Commit graph

8514 commits

Author SHA1 Message Date
John MacFarlane
17ce813060 hlint refactoring. 2017-03-04 12:02:16 +01:00
John MacFarlane
beb94c53e9 Add hanging indent to log messages.
This makes them easier to read.
2017-03-04 11:26:49 +01:00
John MacFarlane
69b3a369ca HTML writer: issue warning if no title specified and template used.
See #3473.
2017-03-04 11:14:41 +01:00
John MacFarlane
87764b1c46 Logging: Added NoTitleElement constructor for LogMessage. 2017-03-04 11:13:54 +01:00
John MacFarlane
9925739ba9 Require skylighting 0.3.1. 2017-03-04 10:33:52 +01:00
John MacFarlane
37152f9351 Document that html5 output is polyglot compatible. 2017-03-04 10:12:33 +01:00
John MacFarlane
a99d0c6b42 Merge branch 'master' of github.com:jgm/pandoc 2017-03-04 10:08:51 +01:00
John Luke Bentley
07d51d9e30 Make default.html5 polyglot markup conformant. (#3473)
Polyglot markup is HTML5 that is also valid XHTML. See
<https://www.w3.org/TR/html-polyglot>.  With this change, pandoc's
html5 writer creates HTML that is both valid HTML5 and valid XHTML.
See jgm/pandoc-templates#237 for prior discussion.

* Add xml namespace to `<html>` element.
* Make all `<meta>` elements self closing.
  See <https://www.w3.org/TR/html-polyglot/#empty-elements>.
* Add `xml:lang` attribute on `<html>` element, defaulting to blank, and
  always include `lang` attribute, even when blank.  See
  <https://www.w3.org/TR/html-polyglot/#language-attributes>.
* Update test files for template changes.

The key justification for having language values default to blank: it
turns out the HTML5 spec requires it (as I read it).  Under
[the HTML5 spec, section "3.2.5.3. The lang and xml:lang
attributes"](https://www.w3.org/TR/html/dom.html#the-lang-and-xmllang-attributes),
providing attributes with blank contents both:

    * Has meaning, "unknown", and
    * Is a MUST (written as "must") if a language value is not provided ...

> The lang attribute (in no namespace) specifies the primary language
> for the element's contents and for any of the element's attributes that
> contain text. Its value must be a valid BCP 47 language tag, or the
> empty string. Setting the attribute to the empty string indicates that
> the primary language is unknown.

In short, it seems that where a language value is not provided then a
blank value MUST be provided for Polyglot Markup conformance, because
the HTML5 spec stipulates a "must". So although the Polyglot Markup spec
is unclear on this issue it would seem that if it was correctly written,
it would therefore require blank attributes.

Further justifications are found at
https://github.com/jgm/pandoc-templates/issues/237#issuecomment-275584181
(but the HTML5 spec justification given above would seem to be the
clincher).

In addition to having lang-values-default-to-blank I recommend that, when an
author does not provide a lang value, then upon on pandoc command execution
a warning message like the following be provided:

> Polyglot markup stipulates that 'The root element SHOULD always specify
> the language'. It is therefore recommended you specify a language value in
> your source document. See
> <https://www.w3.org/International/articles/language-tags/> for valid
> language values.
2017-03-04 10:08:38 +01:00
John MacFarlane
9616a8a2dd OpenDocument writer: Clarified some code. 2017-03-03 23:16:15 +01:00
John MacFarlane
ce9d49ef04 OpenDocument writer: fixed dropped elements in some ordered lists.
Closes #2434.
2017-03-03 22:48:37 +01:00
John MacFarlane
fb47d1d909 RST reader: support RST-style citations.
The citations appear at the end of the document as a definition
list in a special div with id `citations`.

Citations link to the definitions.

Added stateCitations to ParserState.

Closes #853.
2017-03-03 22:23:01 +01:00
John MacFarlane
d18a1c1c9e Docx writer: Don't include bookmarks on headers unless non-null id.
Closes #3476.
2017-03-03 21:13:08 +01:00
John MacFarlane
dc9788b6dc Pretty: don't error for blocks of size < 1.
Instead, resize to 1.

Note, this (together with earlier changes to the Markdown
writer) seems to fix #1785.

The table renders as garbage, but pandoc now completes the conversion
quickly and doesn't get tied up.
2017-03-03 15:01:23 +01:00
Alexander Krotov
24f027fe8d ConTeXt writer: remove unnecessary $ (#3482) 2017-03-03 10:43:17 +01:00
John MacFarlane
4d25bba5f7 RST reader: Handle multiline cells in simple tables.
Closes #1166.
2017-03-02 16:48:53 +01:00
John MacFarlane
46135ac875 LaTeX writer: add \leavevmode before hypertarget at start of paragraph.
Closes #2704 (formatting problems in beamer citations).

See
http://tex.stackexchange.com/questions/22852/function-and-usage-of-leavevmode
2017-03-02 12:13:20 +01:00
John MacFarlane
8709b7cf80 LaTeX writer: use % after hypertarget before code block 2017-03-02 12:13:02 +01:00
John MacFarlane
9e50319df3 LaTeX writer: minor tweak to hypertarget (semantically irrelevant). 2017-03-02 11:53:31 +01:00
John MacFarlane
a69cfa0178 Removed unnecessary import. 2017-03-02 11:28:29 +01:00
John MacFarlane
81028e2dce Bumped syb upper bound. 2017-03-02 10:42:07 +01:00
John MacFarlane
fa59e2ef28 Markdown reader: when splitting pipe table cells, skip tex math.
You might have a `|` character inside math.
(Or for that matter something that the parser might mistake
for raw HTML.)

See #3481.
2017-03-02 10:25:12 +01:00
John MacFarlane
fe4311d5a1 LaTeX writer: always add hypertarget when there's a non-empty identifier.
Previously the hypertargets were only added when there was actually
a link to that identifier.  Closes #2719.
2017-03-01 21:38:28 +01:00
John MacFarlane
d21c7fee66 LaTeX reader: don't drop contents of \hypertarget. 2017-03-01 21:05:29 +01:00
Alexander Krotov
39a8359b57 Writers: Use gets to access MonadState where possible (#3480) 2017-03-01 20:36:54 +01:00
John MacFarlane
ea619bfcb4 Markdown writer: Fixed grid tables embedded in grid tables.
Closes #2834.
2017-03-01 17:41:14 +01:00
John MacFarlane
8b641f38ca Markdown writer: Refactored gridTable to use widths in chars. 2017-03-01 17:08:14 +01:00
Wandmalfarbe
8af838f98f Fixed typos in CONTRIBUTING.md (#3479) 2017-03-01 15:00:53 +01:00
Mauro Bieg
d0fc2f1573 ODT writer: calculate aspect ratio for percentage-sized images (#3478)
closes #3239
2017-03-01 12:13:45 +01:00
John MacFarlane
d1b50a6c5d RST reader: implemented implicit internal header links.
Cloess #3475.
2017-02-28 10:32:36 +01:00
John MacFarlane
c7e2c718eb Removed --epub-stylesheet; use --css instead.
* Removed writerEpubStylesheet in WriterOptions.
* Removed `--epub-stylesheet` option.
* Allow `--css` to be used with epub.
* Allow multiple stylesheets to be used.
* Stylesheets will be taken both from `--css` and from
  the `stylesheet` metadata field (which can contain either
  a file path or a list of them).

Closes #3472, #847.
2017-02-27 21:29:16 +01:00
John MacFarlane
1d17dbd3ae LaTeX reader: Handle komascript \dedication.
It now adds a `dedication` field to metadata.
It is up to the user to supply a template that uses this
variable.

Closes #1845.
2017-02-27 14:16:05 +01:00
John MacFarlane
d30883d49e Added issue and PR template for data/templates.
Direct users to open issues in jgm/pandoc, not jgm/pandoc-templates.
2017-02-27 11:01:12 +01:00
John MacFarlane
0b78d9add0 Merge commit 'ce8226f1a7d64da56117d2f7f351e06225a84614' 2017-02-27 10:55:10 +01:00
John MacFarlane
bf074a18b6 Update RELEASE_CHECKLIST. 2017-02-27 10:19:22 +01:00
John MacFarlane
550ed838dc Removed .gitmodules. 2017-02-27 10:16:49 +01:00
John MacFarlane
ab494e727c Updated README for pandco-templates. 2017-02-27 10:12:38 +01:00
John MacFarlane
4fb9976a9a Minor cleanups in LaTeX reader. 2017-02-27 00:40:33 +01:00
John MacFarlane
99b39ffc17 RST reader: support scale and align attributes of images.
Closes #2662.
2017-02-26 23:40:31 +01:00
John MacFarlane
092c8f7732 ImageSize: export lengthToDim, new function scaleDimension. 2017-02-26 23:40:09 +01:00
John MacFarlane
377c27befe --self-contained: don't incorporate elements with data-external="1".
You can leave an external link as it is by adding the attribute
data-external="1" to the element.  Pandoc will then not try to
incorporate its content when `--self-contained` is used.  This is
similar to a feature already supported by the EPUB writer.

Closes #2656.
2017-02-26 22:48:02 +01:00
John MacFarlane
d7e25d203a Fixed typo in CONTRIBUTING.md.
Introduced by 9d91b8825f.
2017-02-26 22:20:15 +01:00
Mauro Bieg
2d6b834cdb MANUAL.txt explain --webtex SVG url (#3471) 2017-02-26 11:37:57 +01:00
Mauro Bieg
9d91b8825f CONTRIBUTING.md add "ask on pandoc-discuss" 2017-02-26 00:12:08 +01:00
John MacFarlane
5a47f3422a Fixed type sig for older GHC versions. 2017-02-25 23:56:32 +01:00
John MacFarlane
65c4efeb59 Added test case for variables/metadata in Markdown writer. 2017-02-25 23:54:30 +01:00
John MacFarlane
737d954a59 App: reverse optInputFiles so they come out in right order in templates. 2017-02-25 23:47:19 +01:00
John MacFarlane
4aed13bf7c Markdown writer: don't include variables in metadata blocks!
Previously variables set on the command line were included in
e.g. YAML metadata, contrary to documentation and intentions.
2017-02-25 23:46:39 +01:00
John MacFarlane
124551461c Fixed addVariablesToJSON.
It was previously not allowing multiple values to become lists.
2017-02-25 23:42:56 +01:00
Roland Hieber
699d289cc5 Add sourcefile and outputfile template variables (#3439)
Closes #3431.
2017-02-25 23:15:56 +01:00
John MacFarlane
9ab30c6495 Writers.Shared: export metaToJSON', addVariablesToJSON.
This allows us to add the variables AFTER using the metadata
to generate a YAML header (in the Markdown writer).

Addresses the problem shown by
https://travis-ci.org/jgm/pandoc/jobs/205154181#L705

See #3439
2017-02-25 23:13:23 +01:00