Commit graph

8240 commits

Author SHA1 Message Date
b84554880d A suggestion to turn defaultUserDataDir :: IO FilePath into defaultUserDataDirs :: IO [FilePath]
Some checks failed
CI tests / linux (map[cabal:3.2 cabalopts: ghc:8.10.7 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Has been cancelled
CI tests / linux (map[cabal:3.2 cabalopts: ghc:8.8.4 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Has been cancelled
CI tests / linux (map[cabal:3.2 cabalopts:-f-embed_data_files ghc:8.6.5 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Has been cancelled
CI tests / linux (map[cabal:3.4 cabalopts: ghc:9.0.2 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Has been cancelled
CI tests / linux (map[cabal:3.6 cabalopts: ghc:9.2.3 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Has been cancelled
CI tests / windows (push) Has been cancelled
CI tests / macos (map[cabal:3.2 ghc:8.8.4]) (push) Has been cancelled
CI tests / benchmark (map[cabal:3.2 ghc:8.10.7]) (push) Has been cancelled
CI tests / benchmark (map[cabal:3.6 ghc:9.2.2]) (push) Has been cancelled
commit-validation / check-commit-msg-length (push) Has been cancelled
2025-01-11 12:25:41 +01:00
373423d537 Forgot to mock a cabal primitive
Some checks are pending
CI tests / linux (map[cabal:3.2 cabalopts: ghc:8.10.7 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Waiting to run
CI tests / linux (map[cabal:3.2 cabalopts: ghc:8.8.4 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Waiting to run
CI tests / linux (map[cabal:3.2 cabalopts:-f-embed_data_files ghc:8.6.5 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Waiting to run
CI tests / linux (map[cabal:3.4 cabalopts: ghc:9.0.2 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Waiting to run
CI tests / linux (map[cabal:3.6 cabalopts: ghc:9.2.3 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Waiting to run
CI tests / windows (push) Waiting to run
CI tests / macos (map[cabal:3.2 ghc:8.8.4]) (push) Waiting to run
CI tests / benchmark (map[cabal:3.2 ghc:8.10.7]) (push) Waiting to run
CI tests / benchmark (map[cabal:3.6 ghc:9.2.2]) (push) Waiting to run
commit-validation / check-commit-msg-length (push) Waiting to run
2025-01-11 12:20:37 +01:00
2291a4d49e Tweaking the source to be able to compile without cabal. Compile with: ghc -iapp -isrc --make app/pandoc.hs -Wall -fno-warn-unused-do-bind -Wincomplete-record-updates -Wnoncanonical-monad-instances -Wcpp-undef -Wincomplete-uni-patterns -Widentities -Wpartial-fields -Wmissing-signatures -fhide-source-paths -Wmissing-export-lists -hide-package base64-bytestring
Some checks are pending
CI tests / linux (map[cabal:3.2 cabalopts: ghc:8.10.7 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Waiting to run
CI tests / linux (map[cabal:3.2 cabalopts: ghc:8.8.4 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Waiting to run
CI tests / linux (map[cabal:3.2 cabalopts:-f-embed_data_files ghc:8.6.5 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Waiting to run
CI tests / linux (map[cabal:3.4 cabalopts: ghc:9.0.2 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Waiting to run
CI tests / linux (map[cabal:3.6 cabalopts: ghc:9.2.3 testopts:--test-option=--hide-successes --test-option=--ansi-tricks=false]) (push) Waiting to run
CI tests / windows (push) Waiting to run
CI tests / macos (map[cabal:3.2 ghc:8.8.4]) (push) Waiting to run
CI tests / benchmark (map[cabal:3.2 ghc:8.10.7]) (push) Waiting to run
CI tests / benchmark (map[cabal:3.6 ghc:9.2.2]) (push) Waiting to run
commit-validation / check-commit-msg-length (push) Waiting to run
2025-01-11 12:13:59 +01:00
Albert Krewinkel
16d134218b HTML writer: revert to using width property for column widths
The default `flex` and `overflow-x` properties of a column are set to
`auto`. In combination, these changes allow to get good results when
using columns with or without explicit widths.
2022-08-22 15:32:39 +02:00
Albert Krewinkel
08f1f4551c
Org writer: add support for jupyter nodebook cells.
Closes: #6367
2022-08-22 12:53:58 +02:00
Albert Krewinkel
90610eb78c
Org writer: prefix code language of ipynb code blocks with jupyter-.
This is the convention used by the *emacs-jupyter* package.
2022-08-22 12:53:57 +02:00
Albert Krewinkel
a31cf9a005
Org writer: keep code block attributes as header args.
This allows to keep more information in the resulting `src` blocks,
making it easier to roundtrip from or through Org. Org babel ignores
unknown header arguments.
2022-08-22 12:53:57 +02:00
Albert Krewinkel
1de40c62fc
Org writer: add code block identifier as #+name to src blocks. 2022-08-22 12:53:50 +02:00
John MacFarlane
eb96defcc6 pandoc-server: handle citeproc parameter as documented.
Closes #8235.
2022-08-21 21:33:52 -07:00
John MacFarlane
a0d1749162 Fix regression with data uris in 2.19.1.
In 2.19.1 we used the base64URL encoding rather than base64.
This works in Safari, apparently, but not in other browsers.

Closes #8239.
2022-08-21 21:22:30 -07:00
luz paz
aff726b460 Fix typos
Found via `codespell -q 3 -S changelog.md -L bu,fo,ist,mke,multline,noes,ot,pard,pres,tabl,te,tothe`
2022-08-21 20:23:00 -07:00
Albert Krewinkel
5d66166088
Org reader: treat *emacs-jupyter* src blocks as code cells.
This improves support for notebook-like org files that are intended to be used
with emacs-jupyter package.

Closes: #8236
2022-08-21 21:53:33 +02:00
John MacFarlane
748da6d123 Handle haddock 1.11.0 API changes (not noted in their changelog). 2022-08-18 11:37:10 -07:00
Albert Krewinkel
0d19b859ce
HTML writer: use flex property for column widths
Fixes: #8232
2022-08-18 11:20:42 +02:00
John MacFarlane
8ddc2fc79a Integrate server into main pandoc.
- Remove server flag.
- Remove pandoc-server executable.
- Add Text.Pandoc.Server as exposed module. [API change]
- Re-use Opt (and our existing FromJSON instance) for Params.
- Document.
2022-08-17 12:28:14 -07:00
John MacFarlane
90d52b7129 Redo FromJSON for Opt so that optional values can be omitted.
It would have been cleaner to make all of these values Maybes,
so the JSON could be derived automatically. But this method preserves
the existing API.
2022-08-17 12:28:14 -07:00
Albert Krewinkel
f294acff38
Org reader: treat "abstract" block as metadata
A block of type "abstract" is assumed to define the document's abstract.
It is transferred from the main text to the metadata.

Closes: #8204
2022-08-17 16:49:37 +02:00
Albert Krewinkel
81e31ee637
LaTeX writer: add label to tables that have an identifier
Tables with an identifier are marked with a `\label`. A caption is
always included in this case, even if the caption is empty.

Closes: #8219
2022-08-17 12:39:07 +02:00
John MacFarlane
473a9b15be LaTeX writer: use \textquotesingle for straight quotes in text. 2022-08-16 09:52:16 -07:00
John MacFarlane
4f8ee2212a T.P.Highlighting: Export lookupHighlightingStyle.
[API change]
Previously this lived in an unexported module
T.P.App.CommandLineOptions, under the name `lookupHighlightStyle`.
2022-08-14 22:50:57 -07:00
John MacFarlane
6625e9655e Use base64 instead of base64-bytestring.
It is supposed to be faster and more standards-compliant.
2022-08-14 16:33:37 -07:00
John MacFarlane
6274327398 App: Remove unneeded MonadIO constraints in readSources. 2022-08-13 20:36:44 -07:00
John MacFarlane
62ddc1ae54 PDF: Use some standard PandocMonad functions instead of liftIO. 2022-08-13 18:18:26 -07:00
John MacFarlane
34e00caee5 Factor out convertWithOpts' from convertWithOpts.
This runs in any PandocMonad, MonadIO, MonadMask instance.
2022-08-13 17:10:31 -07:00
John MacFarlane
55c524e83c Support --strip-comments in commonmark/gfm.
This change makes the commonmark reader sensitive to
`readerStripComments`.

Closes #8222.
2022-08-13 12:58:40 -07:00
Albert Krewinkel
5a99747063 Lua: add function pandoc.utils.citeproc
The function runs the *citeproc* processor on a Pandoc document.
Exposing this functionality to Lua allows to make citation processing
part of a filter or writer, simplifies the creation of multiple
bibliographies, and enables the use of varying citation styles in
different parts of a document.
2022-08-13 12:30:13 -07:00
Albert Krewinkel
18484cbf47
LaTeX writer: fix widths of multicolumn cells
Fixes: #8218
2022-08-07 22:10:15 +02:00
John MacFarlane
2bb3f33296 FB2 writer: fix handling of non-section Divs.
This allows the writer to recurse into those Divs and
find new sections inside them. See #8123.
2022-08-03 16:09:03 -07:00
John MacFarlane
c9027fb834 Deprecate deLink. 2022-08-03 12:17:09 -07:00
Albert Krewinkel
0d7f80c87f
HTML reader: allow sublists that are not marked as items.
The HTML standard requires all list items to be marked with a `<li>`
tag, but some tools fail to do so for sublists. The reader now accepts
these unwrapped lists as sublists.

Closes: #8150
2022-08-03 15:00:35 +02:00
Albert Krewinkel
b306f2e1fd
Org reader: add missing / to Windows file URI; fixes prev commit 2022-08-03 09:51:13 +02:00
Albert Krewinkel
096863e0ad fillMediaBag: Keep attributes of original image on Span
Images that cannot be fetched are replaced with a Span that contains the
image's description. The span now also retains all original image
attributes and inherits all attributes of the image. Furthermore, the
classes `image` and `placeholder` are added, and path and title are
store in attributes `original-image-src` and `original-image-title`,
respectively.

Closes: #8099
2022-08-02 20:09:14 -07:00
Albert Krewinkel
516c827d61
Org reader: recognize absolute paths on Windows
Fixes: #8201
2022-08-02 23:49:10 +02:00
Albert Krewinkel
7a4afce60c Markdown reader: allow special span classes in any position 2022-08-01 10:03:48 -07:00
Albert Krewinkel
f4a7c0b799 Markdown reader: allow more attributes in special spans
Spans with "smallcaps" as the first class are converted to *SmallCaps*
elements. While previously no other classes or attributes were allowed,
additional classes, attributes, and an identifier are not permitted and
kept in a *SmallCaps* wrapping *Span* element.

The same change is applied to underline spans, where the first class
must be either "ul" or "underline".

Closes: #4102
2022-08-01 10:03:48 -07:00
Albert Krewinkel
c015c35a8a
Support rowspans and colspans in grid tables (#8202)
* Add tests for zero-width and fullwidth chars in grid tables

* T.P.Parsing: simplify `gridTableWith'`, `gridTableWith` [API Change]
  The functions `gridTableWith` and `gridTableWith'` no longer takes a
  boolean argument that toggles whether a table head should be parsed:
  both, tables with heads and without heads, are always accepted now.

* Support colspans, rowspans, and multirow headers in grid tables.

  Grid tables in Markdown, reStructuredText, and Org can now contain cells
  spanning over multiple columns and/or multiple rows; table headers
  containing multiple rows are supported as well.

Note: the markdown writer does not yet support these more complex grid
table features.
2022-07-30 08:56:44 -07:00
John MacFarlane
f637ccd3bf MediaWiki reader: allow HTML comment after row start.
Closes #8110.
2022-07-28 11:28:02 -07:00
John MacFarlane
5c3423f2e2 DokuWiki reader: support latex plugin and math.
The `tex_math_dollars` extension is now supported for `dokuwiki`
(but off by default).

Content inside `<latex>...</latex>` is parsed as raw LaTeX inline,
and inside `<LATEX>..</LATEX>` as raw LaTeX block.

In addition, this commit changes the behavior of `<php>...</php>` so
that instead of producing a code block, it produces raw HTML
with `<?php ... ?>`.

Closes #8178.
2022-07-28 11:28:02 -07:00
Albert Krewinkel
aaf69044b1
Populate mediabag after filters have run. (#8114)
The mediabag is filled with document resources after the filters have
run. This allows, for example, filter authors to modify image paths
before pandoc tries to fetch the images.

Lua filters that rely on a filled mediabag can use the new
`pandoc.mediabag.fill` function to perform that action in the filter.

Closes: #8099
2022-07-28 10:50:00 -07:00
John MacFarlane
1f83f19c92 EPUB writer: allow choice of math method for v3.
Previously we always used MathML for math in EPUB3, because
the spec includes MathML.  But this is not widely supported
by readers, so it seems better to allow users to choose their
math method as they can with EPUB2 or HTML.

Closes #8164.

NOTE!  Existing workflows that produce EPUBv3 documents including
math will be affected by this change.  You must add `--mathml` to
your command line if you want to continue producing MathML.
2022-07-26 10:29:18 -07:00
John MacFarlane
ac7fa3da4d HTML writer: Allow "spanlike" classes to be combined.
Previously classes like "underline" and "marked" had to
be the first class in a span in order for the span to be
interpreted as a "ul" or "mark" element.  This commit allows
these special classes to be "stacked," e.g.
`[test]{.mark .underline}`; in addition, the special classes are no
longer required to come first in the list of classes.

See #8194 for context.
2022-07-25 11:55:48 -07:00
John MacFarlane
4ea51b6e96 --self-contained: Handle url() in style elements.
Previously we handled these in included CSS files but not
in style elements.

Closes #8193.
2022-07-23 00:34:09 +02:00
John MacFarlane
e90ce8e1ab Unescape characters in \lstinline inside \passthrough.
For full motivation, see #1629 ; this improves on
99e24cf183.

Closes #8179.
2022-07-18 19:52:33 +02:00
Albert Krewinkel
dfbfbfbf24
Parsing.GridTable: remove use of unsafe function last 2022-07-18 12:14:54 +02:00
John MacFarlane
98fb8521a7 RST writer: Fix missing spaces with nested inlines.
Previously spaces around links inside italics were omitted.

Closes #8182.
2022-07-16 15:49:45 +02:00
Albert Krewinkel
daef24f022
Lua: extend pandoc.system module. (#8184)
The module now has the additional functions `list_directory`,
`make_directory`, and `remove_directory`. This makes it easier to write
cross-platform scripts that need to inspect or modify the file system.
2022-07-15 21:22:33 +02:00
Albert Krewinkel
12cc140272
Lua: add fields pandoc.readers and pandoc.writers. (#8177)
The set of supported input and output formats is made available to Lua
users.
2022-07-12 20:14:42 +02:00
John MacFarlane
c7f5fd2400 RST writer: always escape literal backslash.
Previously we didn't escape it when it is word-internal,
but that seems wrong.  See #8178.
2022-07-12 20:11:05 +02:00
John MacFarlane
cf57a8344a Fix roff ms syntax highlighting definitions.
Begin each string definition with `\&`.
Closes #8175. Thanks to Branden Robinson.
2022-07-11 23:58:13 +02:00
John MacFarlane
56051c8ac3 RTF reader: support \nosupersub.
Closes #8170.
2022-07-07 22:56:29 +02:00