aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
AgeCommit message (Collapse)AuthorFilesLines
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.
2017-01-27HTML writer: export writeHtmlStringForEPUB.John MacFarlane1-6/+26
Options: Remove writerEPUBVersion.
2017-01-25Provide explicit separate functions for HTML 4 and 5.John MacFarlane1-43/+74
* Text.Pandoc.Writers.HTML: removed writeHtml, writeHtmlString, added writeHtml4, writeHtml4String, writeHtml5, writeHtml5String. * Removed writerHtml5 from WriterOptions. * Renamed default.html template to default.html4. * "html" now aliases to "html5"; to get the old HTML4 behavior, you must now specify "-t html4".
2017-01-25Removed writerHighlight; made writerHighlightStyle a Maybe.John MacFarlane1-7/+12
API change. For no highlighting, set writerHighlightStyle to Nothing.
2017-01-25Revert "Added page breaks into Pandoc."John MacFarlane1-1/+0
This reverts commit f02a12aff638fa2339192231b8f601bffdfe3e14.
2017-01-25Removed writerIgnoreNotes.John MacFarlane1-6/+4
Instead, just temporarily remove notes when generating TOC lists in HTML and Markdown (as we already did in LaTeX). Also export deNote from Text.Pandoc.Shared. API change in Shared and Options.WriterOptions.
2017-01-25Refactored math conversion in writers.John MacFarlane1-9/+6
* Remove exported module `Text.Pandoc.Readers.TeXMath` * Add exported module `Text.Pandoc.Writers.Math` * The function `texMathToInlines` now lives in `Text.Pandoc.Writers.Math` * Export helper function `convertMath` from `Text.Pandoc.Writers.Math` * Use these functions in all writers that do math conversion. This ensures that warnings will always be issued for failed math conversions.
2017-01-25Fix rebasing errors.Jesse Rosenthal1-1/+1
2017-01-25Unify Errors.Jesse Rosenthal1-1/+2
2017-01-25Implement Errors in PandocMonadJesse Rosenthal1-32/+38
Errors can be thrown purely with `throwError`. At the moment there are only three kinds of errors: 1. PandocFileReadError FilePath (for problems reading a file from the filesystem) 2. PandocShouldNeverHappenError String (for stuff that should never happen but we need to pattern-match anyway) 3. PandocSomeError String (a grab bag of everything else) Of course, we need to subdivide the third item in this list.
2017-01-25Convert all writers to use PandocMonad.Jesse Rosenthal1-4/+5
Since PandocMonad is an instance of MonadError, this will allow us, in a future commit, to change all invocations of `error` to `throwError`, which will be preferable for the pure versions. At the moment, we're disabling the lua custom writers (this is temporary). This requires changing the type of the Writer in Text.Pandoc. Right now, we run `runIOorExplode` in pandoc.hs, to make the conversion easier. We can switch it to the safer `runIO` in the future. Note that this required a change to Text.Pandoc.PDF as well. Since running an external program is necessarily IO, we can be clearer about using PandocIO.
2017-01-25Adds support for pagebreaks (when it makes sense)Hubert Plociniczak1-0/+1
Update all writers to take into account page breaks. A straightforwad, far from complete, implementation of page breaks in selected writers. Readers will have to follow in the future as well.
2016-12-24HTML writer: don't process pars with empty RawInline, fixes #1040 (#3327)Mauro Bieg1-3/+8
2016-11-30Options: Removed writerStandalone, made writerTemplate a Maybe.John MacFarlane1-14/+8
Previously setting writerStandalone = True did nothing unless a template was provided in writerTemplate. Now a fragment will be generated if writerTemplate is Nothing; otherwise, the specified template will be used and standalone output generated. [API change]
2016-11-27Updated renderHtml import in HTML writer to avoid deprecated function.John MacFarlane1-2/+1
2016-10-25reveal.js: don't change slide title to level 1 header.John MacFarlane1-3/+1
This also affects other HTML slide show formats. Closes #2221.
2016-10-13Add support for the LineBlock element to writersAlbert Krewinkel1-1/+8
The following markup features are used to output the lines of the `LineBlock` element: - AsciiDoc: a `[verse]` block, - ConTeXt: text surrounded by `\startlines` and `\endlines`, - HTML: `div` with an per-element style setting to interpret the content as pre-wrapped, - Markdown: line blocks if the `line_blocks` extension is enabled, a simple paragraph with hard linebreaks otherwise, - Org: VERSE block, - RST: a line block, and - all other formats: a paragraph, containing hard linebreaks between lines. Custom lua writers should be updated to use the `LineBlock` element.
2016-09-02Remove Compat.MonoidJesse Rosenthal1-1/+1
This was only necessary for GHC versions with base below 4.5 (i.e., ghc < 7.4).
2016-06-22HTML writer: Better support for raw LaTeX environments.John MacFarlane1-12/+41
Previously we just passed all raw TeX through when MathJax was used for HTML math. This passed through too much. With this patch, only raw LaTeX environments that MathJax can handle get passed through. This patch also causes raw LaTeX environments to be treated as math, when possible, with MathML and WebTeX output. Closes #2758.
2016-04-29HTML writer: ensure mathjax link is added when math appears in footnote.John MacFarlane1-3/+2
Previously if a document only had math in a footnote, the MathJax link would not be added. Closes #2881.
2016-02-03HTML writer: don't include alignment attribute for default table columns.John MacFarlane1-2/+5
Previously these were given "left" alignment. Better to leave off alignment attributes altogether. Closes #2694.
2016-01-14HTML writer: harmless code simplification.John MacFarlane1-34/+32
Since the 'math' is only put into the template if stMath is set anyway, there's no need for this conditional.
2015-12-11Implemented SoftBreak and new `--wrap` option.John MacFarlane1-3/+7
Added threefold wrapping option. * Command line option: deprecated `--no-wrap`, added `--wrap=[auto|none|preserve]` * Added WrapOption, exported from Text.Pandoc.Options * Changed type of writerWrapText in WriterOptions from Bool to WrapOption. * Modified Text.Pandoc.Shared functions for SoftBreak. * Supported SoftBreak in writers. * Updated tests. * Updated README. Closes #1701.
2015-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane1-20/+47
mb21-new-image-attributes * Bumped version to 1.16. * Added Attr field to Link and Image. * Added `common_link_attributes` extension. * Updated readers for link attributes. * Updated writers for link attributes. * Updated tests * Updated stack.yaml to build against unreleased versions of pandoc-types and texmath. * Fixed various compiler warnings. Closes #261. TODO: * Relative (percentage) image widths in docx writer. * ODT/OpenDocument writer (untested, same issue about percentage widths). * Update pandoc-citeproc.