aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml3
-rw-r--r--Makefile8
-rw-r--r--README277
-rw-r--r--RELEASE-CHECKLIST6
-rw-r--r--benchmark/benchmark-pandoc.hs1
-rw-r--r--changelog218
m---------data/templates16
-rw-r--r--deb/GlobalSignDomainValidationCA-SHA256-G2.pem26
-rw-r--r--deb/Makefile3
-rw-r--r--deb/Vagrantfile10
-rw-r--r--deb/control.in2
-rw-r--r--deb/haskell.org.pem30
-rw-r--r--deb/stack.yaml4
-rw-r--r--extract-changes.hs9
-rwxr-xr-xmake_osx_package.sh3
-rw-r--r--man/pandoc.1412
-rw-r--r--osx/stack.yaml4
-rw-r--r--pandoc.cabal52
-rw-r--r--pandoc.hs13
-rw-r--r--prelude/Prelude.hs19
-rw-r--r--src/Text/Pandoc.hs1
-rw-r--r--src/Text/Pandoc/Asciify.hs1
-rw-r--r--src/Text/Pandoc/CSS.hs1
-rw-r--r--src/Text/Pandoc/Compat/Directory.hs1
-rw-r--r--src/Text/Pandoc/Compat/Except.hs1
-rw-r--r--src/Text/Pandoc/Compat/Monoid.hs17
-rw-r--r--src/Text/Pandoc/Compat/TagSoupEntity.hs1
-rw-r--r--src/Text/Pandoc/Emoji.hs905
-rw-r--r--src/Text/Pandoc/Error.hs1
-rw-r--r--src/Text/Pandoc/Highlighting.hs1
-rw-r--r--src/Text/Pandoc/ImageSize.hs1
-rw-r--r--src/Text/Pandoc/MIME.hs1
-rw-r--r--src/Text/Pandoc/MediaBag.hs1
-rw-r--r--src/Text/Pandoc/Options.hs24
-rw-r--r--src/Text/Pandoc/PDF.hs2
-rw-r--r--src/Text/Pandoc/Parsing.hs5
-rw-r--r--src/Text/Pandoc/Pretty.hs2
-rw-r--r--src/Text/Pandoc/Process.hs1
-rw-r--r--src/Text/Pandoc/Readers/CommonMark.hs1
-rw-r--r--src/Text/Pandoc/Readers/DocBook.hs1
-rw-r--r--src/Text/Pandoc/Readers/Docx.hs5
-rw-r--r--src/Text/Pandoc/Readers/Docx/Fonts.hs1
-rw-r--r--src/Text/Pandoc/Readers/Docx/Lists.hs1
-rw-r--r--src/Text/Pandoc/Readers/Docx/Parse.hs72
-rw-r--r--src/Text/Pandoc/Readers/Docx/Reducible.hs1
-rw-r--r--src/Text/Pandoc/Readers/Docx/StyleMap.hs1
-rw-r--r--src/Text/Pandoc/Readers/Docx/Util.hs1
-rw-r--r--src/Text/Pandoc/Readers/EPUB.hs2
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs3
-rw-r--r--src/Text/Pandoc/Readers/Haddock.hs4
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs25
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs19
-rw-r--r--src/Text/Pandoc/Readers/MediaWiki.hs2
-rw-r--r--src/Text/Pandoc/Readers/Native.hs1
-rw-r--r--src/Text/Pandoc/Readers/OPML.hs1
-rw-r--r--src/Text/Pandoc/Readers/Odt.hs1
-rw-r--r--src/Text/Pandoc/Readers/Odt/Arrows/State.hs1
-rw-r--r--src/Text/Pandoc/Readers/Odt/Arrows/Utils.hs3
-rw-r--r--src/Text/Pandoc/Readers/Odt/ContentReader.hs1
-rw-r--r--src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs3
-rw-r--r--src/Text/Pandoc/Readers/Odt/Generic/Namespaces.hs1
-rw-r--r--src/Text/Pandoc/Readers/Odt/Generic/SetMap.hs1
-rw-r--r--src/Text/Pandoc/Readers/Odt/Generic/Utils.hs1
-rw-r--r--src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs1
-rw-r--r--src/Text/Pandoc/Readers/Odt/Namespaces.hs1
-rw-r--r--src/Text/Pandoc/Readers/Odt/StyleReader.hs1
-rw-r--r--src/Text/Pandoc/Readers/Org.hs20
-rw-r--r--src/Text/Pandoc/Readers/RST.hs3
-rw-r--r--src/Text/Pandoc/Readers/TWiki.hs1
-rw-r--r--src/Text/Pandoc/Readers/TeXMath.hs1
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs3
-rw-r--r--src/Text/Pandoc/Readers/Txt2Tags.hs2
-rw-r--r--src/Text/Pandoc/SelfContained.hs1
-rw-r--r--src/Text/Pandoc/Shared.hs6
-rw-r--r--src/Text/Pandoc/Slides.hs1
-rw-r--r--src/Text/Pandoc/Templates.hs2
-rw-r--r--src/Text/Pandoc/UUID.hs1
-rw-r--r--src/Text/Pandoc/Writers/AsciiDoc.hs1
-rw-r--r--src/Text/Pandoc/Writers/CommonMark.hs1
-rw-r--r--src/Text/Pandoc/Writers/ConTeXt.hs1
-rw-r--r--src/Text/Pandoc/Writers/Custom.hs1
-rw-r--r--src/Text/Pandoc/Writers/Docbook.hs1
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs6
-rw-r--r--src/Text/Pandoc/Writers/DokuWiki.hs1
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs4
-rw-r--r--src/Text/Pandoc/Writers/FB2.hs1
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs5
-rw-r--r--src/Text/Pandoc/Writers/Haddock.hs5
-rw-r--r--src/Text/Pandoc/Writers/ICML.hs5
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs6
-rw-r--r--src/Text/Pandoc/Writers/Man.hs1
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs1
-rw-r--r--src/Text/Pandoc/Writers/MediaWiki.hs1
-rw-r--r--src/Text/Pandoc/Writers/Native.hs1
-rw-r--r--src/Text/Pandoc/Writers/ODT.hs1
-rw-r--r--src/Text/Pandoc/Writers/OPML.hs1
-rw-r--r--src/Text/Pandoc/Writers/OpenDocument.hs4
-rw-r--r--src/Text/Pandoc/Writers/Org.hs1
-rw-r--r--src/Text/Pandoc/Writers/RST.hs1
-rw-r--r--src/Text/Pandoc/Writers/RTF.hs1
-rw-r--r--src/Text/Pandoc/Writers/Shared.hs1
-rw-r--r--src/Text/Pandoc/Writers/Texinfo.hs1
-rw-r--r--src/Text/Pandoc/Writers/Textile.hs1
-rw-r--r--src/Text/Pandoc/XML.hs1
-rw-r--r--stack.yaml2
-rw-r--r--tests/Tests/Arbitrary.hs1
-rw-r--r--tests/Tests/Helpers.hs1
-rw-r--r--tests/Tests/Old.hs1
-rw-r--r--tests/Tests/Readers/Docx.hs13
-rw-r--r--tests/Tests/Readers/EPUB.hs1
-rw-r--r--tests/Tests/Readers/HTML.hs1
-rw-r--r--tests/Tests/Readers/LaTeX.hs1
-rw-r--r--tests/Tests/Readers/Markdown.hs5
-rw-r--r--tests/Tests/Readers/Odt.hs3
-rw-r--r--tests/Tests/Readers/Org.hs16
-rw-r--r--tests/Tests/Readers/RST.hs1
-rw-r--r--tests/Tests/Readers/Txt2Tags.hs1
-rw-r--r--tests/Tests/Shared.hs1
-rw-r--r--tests/Tests/Walk.hs1
-rw-r--r--tests/Tests/Writers/AsciiDoc.hs1
-rw-r--r--tests/Tests/Writers/ConTeXt.hs1
-rw-r--r--tests/Tests/Writers/Docbook.hs1
-rw-r--r--tests/Tests/Writers/Docx.hs1
-rw-r--r--tests/Tests/Writers/HTML.hs1
-rw-r--r--tests/Tests/Writers/LaTeX.hs1
-rw-r--r--tests/Tests/Writers/Markdown.hs1
-rw-r--r--tests/Tests/Writers/Native.hs1
-rw-r--r--tests/Tests/Writers/Plain.hs1
-rw-r--r--tests/Tests/Writers/RST.hs1
-rw-r--r--tests/docx/dummy_item_after_list_item.docxbin0 -> 70197 bytes
-rw-r--r--tests/docx/dummy_item_after_list_item.native3
-rw-r--r--tests/docx/dummy_item_after_paragraph.docxbin0 -> 70234 bytes
-rw-r--r--tests/docx/dummy_item_after_paragraph.native3
-rw-r--r--tests/docx/link_in_notes.docxbin0 -> 27357 bytes
-rw-r--r--tests/docx/link_in_notes.native1
-rw-r--r--tests/lhs-test.latex9
-rw-r--r--tests/lhs-test.latex+lhs9
-rw-r--r--tests/test-pandoc.hs1
-rw-r--r--tests/writer.context14
-rw-r--r--tests/writer.icml68
-rw-r--r--tests/writer.latex11
-rw-r--r--tests/writers-lang-and-dir.context10
-rw-r--r--tests/writers-lang-and-dir.latex9
-rw-r--r--trypandoc/Makefile2
-rw-r--r--windows/make-windows-installer.bat24
-rw-r--r--windows/pandoc.wxs12
-rw-r--r--windows/stack.yaml19
147 files changed, 2009 insertions, 580 deletions
diff --git a/.travis.yml b/.travis.yml
index cd6b1ee25..2901288e9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,6 +13,9 @@ before_cache:
matrix:
include:
+ - env: CABALVER=1.16 GHCVER=7.4.2 GHCOPTS=-Werror
+ compiler: ": #GHC 7.4.2"
+ addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2], sources: [hvr-ghc]}}
- env: CABALVER=1.16 GHCVER=7.6.3 GHCOPTS=-Werror
compiler: ": #GHC 7.6.3"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
diff --git a/Makefile b/Makefile
index 7c16418f8..5dfb5565b 100644
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,9 @@ test:
bench:
cabal bench
+changes_github:
+ pandoc --filter extract-changes.hs changelog -t markdown_github | pbcopy
+
install: full
cabal copy
cabal register
@@ -32,7 +35,7 @@ dist: man/pandoc.1
rm -rf "pandoc-${version}"
tar xvzf dist/pandoc-${version}.tar.gz
cd pandoc-${version}
- cabal configure ${CABALARGS} && cabal build && cabal test && cd .. && rm -rf "pandoc-${version}"
+ stack setup && stack test && cd .. && rm -rf "pandoc-${version}"
.travis.yml: pandoc.cabal make_travis_yml.hs
runghc make_travis_yml.hs $< > $@
@@ -48,6 +51,7 @@ man/pandoc.1: README man/pandoc.1.template
--filter man/capitalizeHeaders.hs \
--filter man/removeNotes.hs \
--filter man/removeLinks.hs \
+ --variable version="pandoc $(version)" \
-o $@
download_stats:
@@ -57,4 +61,4 @@ download_stats:
clean:
cabal clean
-.PHONY: deps quick full install clean test bench osxpkg dist prof download_stats
+.PHONY: deps quick full install clean test bench changes_github osxpkg dist prof download_stats
diff --git a/README b/README
index d8953ed48..923223ae1 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
% Pandoc User's Guide
% John MacFarlane
-% October 16, 2015
+% November 12, 2015
Synopsis
========
@@ -26,32 +26,32 @@ markup], [Haddock markup], [OPML], [Emacs Org mode], [DocBook],
[reveal.js] or [S5] HTML slide shows. It can also produce [PDF] output
on systems where LaTeX or ConTeXt is installed.
-Pandoc's enhanced version of markdown includes syntax for [footnotes],
+Pandoc's enhanced version of Markdown includes syntax for [footnotes],
[tables], flexible [ordered lists], [definition lists], [fenced code blocks],
[superscripts and subscripts], [strikeout], [metadata blocks], automatic tables of
-contents, [embedded LaTeX math][Math rendering in HTML], [citations], and [markdown inside HTML block
+contents, embedded LaTeX [math], [citations], and [Markdown inside HTML block
elements][Extension: `markdown_in_html_blocks`]. (These enhancements, described below under
-[Pandoc's markdown], can be disabled using the
+[Pandoc's Markdown], can be disabled using the
`markdown_strict` input or output format.)
-In contrast to most existing tools for converting markdown to HTML, which
-use regex substitutions, Pandoc has a modular design: it consists of a
+In contrast to most existing tools for converting Markdown to HTML, which
+use regex substitutions, pandoc has a modular design: it consists of a
set of readers, which parse text in a given format and produce a native
representation of the document, and a set of writers, which convert
this native representation into a target format. Thus, adding an input
or output format requires only adding a reader or writer.
-Because Pandoc's intermediate representation of a document is less
+Because pandoc's intermediate representation of a document is less
expressive than many of the formats it converts between, one should
not expect perfect conversions between every format and every other.
Pandoc attempts to preserve the structural elements of a document, but
not formatting details such as margin size. And some document elements,
-such as complex tables, may not fit into Pandoc's simple document
-model. While conversions from Pandoc's Markdown to all formats aspire
-to be perfect, conversions from formats more expressive than Pandoc's
+such as complex tables, may not fit into pandoc's simple document
+model. While conversions from pandoc's Markdown to all formats aspire
+to be perfect, conversions from formats more expressive than pandoc's
Markdown can be expected to be lossy.
-[markdown]: http://daringfireball.net/projects/markdown/
+[Markdown]: http://daringfireball.net/projects/markdown/
[CommonMark]: http://commonmark.org
[PHP Markdown Extra]: https://michelf.ca/projects/php-markdown/extra/
[GitHub-Flavored Markdown]: https://help.github.com/articles/github-flavored-markdown/
@@ -124,11 +124,11 @@ The format of the input and output can be specified explicitly using
command-line options. The input format can be specified using the
`-r/--read` or `-f/--from` options, the output format using the
`-w/--write` or `-t/--to` options. Thus, to convert `hello.txt` from
-markdown to LaTeX, you could type:
+Markdown to LaTeX, you could type:
pandoc -f markdown -t latex hello.txt
-To convert `hello.html` from HTML to markdown:
+To convert `hello.html` from HTML to Markdown:
pandoc -f html -t markdown hello.html
@@ -143,12 +143,12 @@ the input and output filenames. Thus, for example,
pandoc -o hello.tex hello.txt
-will convert `hello.txt` from markdown to LaTeX. If no output file
+will convert `hello.txt` from Markdown to LaTeX. If no output file
is specified (so that output goes to *stdout*), or if the output file's
extension is unknown, the output format will default to HTML.
If no input file is specified (so that input comes from *stdin*), or
if the input files' extensions are unknown, the input format will
-be assumed to be markdown unless explicitly specified.
+be assumed to be Markdown unless explicitly specified.
Pandoc uses the UTF-8 character encoding for both input and output.
If your local character encoding is not UTF-8, you
@@ -176,8 +176,8 @@ Production of a PDF requires that a LaTeX engine be installed (see
are available: [`amsfonts`], [`amsmath`], [`lm`],
[`ifxetex`], [`ifluatex`], [`eurosym`], [`listings`] (if the
`--listings` option is used), [`fancyvrb`], [`longtable`],
-[`booktabs`], [`url`], [`graphicx`] and [`grffile`] (if the
-document contains images), [`color`], [`hyperref`], [`ulem`],
+[`booktabs`], [`graphicx`] and [`grffile`] (if the
+document contains images), [`hyperref`], [`ulem`],
[`geometry`] (with the `geometry` variable set), [`setspace`] (with
`linestretch`), and [`babel`] (with `lang`). The use of `xelatex` or
`lualatex` as the LaTeX engine requires [`fontspec`]; `xelatex` uses
@@ -206,12 +206,10 @@ or [variables for ConTeXt].
[`fancyvrb`]: https://ctan.org/pkg/fancyvrb
[`longtable`]: https://ctan.org/pkg/longtable
[`booktabs`]: https://ctan.org/pkg/booktabs
-[`url`]: https://ctan.org/pkg/url
[`graphicx`]: https://ctan.org/pkg/graphicx
[`grffile`]: https://ctan.org/pkg/grffile
[`geometry`]: https://ctan.org/pkg/geometry
[`setspace`]: https://ctan.org/pkg/setspace
-[`color`]: http://ctan.org/pkg/color
[`xecjk`]: https://ctan.org/pkg/xecjk
[`hyperref`]: https://ctan.org/pkg/hyperref
[`ulem`]: https://ctan.org/pkg/ulem
@@ -252,10 +250,10 @@ General options
: Specify input format. *FORMAT* can be `native` (native Haskell),
`json` (JSON version of native AST), `markdown` (pandoc's
- extended markdown), `markdown_strict` (original unextended
- markdown), `markdown_phpextra` (PHP Markdown Extra),
+ extended Markdown), `markdown_strict` (original unextended
+ Markdown), `markdown_phpextra` (PHP Markdown Extra),
`markdown_github` (GitHub-Flavored Markdown),
- `commonmark` (CommonMark markdown), `textile` (Textile), `rst`
+ `commonmark` (CommonMark Markdown), `textile` (Textile), `rst`
(reStructuredText), `html` (HTML), `docbook` (DocBook), `t2t`
(txt2tags), `docx` (docx), `odt` (ODT), `epub` (EPUB), `opml` (OPML),
`org` (Emacs Org mode), `mediawiki` (MediaWiki markup), `twiki` (TWiki
@@ -266,20 +264,20 @@ General options
syntax extensions can be individually enabled or disabled by
appending `+EXTENSION` or `-EXTENSION` to the format name. So, for
example, `markdown_strict+footnotes+definition_lists` is strict
- markdown with footnotes and definition lists enabled, and
- `markdown-pipe_tables+hard_line_breaks` is pandoc's markdown
+ Markdown with footnotes and definition lists enabled, and
+ `markdown-pipe_tables+hard_line_breaks` is pandoc's Markdown
without pipe tables and with hard line breaks. See [Pandoc's
- markdown], below, for a list of extensions and
+ Markdown], below, for a list of extensions and
their names.
`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*
: Specify output format. *FORMAT* can be `native` (native Haskell),
`json` (JSON version of native AST), `plain` (plain text),
- `markdown` (pandoc's extended markdown), `markdown_strict`
- (original unextended markdown), `markdown_phpextra` (PHP Markdown
+ `markdown` (pandoc's extended Markdown), `markdown_strict`
+ (original unextended Markdown), `markdown_phpextra` (PHP Markdown
Extra), `markdown_github` (GitHub-Flavored
- Markdown), `commonmark` (CommonMark markdown), `rst`
+ Markdown), `commonmark` (CommonMark Markdown), `rst`
(reStructuredText), `html` (XHTML), `html5` (HTML5), `latex`
(LaTeX), `beamer` (LaTeX beamer slide show), `context` (ConTeXt),
`man` (groff man), `mediawiki` (MediaWiki markup), `dokuwiki`
@@ -360,9 +358,9 @@ Reader options
: Parse untranslatable HTML codes and LaTeX environments as raw HTML
or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
- input. Raw HTML can be printed in markdown, reStructuredText, HTML,
+ input. Raw HTML can be printed in Markdown, reStructuredText, HTML,
Slidy, Slideous, DZSlides, reveal.js, and S5 output; raw LaTeX
- can be printed in markdown, reStructuredText, LaTeX, and ConTeXt output.
+ can be printed in Markdown, reStructuredText, LaTeX, and ConTeXt output.
The default is for the readers to omit untranslatable HTML codes and
LaTeX environments. (The LaTeX reader does pass through untranslatable
LaTeX *commands*, even if `-R` is not specified.)
@@ -374,7 +372,7 @@ Reader options
`...` to ellipses. Nonbreaking spaces are inserted after certain
abbreviations, such as "Mr." (Note: This option is selected automatically
when the output format is `latex` or `context`, unless `--no-tex-ligatures`
- is used.)
+ is used. It has no effect for `latex` input.)
`--old-dashes`
@@ -397,12 +395,12 @@ Reader options
: Specify a default extension to use when image paths/URLs have no
extension. This allows you to use the same source for formats that
require different kinds of images. Currently this option only affects
- the markdown and LaTeX readers.
+ the Markdown and LaTeX readers.
`--filter=`*EXECUTABLE*
: Specify an executable to be used as a filter transforming the
- Pandoc AST after the input is parsed and before the output is
+ pandoc AST after the input is parsed and before the output is
written. The executable should read JSON from stdin and write
JSON to stdout. The JSON must be formatted like pandoc's own
JSON input and output. The name of the output format will be
@@ -616,12 +614,12 @@ Options affecting specific writers
`--reference-links`
-: Use reference-style links, rather than inline links, in writing markdown
+: Use reference-style links, rather than inline links, in writing Markdown
or reStructuredText. By default inline links are used.
`--atx-headers`
-: Use ATX-style headers in markdown and asciidoc output. The default is
+: Use ATX-style headers in Markdown and asciidoc output. The default is
to use setext-style headers for levels 1-2, and then ATX headers.
`--chapters`
@@ -651,15 +649,19 @@ Options affecting specific writers
`--no-tex-ligatures`
-: Do not convert quotation marks, apostrophes, and dashes to
- the TeX ligatures when writing LaTeX or ConTeXt. Instead, just
- use literal unicode characters. This is needed for using advanced
- OpenType features with `xelatex` and `lualatex`. Note: normally
- `--smart` is selected automatically for LaTeX and ConTeXt
- output, but it must be specified explicitly if `--no-tex-ligatures`
- is selected. If you use literal curly quotes, dashes, and ellipses
- in your source, then you may want to use `--no-tex-ligatures`
- without `--smart`.
+: Do not use the TeX ligatures for quotation marks, apostrophes,
+ and dashes (`` `...' ``, ` ``..'' `, `--`, `---`) when
+ writing or reading LaTeX or ConTeXt. In reading LaTeX,
+ parse the characters `` ` ``, `'`, and `-` literally, rather
+ than parsing ligatures for quotation marks and dashes. In
+ writing LaTeX or ConTeXt, print unicode quotation mark and
+ dash characters literally, rather than converting them to
+ the standard ASCII TeX ligatures. Note: normally `--smart`
+ is selected automatically for LaTeX and ConTeXt output, but
+ it must be specified explicitly if `--no-tex-ligatures` is
+ selected. If you use literal curly quotes, dashes, and
+ ellipses in your source, then you may want to use
+ `--no-tex-ligatures` without `--smart`.
`--listings`
@@ -692,12 +694,13 @@ Options affecting specific writers
: Specify a method for obfuscating `mailto:` links in HTML documents.
`none` leaves `mailto:` links as they are. `javascript` obfuscates
them using javascript. `references` obfuscates them by printing their
- letters as decimal or hexadecimal character references.
+ letters as decimal or hexadecimal character references. The default
+ is `javascript`.
`--id-prefix=`*STRING*
: Specify a prefix to be added to all automatically generated identifiers
- in HTML and DocBook output, and to footnote numbers in markdown output.
+ in HTML and DocBook output, and to footnote numbers in Markdown output.
This is useful for preventing duplicate identifiers when generating
fragments to be included in other pages.
@@ -754,7 +757,7 @@ Options affecting specific writers
: Use the specified image as the EPUB cover. It is recommended
that the image be less than 1000px in width and height. Note that
- in a markdown source document you can also specify `cover-image`
+ in a Markdown source document you can also specify `cover-image`
in a YAML metadata block (see [EPUB Metadata], below).
`--epub-metadata=`*FILE*
@@ -774,7 +777,7 @@ Options affecting specific writers
id="BookId">` (a randomly generated UUID). Any of these may be
overridden by elements in the metadata file.
- Note: if the source document is markdown, a YAML metadata block
+ Note: if the source document is Markdown, a YAML metadata block
in the document can be used instead. See below under
[EPUB Metadata].
@@ -963,13 +966,13 @@ Options for wrapper scripts
with the `-o` option, or `-` (for *stdout*) if no output file was
specified. The remaining lines contain the command-line arguments,
one per line, in the order they appear. These do not include regular
- Pandoc options and their arguments, but do include any options appearing
+ pandoc options and their arguments, but do include any options appearing
after a `--` separator at the end of the line.
`--ignore-args`
: Ignore command-line arguments (for use in wrapper scripts).
- Regular Pandoc options are not ignored. Thus, for example,
+ Regular pandoc options are not ignored. Thus, for example,
pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
@@ -1114,6 +1117,11 @@ including all [reveal.js configuration options].
`theme`, `colortheme`, `fonttheme`, `innertheme`, `outertheme`
: themes for LaTeX [`beamer`] documents
+`navigation`
+: controls navigation symbols in `beamer` documents
+ (default is `empty` for no navigation symbols; other valid values
+ are `frame`, `vertical`, and `horizontal`).
+
[reveal.js configuration options]: https://github.com/hakimel/reveal.js#configuration
Variables for LaTeX
@@ -1165,13 +1173,13 @@ LaTeX variables are used when [creating a PDF].
: allows font encoding to be specified through `fontenc` package (with `pdflatex`);
default is `T1` (see guide to [LaTeX font encodings])
-`linkcolor`, `toccolor`, `urlcolor`, `citecolor`
-: color for internal links, links in table of contents, external links,
- and citation links, using options available through
- [`color`] package, e.g. `red`, `green`, `magenta`, `cyan`, `blue`, `black`
+`colorlinks`
+: add color to link text; automatically enabled if any of `linkcolor`, `citecolor`,
+ `urlcolor`, or `toccolor` are set
-`hidelinks`
-: enables `hidelinks` option for [`hyperref`], disabling link color
+`linkcolor`, `citecolor`, `urlcolor`, `toccolor`
+: color for internal links, citation links, external links, and links in table of contents:
+ uses any of the [predefined LaTeX colors]
`links-as-notes`
: causes links to be printed as footnotes
@@ -1203,6 +1211,7 @@ LaTeX variables are used when [creating a PDF].
[`report`]: https://ctan.org/pkg/report
[`book`]: https://ctan.org/pkg/book
[`memoir`]: https://ctan.org/pkg/memoir
+[predefined LaTeX colors]: https://en.wikibooks.org/wiki/LaTeX/Colors#Predefined_colors
[LaTeX Font Catalogue]: http://www.tug.dk/FontCatalogue/
[`mathpazo`]: https://ctan.org/pkg/mathpazo
[LaTeX font encodings]: https://ctan.org/pkg/encguide
@@ -1224,8 +1233,11 @@ Variables for ConTeXt
`mainfont`, `sansfont`, `monofont`, `mathfont`
: font families: take the name of any system font (see [ConTeXt Font Switching])
-`linkcolor`
-: color for links, e.g. `red`, `blue` (see [ConTeXt Color])
+`linkcolor`, `contrastcolor`
+: color for links outside and inside a page, e.g. `red`, `blue` (see [ConTeXt Color])
+
+`linkstyle`
+: typeface style for links, e.g. `normal`, `bold`, `slanted`, `boldslanted`, `type`, `cap`, `small`
`indenting`
: controls indentation of paragraphs, e.g. `yes,small,next` (see [ConTeXt Indentation]);
@@ -1332,18 +1344,18 @@ pandoc release.
[pandoc-templates]: https://github.com/jgm/pandoc-templates
-Pandoc's markdown
+Pandoc's Markdown
=================
Pandoc understands an extended and slightly revised version of
-John Gruber's [markdown] syntax. This document explains the syntax,
-noting differences from standard markdown. Except where noted, these
+John Gruber's [Markdown] syntax. This document explains the syntax,
+noting differences from standard Markdown. Except where noted, these
differences can be suppressed by using the `markdown_strict` format instead
of `markdown`. An extensions can be enabled by adding `+EXTENSION`
to the format name and disabled by adding `-EXTENSION`. For example,
-`markdown_strict+footnotes` is strict markdown with footnotes
+`markdown_strict+footnotes` is strict Markdown with footnotes
enabled, while `markdown-footnotes-pipe_tables` is pandoc's
-markdown without footnotes or pipe tables.
+Markdown without footnotes or pipe tables.
Philosophy
----------
@@ -1360,7 +1372,7 @@ This principle has guided pandoc's decisions in finding syntax for
tables, footnotes, and other extensions.
There is, however, one respect in which pandoc's aims are different
-from the original aims of markdown. Whereas markdown was originally
+from the original aims of Markdown. Whereas Markdown was originally
designed with HTML generation in mind, pandoc is designed for multiple
output formats. Thus, while pandoc allows the embedding of raw HTML,
it discourages it, and provides other, non-HTMLish ways of representing
@@ -1417,7 +1429,7 @@ As with setext-style headers, the header text can contain formatting:
#### Extension: `blank_before_header` ####
-Standard markdown syntax does not require a blank line before a header.
+Standard Markdown syntax does not require a blank line before a header.
Pandoc does require this (except, of course, at the beginning of the
document). The reason for the requirement is that it is all too easy for a
`#` to end up at the beginning of a line by accident (perhaps through line
@@ -1589,7 +1601,7 @@ block in a block quote, you need five spaces after the `>`:
#### Extension: `blank_before_blockquote` ####
-Standard markdown syntax does not require a blank line before a block
+Standard Markdown syntax does not require a blank line before a block
quote. Pandoc does require this (except, of course, at the beginning of the
document). The reason for the requirement is that it is all too easy for a
`>` to end up at the beginning of a line by accident (perhaps through line
@@ -1623,7 +1635,7 @@ Note: blank lines in the verbatim text need not begin with four spaces.
#### Extension: `fenced_code_blocks` ####
-In addition to standard indented code blocks, Pandoc supports
+In addition to standard indented code blocks, pandoc supports
*fenced* code blocks. These begin with a row of three or more
tildes (`~`) and end with a row of tildes that must be at least as long as
the starting row. Everything between these lines is treated as code. No
@@ -1708,7 +1720,7 @@ Line blocks
A line block is a sequence of lines beginning with a vertical bar (`|`)
followed by a space. The division into lines will be preserved in
the output, as will any leading spaces; otherwise, the lines will
-be formatted as markdown. This is useful for verse and addresses:
+be formatted as Markdown. This is useful for verse and addresses:
| The limerick packs laughs anatomical
| In space that is quite economical.
@@ -1762,7 +1774,7 @@ line (after the bullet):
list item.
* and my second.
-But markdown also allows a "lazy" format:
+But Markdown also allows a "lazy" format:
* here is my first
list item.
@@ -1798,7 +1810,7 @@ one tab:
+ broccoli
+ chard
-As noted above, markdown allows you to write list items "lazily," instead of
+As noted above, Markdown allows you to write list items "lazily," instead of
indenting continuation lines. However, if there are multiple paragraphs or
other blocks in a list item, the first line of each must be indented.
@@ -1812,18 +1824,18 @@ other blocks in a list item, the first line of each must be indented.
list item.
**Note:** Although the four-space rule for continuation paragraphs
-comes from the official [markdown syntax guide], the reference implementation,
+comes from the official [Markdown syntax guide], the reference implementation,
`Markdown.pl`, does not follow it. So pandoc will give different results than
`Markdown.pl` when authors have indented continuation paragraphs fewer than
four spaces.
-The [markdown syntax guide] is not explicit whether the four-space
+The [Markdown syntax guide] is not explicit whether the four-space
rule applies to *all* block-level content in a list item; it only
mentions paragraphs and code blocks. But it implies that the rule
applies to all block-level content (including nested lists), and
pandoc interprets it that way.
- [markdown syntax guide]:
+ [Markdown syntax guide]:
http://daringfireball.net/projects/markdown/syntax#list
### Ordered lists ###
@@ -1831,7 +1843,7 @@ pandoc interprets it that way.
Ordered lists work just like bulleted lists, except that the items
begin with enumerators rather than bullets.
-In standard markdown, enumerators are decimal numbers followed
+In standard Markdown, enumerators are decimal numbers followed
by a period and a space. The numbers themselves are ignored, so
there is no difference between this list:
@@ -1847,7 +1859,7 @@ and this one:
#### Extension: `fancy_lists` ####
-Unlike standard markdown, Pandoc allows ordered list items to be marked
+Unlike standard Markdown, pandoc allows ordered list items to be marked
with uppercase and lowercase letters and roman numerals, in addition to
arabic numerals. List markers may be enclosed in parentheses or followed by a
single right-parentheses or period. They must be separated from the
@@ -1934,7 +1946,7 @@ A term may have multiple definitions, and each definition may consist of one or
more block elements (paragraph, code block, list, etc.), each indented four
spaces or one tab stop. The body of the definition (including the first line,
aside from the colon or tilde) should be indented four spaces. However,
-as with other markdown lists, you can "lazily" omit indentation except
+as with other Markdown lists, you can "lazily" omit indentation except
at the beginning of a paragraph or other block element:
Term 1
@@ -2006,14 +2018,14 @@ cases" involving lists. Consider this source:
+ Third
Pandoc transforms this into a "compact list" (with no `<p>` tags around
-"First", "Second", or "Third"), while markdown puts `<p>` tags around
+"First", "Second", or "Third"), while Markdown puts `<p>` tags around
"Second" and "Third" (but not "First"), because of the blank space
around "Third". Pandoc follows a simple rule: if the text is followed by
a blank line, it is treated as a paragraph. Since "Second" is followed
by a list, and not a blank line, it isn't treated as a paragraph. The
fact that the list is followed by a blank line is irrelevant. (Note:
Pandoc works this way even when the `markdown_strict` format is specified. This
-behavior is consistent with the official markdown syntax description,
+behavior is consistent with the official Markdown syntax description,
even though it is different from that of `Markdown.pl`.)
@@ -2026,7 +2038,7 @@ What if you want to put an indented code block after a list?
{ my code block }
-Trouble! Here pandoc (like other markdown implementations) will treat
+Trouble! Here pandoc (like other Markdown implementations) will treat
`{ my code block }` as the second paragraph of item two, and not as
a code block.
@@ -2154,7 +2166,7 @@ These work like simple tables, but with the following differences:
In multiline tables, the table parser pays attention to the widths of
the columns, and the writers try to reproduce these relative widths in
the output. So, if you find that one of the columns is too narrow in the
-output, try widening it in the markdown source.
+output, try widening it in the Markdown source.
Headers may be omitted in multiline tables as well as simple tables:
@@ -2231,7 +2243,7 @@ output, the cells produced by pipe tables will not wrap, since there
is no information available about relative widths. If you want content
to wrap within cells, use multiline or grid tables.
-Note: Pandoc also recognizes pipe tables of the following
+Note: pandoc also recognizes pipe tables of the following
form, as can be produced by Emacs' orgtbl-mode:
| One | Two |
@@ -2332,7 +2344,7 @@ hyphens (`---`) at the top and a line of three hyphens (`---`) or three dots
document, but if it is not at the beginning, it must be preceded by a blank
line. (Note that, because of the way pandoc concatenates input files when
several are provided, you may also keep the metadata in a separate YAML file
-and pass it to pandoc as an argument, along with your markdown files:
+and pass it to pandoc as an argument, along with your Markdown files:
pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
@@ -2341,7 +2353,7 @@ Just be sure that the YAML file begins with `---` and ends with `---` or
Metadata will be taken from the fields of the YAML object and added to any
existing document metadata. Metadata can contain lists and objects (nested
-arbitrarily), but all string scalars will be interpreted as markdown. Fields
+arbitrarily), but all string scalars will be interpreted as Markdown. Fields
with names ending in an underscore will be ignored by pandoc. (They may be
given a role by external processors.)
@@ -2349,7 +2361,7 @@ A document may contain multiple metadata blocks. The metadata fields will
be combined through a *left-biased union*: if two metadata blocks attempt
to set the same field, the value from the first block will be taken.
-When pandoc is used with `-t markdown` to create a markdown document,
+When pandoc is used with `-t markdown` to create a Markdown document,
a YAML metadata block will be produced only if the `-s/--standalone`
option is used. All of the metadata will appear in a single block
at the beginning of the document.
@@ -2376,7 +2388,7 @@ when the field contains blank lines:
Template variables will be set automatically from the metadata. Thus, for
example, in writing HTML, the variable `abstract` will be set to the HTML
-equivalent of the markdown in the `abstract` field:
+equivalent of the Markdown in the `abstract` field:
<p>This is the abstract.</p>
<p>It consists of two paragraphs.</p>
@@ -2413,12 +2425,12 @@ instead of
<strong>hello</strong>
-This rule is easier to remember than standard markdown's rule,
+This rule is easier to remember than standard Markdown's rule,
which allows only the following characters to be backslash-escaped:
\`*_{}[]()>#+-.!
-(However, if the `markdown_strict` format is used, the standard markdown rule
+(However, if the `markdown_strict` format is used, the standard Markdown rule
will be used.)
A backslash-escaped space is parsed as a nonbreaking space. It will
@@ -2428,7 +2440,7 @@ appear in TeX output as `~` and in HTML and XML as `\&#160;` or
A backslash-escaped newline (i.e. a backslash occurring at the end of
a line) is parsed as a hard line break. It will appear in TeX output as
`\\` and in HTML as `<br />`. This is a nice alternative to
-markdown's "invisible" way of indicating hard line breaks using
+Markdown's "invisible" way of indicating hard line breaks using
two trailing spaces on a line.
Backslash escapes do not work in verbatim contexts.
@@ -2520,7 +2532,7 @@ of consecutive backticks (optionally followed by a space)
and ends with a string of the same number of backticks (optionally
preceded by a space).
-Note that backslash-escapes (and other markdown constructs) do not
+Note that backslash-escapes (and other Markdown constructs) do not
work in verbatim contexts:
This is a backslash followed by an asterisk: `\*`.
@@ -2653,7 +2665,7 @@ Raw HTML
Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
(except verbatim contexts, where `<`, `>`, and `&` are interpreted
literally). (Technically this is not an extension, since standard
-markdown allows it, but it has been made an extension so that it can
+Markdown allows it, but it has been made an extension so that it can
be disabled if desired.)
The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
@@ -2662,15 +2674,15 @@ formats.
#### Extension: `markdown_in_html_blocks` ####
-Standard markdown allows you to include HTML "blocks": blocks
+Standard Markdown allows you to include HTML "blocks": blocks
of HTML between balanced tags that are separated from the surrounding text
with blank lines, and start and end at the left margin. Within
-these blocks, everything is interpreted as HTML, not markdown;
+these blocks, everything is interpreted as HTML, not Markdown;
so (for example), `*` does not signify emphasis.
Pandoc behaves this way when the `markdown_strict` format is used; but
-by default, pandoc interprets material between HTML block tags as markdown.
-Thus, for example, Pandoc will turn
+by default, pandoc interprets material between HTML block tags as Markdown.
+Thus, for example, pandoc will turn
<table>
<tr>
@@ -2691,12 +2703,12 @@ into
whereas `Markdown.pl` will preserve it as is.
There is one exception to this rule: text between `<script>` and
-`<style>` tags is not interpreted as markdown.
+`<style>` tags is not interpreted as Markdown.
-This departure from standard markdown should make it easier to mix
-markdown with HTML block elements. For example, one can surround
-a block of markdown text with `<div>` tags without preventing it
-from being interpreted as markdown.
+This departure from standard Markdown should make it easier to mix
+Markdown with HTML block elements. For example, one can surround
+a block of Markdown text with `<div>` tags without preventing it
+from being interpreted as Markdown.
#### Extension: `native_divs` ####
@@ -2734,7 +2746,7 @@ Note that in LaTeX environments, like
\end{tabular}
the material between the begin and end tags will be interpreted as raw
-LaTeX, not as markdown.
+LaTeX, not as Markdown.
Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
and ConTeXt.
@@ -2830,7 +2842,7 @@ empty:
[my website]: http://foo.bar.baz
-Note: In `Markdown.pl` and most other markdown implementations,
+Note: In `Markdown.pl` and most other Markdown implementations,
reference link definitions cannot occur in nested constructions
such as list items or block quotes. Pandoc lifts this arbitrary
seeming restriction. So the following is fine in pandoc, though
@@ -2903,7 +2915,7 @@ Footnotes
#### Extension: `footnotes` ####
-Pandoc's markdown allows footnotes, using the following syntax:
+Pandoc's Markdown allows footnotes, using the following syntax:
Here is a footnote reference,[^1] and another.[^longnote]
@@ -2982,7 +2994,7 @@ Note that `pandoc-citeproc --bib2json` and `pandoc-citeproc --bib2yaml`
can produce `.json` and `.yaml` files from any of the supported formats.
In-field markup: In BibTeX and BibLaTeX databases, pandoc-citeproc parses
-a subset of LaTeX markup; in CSL YAML databases, pandoc markdown; and in CSL JSON databases, an [HTML-like markup][CSL markup specs]:
+a subset of LaTeX markup; in CSL YAML databases, pandoc Markdown; and in CSL JSON databases, an [HTML-like markup][CSL markup specs]:
`<i>...</i>`
: italics
@@ -3124,10 +3136,10 @@ format (either BibTeX or BibLaTeX).
Non-pandoc extensions
---------------------
-The following markdown syntax extensions are not enabled by default
+The following Markdown syntax extensions are not enabled by default
in pandoc, but may be enabled by adding `+EXTENSION` to the format
name, where `EXTENSION` is the name of the extension. Thus, for
-example, `markdown+hard_line_breaks` is markdown with hard line breaks.
+example, `markdown+hard_line_breaks` is Markdown with hard line breaks.
#### Extension: `lists_without_preceding_blankline` ####
@@ -3146,6 +3158,10 @@ treated as spaces or as hard line breaks. This option is intended for
use with East Asian languages where spaces are not used between words,
but text is divided into lines for readability.
+#### Extension: `emoji` ####
+
+Parses textual emojis like `:smile:` as Unicode emoticons.
+
#### Extension: `tex_math_single_backslash` ####
Causes anything between `\(` and `\)` to be interpreted as inline
@@ -3161,8 +3177,8 @@ as display TeX math.
#### Extension: `markdown_attribute` ####
-By default, pandoc interprets material inside block-level tags as markdown.
-This extension changes the behavior so that markdown is only parsed
+By default, pandoc interprets material inside block-level tags as Markdown.
+This extension changes the behavior so that Markdown is only parsed
inside block-level tags if the tags have the attribute `markdown=1`.
#### Extension: `mmd_title_block` ####
@@ -3244,7 +3260,7 @@ in several respects:
Markdown variants
-----------------
-In addition to pandoc's extended markdown, the following markdown
+In addition to pandoc's extended Markdown, the following Markdown
variants are supported:
`markdown_phpextra` (PHP Markdown Extra)
@@ -3256,7 +3272,7 @@ variants are supported:
: `pipe_tables`, `raw_html`, `tex_math_single_backslash`,
`fenced_code_blocks`, `auto_identifiers`,
`ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
- `intraword_underscores`, `strikeout`, `hard_line_breaks`,
+ `intraword_underscores`, `strikeout`, `hard_line_breaks`, `emoji`,
`shortcut_reference_links`.
`markdown_mmd` (MultiMarkdown)
@@ -3270,11 +3286,11 @@ variants are supported:
`markdown_strict` (Markdown.pl)
: `raw_html`
-Extensions with formats other than markdown
+Extensions with formats other than Markdown
-------------------------------------------
Some of the extensions discussed above can be used with formats
-other than markdown:
+other than Markdown:
* `auto_identifiers` can be used with `latex`, `rst`, `mediawiki`,
and `textile` input (and is used by default).
@@ -3284,15 +3300,15 @@ other than markdown:
(This is handy for reading web pages formatted using MathJax,
for example.)
-Producing slide shows with Pandoc
+Producing slide shows with pandoc
=================================
-You can use Pandoc to produce an HTML + javascript slide presentation
+You can use pandoc to produce an HTML + javascript slide presentation
that can be viewed via a web browser. There are five ways to do this,
using [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].
You can also produce a PDF slide show using LaTeX [`beamer`].
-Here's the markdown source for a simple slide show, `habits.txt`:
+Here's the Markdown source for a simple slide show, `habits.txt`:
% Habits
% John Doe
@@ -3460,12 +3476,12 @@ Speaker notes
-------------
reveal.js has good support for speaker notes. You can add notes to your
-markdown document thus:
+Markdown document thus:
<div class="notes">
This is my note.
- - It can contain markdown
+ - It can contain Markdown
- like this list
</div>
@@ -3489,11 +3505,14 @@ the [Beamer User's Guide] may also be used: `allowdisplaybreaks`,
`allowframebreaks`, `b`, `c`, `t`, `environment`, `label`, `plain`,
`shrink`.
+Creating EPUBs with pandoc
+==========================
+
EPUB Metadata
-=============
+-------------
EPUB metadata may be specified using the `--epub-metadata` option, but
-if the source document is markdown, it is better to use a [YAML metadata
+if the source document is Markdown, it is better to use a [YAML metadata
block][Extension: `yaml_metadata_block`]. Here is an example:
---
@@ -3580,6 +3599,21 @@ The following fields are recognized:
[MARC relators]: http://loc.gov/marc/relators/relaterm.html
[`spine` element]: http://idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem
+Linked media
+------------
+
+By default, pandoc will download linked media (including audio and
+video) and include it in the EPUB container, yielding a completely
+self-contained EPUB. If you want to link to external media resources
+instead, use raw HTML in your source and add `data-external="1"` to the tag
+with the `src` attribute. For example:
+
+ <audio controls="1">
+ <source src="http://example.com/music/toccata.mp3"
+ data-external="1" type="audio/mpeg">
+ </source>
+ </audio>
+
Literate Haskell support
========================
@@ -3588,12 +3622,12 @@ format (`markdown`, `markdown_strict`, `rst`, or `latex` for input or output;
`beamer`, `html` or `html5` for output only), pandoc will treat the document as
literate Haskell source. This means that
- - In markdown input, "bird track" sections will be parsed as Haskell
+ - In Markdown input, "bird track" sections will be parsed as Haskell
code rather than block quotations. Text between `\begin{code}`
and `\end{code}` will also be treated as Haskell code. For
ATX-style headers the character '=' will be used instead of '#'.
- - In markdown output, code blocks with classes `haskell` and `literate`
+ - In Markdown output, code blocks with classes `haskell` and `literate`
will be rendered using bird tracks, and block quotations will be
indented one space, so they will not be treated as Haskell code.
In addition, headers will be rendered setext-style (with underlines)
@@ -3619,7 +3653,7 @@ Examples:
pandoc -f markdown+lhs -t html
-reads literate Haskell source formatted with markdown conventions and writes
+reads literate Haskell source formatted with Markdown conventions and writes
ordinary HTML (without bird tracks).
pandoc -f markdown+lhs -t html+lhs
@@ -3681,6 +3715,7 @@ Alfred Wechselberger,
Andreas Lööw,
Andrew Dunning,
Antoine Latter,
+Arata Mizuki,
Arlo O'Keeffe,
Artyom Kazak,
Ben Gamari,
diff --git a/RELEASE-CHECKLIST b/RELEASE-CHECKLIST
index fb786a9f0..7ae936d96 100644
--- a/RELEASE-CHECKLIST
+++ b/RELEASE-CHECKLIST
@@ -14,13 +14,13 @@ _ Generate Windows package and copy to directory.
_ Generate Mac OSX package.
-_ Generate Ubuntu/Debian deb package.
+_ Generate Ubuntu/Debian deb package (cd deb; make package).
-- Add release on github (and upload files)
+- Add release on github (use 'make changes_github' and upload files)
_ Upload to HackageDB
-_ Update website, including short description of changes
+_ Update website, including short description of changes ('make changes')
_ Announce on pandoc-announce, pandoc-discuss
diff --git a/benchmark/benchmark-pandoc.hs b/benchmark/benchmark-pandoc.hs
index aa36800ca..849448feb 100644
--- a/benchmark/benchmark-pandoc.hs
+++ b/benchmark/benchmark-pandoc.hs
@@ -15,7 +15,6 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-}
-import Prelude
import Text.Pandoc
import Criterion.Main
import Criterion.Types (Config(..))
diff --git a/changelog b/changelog
index 09a2eb18e..6c0c6e590 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,219 @@
+pandoc (1.15.2.1)
+
+ * Added two missing test files, and `stack.yaml`, to
+ `extra-source-files` so they're included in the source tarball.
+
+ * reveal.js template: Fixed parallaxBackground options.
+ `parallaxBackgroundHorizontal` and `parallaxBackgroundVertical`
+ need integer values, not strings. (Vaughn Iverson)
+
+pandoc (1.15.2)
+
+ * `pandoc my.md -t context -o my.pdf` will now create a PDF using
+ ConTeXt rather than LaTeX (#2463).
+
+ * Fixed omitted `url(...)` in CSS data-uri with `--self-contained` (#2489).
+
+ * Added `emoji` Markdown extension, enabled by default in `markdown_github`
+ (#2523). Added `Ext_emoji` to `Extension` in `Text.Pandoc.Options`
+ (API change).
+
+ * `Text.Pandoc.Readers.HTML.parseTags`: Fixed over-eager raw HTML inline
+ parsing (#2469). Tightened up the inline HTML parser so it disallows
+ TagWarnings.
+
+ * Derive `Generic` instances for the types in `Text.Pandoc.Options`.
+
+ * Org reader:
+
+ + Fix paragraph/list interaction (Albert Krewinkel, #2464).
+ Paragraphs can be followed by lists, even if there is no blank line
+ between the two blocks. However, this should only be true if the
+ paragraph is not within a list, were the preceding block should be
+ parsed as a plain instead of paragraph (to allow for compact lists).
+ Thanks to @rgaiacs for bringing this up.
+ + Allow toggling header args (Albert Krewinkel, #2269).
+ Org-mode allows to skip the argument of a code block header argument if
+ it's toggling a value. Argument-less headers are now recognized,
+ avoiding weird parsing errors.
+ + Fix markup parsing in headers (Albert Krewinkel, #2504).
+ Markup as the very first item in a header wasn't recognized. This was
+ caused by an incorrect parser state: positions at which inline markup
+ can start need to be marked explicitly by changing the parser state.
+ This wasn't done for headers. The proper function to update the state
+ is now called at the beginning of the header parser, fixing this issue.
+ + Fix emphasis rules for smart parsing (Albert Krewinkel, #2513).
+ Smart quotes, ellipses, and dashes should behave like normal quotes,
+ single dashes, and dots with respect to text markup parsing.
+ + Require whitespace around definition list markers (#2518).
+ This rule was not checked before, resulting in bugs with footnotes
+ and some link types.
+
+ * Markdown reader:
+
+ + Pipe tables with long lines now get relative cell widths (#2471).
+ If a pipe table contains a line longer than the column width (as set by
+ `--columns` or 80 by default), relative widths are computed based on the
+ widths of the separator lines relative to the column width. This should
+ solve persistent problems with long pipe tables in LaTeX/PDF output, and
+ give more flexibility for determining relative column widths in other
+ formats, too. For narrower pipe tables, column widths of 0 are used,
+ telling pandoc not to specify widths explicitly in output formats that
+ permit this.
+ + Improved parser for `mmd_title_block`. We now allow blank metadata
+ fields. These were explicitly disallowed before.
+ + Citation keys can now contain `://`, so URLs and DOIs can be used
+ as citation keys (jgm/pandoc-citeproc#166).
+
+ * Beamer template: fix incompatibility of section slides with natbib.
+ Natbib (and presumably biblatex) bibliography commands create
+ their own section. Since these are in frame environments,
+ we have an incompatibility with the `\AtBeginSection` macro
+ which creates a special frame when a new section occurs.
+ (We can't have a frame inside another frame.) This change disables
+ `\AtBeginSection` inside bibliography slides. Thinks to Yihui Xie for
+ bringing the problem to my attention. This supersedes #145. See
+ discussion there.
+
+ * Textile reader: don't do smart punctuation unless explicitly asked
+ (#2480). Note that although smart punctuation is part of the textile
+ spec, it's not always wanted when converting from textile
+ to, say, Markdown. So it seems better to make this an option.
+
+ * LaTeX reader: Handle `comment` environment (Arata Mizuki).
+ The `comment` environment is handled in a similar way to the
+ `verbatim` environment, except that its content is discarded.
+
+ * Docx reader: Follow relationships correctly in foot/endnotes (#2258,
+ Jesse Rosenthal). This fixes a problem with links in notes.
+
+ * LaTeX and ConTeXt writers: support `lang` attribute on divs and spans
+ (mb21). For LaTeX, also collect `lang` and `dir` attributes on spans and
+ divs to set the `lang`, `otherlangs` and `dir` variables if they aren’t set
+ already. See #895.
+
+ * LaTeX writer:
+
+ + Use proper command for `\textarabic` (mb21).
+ + Added `de-CH-1901`, fixed `el-polyton` in `toPloyglossia` (Nick Bart).
+ + Use `\hypertarget` and `\hyperlink` for links. This works correctly
+ to link to Div or Span elements. We now don't bother defining `\label`
+ for Div or Span elements. Closes jgm/pandoc-citeproc#174.
+ + Avoid footnotes in list of figures (#1506).
+ + Properly handle footnotes in captions (#1506).
+ + Add `\protect` to `\hyperlink` (#2490). Thanks to Hadrien Mary.
+ + Set `colorlinks` if `linkcolor`, `urlcolor`, `citecolor`, or
+ `toccolor` is set (#2508).
+
+ * Textile writer: support start number in ordered lists (#2465).
+
+ * OpenDocument writer: Allow customization of opendocument
+ automatic styles. Automatic styles can now be inserted in the
+ template, which now provides the enclosing `<office:automatic-styles>`
+ tags (#2520).
+
+ * Docx writer: insert space between footnote reference and note (#2527).
+ This matches Word's default behavior.
+
+ * EPUB writer: don't download linked media when `data-external` attribute
+ set (#2473). By default pandoc downloads all linked media and includes it
+ in the EPUB container. This can be disabled by setting `data-external` on
+ the tags linking to media that should not be downloaded. Example:
+
+ <audio controls="1">
+ <source src="http://example.com/music/toccata.mp3"
+ data-external="1" type="audio/mpeg">
+ </source>
+ </audio>
+
+ * HTML writer: use width on whole table if col widths sum to < 100%.
+ Otherwise some browsers display the table with the columns
+ separated far apart.
+
+ * AsciiDoc template: Fix `author` and `date`; add `keywords`,
+ `abstract` (Andrew Dunning).
+
+ * HTML-based templates (Andrew Dunning):
+
+ + Use en dash instead of hyphen between title prefix and title.
+ + Add `keywords` to metadata.
+ + Add `lang`, `dir`, `quotes` where missing.
+ + Always make author and date display conditional.
+ + Updated dzslides template from source.
+
+ * Man template: make "generated by" comment conditional.
+
+ * LaTeX, Beamer templates:
+
+ + Add `babel-otherlangs` for language divs/spans; `babel-newcommands`,
+ filled by commands that make babel understand the polyglossia-style
+ language directives (mb21, #137).
+ + Improved formatting of conditionals; `$for$` is always provided to allow
+ multiple options (Andrew Dunning, #141).
+ + Use `Ligatures=TeX` rather than `Mapping=tex-text` with `fontspec`
+ to improve support for LuaTeX (Andrew Dunning, #135).
+ + Revise `hyperref` usage (Andrew Dunning, #139, #141):
+ - use same options for all LaTeX engines;
+ - add `subtitle` and `keywords` to PDF metadata;
+ - do not override `hyperref` link coloring without user input, effectively making
+ the `hidelinks` option the default (removed as a separate variable);
+ - link colors can be enabled (using a slightly darker version of the old
+ defaults) using a new `colorlinks` variable, automatically used by
+ the LaTeX writer when custom colors are specified;
+ - `pdfborder={0 0 0}` is automatically set by `hyperref` with
+ `colorlinks`, and is only applied if `colorlinks` is disabled.
+
+ * ConTeXt template (Andrew Dunning):
+
+ + New variables for controlling styles: `linkstyle`, `linkcolor`,
+ `linkcontrastcolor`, `layout`, `pagenumbering`, `whitespace`, `indenting`,
+ `interlinespace`, `headertext`, `footertext`, `mainfont`, `sansfont`,
+ `monofont`, `mathfont`, `fontsize`.
+ + Default template no longer supports MkII.
+ + Improve writing of title block (suppressing numbering of first page).
+ + Add `title` `subtitle`, `author`, `date`, `keywords` to PDF metadata.
+ + Support `subtitle`, `abstract`.
+ + Support list of figures (`lof`), list of tables (`lot`).
+ + Disable link styling by default.
+ + Define styles for all section types.
+ + Enable microtype.
+ + Improved formatting of conditionals.
+
+ * Beamer template: added code to prevent slide breaks inside paragraphs
+ (#2422, thanks to Nick Bart). This will matter, in practice, only when
+ `allowframebreaks` is used. It is especially helpful for bibliography
+ slides.
+
+ * OpenDocument template: Add `<office:automatic-styles>` tag around
+ automatic styles. The writer now longer provides this (see #2520).
+
+ * Restored Text.Pandoc.Compat.Monoid.
+
+ * Do not export (<>) from custom Prelude. The Prelude now matches
+ base 4.8 Prelude's API.
+
+ * Don't use custom prelude with ghc 7.10. Use the custom prelude
+ only for earlier versions. This change makes `stack ghci` and
+ `cabal repl` work (#2503), at least with ghc 7.10.
+
+ * Changed § to % in operators from Odt.Arrows.Utils (#2457).
+ This prevents problems building haddocks with "C" locale.
+
+ * Change default for old-locale flag to False.
+
+ * Use stack in deb, osx, and Windows package generators.
+
+ * Added Vagrantfile for building deb in vm.
+ This should help in automating binary package creation. 'make package'
+ will make the package. 'make package COMMIT=blah' will make the package
+ from commit blah.
+
+ * README:
+
+ + Consistent capitalization for pandoc and Markdown.
+ + Fixed `auto_identifiers` examples (Benoit Schweblin).
+ + Improved documentation of template variables (Andrew Dunning).
+
pandoc (1.15.1.1)
* `Text.Pandoc.Data`: store paths in dataFiles using posix separators.
@@ -205,7 +421,7 @@ pandoc (1.15.1)
Move HTML5 shiv after CSS and fix URL (Andrew Dunning).
Add dir attribute in html5 (Andrew Dunning).
+ reveal.js: Add `controls`, `progress` variables (Grégoire Pineau, #127).
- Add `width`, `height` variables (Anrew Dunning). Update template
+ Add `width`, `height` variables (Andrew Dunning). Update template
from 3.1 source (Andrew Dunning). All configuration options are now
available as variables, but are only be included if set (reveal.js
uses defaults otherwise).
diff --git a/data/templates b/data/templates
-Subproject 12a0110a0a5baeb56436275006dbda7ce119e3d
+Subproject ff9ebaa31ae31401e236574e81c2e75609adc72
diff --git a/deb/GlobalSignDomainValidationCA-SHA256-G2.pem b/deb/GlobalSignDomainValidationCA-SHA256-G2.pem
new file mode 100644
index 000000000..b9130c350
--- /dev/null
+++ b/deb/GlobalSignDomainValidationCA-SHA256-G2.pem
@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEYzCCA0ugAwIBAgILBAAAAAABRE7wPiAwDQYJKoZIhvcNAQELBQAwVzELMAkG
+A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
+b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw0xNDAyMjAxMDAw
+MDBaFw0yNDAyMjAxMDAwMDBaMGAxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
+YWxTaWduIG52LXNhMTYwNAYDVQQDEy1HbG9iYWxTaWduIERvbWFpbiBWYWxpZGF0
+aW9uIENBIC0gU0hBMjU2IC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
+AoIBAQCp3cwOs+IyOd1JIqgTaZOHiOEM7nF9vZCHll1Z8syz0lhXV/lG72wm2DZC
+jn4wsy+aPlN7H262okxFHzzTFZMcie089Ffeyr3sBppqKqAZUn9R0XQ5CJ+r69eG
+ExWXrjbDVGYOWvKgc4Ux47JkFGr/paKOJLu9hVIVonnu8LXuPbj0fYC82ZA1ZbgX
+qa2zmJ+gfn1u+z+tfMIbWTaW2jcyS0tdNQJjjtunz2LuzC7Ujcm9PGqRcqIip3It
+INH6yjfaGJjmFiRxJUvE5XuJUgkC/VkrBG7KB4HUs9ra2+PMgKhWBwZ8lgg3nds4
+tmI0kWIHdAE42HIw4uuQcSZiwFfzAgMBAAGjggElMIIBITAOBgNVHQ8BAf8EBAMC
+AQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQU6k581IAt5RWBhiaMgm3A
+mKTPlw8wRwYDVR0gBEAwPjA8BgRVHSAAMDQwMgYIKwYBBQUHAgEWJmh0dHBzOi8v
+d3d3Lmdsb2JhbHNpZ24uY29tL3JlcG9zaXRvcnkvMDMGA1UdHwQsMCowKKAmoCSG
+Imh0dHA6Ly9jcmwuZ2xvYmFsc2lnbi5uZXQvcm9vdC5jcmwwPQYIKwYBBQUHAQEE
+MTAvMC0GCCsGAQUFBzABhiFodHRwOi8vb2NzcC5nbG9iYWxzaWduLmNvbS9yb290
+cjEwHwYDVR0jBBgwFoAUYHtmGkUNl8qJUC99BM00qP/8/UswDQYJKoZIhvcNAQEL
+BQADggEBANdFnqDc4ONhWgt9d4QXLWVagpqNoycqhffJ7+mG/dRHzQFSlsVDvTex
+4bjyqdKKEYRxkRWJ3AKdC8tsM4U0KJ4gsrGX3G0LEME8zV/qXdeYMcU0mVwAYVXE
+GwJbxeOJyLS4bx448lYm6UHvPc2smU9ZSlctS32ux4j71pg79eXw6ImJuYsDy1oj
+H6T9uOr7Lp2uanMJvPzVoLVEgqtEkS5QLlfBQ9iRBIvpES5ftD953x77PzAAi1Pj
+tywdO02L3ORkHQRYM68bVeerDL8wBHTk8w4vMDmNSwSMHnVmZkngvkA0x1xaUZK6
+EjxS1QSCVS1npd+3lXzuP8MIugS+wEY=
+-----END CERTIFICATE-----
diff --git a/deb/Makefile b/deb/Makefile
index 7f514fe24..0c4262fc0 100644
--- a/deb/Makefile
+++ b/deb/Makefile
@@ -1,9 +1,10 @@
COMMIT?=HEAD
+VAGRANTBOX?=debian/wheezy64
.PHONY: package clean
package:
- vagrant up
+ VAGRANTBOX=$(VAGRANTBOX) vagrant up
vagrant ssh -c 'rm -rf pandoc && git clone https://github.com/jgm/pandoc && cd pandoc && git checkout -b work $(COMMIT) && git submodule update --init && ./make_deb.sh && cp *.deb /vagrant_data/'
vagrant halt
diff --git a/deb/Vagrantfile b/deb/Vagrantfile
index f52de8ff9..3a6ac14e8 100644
--- a/deb/Vagrantfile
+++ b/deb/Vagrantfile
@@ -12,7 +12,7 @@ Vagrant.configure(2) do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
- config.vm.box = "ubuntu/trusty64"
+ config.vm.box = ENV['VAGRANTBOX'] || "ubuntu/precise64"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
@@ -48,7 +48,7 @@ Vagrant.configure(2) do |config|
# vb.gui = true
# Customize the amount of memory on the VM:
- vb.memory = "4096"
+ vb.memory = "2048"
end
#
# View the documentation for the provider you are using for more
@@ -65,9 +65,11 @@ Vagrant.configure(2) do |config|
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
- wget -q -O- https://s3.amazonaws.com/download.fpcomplete.com/debian/fpco.key | sudo apt-key add -
- echo 'deb http://download.fpcomplete.com/ubuntu/trusty stable main'|sudo tee /etc/apt/sources.list.d/fpco.list
+ wget -q https://s3.amazonaws.com/download.fpcomplete.com/debian/fpco.key
+ sudo apt-key add fpco.key
+ echo 'deb http://download.fpcomplete.com/ubuntu/precise stable main'|sudo tee /etc/apt/sources.list.d/fpco.list
sudo apt-get update
sudo apt-get install -y stack build-essential debhelper dh-make
+ sudo cp /vagrant_data/deb/*.pem /etc/ssl/certs/
SHELL
end
diff --git a/deb/control.in b/deb/control.in
index 0aabf67a2..549f9c115 100644
--- a/deb/control.in
+++ b/deb/control.in
@@ -4,7 +4,7 @@ Section: text
Priority: optional
Architecture: ARCHITECTURE
Installed-Size: INSTALLED_SIZE
-Depends: libc6 (>= 2.11), libgmp10, zlib1g (>= 1:1.1.4)
+Depends: libc6 (>= 2.13), libgmp10, zlib1g (>= 1:1.1.4)
Maintainer: John MacFarlane <jgm@berkeley.edu>
Description: general markup converter
Pandoc is a Haskell library for converting from one markup
diff --git a/deb/haskell.org.pem b/deb/haskell.org.pem
new file mode 100644
index 000000000..05bdffb9a
--- /dev/null
+++ b/deb/haskell.org.pem
@@ -0,0 +1,30 @@
+-----BEGIN CERTIFICATE-----
+MIIFMjCCBBqgAwIBAgISESGwJtbMWHI+x6Mmm0FEK3WqMA0GCSqGSIb3DQEBCwUA
+MGAxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTYwNAYD
+VQQDEy1HbG9iYWxTaWduIERvbWFpbiBWYWxpZGF0aW9uIENBIC0gU0hBMjU2IC0g
+RzIwHhcNMTUxMTExMjE0NjUzWhcNMTYxMjE1MDYyODEwWjA7MSEwHwYDVQQLExhE
+b21haW4gQ29udHJvbCBWYWxpZGF0ZWQxFjAUBgNVBAMMDSouaGFza2VsbC5vcmcw
+ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDNixwKSAJbYPGflK3nO/hH
+CxigkOiKQr9q47aY9S8l0vU9ISC0eiuKkFD42ia5GzeqyBsGF4HoSF0MtBivShJz
+oxt6xFtmagKRX6VB3Qo41+36IKnqmvWE5CAoNIyoy9+ZgfKQKOaIjQzFd4edYxfa
+AQgEypRjod/BjY4NlAOILXa1L7cNQp29QkouODU5oW9mT/TWh3gNIO7cjqq+GHxh
+7/itRt7I6CJOPhEZa3UaA27yNbDsJK8dxGXeGqkUVqdoff98zO4LygyNxwIguWbD
+ektP8472N9tR4G2e/f3tnWPFzmSFIUYQPQQZsWbMi5lBVAL1IX3kgO8qgyJOQeWN
+AgMBAAGjggIJMIICBTAOBgNVHQ8BAf8EBAMCBaAwSQYDVR0gBEIwQDA+BgZngQwB
+AgEwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ2xvYmFsc2lnbi5jb20vcmVw
+b3NpdG9yeS8wYgYDVR0RBFswWYINKi5oYXNrZWxsLm9yZ4IYYXV0b2Rpc2NvdmVy
+Lmhhc2tlbGwub3JnghBtYWlsLmhhc2tlbGwub3Jngg9vd2EuaGFza2VsbC5vcmeC
+C2hhc2tlbGwub3JnMAkGA1UdEwQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsG
+AQUFBwMCMEMGA1UdHwQ8MDowOKA2oDSGMmh0dHA6Ly9jcmwuZ2xvYmFsc2lnbi5j
+b20vZ3MvZ3Nkb21haW52YWxzaGEyZzIuY3JsMIGUBggrBgEFBQcBAQSBhzCBhDBH
+BggrBgEFBQcwAoY7aHR0cDovL3NlY3VyZS5nbG9iYWxzaWduLmNvbS9jYWNlcnQv
+Z3Nkb21haW52YWxzaGEyZzJyMS5jcnQwOQYIKwYBBQUHMAGGLWh0dHA6Ly9vY3Nw
+Mi5nbG9iYWxzaWduLmNvbS9nc2RvbWFpbnZhbHNoYTJnMjAdBgNVHQ4EFgQUsWoN
+IkHc+WhdtDwGB4pRHYZu+x4wHwYDVR0jBBgwFoAU6k581IAt5RWBhiaMgm3AmKTP
+lw8wDQYJKoZIhvcNAQELBQADggEBADrupN5ncMzXJLUxtIkhZKJUOQByrkVqmlvO
+me3tsAQn2YccC1YPE7wlkMttV8h8JN3/CWlvcSwfncXPzDF4lV7tuunapmAJLTxz
+Iz4tCIMzKVaGaivxYe9dml9LtiicsAOo29ZGE4E+mTHXR0EBjylKn4RS5f6XLawC
+wvdzYEH6nw6XbD6PlvYjZekIcky1lZ99cqsBoYiht0PQEcj8LWcBW79o1UWYEaXv
+q8b47QhFYMQ+IKwfIo3PSWjotIBw35lnrfKlrWvqyRA5t+ollH+6X1vdYOibupts
+rUdXZCfeWcwhFiJVOrq7kxpQLNZsPq8nm55Ao2tRGsrDMwsuZhc=
+-----END CERTIFICATE-----
diff --git a/deb/stack.yaml b/deb/stack.yaml
index 9c9906c05..b4ee36157 100644
--- a/deb/stack.yaml
+++ b/deb/stack.yaml
@@ -13,5 +13,5 @@ flags:
debug: false
packages:
- '..'
-- 'https://hackage.haskell.org/package/pandoc-citeproc-0.8.0.1/pandoc-citeproc-0.8.0.1.tar.gz'
-resolver: lts-3.10
+- 'https://hackage.haskell.org/package/pandoc-citeproc-0.8.1.3/pandoc-citeproc-0.8.1.3.tar.gz'
+resolver: lts-3.13
diff --git a/extract-changes.hs b/extract-changes.hs
new file mode 100644
index 000000000..8c8160c2c
--- /dev/null
+++ b/extract-changes.hs
@@ -0,0 +1,9 @@
+-- Extract changes from latest version in changelog.
+import Text.Pandoc.JSON
+
+main = toJSONFilter extractFirst
+
+extractFirst :: Pandoc -> Pandoc
+extractFirst (Pandoc meta (Para{} : BulletList bs : _)) =
+ Pandoc meta [BulletList bs]
+extractFirst x = x
diff --git a/make_osx_package.sh b/make_osx_package.sh
index a544ad7a0..320c3fead 100755
--- a/make_osx_package.sh
+++ b/make_osx_package.sh
@@ -14,13 +14,14 @@ PACKAGEMAKER=/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
# We need this for hsb2hs:
PATH=$LOCALBIN:$PATH
+export MACOSX_DEPLOYMENT_TARGET=10.7
# echo Removing old files...
rm -rf $DIST
mkdir -p $DIST
mkdir -p $RESOURCES
stack setup
-which hsb2hs | stack install --stack-yaml=stack.hsb2hs.yaml
+which hsb2hs || stack install --stack-yaml=stack.hsb2hs.yaml
echo Building pandoc...
stack clean
diff --git a/man/pandoc.1 b/man/pandoc.1
index 1390591c5..0126fc6de 100644
--- a/man/pandoc.1
+++ b/man/pandoc.1
@@ -1,5 +1,5 @@
.\"t
-.TH PANDOC 1 "July 15, 2015" ""
+.TH PANDOC 1 "November 12, 2015" "pandoc 1.15.2.1"
.SH NAME
pandoc - general markup converter
.SH SYNOPSIS
@@ -20,33 +20,34 @@ Texinfo, MediaWiki markup, DokuWiki markup, Haddock markup, EPUB (v2 or
v3), FictionBook2, Textile, groff man pages, Emacs Org mode, AsciiDoc,
InDesign ICML, and Slidy, Slideous, DZSlides, reveal.js or S5 HTML slide
shows.
-It can also produce PDF output on systems where LaTeX is installed.
+It can also produce PDF output on systems where LaTeX or ConTeXt is
+installed.
.PP
-Pandoc\[aq]s enhanced version of markdown includes syntax for footnotes,
+Pandoc\[aq]s enhanced version of Markdown includes syntax for footnotes,
tables, flexible ordered lists, definition lists, fenced code blocks,
superscripts and subscripts, strikeout, metadata blocks, automatic
-tables of contents, embedded LaTeX math, citations, and markdown inside
+tables of contents, embedded LaTeX math, citations, and Markdown inside
HTML block elements.
-(These enhancements, described below under Pandoc\[aq]s markdown, can be
+(These enhancements, described below under Pandoc\[aq]s Markdown, can be
disabled using the \f[C]markdown_strict\f[] input or output format.)
.PP
-In contrast to most existing tools for converting markdown to HTML,
-which use regex substitutions, Pandoc has a modular design: it consists
+In contrast to most existing tools for converting Markdown to HTML,
+which use regex substitutions, pandoc has a modular design: it consists
of a set of readers, which parse text in a given format and produce a
native representation of the document, and a set of writers, which
convert this native representation into a target format.
Thus, adding an input or output format requires only adding a reader or
writer.
.PP
-Because Pandoc\[aq]s intermediate representation of a document is less
+Because pandoc\[aq]s intermediate representation of a document is less
expressive than many of the formats it converts between, one should not
expect perfect conversions between every format and every other.
Pandoc attempts to preserve the structural elements of a document, but
not formatting details such as margin size.
And some document elements, such as complex tables, may not fit into
-Pandoc\[aq]s simple document model.
-While conversions from Pandoc\[aq]s Markdown to all formats aspire to be
-perfect, conversions from formats more expressive than Pandoc\[aq]s
+pandoc\[aq]s simple document model.
+While conversions from pandoc\[aq]s Markdown to all formats aspire to be
+perfect, conversions from formats more expressive than pandoc\[aq]s
Markdown can be expected to be lossy.
.SS Using \f[C]pandoc\f[]
.PP
@@ -98,7 +99,7 @@ command\-line options.
The input format can be specified using the \f[C]\-r/\-\-read\f[] or
\f[C]\-f/\-\-from\f[] options, the output format using the
\f[C]\-w/\-\-write\f[] or \f[C]\-t/\-\-to\f[] options.
-Thus, to convert \f[C]hello.txt\f[] from markdown to LaTeX, you could
+Thus, to convert \f[C]hello.txt\f[] from Markdown to LaTeX, you could
type:
.IP
.nf
@@ -107,7 +108,7 @@ pandoc\ \-f\ markdown\ \-t\ latex\ hello.txt
\f[]
.fi
.PP
-To convert \f[C]hello.html\f[] from HTML to markdown:
+To convert \f[C]hello.html\f[] from HTML to Markdown:
.IP
.nf
\f[C]
@@ -134,13 +135,13 @@ pandoc\ \-o\ hello.tex\ hello.txt
\f[]
.fi
.PP
-will convert \f[C]hello.txt\f[] from markdown to LaTeX.
+will convert \f[C]hello.txt\f[] from Markdown to LaTeX.
If no output file is specified (so that output goes to \f[I]stdout\f[]),
or if the output file\[aq]s extension is unknown, the output format will
default to HTML.
If no input file is specified (so that input comes from \f[I]stdin\f[]),
or if the input files\[aq] extensions are unknown, the input format will
-be assumed to be markdown unless explicitly specified.
+be assumed to be Markdown unless explicitly specified.
.PP
Pandoc uses the UTF\-8 character encoding for both input and output.
If your local character encoding is not UTF\-8, you should pipe input
@@ -160,7 +161,7 @@ the \f[C]\-s/\-\-standalone\f[] option.
.PP
To produce a PDF, specify an output file with a \f[C]\&.pdf\f[]
extension.
-Pandoc will use LaTeX to convert it to PDF:
+By default, pandoc will use LaTeX to convert it to PDF:
.IP
.nf
\f[C]
@@ -190,7 +191,12 @@ The \f[C]natbib\f[], \f[C]biblatex\f[], \f[C]bibtex\f[], and
\f[C]biber\f[] packages can optionally be used for citation rendering.
These are included with all recent versions of TeX Live.
.PP
-PDF output can be controlled using variables for LaTeX.
+Alternatively, pandoc can use ConTeXt to create a PDF.
+To do this, specify an output file with a \f[C]\&.pdf\f[] extension, as
+before, but add \f[C]\-t\ context\f[] to the command line.
+.PP
+PDF output can be controlled using variables for LaTeX or variables for
+ConTeXt.
.SS \f[C]hsmarkdown\f[]
.PP
A user who wants a drop\-in replacement for \f[C]Markdown.pl\f[] may
@@ -209,10 +215,10 @@ simulation of symbolic links.
Specify input format.
\f[I]FORMAT\f[] can be \f[C]native\f[] (native Haskell), \f[C]json\f[]
(JSON version of native AST), \f[C]markdown\f[] (pandoc\[aq]s extended
-markdown), \f[C]markdown_strict\f[] (original unextended markdown),
+Markdown), \f[C]markdown_strict\f[] (original unextended Markdown),
\f[C]markdown_phpextra\f[] (PHP Markdown Extra),
\f[C]markdown_github\f[] (GitHub\-Flavored Markdown),
-\f[C]commonmark\f[] (CommonMark markdown), \f[C]textile\f[] (Textile),
+\f[C]commonmark\f[] (CommonMark Markdown), \f[C]textile\f[] (Textile),
\f[C]rst\f[] (reStructuredText), \f[C]html\f[] (HTML), \f[C]docbook\f[]
(DocBook), \f[C]t2t\f[] (txt2tags), \f[C]docx\f[] (docx), \f[C]odt\f[]
(ODT), \f[C]epub\f[] (EPUB), \f[C]opml\f[] (OPML), \f[C]org\f[] (Emacs
@@ -225,10 +231,10 @@ Markdown syntax extensions can be individually enabled or disabled by
appending \f[C]+EXTENSION\f[] or \f[C]\-EXTENSION\f[] to the format
name.
So, for example, \f[C]markdown_strict+footnotes+definition_lists\f[] is
-strict markdown with footnotes and definition lists enabled, and
-\f[C]markdown\-pipe_tables+hard_line_breaks\f[] is pandoc\[aq]s markdown
+strict Markdown with footnotes and definition lists enabled, and
+\f[C]markdown\-pipe_tables+hard_line_breaks\f[] is pandoc\[aq]s Markdown
without pipe tables and with hard line breaks.
-See Pandoc\[aq]s markdown, below, for a list of extensions and their
+See Pandoc\[aq]s Markdown, below, for a list of extensions and their
names.
.RS
.RE
@@ -237,11 +243,11 @@ names.
Specify output format.
\f[I]FORMAT\f[] can be \f[C]native\f[] (native Haskell), \f[C]json\f[]
(JSON version of native AST), \f[C]plain\f[] (plain text),
-\f[C]markdown\f[] (pandoc\[aq]s extended markdown),
-\f[C]markdown_strict\f[] (original unextended markdown),
+\f[C]markdown\f[] (pandoc\[aq]s extended Markdown),
+\f[C]markdown_strict\f[] (original unextended Markdown),
\f[C]markdown_phpextra\f[] (PHP Markdown Extra),
\f[C]markdown_github\f[] (GitHub\-Flavored Markdown),
-\f[C]commonmark\f[] (CommonMark markdown), \f[C]rst\f[]
+\f[C]commonmark\f[] (CommonMark Markdown), \f[C]rst\f[]
(reStructuredText), \f[C]html\f[] (XHTML), \f[C]html5\f[] (HTML5),
\f[C]latex\f[] (LaTeX), \f[C]beamer\f[] (LaTeX beamer slide show),
\f[C]context\f[] (ConTeXt), \f[C]man\f[] (groff man), \f[C]mediawiki\f[]
@@ -350,9 +356,9 @@ Show usage message.
Parse untranslatable HTML codes and LaTeX environments as raw HTML or
LaTeX, instead of ignoring them.
Affects only HTML and LaTeX input.
-Raw HTML can be printed in markdown, reStructuredText, HTML, Slidy,
+Raw HTML can be printed in Markdown, reStructuredText, HTML, Slidy,
Slideous, DZSlides, reveal.js, and S5 output; raw LaTeX can be printed
-in markdown, reStructuredText, LaTeX, and ConTeXt output.
+in Markdown, reStructuredText, LaTeX, and ConTeXt output.
The default is for the readers to omit untranslatable HTML codes and
LaTeX environments.
(The LaTeX reader does pass through untranslatable LaTeX
@@ -365,11 +371,8 @@ Produce typographically correct output, converting straight quotes to
curly quotes, \f[C]\-\-\-\f[] to em\-dashes, \f[C]\-\-\f[] to
en\-dashes, and \f[C]\&...\f[] to ellipses.
Nonbreaking spaces are inserted after certain abbreviations, such as
-"Mr." (Note: This option is significant only when the input format is
-\f[C]markdown\f[], \f[C]markdown_strict\f[], \f[C]textile\f[] or
-\f[C]twiki\f[].
-It is selected automatically when the input format is \f[C]textile\f[]
-or the output format is \f[C]latex\f[] or \f[C]context\f[], unless
+"Mr." (Note: This option is selected automatically when the output
+format is \f[C]latex\f[] or \f[C]context\f[], unless
\f[C]\-\-no\-tex\-ligatures\f[] is used.)
.RS
.RE
@@ -399,12 +402,12 @@ Specify a default extension to use when image paths/URLs have no
extension.
This allows you to use the same source for formats that require
different kinds of images.
-Currently this option only affects the markdown and LaTeX readers.
+Currently this option only affects the Markdown and LaTeX readers.
.RS
.RE
.TP
.B \f[C]\-\-filter=\f[]\f[I]EXECUTABLE\f[]
-Specify an executable to be used as a filter transforming the Pandoc AST
+Specify an executable to be used as a filter transforming the pandoc AST
after the input is parsed and before the output is written.
The executable should read JSON from stdin and write JSON to stdout.
The JSON must be formatted like pandoc\[aq]s own JSON input and output.
@@ -674,13 +677,13 @@ instead of UTF\-8 when this option is selected).
.TP
.B \f[C]\-\-reference\-links\f[]
Use reference\-style links, rather than inline links, in writing
-markdown or reStructuredText.
+Markdown or reStructuredText.
By default inline links are used.
.RS
.RE
.TP
.B \f[C]\-\-atx\-headers\f[]
-Use ATX\-style headers in markdown and asciidoc output.
+Use ATX\-style headers in Markdown and asciidoc output.
The default is to use setext\-style headers for levels 1\-2, and then
ATX headers.
.RS
@@ -771,12 +774,13 @@ documents.
\f[C]javascript\f[] obfuscates them using javascript.
\f[C]references\f[] obfuscates them by printing their letters as decimal
or hexadecimal character references.
+The default is \f[C]javascript\f[].
.RS
.RE
.TP
.B \f[C]\-\-id\-prefix=\f[]\f[I]STRING\f[]
Specify a prefix to be added to all automatically generated identifiers
-in HTML and DocBook output, and to footnote numbers in markdown output.
+in HTML and DocBook output, and to footnote numbers in Markdown output.
This is useful for preventing duplicate identifiers when generating
fragments to be included in other pages.
.RS
@@ -844,7 +848,7 @@ If it is not found there, sensible defaults will be used.
Use the specified image as the EPUB cover.
It is recommended that the image be less than 1000px in width and
height.
-Note that in a markdown source document you can also specify
+Note that in a Markdown source document you can also specify
\f[C]cover\-image\f[] in a YAML metadata block (see EPUB Metadata,
below).
.RS
@@ -871,7 +875,7 @@ which should be in ISO 8601 format), \f[C]<dc:language>\f[] (from the
\f[C]<dc:identifier\ id="BookId">\f[] (a randomly generated UUID).
Any of these may be overridden by elements in the metadata file.
.PP
-Note: if the source document is markdown, a YAML metadata block in the
+Note: if the source document is Markdown, a YAML metadata block in the
document can be used instead.
See below under EPUB Metadata.
.RE
@@ -1086,7 +1090,7 @@ with the \f[C]\-o\f[] option, or \f[C]\-\f[] (for \f[I]stdout\f[]) if no
output file was specified.
The remaining lines contain the command\-line arguments, one per line,
in the order they appear.
-These do not include regular Pandoc options and their arguments, but do
+These do not include regular pandoc options and their arguments, but do
include any options appearing after a \f[C]\-\-\f[] separator at the end
of the line.
.RS
@@ -1094,7 +1098,7 @@ of the line.
.TP
.B \f[C]\-\-ignore\-args\f[]
Ignore command\-line arguments (for use in wrapper scripts).
-Regular Pandoc options are not ignored.
+Regular pandoc options are not ignored.
Thus, for example,
.RS
.IP
@@ -1150,7 +1154,7 @@ fields as well as the following:
.TP
.B \f[C]title\f[], \f[C]author\f[], \f[C]date\f[]
allow identification of basic aspects of the document.
-Included in PDF metadata through LaTeX.
+Included in PDF metadata through LaTeX and ConTeXt.
These can be set through a pandoc title block, which allows for multiple
authors, or through a YAML metadata block:
.RS
@@ -1166,8 +1170,19 @@ author:
.fi
.RE
.TP
+.B \f[C]subtitle\f[]
+document subtitle; also used as subject in PDF metadata
+.RS
+.RE
+.TP
.B \f[C]abstract\f[]
-allows for specification of document summary in LaTeX and Word docx
+document summary, included in LaTeX, ConTeXt, AsciiDoc, and Word docx
+.RS
+.RE
+.TP
+.B \f[C]keywords\f[]
+list of keywords to be included in HTML, PDF, and AsciiDoc metadata; may
+be repeated as for \f[C]author\f[], above
.RS
.RE
.TP
@@ -1183,6 +1198,11 @@ specified
.RS
.RE
.TP
+.B \f[C]toc\-title\f[]
+title of table of contents (works only with EPUB and docx)
+.RS
+.RE
+.TP
.B \f[C]include\-before\f[]
contents specified by \f[C]\-B/\-\-include\-before\-body\f[] (may have
multiple values)
@@ -1209,14 +1229,23 @@ For some output formats, pandoc will convert it to an appropriate format
stored in the additional variables \f[C]babel\-lang\f[],
\f[C]polyglossia\-lang\f[] (LaTeX) and \f[C]context\-lang\f[] (ConTeXt).
.RS
+.PP
+Native pandoc \f[C]span\f[]s and \f[C]div\f[]s with the lang attribute
+(value in BCP 47) can be used to switch the language in that range.
.RE
.TP
.B \f[C]otherlangs\f[]
a list of other languages used in the document in the YAML metadata,
according to BCP 47.
For example: \f[C]otherlangs:\ [en\-GB,\ fr]\f[].
-Currently only used by \f[C]xelatex\f[] through the generated
-\f[C]polyglossia\-otherlangs\f[] variable.
+This is automatically generated from the \f[C]lang\f[] attributes in all
+\f[C]span\f[]s and \f[C]div\f[]s but can be overriden.
+Currently only used by LaTeX through the generated
+\f[C]babel\-otherlangs\f[] and \f[C]polyglossia\-otherlangs\f[]
+variables.
+The LaTeX writer outputs polyglossia commands in the text but the
+\f[C]babel\-newcommands\f[] variable contains mappings for them to the
+corresponding babel.
.RS
.RE
.TP
@@ -1233,11 +1262,6 @@ This may not always be necessary if the final renderer (e.g.
the browser, when generating HTML) supports the Unicode Bidirectional
Algorithm.
.PP
-LaTeX and ConTeXt assume by default that all text is left\-to\-right.
-Setting \f[C]dir:\ ltr\f[] enables bidirectional text handling in a
-document whose base direction is left\-to\-right but contains some
-right\-to\-left script.
-.PP
When using LaTeX for bidirectional documents, only the \f[C]xelatex\f[]
engine is fully supported (use \f[C]\-\-latex\-engine=xelatex\f[]).
.RE
@@ -1276,39 +1300,38 @@ themes for LaTeX \f[C]beamer\f[] documents
LaTeX variables are used when creating a PDF.
.TP
.B \f[C]fontsize\f[]
-font size (e.g.
-\f[C]10pt\f[], \f[C]12pt\f[]) for LaTeX documents
+font size for body text (e.g.
+\f[C]10pt\f[], \f[C]12pt\f[])
.RS
.RE
.TP
.B \f[C]documentclass\f[]
-document class for LaTeX documents, e.g.
+document class, e.g.
\f[C]article\f[], \f[C]report\f[], \f[C]book\f[], \f[C]memoir\f[]
.RS
.RE
.TP
.B \f[C]classoption\f[]
-option for LaTeX document class, e.g.
+option for document class, e.g.
\f[C]oneside\f[]; may be repeated for multiple options
.RS
.RE
.TP
.B \f[C]geometry\f[]
-option for LaTeX \f[C]geometry\f[] package, e.g.
+option for \f[C]geometry\f[] package, e.g.
\f[C]margin=1in\f[]; may be repeated for multiple options
.RS
.RE
.TP
.B \f[C]linestretch\f[]
-adjusts line spacing in LaTeX documents using the \f[C]setspace\f[]
-package, e.g.
+adjusts line spacing using the \f[C]setspace\f[] package, e.g.
\f[C]1.25\f[], \f[C]1.5\f[]
.RS
.RE
.TP
.B \f[C]fontfamily\f[]
-font package for LaTeX documents (with \f[C]pdflatex\f[]): TeX Live
-includes many options, documented in the LaTeX Font Catalogue.
+font package for use with \f[C]pdflatex\f[]: TeX Live includes many
+options, documented in the LaTeX Font Catalogue.
The default is Latin Modern.
.RS
.RE
@@ -1316,14 +1339,14 @@ The default is Latin Modern.
.B \f[C]fontfamilyoptions\f[]
options for package used as \f[C]fontfamily\f[]: e.g.
\f[C]osf,sc\f[] with \f[C]fontfamily\f[] set to \f[C]mathpazo\f[]
-provides Palatino with old\-style figures and true small caps
+provides Palatino with old\-style figures and true small caps; may be
+repeated for multiple options
.RS
.RE
.TP
.B \f[C]mainfont\f[], \f[C]sansfont\f[], \f[C]monofont\f[], \f[C]mathfont\f[], \f[C]CJKmainfont\f[]
-fonts for LaTeX documents (works only with \f[C]xelatex\f[] and
-\f[C]lualatex\f[]): takes the name of any system font, using the
-\f[C]fontspec\f[] package.
+font families for use with \f[C]xelatex\f[] or \f[C]lualatex\f[]: take
+the name of any system font, using the \f[C]fontspec\f[] package.
Note that if \f[C]CJKmainfont\f[] is used, the \f[C]xecjk\f[] package
must be available.
.RS
@@ -1333,8 +1356,9 @@ must be available.
options to use with \f[C]mainfont\f[], \f[C]sansfont\f[],
\f[C]monofont\f[], \f[C]mathfont\f[], \f[C]CJKmainfont\f[] in
\f[C]xelatex\f[] and \f[C]lualatex\f[].
-Allows for any choices available through \f[C]fontspec\f[], such as the
+Allow for any choices available through \f[C]fontspec\f[], such as the
OpenType features \f[C]Numbers=OldStyle,Numbers=Proportional\f[].
+May be repeated for multiple options.
.RS
.RE
.TP
@@ -1347,8 +1371,8 @@ font encodings)
.TP
.B \f[C]linkcolor\f[], \f[C]toccolor\f[], \f[C]urlcolor\f[], \f[C]citecolor\f[]
color for internal links, links in table of contents, external links,
-and citation links in LaTeX documents, using options available through
-\f[C]color\f[] package, e.g.
+and citation links, using options available through \f[C]color\f[]
+package, e.g.
\f[C]red\f[], \f[C]green\f[], \f[C]magenta\f[], \f[C]cyan\f[],
\f[C]blue\f[], \f[C]black\f[]
.RS
@@ -1361,7 +1385,7 @@ color
.RE
.TP
.B \f[C]links\-as\-notes\f[]
-causes links to be printed as footnotes in LaTeX documents
+causes links to be printed as footnotes
.RS
.RE
.TP
@@ -1379,37 +1403,103 @@ in some classes
.RE
.TP
.B \f[C]toc\f[]
-include table of contents in LaTeX documents
+include table of contents (can also be set using
+\f[C]\-\-toc/\-\-table\-of\-contents\f[])
.RS
.RE
.TP
.B \f[C]toc\-depth\f[]
-level of section to include in table of contents in LaTeX documents
+level of section to include in table of contents
.RS
.RE
.TP
-.B \f[C]toc\-title\f[]
-title of table of contents (works only with EPUB and docx)
+.B \f[C]lof\f[], \f[C]lot\f[]
+include list of figures, list of tables
.RS
.RE
.TP
-.B \f[C]lof\f[]
-include list of figures in LaTeX documents
+.B \f[C]bibliography\f[]
+bibliography to use for resolving references
.RS
.RE
.TP
-.B \f[C]lot\f[]
-include list of tables in LaTeX documents
+.B \f[C]biblio\-style\f[]
+bibliography style, when used with \f[C]\-\-natbib\f[]
.RS
.RE
+.SS Variables for ConTeXt
.TP
-.B \f[C]bibliography\f[]
-bibliography to use for resolving references
+.B \f[C]papersize\f[]
+paper size, e.g.
+\f[C]letter\f[], \f[C]A4\f[], \f[C]landscape\f[] (see ConTeXt Paper
+Setup); may be repeated for multiple options
.RS
.RE
.TP
-.B \f[C]biblio\-style\f[]
-bibliography style in LaTeX, when used with \f[C]\-\-natbib\f[]
+.B \f[C]layout\f[]
+options for page margins and text arrangement (see ConTeXt Layout); may
+be repeated for multiple options
+.RS
+.RE
+.TP
+.B \f[C]fontsize\f[]
+font size for body text (e.g.
+\f[C]10pt\f[], \f[C]12pt\f[])
+.RS
+.RE
+.TP
+.B \f[C]mainfont\f[], \f[C]sansfont\f[], \f[C]monofont\f[], \f[C]mathfont\f[]
+font families: take the name of any system font (see ConTeXt Font
+Switching)
+.RS
+.RE
+.TP
+.B \f[C]linkcolor\f[]
+color for links, e.g.
+\f[C]red\f[], \f[C]blue\f[] (see ConTeXt Color)
+.RS
+.RE
+.TP
+.B \f[C]indenting\f[]
+controls indentation of paragraphs, e.g.
+\f[C]yes,small,next\f[] (see ConTeXt Indentation); may be repeated for
+multiple options
+.RS
+.RE
+.TP
+.B \f[C]whitespace\f[]
+spacing between paragraphs, e.g.
+\f[C]none\f[], \f[C]small\f[] (using \f[C]setupwhitespace\f[])
+.RS
+.RE
+.TP
+.B \f[C]interlinespace\f[]
+adjusts line spacing, e.g.
+\f[C]4ex\f[] (using \f[C]setupinterlinespace\f[]); may be repeated for
+multiple options
+.RS
+.RE
+.TP
+.B \f[C]headertext\f[], \f[C]footertext\f[]
+text to be placed in running header or footer (see ConTeXt Headers and
+Footers); may be repeated up to four times for different placement
+.RS
+.RE
+.TP
+.B \f[C]pagenumbering\f[]
+page number style and location (using \f[C]setuppagenumbering\f[]); may
+be repeated for multiple options
+.RS
+.RE
+.TP
+.B \f[C]toc\f[]
+include table of contents (can also be set using
+\f[C]\-\-toc/\-\-table\-of\-contents\f[])
+.RS
+.RE
+.TP
+.B \f[C]lof\f[], \f[C]lot\f[]
+include list of figures, list of tables
.RS
.RE
.SS Variables for man pages
@@ -1515,16 +1605,16 @@ merge in changes after each pandoc release.
.SH PANDOC\[aq]S MARKDOWN
.PP
Pandoc understands an extended and slightly revised version of John
-Gruber\[aq]s markdown syntax.
+Gruber\[aq]s Markdown syntax.
This document explains the syntax, noting differences from standard
-markdown.
+Markdown.
Except where noted, these differences can be suppressed by using the
\f[C]markdown_strict\f[] format instead of \f[C]markdown\f[].
An extensions can be enabled by adding \f[C]+EXTENSION\f[] to the format
name and disabled by adding \f[C]\-EXTENSION\f[].
-For example, \f[C]markdown_strict+footnotes\f[] is strict markdown with
+For example, \f[C]markdown_strict+footnotes\f[] is strict Markdown with
footnotes enabled, while \f[C]markdown\-footnotes\-pipe_tables\f[] is
-pandoc\[aq]s markdown without footnotes or pipe tables.
+pandoc\[aq]s Markdown without footnotes or pipe tables.
.SS Philosophy
.PP
Markdown is designed to be easy to write, and, even more importantly,
@@ -1541,8 +1631,8 @@ This principle has guided pandoc\[aq]s decisions in finding syntax for
tables, footnotes, and other extensions.
.PP
There is, however, one respect in which pandoc\[aq]s aims are different
-from the original aims of markdown.
-Whereas markdown was originally designed with HTML generation in mind,
+from the original aims of Markdown.
+Whereas Markdown was originally designed with HTML generation in mind,
pandoc is designed for multiple output formats.
Thus, while pandoc allows the embedding of raw HTML, it discourages it,
and provides other, non\-HTMLish ways of representing important document
@@ -1605,7 +1695,7 @@ As with setext\-style headers, the header text can contain formatting:
.fi
.SS Extension: \f[C]blank_before_header\f[]
.PP
-Standard markdown syntax does not require a blank line before a header.
+Standard Markdown syntax does not require a blank line before a header.
Pandoc does require this (except, of course, at the beginning of the
document).
The reason for the requirement is that it is all too easy for a
@@ -1707,28 +1797,27 @@ Identifier
T}
_
T{
-Header identifiers in HTML
+\f[C]Header\ identifiers\ in\ HTML\f[]
T}@T{
\f[C]header\-identifiers\-in\-html\f[]
T}
T{
-\f[I]Dogs\f[]?\-\-in \f[I]my\f[] house?
+\f[C]*Dogs*?\-\-in\ *my*\ house?\f[]
T}@T{
\f[C]dogs\-\-in\-my\-house\f[]
T}
T{
-HTML, S5, or RTF?
+\f[C][HTML],\ [S5],\ or\ [RTF]?\f[]
T}@T{
\f[C]html\-s5\-or\-rtf\f[]
T}
T{
-3.
-Applications
+\f[C]3.\ Applications\f[]
T}@T{
\f[C]applications\f[]
T}
T{
-33
+\f[C]33\f[]
T}@T{
\f[C]section\f[]
T}
@@ -1877,7 +1966,7 @@ spaces after the \f[C]>\f[]:
.fi
.SS Extension: \f[C]blank_before_blockquote\f[]
.PP
-Standard markdown syntax does not require a blank line before a block
+Standard Markdown syntax does not require a blank line before a block
quote.
Pandoc does require this (except, of course, at the beginning of the
document).
@@ -1916,7 +2005,7 @@ Note: blank lines in the verbatim text need not begin with four spaces.
.SS Fenced code blocks
.SS Extension: \f[C]fenced_code_blocks\f[]
.PP
-In addition to standard indented code blocks, Pandoc supports
+In addition to standard indented code blocks, pandoc supports
\f[I]fenced\f[] code blocks.
These begin with a row of three or more tildes (\f[C]~\f[]) and end with
a row of tildes that must be at least as long as the starting row.
@@ -2022,7 +2111,7 @@ For more information on highlighting, see Syntax highlighting, below.
A line block is a sequence of lines beginning with a vertical bar
(\f[C]|\f[]) followed by a space.
The division into lines will be preserved in the output, as will any
-leading spaces; otherwise, the lines will be formatted as markdown.
+leading spaces; otherwise, the lines will be formatted as Markdown.
This is useful for verse and addresses:
.IP
.nf
@@ -2096,7 +2185,7 @@ List items look best if subsequent lines are flush with the first line
\f[]
.fi
.PP
-But markdown also allows a "lazy" format:
+But Markdown also allows a "lazy" format:
.IP
.nf
\f[C]
@@ -2145,7 +2234,7 @@ The nested list must be indented four spaces or one tab:
\f[]
.fi
.PP
-As noted above, markdown allows you to write list items "lazily,"
+As noted above, Markdown allows you to write list items "lazily,"
instead of indenting continuation lines.
However, if there are multiple paragraphs or other blocks in a list
item, the first line of each must be indented.
@@ -2164,12 +2253,12 @@ list\ item.
.fi
.PP
\f[B]Note:\f[] Although the four\-space rule for continuation paragraphs
-comes from the official markdown syntax guide, the reference
+comes from the official Markdown syntax guide, the reference
implementation, \f[C]Markdown.pl\f[], does not follow it.
So pandoc will give different results than \f[C]Markdown.pl\f[] when
authors have indented continuation paragraphs fewer than four spaces.
.PP
-The markdown syntax guide is not explicit whether the four\-space rule
+The Markdown syntax guide is not explicit whether the four\-space rule
applies to \f[I]all\f[] block\-level content in a list item; it only
mentions paragraphs and code blocks.
But it implies that the rule applies to all block\-level content
@@ -2179,7 +2268,7 @@ But it implies that the rule applies to all block\-level content
Ordered lists work just like bulleted lists, except that the items begin
with enumerators rather than bullets.
.PP
-In standard markdown, enumerators are decimal numbers followed by a
+In standard Markdown, enumerators are decimal numbers followed by a
period and a space.
The numbers themselves are ignored, so there is no difference between
this list:
@@ -2203,7 +2292,7 @@ and this one:
.fi
.SS Extension: \f[C]fancy_lists\f[]
.PP
-Unlike standard markdown, Pandoc allows ordered list items to be marked
+Unlike standard Markdown, pandoc allows ordered list items to be marked
with uppercase and lowercase letters and roman numerals, in addition to
arabic numerals.
List markers may be enclosed in parentheses or followed by a single
@@ -2295,7 +2384,7 @@ one or more block elements (paragraph, code block, list, etc.), each
indented four spaces or one tab stop.
The body of the definition (including the first line, aside from the
colon or tilde) should be indented four spaces.
-However, as with other markdown lists, you can "lazily" omit indentation
+However, as with other Markdown lists, you can "lazily" omit indentation
except at the beginning of a paragraph or other block element:
.IP
.nf
@@ -2385,7 +2474,7 @@ Consider this source:
.fi
.PP
Pandoc transforms this into a "compact list" (with no \f[C]<p>\f[] tags
-around "First", "Second", or "Third"), while markdown puts \f[C]<p>\f[]
+around "First", "Second", or "Third"), while Markdown puts \f[C]<p>\f[]
tags around "Second" and "Third" (but not "First"), because of the blank
space around "Third".
Pandoc follows a simple rule: if the text is followed by a blank line,
@@ -2395,7 +2484,7 @@ treated as a paragraph.
The fact that the list is followed by a blank line is irrelevant.
(Note: Pandoc works this way even when the \f[C]markdown_strict\f[]
format is specified.
-This behavior is consistent with the official markdown syntax
+This behavior is consistent with the official Markdown syntax
description, even though it is different from that of
\f[C]Markdown.pl\f[].)
.SS Ending a list
@@ -2411,7 +2500,7 @@ What if you want to put an indented code block after a list?
\f[]
.fi
.PP
-Trouble! Here pandoc (like other markdown implementations) will treat
+Trouble! Here pandoc (like other Markdown implementations) will treat
\f[C]{\ my\ code\ block\ }\f[] as the second paragraph of item two, and
not as a code block.
.PP
@@ -2565,7 +2654,7 @@ In multiline tables, the table parser pays attention to the widths of
the columns, and the writers try to reproduce these relative widths in
the output.
So, if you find that one of the columns is too narrow in the output, try
-widening it in the markdown source.
+widening it in the Markdown source.
.PP
Headers may be omitted in multiline tables as well as simple tables:
.IP
@@ -2658,7 +2747,7 @@ will not wrap, since there is no information available about relative
widths.
If you want content to wrap within cells, use multiline or grid tables.
.PP
-Note: Pandoc also recognizes pipe tables of the following form, as can
+Note: pandoc also recognizes pipe tables of the following form, as can
be produced by Emacs\[aq] orgtbl\-mode:
.IP
.nf
@@ -2791,7 +2880,7 @@ A YAML metadata block may occur anywhere in the document, but if it is
not at the beginning, it must be preceded by a blank line.
(Note that, because of the way pandoc concatenates input files when
several are provided, you may also keep the metadata in a separate YAML
-file and pass it to pandoc as an argument, along with your markdown
+file and pass it to pandoc as an argument, along with your Markdown
files:
.IP
.nf
@@ -2806,7 +2895,7 @@ with \f[C]\-\-\-\f[] or \f[C]\&...\f[].)
Metadata will be taken from the fields of the YAML object and added to
any existing document metadata.
Metadata can contain lists and objects (nested arbitrarily), but all
-string scalars will be interpreted as markdown.
+string scalars will be interpreted as Markdown.
Fields with names ending in an underscore will be ignored by pandoc.
(They may be given a role by external processors.)
.PP
@@ -2815,7 +2904,7 @@ The metadata fields will be combined through a \f[I]left\-biased
union\f[]: if two metadata blocks attempt to set the same field, the
value from the first block will be taken.
.PP
-When pandoc is used with \f[C]\-t\ markdown\f[] to create a markdown
+When pandoc is used with \f[C]\-t\ markdown\f[] to create a Markdown
document, a YAML metadata block will be produced only if the
\f[C]\-s/\-\-standalone\f[] option is used.
All of the metadata will appear in a single block at the beginning of
@@ -2847,7 +2936,7 @@ abstract:\ |
.PP
Template variables will be set automatically from the metadata.
Thus, for example, in writing HTML, the variable \f[C]abstract\f[] will
-be set to the HTML equivalent of the markdown in the \f[C]abstract\f[]
+be set to the HTML equivalent of the Markdown in the \f[C]abstract\f[]
field:
.IP
.nf
@@ -2904,7 +2993,7 @@ instead of
\f[]
.fi
.PP
-This rule is easier to remember than standard markdown\[aq]s rule, which
+This rule is easier to remember than standard Markdown\[aq]s rule, which
allows only the following characters to be backslash\-escaped:
.IP
.nf
@@ -2914,7 +3003,7 @@ allows only the following characters to be backslash\-escaped:
.fi
.PP
(However, if the \f[C]markdown_strict\f[] format is used, the standard
-markdown rule will be used.)
+Markdown rule will be used.)
.PP
A backslash\-escaped space is parsed as a nonbreaking space.
It will appear in TeX output as \f[C]~\f[] and in HTML and XML as
@@ -2925,7 +3014,7 @@ a backslash occurring at the end of a line) is parsed as a hard line
break.
It will appear in TeX output as \f[C]\\\\\f[] and in HTML as
\f[C]<br\ />\f[].
-This is a nice alternative to markdown\[aq]s "invisible" way of
+This is a nice alternative to Markdown\[aq]s "invisible" way of
indicating hard line breaks using two trailing spaces on a line.
.PP
Backslash escapes do not work in verbatim contexts.
@@ -3040,7 +3129,7 @@ The general rule is that a verbatim span starts with a string of
consecutive backticks (optionally followed by a space) and ends with a
string of the same number of backticks (optionally preceded by a space).
.PP
-Note that backslash\-escapes (and other markdown constructs) do not work
+Note that backslash\-escapes (and other Markdown constructs) do not work
in verbatim contexts:
.IP
.nf
@@ -3212,7 +3301,7 @@ The MathJax script will be used to render it as formulas.
Markdown allows you to insert raw HTML (or DocBook) anywhere in a
document (except verbatim contexts, where \f[C]<\f[], \f[C]>\f[], and
\f[C]&\f[] are interpreted literally).
-(Technically this is not an extension, since standard markdown allows
+(Technically this is not an extension, since standard Markdown allows
it, but it has been made an extension so that it can be disabled if
desired.)
.PP
@@ -3221,16 +3310,16 @@ DZSlides, EPUB, Markdown, and Textile output, and suppressed in other
formats.
.SS Extension: \f[C]markdown_in_html_blocks\f[]
.PP
-Standard markdown allows you to include HTML "blocks": blocks of HTML
+Standard Markdown allows you to include HTML "blocks": blocks of HTML
between balanced tags that are separated from the surrounding text with
blank lines, and start and end at the left margin.
-Within these blocks, everything is interpreted as HTML, not markdown; so
+Within these blocks, everything is interpreted as HTML, not Markdown; so
(for example), \f[C]*\f[] does not signify emphasis.
.PP
Pandoc behaves this way when the \f[C]markdown_strict\f[] format is
used; but by default, pandoc interprets material between HTML block tags
-as markdown.
-Thus, for example, Pandoc will turn
+as Markdown.
+Thus, for example, pandoc will turn
.IP
.nf
\f[C]
@@ -3259,13 +3348,13 @@ into
whereas \f[C]Markdown.pl\f[] will preserve it as is.
.PP
There is one exception to this rule: text between \f[C]<script>\f[] and
-\f[C]<style>\f[] tags is not interpreted as markdown.
+\f[C]<style>\f[] tags is not interpreted as Markdown.
.PP
-This departure from standard markdown should make it easier to mix
-markdown with HTML block elements.
-For example, one can surround a block of markdown text with
+This departure from standard Markdown should make it easier to mix
+Markdown with HTML block elements.
+For example, one can surround a block of Markdown text with
\f[C]<div>\f[] tags without preventing it from being interpreted as
-markdown.
+Markdown.
.SS Extension: \f[C]native_divs\f[]
.PP
Use native pandoc \f[C]Div\f[] blocks for content inside \f[C]<div>\f[]
@@ -3309,7 +3398,7 @@ Age\ &\ Frequency\ \\\\\ \\hline
.fi
.PP
the material between the begin and end tags will be interpreted as raw
-LaTeX, not as markdown.
+LaTeX, not as Markdown.
.PP
Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
and ConTeXt.
@@ -3432,7 +3521,7 @@ See\ [my\ website][].
\f[]
.fi
.PP
-Note: In \f[C]Markdown.pl\f[] and most other markdown implementations,
+Note: In \f[C]Markdown.pl\f[] and most other Markdown implementations,
reference link definitions cannot occur in nested constructions such as
list items or block quotes.
Pandoc lifts this arbitrary seeming restriction.
@@ -3522,7 +3611,7 @@ One way to do this is to insert a nonbreaking space after the image:
.SS Footnotes
.SS Extension: \f[C]footnotes\f[]
.PP
-Pandoc\[aq]s markdown allows footnotes, using the following syntax:
+Pandoc\[aq]s Markdown allows footnotes, using the following syntax:
.IP
.nf
\f[C]
@@ -3665,7 +3754,7 @@ Note that \f[C]pandoc\-citeproc\ \-\-bib2json\f[] and
\f[C]\&.yaml\f[] files from any of the supported formats.
.PP
In\-field markup: In BibTeX and BibLaTeX databases, pandoc\-citeproc
-parses a subset of LaTeX markup; in CSL YAML databases, pandoc markdown;
+parses a subset of LaTeX markup; in CSL YAML databases, pandoc Markdown;
and in CSL JSON databases, an HTML\-like markup:
.TP
.B \f[C]<i>...</i>\f[]
@@ -3851,10 +3940,10 @@ Bear in mind that bibliography files have to be in respective format
(either BibTeX or BibLaTeX).
.SS Non\-pandoc extensions
.PP
-The following markdown syntax extensions are not enabled by default in
+The following Markdown syntax extensions are not enabled by default in
pandoc, but may be enabled by adding \f[C]+EXTENSION\f[] to the format
name, where \f[C]EXTENSION\f[] is the name of the extension.
-Thus, for example, \f[C]markdown+hard_line_breaks\f[] is markdown with
+Thus, for example, \f[C]markdown+hard_line_breaks\f[] is Markdown with
hard line breaks.
.SS Extension: \f[C]lists_without_preceding_blankline\f[]
.PP
@@ -3871,6 +3960,9 @@ treated as spaces or as hard line breaks.
This option is intended for use with East Asian languages where spaces
are not used between words, but text is divided into lines for
readability.
+.SS Extension: \f[C]emoji\f[]
+.PP
+Parses textual emojis like \f[C]:smile:\f[] as Unicode emoticons.
.SS Extension: \f[C]tex_math_single_backslash\f[]
.PP
Causes anything between \f[C]\\(\f[] and \f[C]\\)\f[] to be interpreted
@@ -3886,8 +3978,8 @@ interpreted as inline TeX math, and anything between \f[C]\\\\[\f[] and
.SS Extension: \f[C]markdown_attribute\f[]
.PP
By default, pandoc interprets material inside block\-level tags as
-markdown.
-This extension changes the behavior so that markdown is only parsed
+Markdown.
+This extension changes the behavior so that Markdown is only parsed
inside block\-level tags if the tags have the attribute
\f[C]markdown=1\f[].
.SS Extension: \f[C]mmd_title_block\f[]
@@ -3958,7 +4050,7 @@ Lazy wrapping of paragraphs is not allowed: the entire definition must
be indented four spaces.
.SS Markdown variants
.PP
-In addition to pandoc\[aq]s extended markdown, the following markdown
+In addition to pandoc\[aq]s extended Markdown, the following Markdown
variants are supported:
.TP
.B \f[C]markdown_phpextra\f[] (PHP Markdown Extra)
@@ -3976,7 +4068,8 @@ variants are supported:
\f[C]auto_identifiers\f[], \f[C]ascii_identifiers\f[],
\f[C]backtick_code_blocks\f[], \f[C]autolink_bare_uris\f[],
\f[C]intraword_underscores\f[], \f[C]strikeout\f[],
-\f[C]hard_line_breaks\f[], \f[C]shortcut_reference_links\f[].
+\f[C]hard_line_breaks\f[], \f[C]emoji\f[],
+\f[C]shortcut_reference_links\f[].
.RS
.RE
.TP
@@ -3995,10 +4088,10 @@ variants are supported:
\f[C]raw_html\f[]
.RS
.RE
-.SS Extensions with formats other than markdown
+.SS Extensions with formats other than Markdown
.PP
Some of the extensions discussed above can be used with formats other
-than markdown:
+than Markdown:
.IP \[bu] 2
\f[C]auto_identifiers\f[] can be used with \f[C]latex\f[], \f[C]rst\f[],
\f[C]mediawiki\f[], and \f[C]textile\f[] input (and is used by default).
@@ -4009,13 +4102,13 @@ than markdown:
example.)
.SH PRODUCING SLIDE SHOWS WITH PANDOC
.PP
-You can use Pandoc to produce an HTML + javascript slide presentation
+You can use pandoc to produce an HTML + javascript slide presentation
that can be viewed via a web browser.
There are five ways to do this, using S5, DZSlides, Slidy, Slideous, or
reveal.js.
You can also produce a PDF slide show using LaTeX \f[C]beamer\f[].
.PP
-Here\[aq]s the markdown source for a simple slide show,
+Here\[aq]s the Markdown source for a simple slide show,
\f[C]habits.txt\f[]:
.IP
.nf
@@ -4219,14 +4312,14 @@ This is recommended especially for bibliographies:
.SS Speaker notes
.PP
reveal.js has good support for speaker notes.
-You can add notes to your markdown document thus:
+You can add notes to your Markdown document thus:
.IP
.nf
\f[C]
<div\ class="notes">
This\ is\ my\ note.
-\-\ It\ can\ contain\ markdown
+\-\ It\ can\ contain\ Markdown
\-\ like\ this\ list
</div>
@@ -4255,10 +4348,11 @@ All of the other frame attributes described in Section 8.1 of the Beamer
User\[aq]s Guide may also be used: \f[C]allowdisplaybreaks\f[],
\f[C]allowframebreaks\f[], \f[C]b\f[], \f[C]c\f[], \f[C]t\f[],
\f[C]environment\f[], \f[C]label\f[], \f[C]plain\f[], \f[C]shrink\f[].
-.SH EPUB METADATA
+.SH CREATING EPUBS WITH PANDOC
+.SS EPUB Metadata
.PP
EPUB metadata may be specified using the \f[C]\-\-epub\-metadata\f[]
-option, but if the source document is markdown, it is better to use a
+option, but if the source document is Markdown, it is better to use a
YAML metadata block.
Here is an example:
.IP
@@ -4384,6 +4478,25 @@ Specifies the \f[C]page\-progression\-direction\f[] attribute for the
\f[C]spine\f[] element.
.RS
.RE
+.SS Linked media
+.PP
+By default, pandoc will download linked media (including audio and
+video) and include it in the EPUB container, yielding a completely
+self\-contained EPUB.
+If you want to link to external media resources instead, use raw HTML in
+your source and add \f[C]data\-external="1"\f[] to the tag with the
+\f[C]src\f[] attribute.
+For example:
+.IP
+.nf
+\f[C]
+<audio\ controls="1">
+\ \ <source\ src="http://example.com/music/toccata.mp3"
+\ \ \ \ \ \ \ \ \ \ data\-external="1"\ type="audio/mpeg">
+\ \ </source>
+</audio>
+\f[]
+.fi
.SH LITERATE HASKELL SUPPORT
.PP
If you append \f[C]+lhs\f[] (or \f[C]+literate_haskell\f[]) to an
@@ -4393,14 +4506,14 @@ output; \f[C]beamer\f[], \f[C]html\f[] or \f[C]html5\f[] for output
only), pandoc will treat the document as literate Haskell source.
This means that
.IP \[bu] 2
-In markdown input, "bird track" sections will be parsed as Haskell code
+In Markdown input, "bird track" sections will be parsed as Haskell code
rather than block quotations.
Text between \f[C]\\begin{code}\f[] and \f[C]\\end{code}\f[] will also
be treated as Haskell code.
For ATX\-style headers the character \[aq]=\[aq] will be used instead of
\[aq]#\[aq].
.IP \[bu] 2
-In markdown output, code blocks with classes \f[C]haskell\f[] and
+In Markdown output, code blocks with classes \f[C]haskell\f[] and
\f[C]literate\f[] will be rendered using bird tracks, and block
quotations will be indented one space, so they will not be treated as
Haskell code.
@@ -4432,7 +4545,7 @@ pandoc\ \-f\ markdown+lhs\ \-t\ html
\f[]
.fi
.PP
-reads literate Haskell source formatted with markdown conventions and
+reads literate Haskell source formatted with Markdown conventions and
writes ordinary HTML (without bird tracks).
.IP
.nf
@@ -4494,9 +4607,10 @@ This software carries no warranty of any kind.
.PP
Contributors include Aaron Wolen, Albert Krewinkel, Alexander
Kondratskiy, Alexander Sulfrian, Alexander V Vershilov, Alfred
-Wechselberger, Andreas Lööw, Andrew Dunning, Antoine Latter, Arlo
-O\[aq]Keeffe, Artyom Kazak, Ben Gamari, Beni Cherniavsky\-Paskin, Bjorn
-Buckwalter, Bradley Kuhn, Brent Yorgey, Bryan O\[aq]Sullivan, B.
+Wechselberger, Andreas Lööw, Andrew Dunning, Antoine Latter, Arata
+Mizuki, Arlo O\[aq]Keeffe, Artyom Kazak, Ben Gamari, Beni
+Cherniavsky\-Paskin, Bjorn Buckwalter, Bradley Kuhn, Brent Yorgey, Bryan
+O\[aq]Sullivan, B.
Scott Michel, Caleb McDaniel, Calvin Beck, Christoffer Ackelman,
Christoffer Sawicki, Clare Macrae, Clint Adams, Conal Elliott, Craig S.
Bosma, Daniel Bergey, Daniel T.
diff --git a/osx/stack.yaml b/osx/stack.yaml
index 674ebed2c..71af73661 100644
--- a/osx/stack.yaml
+++ b/osx/stack.yaml
@@ -16,5 +16,5 @@ ghc-options:
highlighting-kate: '-pgmP cpphs -optP--cpp'
packages:
- '..'
-- 'https://hackage.haskell.org/package/pandoc-citeproc-0.8.0.1/pandoc-citeproc-0.8.0.1.tar.gz'
-resolver: lts-3.10
+- 'https://hackage.haskell.org/package/pandoc-citeproc-0.8.1.3/pandoc-citeproc-0.8.1.3.tar.gz'
+resolver: lts-3.13
diff --git a/pandoc.cabal b/pandoc.cabal
index fcdadb324..fd9a43179 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -1,5 +1,5 @@
Name: pandoc
-Version: 1.15.1.1
+Version: 1.15.2.1
Cabal-Version: >= 1.10
Build-Type: Custom
License: GPL
@@ -11,7 +11,7 @@ Bug-Reports: https://github.com/jgm/pandoc/issues
Stability: alpha
Homepage: http://pandoc.org
Category: Text
-Tested-With: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2
+Tested-With: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2
Synopsis: Conversion between markup formats
Description: Pandoc is a Haskell library for converting from one markup
format to another, and a command-line tool that uses
@@ -113,6 +113,8 @@ Extra-Source-Files:
-- documentation
INSTALL, BUGS, CONTRIBUTING.md, changelog
man/pandoc.1
+ -- stack build plan
+ stack.yaml
-- files needed to build man page
man/capitalizeHeaders.hs
man/removeNotes.hs
@@ -187,6 +189,8 @@ Extra-Source-Files:
tests/writer.fb2
tests/writer.opml
tests/writer.dokuwiki
+ tests/writers-lang-and-dir.latex
+ tests/writers-lang-and-dir.context
tests/dokuwiki_inline_formatting.dokuwiki
tests/lhs-test.markdown
tests/lhs-test.markdown+lhs
@@ -250,7 +254,7 @@ Library
parsec >= 3.1 && < 3.2,
mtl >= 1.1 && < 2.3,
filepath >= 1.1 && < 1.5,
- process >= 1 && < 1.3,
+ process >= 1 && < 1.4,
directory >= 1 && < 1.3,
bytestring >= 0.9 && < 0.11,
text >= 0.11 && < 1.3,
@@ -306,12 +310,14 @@ Library
Ghc-Options: -rtsopts -Wall -fno-warn-unused-do-bind
Ghc-Prof-Options: -fprof-auto-exported -rtsopts
Default-Language: Haskell98
- Default-Extensions: NoImplicitPrelude
Other-Extensions: PatternGuards, OverloadedStrings,
ScopedTypeVariables, GeneralizedNewtypeDeriving,
RelaxedPolyRec, DeriveDataTypeable, TypeSynonymInstances,
FlexibleInstances
- Hs-Source-Dirs: src, prelude
+ Hs-Source-Dirs: src
+ if impl(ghc < 7.10)
+ Hs-Source-Dirs: prelude
+ Other-Modules: Prelude
Exposed-Modules: Text.Pandoc,
Text.Pandoc.Options,
@@ -389,6 +395,7 @@ Library
Text.Pandoc.Writers.Shared,
Text.Pandoc.Asciify,
Text.Pandoc.MIME,
+ Text.Pandoc.Emoji,
Text.Pandoc.Parsing,
Text.Pandoc.UUID,
Text.Pandoc.ImageSize,
@@ -397,9 +404,9 @@ Library
Text.Pandoc.Compat.Time,
Text.Pandoc.Compat.Except,
Text.Pandoc.Compat.TagSoupEntity,
- Text.Pandoc.Compat.Directory
+ Text.Pandoc.Compat.Directory,
+ Text.Pandoc.Compat.Monoid,
Paths_pandoc
- Prelude
Buildable: True
@@ -426,20 +433,24 @@ Executable pandoc
if os(windows)
Cpp-options: -D_WINDOWS
Default-Language: Haskell98
- Default-Extensions: NoImplicitPrelude
Other-Extensions: PatternGuards, OverloadedStrings,
ScopedTypeVariables, GeneralizedNewtypeDeriving,
RelaxedPolyRec, DeriveDataTypeable, TypeSynonymInstances,
FlexibleInstances
- Hs-Source-Dirs: ., prelude
+ Hs-Source-Dirs: .
+ if impl(ghc < 7.10)
+ Hs-Source-Dirs: prelude
+ Other-Modules: Prelude
Main-Is: pandoc.hs
Buildable: True
- Other-Modules: Prelude
- Paths_pandoc
+ Other-Modules: Paths_pandoc
Executable trypandoc
Main-Is: trypandoc.hs
- Hs-Source-Dirs: trypandoc, prelude
+ Hs-Source-Dirs: trypandoc
+ if impl(ghc < 7.10)
+ Hs-Source-Dirs: prelude
+ Other-Modules: Prelude
default-language: Haskell2010
if flag(trypandoc)
Build-Depends: base, aeson, pandoc, highlighting-kate,
@@ -447,12 +458,14 @@ Executable trypandoc
Buildable: True
else
Buildable: False
- Other-Modules: Prelude
Test-Suite test-pandoc
Type: exitcode-stdio-1.0
Main-Is: test-pandoc.hs
- Hs-Source-Dirs: tests, prelude
+ Hs-Source-Dirs: tests
+ if impl(ghc < 7.10)
+ Hs-Source-Dirs: prelude
+ Other-Modules: Prelude
Build-Depends: base >= 4.2 && < 5,
syb >= 0.1 && < 0.7,
pandoc,
@@ -461,7 +474,7 @@ Test-Suite test-pandoc
text >= 0.11 && < 1.3,
directory >= 1 && < 1.3,
filepath >= 1.1 && < 1.5,
- process >= 1 && < 1.3,
+ process >= 1 && < 1.4,
highlighting-kate >= 0.6 && < 0.7,
Diff >= 0.2 && < 0.4,
test-framework >= 0.3 && < 0.9,
@@ -497,20 +510,19 @@ Test-Suite test-pandoc
Tests.Writers.LaTeX
Tests.Writers.Docx
Tests.Writers.RST
- Prelude
Ghc-Options: -rtsopts -Wall -fno-warn-unused-do-bind -threaded
Default-Language: Haskell98
- Default-Extensions: NoImplicitPrelude
benchmark benchmark-pandoc
Type: exitcode-stdio-1.0
Main-Is: benchmark-pandoc.hs
- Hs-Source-Dirs: benchmark, prelude
+ Hs-Source-Dirs: benchmark
+ if impl(ghc < 7.10)
+ Hs-Source-Dirs: prelude
+ Other-Modules: Prelude
Build-Depends: pandoc,
base >= 4.2 && < 5,
syb >= 0.1 && < 0.7,
criterion >= 1.0 && < 1.2
Ghc-Options: -rtsopts -Wall -fno-warn-unused-do-bind
Default-Language: Haskell98
- Default-Extensions: NoImplicitPrelude
- Other-Modules: Prelude
diff --git a/pandoc.hs b/pandoc.hs
index a83426bff..2353ebb11 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -30,7 +30,6 @@ Parses command-line options and calls the appropriate readers and
writers.
-}
module Main where
-import Prelude
import Text.Pandoc
import Text.Pandoc.Builder (setMeta)
import Text.Pandoc.PDF (makePDF)
@@ -1011,6 +1010,7 @@ defaultWriterName x =
".epub" -> "epub"
".org" -> "org"
".asciidoc" -> "asciidoc"
+ ".adoc" -> "asciidoc"
".pdf" -> "latex"
".fb2" -> "fb2"
".opml" -> "opml"
@@ -1140,7 +1140,7 @@ main = do
-- --bibliography implies -F pandoc-citeproc for backwards compatibility:
- let needsCiteproc = any ("--bibliography" `isPrefixOf`) rawArgs &&
+ let needsCiteproc = M.lookup "bibliography" (optMetadata opts) /= Nothing &&
optCiteMethod opts `notElem` [Natbib, Biblatex] &&
"pandoc-citeproc" `notElem` map takeBaseName filters
let filters' = if needsCiteproc then "pandoc-citeproc" : filters
@@ -1176,6 +1176,9 @@ main = do
"beamer" `isPrefixOf` writerName'
let conTeXtOutput = "context" `isPrefixOf` writerName'
+ let laTeXInput = "latex" `isPrefixOf` readerName' ||
+ "beamer" `isPrefixOf` readerName'
+
writer <- if ".lua" `isSuffixOf` writerName'
-- note: use non-lowercased version writerName
then return $ IOStringWriter $ writeCustom writerName
@@ -1257,8 +1260,10 @@ main = do
uriFragment = "" }
_ -> Nothing
- let readerOpts = def{ readerSmart = smart || (texLigatures &&
- (laTeXOutput || conTeXtOutput))
+ let readerOpts = def{ readerSmart = if laTeXInput
+ then texLigatures
+ else smart || (texLigatures &&
+ (laTeXOutput || conTeXtOutput))
, readerStandalone = standalone'
, readerParseRaw = parseRaw
, readerColumns = columns
diff --git a/prelude/Prelude.hs b/prelude/Prelude.hs
index ca5c687ea..50e86a7b9 100644
--- a/prelude/Prelude.hs
+++ b/prelude/Prelude.hs
@@ -1,23 +1,24 @@
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE CPP #-}
+-- This custom Prelude emulates the API of the prelude
+-- with base 4.8.
+
module Prelude
(
module P
-, Monoid(..)
-, Applicative(..)
#if MIN_VERSION_base(4,8,0)
#else
+, Monoid(..)
+, Applicative(..)
, (<$>)
, (<$)
#endif
-, (<>)
)
where
#if MIN_VERSION_base(4,8,0)
import "base" Prelude as P
-import Data.Monoid ((<>))
#elif MIN_VERSION_base(4,6,0)
import "base" Prelude as P
import Control.Applicative
@@ -27,13 +28,3 @@ import "base" Prelude as P hiding (catch)
import Control.Applicative
import Data.Monoid
#endif
-
-#if MIN_VERSION_base(4,5,0)
-#else
-infixr 6 <>
-
--- | An infix synonym for 'mappend'.
-(<>) :: Monoid m => m -> m -> m
-(<>) = mappend
-{-# INLINE (<>) #-}
-#endif
diff --git a/src/Text/Pandoc.hs b/src/Text/Pandoc.hs
index f3301d140..e49fef3b5 100644
--- a/src/Text/Pandoc.hs
+++ b/src/Text/Pandoc.hs
@@ -150,7 +150,6 @@ import Text.Pandoc.Writers.RST
import Text.Pandoc.Writers.LaTeX
import Text.Pandoc.Writers.ConTeXt
import Text.Pandoc.Writers.Texinfo
-import Prelude
import Text.Pandoc.Writers.HTML
import Text.Pandoc.Writers.ODT
import Text.Pandoc.Writers.Docx
diff --git a/src/Text/Pandoc/Asciify.hs b/src/Text/Pandoc/Asciify.hs
index a11809a00..c183458e4 100644
--- a/src/Text/Pandoc/Asciify.hs
+++ b/src/Text/Pandoc/Asciify.hs
@@ -30,7 +30,6 @@ ascii equivalents (used in constructing HTML identifiers).
-}
module Text.Pandoc.Asciify (toAsciiChar)
where
-import Prelude
import qualified Data.Map as M
import Data.Char (isAscii)
diff --git a/src/Text/Pandoc/CSS.hs b/src/Text/Pandoc/CSS.hs
index ad0d0636a..9d0c84243 100644
--- a/src/Text/Pandoc/CSS.hs
+++ b/src/Text/Pandoc/CSS.hs
@@ -3,7 +3,6 @@ module Text.Pandoc.CSS ( foldOrElse,
)
where
-import Prelude
import Text.Pandoc.Shared (trim)
import Text.Parsec
import Text.Parsec.String
diff --git a/src/Text/Pandoc/Compat/Directory.hs b/src/Text/Pandoc/Compat/Directory.hs
index c8f3cc047..61dd5c525 100644
--- a/src/Text/Pandoc/Compat/Directory.hs
+++ b/src/Text/Pandoc/Compat/Directory.hs
@@ -5,6 +5,7 @@ module Text.Pandoc.Compat.Directory ( getModificationTime )
#if MIN_VERSION_directory(1,2,0)
import System.Directory
+
#else
import qualified System.Directory as S
import Data.Time.Clock (UTCTime)
diff --git a/src/Text/Pandoc/Compat/Except.hs b/src/Text/Pandoc/Compat/Except.hs
index 5c1214f47..9ce7c0d36 100644
--- a/src/Text/Pandoc/Compat/Except.hs
+++ b/src/Text/Pandoc/Compat/Except.hs
@@ -9,7 +9,6 @@ module Text.Pandoc.Compat.Except ( ExceptT
, catchError )
where
-import Prelude
#if MIN_VERSION_mtl(2,2,1)
import Control.Monad.Except
diff --git a/src/Text/Pandoc/Compat/Monoid.hs b/src/Text/Pandoc/Compat/Monoid.hs
new file mode 100644
index 000000000..4daceb8e1
--- /dev/null
+++ b/src/Text/Pandoc/Compat/Monoid.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE CPP #-}
+module Text.Pandoc.Compat.Monoid ( (<>) )
+ where
+
+#if MIN_VERSION_base(4,5,0)
+import Data.Monoid ((<>))
+
+#else
+import Data.Monoid
+
+infixr 6 <>
+
+--- | An infix synonym for 'mappend'.
+(<>) :: Monoid m => m -> m -> m
+(<>) = mappend
+{-# INLINE (<>) #-}
+#endif
diff --git a/src/Text/Pandoc/Compat/TagSoupEntity.hs b/src/Text/Pandoc/Compat/TagSoupEntity.hs
index 30889e915..80985aef9 100644
--- a/src/Text/Pandoc/Compat/TagSoupEntity.hs
+++ b/src/Text/Pandoc/Compat/TagSoupEntity.hs
@@ -2,7 +2,6 @@
module Text.Pandoc.Compat.TagSoupEntity (lookupEntity
) where
-import Prelude
import qualified Text.HTML.TagSoup.Entity as TE
lookupEntity :: String -> Maybe Char
diff --git a/src/Text/Pandoc/Emoji.hs b/src/Text/Pandoc/Emoji.hs
new file mode 100644
index 000000000..c98b06fa1
--- /dev/null
+++ b/src/Text/Pandoc/Emoji.hs
@@ -0,0 +1,905 @@
+{-
+Copyright (C) 2015 John MacFarlane <jgm@berkeley.edu>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-}
+
+{- |
+ Module : Text.Pandoc.Emoji
+ Copyright : Copyright (C) 2015 John MacFarlane
+ License : GNU GPL, version 2 or above
+
+ Maintainer : John MacFarlane <jgm@berkeley.edu>
+ Stability : alpha
+ Portability : portable
+
+Emoji symbol lookup from canonical string identifier.
+-}
+module Text.Pandoc.Emoji ( emojis ) where
+import qualified Data.Map as M
+
+emojis :: M.Map String String
+emojis = M.fromList
+ [ ("100", "\x1f4af")
+ , ("1234", "\x1f522")
+ , ("smile", "\x1f604")
+ , ("smiley", "\x1f603")
+ , ("grinning", "\x1f600")
+ , ("blush", "\x1f60a")
+ , ("relaxed", "\x263a\fe0f")
+ , ("wink", "\x1f609")
+ , ("heart_eyes", "\x1f60d")
+ , ("kissing_heart", "\x1f618")
+ , ("kissing_closed_eyes", "\x1f61a")
+ , ("kissing", "\x1f617")
+ , ("kissing_smiling_eyes", "\x1f619")
+ , ("stuck_out_tongue_winking_eye", "\x1f61c")
+ , ("stuck_out_tongue_closed_eyes", "\x1f61d")
+ , ("stuck_out_tongue", "\x1f61b")
+ , ("flushed", "\x1f633")
+ , ("grin", "\x1f601")
+ , ("pensive", "\x1f614")
+ , ("relieved", "\x1f60c")
+ , ("unamused", "\x1f612")
+ , ("disappointed", "\x1f61e")
+ , ("persevere", "\x1f623")
+ , ("cry", "\x1f622")
+ , ("joy", "\x1f602")
+ , ("sob", "\x1f62d")
+ , ("sleepy", "\x1f62a")
+ , ("disappointed_relieved", "\x1f625")
+ , ("cold_sweat", "\x1f630")
+ , ("sweat_smile", "\x1f605")
+ , ("sweat", "\x1f613")
+ , ("weary", "\x1f629")
+ , ("tired_face", "\x1f62b")
+ , ("fearful", "\x1f628")
+ , ("scream", "\x1f631")
+ , ("angry", "\x1f620")
+ , ("rage", "\x1f621")
+ , ("triumph", "\x1f624")
+ , ("confounded", "\x1f616")
+ , ("laughing", "\x1f606")
+ , ("satisfied", "\x1f606")
+ , ("yum", "\x1f60b")
+ , ("mask", "\x1f637")
+ , ("sunglasses", "\x1f60e")
+ , ("sleeping", "\x1f634")
+ , ("dizzy_face", "\x1f635")
+ , ("astonished", "\x1f632")
+ , ("worried", "\x1f61f")
+ , ("frowning", "\x1f626")
+ , ("anguished", "\x1f627")
+ , ("smiling_imp", "\x1f608")
+ , ("imp", "\x1f47f")
+ , ("open_mouth", "\x1f62e")
+ , ("grimacing", "\x1f62c")
+ , ("neutral_face", "\x1f610")
+ , ("confused", "\x1f615")
+ , ("hushed", "\x1f62f")
+ , ("no_mouth", "\x1f636")
+ , ("innocent", "\x1f607")
+ , ("smirk", "\x1f60f")
+ , ("expressionless", "\x1f611")
+ , ("man_with_gua_pi_mao", "\x1f472")
+ , ("man_with_turban", "\x1f473")
+ , ("cop", "\x1f46e")
+ , ("construction_worker", "\x1f477")
+ , ("guardsman", "\x1f482")
+ , ("baby", "\x1f476")
+ , ("boy", "\x1f466")
+ , ("girl", "\x1f467")
+ , ("man", "\x1f468")
+ , ("woman", "\x1f469")
+ , ("older_man", "\x1f474")
+ , ("older_woman", "\x1f475")
+ , ("person_with_blond_hair", "\x1f471")
+ , ("angel", "\x1f47c")
+ , ("princess", "\x1f478")
+ , ("smiley_cat", "\x1f63a")
+ , ("smile_cat", "\x1f638")
+ , ("heart_eyes_cat", "\x1f63b")
+ , ("kissing_cat", "\x1f63d")
+ , ("smirk_cat", "\x1f63c")
+ , ("scream_cat", "\x1f640")
+ , ("crying_cat_face", "\x1f63f")
+ , ("joy_cat", "\x1f639")
+ , ("pouting_cat", "\x1f63e")
+ , ("japanese_ogre", "\x1f479")
+ , ("japanese_goblin", "\x1f47a")
+ , ("see_no_evil", "\x1f648")
+ , ("hear_no_evil", "\x1f649")
+ , ("speak_no_evil", "\x1f64a")
+ , ("skull", "\x1f480")
+ , ("alien", "\x1f47d")
+ , ("hankey", "\x1f4a9")
+ , ("poop", "\x1f4a9")
+ , ("shit", "\x1f4a9")
+ , ("fire", "\x1f525")
+ , ("sparkles", "\x2728")
+ , ("star2", "\x1f31f")
+ , ("dizzy", "\x1f4ab")
+ , ("boom", "\x1f4a5")
+ , ("collision", "\x1f4a5")
+ , ("anger", "\x1f4a2")
+ , ("sweat_drops", "\x1f4a6")
+ , ("droplet", "\x1f4a7")
+ , ("zzz", "\x1f4a4")
+ , ("dash", "\x1f4a8")
+ , ("ear", "\x1f442")
+ , ("eyes", "\x1f440")
+ , ("nose", "\x1f443")
+ , ("tongue", "\x1f445")
+ , ("lips", "\x1f444")
+ , ("+1", "\x1f44d")
+ , ("thumbsup", "\x1f44d")
+ , ("-1", "\x1f44e")
+ , ("thumbsdown", "\x1f44e")
+ , ("ok_hand", "\x1f44c")
+ , ("facepunch", "\x1f44a")
+ , ("punch", "\x1f44a")
+ , ("fist", "\x270a")
+ , ("v", "\x270c\fe0f")
+ , ("wave", "\x1f44b")
+ , ("hand", "\x270b")
+ , ("raised_hand", "\x270b")
+ , ("open_hands", "\x1f450")
+ , ("point_up_2", "\x1f446")
+ , ("point_down", "\x1f447")
+ , ("point_right", "\x1f449")
+ , ("point_left", "\x1f448")
+ , ("raised_hands", "\x1f64c")
+ , ("pray", "\x1f64f")
+ , ("point_up", "\x261d\fe0f")
+ , ("clap", "\x1f44f")
+ , ("muscle", "\x1f4aa")
+ , ("walking", "\x1f6b6")
+ , ("runner", "\x1f3c3")
+ , ("running", "\x1f3c3")
+ , ("dancer", "\x1f483")
+ , ("couple", "\x1f46b")
+ , ("family", "\x1f46a")
+ , ("two_men_holding_hands", "\x1f46c")
+ , ("two_women_holding_hands", "\x1f46d")
+ , ("couplekiss", "\x1f48f")
+ , ("couple_with_heart", "\x1f491")
+ , ("dancers", "\x1f46f")
+ , ("ok_woman", "\x1f646")
+ , ("no_good", "\x1f645")
+ , ("information_desk_person", "\x1f481")
+ , ("raising_hand", "\x1f64b")
+ , ("massage", "\x1f486")
+ , ("haircut", "\x1f487")
+ , ("nail_care", "\x1f485")
+ , ("bride_with_veil", "\x1f470")
+ , ("person_with_pouting_face", "\x1f64e")
+ , ("person_frowning", "\x1f64d")
+ , ("bow", "\x1f647")
+ , ("tophat", "\x1f3a9")
+ , ("crown", "\x1f451")
+ , ("womans_hat", "\x1f452")
+ , ("athletic_shoe", "\x1f45f")
+ , ("mans_shoe", "\x1f45e")
+ , ("shoe", "\x1f45e")
+ , ("sandal", "\x1f461")
+ , ("high_heel", "\x1f460")
+ , ("boot", "\x1f462")
+ , ("shirt", "\x1f455")
+ , ("tshirt", "\x1f455")
+ , ("necktie", "\x1f454")
+ , ("womans_clothes", "\x1f45a")
+ , ("dress", "\x1f457")
+ , ("running_shirt_with_sash", "\x1f3bd")
+ , ("jeans", "\x1f456")
+ , ("kimono", "\x1f458")
+ , ("bikini", "\x1f459")
+ , ("briefcase", "\x1f4bc")
+ , ("handbag", "\x1f45c")
+ , ("pouch", "\x1f45d")
+ , ("purse", "\x1f45b")
+ , ("eyeglasses", "\x1f453")
+ , ("ribbon", "\x1f380")
+ , ("closed_umbrella", "\x1f302")
+ , ("lipstick", "\x1f484")
+ , ("yellow_heart", "\x1f49b")
+ , ("blue_heart", "\x1f499")
+ , ("purple_heart", "\x1f49c")
+ , ("green_heart", "\x1f49a")
+ , ("heart", "\x2764\fe0f")
+ , ("broken_heart", "\x1f494")
+ , ("heartpulse", "\x1f497")
+ , ("heartbeat", "\x1f493")
+ , ("two_hearts", "\x1f495")
+ , ("sparkling_heart", "\x1f496")
+ , ("revolving_hearts", "\x1f49e")
+ , ("cupid", "\x1f498")
+ , ("love_letter", "\x1f48c")
+ , ("kiss", "\x1f48b")
+ , ("ring", "\x1f48d")
+ , ("gem", "\x1f48e")
+ , ("bust_in_silhouette", "\x1f464")
+ , ("busts_in_silhouette", "\x1f465")
+ , ("speech_balloon", "\x1f4ac")
+ , ("footprints", "\x1f463")
+ , ("thought_balloon", "\x1f4ad")
+ , ("dog", "\x1f436")
+ , ("wolf", "\x1f43a")
+ , ("cat", "\x1f431")
+ , ("mouse", "\x1f42d")
+ , ("hamster", "\x1f439")
+ , ("rabbit", "\x1f430")
+ , ("frog", "\x1f438")
+ , ("tiger", "\x1f42f")
+ , ("koala", "\x1f428")
+ , ("bear", "\x1f43b")
+ , ("pig", "\x1f437")
+ , ("pig_nose", "\x1f43d")
+ , ("cow", "\x1f42e")
+ , ("boar", "\x1f417")
+ , ("monkey_face", "\x1f435")
+ , ("monkey", "\x1f412")
+ , ("horse", "\x1f434")
+ , ("sheep", "\x1f411")
+ , ("elephant", "\x1f418")
+ , ("panda_face", "\x1f43c")
+ , ("penguin", "\x1f427")
+ , ("bird", "\x1f426")
+ , ("baby_chick", "\x1f424")
+ , ("hatched_chick", "\x1f425")
+ , ("hatching_chick", "\x1f423")
+ , ("chicken", "\x1f414")
+ , ("snake", "\x1f40d")
+ , ("turtle", "\x1f422")
+ , ("bug", "\x1f41b")
+ , ("bee", "\x1f41d")
+ , ("honeybee", "\x1f41d")
+ , ("ant", "\x1f41c")
+ , ("beetle", "\x1f41e")
+ , ("snail", "\x1f40c")
+ , ("octopus", "\x1f419")
+ , ("shell", "\x1f41a")
+ , ("tropical_fish", "\x1f420")
+ , ("fish", "\x1f41f")
+ , ("dolphin", "\x1f42c")
+ , ("flipper", "\x1f42c")
+ , ("whale", "\x1f433")
+ , ("whale2", "\x1f40b")
+ , ("cow2", "\x1f404")
+ , ("ram", "\x1f40f")
+ , ("rat", "\x1f400")
+ , ("water_buffalo", "\x1f403")
+ , ("tiger2", "\x1f405")
+ , ("rabbit2", "\x1f407")
+ , ("dragon", "\x1f409")
+ , ("racehorse", "\x1f40e")
+ , ("goat", "\x1f410")
+ , ("rooster", "\x1f413")
+ , ("dog2", "\x1f415")
+ , ("pig2", "\x1f416")
+ , ("mouse2", "\x1f401")
+ , ("ox", "\x1f402")
+ , ("dragon_face", "\x1f432")
+ , ("blowfish", "\x1f421")
+ , ("crocodile", "\x1f40a")
+ , ("camel", "\x1f42b")
+ , ("dromedary_camel", "\x1f42a")
+ , ("leopard", "\x1f406")
+ , ("cat2", "\x1f408")
+ , ("poodle", "\x1f429")
+ , ("feet", "\x1f43e")
+ , ("paw_prints", "\x1f43e")
+ , ("bouquet", "\x1f490")
+ , ("cherry_blossom", "\x1f338")
+ , ("tulip", "\x1f337")
+ , ("four_leaf_clover", "\x1f340")
+ , ("rose", "\x1f339")
+ , ("sunflower", "\x1f33b")
+ , ("hibiscus", "\x1f33a")
+ , ("maple_leaf", "\x1f341")
+ , ("leaves", "\x1f343")
+ , ("fallen_leaf", "\x1f342")
+ , ("herb", "\x1f33f")
+ , ("ear_of_rice", "\x1f33e")
+ , ("mushroom", "\x1f344")
+ , ("cactus", "\x1f335")
+ , ("palm_tree", "\x1f334")
+ , ("evergreen_tree", "\x1f332")
+ , ("deciduous_tree", "\x1f333")
+ , ("chestnut", "\x1f330")
+ , ("seedling", "\x1f331")
+ , ("blossom", "\x1f33c")
+ , ("globe_with_meridians", "\x1f310")
+ , ("sun_with_face", "\x1f31e")
+ , ("full_moon_with_face", "\x1f31d")
+ , ("new_moon_with_face", "\x1f31a")
+ , ("new_moon", "\x1f311")
+ , ("waxing_crescent_moon", "\x1f312")
+ , ("first_quarter_moon", "\x1f313")
+ , ("moon", "\x1f314")
+ , ("waxing_gibbous_moon", "\x1f314")
+ , ("full_moon", "\x1f315")
+ , ("waning_gibbous_moon", "\x1f316")
+ , ("last_quarter_moon", "\x1f317")
+ , ("waning_crescent_moon", "\x1f318")
+ , ("last_quarter_moon_with_face", "\x1f31c")
+ , ("first_quarter_moon_with_face", "\x1f31b")
+ , ("crescent_moon", "\x1f319")
+ , ("earth_africa", "\x1f30d")
+ , ("earth_americas", "\x1f30e")
+ , ("earth_asia", "\x1f30f")
+ , ("volcano", "\x1f30b")
+ , ("milky_way", "\x1f30c")
+ , ("stars", "\x1f320")
+ , ("star", "\x2b50")
+ , ("sunny", "\x2600\fe0f")
+ , ("partly_sunny", "\x26c5")
+ , ("cloud", "\x2601\fe0f")
+ , ("zap", "\x26a1")
+ , ("umbrella", "\x2614")
+ , ("snowflake", "\x2744\fe0f")
+ , ("snowman", "\x26c4")
+ , ("cyclone", "\x1f300")
+ , ("foggy", "\x1f301")
+ , ("rainbow", "\x1f308")
+ , ("ocean", "\x1f30a")
+ , ("bamboo", "\x1f38d")
+ , ("gift_heart", "\x1f49d")
+ , ("dolls", "\x1f38e")
+ , ("school_satchel", "\x1f392")
+ , ("mortar_board", "\x1f393")
+ , ("flags", "\x1f38f")
+ , ("fireworks", "\x1f386")
+ , ("sparkler", "\x1f387")
+ , ("wind_chime", "\x1f390")
+ , ("rice_scene", "\x1f391")
+ , ("jack_o_lantern", "\x1f383")
+ , ("ghost", "\x1f47b")
+ , ("santa", "\x1f385")
+ , ("christmas_tree", "\x1f384")
+ , ("gift", "\x1f381")
+ , ("tanabata_tree", "\x1f38b")
+ , ("tada", "\x1f389")
+ , ("confetti_ball", "\x1f38a")
+ , ("balloon", "\x1f388")
+ , ("crossed_flags", "\x1f38c")
+ , ("crystal_ball", "\x1f52e")
+ , ("movie_camera", "\x1f3a5")
+ , ("camera", "\x1f4f7")
+ , ("video_camera", "\x1f4f9")
+ , ("vhs", "\x1f4fc")
+ , ("cd", "\x1f4bf")
+ , ("dvd", "\x1f4c0")
+ , ("minidisc", "\x1f4bd")
+ , ("floppy_disk", "\x1f4be")
+ , ("computer", "\x1f4bb")
+ , ("iphone", "\x1f4f1")
+ , ("phone", "\x260e\fe0f")
+ , ("telephone", "\x260e\fe0f")
+ , ("telephone_receiver", "\x1f4de")
+ , ("pager", "\x1f4df")
+ , ("fax", "\x1f4e0")
+ , ("satellite", "\x1f4e1")
+ , ("tv", "\x1f4fa")
+ , ("radio", "\x1f4fb")
+ , ("loud_sound", "\x1f50a")
+ , ("sound", "\x1f509")
+ , ("speaker", "\x1f508")
+ , ("mute", "\x1f507")
+ , ("bell", "\x1f514")
+ , ("no_bell", "\x1f515")
+ , ("loudspeaker", "\x1f4e2")
+ , ("mega", "\x1f4e3")
+ , ("hourglass_flowing_sand", "\x23f3")
+ , ("hourglass", "\x231b")
+ , ("alarm_clock", "\x23f0")
+ , ("watch", "\x231a")
+ , ("unlock", "\x1f513")
+ , ("lock", "\x1f512")
+ , ("lock_with_ink_pen", "\x1f50f")
+ , ("closed_lock_with_key", "\x1f510")
+ , ("key", "\x1f511")
+ , ("mag_right", "\x1f50e")
+ , ("bulb", "\x1f4a1")
+ , ("flashlight", "\x1f526")
+ , ("high_brightness", "\x1f506")
+ , ("low_brightness", "\x1f505")
+ , ("electric_plug", "\x1f50c")
+ , ("battery", "\x1f50b")
+ , ("mag", "\x1f50d")
+ , ("bathtub", "\x1f6c1")
+ , ("bath", "\x1f6c0")
+ , ("shower", "\x1f6bf")
+ , ("toilet", "\x1f6bd")
+ , ("wrench", "\x1f527")
+ , ("nut_and_bolt", "\x1f529")
+ , ("hammer", "\x1f528")
+ , ("door", "\x1f6aa")
+ , ("smoking", "\x1f6ac")
+ , ("bomb", "\x1f4a3")
+ , ("gun", "\x1f52b")
+ , ("hocho", "\x1f52a")
+ , ("knife", "\x1f52a")
+ , ("pill", "\x1f48a")
+ , ("syringe", "\x1f489")
+ , ("moneybag", "\x1f4b0")
+ , ("yen", "\x1f4b4")
+ , ("dollar", "\x1f4b5")
+ , ("pound", "\x1f4b7")
+ , ("euro", "\x1f4b6")
+ , ("credit_card", "\x1f4b3")
+ , ("money_with_wings", "\x1f4b8")
+ , ("calling", "\x1f4f2")
+ , ("e-mail", "\x1f4e7")
+ , ("inbox_tray", "\x1f4e5")
+ , ("outbox_tray", "\x1f4e4")
+ , ("email", "\x2709\fe0f")
+ , ("envelope", "\x2709\fe0f")
+ , ("envelope_with_arrow", "\x1f4e9")
+ , ("incoming_envelope", "\x1f4e8")
+ , ("postal_horn", "\x1f4ef")
+ , ("mailbox", "\x1f4eb")
+ , ("mailbox_closed", "\x1f4ea")
+ , ("mailbox_with_mail", "\x1f4ec")
+ , ("mailbox_with_no_mail", "\x1f4ed")
+ , ("postbox", "\x1f4ee")
+ , ("package", "\x1f4e6")
+ , ("memo", "\x1f4dd")
+ , ("pencil", "\x1f4dd")
+ , ("page_facing_up", "\x1f4c4")
+ , ("page_with_curl", "\x1f4c3")
+ , ("bookmark_tabs", "\x1f4d1")
+ , ("bar_chart", "\x1f4ca")
+ , ("chart_with_upwards_trend", "\x1f4c8")
+ , ("chart_with_downwards_trend", "\x1f4c9")
+ , ("scroll", "\x1f4dc")
+ , ("clipboard", "\x1f4cb")
+ , ("date", "\x1f4c5")
+ , ("calendar", "\x1f4c6")
+ , ("card_index", "\x1f4c7")
+ , ("file_folder", "\x1f4c1")
+ , ("open_file_folder", "\x1f4c2")
+ , ("scissors", "\x2702\fe0f")
+ , ("pushpin", "\x1f4cc")
+ , ("paperclip", "\x1f4ce")
+ , ("black_nib", "\x2712\fe0f")
+ , ("pencil2", "\x270f\fe0f")
+ , ("straight_ruler", "\x1f4cf")
+ , ("triangular_ruler", "\x1f4d0")
+ , ("closed_book", "\x1f4d5")
+ , ("green_book", "\x1f4d7")
+ , ("blue_book", "\x1f4d8")
+ , ("orange_book", "\x1f4d9")
+ , ("notebook", "\x1f4d3")
+ , ("notebook_with_decorative_cover", "\x1f4d4")
+ , ("ledger", "\x1f4d2")
+ , ("books", "\x1f4da")
+ , ("book", "\x1f4d6")
+ , ("open_book", "\x1f4d6")
+ , ("bookmark", "\x1f516")
+ , ("name_badge", "\x1f4db")
+ , ("microscope", "\x1f52c")
+ , ("telescope", "\x1f52d")
+ , ("newspaper", "\x1f4f0")
+ , ("art", "\x1f3a8")
+ , ("clapper", "\x1f3ac")
+ , ("microphone", "\x1f3a4")
+ , ("headphones", "\x1f3a7")
+ , ("musical_score", "\x1f3bc")
+ , ("musical_note", "\x1f3b5")
+ , ("notes", "\x1f3b6")
+ , ("musical_keyboard", "\x1f3b9")
+ , ("violin", "\x1f3bb")
+ , ("trumpet", "\x1f3ba")
+ , ("saxophone", "\x1f3b7")
+ , ("guitar", "\x1f3b8")
+ , ("space_invader", "\x1f47e")
+ , ("video_game", "\x1f3ae")
+ , ("black_joker", "\x1f0cf")
+ , ("flower_playing_cards", "\x1f3b4")
+ , ("mahjong", "\x1f004")
+ , ("game_die", "\x1f3b2")
+ , ("dart", "\x1f3af")
+ , ("football", "\x1f3c8")
+ , ("basketball", "\x1f3c0")
+ , ("soccer", "\x26bd")
+ , ("baseball", "\x26be\fe0f")
+ , ("tennis", "\x1f3be")
+ , ("8ball", "\x1f3b1")
+ , ("rugby_football", "\x1f3c9")
+ , ("bowling", "\x1f3b3")
+ , ("golf", "\x26f3")
+ , ("mountain_bicyclist", "\x1f6b5")
+ , ("bicyclist", "\x1f6b4")
+ , ("checkered_flag", "\x1f3c1")
+ , ("horse_racing", "\x1f3c7")
+ , ("trophy", "\x1f3c6")
+ , ("ski", "\x1f3bf")
+ , ("snowboarder", "\x1f3c2")
+ , ("swimmer", "\x1f3ca")
+ , ("surfer", "\x1f3c4")
+ , ("fishing_pole_and_fish", "\x1f3a3")
+ , ("coffee", "\x2615")
+ , ("tea", "\x1f375")
+ , ("sake", "\x1f376")
+ , ("baby_bottle", "\x1f37c")
+ , ("beer", "\x1f37a")
+ , ("beers", "\x1f37b")
+ , ("cocktail", "\x1f378")
+ , ("tropical_drink", "\x1f379")
+ , ("wine_glass", "\x1f377")
+ , ("fork_and_knife", "\x1f374")
+ , ("pizza", "\x1f355")
+ , ("hamburger", "\x1f354")
+ , ("fries", "\x1f35f")
+ , ("poultry_leg", "\x1f357")
+ , ("meat_on_bone", "\x1f356")
+ , ("spaghetti", "\x1f35d")
+ , ("curry", "\x1f35b")
+ , ("fried_shrimp", "\x1f364")
+ , ("bento", "\x1f371")
+ , ("sushi", "\x1f363")
+ , ("fish_cake", "\x1f365")
+ , ("rice_ball", "\x1f359")
+ , ("rice_cracker", "\x1f358")
+ , ("rice", "\x1f35a")
+ , ("ramen", "\x1f35c")
+ , ("stew", "\x1f372")
+ , ("oden", "\x1f362")
+ , ("dango", "\x1f361")
+ , ("egg", "\x1f373")
+ , ("bread", "\x1f35e")
+ , ("doughnut", "\x1f369")
+ , ("custard", "\x1f36e")
+ , ("icecream", "\x1f366")
+ , ("ice_cream", "\x1f368")
+ , ("shaved_ice", "\x1f367")
+ , ("birthday", "\x1f382")
+ , ("cake", "\x1f370")
+ , ("cookie", "\x1f36a")
+ , ("chocolate_bar", "\x1f36b")
+ , ("candy", "\x1f36c")
+ , ("lollipop", "\x1f36d")
+ , ("honey_pot", "\x1f36f")
+ , ("apple", "\x1f34e")
+ , ("green_apple", "\x1f34f")
+ , ("tangerine", "\x1f34a")
+ , ("lemon", "\x1f34b")
+ , ("cherries", "\x1f352")
+ , ("grapes", "\x1f347")
+ , ("watermelon", "\x1f349")
+ , ("strawberry", "\x1f353")
+ , ("peach", "\x1f351")
+ , ("melon", "\x1f348")
+ , ("banana", "\x1f34c")
+ , ("pear", "\x1f350")
+ , ("pineapple", "\x1f34d")
+ , ("sweet_potato", "\x1f360")
+ , ("eggplant", "\x1f346")
+ , ("tomato", "\x1f345")
+ , ("corn", "\x1f33d")
+ , ("house", "\x1f3e0")
+ , ("house_with_garden", "\x1f3e1")
+ , ("school", "\x1f3eb")
+ , ("office", "\x1f3e2")
+ , ("post_office", "\x1f3e3")
+ , ("hospital", "\x1f3e5")
+ , ("bank", "\x1f3e6")
+ , ("convenience_store", "\x1f3ea")
+ , ("love_hotel", "\x1f3e9")
+ , ("hotel", "\x1f3e8")
+ , ("wedding", "\x1f492")
+ , ("church", "\x26ea")
+ , ("department_store", "\x1f3ec")
+ , ("european_post_office", "\x1f3e4")
+ , ("city_sunrise", "\x1f307")
+ , ("city_sunset", "\x1f306")
+ , ("japanese_castle", "\x1f3ef")
+ , ("european_castle", "\x1f3f0")
+ , ("tent", "\x26fa")
+ , ("factory", "\x1f3ed")
+ , ("tokyo_tower", "\x1f5fc")
+ , ("japan", "\x1f5fe")
+ , ("mount_fuji", "\x1f5fb")
+ , ("sunrise_over_mountains", "\x1f304")
+ , ("sunrise", "\x1f305")
+ , ("night_with_stars", "\x1f303")
+ , ("statue_of_liberty", "\x1f5fd")
+ , ("bridge_at_night", "\x1f309")
+ , ("carousel_horse", "\x1f3a0")
+ , ("ferris_wheel", "\x1f3a1")
+ , ("fountain", "\x26f2")
+ , ("roller_coaster", "\x1f3a2")
+ , ("ship", "\x1f6a2")
+ , ("boat", "\x26f5")
+ , ("sailboat", "\x26f5")
+ , ("speedboat", "\x1f6a4")
+ , ("rowboat", "\x1f6a3")
+ , ("anchor", "\x2693")
+ , ("rocket", "\x1f680")
+ , ("airplane", "\x2708\fe0f")
+ , ("seat", "\x1f4ba")
+ , ("helicopter", "\x1f681")
+ , ("steam_locomotive", "\x1f682")
+ , ("tram", "\x1f68a")
+ , ("station", "\x1f689")
+ , ("mountain_railway", "\x1f69e")
+ , ("train2", "\x1f686")
+ , ("bullettrain_side", "\x1f684")
+ , ("bullettrain_front", "\x1f685")
+ , ("light_rail", "\x1f688")
+ , ("metro", "\x1f687")
+ , ("monorail", "\x1f69d")
+ , ("train", "\x1f68b")
+ , ("railway_car", "\x1f683")
+ , ("trolleybus", "\x1f68e")
+ , ("bus", "\x1f68c")
+ , ("oncoming_bus", "\x1f68d")
+ , ("blue_car", "\x1f699")
+ , ("oncoming_automobile", "\x1f698")
+ , ("car", "\x1f697")
+ , ("red_car", "\x1f697")
+ , ("taxi", "\x1f695")
+ , ("oncoming_taxi", "\x1f696")
+ , ("articulated_lorry", "\x1f69b")
+ , ("truck", "\x1f69a")
+ , ("rotating_light", "\x1f6a8")
+ , ("police_car", "\x1f693")
+ , ("oncoming_police_car", "\x1f694")
+ , ("fire_engine", "\x1f692")
+ , ("ambulance", "\x1f691")
+ , ("minibus", "\x1f690")
+ , ("bike", "\x1f6b2")
+ , ("aerial_tramway", "\x1f6a1")
+ , ("suspension_railway", "\x1f69f")
+ , ("mountain_cableway", "\x1f6a0")
+ , ("tractor", "\x1f69c")
+ , ("barber", "\x1f488")
+ , ("busstop", "\x1f68f")
+ , ("ticket", "\x1f3ab")
+ , ("vertical_traffic_light", "\x1f6a6")
+ , ("traffic_light", "\x1f6a5")
+ , ("warning", "\x26a0\fe0f")
+ , ("construction", "\x1f6a7")
+ , ("beginner", "\x1f530")
+ , ("fuelpump", "\x26fd")
+ , ("izakaya_lantern", "\x1f3ee")
+ , ("lantern", "\x1f3ee")
+ , ("slot_machine", "\x1f3b0")
+ , ("hotsprings", "\x2668\fe0f")
+ , ("moyai", "\x1f5ff")
+ , ("circus_tent", "\x1f3aa")
+ , ("performing_arts", "\x1f3ad")
+ , ("round_pushpin", "\x1f4cd")
+ , ("triangular_flag_on_post", "\x1f6a9")
+ , ("jp", "\x1f1ef\1f1f5")
+ , ("kr", "\x1f1f0\1f1f7")
+ , ("de", "\x1f1e9\1f1ea")
+ , ("cn", "\x1f1e8\1f1f3")
+ , ("us", "\x1f1fa\1f1f8")
+ , ("fr", "\x1f1eb\1f1f7")
+ , ("es", "\x1f1ea\1f1f8")
+ , ("it", "\x1f1ee\1f1f9")
+ , ("ru", "\x1f1f7\1f1fa")
+ , ("gb", "\x1f1ec\1f1e7")
+ , ("uk", "\x1f1ec\1f1e7")
+ , ("one", "1\fe0f\20e3")
+ , ("two", "2\fe0f\20e3")
+ , ("three", "3\fe0f\20e3")
+ , ("four", "4\fe0f\20e3")
+ , ("five", "5\fe0f\20e3")
+ , ("six", "6\fe0f\20e3")
+ , ("seven", "7\fe0f\20e3")
+ , ("eight", "8\fe0f\20e3")
+ , ("nine", "9\fe0f\20e3")
+ , ("zero", "0\fe0f\20e3")
+ , ("keycap_ten", "\x1f51f")
+ , ("hash", "#\fe0f\20e3")
+ , ("symbols", "\x1f523")
+ , ("arrow_up", "\x2b06\fe0f")
+ , ("arrow_down", "\x2b07\fe0f")
+ , ("arrow_left", "\x2b05\fe0f")
+ , ("arrow_right", "\x27a1\fe0f")
+ , ("capital_abcd", "\x1f520")
+ , ("abcd", "\x1f521")
+ , ("abc", "\x1f524")
+ , ("arrow_upper_right", "\x2197\fe0f")
+ , ("arrow_upper_left", "\x2196\fe0f")
+ , ("arrow_lower_right", "\x2198\fe0f")
+ , ("arrow_lower_left", "\x2199\fe0f")
+ , ("left_right_arrow", "\x2194\fe0f")
+ , ("arrow_up_down", "\x2195\fe0f")
+ , ("arrows_counterclockwise", "\x1f504")
+ , ("arrow_backward", "\x25c0\fe0f")
+ , ("arrow_forward", "\x25b6\fe0f")
+ , ("arrow_up_small", "\x1f53c")
+ , ("arrow_down_small", "\x1f53d")
+ , ("leftwards_arrow_with_hook", "\x21a9\fe0f")
+ , ("arrow_right_hook", "\x21aa\fe0f")
+ , ("information_source", "\x2139\fe0f")
+ , ("rewind", "\x23ea")
+ , ("fast_forward", "\x23e9")
+ , ("arrow_double_up", "\x23eb")
+ , ("arrow_double_down", "\x23ec")
+ , ("arrow_heading_down", "\x2935\fe0f")
+ , ("arrow_heading_up", "\x2934\fe0f")
+ , ("ok", "\x1f197")
+ , ("twisted_rightwards_arrows", "\x1f500")
+ , ("repeat", "\x1f501")
+ , ("repeat_one", "\x1f502")
+ , ("new", "\x1f195")
+ , ("up", "\x1f199")
+ , ("cool", "\x1f192")
+ , ("free", "\x1f193")
+ , ("ng", "\x1f196")
+ , ("signal_strength", "\x1f4f6")
+ , ("cinema", "\x1f3a6")
+ , ("koko", "\x1f201")
+ , ("u6307", "\x1f22f")
+ , ("u7a7a", "\x1f233")
+ , ("u6e80", "\x1f235")
+ , ("u5408", "\x1f234")
+ , ("u7981", "\x1f232")
+ , ("ideograph_advantage", "\x1f250")
+ , ("u5272", "\x1f239")
+ , ("u55b6", "\x1f23a")
+ , ("u6709", "\x1f236")
+ , ("u7121", "\x1f21a")
+ , ("restroom", "\x1f6bb")
+ , ("mens", "\x1f6b9")
+ , ("womens", "\x1f6ba")
+ , ("baby_symbol", "\x1f6bc")
+ , ("wc", "\x1f6be")
+ , ("potable_water", "\x1f6b0")
+ , ("put_litter_in_its_place", "\x1f6ae")
+ , ("parking", "\x1f17f\fe0f")
+ , ("wheelchair", "\x267f")
+ , ("no_smoking", "\x1f6ad")
+ , ("u6708", "\x1f237\fe0f")
+ , ("u7533", "\x1f238")
+ , ("sa", "\x1f202\fe0f")
+ , ("m", "\x24c2\fe0f")
+ , ("passport_control", "\x1f6c2")
+ , ("baggage_claim", "\x1f6c4")
+ , ("left_luggage", "\x1f6c5")
+ , ("customs", "\x1f6c3")
+ , ("accept", "\x1f251")
+ , ("secret", "\x3299\fe0f")
+ , ("congratulations", "\x3297\fe0f")
+ , ("cl", "\x1f191")
+ , ("sos", "\x1f198")
+ , ("id", "\x1f194")
+ , ("no_entry_sign", "\x1f6ab")
+ , ("underage", "\x1f51e")
+ , ("no_mobile_phones", "\x1f4f5")
+ , ("do_not_litter", "\x1f6af")
+ , ("non-potable_water", "\x1f6b1")
+ , ("no_bicycles", "\x1f6b3")
+ , ("no_pedestrians", "\x1f6b7")
+ , ("children_crossing", "\x1f6b8")
+ , ("no_entry", "\x26d4")
+ , ("eight_spoked_asterisk", "\x2733\fe0f")
+ , ("sparkle", "\x2747\fe0f")
+ , ("negative_squared_cross_mark", "\x274e")
+ , ("white_check_mark", "\x2705")
+ , ("eight_pointed_black_star", "\x2734\fe0f")
+ , ("heart_decoration", "\x1f49f")
+ , ("vs", "\x1f19a")
+ , ("vibration_mode", "\x1f4f3")
+ , ("mobile_phone_off", "\x1f4f4")
+ , ("a", "\x1f170\fe0f")
+ , ("b", "\x1f171\fe0f")
+ , ("ab", "\x1f18e")
+ , ("o2", "\x1f17e\fe0f")
+ , ("diamond_shape_with_a_dot_inside", "\x1f4a0")
+ , ("loop", "\x27bf")
+ , ("recycle", "\x267b\fe0f")
+ , ("aries", "\x2648")
+ , ("taurus", "\x2649")
+ , ("gemini", "\x264a")
+ , ("cancer", "\x264b")
+ , ("leo", "\x264c")
+ , ("virgo", "\x264d")
+ , ("libra", "\x264e")
+ , ("scorpius", "\x264f")
+ , ("sagittarius", "\x2650")
+ , ("capricorn", "\x2651")
+ , ("aquarius", "\x2652")
+ , ("pisces", "\x2653")
+ , ("ophiuchus", "\x26ce")
+ , ("six_pointed_star", "\x1f52f")
+ , ("atm", "\x1f3e7")
+ , ("chart", "\x1f4b9")
+ , ("heavy_dollar_sign", "\x1f4b2")
+ , ("currency_exchange", "\x1f4b1")
+ , ("copyright", "©\fe0f")
+ , ("registered", "®\fe0f")
+ , ("tm", "\x2122\fe0f")
+ , ("x", "\x274c")
+ , ("bangbang", "\x203c\fe0f")
+ , ("interrobang", "\x2049\fe0f")
+ , ("exclamation", "\x2757")
+ , ("heavy_exclamation_mark", "\x2757")
+ , ("question", "\x2753")
+ , ("grey_exclamation", "\x2755")
+ , ("grey_question", "\x2754")
+ , ("o", "\x2b55")
+ , ("top", "\x1f51d")
+ , ("end", "\x1f51a")
+ , ("back", "\x1f519")
+ , ("on", "\x1f51b")
+ , ("soon", "\x1f51c")
+ , ("arrows_clockwise", "\x1f503")
+ , ("clock12", "\x1f55b")
+ , ("clock1230", "\x1f567")
+ , ("clock1", "\x1f550")
+ , ("clock130", "\x1f55c")
+ , ("clock2", "\x1f551")
+ , ("clock230", "\x1f55d")
+ , ("clock3", "\x1f552")
+ , ("clock330", "\x1f55e")
+ , ("clock4", "\x1f553")
+ , ("clock430", "\x1f55f")
+ , ("clock5", "\x1f554")
+ , ("clock530", "\x1f560")
+ , ("clock6", "\x1f555")
+ , ("clock7", "\x1f556")
+ , ("clock8", "\x1f557")
+ , ("clock9", "\x1f558")
+ , ("clock10", "\x1f559")
+ , ("clock11", "\x1f55a")
+ , ("clock630", "\x1f561")
+ , ("clock730", "\x1f562")
+ , ("clock830", "\x1f563")
+ , ("clock930", "\x1f564")
+ , ("clock1030", "\x1f565")
+ , ("clock1130", "\x1f566")
+ , ("heavy_multiplication_x", "\x2716\fe0f")
+ , ("heavy_plus_sign", "\x2795")
+ , ("heavy_minus_sign", "\x2796")
+ , ("heavy_division_sign", "\x2797")
+ , ("spades", "\x2660\fe0f")
+ , ("hearts", "\x2665\fe0f")
+ , ("clubs", "\x2663\fe0f")
+ , ("diamonds", "\x2666\fe0f")
+ , ("white_flower", "\x1f4ae")
+ , ("heavy_check_mark", "\x2714\fe0f")
+ , ("ballot_box_with_check", "\x2611\fe0f")
+ , ("radio_button", "\x1f518")
+ , ("link", "\x1f517")
+ , ("curly_loop", "\x27b0")
+ , ("wavy_dash", "\x3030\fe0f")
+ , ("part_alternation_mark", "\x303d\fe0f")
+ , ("trident", "\x1f531")
+ , ("black_medium_square", "\x25fc\fe0f")
+ , ("white_medium_square", "\x25fb\fe0f")
+ , ("black_medium_small_square", "\x25fe")
+ , ("white_medium_small_square", "\x25fd")
+ , ("black_small_square", "\x25aa\fe0f")
+ , ("white_small_square", "\x25ab\fe0f")
+ , ("small_red_triangle", "\x1f53a")
+ , ("black_square_button", "\x1f532")
+ , ("white_square_button", "\x1f533")
+ , ("black_circle", "\x26ab")
+ , ("white_circle", "\x26aa")
+ , ("red_circle", "\x1f534")
+ , ("large_blue_circle", "\x1f535")
+ , ("small_red_triangle_down", "\x1f53b")
+ , ("white_large_square", "\x2b1c")
+ , ("black_large_square", "\x2b1b")
+ , ("large_orange_diamond", "\x1f536")
+ , ("large_blue_diamond", "\x1f537")
+ , ("small_orange_diamond", "\x1f538")
+ , ("small_blue_diamond", "\x1f539")
+ ]
diff --git a/src/Text/Pandoc/Error.hs b/src/Text/Pandoc/Error.hs
index 04084055e..0a4e08175 100644
--- a/src/Text/Pandoc/Error.hs
+++ b/src/Text/Pandoc/Error.hs
@@ -31,7 +31,6 @@ during parsing.
-}
module Text.Pandoc.Error (PandocError(..), handleError) where
-import Prelude
import Text.Parsec.Error
import Text.Parsec.Pos hiding (Line)
import Text.Pandoc.Compat.Except
diff --git a/src/Text/Pandoc/Highlighting.hs b/src/Text/Pandoc/Highlighting.hs
index 40e1ec8ae..d0b945d45 100644
--- a/src/Text/Pandoc/Highlighting.hs
+++ b/src/Text/Pandoc/Highlighting.hs
@@ -48,7 +48,6 @@ module Text.Pandoc.Highlighting ( languages
, fromListingsLanguage
, toListingsLanguage
) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Shared (safeRead)
import Text.Highlighting.Kate
diff --git a/src/Text/Pandoc/ImageSize.hs b/src/Text/Pandoc/ImageSize.hs
index 5b4593a4c..a38a9dcd1 100644
--- a/src/Text/Pandoc/ImageSize.hs
+++ b/src/Text/Pandoc/ImageSize.hs
@@ -31,7 +31,6 @@ Functions for determining the size of a PNG, JPEG, or GIF image.
-}
module Text.Pandoc.ImageSize ( ImageType(..), imageType, imageSize,
sizeInPixels, sizeInPoints ) where
-import Prelude
import Data.ByteString (ByteString, unpack)
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy as BL
diff --git a/src/Text/Pandoc/MIME.hs b/src/Text/Pandoc/MIME.hs
index 926a98b53..6fd9ac373 100644
--- a/src/Text/Pandoc/MIME.hs
+++ b/src/Text/Pandoc/MIME.hs
@@ -29,7 +29,6 @@ Mime type lookup for ODT writer.
-}
module Text.Pandoc.MIME ( MimeType, getMimeType, getMimeTypeDef,
extensionFromMimeType )where
-import Prelude
import System.FilePath
import Data.Char ( toLower )
import Data.List (isPrefixOf, isSuffixOf)
diff --git a/src/Text/Pandoc/MediaBag.hs b/src/Text/Pandoc/MediaBag.hs
index 8f965c3d5..eea25fadf 100644
--- a/src/Text/Pandoc/MediaBag.hs
+++ b/src/Text/Pandoc/MediaBag.hs
@@ -36,7 +36,6 @@ module Text.Pandoc.MediaBag (
mediaDirectory,
extractMediaBag
) where
-import Prelude
import System.FilePath
import qualified System.FilePath.Posix as Posix
import System.Directory (createDirectoryIfMissing)
diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs
index a97c4179d..158303acd 100644
--- a/src/Text/Pandoc/Options.hs
+++ b/src/Text/Pandoc/Options.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveDataTypeable, DeriveGeneric #-}
{-
Copyright (C) 2012-2015 John MacFarlane <jgm@berkeley.edu>
@@ -47,7 +47,6 @@ module Text.Pandoc.Options ( Extension(..)
, def
, isEnabled
) where
-import Prelude
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Default
@@ -55,6 +54,7 @@ import Text.Pandoc.Highlighting (Style, pygments)
import Text.Pandoc.MediaBag (MediaBag)
import Data.Data (Data)
import Data.Typeable (Typeable)
+import GHC.Generics (Generic)
-- | Individually selectable syntax extensions.
data Extension =
@@ -106,6 +106,7 @@ data Extension =
| Ext_ignore_line_breaks -- ^ Newlines in paragraphs are ignored
| Ext_literate_haskell -- ^ Enable literate Haskell conventions
| Ext_abbreviations -- ^ PHP markdown extra abbreviation definitions
+ | Ext_emoji -- ^ Support emoji like :smile:
| Ext_auto_identifiers -- ^ Automatic identifiers for headers
| Ext_ascii_identifiers -- ^ ascii-only identifiers for headers
| Ext_header_attributes -- ^ Explicit header attributes {#id .class k=v}
@@ -114,7 +115,7 @@ data Extension =
| Ext_line_blocks -- ^ RST style line blocks
| Ext_epub_html_exts -- ^ Recognise the EPUB extended version of HTML
| Ext_shortcut_reference_links -- ^ Shortcut reference links
- deriving (Show, Read, Enum, Eq, Ord, Bounded, Data, Typeable)
+ deriving (Show, Read, Enum, Eq, Ord, Bounded, Data, Typeable, Generic)
pandocExtensions :: Set Extension
pandocExtensions = Set.fromList
@@ -204,6 +205,7 @@ githubMarkdownExtensions = Set.fromList
, Ext_intraword_underscores
, Ext_strikeout
, Ext_hard_line_breaks
+ , Ext_emoji
, Ext_lists_without_preceding_blankline
, Ext_shortcut_reference_links
]
@@ -257,7 +259,7 @@ data ReaderOptions = ReaderOptions{
, readerDefaultImageExtension :: String -- ^ Default extension for images
, readerTrace :: Bool -- ^ Print debugging info
, readerTrackChanges :: TrackChanges
-} deriving (Show, Read, Data, Typeable)
+} deriving (Show, Read, Data, Typeable, Generic)
instance Default ReaderOptions
where def = ReaderOptions{
@@ -279,7 +281,7 @@ instance Default ReaderOptions
-- Writer options
--
-data EPUBVersion = EPUB2 | EPUB3 deriving (Eq, Show, Read, Data, Typeable)
+data EPUBVersion = EPUB2 | EPUB3 deriving (Eq, Show, Read, Data, Typeable, Generic)
data HTMLMathMethod = PlainMath
| LaTeXMathML (Maybe String) -- url of LaTeXMathML.js
@@ -289,18 +291,18 @@ data HTMLMathMethod = PlainMath
| MathML (Maybe String) -- url of MathMLinHTML.js
| MathJax String -- url of MathJax.js
| KaTeX String String -- url of stylesheet and katex.js
- deriving (Show, Read, Eq, Data, Typeable)
+ deriving (Show, Read, Eq, Data, Typeable, Generic)
data CiteMethod = Citeproc -- use citeproc to render them
| Natbib -- output natbib cite commands
| Biblatex -- output biblatex cite commands
- deriving (Show, Read, Eq, Data, Typeable)
+ deriving (Show, Read, Eq, Data, Typeable, Generic)
-- | Methods for obfuscating email addresses in HTML.
data ObfuscationMethod = NoObfuscation
| ReferenceObfuscation
| JavascriptObfuscation
- deriving (Show, Read, Eq, Data, Typeable)
+ deriving (Show, Read, Eq, Data, Typeable, Generic)
-- | Varieties of HTML slide shows.
data HTMLSlideVariant = S5Slides
@@ -309,13 +311,13 @@ data HTMLSlideVariant = S5Slides
| DZSlides
| RevealJsSlides
| NoSlides
- deriving (Show, Read, Eq, Data, Typeable)
+ deriving (Show, Read, Eq, Data, Typeable, Generic)
-- | Options for accepting or rejecting MS Word track-changes.
data TrackChanges = AcceptChanges
| RejectChanges
| AllChanges
- deriving (Show, Read, Eq, Data, Typeable)
+ deriving (Show, Read, Eq, Data, Typeable, Generic)
-- | Options for writers
data WriterOptions = WriterOptions
@@ -362,7 +364,7 @@ data WriterOptions = WriterOptions
, writerMediaBag :: MediaBag -- ^ Media collected by docx or epub reader
, writerVerbose :: Bool -- ^ Verbose debugging output
, writerLaTeXArgs :: [String] -- ^ Flags to pass to latex-engine
- } deriving (Show, Data, Typeable)
+ } deriving (Show, Data, Typeable, Generic)
instance Default WriterOptions where
def = WriterOptions { writerStandalone = False
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs
index 4c96908c1..ab94a289a 100644
--- a/src/Text/Pandoc/PDF.hs
+++ b/src/Text/Pandoc/PDF.hs
@@ -30,11 +30,11 @@ Conversion of LaTeX documents to PDF.
-}
module Text.Pandoc.PDF ( makePDF ) where
-import Prelude
import Data.ByteString.Lazy (ByteString)
import qualified Data.ByteString.Lazy as B
import qualified Data.ByteString.Lazy.Char8 as BC
import qualified Data.ByteString as BS
+import Text.Pandoc.Compat.Monoid ((<>))
import System.Exit (ExitCode (..))
import System.FilePath
import System.IO (stderr, stdout)
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs
index 75c557ac6..02d114e0f 100644
--- a/src/Text/Pandoc/Parsing.hs
+++ b/src/Text/Pandoc/Parsing.hs
@@ -180,12 +180,12 @@ import Data.Char ( toLower, toUpper, ord, chr, isAscii, isAlphaNum,
isHexDigit, isSpace )
import Data.List ( intercalate, transpose, isSuffixOf )
import Text.Pandoc.Shared
-import Prelude
import qualified Data.Map as M
import Text.TeXMath.Readers.TeX.Macros (applyMacros, Macro,
parseMacroDefinitions)
import Text.Pandoc.Compat.TagSoupEntity ( lookupEntity )
import Text.Pandoc.Asciify (toAsciiChar)
+import Text.Pandoc.Compat.Monoid ((<>))
import Data.Default
import qualified Data.Set as Set
import Control.Monad.Reader
@@ -1211,7 +1211,8 @@ citeKey = try $ do
firstChar <- alphaNum <|> char '_' <|> char '*' -- @* for wildcard in nocite
let regchar = satisfy (\c -> isAlphaNum c || c == '_')
let internal p = try $ p <* lookAhead regchar
- rest <- many $ regchar <|> internal (oneOf ":.#$%&-+?<>~/")
+ rest <- many $ regchar <|> internal (oneOf ":.#$%&-+?<>~/") <|>
+ (oneOf ":/" <* lookAhead (char '/'))
let key = firstChar:rest
return (suppress_author, key)
diff --git a/src/Text/Pandoc/Pretty.hs b/src/Text/Pandoc/Pretty.hs
index 2589f7f6b..5771f3a89 100644
--- a/src/Text/Pandoc/Pretty.hs
+++ b/src/Text/Pandoc/Pretty.hs
@@ -74,13 +74,13 @@ module Text.Pandoc.Pretty (
)
where
-import Prelude
import Data.Sequence (Seq, fromList, (<|), singleton, mapWithIndex, viewl, ViewL(..))
import Data.Foldable (toList)
import Data.List (intercalate)
import Data.String
import Control.Monad.State
import Data.Char (isSpace)
+import Text.Pandoc.Compat.Monoid ((<>))
data RenderState a = RenderState{
output :: [a] -- ^ In reverse order
diff --git a/src/Text/Pandoc/Process.hs b/src/Text/Pandoc/Process.hs
index 77b009d96..e5245638d 100644
--- a/src/Text/Pandoc/Process.hs
+++ b/src/Text/Pandoc/Process.hs
@@ -29,7 +29,6 @@ ByteString variant of 'readProcessWithExitCode'.
-}
module Text.Pandoc.Process (pipeProcess)
where
-import Prelude
import System.Process
import System.Exit (ExitCode (..))
import Control.Exception
diff --git a/src/Text/Pandoc/Readers/CommonMark.hs b/src/Text/Pandoc/Readers/CommonMark.hs
index e6f8026ab..51a35c8ad 100644
--- a/src/Text/Pandoc/Readers/CommonMark.hs
+++ b/src/Text/Pandoc/Readers/CommonMark.hs
@@ -32,7 +32,6 @@ CommonMark is a strongly specified variant of Markdown: http://commonmark.org.
module Text.Pandoc.Readers.CommonMark (readCommonMark)
where
-import Prelude
import CMark
import Data.Text (unpack, pack)
import Data.List (groupBy)
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs
index 0845f5e03..f679ddb57 100644
--- a/src/Text/Pandoc/Readers/DocBook.hs
+++ b/src/Text/Pandoc/Readers/DocBook.hs
@@ -1,5 +1,4 @@
module Text.Pandoc.Readers.DocBook ( readDocBook ) where
-import Prelude
import Data.Char (toUpper)
import Text.Pandoc.Shared (safeRead)
import Text.Pandoc.Options
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs
index 35b2ba3fd..9f1c7af0a 100644
--- a/src/Text/Pandoc/Readers/Docx.hs
+++ b/src/Text/Pandoc/Readers/Docx.hs
@@ -74,7 +74,6 @@ module Text.Pandoc.Readers.Docx
( readDocx
) where
-import Prelude
import Codec.Archive.Zip
import Text.Pandoc.Definition
import Text.Pandoc.Options
@@ -504,6 +503,10 @@ bodyPartToBlocks (ListItem pPr numId lvl levelInfo parparts) = do
]
blks <- bodyPartToBlocks (Paragraph pPr parparts)
return $ divWith ("", ["list-item"], kvs) blks
+bodyPartToBlocks (DummyListItem pPr _ parparts) =
+ let pPr' = pPr {pStyle = "ListParagraph": (pStyle pPr)}
+ in
+ bodyPartToBlocks $ Paragraph pPr' parparts
bodyPartToBlocks (Tbl _ _ _ []) =
return $ para mempty
bodyPartToBlocks (Tbl cap _ look (r:rs)) = do
diff --git a/src/Text/Pandoc/Readers/Docx/Fonts.hs b/src/Text/Pandoc/Readers/Docx/Fonts.hs
index 967ca296c..b44c71412 100644
--- a/src/Text/Pandoc/Readers/Docx/Fonts.hs
+++ b/src/Text/Pandoc/Readers/Docx/Fonts.hs
@@ -29,7 +29,6 @@ Utilities to convert between font codepoints and unicode characters.
-}
module Text.Pandoc.Readers.Docx.Fonts (getUnicode, Font(..)) where
-import Prelude
-- | Enumeration of recognised fonts
data Font = Symbol -- ^ <http://en.wikipedia.org/wiki/Symbol_(typeface) Adobe Symbol>
diff --git a/src/Text/Pandoc/Readers/Docx/Lists.hs b/src/Text/Pandoc/Readers/Docx/Lists.hs
index 0c9297139..c265ad074 100644
--- a/src/Text/Pandoc/Readers/Docx/Lists.hs
+++ b/src/Text/Pandoc/Readers/Docx/Lists.hs
@@ -33,7 +33,6 @@ module Text.Pandoc.Readers.Docx.Lists ( blocksToBullets
, listParagraphDivs
) where
-import Prelude
import Text.Pandoc.JSON
import Text.Pandoc.Generic (bottomUp)
import Text.Pandoc.Shared (trim)
diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs
index 91eab1339..5910a476b 100644
--- a/src/Text/Pandoc/Readers/Docx/Parse.hs
+++ b/src/Text/Pandoc/Readers/Docx/Parse.hs
@@ -50,7 +50,6 @@ module Text.Pandoc.Readers.Docx.Parse ( Docx(..)
, Cell(..)
, archiveToDocx
) where
-import Prelude
import Codec.Archive.Zip
import Text.XML.Light
import Data.Maybe
@@ -76,6 +75,7 @@ data ReaderEnv = ReaderEnv { envNotes :: Notes
, envFont :: Maybe Font
, envCharStyles :: CharStyleMap
, envParStyles :: ParStyleMap
+ , envLocation :: DocumentLocation
}
deriving Show
@@ -88,7 +88,7 @@ instance Error DocxError where
type D = ExceptT DocxError (Reader ReaderEnv)
runD :: D a -> ReaderEnv -> Either DocxError a
-runD dx re = runReader (runExceptT dx ) re
+runD dx re = runReader (runExceptT dx) re
maybeToD :: Maybe a -> D a
maybeToD (Just a) = return a
@@ -141,7 +141,10 @@ data AbstractNumb = AbstractNumb String [Level]
-- (ilvl, format, string, start)
type Level = (String, String, String, Maybe Integer)
-data Relationship = Relationship (RelId, Target)
+data DocumentLocation = InDocument | InFootnote | InEndnote
+ deriving (Eq,Show)
+
+data Relationship = Relationship DocumentLocation RelId Target
deriving Show
data Notes = Notes NameSpaces
@@ -175,6 +178,7 @@ defaultParagraphStyle = ParagraphStyle { pStyle = []
data BodyPart = Paragraph ParagraphStyle [ParPart]
| ListItem ParagraphStyle String String Level [ParPart]
+ | DummyListItem ParagraphStyle String [ParPart]
| Tbl String TblGrid TblLook [Row]
| OMathPara [Exp]
deriving Show
@@ -239,7 +243,6 @@ defaultRunStyle = RunStyle { isBold = Nothing
, rUnderline = Nothing
, rStyle = Nothing}
-
type Target = String
type Anchor = String
type URL = String
@@ -256,7 +259,8 @@ archiveToDocx archive = do
rels = archiveToRelationships archive
media = archiveToMedia archive
(styles, parstyles) = archiveToStyles archive
- rEnv = ReaderEnv notes numbering rels media Nothing styles parstyles
+ rEnv =
+ ReaderEnv notes numbering rels media Nothing styles parstyles InDocument
doc <- runD (archiveToDocument archive) rEnv
return $ Docx doc
@@ -363,29 +367,30 @@ archiveToNotes zf =
in
Notes ns fn en
-filePathIsRel :: FilePath -> Bool
-filePathIsRel fp =
- let (dir, name) = splitFileName fp
- in
- (dir == "word/_rels/") && ((takeExtension name) == ".rels")
+filePathToRelType :: FilePath -> Maybe DocumentLocation
+filePathToRelType "word/_rels/document.xml.rels" = Just InDocument
+filePathToRelType "word/_rels/footnotes.xml.rels" = Just InFootnote
+filePathToRelType "word/_rels/endnotes.xml.rels" = Just InEndnote
+filePathToRelType _ = Nothing
-relElemToRelationship :: Element -> Maybe Relationship
-relElemToRelationship element | qName (elName element) == "Relationship" =
+relElemToRelationship :: DocumentLocation -> Element -> Maybe Relationship
+relElemToRelationship relType element | qName (elName element) == "Relationship" =
do
relId <- findAttr (QName "Id" Nothing Nothing) element
target <- findAttr (QName "Target" Nothing Nothing) element
- return $ Relationship (relId, target)
-relElemToRelationship _ = Nothing
-
-
+ return $ Relationship relType relId target
+relElemToRelationship _ _ = Nothing
+
+filePathToRelationships :: Archive -> FilePath -> [Relationship]
+filePathToRelationships ar fp | Just relType <- filePathToRelType fp
+ , Just entry <- findEntryByPath fp ar
+ , Just relElems <- (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry =
+ mapMaybe (relElemToRelationship relType) $ elChildren relElems
+filePathToRelationships _ _ = []
+
archiveToRelationships :: Archive -> [Relationship]
archiveToRelationships archive =
- let relPaths = filter filePathIsRel (filesInArchive archive)
- entries = mapMaybe (\f -> findEntryByPath f archive) relPaths
- relElems = mapMaybe (parseXMLDoc . UTF8.toStringLazy . fromEntry) entries
- rels = mapMaybe relElemToRelationship $ concatMap elChildren relElems
- in
- rels
+ concatMap (filePathToRelationships archive) $ filesInArchive archive
filePathIsMedia :: FilePath -> Bool
filePathIsMedia fp =
@@ -410,6 +415,7 @@ lookupLevel numId ilvl (Numbering _ numbs absNumbs) = do
lvl <- lookup ilvl $ map (\l@(i, _, _, _) -> (i, l)) lvls
return lvl
+
numElemToNum :: NameSpaces -> Element -> Maybe Numb
numElemToNum ns element |
qName (elName element) == "num" &&
@@ -561,7 +567,7 @@ elemToBodyPart ns element
num <- asks envNumbering
case lookupLevel numId lvl num of
Just levelInfo -> return $ ListItem parstyle numId lvl levelInfo parparts
- Nothing -> throwError WrongElem
+ Nothing -> return $ DummyListItem parstyle lvl parparts
elemToBodyPart ns element
| isElem ns "w" "p" element = do
sty <- asks envParStyles
@@ -574,7 +580,7 @@ elemToBodyPart ns element
Just levelInfo ->
return $ ListItem parstyle numId lvl levelInfo parparts
Nothing ->
- throwError WrongElem
+ return $ DummyListItem parstyle lvl parparts
Nothing -> return $ Paragraph parstyle parparts
elemToBodyPart ns element
| isElem ns "w" "tbl" element = do
@@ -597,13 +603,16 @@ elemToBodyPart ns element
return $ Tbl caption grid tblLook rows
elemToBodyPart _ _ = throwError WrongElem
-lookupRelationship :: RelId -> [Relationship] -> Maybe Target
-lookupRelationship relid rels =
- lookup relid (map (\(Relationship pair) -> pair) rels)
+lookupRelationship :: DocumentLocation -> RelId -> [Relationship] -> Maybe Target
+lookupRelationship docLocation relid rels =
+ lookup (docLocation, relid) pairs
+ where
+ pairs = map (\(Relationship loc relid' target) -> ((loc, relid'), target)) rels
expandDrawingId :: String -> D (FilePath, B.ByteString)
expandDrawingId s = do
- target <- asks (lookupRelationship s . envRelationships)
+ location <- asks envLocation
+ target <- asks (lookupRelationship location s . envRelationships)
case target of
Just filepath -> do
bytes <- asks (lookup ("word/" ++ filepath) . envMedia)
@@ -658,9 +667,10 @@ elemToParPart ns element
elemToParPart ns element
| isElem ns "w" "hyperlink" element
, Just relId <- findAttr (elemName ns "r" "id") element = do
+ location <- asks envLocation
runs <- mapD (elemToRun ns) (elChildren element)
rels <- asks envRelationships
- case lookupRelationship relId rels of
+ case lookupRelationship location relId rels of
Just target -> do
case findAttr (elemName ns "w" "anchor") element of
Just anchor -> return $ ExternalHyperLink (target ++ '#':anchor) runs
@@ -700,7 +710,7 @@ elemToRun ns element
, Just fnId <- findAttr (elemName ns "w" "id") ref = do
notes <- asks envNotes
case lookupFootnote fnId notes of
- Just e -> do bps <- mapD (elemToBodyPart ns) (elChildren e)
+ Just e -> do bps <- local (\r -> r {envLocation=InFootnote}) $ mapD (elemToBodyPart ns) (elChildren e)
return $ Footnote bps
Nothing -> return $ Footnote []
elemToRun ns element
@@ -709,7 +719,7 @@ elemToRun ns element
, Just enId <- findAttr (elemName ns "w" "id") ref = do
notes <- asks envNotes
case lookupEndnote enId notes of
- Just e -> do bps <- mapD (elemToBodyPart ns) (elChildren e)
+ Just e -> do bps <- local (\r -> r {envLocation=InEndnote}) $ mapD (elemToBodyPart ns) (elChildren e)
return $ Endnote bps
Nothing -> return $ Endnote []
elemToRun ns element
diff --git a/src/Text/Pandoc/Readers/Docx/Reducible.hs b/src/Text/Pandoc/Readers/Docx/Reducible.hs
index a850141f6..c93b40119 100644
--- a/src/Text/Pandoc/Readers/Docx/Reducible.hs
+++ b/src/Text/Pandoc/Readers/Docx/Reducible.hs
@@ -7,7 +7,6 @@ module Text.Pandoc.Readers.Docx.Reducible ( concatReduce
where
-import Prelude
import Text.Pandoc.Builder
import Data.List
import Data.Sequence (ViewR(..), ViewL(..), viewl, viewr)
diff --git a/src/Text/Pandoc/Readers/Docx/StyleMap.hs b/src/Text/Pandoc/Readers/Docx/StyleMap.hs
index 231653106..2901ea2a3 100644
--- a/src/Text/Pandoc/Readers/Docx/StyleMap.hs
+++ b/src/Text/Pandoc/Readers/Docx/StyleMap.hs
@@ -5,7 +5,6 @@ module Text.Pandoc.Readers.Docx.StyleMap ( StyleMaps(..)
, hasStyleName
) where
-import Prelude
import Text.XML.Light
import Text.Pandoc.Readers.Docx.Util
import Control.Monad.State
diff --git a/src/Text/Pandoc/Readers/Docx/Util.hs b/src/Text/Pandoc/Readers/Docx/Util.hs
index 2790c0d1a..891f107b0 100644
--- a/src/Text/Pandoc/Readers/Docx/Util.hs
+++ b/src/Text/Pandoc/Readers/Docx/Util.hs
@@ -5,7 +5,6 @@ module Text.Pandoc.Readers.Docx.Util (
, elemToNameSpaces
) where
-import Prelude
import Text.XML.Light
import Data.Maybe (mapMaybe)
diff --git a/src/Text/Pandoc/Readers/EPUB.hs b/src/Text/Pandoc/Readers/EPUB.hs
index 9938bb70b..b8698fe26 100644
--- a/src/Text/Pandoc/Readers/EPUB.hs
+++ b/src/Text/Pandoc/Readers/EPUB.hs
@@ -8,7 +8,6 @@ module Text.Pandoc.Readers.EPUB
(readEPUB)
where
-import Prelude
import Text.XML.Light
import Text.Pandoc.Definition hiding (Attr)
import Text.Pandoc.Walk (walk, query)
@@ -17,6 +16,7 @@ import Text.Pandoc.Options ( ReaderOptions(..), readerTrace)
import Text.Pandoc.Shared (escapeURI, collapseFilePath, addMetaField)
import Text.Pandoc.MediaBag (MediaBag, insertMedia)
import Text.Pandoc.Compat.Except (MonadError, throwError, runExcept, Except)
+import Text.Pandoc.Compat.Monoid ((<>))
import Text.Pandoc.MIME (MimeType)
import qualified Text.Pandoc.Builder as B
import Codec.Archive.Zip ( Archive (..), toArchive, fromEntry
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 570efc2be..ce10a289e 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -38,7 +38,6 @@ module Text.Pandoc.Readers.HTML ( readHtml
, isCommentTag
) where
-import Prelude
import Text.HTML.TagSoup
import Text.HTML.TagSoup.Match
import Text.Pandoc.Definition
@@ -67,7 +66,7 @@ import Control.Monad.Reader (Reader,ask, asks, local, runReader)
import Network.URI (isURI)
import Text.Pandoc.Error
import Text.Pandoc.CSS (foldOrElse, pickStyleAttrProps)
-
+import Text.Pandoc.Compat.Monoid ((<>))
import Text.Parsec.Error
diff --git a/src/Text/Pandoc/Readers/Haddock.hs b/src/Text/Pandoc/Readers/Haddock.hs
index 578a89d21..16f3d7ef3 100644
--- a/src/Text/Pandoc/Readers/Haddock.hs
+++ b/src/Text/Pandoc/Readers/Haddock.hs
@@ -14,9 +14,9 @@ module Text.Pandoc.Readers.Haddock
( readHaddock
) where
-import Prelude
import Text.Pandoc.Builder (Blocks, Inlines)
import qualified Text.Pandoc.Builder as B
+import Text.Pandoc.Compat.Monoid ((<>))
import Text.Pandoc.Shared (trim, splitBy)
import Data.List (intersperse, stripPrefix)
import Data.Maybe (fromMaybe)
@@ -130,7 +130,7 @@ makeExample prompt expression result =
<> (mconcat $ intersperse B.linebreak $ map coder result')
where
-- 1. drop trailing whitespace from the prompt, remember the prefix
- prefix = takeWhile (`elem` [' ','\t']) prompt
+ prefix = takeWhile (`elem` " \t") prompt
-- 2. drop, if possible, the exact same sequence of whitespace
-- characters from each result line
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index ffb4182ad..b9645d034 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -35,7 +35,6 @@ module Text.Pandoc.Readers.LaTeX ( readLaTeX,
handleIncludes
) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Walk
import Text.Pandoc.Shared
@@ -170,17 +169,23 @@ quoted' f starter ender = do
try ((f . mconcat) <$> manyTill inline ender) <|> lit startchs
doubleQuote :: LP Inlines
-doubleQuote =
- quoted' doubleQuoted (try $ string "``") (void $ try $ string "''")
- <|> quoted' doubleQuoted (string "“") (void $ char '”')
- -- the following is used by babel for localized quotes:
- <|> quoted' doubleQuoted (try $ string "\"`") (void $ try $ string "\"'")
- <|> quoted' doubleQuoted (string "\"") (void $ char '"')
+doubleQuote = do
+ smart <- getOption readerSmart
+ if smart
+ then quoted' doubleQuoted (try $ string "``") (void $ try $ string "''")
+ <|> quoted' doubleQuoted (string "“") (void $ char '”')
+ -- the following is used by babel for localized quotes:
+ <|> quoted' doubleQuoted (try $ string "\"`") (void $ try $ string "\"'")
+ <|> quoted' doubleQuoted (string "\"") (void $ char '"')
+ else str <$> many1 (oneOf "`'“”\"")
singleQuote :: LP Inlines
-singleQuote =
- quoted' singleQuoted (string "`") (try $ char '\'' >> notFollowedBy letter)
- <|> quoted' singleQuoted (string "‘") (try $ char '’' >> notFollowedBy letter)
+singleQuote = do
+ smart <- getOption readerSmart
+ if smart
+ then quoted' singleQuoted (string "`") (try $ char '\'' >> notFollowedBy letter)
+ <|> quoted' singleQuoted (string "‘") (try $ char '’' >> notFollowedBy letter)
+ else str <$> many1 (oneOf "`\'‘’")
inline :: LP Inlines
inline = (mempty <$ comment)
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index d3b71c499..7e811a966 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -32,7 +32,6 @@ Conversion of markdown-formatted plain text to 'Pandoc' document.
module Text.Pandoc.Readers.Markdown ( readMarkdown,
readMarkdownWithWarnings ) where
-import Prelude
import Data.List ( transpose, sortBy, findIndex, intersperse, intercalate )
import qualified Data.Map as M
import Data.Scientific (coefficient, base10Exponent)
@@ -40,6 +39,7 @@ import Data.Ord ( comparing )
import Data.Char ( isSpace, isAlphaNum, toLower )
import Data.Maybe
import Text.Pandoc.Definition
+import Text.Pandoc.Emoji (emojis)
import qualified Data.Text as T
import Data.Text (Text)
import qualified Data.Yaml as Yaml
@@ -63,6 +63,7 @@ import Text.HTML.TagSoup.Match (tagOpen)
import qualified Data.Set as Set
import Text.Printf (printf)
import Debug.Trace (trace)
+import Text.Pandoc.Compat.Monoid ((<>))
import Text.Pandoc.Error
type MarkdownParser = Parser [Char] ParserState
@@ -1467,6 +1468,7 @@ inline = choice [ whitespace
, exampleRef
, smart
, return . B.singleton <$> charRef
+ , emoji
, symbol
, ltSign
] <?> "inline"
@@ -1898,6 +1900,21 @@ rawHtmlInline = do
else not . isTextTag
return $ return $ B.rawInline "html" result
+-- Emoji
+
+emojiChars :: [Char]
+emojiChars = ['a'..'z'] ++ ['0'..'9'] ++ ['_','+','-']
+
+emoji :: MarkdownParser (F Inlines)
+emoji = try $ do
+ guardEnabled Ext_emoji
+ char ':'
+ emojikey <- many1 (oneOf emojiChars)
+ char ':'
+ case M.lookup emojikey emojis of
+ Just s -> return (return (B.str s))
+ Nothing -> mzero
+
-- Citations
cite :: MarkdownParser (F Inlines)
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
index b21fb58c0..ffac51e7b 100644
--- a/src/Text/Pandoc/Readers/MediaWiki.hs
+++ b/src/Text/Pandoc/Readers/MediaWiki.hs
@@ -36,10 +36,10 @@ _ parse templates?
-}
module Text.Pandoc.Readers.MediaWiki ( readMediaWiki ) where
-import Prelude
import Text.Pandoc.Definition
import qualified Text.Pandoc.Builder as B
import Text.Pandoc.Builder (Inlines, Blocks, trimInlines)
+import Text.Pandoc.Compat.Monoid ((<>))
import Text.Pandoc.Options
import Text.Pandoc.Readers.HTML ( htmlTag, isBlockTag, isCommentTag )
import Text.Pandoc.XML ( fromEntities )
diff --git a/src/Text/Pandoc/Readers/Native.hs b/src/Text/Pandoc/Readers/Native.hs
index 73ac0d4b2..4ec164e19 100644
--- a/src/Text/Pandoc/Readers/Native.hs
+++ b/src/Text/Pandoc/Readers/Native.hs
@@ -30,7 +30,6 @@ Conversion of a string representation of a pandoc type (@Pandoc@,
-}
module Text.Pandoc.Readers.Native ( readNative ) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Shared (safeRead)
diff --git a/src/Text/Pandoc/Readers/OPML.hs b/src/Text/Pandoc/Readers/OPML.hs
index e7633e414..b2e5f2e67 100644
--- a/src/Text/Pandoc/Readers/OPML.hs
+++ b/src/Text/Pandoc/Readers/OPML.hs
@@ -1,6 +1,5 @@
{-# LANGUAGE FlexibleContexts #-}
module Text.Pandoc.Readers.OPML ( readOPML ) where
-import Prelude
import Data.Char (toUpper)
import Text.Pandoc.Options
import Text.Pandoc.Definition
diff --git a/src/Text/Pandoc/Readers/Odt.hs b/src/Text/Pandoc/Readers/Odt.hs
index cc15c9e20..a925c1d84 100644
--- a/src/Text/Pandoc/Readers/Odt.hs
+++ b/src/Text/Pandoc/Readers/Odt.hs
@@ -32,7 +32,6 @@ Entry point to the odt reader.
module Text.Pandoc.Readers.Odt ( readOdt ) where
-import Prelude
import Codec.Archive.Zip
import qualified Text.XML.Light as XML
diff --git a/src/Text/Pandoc/Readers/Odt/Arrows/State.hs b/src/Text/Pandoc/Readers/Odt/Arrows/State.hs
index 2cc83183f..30f96c557 100644
--- a/src/Text/Pandoc/Readers/Odt/Arrows/State.hs
+++ b/src/Text/Pandoc/Readers/Odt/Arrows/State.hs
@@ -46,6 +46,7 @@ import Control.Monad
import Data.Foldable
+import Text.Pandoc.Compat.Monoid
import Text.Pandoc.Readers.Odt.Arrows.Utils
import Text.Pandoc.Readers.Odt.Generic.Fallible
diff --git a/src/Text/Pandoc/Readers/Odt/Arrows/Utils.hs b/src/Text/Pandoc/Readers/Odt/Arrows/Utils.hs
index e7d2bcb92..8c9ee0539 100644
--- a/src/Text/Pandoc/Readers/Odt/Arrows/Utils.hs
+++ b/src/Text/Pandoc/Readers/Odt/Arrows/Utils.hs
@@ -39,7 +39,6 @@ with an equivalent return value.
-- We export everything
module Text.Pandoc.Readers.Odt.Arrows.Utils where
-import Prelude
import Control.Arrow
import Control.Monad ( join, MonadPlus(..) )
@@ -47,7 +46,7 @@ import qualified Data.Foldable as F
import Text.Pandoc.Readers.Odt.Generic.Fallible
import Text.Pandoc.Readers.Odt.Generic.Utils
-
+import Text.Pandoc.Compat.Monoid
and2 :: (Arrow a) => a b c -> a b c' -> a b (c,c')
and2 = (&&&)
diff --git a/src/Text/Pandoc/Readers/Odt/ContentReader.hs b/src/Text/Pandoc/Readers/Odt/ContentReader.hs
index 06dd83668..1f1c57646 100644
--- a/src/Text/Pandoc/Readers/Odt/ContentReader.hs
+++ b/src/Text/Pandoc/Readers/Odt/ContentReader.hs
@@ -39,7 +39,6 @@ module Text.Pandoc.Readers.Odt.ContentReader
, read_body
) where
-import Prelude
import Control.Arrow
import Control.Applicative hiding ( liftA, liftA2, liftA3 )
diff --git a/src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs b/src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs
index 7213bc8f1..d0fdc228f 100644
--- a/src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs
+++ b/src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs
@@ -39,10 +39,9 @@ compatible instances of "ArrowChoice".
-- We export everything
module Text.Pandoc.Readers.Odt.Generic.Fallible where
-import Prelude
import Control.Applicative
import Control.Monad
-
+import Text.Pandoc.Compat.Monoid ((<>))
import qualified Data.Foldable as F
-- | Default for now. Will probably become a class at some point.
diff --git a/src/Text/Pandoc/Readers/Odt/Generic/Namespaces.hs b/src/Text/Pandoc/Readers/Odt/Generic/Namespaces.hs
index 0a6095e98..82ae3e20e 100644
--- a/src/Text/Pandoc/Readers/Odt/Generic/Namespaces.hs
+++ b/src/Text/Pandoc/Readers/Odt/Generic/Namespaces.hs
@@ -31,7 +31,6 @@ typesafe Haskell namespace identifiers and unsafe "real world" namespaces.
module Text.Pandoc.Readers.Odt.Generic.Namespaces where
-import Prelude
import qualified Data.Map as M
--
diff --git a/src/Text/Pandoc/Readers/Odt/Generic/SetMap.hs b/src/Text/Pandoc/Readers/Odt/Generic/SetMap.hs
index b7a555219..afd7d616c 100644
--- a/src/Text/Pandoc/Readers/Odt/Generic/SetMap.hs
+++ b/src/Text/Pandoc/Readers/Odt/Generic/SetMap.hs
@@ -30,7 +30,6 @@ A map of values to sets of values.
module Text.Pandoc.Readers.Odt.Generic.SetMap where
-import Prelude
import qualified Data.Map as M
import qualified Data.Set as S
diff --git a/src/Text/Pandoc/Readers/Odt/Generic/Utils.hs b/src/Text/Pandoc/Readers/Odt/Generic/Utils.hs
index a09b4cc1d..6c10ed61d 100644
--- a/src/Text/Pandoc/Readers/Odt/Generic/Utils.hs
+++ b/src/Text/Pandoc/Readers/Odt/Generic/Utils.hs
@@ -53,7 +53,6 @@ module Text.Pandoc.Readers.Odt.Generic.Utils
, composition
) where
-import Prelude
import Control.Category ( Category, (>>>), (<<<) )
import qualified Control.Category as Cat ( id )
import Control.Monad ( msum )
diff --git a/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs b/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs
index 7d72ee125..8c03d1a09 100644
--- a/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs
+++ b/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs
@@ -116,7 +116,6 @@ module Text.Pandoc.Readers.Odt.Generic.XMLConverter
, matchContent
) where
-import Prelude
import Control.Applicative hiding ( liftA, liftA2 )
import Control.Monad ( MonadPlus )
import Control.Arrow
diff --git a/src/Text/Pandoc/Readers/Odt/Namespaces.hs b/src/Text/Pandoc/Readers/Odt/Namespaces.hs
index f00093368..deb009998 100644
--- a/src/Text/Pandoc/Readers/Odt/Namespaces.hs
+++ b/src/Text/Pandoc/Readers/Odt/Namespaces.hs
@@ -31,7 +31,6 @@ Namespaces used in odt files.
module Text.Pandoc.Readers.Odt.Namespaces ( Namespace (..)
) where
-import Prelude
import Data.List ( isPrefixOf )
import Data.Maybe ( fromMaybe, listToMaybe )
import qualified Data.Map as M ( empty, insert )
diff --git a/src/Text/Pandoc/Readers/Odt/StyleReader.hs b/src/Text/Pandoc/Readers/Odt/StyleReader.hs
index 4140bf2c7..96cfed0b3 100644
--- a/src/Text/Pandoc/Readers/Odt/StyleReader.hs
+++ b/src/Text/Pandoc/Readers/Odt/StyleReader.hs
@@ -70,7 +70,6 @@ module Text.Pandoc.Readers.Odt.StyleReader
, readStylesAt
) where
-import Prelude
import Control.Arrow
import Control.Applicative hiding ( liftA, liftA2, liftA3 )
diff --git a/src/Text/Pandoc/Readers/Org.hs b/src/Text/Pandoc/Readers/Org.hs
index 6e14febeb..3be47cfd4 100644
--- a/src/Text/Pandoc/Readers/Org.hs
+++ b/src/Text/Pandoc/Readers/Org.hs
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- |
Module : Text.Pandoc.Readers.Org
- Copyright : Copyright (C) 2014 Albert Krewinkel
+ Copyright : Copyright (C) 2014-2015 Albert Krewinkel
License : GNU GPL, version 2 or above
Maintainer : Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
@@ -30,11 +30,11 @@ Conversion of org-mode formatted plain text to 'Pandoc' document.
-}
module Text.Pandoc.Readers.Org ( readOrg ) where
-import Prelude
import qualified Text.Pandoc.Builder as B
import Text.Pandoc.Builder ( Inlines, Blocks, HasMeta(..),
trimInlines )
import Text.Pandoc.Definition
+import Text.Pandoc.Compat.Monoid ((<>))
import Text.Pandoc.Options
import qualified Text.Pandoc.Parsing as P
import Text.Pandoc.Parsing hiding ( F, unF, askF, asksF, runF
@@ -994,13 +994,16 @@ definitionListItem :: OrgParser Int
-> OrgParser (F (Inlines, [Blocks]))
definitionListItem parseMarkerGetLength = try $ do
markerLength <- parseMarkerGetLength
- term <- manyTill (noneOf "\n\r") (try $ string "::")
+ term <- manyTill (noneOf "\n\r") (try definitionMarker)
line1 <- anyLineNewline
blank <- option "" ("\n" <$ blankline)
cont <- concat <$> many (listContinuation markerLength)
term' <- parseFromString parseInlines term
contents' <- parseFromString parseBlocks $ line1 ++ blank ++ cont
return $ (,) <$> term' <*> fmap (:[]) contents'
+ where
+ definitionMarker =
+ spaceChar *> string "::" <* (spaceChar <|> lookAhead P.newline)
-- parse raw text for one list item, excluding start marker and continuations
@@ -1585,8 +1588,11 @@ smart :: OrgParser (F Inlines)
smart = do
getOption readerSmart >>= guard
doubleQuoted <|> singleQuoted <|>
- choice (map (return <$>) [orgApostrophe, dash, ellipses])
- where orgApostrophe =
+ choice (map (return <$>) [orgApostrophe, orgDash, orgEllipses])
+ where
+ orgDash = dash <* updatePositions '-'
+ orgEllipses = ellipses <* updatePositions '.'
+ orgApostrophe =
(char '\'' <|> char '\8217') <* updateLastPreCharPos
<* updateLastForbiddenCharPos
*> return (B.str "\x2019")
@@ -1594,9 +1600,10 @@ smart = do
singleQuoted :: OrgParser (F Inlines)
singleQuoted = try $ do
singleQuoteStart
+ updatePositions '\''
withQuoteContext InSingleQuote $
fmap B.singleQuoted . trimInlinesF . mconcat <$>
- many1Till inline singleQuoteEnd
+ many1Till inline (singleQuoteEnd <* updatePositions '\'')
-- doubleQuoted will handle regular double-quoted sections, as well
-- as dialogues with an open double-quote without a close double-quote
@@ -1604,6 +1611,7 @@ singleQuoted = try $ do
doubleQuoted :: OrgParser (F Inlines)
doubleQuoted = try $ do
doubleQuoteStart
+ updatePositions '"'
contents <- mconcat <$> many (try $ notFollowedBy doubleQuoteEnd >> inline)
(withQuoteContext InDoubleQuote $ (doubleQuoteEnd <* updateLastForbiddenCharPos) >> return
(fmap B.doubleQuoted . trimInlinesF $ contents))
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index 82fa67407..199e7f3f8 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -33,7 +33,6 @@ module Text.Pandoc.Readers.RST (
readRST,
readRSTWithWarnings
) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Builder (setMeta, fromList)
import Text.Pandoc.Shared
@@ -49,7 +48,7 @@ import Text.Pandoc.Builder (Inlines, Blocks, trimInlines)
import qualified Text.Pandoc.Builder as B
import Data.Sequence (viewr, ViewR(..))
import Data.Char (toLower, isHexDigit, isSpace)
-
+import Text.Pandoc.Compat.Monoid ((<>))
import Text.Pandoc.Error
-- | Parse reStructuredText string and return Pandoc document.
diff --git a/src/Text/Pandoc/Readers/TWiki.hs b/src/Text/Pandoc/Readers/TWiki.hs
index 558e9691a..fc2bdc069 100644
--- a/src/Text/Pandoc/Readers/TWiki.hs
+++ b/src/Text/Pandoc/Readers/TWiki.hs
@@ -33,7 +33,6 @@ module Text.Pandoc.Readers.TWiki ( readTWiki
, readTWikiWithWarnings
) where
-import Prelude
import Text.Pandoc.Definition
import qualified Text.Pandoc.Builder as B
import Text.Pandoc.Options
diff --git a/src/Text/Pandoc/Readers/TeXMath.hs b/src/Text/Pandoc/Readers/TeXMath.hs
index ad0eacb2b..e5778b123 100644
--- a/src/Text/Pandoc/Readers/TeXMath.hs
+++ b/src/Text/Pandoc/Readers/TeXMath.hs
@@ -29,7 +29,6 @@ Conversion of TeX math to a list of 'Pandoc' inline elements.
-}
module Text.Pandoc.Readers.TeXMath ( texMathToInlines ) where
-import Prelude
import Text.Pandoc.Definition
import Text.TeXMath
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
index a99831a56..3db01faf4 100644
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -51,7 +51,6 @@ TODO : refactor common patterns across readers :
module Text.Pandoc.Readers.Textile ( readTextile) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Builder (Inlines, Blocks, trimInlines)
import qualified Text.Pandoc.Builder as B
@@ -65,6 +64,7 @@ import Text.HTML.TagSoup.Match
import Data.List ( intercalate )
import Data.Char ( digitToInt, isUpper)
import Control.Monad ( guard, liftM, when )
+import Text.Pandoc.Compat.Monoid ((<>))
import Text.Printf
import Debug.Trace (trace)
import Text.Pandoc.Error
@@ -535,6 +535,7 @@ link = try $ do
image :: Parser [Char] ParserState Inlines
image = try $ do
char '!' >> notFollowedBy space
+ _ <- attributes -- ignore for now, until we have image attributes
src <- manyTill anyChar' (lookAhead $ oneOf "!(")
alt <- option "" (try $ (char '(' >> manyTill anyChar' (char ')')))
char '!'
diff --git a/src/Text/Pandoc/Readers/Txt2Tags.hs b/src/Text/Pandoc/Readers/Txt2Tags.hs
index 3a3172734..58841f2ce 100644
--- a/src/Text/Pandoc/Readers/Txt2Tags.hs
+++ b/src/Text/Pandoc/Readers/Txt2Tags.hs
@@ -32,9 +32,9 @@ module Text.Pandoc.Readers.Txt2Tags ( readTxt2Tags
, readTxt2TagsNoMacros)
where
-import Prelude
import qualified Text.Pandoc.Builder as B
import Text.Pandoc.Builder ( Inlines, Blocks, trimInlines )
+import Text.Pandoc.Compat.Monoid ((<>))
import Text.Pandoc.Definition
import Text.Pandoc.Options
import Text.Pandoc.Shared (escapeURI,compactify', compactify'DL)
diff --git a/src/Text/Pandoc/SelfContained.hs b/src/Text/Pandoc/SelfContained.hs
index 16013f466..390a7a21a 100644
--- a/src/Text/Pandoc/SelfContained.hs
+++ b/src/Text/Pandoc/SelfContained.hs
@@ -31,7 +31,6 @@ offline, by incorporating linked images, CSS, and scripts into
the HTML using data URIs.
-}
module Text.Pandoc.SelfContained ( makeSelfContained ) where
-import Prelude
import Text.HTML.TagSoup
import Network.URI (isURI, escapeURIString, URI(..), parseURI)
import Data.ByteString.Base64
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 91ccfb134..448a582aa 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -97,7 +97,6 @@ module Text.Pandoc.Shared (
pandocVersion
) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Walk
import Text.Pandoc.MediaBag (MediaBag, lookupMedia)
@@ -130,6 +129,7 @@ import System.IO (stderr)
import System.IO.Temp
import Text.HTML.TagSoup (renderTagsOptions, RenderOptions(..), Tag(..),
renderOptions)
+import Text.Pandoc.Compat.Monoid ((<>))
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as B8
import Data.ByteString.Base64 (decodeLenient)
@@ -247,7 +247,7 @@ trim = triml . trimr
-- | Remove leading space (including newlines) from string.
triml :: String -> String
-triml = dropWhile (`elem` [' ','\r','\n','\t'])
+triml = dropWhile (`elem` " \r\n\t")
-- | Remove trailing space (including newlines) from string.
trimr :: String -> String
@@ -660,7 +660,7 @@ inlineListToIdentifier :: [Inline] -> String
inlineListToIdentifier =
dropWhile (not . isAlpha) . intercalate "-" . words .
map (nbspToSp . toLower) .
- filter (\c -> isLetter c || isDigit c || c `elem` ['_','-','.',' ']) .
+ filter (\c -> isLetter c || isDigit c || c `elem` "_-. ") .
stringify
where nbspToSp '\160' = ' '
nbspToSp x = x
diff --git a/src/Text/Pandoc/Slides.hs b/src/Text/Pandoc/Slides.hs
index 7fdb9d7c4..878c900f7 100644
--- a/src/Text/Pandoc/Slides.hs
+++ b/src/Text/Pandoc/Slides.hs
@@ -29,7 +29,6 @@ Utility functions for splitting documents into slides for slide
show formats (dzslides, revealjs, s5, slidy, slideous, beamer).
-}
module Text.Pandoc.Slides ( getSlideLevel, prepSlides ) where
-import Prelude
import Text.Pandoc.Definition
-- | Find level of header that starts slides (defined as the least header
diff --git a/src/Text/Pandoc/Templates.hs b/src/Text/Pandoc/Templates.hs
index 027996703..a010433fa 100644
--- a/src/Text/Pandoc/Templates.hs
+++ b/src/Text/Pandoc/Templates.hs
@@ -93,12 +93,12 @@ module Text.Pandoc.Templates ( renderTemplate
, Template
, getDefaultTemplate ) where
-import Prelude
import Data.Char (isAlphaNum)
import Control.Monad (guard, when)
import Data.Aeson (ToJSON(..), Value(..))
import qualified Text.Parsec as P
import Text.Parsec.Text (Parser)
+import Text.Pandoc.Compat.Monoid ((<>))
import qualified Data.Text as T
import Data.Text (Text)
import Data.Text.Encoding (encodeUtf8)
diff --git a/src/Text/Pandoc/UUID.hs b/src/Text/Pandoc/UUID.hs
index a99be725d..463be044c 100644
--- a/src/Text/Pandoc/UUID.hs
+++ b/src/Text/Pandoc/UUID.hs
@@ -31,7 +31,6 @@ in RFC4122. See http://tools.ietf.org/html/rfc4122
module Text.Pandoc.UUID ( UUID, getRandomUUID ) where
-import Prelude
import Text.Printf ( printf )
import System.Random ( randomIO )
import Data.Word
diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs
index 832bd5fec..c3406f31f 100644
--- a/src/Text/Pandoc/Writers/AsciiDoc.hs
+++ b/src/Text/Pandoc/Writers/AsciiDoc.hs
@@ -37,7 +37,6 @@ that it has omitted the construct.
AsciiDoc: <http://www.methods.co.nz/asciidoc/>
-}
module Text.Pandoc.Writers.AsciiDoc (writeAsciiDoc) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Templates (renderTemplate')
import Text.Pandoc.Shared
diff --git a/src/Text/Pandoc/Writers/CommonMark.hs b/src/Text/Pandoc/Writers/CommonMark.hs
index 38cfcd82c..fee36d454 100644
--- a/src/Text/Pandoc/Writers/CommonMark.hs
+++ b/src/Text/Pandoc/Writers/CommonMark.hs
@@ -31,7 +31,6 @@ CommonMark: <http://commonmark.org>
-}
module Text.Pandoc.Writers.CommonMark (writeCommonMark) where
-import Prelude
import Text.Pandoc.Writers.HTML (writeHtmlString)
import Text.Pandoc.Definition
import Text.Pandoc.Shared (isTightList)
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs
index 562c9e015..61e62aa17 100644
--- a/src/Text/Pandoc/Writers/ConTeXt.hs
+++ b/src/Text/Pandoc/Writers/ConTeXt.hs
@@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Conversion of 'Pandoc' format into ConTeXt.
-}
module Text.Pandoc.Writers.ConTeXt ( writeConTeXt ) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Shared
import Text.Pandoc.Writers.Shared
diff --git a/src/Text/Pandoc/Writers/Custom.hs b/src/Text/Pandoc/Writers/Custom.hs
index ac8e8cf36..8b7dde3e5 100644
--- a/src/Text/Pandoc/Writers/Custom.hs
+++ b/src/Text/Pandoc/Writers/Custom.hs
@@ -35,7 +35,6 @@ Conversion of 'Pandoc' documents to custom markup using
a lua writer.
-}
module Text.Pandoc.Writers.Custom ( writeCustom ) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Options
import Data.List ( intersperse )
diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs
index bedaaf690..8f9eecea8 100644
--- a/src/Text/Pandoc/Writers/Docbook.hs
+++ b/src/Text/Pandoc/Writers/Docbook.hs
@@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Conversion of 'Pandoc' documents to Docbook XML.
-}
module Text.Pandoc.Writers.Docbook ( writeDocbook) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.XML
import Text.Pandoc.Shared
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index eabf9fb05..94c9ff28e 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Conversion of 'Pandoc' documents to docx.
-}
module Text.Pandoc.Writers.Docx ( writeDocx ) where
-import Prelude
import Data.List ( intercalate, isPrefixOf, isSuffixOf )
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
@@ -61,6 +60,7 @@ import Data.Unique (hashUnique, newUnique)
import System.Random (randomRIO)
import Text.Printf (printf)
import qualified Control.Exception as E
+import Text.Pandoc.Compat.Monoid ((<>))
import Text.Pandoc.MIME (MimeType, getMimeType, getMimeTypeDef,
extensionFromMimeType)
import Control.Applicative ((<|>))
@@ -1070,8 +1070,8 @@ inlineToOpenXML opts (Note bs) = do
[ mknode "w:rPr" [] footnoteStyle
, mknode "w:footnoteRef" [] () ]
let notemarkerXml = RawInline (Format "openxml") $ ppElement notemarker
- let insertNoteRef (Plain ils : xs) = Plain (notemarkerXml : ils) : xs
- insertNoteRef (Para ils : xs) = Para (notemarkerXml : ils) : xs
+ let insertNoteRef (Plain ils : xs) = Plain (notemarkerXml : Space : ils) : xs
+ insertNoteRef (Para ils : xs) = Para (notemarkerXml : Space : ils) : xs
insertNoteRef xs = Para [notemarkerXml] : xs
oldListLevel <- gets stListLevel
oldParaProperties <- gets stParaProperties
diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs
index e7dbd7e2a..b68c46c7e 100644
--- a/src/Text/Pandoc/Writers/DokuWiki.hs
+++ b/src/Text/Pandoc/Writers/DokuWiki.hs
@@ -39,7 +39,6 @@ DokuWiki: <https://www.dokuwiki.org/dokuwiki>
-}
module Text.Pandoc.Writers.DokuWiki ( writeDokuWiki ) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Options ( WriterOptions(
writerTableOfContents
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index 2698ea4be..42f3d5e57 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Conversion of 'Pandoc' documents to EPUB.
-}
module Text.Pandoc.Writers.EPUB ( writeEPUB ) where
-import Prelude
import Data.IORef ( IORef, newIORef, readIORef, modifyIORef )
import qualified Data.Map as M
import Data.Maybe ( fromMaybe, catMaybes )
@@ -817,7 +816,8 @@ transformTag :: WriterOptions
-> Tag String
-> IO (Tag String)
transformTag opts mediaRef tag@(TagOpen name attr)
- | name `elem` ["video", "source", "img", "audio"] = do
+ | name `elem` ["video", "source", "img", "audio"] &&
+ lookup "data-external" attr == Nothing = do
let src = fromAttrib "src" tag
let poster = fromAttrib "poster" tag
newsrc <- modifyMediaRef opts mediaRef src
diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs
index f65f26dd6..31fa4bee8 100644
--- a/src/Text/Pandoc/Writers/FB2.hs
+++ b/src/Text/Pandoc/Writers/FB2.hs
@@ -27,7 +27,6 @@ FictionBook is an XML-based e-book format. For more information see:
-}
module Text.Pandoc.Writers.FB2 (writeFB2) where
-import Prelude
import Control.Monad.State (StateT, evalStateT, get, modify)
import Control.Monad.State (liftM, liftM2, liftIO)
import Data.ByteString.Base64 (encode)
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index fb52256b3..7e3f1c65a 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -30,8 +30,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Conversion of 'Pandoc' documents to HTML.
-}
module Text.Pandoc.Writers.HTML ( writeHtml , writeHtmlString ) where
-import Prelude
import Text.Pandoc.Definition
+import Text.Pandoc.Compat.Monoid ((<>))
import Text.Pandoc.Shared
import Text.Pandoc.Writers.Shared
import Text.Pandoc.Options
@@ -541,6 +541,9 @@ blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do
let attribs = (if startnum /= 1
then [A.start $ toValue startnum]
else []) ++
+ (if numstyle == Example
+ then [A.class_ "example"]
+ else []) ++
(if numstyle /= DefaultStyle
then if writerHtml5 opts
then [A.type_ $
diff --git a/src/Text/Pandoc/Writers/Haddock.hs b/src/Text/Pandoc/Writers/Haddock.hs
index 884a0b318..5df6786ac 100644
--- a/src/Text/Pandoc/Writers/Haddock.hs
+++ b/src/Text/Pandoc/Writers/Haddock.hs
@@ -31,7 +31,6 @@ Conversion of 'Pandoc' documents to haddock markup.
Haddock: <http://www.haskell.org/haddock/doc/html/>
-}
module Text.Pandoc.Writers.Haddock (writeHaddock) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Templates (renderTemplate')
import Text.Pandoc.Shared
@@ -328,8 +327,8 @@ inlineToHaddock _ (RawInline f str)
inlineToHaddock _ (LineBreak) = return cr
inlineToHaddock _ Space = return space
inlineToHaddock opts (Cite _ lst) = inlineListToHaddock opts lst
-inlineToHaddock opts (Link txt (src, _)) = do
- linktext <- inlineListToHaddock opts txt
+inlineToHaddock _opts (Link txt (src, _)) = do
+ let linktext = text $ escapeString $ stringify txt
let useAuto = isURI src &&
case txt of
[Str s] | escapeURI s == src -> True
diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs
index 3bb179353..95ea0c643 100644
--- a/src/Text/Pandoc/Writers/ICML.hs
+++ b/src/Text/Pandoc/Writers/ICML.hs
@@ -14,9 +14,9 @@ InCopy is the companion word-processor to Adobe InDesign and ICML documents can
into InDesign with File -> Place.
-}
module Text.Pandoc.Writers.ICML (writeICML) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.XML
+import Text.Pandoc.Readers.TeXMath (texMathToInlines)
import Text.Pandoc.Writers.Shared
import Text.Pandoc.Shared (splitBy)
import Text.Pandoc.Options
@@ -411,7 +411,8 @@ inlineToICML opts style (Cite _ lst) = inlinesToICML opts style lst
inlineToICML _ style (Code _ str) = charStyle (codeName:style) $ text $ escapeStringForXML str
inlineToICML _ style Space = charStyle style space
inlineToICML _ style LineBreak = charStyle style $ text lineSeparator
-inlineToICML _ style (Math _ str) = charStyle style $ text $ escapeStringForXML str --InDesign doesn't really do math
+inlineToICML opts style (Math mt str) =
+ cat <$> mapM (inlineToICML opts style) (texMathToInlines mt str)
inlineToICML _ _ (RawInline f str)
| f == Format "icml" = return $ text str
| otherwise = return empty
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 97104c4dc..e9a2e0a56 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -30,7 +30,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Conversion of 'Pandoc' format into LaTeX.
-}
module Text.Pandoc.Writers.LaTeX ( writeLaTeX ) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Walk
import Text.Pandoc.Shared
@@ -42,7 +41,7 @@ import Network.URI ( isURI, unEscapeString )
import Data.Aeson (object, (.=))
import Data.List ( (\\), isInfixOf, stripPrefix, intercalate, intersperse, nub, nubBy )
import Data.Char ( toLower, isPunctuation, isAscii, isLetter, isDigit, ord )
-import Data.Maybe ( fromMaybe )
+import Data.Maybe ( fromMaybe, isJust )
import qualified Data.Text as T
import Control.Applicative ((<|>))
import Control.Monad.State
@@ -147,6 +146,7 @@ pandocToLaTeX options (Pandoc meta blocks) = do
titleMeta <- stringToLaTeX TextString $ stringify $ docTitle meta
authorsMeta <- mapM (stringToLaTeX TextString . stringify) $ docAuthors meta
let docLangs = nub $ query (extract "lang") blocks
+ let hasStringValue x = isJust (getField x metadata :: Maybe String)
let context = defField "toc" (writerTableOfContents options) $
defField "toc-depth" (show (writerTOCDepth options -
if stBook st
@@ -184,6 +184,8 @@ pandocToLaTeX options (Pandoc meta blocks) = do
-- set lang to something so polyglossia/babel is included
defField "lang" (if null docLangs then ""::String else "en") $
defField "otherlangs" docLangs $
+ defField "colorlinks" (any hasStringValue
+ ["citecolor", "urlcolor", "linkcolor", "toccolor"]) $
defField "dir" (if (null $ query (extract "dir") blocks)
then ""::String
else "ltr") $
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs
index d6fc0646b..6b1e42394 100644
--- a/src/Text/Pandoc/Writers/Man.hs
+++ b/src/Text/Pandoc/Writers/Man.hs
@@ -29,7 +29,6 @@ Conversion of 'Pandoc' documents to groff man page format.
-}
module Text.Pandoc.Writers.Man ( writeMan) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Templates
import Text.Pandoc.Shared
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index e37e84c4f..cd9c26289 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -31,7 +31,6 @@ Conversion of 'Pandoc' documents to markdown-formatted plain text.
Markdown: <http://daringfireball.net/projects/markdown/>
-}
module Text.Pandoc.Writers.Markdown (writeMarkdown, writePlain) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Walk
import Text.Pandoc.Templates (renderTemplate')
diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs
index 2735d2721..2b7c47e24 100644
--- a/src/Text/Pandoc/Writers/MediaWiki.hs
+++ b/src/Text/Pandoc/Writers/MediaWiki.hs
@@ -30,7 +30,6 @@ Conversion of 'Pandoc' documents to MediaWiki markup.
MediaWiki: <http://www.mediawiki.org/wiki/MediaWiki>
-}
module Text.Pandoc.Writers.MediaWiki ( writeMediaWiki ) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Options
import Text.Pandoc.Shared
diff --git a/src/Text/Pandoc/Writers/Native.hs b/src/Text/Pandoc/Writers/Native.hs
index 80694d74a..2343ff1a8 100644
--- a/src/Text/Pandoc/Writers/Native.hs
+++ b/src/Text/Pandoc/Writers/Native.hs
@@ -34,7 +34,6 @@ metadata.
-}
module Text.Pandoc.Writers.Native ( writeNative )
where
-import Prelude
import Text.Pandoc.Options ( WriterOptions(..) )
import Data.List ( intersperse )
import Text.Pandoc.Definition
diff --git a/src/Text/Pandoc/Writers/ODT.hs b/src/Text/Pandoc/Writers/ODT.hs
index 6947ef396..922a3a785 100644
--- a/src/Text/Pandoc/Writers/ODT.hs
+++ b/src/Text/Pandoc/Writers/ODT.hs
@@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Conversion of 'Pandoc' documents to ODT.
-}
module Text.Pandoc.Writers.ODT ( writeODT ) where
-import Prelude
import Data.IORef
import Data.List ( isPrefixOf )
import Data.Maybe ( fromMaybe )
diff --git a/src/Text/Pandoc/Writers/OPML.hs b/src/Text/Pandoc/Writers/OPML.hs
index ecf6799f5..519136861 100644
--- a/src/Text/Pandoc/Writers/OPML.hs
+++ b/src/Text/Pandoc/Writers/OPML.hs
@@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Conversion of 'Pandoc' documents to OPML XML.
-}
module Text.Pandoc.Writers.OPML ( writeOPML) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.XML
import Text.Pandoc.Writers.Shared
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs
index 5d7f10bdd..7ee87f4af 100644
--- a/src/Text/Pandoc/Writers/OpenDocument.hs
+++ b/src/Text/Pandoc/Writers/OpenDocument.hs
@@ -30,7 +30,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Conversion of 'Pandoc' documents to OpenDocument XML.
-}
module Text.Pandoc.Writers.OpenDocument ( writeOpenDocument ) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Options
import Text.Pandoc.XML
@@ -192,8 +191,7 @@ writeOpenDocument opts (Pandoc meta blocks) =
listStyle (n,l) = inTags True "text:list-style"
[("style:name", "L" ++ show n)] (vcat l)
listStyles = map listStyle (stListStyles s)
- automaticStyles = inTagsIndented "office:automatic-styles" $ vcat $
- reverse $ styles ++ listStyles
+ automaticStyles = vcat $ reverse $ styles ++ listStyles
context = defField "body" body
$ defField "automatic-styles" (render' automaticStyles)
$ metadata
diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs
index 9e7894bed..1b0ab387f 100644
--- a/src/Text/Pandoc/Writers/Org.hs
+++ b/src/Text/Pandoc/Writers/Org.hs
@@ -32,7 +32,6 @@ Conversion of 'Pandoc' documents to Emacs Org-Mode.
Org-Mode: <http://orgmode.org>
-}
module Text.Pandoc.Writers.Org ( writeOrg) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Options
import Text.Pandoc.Shared
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs
index cf6fe38e9..334619880 100644
--- a/src/Text/Pandoc/Writers/RST.hs
+++ b/src/Text/Pandoc/Writers/RST.hs
@@ -31,7 +31,6 @@ Conversion of 'Pandoc' documents to reStructuredText.
reStructuredText: <http://docutils.sourceforge.net/rst.html>
-}
module Text.Pandoc.Writers.RST ( writeRST ) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Options
import Text.Pandoc.Shared
diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs
index ec289e7a4..9eb02ad02 100644
--- a/src/Text/Pandoc/Writers/RTF.hs
+++ b/src/Text/Pandoc/Writers/RTF.hs
@@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Conversion of 'Pandoc' documents to RTF (rich text format).
-}
module Text.Pandoc.Writers.RTF ( writeRTF, writeRTFWithEmbeddedImages ) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Options
import Text.Pandoc.Shared
diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs
index 2c9d077cc..d94dbac46 100644
--- a/src/Text/Pandoc/Writers/Shared.hs
+++ b/src/Text/Pandoc/Writers/Shared.hs
@@ -37,7 +37,6 @@ module Text.Pandoc.Writers.Shared (
, fixDisplayMath
)
where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Pretty
import Text.Pandoc.XML (escapeStringForXML)
diff --git a/src/Text/Pandoc/Writers/Texinfo.hs b/src/Text/Pandoc/Writers/Texinfo.hs
index 119c45155..2325d1425 100644
--- a/src/Text/Pandoc/Writers/Texinfo.hs
+++ b/src/Text/Pandoc/Writers/Texinfo.hs
@@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Conversion of 'Pandoc' format into Texinfo.
-}
module Text.Pandoc.Writers.Texinfo ( writeTexinfo ) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Options
import Text.Pandoc.Shared
diff --git a/src/Text/Pandoc/Writers/Textile.hs b/src/Text/Pandoc/Writers/Textile.hs
index 6322ce232..dbc9eb40a 100644
--- a/src/Text/Pandoc/Writers/Textile.hs
+++ b/src/Text/Pandoc/Writers/Textile.hs
@@ -30,7 +30,6 @@ Conversion of 'Pandoc' documents to Textile markup.
Textile: <http://thresholdstate.com/articles/4312/the-textile-reference-manual>
-}
module Text.Pandoc.Writers.Textile ( writeTextile ) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Options
import Text.Pandoc.Shared
diff --git a/src/Text/Pandoc/XML.hs b/src/Text/Pandoc/XML.hs
index f53251a1f..caa13f177 100644
--- a/src/Text/Pandoc/XML.hs
+++ b/src/Text/Pandoc/XML.hs
@@ -36,7 +36,6 @@ module Text.Pandoc.XML ( escapeCharForXML,
toEntities,
fromEntities ) where
-import Prelude
import Text.Pandoc.Pretty
import Data.Char (ord, isAscii, isSpace)
import Text.Pandoc.Compat.TagSoupEntity (lookupEntity)
diff --git a/stack.yaml b/stack.yaml
index 55b96046c..5e6e71e95 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -8,4 +8,4 @@ flags:
packages:
- '.'
extra-deps: []
-resolver: lts-3.10
+resolver: lts-3.13
diff --git a/tests/Tests/Arbitrary.hs b/tests/Tests/Arbitrary.hs
index 9073f2521..3675d97bf 100644
--- a/tests/Tests/Arbitrary.hs
+++ b/tests/Tests/Arbitrary.hs
@@ -3,7 +3,6 @@
-- provides Arbitrary instance for Pandoc types
module Tests.Arbitrary ()
where
-import Prelude
import Test.QuickCheck.Gen
import Test.QuickCheck.Arbitrary
import Control.Monad (liftM, liftM2)
diff --git a/tests/Tests/Helpers.hs b/tests/Tests/Helpers.hs
index ffaf39cc5..b48c8af3a 100644
--- a/tests/Tests/Helpers.hs
+++ b/tests/Tests/Helpers.hs
@@ -9,7 +9,6 @@ module Tests.Helpers ( test
)
where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Builder (Inlines, Blocks, doc, plain)
import Test.Framework
diff --git a/tests/Tests/Old.hs b/tests/Tests/Old.hs
index c07f2ca4d..c27d30deb 100644
--- a/tests/Tests/Old.hs
+++ b/tests/Tests/Old.hs
@@ -1,6 +1,5 @@
module Tests.Old (tests) where
-import Prelude
import Test.Framework (testGroup, Test )
import Test.Framework.Providers.HUnit
import Test.HUnit ( assertBool )
diff --git a/tests/Tests/Readers/Docx.hs b/tests/Tests/Readers/Docx.hs
index f826a73f9..086d3f964 100644
--- a/tests/Tests/Readers/Docx.hs
+++ b/tests/Tests/Readers/Docx.hs
@@ -1,6 +1,5 @@
module Tests.Readers.Docx (tests) where
-import Prelude
import Text.Pandoc.Options
import Text.Pandoc.Readers.Native
import Text.Pandoc.Definition
@@ -186,10 +185,22 @@ tests = [ testGroup "inlines"
"docx/german_styled_lists.docx"
"docx/german_styled_lists.native"
, testCompare
+ "user deletes bullet after list item (=> part of item par)"
+ "docx/dummy_item_after_list_item.docx"
+ "docx/dummy_item_after_list_item.native"
+ , testCompare
+ "user deletes bullet after par (=> new par)"
+ "docx/dummy_item_after_paragraph.docx"
+ "docx/dummy_item_after_paragraph.native"
+ , testCompare
"footnotes and endnotes"
"docx/notes.docx"
"docx/notes.native"
, testCompare
+ "links in footnotes and endnotes"
+ "docx/link_in_notes.docx"
+ "docx/link_in_notes.native"
+ , testCompare
"blockquotes (parsing indent as blockquote)"
"docx/block_quotes.docx"
"docx/block_quotes_parse_indent.native"
diff --git a/tests/Tests/Readers/EPUB.hs b/tests/Tests/Readers/EPUB.hs
index b06d8bcfe..2ad36eba6 100644
--- a/tests/Tests/Readers/EPUB.hs
+++ b/tests/Tests/Readers/EPUB.hs
@@ -1,6 +1,5 @@
module Tests.Readers.EPUB (tests) where
-import Prelude
import Text.Pandoc.Options
import Test.Framework
import Test.HUnit (assertBool)
diff --git a/tests/Tests/Readers/HTML.hs b/tests/Tests/Readers/HTML.hs
index df7a55d68..2eb87a2f3 100644
--- a/tests/Tests/Readers/HTML.hs
+++ b/tests/Tests/Readers/HTML.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Tests.Readers.HTML (tests) where
-import Prelude
import Text.Pandoc.Definition
import Test.Framework
import Tests.Helpers
diff --git a/tests/Tests/Readers/LaTeX.hs b/tests/Tests/Readers/LaTeX.hs
index 3444214cb..e21f75aa9 100644
--- a/tests/Tests/Readers/LaTeX.hs
+++ b/tests/Tests/Readers/LaTeX.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Tests.Readers.LaTeX (tests) where
-import Prelude
import Text.Pandoc.Definition
import Test.Framework
import Tests.Helpers
diff --git a/tests/Tests/Readers/Markdown.hs b/tests/Tests/Readers/Markdown.hs
index 7cef6e225..366ab7413 100644
--- a/tests/Tests/Readers/Markdown.hs
+++ b/tests/Tests/Readers/Markdown.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Tests.Readers.Markdown (tests) where
-import Prelude
import Text.Pandoc.Definition
import Test.Framework
import Tests.Helpers
@@ -186,6 +185,10 @@ tests = [ testGroup "inline code"
"<\n\na>" =?>
para (text "<") <> para (text "a>")
]
+ , testGroup "emoji"
+ [ test markdownGH "emoji symbols" $
+ ":smile: and :+1:" =?> para (text "😄 and 👍")
+ ]
, "unbalanced brackets" =:
"[[[[[[[[[[[[[[[hi" =?> para (text "[[[[[[[[[[[[[[[hi")
, testGroup "backslash escapes"
diff --git a/tests/Tests/Readers/Odt.hs b/tests/Tests/Readers/Odt.hs
index 4d9936bf0..cf30b8398 100644
--- a/tests/Tests/Readers/Odt.hs
+++ b/tests/Tests/Readers/Odt.hs
@@ -1,6 +1,5 @@
module Tests.Readers.Odt (tests) where
-import Prelude
import Control.Monad ( liftM )
import Text.Pandoc.Options
import Text.Pandoc.Readers.Native
@@ -163,4 +162,4 @@ namesOfTestsComparingToNative = [ "blockquote"
-- , "table"
, "unicode"
, "unorderedList"
- ]
+ ] \ No newline at end of file
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index f721618e5..9e7399aa0 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Tests.Readers.Org (tests) where
-import Prelude
import Text.Pandoc.Definition
import Test.Framework
import Tests.Helpers
@@ -842,7 +841,7 @@ tests =
unlines [ "- PLL :: phase-locked loop"
, "- TTL ::"
, " transistor-transistor logic"
- , "- PSK::phase-shift keying"
+ , "- PSK :: phase-shift keying"
, ""
, " a digital modulation scheme"
] =?>
@@ -881,6 +880,10 @@ tests =
, headerWith ("header", [], []) 1 "header"
]
+ , "Definition lists double-colon markers must be surrounded by whitespace" =:
+ "- std::cout" =?>
+ bulletList [ plain "std::cout" ]
+
, "Loose bullet list" =:
unlines [ "- apple"
, ""
@@ -1247,6 +1250,7 @@ tests =
]
in codeBlockWith ( "", classes, params) "code body\n"
]
+
, testGroup "Smart punctuation"
[ test orgSmart "quote before ellipses"
("'...hi'"
@@ -1267,5 +1271,13 @@ tests =
, test orgSmart "Dashes are allowed at the borders of emphasis'"
("/foo---/" =?>
para (emph "foo—"))
+
+ , test orgSmart "Single quotes can be followed by emphasized text"
+ ("Singles on the '/meat market/'" =?>
+ para ("Singles on the " <> (singleQuoted $ emph "meat market")))
+
+ , test orgSmart "Double quotes can be followed by emphasized text"
+ ("Double income, no kids: \"/DINK/\"" =?>
+ para ("Double income, no kids: " <> (doubleQuoted $ emph "DINK")))
]
]
diff --git a/tests/Tests/Readers/RST.hs b/tests/Tests/Readers/RST.hs
index d589f6561..df6ba61b2 100644
--- a/tests/Tests/Readers/RST.hs
+++ b/tests/Tests/Readers/RST.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-}
module Tests.Readers.RST (tests) where
-import Prelude
import Text.Pandoc.Definition
import Test.Framework
import Tests.Helpers
diff --git a/tests/Tests/Readers/Txt2Tags.hs b/tests/Tests/Readers/Txt2Tags.hs
index 2c1747eaa..bfe217ce3 100644
--- a/tests/Tests/Readers/Txt2Tags.hs
+++ b/tests/Tests/Readers/Txt2Tags.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Tests.Readers.Txt2Tags (tests) where
-import Prelude
import Text.Pandoc.Definition
import Test.Framework
import Tests.Helpers
diff --git a/tests/Tests/Shared.hs b/tests/Tests/Shared.hs
index 3e2c5179d..12652e4b7 100644
--- a/tests/Tests/Shared.hs
+++ b/tests/Tests/Shared.hs
@@ -1,6 +1,5 @@
module Tests.Shared (tests) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Shared
import Test.Framework
diff --git a/tests/Tests/Walk.hs b/tests/Tests/Walk.hs
index 9ba752c0b..c87cc17d7 100644
--- a/tests/Tests/Walk.hs
+++ b/tests/Tests/Walk.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE ScopedTypeVariables, FlexibleContexts #-}
module Tests.Walk (tests) where
-import Prelude
import Text.Pandoc.Definition
import Text.Pandoc.Walk
import Test.Framework
diff --git a/tests/Tests/Writers/AsciiDoc.hs b/tests/Tests/Writers/AsciiDoc.hs
index 3ca3792e1..56a62c6e4 100644
--- a/tests/Tests/Writers/AsciiDoc.hs
+++ b/tests/Tests/Writers/AsciiDoc.hs
@@ -1,6 +1,5 @@
module Tests.Writers.AsciiDoc (tests) where
-import Prelude
import Test.Framework
import Text.Pandoc.Builder
import Text.Pandoc
diff --git a/tests/Tests/Writers/ConTeXt.hs b/tests/Tests/Writers/ConTeXt.hs
index b4e1e5317..8f0305adb 100644
--- a/tests/Tests/Writers/ConTeXt.hs
+++ b/tests/Tests/Writers/ConTeXt.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Tests.Writers.ConTeXt (tests) where
-import Prelude
import Test.Framework
import Text.Pandoc.Builder
import Text.Pandoc
diff --git a/tests/Tests/Writers/Docbook.hs b/tests/Tests/Writers/Docbook.hs
index 4543b26ad..97126b473 100644
--- a/tests/Tests/Writers/Docbook.hs
+++ b/tests/Tests/Writers/Docbook.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Tests.Writers.Docbook (tests) where
-import Prelude
import Test.Framework
import Text.Pandoc.Builder
import Text.Pandoc
diff --git a/tests/Tests/Writers/Docx.hs b/tests/Tests/Writers/Docx.hs
index 059003cc7..8dba0ea55 100644
--- a/tests/Tests/Writers/Docx.hs
+++ b/tests/Tests/Writers/Docx.hs
@@ -1,6 +1,5 @@
module Tests.Writers.Docx (tests) where
-import Prelude
import Text.Pandoc.Options
import Text.Pandoc.Readers.Native
import Text.Pandoc.Definition
diff --git a/tests/Tests/Writers/HTML.hs b/tests/Tests/Writers/HTML.hs
index 930aa7da9..84f4db191 100644
--- a/tests/Tests/Writers/HTML.hs
+++ b/tests/Tests/Writers/HTML.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Tests.Writers.HTML (tests) where
-import Prelude
import Test.Framework
import Text.Pandoc.Builder
import Text.Pandoc
diff --git a/tests/Tests/Writers/LaTeX.hs b/tests/Tests/Writers/LaTeX.hs
index 4f40ca80c..27931dc28 100644
--- a/tests/Tests/Writers/LaTeX.hs
+++ b/tests/Tests/Writers/LaTeX.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Tests.Writers.LaTeX (tests) where
-import Prelude
import Test.Framework
import Text.Pandoc.Builder
import Text.Pandoc
diff --git a/tests/Tests/Writers/Markdown.hs b/tests/Tests/Writers/Markdown.hs
index 40a0021b1..8ffd7a8c0 100644
--- a/tests/Tests/Writers/Markdown.hs
+++ b/tests/Tests/Writers/Markdown.hs
@@ -2,7 +2,6 @@
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
module Tests.Writers.Markdown (tests) where
-import Prelude
import Test.Framework
import Text.Pandoc.Builder
import Text.Pandoc
diff --git a/tests/Tests/Writers/Native.hs b/tests/Tests/Writers/Native.hs
index 469429298..9833bf5ae 100644
--- a/tests/Tests/Writers/Native.hs
+++ b/tests/Tests/Writers/Native.hs
@@ -1,6 +1,5 @@
module Tests.Writers.Native (tests) where
-import Prelude
import Test.Framework
import Text.Pandoc.Builder
import Text.Pandoc
diff --git a/tests/Tests/Writers/Plain.hs b/tests/Tests/Writers/Plain.hs
index 4b32f18eb..f8f1d3d90 100644
--- a/tests/Tests/Writers/Plain.hs
+++ b/tests/Tests/Writers/Plain.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Tests.Writers.Plain (tests) where
-import Prelude
import Test.Framework
import Text.Pandoc.Builder
import Text.Pandoc
diff --git a/tests/Tests/Writers/RST.hs b/tests/Tests/Writers/RST.hs
index 74b0dc674..b9e359dae 100644
--- a/tests/Tests/Writers/RST.hs
+++ b/tests/Tests/Writers/RST.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Tests.Writers.RST (tests) where
-import Prelude
import Test.Framework
import Text.Pandoc.Builder
import Text.Pandoc
diff --git a/tests/docx/dummy_item_after_list_item.docx b/tests/docx/dummy_item_after_list_item.docx
new file mode 100644
index 000000000..5e29b993c
--- /dev/null
+++ b/tests/docx/dummy_item_after_list_item.docx
Binary files differ
diff --git a/tests/docx/dummy_item_after_list_item.native b/tests/docx/dummy_item_after_list_item.native
new file mode 100644
index 000000000..3f6231932
--- /dev/null
+++ b/tests/docx/dummy_item_after_list_item.native
@@ -0,0 +1,3 @@
+[OrderedList (1,Decimal,Period)
+ [[Para [Str "One"]
+ ,Para [Str "Two",LineBreak,LineBreak,Str "Three"]]]]
diff --git a/tests/docx/dummy_item_after_paragraph.docx b/tests/docx/dummy_item_after_paragraph.docx
new file mode 100644
index 000000000..b0aee8843
--- /dev/null
+++ b/tests/docx/dummy_item_after_paragraph.docx
Binary files differ
diff --git a/tests/docx/dummy_item_after_paragraph.native b/tests/docx/dummy_item_after_paragraph.native
new file mode 100644
index 000000000..2e9b831c4
--- /dev/null
+++ b/tests/docx/dummy_item_after_paragraph.native
@@ -0,0 +1,3 @@
+[Para [Str "First",Space,Str "bullet",Space,Str "point",Space,Str "created",Space,Str "and",Space,Str "then",Space,Str "deleted"]
+,Para [Str "A",Space,Str "normal",Space,Str "paragraph"]
+,Para [Str "First",Space,Str "bullet",Space,Str "point",Space,Str "created",Space,Str "and",Space,Str "then",Space,Str "deleted",Space,Str "after",Space,Str "the",Space,Str "normal",Space,Str "paragraph"]]
diff --git a/tests/docx/link_in_notes.docx b/tests/docx/link_in_notes.docx
new file mode 100644
index 000000000..f3398f438
--- /dev/null
+++ b/tests/docx/link_in_notes.docx
Binary files differ
diff --git a/tests/docx/link_in_notes.native b/tests/docx/link_in_notes.native
new file mode 100644
index 000000000..bb2bbe8a2
--- /dev/null
+++ b/tests/docx/link_in_notes.native
@@ -0,0 +1 @@
+[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "test",Note [Para [Link [Str "http://wikipedia.org/"] ("http://wikipedia.org/","")]],Str "."]]
diff --git a/tests/lhs-test.latex b/tests/lhs-test.latex
index 0dfe323a9..f7b6eb2d7 100644
--- a/tests/lhs-test.latex
+++ b/tests/lhs-test.latex
@@ -24,12 +24,9 @@
}{}
\usepackage{hyperref}
\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
-\hypersetup{breaklinks=true,
- unicode=true, colorlinks=true,
- citecolor=black,
- urlcolor=black,
- linkcolor=black,
- pdfborder={0 0 0}}
+\hypersetup{unicode=true,
+ pdfborder={0 0 0},
+ breaklinks=true}
\urlstyle{same} % don't use monospace font for urls
\usepackage{color}
\usepackage{fancyvrb}
diff --git a/tests/lhs-test.latex+lhs b/tests/lhs-test.latex+lhs
index b025da64b..c9501a2cb 100644
--- a/tests/lhs-test.latex+lhs
+++ b/tests/lhs-test.latex+lhs
@@ -24,12 +24,9 @@
}{}
\usepackage{hyperref}
\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
-\hypersetup{breaklinks=true,
- unicode=true, colorlinks=true,
- citecolor=black,
- urlcolor=black,
- linkcolor=black,
- pdfborder={0 0 0}}
+\hypersetup{unicode=true,
+ pdfborder={0 0 0},
+ breaklinks=true}
\urlstyle{same} % don't use monospace font for urls
\usepackage{listings}
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
diff --git a/tests/test-pandoc.hs b/tests/test-pandoc.hs
index 1e048206a..f7c2f0c1f 100644
--- a/tests/test-pandoc.hs
+++ b/tests/test-pandoc.hs
@@ -2,7 +2,6 @@
module Main where
-import Prelude
import Test.Framework
import GHC.IO.Encoding
import qualified Tests.Old
diff --git a/tests/writer.context b/tests/writer.context
index a2427b363..1f8c3aff7 100644
--- a/tests/writer.context
+++ b/tests/writer.context
@@ -1,17 +1,19 @@
% Enable hyperlinks
\setupinteraction
[state=start,
- style=normal,
- color=black,
- contrastcolor=black,
- title=Pandoc Test Suite,
- author=John MacFarlane; Anonymous]
+ title={Pandoc Test Suite},
+ author={John MacFarlane; Anonymous},
+ style=,
+ color=,
+ contrastcolor=]
% make chapter, section bookmarks visible when opening document
\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]
\setupinteractionscreen[option=bookmark]
\setuptagging[state=start]
-\definefontfeature[default][default][protrusion=quality,expansion=quality,onum=yes] % use microtypography
+% use microtypography
+\definefontfeature[default][default][protrusion=quality,expansion=quality,onum=yes,pnum=yes]
+\definefontfeature[smallcaps][smallcaps][protrusion=quality,expansion=quality,onum=yes,pnum=yes]
\setupalign[hz,hanging]
\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted
\setupbodyfont[mainfont]
diff --git a/tests/writer.icml b/tests/writer.icml
index b6f5b5e32..cd71fa86b 100644
--- a/tests/writer.icml
+++ b/tests/writer.icml
@@ -1864,17 +1864,49 @@ These should not be escaped: \$ \\ \&gt; \[ \{</Content>
</ParagraphStyleRange>
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/BulList">
<CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
- <Content>2+2=4</Content>
+ <Content>2</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content> </Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content>+</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content> </Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content>2</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content> </Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content>=</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content> </Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content>4</Content>
</CharacterStyleRange><Br />
</ParagraphStyleRange>
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/BulList">
- <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
- <Content>x \in y</Content>
+ <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Italic">
+ <Content>x</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content> </Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content>∈</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content> </Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Italic">
+ <Content>y</Content>
</CharacterStyleRange><Br />
</ParagraphStyleRange>
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/BulList">
- <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
- <Content>\alpha \wedge \omega</Content>
+ <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Italic">
+ <Content>α</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content> </Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content>∧</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content> </Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Italic">
+ <Content>ω</Content>
</CharacterStyleRange><Br />
</ParagraphStyleRange>
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/BulList">
@@ -1883,7 +1915,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{</Content>
</CharacterStyleRange><Br />
</ParagraphStyleRange>
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/BulList">
- <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Italic">
<Content>p</Content>
</CharacterStyleRange>
<CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
@@ -1895,15 +1927,33 @@ These should not be escaped: \$ \\ \&gt; \[ \{</Content>
<Content>Here’s some display math: </Content>
</CharacterStyleRange>
<CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
- <Content>\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}</Content>
+ <Content>$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$</Content>
</CharacterStyleRange><Br />
</ParagraphStyleRange>
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/BulList">
<CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
<Content>Here’s one that has a line break in it: </Content>
</CharacterStyleRange>
- <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
- <Content>\alpha + \omega \times x^2</Content>
+ <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Italic">
+ <Content>α</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content> </Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content>+</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content> </Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Italic">
+ <Content>ω</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content> </Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content>×</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+ <Content> </Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Italic">
+ <Content>x</Content>
+ </CharacterStyleRange><CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Superscript">
+ <Content>2</Content>
</CharacterStyleRange>
<CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
<Content>.</Content>
diff --git a/tests/writer.latex b/tests/writer.latex
index 32f200a27..ceee122a4 100644
--- a/tests/writer.latex
+++ b/tests/writer.latex
@@ -24,12 +24,11 @@
}{}
\usepackage{hyperref}
\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
-\hypersetup{breaklinks=true,
- unicode=true, pdftitle={Pandoc Test Suite}, pdfauthor={John MacFarlane; Anonymous}, colorlinks=true,
- citecolor=black,
- urlcolor=black,
- linkcolor=black,
- pdfborder={0 0 0}}
+\hypersetup{unicode=true,
+ pdftitle={Pandoc Test Suite},
+ pdfauthor={John MacFarlane; Anonymous},
+ pdfborder={0 0 0},
+ breaklinks=true}
\urlstyle{same} % don't use monospace font for urls
\usepackage{fancyvrb}
\VerbatimFootnotes % allows verbatim text in footnotes
diff --git a/tests/writers-lang-and-dir.context b/tests/writers-lang-and-dir.context
index 477b808a6..a324c13f5 100644
--- a/tests/writers-lang-and-dir.context
+++ b/tests/writers-lang-and-dir.context
@@ -1,15 +1,17 @@
% Enable hyperlinks
\setupinteraction
[state=start,
- style=normal,
- color=black,
- contrastcolor=black]
+ style=,
+ color=,
+ contrastcolor=]
% make chapter, section bookmarks visible when opening document
\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]
\setupinteractionscreen[option=bookmark]
\setuptagging[state=start]
-\definefontfeature[default][default][protrusion=quality,expansion=quality,onum=yes] % use microtypography
+% use microtypography
+\definefontfeature[default][default][protrusion=quality,expansion=quality,onum=yes,pnum=yes]
+\definefontfeature[smallcaps][smallcaps][protrusion=quality,expansion=quality,onum=yes,pnum=yes]
\setupalign[hz,hanging]
\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted
\setupbodyfont[mainfont]
diff --git a/tests/writers-lang-and-dir.latex b/tests/writers-lang-and-dir.latex
index 93b9ceeb5..3f4ecd5e3 100644
--- a/tests/writers-lang-and-dir.latex
+++ b/tests/writers-lang-and-dir.latex
@@ -24,12 +24,9 @@
}{}
\usepackage{hyperref}
\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
-\hypersetup{breaklinks=true,
- unicode=true, colorlinks=true,
- citecolor=black,
- urlcolor=black,
- linkcolor=black,
- pdfborder={0 0 0}}
+\hypersetup{unicode=true,
+ pdfborder={0 0 0},
+ breaklinks=true}
\urlstyle{same} % don't use monospace font for urls
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[shorthands=off,ngerman,british,ngerman,spanish,french,main=english]{babel}
diff --git a/trypandoc/Makefile b/trypandoc/Makefile
index 29942ac00..b53758d7f 100644
--- a/trypandoc/Makefile
+++ b/trypandoc/Makefile
@@ -1,7 +1,7 @@
CGIBIN=/home/website/cgi-bin
TRYPANDOC=/home/website/html/pandoc/try/
CGI=${CGIBIN}/trypandoc
-BIN=../dist/build/trypandoc/trypandoc
+BIN=../.cabal-sandbox/bin/trypandoc
install: ${CGI} ${TRYPANDOC}/index.html
diff --git a/windows/make-windows-installer.bat b/windows/make-windows-installer.bat
index cac5d974b..c7befe531 100644
--- a/windows/make-windows-installer.bat
+++ b/windows/make-windows-installer.bat
@@ -1,20 +1,15 @@
@echo off
-cd ..
-cabal update
-cabal sandbox init
-cabal clean
-cabal install hsb2hs
+stack install --test
if %errorlevel% neq 0 exit /b %errorlevel%
-cabal install -v1 --force --reinstall --flags="embed_data_files" . pandoc-citeproc
+for /f "delims=" %%a in ('stack path --local-bin-path') do @set BINPATH=%%a
+strip %BINPATH%\pandoc.exe
+strip %BINPATH%\pandoc-citeproc.exe
+%BINPATH%\pandoc.exe -s -S ..\README -o README.html
if %errorlevel% neq 0 exit /b %errorlevel%
-strip .\.cabal-sandbox\bin\pandoc.exe
-strip .\.cabal-sandbox\bin\pandoc-citeproc.exe
-.\.cabal-sandbox\bin\pandoc.exe -s --template data\templates\default.html -S README -o README.html
+%BINPATH%\pandoc.exe -s ..\COPYING -t rtf -S -o COPYING.rtf
if %errorlevel% neq 0 exit /b %errorlevel%
-.\.cabal-sandbox\bin\pandoc.exe -s --template data\templates\default.rtf COPYING -t rtf -S -o COPYING.rtf
-if %errorlevel% neq 0 exit /b %errorlevel%
-copy COPYRIGHT COPYRIGHT.txt
-for /f "tokens=1-2 delims= " %%a in ('.\.cabal-sandbox\bin\pandoc --version') do (
+copy ..\COPYRIGHT COPYRIGHT.txt
+for /f "tokens=1-2 delims= " %%a in ('%BINPATH%\pandoc.exe --version') do (
@set VERSION=%%b
goto :next
)
@@ -24,9 +19,8 @@ if "%VERSION%" == "" (
exit /b 1
)
echo Detected version %VERSION%
-cd windows
echo Creating msi...
-candle -dVERSION=%VERSION% pandoc.wxs
+candle -dVERSION=%VERSION% -dBINPATH=%BINPATH% pandoc.wxs
if %errorlevel% neq 0 exit /b %errorlevel%
light -sw1076 -ext WixUIExtension -ext WixUtilExtension -out pandoc-%VERSION%-windows.msi pandoc.wixobj
if %errorlevel% neq 0 exit /b %errorlevel%
diff --git a/windows/pandoc.wxs b/windows/pandoc.wxs
index c1465ffcf..d19ed81e1 100644
--- a/windows/pandoc.wxs
+++ b/windows/pandoc.wxs
@@ -41,11 +41,11 @@
KeyPath="yes"/>
<RemoveFolder Id="APPLICATIONFOLDER" On="uninstall"/>
<File Id="pandocEXE" Name="pandoc.exe"
- Source="..\.cabal-sandbox\bin\pandoc.exe" />
+ Source="$(var.BINPATH)\pandoc.exe" />
<File Id="pandocCOPYRIGHT" Name="COPYRIGHT.txt"
- Source="..\COPYRIGHT.txt" />
+ Source="COPYRIGHT.txt" />
<File Id="pandocCOPYING" Name="COPYING.rtf"
- Source="..\COPYING.rtf" />
+ Source="COPYING.rtf" />
</Component>
<Component Id="CitationSupport"
@@ -55,13 +55,13 @@
Name="Version" Type="string" Value="[ProductVersion]"
KeyPath="yes"/>
<File Id="pandoc_citeprocEXE" Name="pandoc-citeproc.exe"
- Source="..\.cabal-sandbox\bin\pandoc-citeproc.exe" />
+ Source="$(var.BINPATH)\pandoc-citeproc.exe" />
</Component>
<Component Id="Documentation"
Guid="A8D54A76-1A3D-4647-8327-81B69D39D8A3">
<File Id="pandocREADME" Name="Pandoc User's Guide.html"
- Source="..\README.html" KeyPath="yes">
+ Source="README.html" KeyPath="yes">
<Shortcut Id="ApplicationStartMenuShortcut"
Directory="ApplicationProgramsFolder"
Name="Pandoc User’s Guide" Advertise="yes" />
@@ -163,7 +163,7 @@
<Property Id="ALLUSERS" Value="2" Secure="yes" />
<Property Id="MSIINSTALLPERUSER" Value="1" />
- <WixVariable Id="WixUILicenseRtf" Value="..\COPYING.rtf" />
+ <WixVariable Id="WixUILicenseRtf" Value="COPYING.rtf" />
<UI Id="MyWixUI_Advanced">
<UIRef Id="WixUI_Advanced" />
diff --git a/windows/stack.yaml b/windows/stack.yaml
new file mode 100644
index 000000000..4a00e2d38
--- /dev/null
+++ b/windows/stack.yaml
@@ -0,0 +1,19 @@
+flags:
+ pandoc:
+ trypandoc: false
+ https: true
+ embed_data_files: true
+ old-locale: false
+ network-uri: true
+ pandoc-citeproc:
+ bibutils: true
+ embed_data_files: true
+ unicode_collation: false
+ test_citeproc: false
+ debug: false
+packages:
+- '..'
+- '../../pandoc-citeproc'
+extra-deps:
+- 'hsb2hs-0.3.1'
+resolver: lts-3.13