aboutsummaryrefslogtreecommitdiff
path: root/src/Text
AgeCommit message (Collapse)Author
2022-10-17Fix compiler warning.issue8382John MacFarlane
2022-10-17T.P.Error: Remove PandocParsecError constructor from PandocError.John MacFarlane
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 ```
2022-10-13Extensions: simpler implementation based on Set.John MacFarlane
This implementation would allow us (if we wanted) to add an extensible Ext_custom Text constructor.
2022-10-13FlavoredFormat: add Show, Semigroup, Monad instancesJohn MacFarlane
2022-10-13Rollback parameterize options on scripting engine.John MacFarlane
Rolls back 0ab014ed1e5890e338792fab98aecc45cd889f99. We don't need this because we aren't needing to print the Lua version in options any more; we're handling `--version` now at the pandoc-cli level.
2022-10-12Lua: support extensions in custom readers.Albert Krewinkel
Like custom readers, like writers, can define the set of supported extensions by setting a global. E.g.: ``` lua reader_extensions = { smart = true, citations = false, } ```
2022-10-11Templates: use filename to search for default template of custom writersAlbert Krewinkel
The default template of a custom writer `/path/to/my-writer.lua` is expected in the `templates/default.my-writer.lua` data file. Note that templates are *not* applied automatically to the output of custom writers; custom writer authors must ensure that the template is applied if one is present in the writer options. Closes: #8137
2022-10-11Templates: do not try to normalize input to `getDefaultTemplate`Albert Krewinkel
The function `getDefaultTemplate` no longer splits off extension modifers from the given format, as that conflicts with using custom writers as formats. Haskell library users should use `getDefaultTemplate <=< (fmap formatName . parseFlavoredFormat)` if the input format can still contain extensions. The same is true for `compileDefaultTemplate`, which calls `getDefaultTemplate` internally.
2022-10-10Simplify some citation code in LaTeX writer.John MacFarlane
2022-10-10Lua: support extensions in custom writersAlbert Krewinkel
Custom writers can define the extensions that they support via the global `writer_extensions`. The variable's value must be a table with all supported extensions as keys, and their default status as values. E.g., the below specifies that the writer support the extensions `smart` and `sourcepos`, but only the `smart` extension is enabled by default: writer_extensions = { smart = true, sourcepos = false, }
2022-10-10Org reader: make #+pandoc-emphasis-pre work as expected. (#8360)Amir Dekel
So far, `orgStateLastPreCharPos` wasn't updated appropriately after each parsing to native Str (by the parser `str`). In addition to solving this, the guard `notAfterString` in `emphasisStart` is removed to allow emphasis after Str at the first place.
2022-10-10Remove redundant import from T.P.ScriptingAlbert Krewinkel
2022-10-10Lua: use `Reader` type for custom readers.Albert Krewinkel
2022-10-09HTML writer; Properly merge classes for headings of level > 6.John MacFarlane
Previously we got two separate `class` attributes in the `p` tag. Closes #8363.
2022-10-08[API Change] Change argument type of `getReader`, `getWriter`.Albert Krewinkel
The functions now take a `FlavoredFormat` instead of a text argument.
2022-10-08[API Change] Add new module "Text.Pandoc.Format"Albert Krewinkel
The module provides functions and types for format spec parsing and processing. The function `parseFormatSpec` was moved from Text.Pandoc.Extensions to the new module and renamed to `parseFlavoredFormat`. It now operates in a PandocMonad and is based on the updated types.
2022-10-08[API Change] T.P.Error: Add new constructor "PandocFormatError"Albert Krewinkel
The new error is used to report problems with input or output format specifications. The use of PandocAppError is now limited to code in T.P.App and T.P.Citeproc.
2022-10-08Extensions: add new function `readExtension`Albert Krewinkel
The function tries to read an extension from a string.
2022-10-06LaTeX writer: add separator line between table's body and its foot.Albert Krewinkel
The writer uses features from the longtable package to define the table foot. Furthermore, the table's bottom rule is now part of the foot, where it previously was given as part of the body.
2022-10-05HTML writer: replace deprecated aria roles for bibliography entries.John MacFarlane
`doc-biblioentry` -> `listitem` `doc-bibliography` -> `list` Closes #8354.
2022-10-05Extensions: fix JSON decoding of ExtensionsAlbert Krewinkel
Closes: #8352
2022-10-04Removed some final blank lines.John MacFarlane
2022-10-03Rename T.P.Readers.LaTeX.Types -> T.P.TeX.John MacFarlane
2022-10-03Rename T.P.Network.HTTP -> T.P.URI.John MacFarlane
This is still an unexported internal module. Export `urlEncode`, `escapeURI`, `isURI`, `schemes`, `uriPathToPath`. Re-export `escapeURI` and `isURI` from T.P.Shared (as they were exported before); drop exports of `schemes` and `uriPathToPath` [API change]. With this change, T.P.Class no longer depends on T.P.Shared.
2022-10-03Separate out T.P.Data, T.P.Translations from T.P.Class. (#8348)John MacFarlane
This makes T.P.Class more self-contained, and suitable for extraction into a separate package if desired. [API changes] - T.P.Data is now an exported module, providing `readDataFile`, `readDefaultDataFile` (both formerly provided by T.P.Class), and also `getDataFileNames` (formerly unexported in T.P.App.CommandLineOptions). - T.P.Translations is now an exported module (along with T.P.Translations.Types), providing `readTranslations`, `getTranslations`, `setTranslations`, `translateTerm`, `lookupTerm`, `readTranslations`, `Term(..)`, and `Translations`. - T.P.Class: `readDataFile`, `readDefaultDataFile`, `setTranslations`, and `translateTerm` are no longer exported. `checkUserDataDir` is now exported. - Text.Pandoc now exports Text.Pandoc.Data and `setTranslations` and `translateTerm`.
2022-10-03[API Change] Base custom writers on Writer type.Albert Krewinkel
The `T.P.Lua.writeCustom` function changed to allow either a TextWriter or ByteStringWriter to be returned. The global variables `PANDOC_DOCUMENT` and `PANDOC_WRITER_OPTIONS` are no longer set when the writer script is loaded. Both variables are still set in classic writers before the conversion is started, so they can be used when they are wrapped in functions.
2022-10-02Officially deprecate writeJATS...John MacFarlane
in favor of writeJatsArchiving.
2022-10-02Add T.P.Citeproc.Name.John MacFarlane
This exports `toName`, which previously had been part of T.P.Citeproc.BibTeX. T.P.Readers.RIS,EndNote can now depend on this module without transitively depending on the LaTeX reader, which is used in T.P.Citeproc.BibTeX. Closes #8345.
2022-10-01JATS writer: use `<break/>` for LineBreak...John MacFarlane
in the limited contexts that accept it. Closes #8344.
2022-09-30Move `--version` handling to pandoc-cli.John MacFarlane
Print flag settings (lua, server) and versions of all relevant packages. Add suffix for nightly builds. Move `nightly` flag from pandoc to pandoc-cli. Closes #8339.
2022-09-30App: move initial input-to-Pandoc code to internal submoduleAlbert Krewinkel
2022-09-30[API Change] Extract Lua code into new package pandoc-lua-engineAlbert Krewinkel
The flag 'lua53` must now be used with that package if pandoc is to be compiled against Lua 5.3.
2022-09-30[API Change] Parameterize `convertWithOpts` over scripting engine.Albert Krewinkel
2022-09-30Change imports in Lua code to only use exported pandoc modulesAlbert Krewinkel
2022-09-30App: stop including the HsLua version in version info outputAlbert Krewinkel
2022-09-30[API Change] App: parameterize `options` over the scripting engineAlbert Krewinkel
2022-09-30[API Change] Filter: Parameterize `applyFilters` over scripting engine.Albert Krewinkel
Pass the scripting engine as a parameter so it can be swapped out.
2022-09-30[API Change] Lua: export new function T.P.Lua.getEngineAlbert Krewinkel
The function returns the Lua scripting engine.
2022-09-30[API Change] Change type of Text.Pandoc.Lua.applyFilterAlbert Krewinkel
The module Text.Pandoc.Filter.Lua has been merged into Text.Pandoc.Lua. The function `applyFilter` now has type ``` haskell applyFilter :: (PandocMonad m, MonadIO m) => Environment-> [String]-> FilePath-> Pandoc-> m Pandoc ``` where `Environment` is defined in Text.Pandoc.Filter.Environment.
2022-09-30[API Change] Filter: export function `applyJSONFilter`Albert Krewinkel
2022-09-30[API Change] Remove modules T.P.Writers.Custom and T.P.Readers.Custom.Albert Krewinkel
The functions `writeCustom` and `readCustom` are available from module Text.Pandoc.Lua.
2022-09-30[API Change] Add new error constructor `PandocNoScriptingEngine`.Albert Krewinkel
The exit code for this error is 89.
2022-09-30[API Change] Export new module Text.Pandoc.ScriptingAlbert Krewinkel
The module contains the central data structure for scripting engines.