Commit Graph
16034 Commits
Author SHA1 Message Date
John MacFarlane 3fdfa7387e T.P.Scripting: change types of engineReadCustom, engineWriteCustom.
Not technically an API change, since these are still unreleased.
Remove the `ExtensionsConf` in the return value, and added an 'ExtensionsDiff'
parameter.
2022-10-20 19:53:40 -07:00
John MacFarlane ae2b6ee7b9 Regenerate hie.yaml 2022-10-20 19:53:19 -07:00
John MacFarlane d95befac55 Add custom extensions.
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-20 10:15:30 -07:00
Albert Krewinkel f711c7f2aa Lua: add new module pandoc.zip
Allows to handle docx and epub files.
2022-10-20 09:11:57 -07:00
John MacFarlane 5d71276eca T.P.Class: make getPOSIXTime, getZonedTime sensitive to...
`SOURCE_DATE_EPOCH` environment variable if set.  (`getTimestamp` was
already sensitive.)  This ensures that EPUB builds are reproducible.
Closes #7093.
2022-10-19 21:20:50 -07:00
John MacFarlane db189498a8 Makefile: improve linecounts target. 2022-10-19 15:33:21 -07:00
John MacFarlane 656c329c3b Makefile: exclude tests from SOURCEFILES 2022-10-19 13:34:46 -07:00
John MacFarlane 5faa6d22db Makefile: and linecounts target 2022-10-19 13:33:32 -07:00
John MacFarlane 69485b0c0d Text.Pandoc.Shared: remove findM [API change].
This was only used in one place, and can be replaced with simpler
code.
2022-10-19 13:07:19 -07:00
John MacFarlane fc8b0c4540 Add repl target to Makefile 2022-10-19 13:07:13 -07:00
John MacFarlane 716f5a0387 Text.Pandoc.Shared: remove deprecated makeMeta [API change]. 2022-10-19 12:47:13 -07:00
John MacFarlane ec278d2b60 Text.Pandoc.Shared: remove ordNub [API change].
This is just `nubOrd` from Data.Containers.ListUtils.
2022-10-19 12:46:15 -07:00
John MacFarlane fe137c9d40 T.P.Shared: remove mapLeft [API change].
This is just a synonym for Bifunctor.first.
2022-10-19 12:09:44 -07:00
John MacFarlane 2e1f424daa Move defaultUserDataDir from T.P.Shared to T.P.Data [API change]. 2022-10-19 10:48:49 -07:00
John MacFarlane e10d6d8ff6 Makefile: make sure we run tests for pandoc-lua-engine too 2022-10-19 10:48:25 -07:00
John MacFarlane e5bcfb6a7d Fix import in pandoc-lua-engine tests.
We neglected to change the import after adding T.P.Version.
2022-10-19 10:14:53 -07:00
John MacFarlane 4d01302a7f Text.Pandoc.Shared: remove elemText, notElemText. [API change] 2022-10-19 09:38:45 -07:00
John MacFarlane fde8635a18 Split Text.Pandoc.Version from Text.Pandoc.Shared.
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-19 09:16:13 -07:00
John MacFarlane 4bf685e7eb T.P.Shared: remove escapeURI, isURI.
These are now exported by Text.Pandoc.URI, and removing
them from Shared helps make module structure more straightforward.
2022-10-18 23:08:13 -07:00
John MacFarlane a3905114a4 T.P.SelfContained: use T.P.Parsing rather than direct Text.Parsec. 2022-10-18 22:10:54 -07:00
John MacFarlane be2f946e8f T.P.Sources: UpdateSourcePos instances for String and...
strict and lazy ByteString. [API change]
2022-10-18 22:10:16 -07:00
John MacFarlane bc91e4a8ef T.P.Citeproc.Locator: remove unnecessary import of Text.Parsec. 2022-10-18 21:59:22 -07:00
John MacFarlane e3fd2d5a03 Revert "HTML reader: avoid duplicating any existing identifier..."
This reverts commit e5fbddd3b6.
2022-10-18 12:51:34 -07:00
John MacFarlane 4103d4da82 Revert "T.P.Parsing: export registerIdentifier."
This reverts commit 20492d523c.
2022-10-18 12:51:19 -07:00
John MacFarlane ff22116426 Revert "Markdown reader: avoid duplicate ids with auto_identifiers."
This reverts commit eff82cfe4d.
2022-10-18 12:51:12 -07:00
John MacFarlane eff82cfe4d Markdown reader: avoid duplicate ids with auto_identifiers.
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-18 12:42:12 -07:00
John MacFarlane 20492d523c T.P.Parsing: export registerIdentifier.
[API change]

Use this in the HTML reader to register identifiers to avoid
duplicates created by `auto_identifiers`.
2022-10-18 10:09:27 -07:00
John MacFarlane e5fbddd3b6 HTML reader: avoid duplicating any existing identifier...
with `auto_identifiers`.

Closes #8383.
2022-10-18 09:51:33 -07:00
John MacFarlane c76b6a7094 Revert "MediaWiki writer: avoid extra section divs with repeated ids."
This reverts commit 1e7b57e1e8.
2022-10-18 09:00:34 -07:00
John MacFarlane cca8eee58a T.P.Error: Remove PandocParsecError constructor from PandocError. (#8385)
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-17 22:12:09 -07:00
John MacFarlane dbac9541b5 CI: Make sure we test -lua configuration. 2022-10-17 22:10:30 -07:00
John MacFarlane 4de3a9c2ca Add tools/latex-package-dependencies.lua. 2022-10-17 21:59:44 -07:00
John MacFarlane 1a61eec293 Adjust tests for CSS change; add CSS comments to mark...
highlighting CSS and citations CSS in the source.
2022-10-17 16:59:56 -07:00
John MacFarlane 5ca064b401 Fix typo introduced by recent commit in styles.html. 2022-10-17 16:31:01 -07:00
John MacFarlane 1e7b57e1e8 MediaWiki writer: avoid extra section divs with repeated ids.
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-17 15:14:09 -07:00
John MacFarlane 0cc48b560e Use styles.citations.html partial in styles.html. 2022-10-17 15:09:40 -07:00
John MacFarlane 3666d79ae7 EPUB CSS changes.
With this change, we reduce the amount of inline CSS used
for EPUBs.  Almost everything is now in the default EPUB
CSS (`data/epub.css`), which can be overridden either by
putting `epub.css` in the user data directory or by using
`--css` on the command line.  Inline styles are only used
for syntax highlighting (which depends on the style specified,
and is only included on pages with highlighted code) and
for bibliography formatting (which can depend on the CSL
style, and is only used in the page containing the bibliography).

Note that, for compatibility with older readers, we don't
use flexbox to style `column/columns` divs by default, as
we do in HTML.  Instead, we use an older method which only
works when there are two `column` divs inside a `columns`
div.  If you need more than two columns and aren't worried
about support for older EPUB readers, you can modify the
default CSS (there is a comment in the CSS telling you what to do).

Closes #8379.
2022-10-17 13:36:18 -07:00
John MacFarlane ef432b4324 MANUAL: Clarify that --css should be used with -s. 2022-10-17 08:09:47 -07:00
John MacFarlane 34479e3954 T.P.Readers.VimWiki: avoid direct import of parsec. 2022-10-16 23:24:30 -07:00
John MacFarlane bf96a3a83a T.P.Parsing: export errorMessages, messageString.
[API change]
2022-10-16 23:15:22 -07:00
John MacFarlane c64ac35ae2 T.P.Parsing: Remove gratuitious renaming of Parsec types.
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-16 20:01:01 -07:00
John MacFarlane 276335bcea Makefile: add ghcid target 2022-10-16 19:57:16 -07:00
John MacFarlane abb7aab75f RST writer: improve inline escaping rules.
Also a small performance optimization.

Closes #8380.
2022-10-16 14:59:28 -07:00
John MacFarlane fa450607a8 Makefile: fix .PHONY for test and build. 2022-10-16 14:59:22 -07:00
Albert Krewinkel f189579770 MANUAL: fix reference link in section "pandoc-lua" 2022-10-16 21:39:37 +02:00
Albert Krewinkel af2b4c47bb Lua: fix rendering of Lua errors in Lua
Otherwise the `Error running Lua` message can be prepended multiple
times.
2022-10-16 21:38:25 +02:00
John MacFarlane c8ef079c0f Makefile: hide command output for make binpath.
This allows:

    alias pandoc=`make binpath`

for convenient local testing of a build.
2022-10-16 11:30:26 -07:00
John MacFarlane d348dfa39e 'make help': add environment variables and default values. 2022-10-16 11:29:07 -07:00
John MacFarlane d849fe4525 Makefile changes.
Rename quick-cabal -> all, quick-test -> test.

Add binpath target.
2022-10-16 11:20:53 -07:00
Albert Krewinkel 2463477229 Lua: fix peeker for PandocError.
String error messages were incorrectly popped of the stack when
retrieving a PandocError.
2022-10-16 17:10:00 +02:00