Commit graph

568 commits

Author SHA1 Message Date
John MacFarlane
9b8a691782 Update manual date and man page. 2021-08-20 21:56:32 -07:00
John MacFarlane
13cf02acfd MANUAL.txt/security: add a note on security risks of include directives. 2021-08-20 21:43:22 -07:00
William Lupton
5159d6653b Clarify that each YAML block is a separate YAML document 2021-08-19 10:37:24 -07:00
John MacFarlane
10dfd81000 Document new link-bibliography metadata field.
This affects whether hyperlinks are added to the bibliography
by citeproc.
2021-08-17 15:33:49 -07:00
Emily Bourke
72823ad947 pptx: Select layouts from reference doc by name
Until now, users had to make sure that their reference doc contains
layouts in a specific order: the first four layouts in the file had to
have a specific structure, or else pandoc would error (or sometimes
successfully produce a pptx file, which PowerPoint would then fail to
open).

This commit changes the layout selection to use the layout names rather
than order: users must make sure their reference doc contains four
layouts with specific names, and if a layout with the right name isn’t
found pandoc will output a warning and use the corresponding layout from
the default reference doc as a fallback.

I believe the use of names rather than order will be clearer to users,
and the clearer errors will help them troubleshoot when things go wrong.

- Add tests for moved layouts
- Add tests for deleted layouts
- Add newly included layouts to slideMaster1.xml to fix tests
2021-08-17 09:35:25 -07:00
OCzarnecki
e37cf4484d
Multimarkdown sub- and superscripts (#5512) (#7188)
Added an extension `short_subsuperscripts` which modifies the behavior
of `subscript` and `superscript`, allowing subscripts or superscripts containing only
alphanumerics to end with a space character (eg. `x^2 = 4` or `H~2 is
combustible`).  This improves support for multimarkdown. Closes #5512.

Add `Ext_short_subsuperscripts` constructor to `Extension` [API change].
This is enabled by default for `markdown_mmd`.
2021-08-15 21:57:57 -07:00
John MacFarlane
72447a563c Remove documentation for .ul shortcut for now.
See #7307.  Motivation: there is talk of removing this.
2021-08-15 21:44:46 -07:00
John MacFarlane
4340bd52c4 Make docx writer sensitive to native_numbering extension.
Figure and table numbers are now only included if `native_numbering`
is enabled.  (By default it is disabled.)  This is a behavior change
with respect to 2.14.1, but the behavior is that of previous versions.

The change was necessary to avoid incompatibilities between pandoc's
native numbering and third-party cross reference filters like
pandoc-crossref.

Closes #7499.
2021-08-15 15:05:54 -07:00
William Lupton
649133fe5e
Document use of the 'underline' class. (#7492)
Addresses a comment in #7484.
2021-08-12 10:18:22 -07:00
William Lupton
f00f7ec63c
Clarify internal punctuation in citation keys. (#7491)
Addresses a comment in #5458.
2021-08-11 11:12:45 -07:00
John MacFarlane
6543b05116 Add RTF reader.
- `rtf` is now supported as an input format as well as output.
- New module Text.Pandoc.Readers.RTF (exporting `readRTF`). [API change]

Closes #3982.
2021-08-10 10:48:55 -07:00
John MacFarlane
c0b68b2030 Allow --slide-level=0.
When the slide level is set to 0, headings won't be used at all
in splitting the document into slides. Horizontal rules must be
used to separate slides.

Closes #7476.
2021-08-08 11:20:26 -07:00
John MacFarlane
6acb674e89 Remove obsolete and incorrect sentence in --slide-level docs. 2021-08-08 11:17:28 -07:00
John MacFarlane
c909d16ccc Bump to 2.14.1, update changelog and man page. 2021-07-18 11:39:04 -07:00
Michael Hoffmann
565330033a
Don't incorporate externally linked images in EPUB documents (#7430)
Just like it is possible to avoid incorporating an image in EPUB by
passing `data-external="1"` to a raw HTML snippet, this makes the same
possible for native Images, by looking for an associated `external`
attribute.
2021-07-07 09:26:37 -07:00
John MacFarlane
0c4ed0045a Bump to 2.14.0.3, update changelog, require latest skylighting. 2021-06-20 19:25:43 -07:00
John MacFarlane
961268446c Rephrase section on unsafe HTML in manual. 2021-06-14 12:36:05 -07:00
John MacFarlane
67b3c36a93 Bump to 2.14.0.2, update chaneglog and manual. 2021-06-10 22:47:53 -07:00
John MacFarlane
3776e828a8 Fix MediaBag regressions.
With the 2.14 release `--extract-media` stopped working as before;
there could be mismatches between the paths in the rendered document and
the extracted media.

This patch makes several changes (while keeping the same API).

The `mediaPath` in 2.14 was always constructed from the SHA1 hash of
the media contents.  Now, we preserve the original path unless it's
an absolute path or contains `..` segments (in that case we use a path
based on the SHA1 hash of the contents).

When constructing a path from the SHA1 hash, we always use the
original extension, if there is one. Otherwise we look up an
appropriate extension for the mime type.

`mediaDirectory` and `mediaItems` now use the `mediaPath`, rather
than the mediabag key, for the first component of the tuple.
This makes more sense, I think, and fits with the documentation
of these functions; eventually, though, we should rework the API so that
`mediaItems` returns both the keys and the MediaItems.

Rewriting of source paths in `extractMedia` has been fixed.

`fillMediaBag` has been modified so that it doesn't modify
image paths (that was part of the problem in #7345).

We now do path normalization (e.g. `\` separators on Windows) only
in writing the media; the paths are left unchanged in the image
links (sensibly, since they might be URLs and not file paths).

These changes should restore the original behavior from before 2.14.

Closes #7345.
2021-06-10 16:47:02 -07:00
Sebastian Humenda
39afd4297f Mention GladTeX for EPUB export
This updates the manual and the web site about the GladTeX usage.
2021-06-07 19:17:39 -06:00
John MacFarlane
a54a19cca5 MANUAL: more details and a useful link for YAML syntax. 2021-06-02 22:48:56 -06:00
John MacFarlane
677ccb7138 Bump to 2.14.0.1; update changelog and man page. 2021-05-31 22:07:12 -06:00
John MacFarlane
a7a603cc04 Update manual. 2021-05-28 15:13:22 -07:00
John MacFarlane
4b16d181e7 rebase_relative_paths: leave empty paths unchanged. 2021-05-27 14:16:37 -07:00
John MacFarlane
0661ce699f rebase_relative_paths extension: don't change fragment paths.
We don't want a pure fragment path to be rewritten, since
these are used for cross-referencing.
2021-05-27 13:53:26 -07:00
John MacFarlane
6972a7dc91 Modify rebase_reference_links treatment of reference links/images.
The directory is based on the file containing the link
reference, not the file containing the link, if these differ.
2021-05-27 11:26:38 -07:00
John MacFarlane
cbe16b2866 Citeproc: Don't detect math elements as locators.
Closes #7321.
2021-05-27 10:49:45 -07:00
John MacFarlane
834da53058 Add rebase_relative_paths extension.
- Add manual entry for (non-default) extension
  `rebase_relative_paths`.
- Add constructor `Ext_rebase_relative_paths` to `Extensions`
  in Text.Pandoc.Extensions [API change]. When enabled, this
  extension rewrites relative image and link paths by prepending
  the (relative) directory of the containing file.
- Make Markdown reader sensitive to the new extension.
- Add tests for #3752.

Closes #3752.

NB. currently the extension applies to markdown and associated
readers but not commonmark/gfm.
2021-05-27 10:38:25 -07:00
Tristan Stenner
0226d2320f Add citation example for locators and suffixes 2021-05-27 10:30:37 -07:00
John MacFarlane
4b229e5955 Regenerate man page. 2021-05-21 11:41:37 -07:00
John MacFarlane
8c9f0a62c1 Fix link to KDE syntax highlighting docs.
Closes jgm/pandoc-website#51.
2021-05-21 07:51:27 -07:00
John MacFarlane
7efb71f4f6 Revisions to citation syntax description update. 2021-05-19 10:43:53 -07:00
John MacFarlane
d452155bcf Update documentation on citation syntax. 2021-05-19 10:20:37 -07:00
John MacFarlane
bf73a15197 MANUAL: note that institute variable works for HTML-based slides. 2021-05-15 09:58:43 -07:00
Albert Krewinkel
46baf6659d
MANUAL: add info about YAML escape sequences, link to spec.
Closes: #7152
2021-05-14 22:48:40 +02:00
John MacFarlane
76a4e7127b Beamer writer: support exampleblock and alertblock.
A block will be rendered as an exampleblock if the heading
has class `example` and alertblock if it has class `alert`.

Closes #7278.
2021-05-14 10:09:46 -07:00
John MacFarlane
3f09f53459 Implement curly-brace syntax for Markdown citation keys.
The change provides a way to use citation keys that contain
special characters not usable with the standard citation
key syntax.  Example: `@{foo_bar{x}'}` for the key `foo_bar{x}`.
Closes #6026.

The change requires adding a new parameter to the `citeKey`
parser from Text.Pandoc.Parsing [API change].

Markdown reader: recognize @{..} syntax for citatinos.

Markdown writer:  use @{..} syntax for citations when needed.

Update manual with curly-brace syntax for citations.

Closes #6026.
2021-05-13 21:59:32 -07:00
John MacFarlane
c46482bfc3 Update manual date and man page. 2021-05-13 14:11:15 -07:00
John MacFarlane
4f858a6a49 MANUAL: Add information about lang and bibliography sorting. 2021-04-18 09:09:53 -07:00
John MacFarlane
c389211e2f Support yaml_metadata_block extension form commonmark, gfm.
This is a bit more limited than with markdown, as documented
in the manual:

- The YAML block must be the first thing in the input.
- The leaf notes are parsed in isolation from the rest of
  the document.  So, for example, you can't use reference
  links if the references are defined later in the document.

Closes #6537.
2021-03-20 15:58:33 -07:00
John MacFarlane
80ae929922 Update man page and manual date. 2021-03-20 00:40:04 -07:00
John MacFarlane
3a763ac770 Update date in changelog and manual. 2021-03-08 07:45:23 -08:00
John MacFarlane
735a69de6b Allow --resource-path to accumulate.
Previously, if `--resource-path` were used multiple times, the last
resource path would replace the others.

With this change, each time `--resource-path` is used, it prepends
the specified path components to the existing resource path.

Similarly, when `resource-path` is specified in a defaults file,
the paths provided will be prepended to the existing resource
path.

This change also allows one to avoid using the OS-specific path
separator; instead, one can simply use `--resource-path`
a number of times with single paths. This form of command
will not have an OS-dependent behavior.

This change facilitates the use of multiple, small defaults
files: each can specify a directory containing its own
resources without clobbering the resource paths set by
the others.

Closes #6152.
2021-03-06 10:32:51 -08:00
John MacFarlane
df00cf05cb Allow ${.} in defaults files paths...
to refer to the directory where the default file is.
This will make it possible to create moveable
"packages" of resources in a directory.

Closes #5871.
2021-03-05 11:56:41 -08:00
John MacFarlane
6dd7520cc4 Implement environment variable interpolation in defaults files.
This allows the syntax `${HOME}` to be used, in fields that expect
file paths only.  Any environment variable may be interpolated
in this way. A warning will be raised for undefined variables.
The special variable `USERDATA` is automatically set to the
user data directory in force when the defaults file is parsed.
(Note: it may be different from the eventual user data directory,
if the defaults file or further command line options change that.)

Closes #5982.
Closes #5977.
Closes #6108 (path not taken).
2021-03-05 10:46:01 -08:00
John MacFarlane
5f9327cfc8 Shared: Change defaultUserDataDirs -> defaultUserDataDir.
Rationale: the manual says that the XDG data directory will
be used if it exists, otherwise the legacy data directory.
So we should just determine this and use this directory,
rather than having a search path which could cause some
things to be taken from one data directory and others from
others.

[API change]
2021-03-05 10:25:18 -08:00
John MacFarlane
030209fc29 Revert "Revert "Relax --abbreviations rules so that a period isn't required.
This reverts commit 916ce4d511.

I was confused in thinking it wouldn't work.
2021-03-04 16:25:13 -08:00
John MacFarlane
916ce4d511 Revert "Relax --abbreviations rules so that a period isn't required."
This reverts commit e461b7dd45.

Ill-advised change.  This doesn't work because we parse
strings in chunks.
2021-03-04 16:22:08 -08:00
John MacFarlane
e461b7dd45 Relax --abbreviations rules so that a period isn't required.
Partially addresses #7124.
2021-03-04 16:02:46 -08:00
John MacFarlane
bd988beb38 Update date on manual. 2021-03-04 08:49:45 -08:00