Commit Graph
16018 Commits
Author SHA1 Message Date
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
John MacFarlane 726c54de27 Use skylighting 0.13.1. 2022-10-15 15:36:48 -07:00
John MacFarlane 1195f5bb3b Minor code cleanups. 2022-10-15 11:43:56 -07:00
John MacFarlane 8a21aa8142 Update changelog. 2022-10-14 10:56:01 -07:00
Albert Krewinkel dac059eb3e changelog: remove reverted change.
The change in template handling was reverted via #8372.
2022-10-14 19:52:38 +02:00
Albert Krewinkel 8900b0f953 Lua: Support built-in default templates for custom writers
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-14 10:37:37 -07:00
Albert Krewinkel 06ba4e9788 doc/custom-writers.md: fix formatting 2022-10-14 17:14:49 +02:00
Ilona d501199aea doc/custom-writers.md: Rephrase paragraph on format extensions (#8375) 2022-10-14 17:13:24 +02:00
John MacFarlane 27ecd894ca CI: make sure we catch benchmark build failure. 2022-10-13 23:46:07 -07:00
John MacFarlane 7312e36104 Extensions: simpler implementation based on Set.
This implementation would allow us (if we wanted) to add
an extensible Ext_custom Text constructor.
2022-10-13 23:36:25 -07:00
John MacFarlane e26c8eca69 Got benchmarks compiling with new API. 2022-10-13 23:36:25 -07:00
John MacFarlane cc8ed74c25 FlavoredFormat: add Show, Semigroup, Monad instances 2022-10-13 23:36:25 -07:00
Albert Krewinkel 64fe7b1e2f Changelog: fix some typos, attribution 2022-10-14 08:03:16 +02:00
John MacFarlane 65812a8a2f Update changelog. 2022-10-13 21:17:21 -07:00
John MacFarlane f486fcde13 Rollback parameterize options on scripting engine.
Rolls back 0ab014ed1e.
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-13 17:59:49 -07:00
Albert Krewinkel 14c7b5db20 Lua: add function pandoc.template.meta_to_context.
The functions converts Meta values to template contexts; the intended
use is in combination with `pandoc.template.apply`.
2022-10-12 10:16:01 -07:00
Albert Krewinkel 253d2e768a Lua: support extensions in custom readers.
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-12 11:58:18 +02:00