aboutsummaryrefslogtreecommitdiff
path: root/src/Text
AgeCommit message (Collapse)AuthorFilesLines
2019-12-11Improved template API and fixed a bug. Closes #5979.John MacFarlane3-43/+65
* Text.Pandoc.Templates [API change] + Add Monad wrappers `WithDefaultPartials` and `WithPartials`. Wrapping these around an instance of `PandocMonad` gives us different instances of `TemplateMonad`, with different search behavior in retrieving partials. To compile a template and limit partial search to pandoc's data files, use `runWithDefaultPartials (compileTemplate ...)`. To compile a template and allow partials to be found locally (either on the file system or via HTTP, in the event that the main template has an absolute URL), ue `runWithPartials (compileTemplate ...)`. + Export `getTemplate`, which seeks a template locally, or via HTTP if the template has an absolute URL, falling back to the data files if not found. + Export `compileDefaultTemplate` -- does `getDefaultTemplate` and compiles the result, raising an error on failure. * Text.Pandoc.Class [API change] + Remove `TemplateMonad` instances for `PandocIO` and `PandocPure`. These were too limiting and caused a bug whereby a local partial could be used even when the default template was requested. We now rely on instances provided in the Templates module. Text.Pandoc.App.OutputSettings + Simplify template retrieval code.
2019-12-09More informative JSON parse error.John MacFarlane1-1/+1
Closes #5973.
2019-12-08Use external emojis package.John MacFarlane2-47/+7
Moved the emoji-specified code into an external package we can depend on.
2019-12-07Fix --toc-depth regression in 2.8.John MacFarlane1-6/+6
Closes #5967.
2019-12-07Fix --toc-depth regression in 2.8.John MacFarlane1-3/+3
Closes #5967.
2019-12-05Avoid deprecation warning for minimumDef using CPP.John MacFarlane1-1/+6
2019-12-05Roll back part of of `--shift-heading-level-by` change.John MacFarlane1-6/+0
With positive heading shifts, starting in 2.8 this option caused metadata titles to be removed and changed to regular headings. This behavior is incompatible with the old behavior of `--base-header-level` and breaks old workflows, so with this commit we are rolling back this change. Now, there is an asymmetry in positive and negative heading level shifts: + With positive shifts, the metadata title stays the same and does not get changed to a heading in the body. + With negative shifts, a heading can be converted into the metadata title. I think this is a desirable combination of features, despite the asymmetry. One might, e.g., want to have a document with level-1 section headigs, but render it to HTML with level-2 headings, retaining the metadata title (which pandoc will render as a level-1 heading with the default template). Closes #5957. Revises #5615.
2019-12-05HTML writer: add task-list class to ul if all elements are task list items.John MacFarlane1-1/+10
This will allow styling unordered task lists in a way that omits the bullet.
2019-12-05Fix makeSections so it doesn't turn column divs into sections.John MacFarlane1-1/+3
2019-12-04Fix regression with behavior of --variable.John MacFarlane1-2/+8
Previously -Vfoo=1 -Vfoo=2 would produce a list value for foo; with 2.8 it produced just '2'. This commit restores the earlier beahvior. Closes #5962.
2019-12-03Move data/emoji.json to emoji.json, add to extra-source-files.John MacFarlane1-1/+1
This doesn't really belong in data-files as it's not loaded dynamically.
2019-11-29Add `ascii_identifiers` as a supported extension for `markdown`.John MacFarlane1-27/+25
This fixes a regression in 2.8.
2019-11-27Use `[|..|]` syntax to simplify Emoji.TH.John MacFarlane1-6/+6
2019-11-27Remove redundant import.John MacFarlane1-1/+0
2019-11-27Generate Emoji module with TH.John MacFarlane2-1793/+43
- Add Text.Pandoc.Emoji.TH. - Replace long literal list in Text.Pandoc.Emoji with one-liner generating it from data/emoji.json using TH. - Add Makefile target to download data/emoji.json. - Remove tools/emoji.hs.
2019-11-27LaTeX writer - hlint.John MacFarlane1-29/+24
2019-11-27HTML writer: hlint improvements.John MacFarlane1-25/+22
2019-11-27Removed useless cpp for old versions of blaze.John MacFarlane1-14/+0
2019-11-27Removed unneeded pragma.John MacFarlane1-1/+0
2019-11-26Add pdf to list of output formats (`--list-output-formats`).John MacFarlane1-1/+2
Closes #5938.
2019-11-25EPUB writer: Fix regression with `--css option.John MacFarlane1-9/+13
Closes #5937.
2019-11-25RST writers: Use grid tables for 1-column tables.John MacFarlane1-1/+1
With simple tables, we have a clash with heading syntax. Closes #5936.
2019-11-24Add unexported Text.Pandoc.Readers.Metadata.John MacFarlane3-105/+162
For YAML metadata parsing. A step in the direction of #5914. No API change.
2019-11-22Jira writer: improve escaping of special chars (#5925)Albert Krewinkel1-18/+9
Backslash-escaping is used instead of HTML entities, as escaped characters are easier to read this way. Furthermore, Confluence, which seems to use a subset of Jira markup, seems to get confused by HTML entities.
2019-11-21LaTeX reader: parse \micro siunitx unit command (#5921)Jose Luis Duran1-0/+1
This was somehow missed in 884aef31c55e375cd62fcb55a71829d005087cae.
2019-11-21TEI writer: don't strip hash from internal links.John MacFarlane1-6/+2
Closes #5922.
2019-11-20Fix typos (#5919)Brian Wignall1-1/+1
2019-11-19Improve markdown escaping in list items.John MacFarlane1-27/+25
Closes #5918.
2019-11-18DokuWiki reader: parse markup inside monospace ('') (#5917)Alexander Krotov1-2/+2
Fixes #5916
2019-11-17Reverted the behavior change with `--title-prefix`.John MacFarlane2-2/+4
It now implies `--standalone` again, as before.
2019-11-17Ensure that options imply `--standalone` even in defaults file.John MacFarlane1-14/+15
Certain options (`--self-contained`, `--include-in-header`, etc.) imply `--standalone`. We now handle this after option parsing so that it affects options specified in defaults files too. Behavior change: `--title-prefix` no longer implies `--standalone`.
2019-11-16Ms writer: boldface definition terms in DefinitionLists.John MacFarlane1-1/+2
Like LaTeX, ConTeXt.
2019-11-16ConTeXt writer: set csl-hanging-ident variable if needed.John MacFarlane1-2/+6
2019-11-16ConTeXt writer: Use special environment for CSL references.John MacFarlane1-0/+8
2019-11-16ConTeXt writer: use braces, not start/stop, for inline language tags.John MacFarlane1-2/+2
This prevents unwanted gobbling of spaces.
2019-11-16Add `Ext_smart` to list of possible extensions for HTML.John MacFarlane1-0/+1
2019-11-15RST writer: Improve spacing for tables with no width information.John MacFarlane2-6/+26
If a simple table would be too wide, we use a grid table. The code for generating grid tables has been adjusted to give more intelligent column widths when widths aren't given. (This also affects the markdown writer.) Closes #5899.
2019-11-15LaTeX Reader: Add KOMA-Script metadata commands (#5910)Andrew Dunning1-1/+8
Add all titling commands to existing definition for `\dedication`.
2019-11-14Default files: Allow leaving input-files blank again.John MacFarlane1-3/+4
Leaving it blank yields a Nothing value (interpreted as stdin). Providing an empty list is intepreted as no input. This resolves one part of #5888.
2019-11-14Change optInputFiles to a `Maybe [FilePath]`.John MacFarlane4-15/+21
`Nothing` means: nothing specified. `Just []` means: an empty list specified (e.g. in defaults). Potentially these could lead to different behavior: see #5888.
2019-11-14Writers.Shared: Clean up code for adding metadata to variables.John MacFarlane1-10/+9
2019-11-14Markdown reader: use take1WhileP for table row.John MacFarlane1-1/+1
2019-11-14Markdown reader: Use take1WhileP for str.John MacFarlane1-1/+3
This yields a small but measurable performance improvement.
2019-11-14Parsing: Rename takeWhileP -> take1WhileP and clean it up.John MacFarlane1-9/+11
(It doesn't match the empty sequence.)
2019-11-14Allow combining `-Vheader-includes` and `--include-in-header`.John MacFarlane1-15/+21
Closes #5904.
2019-11-14Fix regression preventing header-includes from being set using -V.John MacFarlane1-1/+2
See #5904.
2019-11-14RST writer: fix backslash escaping after stringsAlbert Krewinkel1-2/+2
The check whether a complex inline element following a string must be escaped, now depends on the last character of the string instead of the first. Fixes: #5906
2019-11-13Fix regression introduced by last commit.John MacFarlane1-1/+2
2019-11-13Markdown reader: don't parse footnote body unless extension enabled.John MacFarlane1-18/+20
2019-11-13Default files: combine with prior values when appropriate.John MacFarlane1-21/+45
Certain command-line arguments can be repeated: `--metadata-file`, `--css`, `--include-in-header`, `--include-before-body`, `--include-after-body`, `--variable`, `--metadata`, `--syntax-definition`. In these cases, values specified in default files should be added to the list rather than replacing values specified earlier on the command line (perhaps in other default files). So, for example, if one does pandoc --variable foo=3 --defaults d1 --defaults d2 and `d1` sets the variable `bar` and `d2` sets `baz`, all three variables will be set. Closes #5894.