aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-02-04Lua filters: use same function names in Haskell and LuaAlbert Krewinkel3-28/+31
2021-02-04doc/lua-filters.md: improve docs for `pandoc.mediabag.insert`Albert Krewinkel1-2/+3
2021-02-04doc/lua-filters.md: fix, improve docs for `pandoc.mediabag.fetch`Albert Krewinkel1-2/+12
2021-02-03ePub writer: `belongs-to-collection` metadata (#7063)Nick Berendsen2-41/+67
2021-02-03LaTeX template: Update to iftex package (#7073)Andrew Dunning6-29/+28
Load the iftex package directly rather than via the ifxetex and ifluatex compatibility wrappers, which have been merged into a single package that is part of the LaTeX core. The capitalization of the commands has been changed for compatibility with older versions of TeX Live that have the version of iftex by the Persian TeX Group. This had been removed in <https://github.com/jgm/pandoc/commit/2845794c0c31b2ef1f3e6a73bb5b109da4c74f37> for compatibility with BasicTeX, but that is no longer an issue.
2021-02-02Fixed some compiler warnings in tests.John MacFarlane3-14/+3
2021-02-02Add tests for search_path_separatorAlbert Krewinkel1-0/+8
2021-02-02Check that all documented functions are present.Albert Krewinkel1-0/+19
Rely on tests in the module package to check the correctness of each function.
2021-02-02Fix stack configAlbert Krewinkel1-1/+1
2021-02-02Use hslua-module-path 0.1.0Albert Krewinkel1-1/+1
2021-02-02Improve docs for directory, normalizeAlbert Krewinkel1-3/+6
2021-02-02Lua: add module "pandoc.path"Albert Krewinkel6-1/+197
The module allows to work with file paths in a convenient and platform-independent manner. Closes: #6001 Closes: #6565
2021-02-02Test suite: a more robust way of testing the executable.John MacFarlane4-72/+64
Mmny of our tests require running the pandoc executable. This is problematic for a few different reasons. First, cabal-install will sometimes run the test suite after building the library but before building the executable, which means the executable isn't in place for the tests. One can work around that by first building, then building and running the tests, but that's fragile. Second, we have to find the executable. So far, we've done that using a function findPandoc that attempts to locate it relative to the test executable (which can be located using findExecutablePath). But the logic here is delicate and work with every combination of options. To solve both problems, we add an `--emulate` option to the `test-pandoc` executable. When `--emulate` occurs as the first argument passed to `test-pandoc`, the program simply emulates the regular pandoc executable, using the rest of the arguments (after `--emulate`). Thus, test-pandoc --emulate -f markdown -t latex is just like pandoc -f markdown -t latex Since all the work is done by library functions, implementing this emulation just takes a couple lines of code and should be entirely reliable. With this change, we can test the pandoc executable by running the test program itself (locatable using findExecutablePath) with the `--emulate` option. This removes the need for the fragile `findPandoc` step, and it means we can run our integration tests even when we're just building the library, not the executable. Part of this change involved simplifying some complex handling to set environment variables for dynamic library paths. I have tested a build with `--enable-dynamic-executable`, and it works, but further testing may be needed.
2021-02-02Add parseOptionsFromArgs [API change, addition].John MacFarlane2-2/+9
Exported by Text.Pandoc.App.
2021-02-02cabal.project - more heap spaceJohn MacFarlane1-1/+1
2021-02-02shell.nix - install zlibJohn MacFarlane1-0/+1
2021-02-02Remove superfluous importJohn MacFarlane1-1/+0
2021-02-01Add default.bibtex to repository.John MacFarlane1-0/+10
2021-02-01BibTeX writer: use doclayout and doctemplate.John MacFarlane6-26/+54
This change allows bibtex/biblatex output to wrap as other formats do, depending on the settings of `--wrap` and `--columns`. It also introduces default templates for bibtex and biblatex, which allow for using the variables `header-include`, `include-before` or `include-after` (or alternatively the command line options `--include-in-header`, `--include-before-body`, `--include-after-body`) to insert content into the generated bibtex/biblatex. This change requires a change in the return type of the unexported `T.P.Citeproc.writeBibTeXString` from `Text` to `Doc Text`. Closes #7068.
2021-02-01BibTeX writer fixes. Closes #7067.John MacFarlane4-9/+108
+ Require citeproc 0.3.0.7, which correctly titlecases when titles contain non-ASCII characters. + Correctly handle 'pages' (= 'page' in CSL). + Correctly handle BibLaTeX 'langid' (= 'language' in CSL). + In BibTeX output, protect foreign titles since there's no language field.
2021-01-31Makefile: give allocation data in benchmarks.John MacFarlane1-2/+2
2021-01-31Add shell.nix.John MacFarlane1-0/+105
2021-01-31RST reader: fix handling of header in CSV tables.John MacFarlane2-4/+37
The interpretation of this line is not affected by the delim option. Closes #7064.
2021-01-31CslJson writer: fix compiler warningAlbert Krewinkel1-1/+1
2021-01-30Require citeproc 0.3.0.6.John MacFarlane2-5/+5
2021-01-30CslJson writer: output `[]` if no references in input,John MacFarlane1-5/+5
instead of raising a PandocAppError as before.
2021-01-30Use tasty-bench instead of criterion for benchmarks.John MacFarlane4-12/+18
It is much lighter-weight.
2021-01-30Use latest citeproc.John MacFarlane1-4/+4
The fix to jgm/citeproc#49 also closes #7060.
2021-01-29Markdown writer: handle math right before digit.John MacFarlane2-1/+11
We insert an HTML comment to avoid a `$` right before a digit, which pandoc will not recognize as a math delimiter.
2021-01-29JATS templates: tag author.name as string-nameAlbert Krewinkel3-0/+9
The partitioning the components of a name into surname, given names, etc. is not always possible or not available. Using `author.name` allows to give the full name as a fallback to be used when `author.surname` is not available.
2021-01-29JATS writer: escape special chars in reference elements.Albert Krewinkel1-3/+6
Prevents the generation of invalid markup if a citation element contains an ampersand or another character with a special meaning in XML.
2021-01-27Improve docs for cite-method.John MacFarlane1-1/+4
2021-01-26Clean up BibTeX parsing.John MacFarlane4-37/+25
Previously there was a messy code path that gave strange results in some cases, not passing through raw tex but trying to extract a string content. This was an artefact of trying to handle some special bibtex-specific commands in the BibTeX reader. Now we just handle these in the LaTeX reader and simplify parsing in the BibTeX reader. This does mean that more raw tex will be passed through (and currently this is not sensitive to the `raw_tex` extension; this should be fixed). Closes #7049.
2021-01-26LaTeX writer: change BCP47 lang tag from jp to jaMauro Bieg1-1/+1
fixes #7047
2021-01-26Lua: always load built-in Lua scripts from default data-dirAlbert Krewinkel4-46/+44
The Lua modules `pandoc` and `pandoc.List` are now always loaded from the system's default data directory. Loading from a different directory by overriding the default path, e.g. via `--data-dir`, is no longer supported to avoid unexpected behavior and to address security concerns.
2021-01-23Update AUTHORS.md.John MacFarlane1-0/+2
2021-01-22Update README and man page.John MacFarlane3-28/+73
2021-01-22Update changelog.John MacFarlane1-0/+149
2021-01-22ImageSize: use viewBox for svg if no length, width.John MacFarlane2-18/+20
This change allows pandoc to extract size information from more SVGs. Closes #7045.
2021-01-22Use citeproc 0.3.0.5.John MacFarlane2-2/+2
2021-01-22Merge pull request #7042 from tarleb/jats-element-citationsJohn MacFarlane8-25/+367
JATS writer: use element citations
2021-01-22JATS writer: allow to use element-citationAlbert Krewinkel7-7/+346
2021-01-22Add biblatex, bibtex as output formats (closes #7040).John MacFarlane6-6/+312
* `biblatex` and `bibtex` are now supported as output as well as input formats. * New module Text.Pandoc.Writers.BibTeX, exporting writeBibTeX and writeBibLaTeX. [API change] * New unexported function `writeBibtexString` in Text.Pandoc.Citeproc.BibTeX.
2021-01-21Text.Pandoc.Citeproc: use finer grained importsAlbert Krewinkel1-18/+21
This allows to import the module in writers without causing a circular dependency.
2021-01-19JATS writer: Ensure that disp-quote is always wrapped in p.John MacFarlane4-97/+131
Closes #7041.
2021-01-18RST writer: fix #7039.John MacFarlane1-2/+2
We were losing content from inside spans with a class, due to logic that is meant to avoid nested inline structures that can't be represented in RST. The logic was a bit stricter than necessary. This commit fixes the issue.
2021-01-16Revert "Markdown reader: support GitHub wiki's internal links (#2923) (#6458)"John MacFarlane3-58/+0
This reverts commit 6efd3460a776620fdb93812daa4f6831e6c332ce. Since this extension is designed to be used with GitHub markdown (gfm), we need to implement the parser as a commonmark extension (commonmark-extensions), rather than in pandoc's markdown reader. When that is done, we can add it here.
2021-01-16Markdown reader: support GitHub wiki's internal links (#2923) (#6458)Gautier DI FOLCO3-0/+58
Canges overview: * Add a `Ext_markdown_github_wikilink` constructor to `Extension` [API change]. * Add the parser `githubWikiLink` in `Text.Pandoc.Readers.Markdown` * Add tests.
2021-01-16Recognize more extensions as markdown by default.John MacFarlane1-0/+5
`mkdn`, `mkd`, `mdwn`, `mdown`, `Rmd`. Closes #7034.
2021-01-15Improve .gitignore.John MacFarlane1-0/+5