Commit graph

6895 commits

Author SHA1 Message Date
Albert Krewinkel
c3a00c1fdc
Org writer: remove extra spaces from table cells
Closes: #6024
2020-01-03 00:00:57 +01:00
John MacFarlane
2c1a911bc1 LaTeX writer: properly handle unnumbered headings level 4+.
Closes #6018.

Previously the `\paragraph` command was used instead of
`\paragraph*` for unnumbered level 4 headings.
2020-01-01 22:32:27 -07:00
John MacFarlane
4affd40194 BCP47: change getLang so it can handle block-level contents.
Some readers (e.g. RST) will populate the `lang` metadata field
with block-level content.  `getLang` has been modified to handle
this.  Previously in these cases the LaTeX writer would not properly
set the "main language" of the document.

Closes #6008.
2019-12-30 23:21:22 -07:00
John MacFarlane
82f44592ae Fix parsing bug affected indented code after raw HTML.
Closes #6009, #5360.
2019-12-27 13:08:22 -08:00
John MacFarlane
b8bd845542 Add a needed try. 2019-12-27 10:37:01 -08:00
Felix Yan
1ff732269e Use HTTPS in copyright message (#6010)
Since the website now redirect to https automatically, it would be nice to just use https in the help text.
2019-12-26 12:26:24 -08:00
John MacFarlane
71fab252d5 Ensure that later default file values for variable replace earlier ones.
The semigroup instance for doctemplates Context does a left-biased
union on the underlying Map.  That means that if you union
`{a: 1}` and `{a: 2}`, you get `{a: 1}`.  This commit causes
pandoc to do the operation in the opposite order, so that later
default files take precedence in the values they assign to
keys.

See #5988.
2019-12-22 22:01:30 -08:00
John MacFarlane
eca39d6cf1 HTML writer: more tweaks to avoid round-trip failures...
having to do with makeSections.
2019-12-21 12:26:29 -08:00
John MacFarlane
42f0b0cdab Fix regression with --number-sections.
Starting with 2.8, `--number-sections` also had the
effect of `--section-divs`, even if `--section-divs` was
not specified.
2019-12-21 09:20:07 -08:00
Jared Lander
e77c218fbc Added glsl mime type for WebGL maps (#6000)
Added glsl mime type for WebGL maps
2019-12-20 22:01:18 -08:00
Albert Krewinkel
2c13773be8
Jira writer: use jira-wiki-markup renderer
Pandoc's AST is translated into the Jira AST, which is then rendered by
the dedicated Jira printer.

The following improvements are included in this change:

- non-jira raw blocks are fully discarded instead of showing as blank
  lines;
- table cells can contain multiple blocks;
- unnecessary blank lines are removed from the output;
- markup chars within words are properly surrounded by braces;
- preserving soft linebreaks via `--wrap=preserve` is supported.

Note that backslashes are rendered as HTML entities, as there appears no
alternative to produce a plain backslash if it is followed by markup.
This may cause problems when used with confluence, where rendering seems
to fail in this case.

Closes: #5926
2019-12-20 17:12:46 +01:00
Albert Krewinkel
b06124e43a
Org reader: report errors properly
Errors during parsing are now returned in full and no longer replaced by
a custom message.
2019-12-19 20:39:29 +01:00
Albert Krewinkel
0a3cc7260c
Org reader: fix parsing problem for colons in headline
Fixed a problem where words surrounded by colons could causing parse
failures in some cases when they occurred in headers.

Fixes: #5993
2019-12-19 20:38:51 +01:00
Albert Krewinkel
5bd2d28b19
Org reader: wrap named table in div, using name as id
Closes: #5984
2019-12-18 22:28:26 +01:00
Albert Krewinkel
96c80b156d Add jira reader (#5913)
Closes #5556
2019-12-17 21:07:46 -08:00
John MacFarlane
d0918627ca Improved --toc generation. 2019-12-17 11:59:52 -08:00
John MacFarlane
80728c8b31 PDF: Ensure UTF8 when printing source in --verbose mode.
This may fix #5997.
2019-12-17 11:59:52 -08:00
John MacFarlane
01b89d87f4 Templates: strip directory before trying to find partial in data files.
Closes #5987.
2019-12-17 11:59:52 -08:00
John MacFarlane
20cf4e47b0 Improved makeSections so we don't get doubled attributes.
Closes #5986.
2019-12-17 11:59:52 -08:00
John MacFarlane
11bab77120 HTML reader: Add "nav" to list of block-level tags. 2019-12-17 11:59:52 -08:00
Albert Krewinkel
75dc013036
Org reader: add table labels to caption if both are present
The table `#+NAME:` or `#+LABEL:` is added to the table's caption in the
form of an empty span with the label set as the span's ID.

Closes: #5984
2019-12-13 16:22:04 +01:00
John MacFarlane
2af13ef05a Change misleading module comment. 2019-12-12 11:16:40 -08:00
John MacFarlane
817d2048da Improved template API and fixed a bug. Closes #5979.
* Text.Pandoc.Templates [API change]

  + Add Monad wrappers `WithDefaultPartials` and `WithPartials`.
    Wrapping these around an instance of `PandocMonad` gives
    us different instances of `TemplateMonad`, with different
    search behavior in retrieving partials.
    To compile a template and limit partial search to pandoc's
    data files, use `runWithDefaultPartials (compileTemplate ...)`.
    To compile a template and allow partials to be found locally
    (either on the file system or via HTTP, in the event that
    the main template has an absolute URL), ue
    `runWithPartials (compileTemplate ...)`.

  + Export `getTemplate`, which seeks a template locally,
    or via HTTP if the template has an absolute URL, falling
    back to the data files if not found.

  + Export `compileDefaultTemplate` -- does `getDefaultTemplate`
    and compiles the result, raising an error on failure.

* Text.Pandoc.Class [API change]

  + Remove `TemplateMonad` instances for `PandocIO` and `PandocPure`.
    These were too limiting and caused a bug whereby a local
    partial could be used even when the default template was requested.
    We now rely on instances provided in the Templates module.

Text.Pandoc.App.OutputSettings

  + Simplify template retrieval code.
2019-12-11 10:53:24 -08:00
John MacFarlane
a6297d252e More informative JSON parse error.
Closes #5973.
2019-12-09 07:25:37 -08:00
John MacFarlane
0bfe478a69 Use external emojis package.
Moved the emoji-specified code into an external package
we can depend on.
2019-12-08 17:27:18 -08:00
John MacFarlane
8d00331115 Fix --toc-depth regression in 2.8.
Closes #5967.
2019-12-07 15:15:55 -08:00
John MacFarlane
0b54d6282b Fix --toc-depth regression in 2.8.
Closes #5967.
2019-12-07 14:20:41 -08:00
John MacFarlane
d96f1fdc40 Avoid deprecation warning for minimumDef using CPP. 2019-12-05 10:35:16 -08:00
John MacFarlane
992f77c17c Roll back part of of --shift-heading-level-by change.
With positive heading shifts, starting in 2.8 this option caused
metadata titles to be removed and changed to regular headings.
This behavior is incompatible with the old behavior of
`--base-header-level` and breaks old workflows, so with this
commit we are rolling back this change.

Now, there is an asymmetry in positive and negative heading
level shifts:

+ With positive shifts, the metadata title stays the same and
  does not get changed to a heading in the body.
+ With negative shifts, a heading can be converted into the
  metadata title.

I think this is a desirable combination of features, despite
the asymmetry.  One might, e.g., want to have a document
with level-1 section headigs, but render it to HTML with
level-2 headings, retaining the metadata title (which pandoc
will render as a level-1 heading with the default template).

Closes #5957.
Revises #5615.
2019-12-05 09:59:50 -08:00
John MacFarlane
79a10388da HTML writer: add task-list class to ul if all elements are task list items.
This will allow styling unordered task lists in a way that omits
the bullet.
2019-12-05 09:32:40 -08:00
John MacFarlane
4489283b03 Fix makeSections so it doesn't turn column divs into sections. 2019-12-05 09:17:28 -08:00
John MacFarlane
28a2a6e534 Fix regression with behavior of --variable.
Previously -Vfoo=1 -Vfoo=2 would produce a list value for foo;
with 2.8 it produced just '2'.  This commit restores the earlier
beahvior.

Closes #5962.
2019-12-04 17:49:12 -08:00
John MacFarlane
6c435a17cd Move data/emoji.json to emoji.json, add to extra-source-files.
This doesn't really belong in data-files as it's not loaded
dynamically.
2019-12-03 16:38:19 -08:00
John MacFarlane
67f5d65cd5 Add ascii_identifiers as a supported extension for markdown.
This fixes a regression in 2.8.
2019-11-29 11:27:05 -08:00
John MacFarlane
36b4c04ffd Use [|..|] syntax to simplify Emoji.TH. 2019-11-27 21:50:55 -08:00
John MacFarlane
14ed6fa141 Remove redundant import. 2019-11-27 21:32:00 -08:00
John MacFarlane
0d0ec98dd5 Generate Emoji module with TH.
- Add Text.Pandoc.Emoji.TH.
- Replace long literal list in Text.Pandoc.Emoji with one-liner
  generating it from data/emoji.json using TH.
- Add Makefile target to download data/emoji.json.
- Remove tools/emoji.hs.
2019-11-27 21:31:53 -08:00
John MacFarlane
8a42ca41cf LaTeX writer - hlint. 2019-11-27 10:04:00 -08:00
John MacFarlane
982d2f6cd3 HTML writer: hlint improvements. 2019-11-27 09:52:11 -08:00
John MacFarlane
3accc2a5cd Removed useless cpp for old versions of blaze. 2019-11-27 09:45:00 -08:00
John MacFarlane
0f800b9d37 Removed unneeded pragma. 2019-11-27 09:40:24 -08:00
John MacFarlane
b4f434ae0d Add pdf to list of output formats (--list-output-formats).
Closes #5938.
2019-11-26 09:28:05 -08:00
John MacFarlane
421ae44cdf EPUB writer: Fix regression with `--css option.
Closes #5937.
2019-11-25 17:50:27 -08:00
John MacFarlane
ce0a4f8c47 RST writers: Use grid tables for 1-column tables.
With simple tables, we have a clash with heading syntax.
Closes #5936.
2019-11-25 07:31:28 -08:00
John MacFarlane
659ee98176 Add unexported Text.Pandoc.Readers.Metadata.
For YAML metadata parsing. A step in the direction of #5914.
No API change.
2019-11-24 11:50:28 -08:00
Albert Krewinkel
d948e13fea Jira writer: improve escaping of special chars (#5925)
Backslash-escaping is used instead of HTML entities, as escaped
characters are easier to read this way. Furthermore, Confluence, which
seems to use a subset of Jira markup, seems to get confused by HTML
entities.
2019-11-22 07:57:24 -08:00
Jose Luis Duran
ff8d143836 LaTeX reader: parse \micro siunitx unit command (#5921)
This was somehow missed in 884aef31c5.
2019-11-21 09:22:53 -08:00
John MacFarlane
5a7a4451ca TEI writer: don't strip hash from internal links.
Closes #5922.
2019-11-21 09:21:15 -08:00
Brian Wignall
a946424e3c Fix typos (#5919) 2019-11-20 09:44:23 -08:00
John MacFarlane
c1b51b1282 Improve markdown escaping in list items.
Closes #5918.
2019-11-19 22:33:14 -08:00