aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2021-12-29LaTeX->HTML: Automatically generate the TOCIgor Pashev1-3/+14
2021-12-28OpenDocument writer: fix vertical align bug with display math.John MacFarlane1-1/+1
Previously some displayed formulas would be floated above a preceding text line. This is fixed by setting vertical-rel to 'text' rather than 'paragraph-content'. Closes #7777.
2021-12-22RTF writer: properly handle images in data URIs.John MacFarlane1-2/+3
See #7771.
2021-12-22HTML writer: make line breaks more consistent.John MacFarlane1-60/+59
- With `--wrap=none`, we now output line breaks between block-level elements. Previously they were omitted entirely, so the whole document was on one line, unless there were literal line breaks in pre sections. This makes the HTML writer's behavior more consistent with that of other writers. - Put newline after `<dd>`. - Put newlines after block-level elements in footnote section.
2021-12-22Add text wrapping to HTML output.John MacFarlane2-49/+197
Previously the HTML writer was exceptional in not being sensitive to the `--wrap` option. With this change `--wrap` now works for HTML. The default (as with other formats) is automatic wrapping to 72 columns. A new internal module, T.P.Writers.Blaze, exports `layoutMarkup`. This converts a blaze Html structure into a doclayout Doc Text. In addition, we now add a line break between an `img` tag and the associated `figcaption`. Note: Output is never wrapped in `writeHtmlStringForEPUB`. This accords with previous behavior since previously the HTML writer was insensitive to `--wrap` settings. There's no real need to wrap HTML inside a zipped container. Note that the contents of script, textarea, and pre tags are always laid out with the `flush` combinator, so that unwanted spaces won't be introduced if these occur in an indented context in a template. Closes #7764.
2021-12-19Add a writer for Markua 0.10 (#7729)binaarinen3-70/+207
Markua is a markdown variant used by Leanpub. More information about Markua can be found at https://leanpub.com/markua/read. Adds a new exported function `writeMarkua` from T.P.Writers.Markdown. [API change] Closes #1871. Co-authored by Tim Wisotzki and Samuel Lemmenmeier.
2021-12-14Org writer: use the citation locator list from the org source code...John MacFarlane1-13/+61
which is not localized, instead of getting locators from the localized CSL stylesheet as we did before.
2021-12-14Markdown writer: avoid extra space before citation suffix...John MacFarlane1-2/+4
if it already starts with a space.
2021-12-14Markdown writer: ensure semicolon btw locator and next citation...John MacFarlane1-1/+5
when an author-in-text citation has a locator and following citations.
2021-12-13Org writer: add tests for org-cite citations, and improve support.John MacFarlane1-4/+28
2021-12-12Org writer: preliminary support for new org-cite syntax.John MacFarlane1-1/+21
See #7329. This could use some tests.
2021-12-09ipynb writer: handle cell output with raw block of markdown (#7563)Kolen Cheung1-0/+2
Write RawBlock of markdown in code-cell output. #7561 makes the ipynb reader reads code-cell output with mime "text/markdown" to a RawBlock of markdown This commit makes the ipynb writer writes this RawBlock of markdown back inside a code-cell output with the same mime, preserving this information in round-trip Add tests of ipynb reader (#7561) and ipynb writer (#7563)'s ability to handle a "text/markdown" mime type in a code-cell output
2021-12-08Ipynb writer: ensure deterministic order of keys.John MacFarlane1-1/+1
2021-12-06Ipynb reader & writer: properly handle cell "id".John MacFarlane1-15/+43
This is passed through if it exists (in Nb4); otherwise the writer will add a random one so that cells all have an "id". Closes #7728.
2021-12-06Ms writer: properly encode strings for PDF contents.John MacFarlane1-2/+19
Closes #7731.
2021-12-05Commonmark writer: allow ')' delimiters on ordered lists.John MacFarlane1-1/+6
2021-12-03Improve Markdown writer escaping.John MacFarlane1-18/+19
This fixes escaping for '#' in particular. Closes #7726.
2021-11-19Remove unused line.John MacFarlane1-1/+0
2021-11-19MediaWiki writer: fix code for generating spans for header IDs.John MacFarlane1-1/+1
We need to generate a span when the header's ID doesn't match the one MediaWiki would generate automatically. But MediaWiki's generation scheme is different from ours (it uses uppercase letters, and `_` instead of `-`, for example). This means that in going from markdown -> mediawiki, we'll now get spans before almost every heading, unless explicit identifiers are used that correspond to the ones MediaWiki auto-generates. This is uglier output but it's necessary for internal links to work properly. See #7697.
2021-11-19HTML writer: Don't create invalid `data-` attribute...John MacFarlane1-0/+1
for empty attribute key. (It would be better to make these unrepresentable in the type system, but for now this is an improvement.) Closes #7546.
2021-11-18MediaWiki writer: use HTML spans for anchors when header has id.John MacFarlane1-2/+8
Closes #7697.
2021-11-17Babel mappings: use ancientgreek for grc.John MacFarlane1-1/+1
2021-11-15Markdown writer: don't create autolinks when this loses information.John MacFarlane1-1/+4
Previously we sometimes lost attributes when rendering links as autolinks. Closes #7692.
2021-11-12JATS writer: ensure figures are wrapped with `<p>` in list items.Albert Krewinkel1-0/+1
This prevents the generation of invalid output.
2021-11-12JATS writer: add URL to element citation entriesAlbert Krewinkel1-0/+1
The URL of a reference, if present, is added in tag `<uri>` to element-citation entries.
2021-11-11Writers.Shared: Improve toLegacyTable.Christian Despres1-1/+1
Closes #7683. (PR #7684)
2021-11-08With `-t latex-smart`, don't generate `\ldots` from ellipsis.John MacFarlane1-1/+1
Instead just use unicode ellipsis. Closes #7674.
2021-11-04Allow `plain` to be used in raw attribute syntax.John MacFarlane2-2/+4
2021-10-29Docx writer: move ": " out of the caption bookmark.Tristan Stenner2-6/+4
This is needed so that native references to the figure are included as "As seen in Figure X, it is..." instead of "As seen in [Figure: , it is..."
2021-10-27Markdown writer: Be sure to quote special values in YAML metadata.John MacFarlane1-3/+13
E.g. "Y", "yes", which are now (with yaml library) considered boolean values, as well as "null". This fixes a bug with roundtripping markdown -> markdown: ``` --- foo: "true" ... ```
2021-10-22Use simpleFigure in Readers.Aner Lucero19-66/+43
2021-10-22Switch to hslua-2.0Albert Krewinkel1-72/+82
The new HsLua version takes a somewhat different approach to marshalling and unmarshalling, relying less on typeclasses and more on specialized types. This allows for better performance and improved error messages. Furthermore, new abstractions allow to document the code and exposed functions.
2021-10-17pptx: Line up continuation paragraphsEmily Bourke2-10/+93
This commit changes the `marL` and `indent` values used for plain paragraphs and numbered lists, and changes the spacing defined in the reference doc master for bulleted lists. For paragraphs, there is now a left-indent taken from the `otherStyle` in the master. For numbered lists, the number is positioned where the text would be if this were a plain paragraph, and the text is indented to the next level. This means that continuation paragraphs line up nicely with numbered lists. It also /mostly/ matches the observed PowerPoint behaviour when inserting paragraphs and numbered lists: the only difference is that PowerPoint was using a different margin value for the first level numbered lists – I’ve changed this to match the other levels, as I don’t think it makes the spacing unappealing and it allows continuation paragraphs at any level to line up. With bulleted lists, I’m keeping the observed PowerPoint behaviour of specifying only a level, letting `marL` and `indent` be automatically taken from `bodyStyle`. To that end, this commit changes the `bodyStyle` spacing in the master of the default reference doc, to: - line up the text of the first paragraph in each bullet with any continuation paragraphs - line up nested bullet markers in any continuation paragraphs with the first paragraph, matching lists and plain paragraphs This does mean the continuation paragraphs still won’t line up for anyone using their own reference doc where they haven’t matched the `otherStyle` and `bodyStyle` indent levels, but I think people in that situation will be able to troubleshoot.
2021-10-17pptx: Remove outdated commentEmily Bourke1-3/+0
I removed the field this comment refers to recently, missed the comment.
2021-10-17pptx: Fix list level numberingEmily Bourke1-14/+17
In PowerPoint, the content of a top-level list is at the same level as the content of a top-level paragraph – the only difference is that a list style has been applied. At the moment, the pptx writer increments the paragraph level on each list, turning what should be top-level lists into second-level lists. This commit changes that logic, only incrementing the paragraph level on continuation paragraphs of lists. - Fixes https://github.com/jgm/pandoc/issues/4828 - Fixes https://github.com/jgm/pandoc/issues/4663
2021-10-14asciidoc writer: translate numberLines attribute to linesnum switchSamuel Tardieu1-2/+5
AsciiDoctor allows to request line numbering on code blocks by using a switch on the `source` block, such as in: ``` [source%linesnum,haskell] ---- some Haskell code here ---- ```
2021-10-12Revert "Depend on pandoc-types 1.23, remove Null constructor on Block."John MacFarlane28-1/+36
This reverts commit fb0d6c7cb63a791fa72becf21ed493282e65ea91.
2021-10-11T.P.Writers.Shared: remove 'breakable'...John MacFarlane1-18/+0
which was introduced in the cherry-pick'd commit that added splitSentences, but isn't needed here. (It is for the nospace branch.)
2021-10-11T.P.Writers.Shared: Export splitSentences as a Doc Text transform.John MacFarlane3-16/+61
[API change] Use this in man/ms.
2021-10-11Remove splitSentences from T.P.Shared [API change].John MacFarlane2-6/+4
We used to attempt automatic sentence splitting in man and ms output, since sentence-ending periods need to be followed by two spaces or a newline in these formats. But it's difficult to do this reliably at the level of `[Inline]`.
2021-10-05Avoid bad wraps in markdown writer at the Doc Text level.John MacFarlane1-22/+23
Previously we tried to do this at the Inline list level, but it makes more sense to intervene on breaking spaces at the Doc Text level.
2021-10-04Powerpoint writer: consolidate text runs when possible.John MacFarlane2-4/+9
This slims down the output files by avoiding unnecessary text run elements. Updated golden tests.
2021-10-04Revert "Powerpoint writer: consolidate text run nodes."John MacFarlane1-9/+1
This reverts commit 62f83aa48633af477913bde6f615fe9f8793901a. This was already being done, it seems. I misidentified the problem; it is really with `Str ""` nodes.
2021-10-04Powerpoint writer: consolidate text run nodes.John MacFarlane1-1/+9
This should reduce the size of the generated files.
2021-10-01Depend on pandoc-types 1.23, remove Null constructor on Block.John MacFarlane28-36/+1
2021-09-30epub: Add EPUB3 subject metadata (authority/term)nuew1-10/+31
This adds the ability to specify EPUB 3 `authority` and `term` specific refinements to the `subject` tag. Specifying a plain `subject` tag in metadata will function as before.
2021-09-29EPUB writer: treat epub:type "frontispiece" as front matter.John MacFarlane1-1/+1
This allows you to include a frontispiece using ``` ![](yourimage.jpg) etc. ``` Closes #7600.
2021-09-28Switch from pretty-simple to pretty-show for native output.John MacFarlane1-12/+8
Update tests. Reason: it turns out that the native output generated by pretty-simple isn't always readable by the native reader. According to https://github.com/cdepillabout/pretty-simple/issues/99 it is not a design goal of the library that the rendered values be readable using 'read'. This makes it unsuitable for our purposes. pretty-show is a bit slower and it uses 4-space indents (non-configurable), but it doesn't have this serious drawback.
2021-09-26RST writer: properly handle anchors to ids...John MacFarlane1-1/+6
with spaces or leading underscore. In this cases we need the quoted form, e.g. ``` .. _`foo bar`: .. _`_foo`: ``` Side note: rST will "normalize" these identifiers anyway, ignoring the underscore: https://docutils.sourceforge.io/docs/ref/rst/directives.html#identifier-normalization Closes #7593.
2021-09-23HTML writer: render `\ref` and `\eqref` as inline math...John MacFarlane1-8/+11
not display. See #7589.