aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2018-10-03OpenDocument writer: make 'Figure' term sensitive to `lang` in metadata.John MacFarlane1-9/+16
We use the new translations API.
2018-10-03Text.Pandoc.Writers.Shared: added `metaValueToString`.John MacFarlane1-0/+9
[API change]
2018-10-03OpenDocument writer: Implement figure numbering in captions (#4944)Nils Carlson1-1/+13
Figure captions are now numbered 1, 2, 3, ... The format in the caption is "Figure 1: <caption>" and so on. This is necessary in order for libreoffice to generate an Illustration Index (Table of Figures) for included figures.
2018-10-02Removed Text.Pandoc.Groff.John MacFarlane3-2/+11
Moved groffEscape function to Text.Pandoc.Writers.Shared. [API change, since T.P.W.S is exported.]
2018-10-02OpenDocument writer: improve bullet/numbering alignment.John MacFarlane1-4/+12
This patch eliminates the large gap we used to have between bullet and text, and also ensures that numbers in numbered lists will be right-aligned. Closes #4385.
2018-10-01Shared: new export `splitSentences` [API change].John MacFarlane2-52/+0
This was duplicated in the Man and Ms writers, and really belongs in Shared.
2018-10-01Lua filters: report traceback when an error occursAlbert Krewinkel1-2/+2
A proper Lua traceback is added if either loading of a file or execution of a filter function fails. This should be of help to authors of Lua filters who need to debug their code.
2018-09-30Implement `--ascii` (`writerPreferAscii`) in writers, not App.John MacFarlane8-54/+132
Now the `write*` functions for Docbook, HTML, ICML, JATS, Man, Ms, OPML are sensitive to `writerPreferAscii`. Previously the to-ascii translation was done in Text.Pandoc.App, and thus not available to those using the writer functions directly. In addition, the LaTeX writer is now sensitive to `writerPreferAscii` and to `--ascii`. 100% ASCII output can't be guaranteed, but the writer will use commands like `\"{a}` and `\l` whenever possible, to avoid emiting a non-ASCII character. A new unexported module, Text.Pandoc.Groff, has been added to store functions used in the different groff-based writers.
2018-09-29LaTeX writer: Fix description lists contining highlighted code.John MacFarlane1-2/+4
Closes #4662.
2018-09-27HTML writer: avoid adding extra section nestings for revealjs.John MacFarlane1-1/+1
Previously revealjs title slides at level (slidelevel - 1) were nested under an extra section element, even when the section contained no additional (vertical) content. That caused problems for some transition effects. See hakimel/reveal.js#1947.
2018-09-27JATS writer: remove 'role' attribute on 'bold' and 'sc' elements.John MacFarlane1-3/+2
The JATS spec does not allow these. Closes #4937.
2018-09-27HTML writer: omit unknown attributes in EPUB2 output.John MacFarlane1-8/+140
This allows users to include `epub:type` attributes, which will be passed through to epub3 but not epub2.
2018-09-24Use hslua v1.0.0Albert Krewinkel1-69/+74
2018-09-24Merge pull request #4921 from pyssling/masterJohn MacFarlane1-13/+21
ODT Writer: Improve table header row style handling
2018-09-24RTF writer: Fix build failure with ghc-8.6.1 caused by missing MonadFail ↵Jonas Scholl1-2/+4
instance.
2018-09-23ODT Writer: Improve table header row style handlingNils Carlson1-13/+21
This changes the way styles for cells in the header row and normal rows are handled in ODT tables. Previously a new (but identical) style was generated for every table, specifying the style of the cells within the table. After this change there are two style definitions for table cells, one for the cells in the header row, one for all other cells. This doesn't change the actual styles, but makes post-processing changes to the table styles much simpler as it is no longer necessary to introduce new styles for header rows and there are now only two styles where there was previously one per table.
2018-09-22LaTeX writer: fix a use of `last` that might take empty list.John MacFarlane1-3/+3
If you ran with `--biblatex` and have an empty document (metadata but no blocks), pandoc would previously raise an error because of the use of `last` on an empty list.
2018-09-20Fix compiler warning.John MacFarlane1-1/+1
2018-09-20ConTeXt writer: change `\` to `/` in Windows image paths.John MacFarlane1-1/+6
We do this in the LaTeX writer, and it avoids problems. Note that `/` works as a LaTeX path separator on Windows. Closes #4918.
2018-09-19Markdown reader: distinguish autolinks in the AST.John MacFarlane2-8/+5
With this change, autolinks are parsed as Links with the `uri` class. (The same is true for bare links, if the `autolink_bare_uris` extension is enabled.) Email autolinks are parsed as Links with the `email` class. This allows the distinction to be represented in the URI. Formerly the `uri` class was added to autolinks by the HTML writer, but it had to guess what was an autolink and could not distinguish `[http://example.com](http://example.com)` from `<http://example.com>`. It also incorrectly recognized `[pandoc](pandoc)` as an autolink. Now the HTML writer simply passes through the `uri` attribute if it is present, but does not add anything. The Textile writer has been modified so that the `uri` class is not explicitly added for autolinks, even if it is present. Closes #4913.
2018-09-16Muse writer: replace newlines in strings with spacesAlexander Krotov1-1/+7
2018-09-16Muse writer: output headers without asterisks if not on the top levelAlexander Krotov1-2/+3
2018-09-15Docx writer: add MetaString case for abstract, subtitle (#4905)Mauro Bieg1-0/+2
fixes #4900
2018-09-12Muse writer: never wrap definition list termsAlexander Krotov1-1/+1
2018-09-11Muse writer: set envInsideBlock = True when rendering notesAlexander Krotov1-1/+2
2018-09-11HTML writer: always output <dt> element, even if it is emptyAlexander Krotov1-3/+1
Fixes #4883
2018-09-11Muse writer: use "" instead of [] for empty StringAlexander Krotov1-1/+1
2018-09-11Muse writer: check for whitespace in the beginning and end of Str'sAlexander Krotov1-0/+2
2018-09-11Muse writer: escape -, ; and > in the beginning of stringsAlexander Krotov1-3/+6
2018-09-11Muse writer: escape list markers in the beginning of notesAlexander Krotov1-1/+4
2018-09-11Muse writer: normalize inline list before testing if tags should be usedAlexander Krotov1-19/+18
2018-09-11Muse writer: use tags instead of lightweight markup for empty stringsAlexander Krotov1-4/+9
2018-09-09Org writer: don't escape literal `_`, `^`.John MacFarlane1-1/+1
Org doesn't recognize these escapes. Closes #4882.
2018-09-07Fix percentage image scaling in ODT (#4881)Nils Carlson2-2/+4
Image scaling in ODT was broken when a width was set to a percentage. The width was passed to the svg:width field as a pecentage, which is not correct according to the ODT standard. Instead the real dimensions should be passed as width and height and the style:rel-width attribute should be set to the percentage while style:rel-heigh attribute should be set to "scale". The converse is true if a percentage height is given. This is now fixed and documents produced are now properly scaled.
2018-09-04hlint some writersAlexander Krotov9-25/+21
2018-09-02Muse writer: hlintAlexander Krotov1-4/+4
2018-09-02Muse writer: use lightweight markup when possibleAlexander Krotov1-19/+123
2018-09-02Muse writer: add more commentsAlexander Krotov1-2/+2
2018-09-02Muse writer: escape empty stringsAlexander Krotov1-1/+2
This guarantees that conditionalEscapeString never returns empty string.
2018-09-01Muse writer: wrap conditionalEscapeString result into "Muse" typeAlexander Krotov1-22/+28
This removes the need to pass envInsideLinkDescription to it.
2018-09-01Muse writer: separate "shouldEscapeString" functionAlexander Krotov1-6/+11
2018-08-31Muse writer: simplify inline list renderingAlexander Krotov1-15/+12
2018-08-28EPUB writer: set epub:type on body element intelligently.John MacFarlane1-6/+22
epub:type of first section epub:type of body -------------------------- ------------------ prologue frontmatter abstract frontmatter acknowledgments frontmatter copyright-page frontmatter dedication frontmatter foreword frontmatter halftitle, frontmatter introduction frontmatter preface frontmatter seriespage frontmatter titlepage frontmatter afterword backmatter appendix backmatter colophon backmatter conclusion backmatter epigraph backmatter Otherwise body will have epub:type 'bodymatter'. This only affects epub3. See http://www.idpf.org/epub/profiles/edu/structure/#h.l0bzsloklt10 Closes #4823.
2018-08-24FB2 writer: put coverpage element between title and date...John MacFarlane1-2/+3
...rather than in document-info element. Closes #4854.
2018-08-19Markdown writer: escape `~` if strikeout extension enabled.John MacFarlane1-1/+2
See #4840.
2018-08-17Docx writer: properly handle display math in spans.John MacFarlane2-6/+10
Closes #4826. This isn't a complete solution, since other nestings of display math may still cause problems, but it should work for what is by far the most common case. Note that this also involves an API change: `isDisplayMath` is now exported from Text.Pandoc.Writers.Shared.
2018-08-17Haddock Writer: Use proper format for latex math in haddock (#4571).Joe Hermaszewski1-6/+4
Inline math in `\(..\)`, display math in `\[..\]`, tex is now used. Previously we'd "fake it with unicode" and fall back to tex when that didn't work. But as of https://github.com/haskell/haddock/commit/3f50b955324bd4b42f88a421f0203bc46a3ccf64 haddock supports latex math.
2018-08-16TEI improvements.John MacFarlane1-14/+1
- Ensure that title element is always present, even if empty. - Put author tags in the template, rather than adding them in the writer. Closes #4839.
2018-08-16LaTeX writer/template: be sensitive to `filecolor` variable.John MacFarlane1-1/+2
`linkcolor` only affects internal links, and `urlcolor` only affects linked URLs. For external links, the option to use is `filecolor`. Closes #4822.
2018-08-15Markdown reader: Use "tex" instead of "latex" for raw tex-ish content.John MacFarlane2-9/+7
We can't always tell if it's LaTeX, ConTeXt, or plain TeX. Better just to use "tex" always. Also changed: ConTeXt writer: now outputs raw "tex" blocks as well as "context". (Closes #969). RST writer: uses ".. raw:: latex" for "tex" content. (RST doesn't support raw context anyway.) Note that if "context" or "latex" specifically is desired, you can still force that in a markdown document by using the raw attribute (see MANUAL.txt): ```{=latex} \foo ``` Note that this change may affect some filters, if they assume that raw tex parsed by the Markdown reader will be RawBlock (Format "latex"). In most cases it should be trivial to modify the filters to accept "tex" as well.