aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2020-11-17JATS writer: move Table handling to separate moduleAlbert Krewinkel3-68/+144
This makes it easier to split the module into smaller parts.
2020-11-14Markdown writer: default to using ATX headings.Aner Lucero1-1/+6
Previously we used Setext (underlined) headings by default. The default is now ATX (`##` style). * Add the `--markdown-headings=atx|setext` option. * Deprecate `--atx-headers`. * Add constructor 'ATXHeadingInLHS` constructor to `LogMessage` [API change]. * Support `markdown-headings` in defaults files. * Document new options in MANUAL. Closes #6662.
2020-11-07Hlint suggestions.John MacFarlane1-2/+3
2020-11-07Lint code in PRs and when committing to master (#6790)Albert Krewinkel8-15/+16
* Remove unused LANGUAGE pragmata * Apply HLint suggestions * Configure HLint to ignore some warnings * Lint code when committing to master
2020-11-06Support nocase spansn for csljson outputJohn MacFarlane1-0/+1
2020-11-04DokuWiki writer: translate language names for code elements...John MacFarlane1-14/+24
...and improve whitespace. Closes #6807.
2020-11-04MediaWiki writer: use syntaxhighlight tag...John MacFarlane1-2/+9
instead of deprecated source, for highlighted code. Also support `startFrom` attribute and `numberLines`. Closes #6810.
2020-10-30Fix duplicate "class" attribute in HTML writerAndy Morris1-2/+4
2020-10-29LaTeX writer: Improved calculation of table column widths.John MacFarlane1-10/+12
We now have LaTeX do the calculation, using `\tabcolsep`. So we should now have accurate relative column widths no matter what the text width. The default template has been modified to load the calc package if tables are used.
2020-10-23Commonmark writer: fix regression with fenced divs.John MacFarlane1-1/+3
Starting with 2.10.1, fenced divs no longer render with HTML div tags in commonmark output. This is a regression due to our transition from cmark-gfm. This commit fixes it. Closes #6768.
2020-10-14Modify fix to #6742 to use stringToLaTeX.John MacFarlane1-3/+5
2020-10-13LaTeX writer: escape option values in lstlistings environment.John MacFarlane1-1/+2
Closes #6742.
2020-10-12LaTeX writer: fix handling of pt-BR.John MacFarlane1-3/+2
For polyglossia we now use `\setmainlanguage[variant=brazilian]{portuguese}` and for babel `\usepackage[shorthands=off,main=brazilian]{babel}`. Closes #2953.
2020-10-12Markdown writer: Fix autolinks rendering for gfm.John MacFarlane1-24/+23
Previously, autolinks rendered as raw HTML, due to the `class="uri"` added by pandoc's markdown reader. Closes #6740.
2020-10-08Be less aggressive about using quotes for YAML values.John MacFarlane1-4/+11
We need quotes if `[` or `{` or `'` is at the beginning of the line, but not otherwise.
2020-10-07Use double quotes for YAML metadata.John MacFarlane1-2/+2
Closes #6727.
2020-10-07Use latest citeproc.John MacFarlane1-3/+1
Better solution to the problem of entities in CSL JSON output.
2020-10-06Unescape entities in writing CSL JSON.John MacFarlane1-2/+5
The renderCslJson function escapes `<`, `>`, and `&` as entities. This is appropriate when generating HTML, but in CSL JSON these are supposed to appear unescaped. Closes jgm/citeproc#17.
2020-10-06DOCX reader: Allow empty dates in comments and tracked changes (#6726)Diego Balseiro1-11/+7
For security reasons, some legal firms delete the date from comments and tracked changes. * Make date optional (Maybe) in tracked changes and comments datatypes * Add tests
2020-10-05Removed the idpred from metaValueToReference.John MacFarlane1-1/+1
This isn't really necessary; we do filtering at other points now.
2020-10-05Add filtering to metaValueToReference, and check other-ids field too.John MacFarlane1-1/+2
2020-10-02Docx writer: better handle list items whose contents are lists (#6522)Michael Hoffmann1-3/+13
If the first element of a bulleted or ordered list is another list, then that first item will disappear if the target format is docx. This changes the docx writer so that it prepends an empty string for those cases. With this, no items will disappear. Closes #5948.
2020-10-01Syntax highlight for inline code of OpenDocument (#6711)niszet1-3/+18
To implement Syntax highlighting for OpenDocument, inlineToOpenDocument in OpenDocument Writer is updated based on Docx Writer. This commit is only for inline Code because update of CodeBlock needs structual change of output document. Currently, styles are not generated automatically in styles.xml. To implement it, additional commit for ODT Writer is needed. Although styles are not included in styles.xml, output file can be shown in LibreOffice(7.0.0.3) like normal characters.
2020-09-27OpenDocument Writer: Implement table cell alignment (#6700)Nils Carlson1-5/+33
Co-authored-by: Mauro Bieg <mb21@users.noreply.github.com>
2020-09-24OpenDocument writer: New table cell support with row and column spans (#6682)Nils Carlson1-26/+56
Unit tests only verify column spans at this point. Co-authored-by: Nils Carlson <nils.carlson@ludd.ltu.se>
2020-09-24Support toc-depth option for ODT writer (#6697)niszet1-0/+1
To support `--toc-depth` option for ODT, writer and template are updated. Closes #6696.
2020-09-21Add built-in citation support using new citeproc library.John MacFarlane5-37/+248
This deprecates the use of the external pandoc-citeproc filter; citation processing is now built in to pandoc. * Add dependency on citeproc library. * Add Text.Pandoc.Citeproc module (and some associated unexported modules under Text.Pandoc.Citeproc). Exports `processCitations`. [API change] * Add data files needed for Text.Pandoc.Citeproc: default.csl in the data directory, and a citeproc directory that is just used at compile-time. Note that we've added file-embed as a mandatory rather than a conditional depedency, because of the biblatex localization files. We might eventually want to use readDataFile for this, but it would take some code reorganization. * Text.Pandoc.Loging: Add `CiteprocWarning` to `LogMessage` and use it in `processCitations`. [API change] * Add tests from the pandoc-citeproc package as command tests (including some tests pandoc-citeproc did not pass). * Remove instructions for building pandoc-citeproc from CI and release binary build instructions. We will no longer distribute pandoc-citeproc. * Markdown reader: tweak abbreviation support. Don't insert a nonbreaking space after a potential abbreviation if it comes right before a note or citation. This messes up several things, including citeproc's moving of note citations. * Add `csljson` as and input and output format. This allows pandoc to convert between `csljson` and other bibliography formats, and to generate formatted versions of CSL JSON bibliographies. * Add module Text.Pandoc.Writers.CslJson, exporting `writeCslJson`. [API change] * Add module Text.Pandoc.Readers.CslJson, exporting `readCslJson`. [API change] * Added `bibtex`, `biblatex` as input formats. This allows pandoc to convert between BibLaTeX and BibTeX and other bibliography formats, and to generated formatted versions of BibTeX/BibLaTeX bibliographies. * Add module Text.Pandoc.Readers.BibTeX, exporting `readBibTeX` and `readBibLaTeX`. [API change] * Make "standalone" implicit if output format is a bibliography format. This is needed because pandoc readers for bibliography formats put the bibliographic information in the `references` field of metadata; and unless standalone is specified, metadata gets ignored. (TODO: This needs improvement. We should trigger standalone for the reader when the input format is bibliographic, and for the writer when the output format is markdown.) * Carry over `citationNoteNum` to `citationNoteNumber`. This was just ignored in pandoc-citeproc. * Text.Pandoc.Filter: Add `CiteprocFilter` constructor to Filter. [API change] This runs the processCitations transformation. We need to treat it like a filter so it can be placed in the sequence of filter runs (after some, before others). In FromYAML, this is parsed from `citeproc` or `{type: citeproc}`, so this special filter may be specified either way in a defaults file (or by `citeproc: true`, though this gives no control of positioning relative to other filters). TODO: we need to add something to the manual section on defaults files for this. * Add deprecation warning if `upandoc-citeproc` filter is used. * Add `--citeproc/-C` option to trigger citation processing. This behaves like a filter and will be positioned relative to filters as they appear on the command line. * Rewrote the manual on citatations, adding a dedicated Citations section which also includes some information formerly found in the pandoc-citeproc man page. * Look for CSL styles in the `csl` subdirectory of the pandoc user data directory. This changes the old pandoc-citeproc behavior, which looked in `~/.csl`. Users can simply symlink `~/.csl` to the `csl` subdirectory of their pandoc user data directory if they want the old behavior. * Add support for CSL bibliography entry formatting to LaTeX, HTML, Ms writers. Added CSL-related CSS to styles.html.
2020-09-21Sort YAML metadata keys in Markdown output case-insensitive.John MacFarlane1-2/+2
Use caseFold.
2020-09-19Asciidoctor images (#6671)argent01-26/+41
Support `Asciidoctor`'s block figures. Closes #6538.
2020-09-19Add CSS to default HTML template (#6601)Mauro Bieg1-0/+2
2020-09-15LaTeX writer: fix spacing issue with list in definition list.John MacFarlane1-3/+20
When a list occurs at the beginning of a definition list definition, it can start on the same line as the label, which looks bad. Fix that by starting such lists with an `\item[]`.
2020-09-13HTML writer: support intermediate table headersAlbert Krewinkel1-4/+10
Closes: #6314
2020-09-13HTML writer: support attributes on all table elementsAlbert Krewinkel1-6/+10
Add attributes to tbody and tr elements.
2020-09-13Fix hlint suggestions, update hlint.yaml (#6680)Christian Despres20-126/+115
* Fix hlint suggestions, update hlint.yaml Most suggestions were redundant brackets. Some required LambdaCase. The .hlint.yaml file had a small typo, and didn't ignore camelCase suggestions in certain modules.
2020-09-12HTML writer: render table footers if presentAlbert Krewinkel1-23/+50
Part of: #6314
2020-09-12[API change] Rename Writers.Tables and its contents (#6679)Christian Despres3-311/+320
Writers.Tables is now Writers.AnnotatedTable. All of the types and functions in it have had the "Ann" removed from them. Now it is expected that the module be imported qualified.
2020-09-11Use the original tail instead of deconstructing and reconstructing it (#6678)Joseph C. Sible1-2/+2
2020-09-10Changed default link state to invisible (#6676)Leonard Rosenthol1-1/+1
2020-09-10Support colspans and rowspans in HTML tables (#6644)Albert Krewinkel1-65/+187
* HTML writer: add support for row headers, colspans, rowspans * Add planet table tests See #6312
2020-09-10Implement support for internal document links in ICML (#6606)Leonard Rosenthol1-59/+95
Closes #5541.
2020-09-05Add Writers.Tables helper functions and types, add tests for those (#6655)Christian Despres1-0/+291
Add Writers.Tables helper functions and types, add tests for those The Writers.Tables module contains an AnnTable type that is a pandoc Table with added inferred information that should be enough for writers (in particular the HTML writer) to operate on without having to lay out the table themselves. The toAnnTable and fromAnnTable functions in that module convert between AnnTable and Table. In addition to producing an AnnTable with coherent and well-formed annotations, the toAnnTable function also normalizes its input Table like the table builder does. Various tests ensure that toAnnTable normalizes tables exactly like the table builder, and that its annotations are coherent.
2020-08-24Docx writer: separate adjacent tables.John MacFarlane1-1/+9
Word combines adjacent tables, so to prevent this we insert an empty paragraph between two adjacent tables. Closes #4315.
2020-08-21HTML writer: Fix addition of doc-biblioentry role.John MacFarlane1-1/+1
2020-08-09Remove `fenced_code_blocks` and `backtick_code_blocks` from...John MacFarlane1-6/+12
commonmark/gfm extensions. These shouldn't really be counted as extensions, because they can't be disabled in commonmark. Adjust markdown writer to check for commonmark variant in addition to extensions.
2020-07-31Org writer: don't force blank line after headersAlbert Krewinkel1-1/+1
Closes: #6554
2020-07-29Writers/Shared: add missing function docsAlbert Krewinkel1-7/+21
Ensure that all functions in the module have a haddock comment.
2020-07-23Markdown writer: use numerical labels for refs...John MacFarlane1-5/+9
...that are longer than 999 characters or contain square brackets. For conformity with commonmark. Closes #6560
2020-07-23Add `raw_markdown` extension affecting `ipynb` reader.John MacFarlane1-2/+2
Specifying `-f ipynb+raw_markdown` will cause Markdown cells to be represented as raw Markdown blocks, instead of being parsed. This is not what you want when going from `ipynb` to other formats, but it may be useful when going from `ipynb` to Markdown or to `ipynb`, to avoid semantically insignificant changes in the contents of the Markdown cells that might otherwise be introduced. Closes #5408.
2020-07-22Docx writer: support --number-sections.John MacFarlane1-4/+17
Closes #1413.
2020-07-19Markdown writer: move asciify out of escapeString.John MacFarlane1-9/+9
Otherwise unsmartify doesn't catch quotes that have already been turned to entities.