aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
AgeCommit message (Collapse)AuthorFilesLines
2020-10-08Qualify some uses of fail to avoid ambiguity.John MacFarlane1-6/+6
2020-10-07Remove redundant import.John MacFarlane1-1/+0
2020-10-07Remove redundant import.John MacFarlane1-1/+1
2020-10-07Raise informative errors when YAML metadata parsing fails.John MacFarlane2-28/+28
Closes #6730. Previously the command would succeed, returning empty metadata, with no errors or warnings. API changes: - Remove now unused CouldNotParseYamlMetadata constructor for LogMessage (T.P.Logging). - Add 'Maybe FilePath' parameter to yamlToMeta in T.P.Readers.Markdown.
2020-10-06DOCX reader: Allow empty dates in comments and tracked changes (#6726)Diego Balseiro2-12/+17
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-05Fixed regresison in last commit.John MacFarlane2-22/+43
Parsing of YAML bibliographies was broken; this fixes it.
2020-10-05Add yamlToRefs, yamlBsToRefs.John MacFarlane2-3/+69
T.P.Readers.Markdown now exports yamlToRefs. [API change] T.P.Readers.Metadata exports yamlBsToRefs. [API change] These allow specifying an id filter so we parse only references that are used in the document. Improves timing with a 3M yaml references file from 36s to 17s.
2020-09-25RST reader: apply `.. class::` directly to following Header.John MacFarlane1-1/+6
rather than creating a surrounding Div. Closes #6699.
2020-09-25Org reader: fix HLint warningsAlbert Krewinkel1-2/+2
2020-09-24DocBook reader: Implement table cell alignment (#6698)Nils Carlson1-6/+11
2020-09-21Add built-in citation support using new citeproc library.John MacFarlane3-0/+124
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-21Markdown reader: Set citationNoteNum accurately in citations.John MacFarlane1-5/+26
This also changes stateLastNoteNumber -> stateNoteNumber.
2020-09-19Change deprecated Builder.isNull to null.John MacFarlane6-9/+9
2020-09-15LaTeX reader: fix improper empty cell filtering (#6689)Christian Despres1-8/+82
2020-09-13Fix hlint suggestions, update hlint.yaml (#6680)Christian Despres26-126/+114
* 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-10Improved uncertainty handling in slunitx.John MacFarlane1-6/+11
2020-09-10LaTeX reader: support parenthesized uncertainties in siunitx.John MacFarlane1-2/+14
2020-09-10docbook reader: Implement column span support for tables (#6492)Nils Carlson1-18/+42
Implement column span support for tables in the DocBook reader. Co-authored-by: Nils Carlson <nils.carlson@ludd.ltu.se>
2020-09-08Reader.LaTeX.hs: remove trailing whitespaceAlbert Krewinkel1-7/+7
2020-09-02Support numrange, numlist for siunitx.John MacFarlane2-9/+27
See #6658.
2020-09-02Support some missing siunitx commands.John MacFarlane1-0/+8
2020-09-02LaTeX reader: Support siunitx `\ang`.John MacFarlane2-0/+13
See #6658.
2020-09-02Skip opts for `\si`.John MacFarlane1-1/+1
2020-09-02LaTeX reader: support `\si` and improve other siunitx commands.John MacFarlane2-8/+23
2020-09-02LaTeX reader: support `\num` from siunitx.John MacFarlane2-6/+40
2020-09-02LaTeX reader: Support squared, cubed, tothe in siunitx.John MacFarlane1-12/+22
Closes #6657.
2020-09-02LaTeX reader: Factored out siunitx stuff into separate module.John MacFarlane2-223/+244
2020-08-15[Latex Reader] Fixing issues with \multirow and \multicolumn table cells (#6608)Laurent P. René de Cotret1-28/+48
* Added test to replicate (#6596) * Table cell reader not consuming spaces correctly (#6596) * Prevented wrong nesting of \multicolumn and \multirow table cells (#6603) * Parse empty table cells (#6603) * Support full prototype for multirow macro (#6603) Closes #6603
2020-08-14Change SIRange to SIrange (#6617)Emerson Harkin1-4/+4
2020-08-11DocBook reader: Update list of block level tags.John MacFarlane1-10/+83
This fixes #6610.
2020-08-07[Latex Reader] Table cell parser not consuming spaces correctly (#6597)Laurent P. René de Cotret1-0/+2
* Added test to replicate (#6596) * Table cell reader not consuming spaces correctly (#6596)
2020-07-23Add `raw_markdown` extension affecting `ipynb` reader.John MacFarlane1-1/+5
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-23Minimal support for SIRange in LaTeX reader (#6418)Emerson Harkin1-0/+24
Add support for `\SIRange{firstnumber}{secondnumber}{unit}` provided by siunitx. An en-dash is used instead of localized "to".
2020-07-23Col-span and row-span in LaTeX reader (#6470)Laurent P. René de Cotret1-19/+57
Add multirow and multicolumn support in LaTex reader. Partially addresses #6311.
2020-07-23Further improvements to ams theorem support, and a test.John MacFarlane1-2/+3
See #1608.
2020-07-23LaTeX reader: Add identifier in divs for ams theorem environments.John MacFarlane1-1/+1
2020-07-22LaTeX reader: SUpport ams `\theoremstyle`.John MacFarlane2-8/+38
2020-07-22Implement first optional argument for `\newtheorem`.John MacFarlane1-23/+30
This allows groups of theorem environments to be put in the same numbering sequence.
2020-07-22LaTeX reader: Don't boldface alt title in theorems.John MacFarlane1-2/+2
2020-07-22LaTeX reader: support theorem environments and `\newtheorem`.John MacFarlane2-3/+65
Includes numbering and labels and refs. Note that numbering support is not complete; we don't reset numbers with sections for example.
2020-07-22LaTeX reader: support ams proof environment.John MacFarlane2-0/+37
2020-07-22Moved more from LaTeX reader to LaTeX.Parsing.John MacFarlane2-63/+67
2020-07-21RST reader: fix csv tables with multiline cells.John MacFarlane1-1/+6
Closes #6549.
2020-07-20Move some code from T.P.R.LaTeX. to T.P.R.LaTeX.Parsing.John MacFarlane2-70/+78
We need to reduce the size of the LaTeX reader to ease compilation on resource-limited systems. More can be done in this vein.
2020-07-19Add generic `attributes` extension.John MacFarlane1-4/+1
This allows attributes to be added to any block or inline element, in principle. (Though in many cases this will be done by adding a Div or Span container, since pandoc's AST doesn't have a slot for attributes for most elements.) Currently this is only possible with the commonmark and gfm readers. Add `Ext_attributes` constructor for `Extension` [API change].
2020-07-19Use commonmark-hs to parse commonmark/gfm...John MacFarlane1-198/+43
...instead of cmark-gfm (a wrapper around a C library). We can now support many more pandoc extensions for commonmark and gfm. Add fenced_code_attributes to gfm/commonmark extensions.
2020-07-18DocBook reader: parse releaseinfo as metadata.John MacFarlane1-0/+1
Closes #6542. Note that you'll need to put releaseinfo somewhere in your template if you want this to be part of the converted output.
2020-07-14Docbook reader: remove misleading comment...John MacFarlane1-1/+1
suggesting that releaseinfo is handled. It isn't.
2020-07-13Merge pull request #6527 from lierdakil/fix-6514John MacFarlane3-55/+59
[Docx Reader] Only use bCs/iCs on runs with rtl or cs property
2020-07-13[Docx Reader] Only use bCs/iCs on runs with rtl or cs propertyNikolay Yakimov3-55/+59
Fixes #6514