aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2019-10-14change indentation of math part in Writers/HTML.hsmb211-33/+44
2019-10-14KaTeX math: respect classoption=fleqn variablemb211-2/+6
closes #5815
2019-10-12LaTeX writer: fix horizontal rule.John MacFarlane1-1/+1
We change to use 0.5pt rather than `\linethickness`, which apparently only ever worked "by accident" and no longer works with recent updates to texlive. Closes #5801.
2019-10-11Markdown writer: prefer pipe_tables to raw html...John MacFarlane1-3/+3
...even when we must lose width information. All in all this seems to be people's preferred behavior, even though it is slightly lossier. Closes #2608. Closes #4497.
2019-10-10Improve parsing of --defaults.John MacFarlane1-5/+1
- Add FromYAML instances to Opt and to all subsidiary types. - Remove the use of HsYAML-aeson, which doesn't give good position information on errors. - Rename some fields in Opt to better match cli options or reflect what the ycontain [API change]: + optMetadataFile -> optMetadataFiles + optPDFEngineArgs -> optPDFEngineOpts + optWrapText -> optWrap - Add IpynbOutput enumerated type to Text.Pandoc.App.Opts. Use this instead fo a string for optIpynbOutput. - Add FromYAML instance for Filter in Text.Pandoc.Filters. With these changes parsing of defaults files should be complete and should give decent error messages. Now (unlike before) we get an error if an unknown field is used.
2019-10-10Make some writers sensitive to 'unlisted' class on headings.John MacFarlane2-7/+10
If this is present on a heading with the 'unnumbered' class, the heading won't appear in the TOC. This class has no effect if 'unnumbered' is not also specified. This affects HTML-based writers (including slide shows and epub), LateX (including beamer), RTF, and PowerPoint. Other writers do not yet support `unlisted`. Closes #1762.
2019-10-09RST writer: proper handling of :align: on figures, images.John MacFarlane1-6/+12
When the image has the `align-right` (etc.) class, we now use an `:align:` attribute. Closes #4420.
2019-10-09Basic changes for MathJax 3.zorkow1-1/+1
2019-10-09Options.WriterOptions: Change type of writerVariables to Context Text.John MacFarlane5-45/+80
This will allow structured values. [API change]
2019-10-04hlint Muse writerAlexander Krotov1-1/+1
2019-09-28More throwError in place of fail.John MacFarlane2-1/+3
2019-09-28Replace some more fails with throwErrors.John MacFarlane3-4/+9
2019-09-28Use throwError instead of fail when appropriate.John MacFarlane2-4/+11
2019-09-28Use Prelude.fail to avoid ambiguity with fail from GHC.Base.John MacFarlane5-8/+8
2019-09-24odt: Add external option for native numberingNils Carlson1-7/+7
This adds an external options +native_numbering to the ODT writer enabling enumeration of figures and tables in ODT output.
2019-09-23Man writer: suppress non-absolute link URLs.John MacFarlane1-3/+3
Motivation: in a man page there's not much use for relative URLs, which you can't follow. Absolute URLs are still useful. We previously suppressed relative URLs starting with '#' (purely internal links), but it makes sense to go a bit farther. Closes #5770.
2019-09-22[Docx Writer] Re-use Readers.Docx.Parse for StyleMap (#5766)Nikolay Yakimov2-31/+78
* [Docx Parser] Move style-parsing-specific code to a new module * [Docx Writer] Re-use Readers.Docx.Parse.Styles for StyleMap * [Docx Writer] Move Readers.Docx.StyleMap to Writers.Docx.StyleMap It's never used outside of writer code, so it makes more sense to scope it under writers really.
2019-09-22Make `plain` output plainer.John MacFarlane1-5/+16
Previously we used the following Project Gutenberg conventions for plain output: - extra space before and after level 1 and 2 headings - all-caps for strong emphasis `LIKE THIS` - underscores surrounding regular emphasis `_like this_` This commit makes `plain` output plainer. Strong and Emph inlines are rendered without special formatting. Headings are also rendered without special formatting, and with only one blank line following. To restore the former behavior, use `-t plain+gutenberg`. API change: Add `Ext_gutenberg` constructor to `Extension`. See #5741.
2019-09-21[Docx Writer] Consistently use style names, not style idsNikolay Yakimov1-27/+25
Styles that this change affects: paragraph styles: Author, Abstract, Compact, Figure, Captioned Figure, Image Caption, First Paragraph, Source Code, Table Caption, Definition, Definition Term; character styles: Verbatim Char, token styles (those with names ending in Tok)
2019-09-21[Docx Writer] Code clean-upNikolay Yakimov1-40/+37
Reduce code duplication, remove redundant brackets
2019-09-20Preserve built-in styles in DOCX with custom style (#5670)Ben Steinberg1-22/+55
This commit prevents custom styles on divs and spans from overriding styles on certain elements inside them, like headings, blockquotes, and links. On those elements, the "native" style is required for the element to display correctly. This change also allows nesting of custom styles; in order to do so, it removes the default "Compact" style applied to Plain blocks, except when inside a table.
2019-09-20Bug fixes to EPUB chapter splitting.John MacFarlane1-15/+16
2019-09-19EPUB writer: make --epub-chapter-level work again.John MacFarlane1-19/+15
It was temporarily broken by the latest change to chapter splitting code.
2019-09-19EPUB writer: improve splitting into chapters.John MacFarlane1-36/+23
+ Use makeSection from T.P.Shared. This deals better with embedded divs. (Closes #5761.) + Remove chapter-title class from chapter h1, for now. (Reverts one change made earlier; we may revisit this in light of #5749.) + Avoid issuing warning multiple times when title not set (see #5760).
2019-09-19Remove admonition-title remnants.John MacFarlane1-1/+1
Completes 8e01ccb41dde8a5e6123f5b0746c36f240576047
2019-09-18LaTeX writer: use `\hspace{0pt}` for 0-width space U+200B.John MacFarlane1-0/+1
Closes #5756.
2019-09-14Add chapter-title class to EPUB chapter title h1 elements.John MacFarlane1-3/+5
See #5269.
2019-09-14EPUB toChapters: don't treat "refs" Div specially.John MacFarlane1-1/+1
This should make toChapters work better if there are Divs around sections.
2019-09-08Replace Element and makeHierarchical with makeSections.John MacFarlane12-462/+387
Text.Pandoc.Shared: + Remove `Element` type [API change] + Remove `makeHierarchicalize` [API change] + Add `makeSections` [API change] + Export `deLink` [API change] Now that we have Divs, we can use them to represent the structure of sections, and we don't need a special Element type. `makeSections` reorganizes a block list, adding Divs with class `section` around sections, and adding numbering if needed. This change also fixes some longstanding issues recognizing section structure when the document contains Divs. Closes #3057, see also #997. All writers have been changed to use `makeSections`. Note that in the process we have reverted the change c1d058aeb1c6a331a2cc22786ffaab17f7118ccd made in response to #5168, which I'm not completely sure was a good idea. Lua modules have also been adjusted accordingly. Existing lua filters that use `hierarchicalize` will need to be rewritten to use `make_sections`.
2019-09-04asciidoc writer: don't include `+` in code blocks for regular asciidoc.John MacFarlane1-2/+7
This is asciidoctor-specific. Amends 98ee6ca289ad7117b7336a57bcfc6f4b54463f4e.
2019-09-02LaTeX writer: use `cslreferences` environment for csl bibliographies.John MacFarlane1-3/+18
this allows bibliographies to receive special formatting. The template now contains definition of this environment (enabled only when CSL is used). It also defines a `\cslhangindent` length. This is set to 2em by default when the bibliography style specifies a hanging indent. To override the length, you can use e.g. \setlength{\cslhangindent}{7em} in header-includes. Closes jgm/pandoc-citeproc#410.
2019-09-02HTML writer: use numeric character references with `--ascii`.John MacFarlane1-6/+2
Previously we used named character references with html5 output. But these aren't valid XML, and we aim to produce html5 that is also valid XHTML (polyglot markup). (This is also needed for epub3.) Closes #5718.
2019-09-02LaTeX writer: strip off `{}` around locator for biblatex/natbib output.John MacFarlane1-1/+7
Closes #5722.
2019-08-27PowerPoint writer: Start numbering at appopriate numbers.Jesse Rosenthal1-4/+8
Starting numbers for ordered lists were previously ignored. Now we specify the number if it is something other than 1. Closes: #5709
2019-08-25Use new doctemplates, doclayout.John MacFarlane31-786/+808
+ Remove Text.Pandoc.Pretty; use doclayout instead. [API change] + Text.Pandoc.Writers.Shared: remove metaToJSON, metaToJSON' [API change]. + Text.Pandoc.Writers.Shared: modify `addVariablesToContext`, `defField`, `setField`, `getField`, `resetField` to work with Context rather than JSON values. [API change] + Text.Pandoc.Writers.Shared: export new function `endsWithPlain` [API change]. + Use new templates and doclayout in writers. + Use Doc-based templates in all writers. + Adjust three tests for minor template rendering differences. + Added indentation to body in docbook4, docbook5 templates. The main impact of this change is better reflowing of content interpolated into templates. Previously, interpolated variables were rendered independently and intepolated as strings, which could lead to overly long lines. Now the templates interpolated as Doc values which may include breaking spaces, and reflowing occurs after template interpolation rather than before.
2019-08-23Asciidoc writer: handle admonitions.John MacFarlane1-3/+22
Closes #5690.
2019-08-23Ensure proper nesting when we have long ordered list markers.John MacFarlane1-2/+5
Closes #5705.
2019-08-23add proofState to settingsList (#5703)Krystof Beuermann1-0/+1
2019-08-14Add thin space when needed in LaTeX quote ligatures.John MacFarlane1-4/+9
Closes #5685.
2019-08-13Fix multiline table for XWiki writer (#5683)Zihang Chen1-2/+4
Details at https://groups.google.com/forum/#!topic/pandoc-discuss/c861tTdCFTg Fix XWiki output for ``` +----------+----------+ | Col A | Col B | +==========+==========+ | Row A | * Item A | | | * Item B | +----------+----------+ ``` from (notice that the following XWiki code renders as a table followed by a singleton list) ``` |=Col A|=Col B |Row A|*. Item A *. Item B ``` to ``` |=Col A|=Col B |Row A|(((*. Item A *. Item B ))) ```
2019-08-11JIRA writer: Remove escapeStringForJira for code blocksJan-Otto Kröpke1-2/+2
2019-07-30Markdown writer: Don't assume Doc has Eq instance.John MacFarlane1-11/+13
It won't in a future version.
2019-07-30ConTeXt writer; don't use `== empty` with `Doc`, use `isEmpty`.John MacFarlane1-5/+5
2019-07-28Use doctemplates 0.3, change type of writerTemplate.John MacFarlane26-163/+144
* Require recent doctemplates. It is more flexible and supports partials. * Changed type of writerTemplate to Maybe Template instead of Maybe String. * Remove code from the LaTeX, Docbook, and JATS writers that looked in the template for strings to determine whether it is a book or an article, or whether csquotes is used. This was always kludgy and unreliable. To use csquotes for LaTeX, set `csquotes` in your variables or metadata. It is no longer sufficient to put `\usepackage{csquotes}` in your template or header includes. To specify a book style, use the `documentclass` variable or `--top-level-division`. * Change template code to use new API for doctemplates.
2019-07-24HTML writer: ensure TeX formulas are rendered correctly (#5658)Philip Pesca1-1/+1
The web service passed in to `--webtex` may render formulas using inline or display style by default. Prefixing formulas with the appropriate command ensures they are rendered correctly. This is a followup to the discussion in #5656.
2019-07-23Templates: Change type of renderTemplate'.John MacFarlane3-11/+10
Return value is now Text rather than being polymorphic. This makes room for upcoming removal of the TemplateTarget class from doctemplates. Other code modified accordingly, and should compile with both current and upcoming version of doctemplates.
2019-07-23HTML writer: render inline formulas correctly with --webtex (#5656)Philip Pesca1-1/+4
We add `\textstyle` to the beginning of the formula to ensure it will be rendered in inline style. Closes #5655.
2019-07-20LaTeX writer: fix line breaks at start of paragraph.John MacFarlane1-9/+9
Previously we just omitted these. Now we render them using `\hfill\break` instead of `\\`. This is a revision of a PR by @sabine (#5591) who should be credited with the idea. Closes #3324.
2019-07-19Change order of ilvl and numId in document.xml (#5647)Agustín Martín Barbero1-3/+3
Workaround for Word Online shortcomming. Fixes #5645 Also, make list para properties go first. This reordering of properties shouldn't be necessary but it seems Word Online does not understand the docx correctly otherwise.
2019-07-18Markdown writer: prefer using raw_attribute when enabled.John MacFarlane1-2/+2
The `raw_attribute` will be used to mark raw bits, even HTML and LaTeX, and even when `raw_html` and `raw_tex` are enabled, as they are by default. To get the old behavior, disable `raw_attribute` in the writer. Closes #4311.