Commit graph

11999 commits

Author SHA1 Message Date
John MacFarlane
2932ac8574 Add isPrefixOf to imports. 2019-01-27 12:27:24 -08:00
Agustín Martín Barbero
9894d05fe3 Improve writing metadata for docx, pptx and odt (#5252)
* docx writer: support custom properties.  Solves the writer part of #3024.
  Also supports additional core properties:  `subject`, `lang`, `category`,
  `description`.

* odt writer: improve standard properties, including the following core properties:
  `generator` (Pandoc/VERSION), `description`, `subject`, `keywords`,
  `initial-creator` (from authors), `creation-date` (actual creation date).
  Also fix date.

* pptx writer: support custom properties.  Also supports additional core
  properties: `subject`, `category`, `description`.

* Includes golden tests.

* MANUAL: document metadata support for docx, odt, pptx writers
2019-01-26 16:14:35 -08:00
John MacFarlane
ff0aaa549d Normalize Windows paths to account for change in ghc 8.6.
When pandoc is compiled with ghc 8.6, Windows paths are treated
differently, and paths beginning `\\server` no longer work.
This commit rewrites such patsh to `\\?\UNC\server` which works.

The change operates at the level of argument parsing, so it
only affects the command line program.

See #5127 and the discussion there.
2019-01-26 16:07:39 -08:00
John MacFarlane
446583e322 Texinfo writer: use header identifier for anchor if present.
Previously we were overwriting an existing identifier
with a new one.  Closes #4731.
2019-01-25 17:11:28 -08:00
John MacFarlane
a5ac58f82f MediaWiki reader: use _ instead of - in auto-identifiers.
Partially addresses #4731.
We may not still be exactly matching mediawiki's algorithm
for identifiers.
2019-01-25 17:10:49 -08:00
John MacFarlane
2e7cfe1bba LaTeX writer: add # special characeters for listings.
This character needs special handling in lstinline.
Closes #4939.
2019-01-25 16:49:31 -08:00
John MacFarlane
7ccaa77797 LaTeX template: Set default listings language for lua, assembler.
Otherwise we get an error when trying to compile code
with lua or assembler code.

To change the default dialect (currenty 5.3 for lua
and x86masm for assembler), you can use `--include-in-header`
to inject something like

    \lstset{defaultdialect=[5.2]Lua}

Closes #5227.
2019-01-25 16:22:56 -08:00
John MacFarlane
7012782b79 Update ipynb example in manual. 2019-01-25 16:12:45 -08:00
John MacFarlane
7444427609 Revert "CircleCI - use -O0 only for cabal-v2 builds."
This reverts commit 062a8fb10b.
2019-01-25 10:08:05 -08:00
John MacFarlane
5ccba09550 Revert "CircleCI - store artifact from stack build."
This reverts commit ecccb69ec7.
2019-01-25 10:07:44 -08:00
John MacFarlane
32119ce04c Revert "circleci - use .gz for build artifact."
This reverts commit f28d39efae.
2019-01-25 10:07:35 -08:00
John MacFarlane
f28d39efae circleci - use .gz for build artifact. 2019-01-25 09:43:09 -08:00
John MacFarlane
ecccb69ec7 CircleCI - store artifact from stack build. 2019-01-25 09:24:29 -08:00
John MacFarlane
062a8fb10b CircleCI - use -O0 only for cabal-v2 builds.
Stack build will not disable optimizations; this way we
can create a nightly.
2019-01-25 09:11:23 -08:00
John MacFarlane
c32bcaa2d3 Remove travis.yml. 2019-01-25 09:11:05 -08:00
John MacFarlane
bfa1bf9302 Regenerated README.md with CircleCI badge instead of travis. 2019-01-25 08:41:39 -08:00
John MacFarlane
ed78d44615 Tweaked circleci. 2019-01-25 08:17:59 -08:00
John MacFarlane
aec7afa24a Fix cabal.project. 2019-01-25 08:11:24 -08:00
John MacFarlane
4c958f1589 Add some ghc options in circleci config. 2019-01-25 07:31:22 -08:00
John MacFarlane
511cc2563a CircleCI: Set workflow version to 2.1. 2019-01-25 07:15:16 -08:00
John MacFarlane
cbd8662b63 Add .circleci config. 2019-01-25 07:00:28 -08:00
John MacFarlane
1c8097136b Update pandoc-citeproc commit in stack.yaml. 2019-01-25 06:58:28 -08:00
John MacFarlane
975d8efb3b cabal.project - set flag defaults, revise pandoc-citeproc commit. 2019-01-25 06:56:08 -08:00
John MacFarlane
2f54470266 Ipynb: Put all jupyter metadata under 'jupyter' key. 2019-01-24 16:51:56 -08:00
John MacFarlane
7167330a2a Revert "Prepend jupyter_ to jupyter metadata keys."
This reverts commit 5eaff399d5.
2019-01-24 16:33:03 -08:00
John MacFarlane
b08c8627d3 Allow some command line options to take URL in addition to FILE.
`--include-in-header`, `--include-before-body`, `--include-after-body`
2019-01-24 16:21:57 -08:00
John MacFarlane
22b09d88ff Ms writer: ensure we have a newline after .EN in disply math.
Closes #5251.
2019-01-24 16:09:14 -08:00
John MacFarlane
5eaff399d5 Prepend jupyter_ to jupyter metadata keys.
This avoids conflics with things like 'toc'.
2019-01-24 09:35:42 -08:00
Andrew Dunning
e18d9ba542 Manual: Reorganize template variables (#5249)
Add additional headings to categorize variables, and
alphabetize when there is large number; add more examples.
2019-01-23 15:36:11 -08:00
John MacFarlane
c5ccfabd9b Update changelog. 2019-01-23 10:43:39 -08:00
Andrew Dunning
ed66278a23 Update changelog for LaTeX template (#5247) 2019-01-23 10:31:57 -08:00
Andrew Dunning
673d545016 LaTeX template: Restrict institute to Beamer (#5219)
The `\institute` command is only standard in the Beamer class.
Use a conditional to restrict this to Beamer output rather than
output an empty command. To add this information to a LaTeX
class providing an `\institute` command, use `header-includes`.
2019-01-23 10:31:26 -08:00
John MacFarlane
09b6dca763 Removed superfluous import. 2019-01-23 10:08:08 -08:00
John MacFarlane
395ea03069 Support ipynb (Jupyter notebook) as input and output format.
[API change]

* Depend on ipynb library.

* Add `ipynb` as input and output format.

* Added Text.Pandoc.Readers.Ipynb (supports both nbformat v3 and v4).

* Added Text.Pandoc.Writers.Ipynb (supports nbformat v4).

* Added ipynb readers and writers to T.P.Readers,
  T.P.Writers, and T.P.Extensions.  Register the
  file extension .ipynb for this format.

* Add `PandocIpynbDecodingError` constructor to Text.Pandoc.Error.Error.

* Note: there is no template for ipynb.
2019-01-22 21:45:59 -08:00
John MacFarlane
5ddd7b121e LaTeX reader: support \endinput. Closes #5233. 2019-01-22 21:39:26 -08:00
Andrew Dunning
3707bed4c1 LaTeX template: Use footnotehyper if available (#5234)
Use the [`footnotehyper`](https://ctan.org/pkg/footnotehyper/) package if available.
This is a rewrite of `footnote` that is compatible with `hyperref` and `babel-frenchb`.

This patch also addresses the incompatibility with `xcolor` noted in #4861, but the
new package has only been available since 2016, so this template still loads `xcolor`
earlier for compatibility with older distributions. Note that the `footnote` package 
is part of `collection-latexrecommended` in TeX Live, so there shouldn't be any
problem loading it unconditionally as we now do if `footnotehyper` is not available.
2019-01-22 21:13:09 -08:00
Andrew Dunning
3ad2255717 LaTeX template: Respect numbersections for books (#5235)
Ensure that `\part` and `\chapter` are only numbered if `numbersections` is set. To return to the previous behaviour, use `-V numbersections -V secnumdepth=0`.

Notes on secnumdepth:

1 = Number `\section`
0 = Number `\chapter`
-1 = Number `\part`
-2 = No numbering
2019-01-22 21:11:13 -08:00
Lev E. Givon
690193e4e5 Clarify that $ must come right before $. (#5243) 2019-01-22 20:58:18 -08:00
Brian Leung
509336d866 Man reader: fix typo. (#5245) 2019-01-22 20:50:25 -08:00
Andrew Dunning
3560b02f8b LaTeX template: Fix subtitle spacing (#5244)
The `\large` command does not reset the spacing without adding `\par` to the end, which caused `\subtitle` to use the same line spacing as `\title`.
2019-01-22 15:00:27 -08:00
John MacFarlane
f86ac89383 HTML and markdown: treat textarea as a verbatim environment.
We don't want to parse its contents as Markdown or HTML.

Closes #5241.
2019-01-21 20:54:12 -08:00
John MacFarlane
847ff4f83d Mention raw_attribute in documentation for raw_html and raw_tex.
Thanks to @eiro.  Closes #5240.
2019-01-21 20:42:46 -08:00
John MacFarlane
11810edb2f LaTeX reader: allow includes with dots like cc_by_4.0.
Previously the `.0` was interpreted as a file extension,
leading pandoc not to add `.tex` (and thus not to find the
file).

The new behavior matches tex more closely.
2019-01-20 18:22:19 -08:00
John MacFarlane
26dfab2e61 LaTeX reader: cleaned up 'input' code. 2019-01-20 17:35:51 -08:00
Agustín Martín Barbero
fb1f76ddee odt writer: fix typo in custom properties (#5231)
fixes #2839
2019-01-17 16:09:25 -08:00
Albert Krewinkel
bbf37dee8e Fix tests for sample custom writer tables 2019-01-16 13:30:16 +01:00
MichaWiedenmann
02a21117fb sample.lua: Add a missing '>' 2019-01-16 12:34:17 +01:00
Albert Krewinkel
42a7b80c04
data/pandoc.lua: auto-fix nested constructor arguments
Incorrect types to pandoc element constructors are automatically
converted to the correct types when possible. This was already done for
most constructors, but conversions are now also done for nested
types (like lists of lists).
2019-01-13 17:14:10 +01:00
Mauro Bieg
9ac5b9d710
changelog: clarify and fix task_lists description 2019-01-13 15:19:57 +01:00
John MacFarlane
0b99056272 Update changelog, AUTHORS.md. 2019-01-12 23:03:28 -08:00