aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
AgeCommit message (Collapse)AuthorFilesLines
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.
2017-05-13Update dates in copyright noticesAlbert Krewinkel1-2/+2
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-04-25HTML line block: Use class instead of style attribute.John MacFarlane1-1/+1
We now issue `<div class="line-block">` and include a default definition for `line-block` in the default templates, instead of hard-coding a `style` on the div. Closes #1623.
2017-04-04Add original classes to JS obfuscated links (#3554)Timm Albers1-1/+4
HTML links containing classes originally now preserve them when using javascript email obfuscation. Fixes #2989
2017-04-03Add class to footnote back referencesTimm Albers1-1/+1
The HTML writer now also adds the class footnoteBack to back references of footnotes. This allows for easier CSS styling.
2017-03-30Allow dynamic loading of syntax definitions.John MacFarlane1-3/+4
See #3334. * Add writerSyntaxMap to WriterOptions. * Highlighting: added parameter for SyntaxMap to highlight. * Implemented --syntax-definition option. TODO: [ ] Figure out whether we want to have the xml parsing depend on the dtd (it currently does, and fails unless the language.dtd is found in the same directory). [ ] Add an option to read a KDE syntax highlighting theme as a custom style. [ ] Add tests.
2017-03-13Highlighting: highlighting now returns an Either rather than Maybe.John MacFarlane1-8/+13
This allows us to display error information returned by the skylighting library. Display a warning if the highlighting library throws an error.
2017-03-09HTML writer: info message if 'lang' is unspecified.John MacFarlane1-1/+4
Closes #3486.
2017-03-09HTML writer: fallback to basename rather than Untitled.John MacFarlane1-4/+5
2017-03-04HTML writer: only issue warning for missing title if --standalone.John MacFarlane1-11/+13
2017-03-04HTML writer: Render SmallCaps as span with smallcaps class.John MacFarlane1-1/+1
Rather than using a style attribute directly. This gives the user more flexibility in styling small caps in CSS. See #1592.
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-50/+53
2017-03-04HTML writer: issue warning if no title specified and template used.John MacFarlane1-7/+14
See #3473.
2017-02-23Special-case .stretch class for images in reveal.js.John MacFarlane1-6/+21
Now in reveal.js, an image with class `stretch` in a paragraph by itself will stretch to fill the whole screen, with no caption or figure environment. Closes #1291.
2017-02-20Use lazy loading for reveal.js slide shows.John MacFarlane1-7/+18
* In HTML writer, with reveal.js we use data-src instead of src for images. * In SelfContained, we also load resources from data-src. Closes #2283.
2017-02-11HTML writer: report when not rendering raw inline/block.John MacFarlane1-3/+8
2017-02-03HTML and DocBook writers: fix internal links with writerIdentifierPrefix opt ↵Mauro Bieg1-3/+5
(#3398) closes #3397
2017-01-30`--mathml` and MathML in HTMLMathMethod longer take an argument.John MacFarlane1-6/+2
The argument was for a bridge javascript that used to be necessary in 2004. We have removed the script already.
2017-01-27HTML: export separate functions for slide formats.John MacFarlane1-53/+111
writeS5, writeSlideous, writeRevealJs, writeDZSlides, writeSlidy. Removed writerSlideVariant from WriterOptions.