aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/CommonMark.hs
AgeCommit message (Collapse)AuthorFilesLines
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-16Monoid/Semiground cleanup relying on custom Prelude.John MacFarlane1-1/+1
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-12-03commonmark/gfm writer: use raw html for native divs/spans.John MacFarlane1-4/+14
This allows a pandoc markdown native div or span to be rendered in gfm using raw html tags.
2017-12-03commonmark/gfm writer: implement `raw_html` and `raw_tex` extensions.John MacFarlane1-6/+12
Note that `raw_html` is enabled by default for `gfm`, while `raw_tex` is disabled by default.
2017-11-28Support `--webtex` for `gfm` output.John MacFarlane1-6/+16
2017-11-04Fix strikethrough in gfm writer.John MacFarlane1-1/+1
Previously we got a crash, because we were trying to print a native cmark STRIKETHROUGH node, and the commonmark writer in cmark-github doesn't support this. Work around this by using a raw node to add the strikethrough delimiters. Closes #4038.
2017-10-29More hlint.John MacFarlane1-6/+6
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-3/+3
2017-10-26update years in copyrightKolen Cheung1-2/+2
2017-10-13CommonMark writer: omit "fig:" prefix in image titles.John MacFarlane1-0/+3
This is used internally to indicate internal figures. See https://groups.google.com/d/msgid/pandoc-discuss/892c5a25-086a-4e19-b4c1-8 975cea8df0f@googlegroups.com?utm_medium=email&utm_source=footer
2017-08-13CommonMark writer: prefer pipe tables to HTML tables...John MacFarlane1-3/+2
...even if it means losing relative column width information. See #3734.
2017-08-08CommonMark writer: avoid excess blank lines at end of output.John MacFarlane1-1/+1
2017-08-08CommonMark writer: support `hard_line_breaks`, `smart`.John MacFarlane1-8/+15
Add tests.
2017-08-08CommonMark writer: Support pipe tables.John MacFarlane1-16/+75
We bypass the commonmark writer from cmark and construct our own pipe tables, with better results. (Note also that cmark-gfm currently doesn't support rendering table nodes; see kivikakk/cmark-gfm-hs#3.)
2017-08-08CommonMark writer: support table, strikethrough extensions...John MacFarlane1-59/+90
when enabled (as with gfm). Note: because of limitations in cmark-gfm, which will hopefully soon be corrected, this currently gives an error on Tables. Also properly support `--wrap=none`.
2017-08-07Remove GFM modules; use CMarkGFM for both gfm and commonmark.John MacFarlane1-1/+1
We no longer have a separate readGFM and writeGFM; instead, we'll use readCommonMark and writeCommonMark with githubExtensions. It remains to implement these extensions conditionally. Closes #3841.
2017-06-20Writers: adjusted for renderTemplate' changes.John MacFarlane1-3/+3
Now we raise a proper error on template failure.
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-7/+6
* 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-03-04Use smallcaps class for SmallCaps in CommonMark writer.John MacFarlane1-1/+1
See #1592.
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-8/+8
2017-01-25Provide explicit separate functions for HTML 4 and 5.John MacFarlane1-2/+2
* 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-25Revert "Added page breaks into Pandoc."John MacFarlane1-1/+0
This reverts commit f02a12aff638fa2339192231b8f601bffdfe3e14.
2017-01-25Deleted whitespace at end of source lines.John MacFarlane1-1/+1
2017-01-25Convert all writers to use PandocMonad.Jesse Rosenthal1-62/+72
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-11-30Options: Removed writerStandalone, made writerTemplate a Maybe.John MacFarlane1-3/+3
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-10-13Add support for the LineBlock element to writersAlbert Krewinkel1-1/+2
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.
2015-12-29Use cmark 0.5.John MacFarlane1-17/+17
Closes #2605.
2015-12-11Implemented SoftBreak and new `--wrap` option.John MacFarlane1-2/+3
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-08-07Updated readers, writers and README for link attributemb211-1/+1
2015-08-07Updated readers and writers for new image attribute parameter.John MacFarlane1-1/+1
(mb21)
2015-07-14Updated to use cmark >= 0.4.John MacFarlane1-4/+4
2015-07-08Correct superscript/subscript.Andrew Dunning1-3/+3
2015-03-29Added CommonMark writer.John MacFarlane1-0/+178
Added `Text.Pandoc.Writers.CommonMark`, exporting `writeCommonMark`.