aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2017-08-16Update to hslua-0.8.0Albert Krewinkel1-0/+6
hslua no longer provides lua stack instances for Int and Double, the necessary instances are added to the Custom writer and the lua filtering system.
2017-08-15Docx writer: fixed a regression (infinite loop on certain lists).John MacFarlane1-2/+2
Bug was introduced by commit a868b238f253423281b2648896f184e7cdc05014.
2017-08-14Implement multicolumn support for slide formats.John MacFarlane2-3/+28
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-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-13Markdown writer: Use pipe tables if `raw_html` disabled...John MacFarlane1-2/+10
and `pipe_tables` enabled, even if the table has relative width information. Closes #3734.
2017-08-13Added some Functor constraints needed for ghc 7.8.John MacFarlane1-2/+2
2017-08-13Delete Text.Pandoc.Lua.SharedInstancesAlbert Krewinkel1-1/+0
Stack instances for common data types are now provides by hslua. The instance for Either was useful only for a very specific case; the function that was using the `ToLuaStack Either` instance was rewritten to work without it. Closes: #3805
2017-08-13Use hslua >= 0.7, update Lua codeAlbert Krewinkel1-128/+109
2017-08-12Docx writer: pass through comments.John MacFarlane1-8/+47
We assume that comments are defined as parsed by the docx reader: I want <span class="comment-start" id="0" author="Jesse Rosenthal" date="2016-05-09T16:13:00Z">I left a comment.</span>some text to have a comment <span class="comment-end" id="0"></span>on it. We assume also that the id attributes are unique and properly matched between comment-start and comment-end. Closes #2994.
2017-08-12Escape MetaString values (as added with --metadata flag).John MacFarlane1-6/+8
Previously they would be transmitted to the template without any escaping. Note that `--M title='*foo*'` yields a different result from --- title: *foo* --- In the latter case, we have emphasis; in the former case, just a string with literal asterisks (which will be escaped in formats, like Markdown, that require it). Closes #3792.
2017-08-11Added support for translations (localization) (see #3559).John MacFarlane4-7/+7
* readDataFile, readDefaultDataFile, getReferenceDocx, getReferenceODT have been removed from Shared and moved into Class. They are now defined in terms of PandocMonad primitives, rather than being primitve methods of the class. * toLang has been moved from BCP47 to Class. * NoTranslation and CouldNotLoudTranslations have been added to LogMessage. * New module, Text.Pandoc.Translations, exporting Term, Translations, readTranslations. * New functions in Class: translateTerm, setTranslations. Note that nothing is loaded from data files until translateTerm is used; setTranslation just sets the language to be used. * Added two translation data files in data/translations. * LaTeX reader: Support `\setmainlanguage` or `\setdefaultlanguage` (polyglossia) and `\figurename`.
2017-08-10Remove writerUserDataDir from WriterOptions.John MacFarlane1-1/+0
It is now carried in CommonState in PandocMonad instances. (And thus it can be used by readers too.)
2017-08-10Removed datadir param from readDataFile and getDefaultTemplate.John MacFarlane3-5/+3
In Text.Pandoc.Class and Text.Pandoc.Template, resp. We now get the datadir from CommonState.
2017-08-10Expose getDefaultDataFile in both Shared and Class.John MacFarlane1-1/+1
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-08-09RST writer: don't wrap term in definition list.John MacFarlane1-1/+1
Wrapping is not allowed.
2017-08-09EPUB writer: don't strip formatting in TOC.John MacFarlane1-10/+23
Closes #1611.
2017-08-08Muse writer: insert two blanklines between lists of the same type (#3844)Alexander1-1/+23
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-08Writers.Shared.unsmartify: undo literal double curly quotes.John MacFarlane1-0/+3
Previously we left these.
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 MacFarlane2-190/+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-08-07Man writer: removed some unneeded imports.John MacFarlane1-2/+0
2017-08-07Man writer: avoid error for def lists with no definitions.John MacFarlane1-9/+12
Closes #3832.
2017-08-07Added gfm (GitHub-flavored CommonMark) as an input and output format.John MacFarlane1-0/+189
This uses bindings to GitHub's fork of cmark, so it should parse gfm exactly as GitHub does (excepting certain postprocessing steps, involving notifications, emojis, etc.). * Added Text.Pandoc.Readers.GFM (exporting readGFM) * Added Text.Pandoc.Writers.GFM (exporting writeGFM) * Added `gfm` as input and output forma Note that tables are currently always rendered as HTML in the writer; this can be improved when CMarkGFM supports tables in output.
2017-08-06LaTeX writer: Don't use figure inside table cell.John MacFarlane1-2/+4
Closes #3836.
2017-08-02DokuWiki reader: better handling for code block in list item.John MacFarlane1-2/+8
Closes #3824.
2017-07-30Markdown writer: better escaping of `<` and `>`.John MacFarlane1-2/+6
If `all_symbols_escapable` is set, we backslash escape these. Otherwise we use entities as before.
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-07-13Use foldrWithKey instead of deprecated foldWithKey.John MacFarlane1-1/+1
2017-07-12Muse writer: indent lists inside <quote> with at least one space (#3795)Alexander Krotov1-4/+11
2017-06-30Allow ibooks-specific metadata in epubs. Closes #2693.John MacFarlane1-5/+20
You can now have the following fields in your YAML metadata, and it will be treated appropriately in the generated EPUB. ``` ibooks: version: 1.3.4 specified-fonts: false ipad-orientation-lock: portrait-only iphone-orientation-lock: landscape-only binding: true scroll-axis: vertical ``` This commit also fixes a regression in stylesheet paths.
2017-06-30Markdown writer: Ensure that `+` and `-` are escaped properly...John MacFarlane1-0/+3
so they don't cause spurious lists. Previously they were only if succeeded by a space, not if they were at end of line. Closes #3773.
2017-06-28Make `papersize: a4` work regardless of the case of `a4`.John MacFarlane2-0/+9
It is converted to `a4` in LaTeX and `A4` in ConTeXt.
2017-06-28LaTeX writer: fixed detection of otherlangs.John MacFarlane1-3/+3
We weren't recursing into inline contexts. Closes #3770.
2017-06-27Docx writer: Allow 9 list levels.John MacFarlane1-3/+9
Closes #3519.
2017-06-26OpenDocument/ODT writer: Added support for table of contents.John MacFarlane1-0/+1
Closes #2836. Thanks to @anayrat.
2017-06-26Use `table-of-contents` for contents of toc, make `toc` a boolean.John MacFarlane3-6/+18
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-26Muse writer: fix hlint errors (#3764)Alexander Krotov1-17/+13
2017-06-26LaTeX writer: use BCP47 parser.John MacFarlane1-89/+105
2017-06-25BCP47: split toLang from getLang, rearranged types.John MacFarlane3-38/+39
2017-06-25Refactored ConTeXt writer to use BCP47.John MacFarlane1-34/+34
BCP47 - consistent case for BCP47 fields (e.g. uppercase for region).
2017-06-25Moved BCP47 specific functions from Writers.Shared to new module.John MacFarlane4-87/+8
Text.Pandoc.BCP47 (unexported, internal module). `getLang`, `Lang(..)`, `parseBCP47`.
2017-06-25Writers.Shared: improve type of Lang and bcp47 parser.John MacFarlane3-41/+79
Use a real parsec parser for BCP47, include variants.
2017-06-25Writers.Shared: refactored getLang, splitLang...John MacFarlane4-36/+55
into `Lang(..)`, `getLang`, `parceBCP47`.
2017-06-25Fixed support for `lang` attribute in OpenDocument and ODT writers.John MacFarlane1-20/+15
This improves on the last commit, which didn't work in some important ways. See #1667.