aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
AgeCommit message (Collapse)AuthorFilesLines
2018-09-30Implement `--ascii` (`writerPreferAscii`) in writers, not App.John MacFarlane1-7/+11
Now the `write*` functions for Docbook, HTML, ICML, JATS, Man, Ms, OPML are sensitive to `writerPreferAscii`. Previously the to-ascii translation was done in Text.Pandoc.App, and thus not available to those using the writer functions directly. In addition, the LaTeX writer is now sensitive to `writerPreferAscii` and to `--ascii`. 100% ASCII output can't be guaranteed, but the writer will use commands like `\"{a}` and `\l` whenever possible, to avoid emiting a non-ASCII character. A new unexported module, Text.Pandoc.Groff, has been added to store functions used in the different groff-based writers.
2018-09-27HTML writer: avoid adding extra section nestings for revealjs.John MacFarlane1-1/+1
Previously revealjs title slides at level (slidelevel - 1) were nested under an extra section element, even when the section contained no additional (vertical) content. That caused problems for some transition effects. See hakimel/reveal.js#1947.
2018-09-27HTML writer: omit unknown attributes in EPUB2 output.John MacFarlane1-8/+140
This allows users to include `epub:type` attributes, which will be passed through to epub3 but not epub2.
2018-09-19Markdown reader: distinguish autolinks in the AST.John MacFarlane1-5/+2
With this change, autolinks are parsed as Links with the `uri` class. (The same is true for bare links, if the `autolink_bare_uris` extension is enabled.) Email autolinks are parsed as Links with the `email` class. This allows the distinction to be represented in the URI. Formerly the `uri` class was added to autolinks by the HTML writer, but it had to guess what was an autolink and could not distinguish `[http://example.com](http://example.com)` from `<http://example.com>`. It also incorrectly recognized `[pandoc](pandoc)` as an autolink. Now the HTML writer simply passes through the `uri` attribute if it is present, but does not add anything. The Textile writer has been modified so that the `uri` class is not explicitly added for autolinks, even if it is present. Closes #4913.
2018-09-11HTML writer: always output <dt> element, even if it is emptyAlexander Krotov1-3/+1
Fixes #4883
2018-08-08HTML writer: Don't prefix epub: attributes with data-.John MacFarlane1-0/+1
2018-06-12reveal.js writer and template: reuse mathjax URL...John MacFarlane1-5/+6
...provided by the argument to `--mathjax` or the normal pandoc default, rather than a hard-coded one in the template. Closes #4701.
2018-05-09Restored and undeprecated gladtex for HTML math.John MacFarlane1-1/+8
- Added `GladTeX` constructor to `Text.Pandoc.Options.HTMLMathMethod` [API change, reverts removal in v2.2] - Restored and undeprecated `--gladtex` option, removed in v2.2. Closes #4607.
2018-05-09Fix regression with tex math environments in HTML + MathJax.John MacFarlane1-11/+5
Closes #4639.
2018-05-07HTML writer: Strip links from headers when creating TOC.John MacFarlane1-4/+12
Otherwise the TOC entries will not link to the sections. Closes #4340.
2018-04-25Removed deprecated ancient HTML math methods.John MacFarlane1-25/+0
Removed `--latexmathml`, `--gladtex`, `--mimetex`, `--jsmath`, `-m`, `--asciimathml` options. Removed `JsMath`, `LaTeXMathML`, and `GladTeX` constructors from `Text.Pandoc.Options.HTMLMathMethod` [API change]. Removed unneeded data file LaTeXMathML.js and updated tests. Bumped version to 2.2.
2018-03-30EPUB writer: add epub:type="footnotes" to notes section in EPUB3.John MacFarlane1-0/+5
Closes #4489.
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane1-0/+2
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-03-17Work around Monoid/Semigroup-related compiler errors GHC 7.10.John MacFarlane1-13/+12
2018-03-16Monoid/Semiground cleanup relying on custom Prelude.John MacFarlane1-1/+0
2018-02-22Presentations: Use divs to set incremental/non-incrementalJesse Rosenthal1-7/+16
Currently, html and beamer presentations use a list-inside-blockquote convention for setting incremental and all-at-once presentation of lists (or reversing the command-line default). This allows the user to set this on a per-case basis with divs, named `incremental` and `nonincremental` respectively, as in: ::: incremental - snap - crackle - pop ::: Note that the former list-inside-blockquote convention still works so as not to break any existing presentations. Closes: #4381
2018-01-19Conditional import to avoid warning.John MacFarlane1-2/+5
2018-01-19hlint code improvements.John MacFarlane1-6/+7
2018-01-09HTML writer: Fixed footnote backlinks with --id-prefix.John MacFarlane1-1/+1
Closes #4235.
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-12-26HTML writer: Use br elements in line blocks...John MacFarlane1-2/+1
instead of relying on CSS. Closes #4162. HTML-based templates have had the custom CSS for div.line-block removed. Those maintaining custom templates will want to remove this too. We still enclose line blocks in a div with class line-block.
2017-12-04Add `empty_paragraphs` extension.John MacFarlane1-5/+9
* Deprecate `--strip-empty-paragraphs` option. Instead we now use an `empty_paragraphs` extension that can be enabled on the reader or writer. By default, disabled. * Add `Ext_empty_paragraphs` constructor to `Extension`. * Revert "Docx reader: don't strip out empty paragraphs." This reverts commit d6c58eb836f033a48955796de4d9ffb3b30e297b. * Implement `empty_paragraphs` extension in docx reader and writer, opendocument writer, html reader and writer. * Add tests for `empty_paragraphs` extension.
2017-12-03Removed unnecessary import.John MacFarlane1-1/+1
2017-12-03HTML writer: export tagWithAttributes.John MacFarlane1-2/+19
This is a helper allowing other writers to create single HTML tags.
2017-11-02Improved support for columns in HTML.John MacFarlane1-5/+2
* Move as much as possible to the CSS in the template. * Ensure that all the HTML-based templates (including epub) contain the CSS for columns. * Columns default to 50% width unless they are given a width attribute. Closes #4028.
2017-11-02Use latest skylighting; ensure no duplicate ids on code lines.John MacFarlane1-3/+11
The line identifiers are built using the code block's identifier as a prefix. If the code block has null identifier, we use "cb1", "cb2", etc. Closes #4031.
2017-11-02Fixed revealjs slide column width issues.John MacFarlane1-2/+7
* Remove "width" attribute which is not allowed on div. * Remove space between `<div class="column">` elements, since this prevents columns whose widths sum to 100% (the space takes up space). Closes #4028.
2017-10-31HTML Writer: consistently use dashed class-namesmb211-3/+3
see #3556
2017-10-29Source code reformatting.John MacFarlane1-2/+2
2017-10-29hlint suggestions.John MacFarlane1-51/+50
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-8/+8
2017-10-16HTML writer: don't add data- prefix to unknown attributes beginning with data-.John MacFarlane1-0/+1
Or we'll get data-data-blah.
2017-10-05KaTeX fixes:John MacFarlane1-19/+15
* In Options.HTMLMathMethod, the KaTeX contsructor now takes only one string (for the KaTeX base URL), rather than two [API change]. * The default URL has been updated to the latest version. * The autoload script is now loaded by default.
2017-08-29Add a type sig to satisfy ghc 7.10.3.John MacFarlane1-0/+1
2017-08-28HTML writer: ensure we don't get two style attributes for width & height.John MacFarlane1-2/+8
2017-08-17slidy uses https instead of http (#3848)ickc1-1/+1
grep -rl 'http://www.w3.org/Talks/Tools/Slidy2' . | xargs sed -i 's/http:\/\/www\.w3\.org\/Talks\/Tools\/Slidy2/https:\/\/www\.w3\.org\/Talks\/Tools\/Slidy2/g'
2017-08-14Implement multicolumn support for slide formats.John MacFarlane1-1/+7
The structure expected is: <div class="columns"> <div class="column" width="40%"> contents... </div> <div class="column" width="60%"> contents... </div> </div> Support has been added for beamer and all HTML slide formats. Closes #1710. Note: later we could add a more elegant way to create this structure in Markdown than to use raw HTML div elements. This would come for free with a "native div syntax" (#168). Or we could devise something specific to slides
2017-08-10Slidy writer: use h1 for all slides...John MacFarlane1-1/+5
even if they were originally level 2 headers. Otherwise the built-in table of contents in Slidy breaks. Closes #3566.
2017-07-26Sorted the list of supported HTML5 attributes and removed duplicates. (#3817)Wandmalfarbe1-80/+46
2017-07-26HTML writer: render raw inline environments when --mathjax used.John MacFarlane1-3/+8
We previously did this only with raw blocks, on the assumption that math environments would always be raw blocks. This has changed since we now parse them as inline environments. Closes #3816.
2017-07-25HTML writer: insert data- in front of unsupported attributes.John MacFarlane1-48/+309
Thus, a span with attribute 'foo' gets written to HTML5 with 'data-foo', so it is valid HTML5. HTML4 is not affected. This will allow us to use custom attributes in pandoc without producing invalid HTML.
2017-06-26Use `table-of-contents` for contents of toc, make `toc` a boolean.John MacFarlane1-2/+6
Changed markdown, rtf, and HTML-based templates accordingly. This allows you to set `toc: true` in the metadata; this previously produced strange results in some output formats. Closes #2872. For backwards compatibility, `toc` is still set to the toc contents. But it is recommended that you update templates to use `table-of-contents` for the toc contents and `toc` for a boolean flag.
2017-06-23HTML writer: make sure html4, html5 formats work for raw blocks/inlines.John MacFarlane1-14/+26
2017-06-20Writers: adjusted for renderTemplate' changes.John MacFarlane1-1/+1
Now we raise a proper error on template failure.
2017-06-18Use revealjs's math plugin for mathjax.John MacFarlane1-1/+7
This is a thin wrapper around mathjax that makes math look better on revealjs. See https://github.com/hakimel/reveal.js/#mathjax We do this by setting the 'mathjax' boolean variable and using it in the revealjs template. Also, for revealjs and mathjax, we don't assign the usual thing to the 'math' variable, since it's handled by mathjax config. Closes #3743.
2017-06-17Use Control.Monad.State.Strict throughout.John MacFarlane1-1/+1
This gives 20-30% speedup and reduction of memory usage in most of the writers.
2017-06-11Switched Writer types to use Text.John MacFarlane1-22/+28
* XML.toEntities: changed type to Text -> Text. * Shared.tabFilter -- fixed so it strips out CRs as before. * Modified writers to take Text. * Updated tests, benchmarks, trypandoc. [API change] Closes #3731.
2017-06-01HTML writer: Avoid two class attributes when adding 'uri' class.John MacFarlane1-7/+7
Closes #3716.
2017-05-26HTML writer: Removed unused parameter in dimensionsToAttributeList.John MacFarlane1-3/+3
2017-05-25Allow em for image height/width in HTML, LaTeX.John MacFarlane1-4/+3
- Export `inEm` from ImageSize [API change]. - Change `showFl` and `show` instance for `Dimension` so extra decimal places are omitted. - Added `Em` as a constructor of `Dimension` [API change]. - Allow `em`, `cm`, `in` to pass through without conversion in HTML, LaTeX. Closes #3450.