aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-03-20Support `yaml_metadata_block` extension form commonmark, gfm.John MacFarlane
This is a bit more limited than with markdown, as documented in the manual: - The YAML block must be the first thing in the input. - The leaf notes are parsed in isolation from the rest of the document. So, for example, you can't use reference links if the references are defined later in the document. Closes #6537.
2021-03-20Move yamlMetaBlock from Markdown reader to T.P.Readers.Metadata.John MacFarlane
2021-03-20Markdown reader: export `yamlMetaBlock`.John MacFarlane
[API change] This will allow us to parse YAML metadata blocks in other readers, potentially.
2021-03-20Text.Pandoc.Parsing: remove F type synonym.John MacFarlane
Muse and Org were defining their own F anyway, with their own state. We therefore move this definition to the Markdown reader.
2021-03-20T.P.Readers.Metadata: made `yamlBsToMeta`, `yamlBsToRefs` polymorphic...John MacFarlane
on the parser state, instead of requiring ParserState. [API change]
2021-03-20RST writer: use NonEmpty for init, last.John MacFarlane
2021-03-20Include Header.Attr.attributes as XML attributes on sectionErik Rask
Add key-value pairs found in the attributes list of Header.Attr as XML attributes on the corresponding section element. Any key name not allowed as an XML attribute name is dropped, as are keys with invalid values where they are defined as enums in DocBook, and xml:id (for DocBook 5)/id (for DocBook 4) to not intervene with computed identifiers.
2021-03-20T.P.Shared: remove `backslashEscapes`, `escapeStringUsing`.John MacFarlane
[API change] These are inefficient association list lookups. Replace with more efficient functions in the writers that used them (with 10-25% performance improvements in haddock, org, rtf, texinfo writers).
2021-03-19Fix fallback to default partials on templates.John MacFarlane
If the directory containing a template does not contain the partial, it should be sought in the default data files. Closes #7164.
2021-03-19Hlint suggestion.John MacFarlane
2021-03-19T.P.Shared: Remove ToString, ToText typeclasses [API change].John MacFarlane
T.P.Parsing: revise type of readWithM so that it takes a Text rather than a polymorphic ToText value. These typeclasses were there to ease the transition from String to Text. They are no longer needed, and they may clash with more useful versions under the same name. This will require a bump to 2.13.
2021-03-19Protect partial uses of maximum with NonEmpty.John MacFarlane
2021-03-19Use NonEmpty instead of minimumDef.John MacFarlane
2021-03-19Docx reader: Don't reimplement NonEmpty.John MacFarlane
2021-03-18Use minimumDef instead of minimum (partial function).John MacFarlane
2021-03-18Require safe >= 0.3.18 and remove cpp.John MacFarlane
2021-03-18Rewrite a foldl1 as a foldl'.John MacFarlane
2021-03-18Remove another foldr1 partial function use.John MacFarlane
2021-03-18T.P.Readers.Odt.StyleReader: rewrite foldr1 use as foldr.John MacFarlane
This avoids a partial function.
2021-03-17Docx writer: make nsid in abstractNum deterministic.John MacFarlane
Previously we assigned a random number (though in a deterministic way). But changes in the random package mean we get different results now on different architectures, even with the same random seed. We don't need random values; so now we just assign a value based on the list number id, which is guaranteed to be unique to the list marker.
2021-03-17Fix regression with `tex_math_backslash` in Markdown reader.John MacFarlane
Added regression test. Closes #7155.
2021-03-16Removed unused LANGUAGE pragmas.John MacFarlane
2021-03-15Remove an unneeded importJohn MacFarlane
2021-03-15Use foldl' instead of foldl everywhere.John MacFarlane
2021-03-14Handle 'nocite' better with --biblatex and --natbib.John MacFarlane
Previously the nocite metadata field was ignored with these formats. Now it populates a `nocite-ids` template variable and causes a `\nocite` command to be issued. Closes #4585.
2021-03-13T.P.App.FormatHeuristics: shorten code, improve docs.Albert Krewinkel
2021-03-13MediaWiki reader: Allow block-level content in notes (ref).John MacFarlane
Closes #7145.
2021-03-13Use integral values for w:tblW in docx.John MacFarlane
Cloess #7141.
2021-03-13Jira reader: mark divs created from panels with class "panel".Albert Krewinkel
Closes: tarleb/jira-wiki-markup#2
2021-03-13Jira writer: improve div/panel handlingAlbert Krewinkel
Include div attributes in panels, always render divs with class `panel` as panels, and avoid nesting of panels.
2021-03-12Citeproc: apply fixLinks correctly.John MacFarlane
This is code that incorporates a prefix like `https://doi.org/` into a following link when appropriate. But it didn't work because we were walking with a `[Inline] -> [Inline]` function on an `Inlines`. Changed the point of application of `fixLink` to resolve the issue. Closes #7130.
2021-03-12Simplify compactDL.John MacFarlane
2021-03-10HTML writer: Add warnings on duplicate attribute values.John MacFarlane
This prevents emitting invalid HTML. Ultimately it would be good to prevent this in the types themselves, but this is better for now. T.P.Logging: Add DuplicateAttribute constructor to LogMessage. [API change]
2021-03-09RST reader: fix logic for ending comments.John MacFarlane
Previously comments sometimes got extended too far. Closes #7134.
2021-03-09Org writer: fix operator precedence mistake in previous commitAlbert Krewinkel
2021-03-09Org writer: prevent unintended creation of ordered list itemsAlbert Krewinkel
Adjust line wrapping if default wrapping would cause a line to be read as an ordered list item. Fixes #7132
2021-03-08Jira writer: use noformat instead of code for unknown languages.Albert Krewinkel
Code blocks that are not marked as a language supported by Jira are rendered as preformatted text with `{noformat}` blocks. Fixes: tarleb/jira-wiki-markup#4
2021-03-07LaTeX reader: handle table cells containing `&` in `\verb`.John MacFarlane
Closes #7129.
2021-03-07LaTeX reader: support hyperref command.John MacFarlane
Closes #7127.
2021-03-06Allow `--resource-path` to accumulate.John MacFarlane
Previously, if `--resource-path` were used multiple times, the last resource path would replace the others. With this change, each time `--resource-path` is used, it prepends the specified path components to the existing resource path. Similarly, when `resource-path` is specified in a defaults file, the paths provided will be prepended to the existing resource path. This change also allows one to avoid using the OS-specific path separator; instead, one can simply use `--resource-path` a number of times with single paths. This form of command will not have an OS-dependent behavior. This change facilitates the use of multiple, small defaults files: each can specify a directory containing its own resources without clobbering the resource paths set by the others. Closes #6152.
2021-03-05Allow `${.}` in defaults files paths...John MacFarlane
to refer to the directory where the default file is. This will make it possible to create moveable "packages" of resources in a directory. Closes #5871.
2021-03-05Implement environment variable interpolation in defaults files.John MacFarlane
This allows the syntax `${HOME}` to be used, in fields that expect file paths only. Any environment variable may be interpolated in this way. A warning will be raised for undefined variables. The special variable `USERDATA` is automatically set to the user data directory in force when the defaults file is parsed. (Note: it may be different from the eventual user data directory, if the defaults file or further command line options change that.) Closes #5982. Closes #5977. Closes #6108 (path not taken).
2021-03-05Add fields for CSL optinos to Opt.John MacFarlane
* Add `optCSL`, `optBibliography`, `optCitationAbbreviations` to `Opt` [API change]. * Move `addMeta` from T.P.App.Opt to T.P.App.CommandLineOptions.
2021-03-05Logging: Add EnvironmentVariableUndefined constructor to LogMessage.John MacFarlane
[API change]
2021-03-05Shared: Change defaultUserDataDirs -> defaultUserDataDir.John MacFarlane
Rationale: the manual says that the XDG data directory will be used if it exists, otherwise the legacy data directory. So we should just determine this and use this directory, rather than having a search path which could cause some things to be taken from one data directory and others from others. [API change]
2021-03-04Revert "Revert "Relax `--abbreviations` rules so that a period isn't required.John MacFarlane
This reverts commit 916ce4d51121e0529b938fda71f37e947882abe5. I was confused in thinking it wouldn't work.
2021-03-04Revert "Relax `--abbreviations` rules so that a period isn't required."John MacFarlane
This reverts commit e461b7dd45f717f3317216c7d3207a1d24bf1c85. Ill-advised change. This doesn't work because we parse strings in chunks.
2021-03-04Relax `--abbreviations` rules so that a period isn't required.John MacFarlane
Partially addresses #7124.
2021-03-03Revert "Add T.P.Readers.LaTeX.Include."John MacFarlane
This reverts commit b569b0226d4bd5e0699077089d54fb03d4394b7d. Memory usage improvement in compilation wasn't very significant.
2021-03-03Add T.P.Readers.LaTeX.Include.John MacFarlane