aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
AgeCommit message (Collapse)AuthorFilesLines
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.
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.