aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-10-31Text.Pandoc.App: Change `parseOptionsFromArgs` and `parseOptions`...optinfoJohn MacFarlane
They now return `Either OptInfo Opt`. Add `OptInfo` type. Add `handleOptInfo` function. This performs the IO actions for things like `--version` that were previously done in `parseOptionsFromArgs`. An argument for a `ScriptingEngine` has been added, to facilitate printing custom templates and custom extensions for Lua filters. (However, at this stage nothing is yet done with it.) [API change]
2022-10-30hlint suggestions.John MacFarlane
2022-10-30hlint suggestions.John MacFarlane
2022-10-29Fix an import warning.John MacFarlane
2022-10-29Use T.P.XML lookupEntity in Jira reader.John MacFarlane
2022-10-29Re-export lookupEntity from Text.Pandoc.XML [API change].John MacFarlane
2022-10-29T.P.XML: use lookupEntity from commonmark-hs.John MacFarlane
2022-10-29T.P.Parsing.General: change `characterReference`, `charsInBalanced`.John MacFarlane
`characterReference` now returns a Text (as it should, because some named references don't correspond to a single Char), and uses the `lookupEntity` function from commonmark-hs instead of the slow one from tagsoup. `charsInBalanced` now takes a Text parser rather than a Char parser as argument. [API change]
2022-10-27Don't fail on inline metadata beginning with newline.John MacFarlane
Closes #8358.
2022-10-27T.P.Writers.Shared `toTableOfContents`: handle nested Divs better.John MacFarlane
Closes #8402.
2022-10-27T.P.PDF: fix papersize on PDF generation via ms.John MacFarlane
We need to set an option in pdfroff in addition to including a macro in the ms file. With this fix, `-Vpapersize=a4` should be sufficient to produce A4 PDF via ms. Closes #8403.
2022-10-26LaTeX reader: fix TEXINPUTS handling.John MacFarlane
If TEXINPUTS ends with `:`, then the system default TEXINPUTS is added. We handle this by just adding the working directory in this case. Closes #8392.
2022-10-26ICML writer: use Contents element for images with raw data...John MacFarlane
instead of a link with a data: uri. Closes #8398.
2022-10-25Remove type alias WriterProperties.John MacFarlane
I don't think this aids clarity, and anyway it's not exported.
2022-10-24Rename T.P.Readers.Odt -> T.P.Readers.ODT.John MacFarlane
For consistency with Writers.ODT. Similarly, rename `readOdt` -> `readODT`. [API change]
2022-10-24Rename T.P.Writers.Docbook -> T.P.Writers.DocBook.John MacFarlane
Similarly, rename `writeDocbook` -> `writeDocBook`, for consistency with the DocBook reader's naming. [API change]
2022-10-24ODT reader: fix relative links.John MacFarlane
ODT adds a `../` to relative links (see #3524); this needs to be removed when converting from ODT.
2022-10-24ODT writer: further refinement to #3524.John MacFarlane
Don't alter the link if the path is empty.
2022-10-24ODT writer:John MacFarlane
Revise commit 9496ce818bfc22cb8e823a04de8f5791fd84c8dd so it doesn't change image links. (These should have already been adjusted.) See #3524.
2022-10-24ODT writer: fix relative links.John MacFarlane
Closes #3524.
2022-10-21LaTeX reader: parse short table caption.John MacFarlane
See jgm/pandoc-types#103. This is not too useful yet, because writers don't do anything with the short caption.
2022-10-20Text.Pandoc.Parsing: remove `nested` [API change].John MacFarlane
It was not being used, and in fact it was a bad idea from the beginning, as it had no hope of solving the problem it was introduced to solve.
2022-10-20Add custom extensions.John MacFarlane
T.P.Extensions [API change]: + Add CustomExtension constructor to Extension. + Remove Bounded, Enum instances for Extension. + Add `extensionsToList` function. + Revise `readExtension` so it can handle CustomExtension, and so that it returns a Text rather than Maybe Text. + Add `showExtension`. T.P.Format: + Revise error checking to handle CustomExtension.
2022-10-19T.P.Class: make `getPOSIXTime`, `getZonedTime` sensitive to...John MacFarlane
`SOURCE_DATE_EPOCH` environment variable if set. (`getTimestamp` was already sensitive.) This ensures that EPUB builds are reproducible. Closes #7093.
2022-10-19Text.Pandoc.Shared: remove `findM` [API change].John MacFarlane
This was only used in one place, and can be replaced with simpler code.
2022-10-19Text.Pandoc.Shared: remove deprecated `makeMeta` [API change].John MacFarlane
2022-10-19Text.Pandoc.Shared: remove `ordNub` [API change].John MacFarlane
This is just `nubOrd` from Data.Containers.ListUtils.
2022-10-19T.P.Shared: remove `mapLeft` [API change].John MacFarlane
This is just a synonym for Bifunctor.first.
2022-10-19Move `defaultUserDataDir` from T.P.Shared to T.P.Data [API change].John MacFarlane
2022-10-19Text.Pandoc.Shared: remove `elemText`, `notElemText`. [API change]John MacFarlane
2022-10-19Split Text.Pandoc.Version from Text.Pandoc.Shared.John MacFarlane
This new module exports `pandocVersion` and `pandocVersionText`, which are no longer exported from Text.Pandoc.Shared. [API change] Also, we now set the `pandoc-version` variable centrally rather than in the writers. One effect is the man writer now emits a comment with the pandoc version (this was intended before, judging from the template, but it didn't happen because the vairable wasn't set).
2022-10-18T.P.Shared: remove `escapeURI`, `isURI`.John MacFarlane
These are now exported by Text.Pandoc.URI, and removing them from Shared helps make module structure more straightforward.
2022-10-18T.P.SelfContained: use T.P.Parsing rather than direct Text.Parsec.John MacFarlane
2022-10-18T.P.Sources: UpdateSourcePos instances for String and...John MacFarlane
strict and lazy ByteString. [API change]
2022-10-18T.P.Citeproc.Locator: remove unnecessary import of Text.Parsec.John MacFarlane
2022-10-18Revert "HTML reader: avoid duplicating any existing identifier..."John MacFarlane
This reverts commit e5fbddd3b6c0c7a3b76b313edbe55242e3b138fc.
2022-10-18Revert "T.P.Parsing: export `registerIdentifier`."John MacFarlane
This reverts commit 20492d523c8324e36781cfbbc8092c796f94b151.
2022-10-18Revert "Markdown reader: avoid duplicate ids with auto_identifiers."John MacFarlane
This reverts commit eff82cfe4de44a111250ce9ce3ecee2fd4d99924.
2022-10-18Markdown reader: avoid duplicate ids with auto_identifiers.John MacFarlane
We previously avoided generating a duplicate with another automatically generated identifier; now we also avoid duplicates with explicit identifiers that occur before the header for which an identifier is being generated. (Collisions are still possible for identifiers that occur after the header.) T.P.Shared: `makeSections` is also modified so it doesn't give bad results when the enclosing Div has a different identifier from the header, as may now happen.
2022-10-18T.P.Parsing: export `registerIdentifier`.John MacFarlane
[API change] Use this in the HTML reader to register identifiers to avoid duplicates created by `auto_identifiers`.
2022-10-18HTML reader: avoid duplicating any existing identifier...John MacFarlane
with `auto_identifiers`. Closes #8383.
2022-10-18Revert "MediaWiki writer: avoid extra section divs with repeated ids."John MacFarlane
This reverts commit 1e7b57e1e888575ec772fa30381a9edc9577a406.
2022-10-17T.P.Error: Remove PandocParsecError constructor from PandocError. (#8385)John MacFarlane
Henceforth we just use `PandocParseError`. T.P.Parsing now exports `fromParsecError`, which can be used to turn a parsec ParseError into a regular PandocParseError (the appearance to the user should be unchanged in every case). [API change] Closes #8382.
2022-10-17MediaWiki writer: avoid extra section divs with repeated ids.John MacFarlane
Closes #8383. Previously when converting HTML with headings nested under section elements, pandoc would produce HTML div tags and a span with an identifier duplicating the one on the div. It seems better just to omit the superstructure of section divs, so that's what this commit does, yielding more normal MediaWiki output.
2022-10-16T.P.Readers.VimWiki: avoid direct import of parsec.John MacFarlane
2022-10-16T.P.Parsing: export errorMessages, messageString.John MacFarlane
[API change]
2022-10-16T.P.Parsing: Remove gratuitious renaming of Parsec types.John MacFarlane
We were exporting Parser, ParserT as synonyms of Parsec, ParsecT. There is no good reason for this and it can cause confusion. Also, when possible, we replace imports of Text.Parsec with T.P.Parsing. The idea is to make it easier, at some point, to switch to megaparsec or another parsing engine if we want to. T.P.Parsing new exports: Stream(..), updatePosString, SourceName, Parsec, ParsecT [API change]. Removed exports: Parser, ParserT [API change].
2022-10-16RST writer: improve inline escaping rules.John MacFarlane
Also a small performance optimization. Closes #8380.
2022-10-15Minor code cleanups.John MacFarlane
2022-10-14Lua: Support built-in default templates for custom writersAlbert Krewinkel
Custom writers can define a default template via a global `Template` function; the data directory is no longer searched for a default template. Writer authors can restore the old lookup behavior with ``` lua Template = function () local template return template.compile(template.default(PANDOC_SCRIPT_FILE)) end ```