aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
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.
2017-06-25Support `lang` attribute in OpenDocument and ODT writers.John MacFarlane3-18/+72
This adds the required attributes to the temporary styles, and also replaces existing language attributes in styles.xml. Support for lang attributes on Div and Span has also been added. Closes #1667.
2017-06-25Text.Pandoc.Writers.Shared: export splitLang.John MacFarlane1-0/+19
2017-06-25Text.Pandoc.Writers.Shared: added getLang.John MacFarlane1-2/+13
2017-06-23Markdown writer: make sure `plain`, `markdown_github`, etc. work for raw.John MacFarlane1-5/+9
Previously only `markdown` worked. Note: currently a raw block labeled `markdown_github` will be printed for any `markdown` format.
2017-06-23HTML writer: make sure html4, html5 formats work for raw blocks/inlines.John MacFarlane1-14/+26
2017-06-22EPUB writer: put title_page.xhtml in text/.John MacFarlane1-2/+2
2017-06-22EPUB writer: Fixed various things with new EPUB structure.John MacFarlane1-6/+6
2017-06-22Added `writerEpubSubdirectory` to `WriterOptions`.John MacFarlane1-8/+8
[API change] The EPUB writer now takes its EPUB subdirectory from this option. Also added `PandocEpubSubdirectoryError` to `PandocError`. This is raised if the EPUB subdirectory is not all ASCII alphanumerics. See #3720.
2017-06-21Change default EPUB directory structure in OCF container.John MacFarlane1-11/+22
See #3720. We now put all EPUB related content in an EPUB/ subdirectory by default (later this will be configurable). mimetype META-INF/ com.apple.ibooks.display-options.xml container.xml EPUB/ <<--configurable-->> fonts/ <<--static-->> font.otf media/ <<--static-->> cover.jpg fig1.jpg styles/ <<--static-->> stylesheet.css content.opf toc.ncx text/ <<--static-->> ch001.xhtml
2017-06-20Writers: adjusted for renderTemplate' changes.John MacFarlane25-47/+51
Now we raise a proper error on template failure.
2017-06-20Removed redundant import.John MacFarlane1-1/+0
2017-06-20Docbook, JATS, TEI writers: print INFO message when omitting interior header.John MacFarlane3-8/+14
This only applies to section headers inside list items, e.g., which were otherwise silently omitted. See #3750.
2017-06-20FB2 writer: don't fail with an error on interior headers (e.g. in list).John MacFarlane1-3/+5
Instead, omit them with an INFO message. Closes #3750.
2017-06-20Fixed footnotes in table captions.John MacFarlane1-16/+18
Note that if the table has a first page header and a continuation page header, the notes will appear only on the first occurrence of the header. Closes #2378.
2017-06-19Text.Pandoc.Writers.Math: export defaultMathJaxURL, defaultKaTeXURL.John MacFarlane1-0/+7
This will ensure that we only need to update these in one place. (Currently, for example, the mathjax URL is used in both App and trypandoc.) Closes #3685.
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 MacFarlane23-24/+24
This gives 20-30% speedup and reduction of memory usage in most of the writers.
2017-06-12Markdown writer: don't allow soft break in header.John MacFarlane1-0/+7
Closes #3736.
2017-06-11Switched Writer types to use Text.John MacFarlane29-149/+211
* 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-10Writers.Shared: metaToJSON, generalized type so it can take a Text.John MacFarlane1-9/+9
Previously a String was needed as argument; now any ToJSON instance will do. API change.
2017-06-03Improve code style in lua and org modulesAlbert Krewinkel1-16/+14
2017-06-02Fixed keywords in docx writer.John MacFarlane1-1/+6
(See #3719)
2017-06-02Add keywords metadata to docx document propertiesIan1-0/+1
Hi, I don't know haskell so possibly this is wrong, but DOCX stores keywords in cp:keywords in core.xml, and this should be easy to add from the pandoc metadata (I copy and paste the author code). As far as I can tell (no clear documentation, just a few refs), keywords should be separated with a comma.
2017-06-01HTML writer: Avoid two class attributes when adding 'uri' class.John MacFarlane1-7/+7
Closes #3716.
2017-06-01Markdown writer: Avoid inline surround-marking with empty content.John MacFarlane1-0/+5
E.g. we don't want `<strong></strong>` to become `****`. Similarly for emphasis, super/subscript, strikeout. Closes #3715.
2017-05-27Markdown writer: changes to `--reference-links`.John MacFarlane1-15/+44
With `--reference-location` of `section` or `block`, pandoc will now repeat references that have been used in earlier sections. The Markdown reader has also been modified, so that *exactly* repeated references do not generate a warning, only references with the same label but different targets. The idea is that, with references after every block, one might want to repeat references sometimes. Closes #3701.
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-25Docx writer: Use Table rather than "Table Normal" for table style.John MacFarlane1-1/+1
"Table Normal" is the default table style and can't be modified. Closes #3275, further testing welcome.
2017-05-23Fixed handling of soft hyphen (0173) in docx writer.John MacFarlane1-7/+19
Closes #3691.
2017-05-23Shared: Provide custom isURI that rejects unknown schemes [isURI]Albert Krewinkel11-16/+8
We also export the set of known `schemes`. The new function replaces the function of the same name from `Network.URI`, as the latter did not check whether a scheme is well-known. E.g. MediaWiki wikis frequently feature pages with names like `User:John`. These links were interpreted as URIs, thus turning internal links into global links. This is prevented by also checking whether the scheme of a URI is frequently used (i.e. is IANA registered or an otherwise well-known scheme). Fixes: #2713 Update set of well-known URIs from IANA list All official IANA schemes (as of 2017-05-22) are included in the set of known schemes. The four non-official schemes doi, isbn, javascript, and pmid are kept.
2017-05-19RST writer: add empty comments when needed...John MacFarlane1-3/+25
to avoid including a blocquote in the indented content of a preceding block. Closes #3675.
2017-05-18Don't render LaTeX images with data: URIs.John MacFarlane1-0/+3
LaTeX can't handle these. Note that --extract-media can be used when the input contains data: URIs. Closes #3636.
2017-05-18Docx writer: Change FigureWithCaption to CaptionedFigure (#3658)Ian1-1/+1
Edit styles.xml as part of the fix for #3656