pandoc 1.13.1 → 3.10
raw patch · 2741 files changed
This diff is very large; some files are shown as “too large to diff”. Download the raw patch for the complete diff.
Files
- AUTHORS.md +540/−0
- CONTRIBUTING.md +351/−50
- COPYING +0/−346
- COPYING.md +360/−0
- COPYRIGHT +168/−27
- INSTALL +0/−203
- INSTALL.md +424/−0
- MANUAL.txt +8054/−0
- Makefile +0/−60
- README +0/−3179
- README.md +300/−0
- Setup.hs +0/−51
- benchmark/benchmark-pandoc.hs +80/−32
- changelog +0/−7362
- changelog.md +29619/−0
- citeproc/biblatex-localization/UKenglish.lbx.strings +0/−0
- citeproc/biblatex-localization/USenglish.lbx.strings +0/−0
- citeproc/biblatex-localization/american.lbx.strings +0/−0
- citeproc/biblatex-localization/australian.lbx.strings +0/−0
- citeproc/biblatex-localization/austrian.lbx.strings +1/−0
- citeproc/biblatex-localization/brazil.lbx.strings +0/−0
- citeproc/biblatex-localization/brazilian.lbx.strings +233/−0
- citeproc/biblatex-localization/british.lbx.strings +3/−0
- citeproc/biblatex-localization/bulgarian.lbx.strings +28/−0
- citeproc/biblatex-localization/canadian.lbx.strings +0/−0
- citeproc/biblatex-localization/catalan.lbx.strings +158/−0
- citeproc/biblatex-localization/croatian.lbx.strings +214/−0
- citeproc/biblatex-localization/czech.lbx.strings +91/−0
- citeproc/biblatex-localization/danish.lbx.strings +106/−0
- citeproc/biblatex-localization/dutch.lbx.strings +23/−0
- citeproc/biblatex-localization/english.lbx.strings +254/−0
- citeproc/biblatex-localization/estonian.lbx.strings +178/−0
- citeproc/biblatex-localization/finnish.lbx.strings +254/−0
- citeproc/biblatex-localization/french.lbx.strings +245/−0
- citeproc/biblatex-localization/galician.lbx.strings +28/−0
- citeproc/biblatex-localization/german.lbx.strings +28/−0
- citeproc/biblatex-localization/greek.lbx.strings +9/−0
- citeproc/biblatex-localization/hungarian.lbx.strings +0/−0
- citeproc/biblatex-localization/icelandic.lbx.strings +7/−0
- citeproc/biblatex-localization/italian.lbx.strings +9/−0
- citeproc/biblatex-localization/latvian.lbx.strings +75/−0
- citeproc/biblatex-localization/lithuanian.lbx.strings +31/−0
- citeproc/biblatex-localization/magyar.lbx.strings +29/−0
- citeproc/biblatex-localization/naustrian.lbx.strings +2/−0
- citeproc/biblatex-localization/newzealand.lbx.strings +0/−0
- citeproc/biblatex-localization/ngerman.lbx.strings +1/−0
- citeproc/biblatex-localization/norsk.lbx.strings +98/−0
- citeproc/biblatex-localization/nswissgerman.lbx.strings +2/−0
- citeproc/biblatex-localization/nynorsk.lbx.strings +28/−0
- citeproc/biblatex-localization/polish.lbx.strings +100/−0
- citeproc/biblatex-localization/portuges.lbx.strings +0/−0
- citeproc/biblatex-localization/portuguese.lbx.strings +95/−0
- citeproc/biblatex-localization/russian.lbx.strings +102/−0
- citeproc/biblatex-localization/serbian.lbx.strings +0/−0
- citeproc/biblatex-localization/serbianc.lbx.strings +0/−0
- citeproc/biblatex-localization/slovak.lbx.strings +82/−0
- citeproc/biblatex-localization/slovene.lbx.strings +28/−0
- citeproc/biblatex-localization/slovenian.lbx.strings +0/−0
- citeproc/biblatex-localization/spanish.lbx.strings +190/−0
- citeproc/biblatex-localization/swedish.lbx.strings +9/−0
- citeproc/biblatex-localization/swissgerman.lbx.strings +1/−0
- citeproc/biblatex-localization/turkish.lbx.strings +157/−0
- citeproc/biblatex-localization/ukrainian.lbx.strings +102/−0
- data/LaTeXMathML.js +0/−198
- data/MathMLinHTML.js +0/−70
- data/abbreviations +80/−0
- data/bash_completion.tpl +90/−0
- data/creole.lua +190/−0
- data/default.csl +3933/−0
- data/docbook-entities.txt +2237/−0
- data/docx/[Content_Types].xml +2/−0
- data/docx/_rels/.rels +3/−0
- data/docx/docProps/app.xml +18/−0
- data/docx/docProps/core.xml +2/−0
- data/docx/docProps/custom.xml +2/−0
- data/docx/word/_rels/document.xml.rels +2/−0
- data/docx/word/_rels/footnotes.xml.rels +2/−0
- data/docx/word/comments.xml +2/−0
- data/docx/word/document.xml +330/−0
- data/docx/word/fontTable.xml +52/−0
- data/docx/word/footnotes.xml +21/−0
- data/docx/word/numbering.xml +2/−0
- data/docx/word/settings.xml +37/−0
- data/docx/word/styles.xml +714/−0
- data/docx/word/theme/theme1.xml +293/−0
- data/docx/word/webSettings.xml +5/−0
- data/dzslides/template.html +128/−30
- data/epub.css +215/−12
- data/init.lua +3/−0
- data/odt/META-INF/manifest.xml +8/−0
- data/odt/content.xml +82/−0
- data/odt/manifest.rdf +18/−0
- data/odt/meta.xml +18/−0
- data/odt/mimetype +1/−0
- data/odt/styles.xml +1171/−0
- data/pptx/[Content_Types].xml +2/−0
- data/pptx/_rels/.rels +2/−0
- data/pptx/docProps/app.xml +2/−0
- data/pptx/docProps/core.xml +2/−0
- data/pptx/ppt/_rels/presentation.xml.rels +2/−0
- data/pptx/ppt/notesMasters/_rels/notesMaster1.xml.rels +2/−0
- data/pptx/ppt/notesMasters/notesMaster1.xml +2/−0
- data/pptx/ppt/notesSlides/_rels/notesSlide1.xml.rels +2/−0
- data/pptx/ppt/notesSlides/_rels/notesSlide2.xml.rels +2/−0
- data/pptx/ppt/notesSlides/notesSlide1.xml +2/−0
- data/pptx/ppt/notesSlides/notesSlide2.xml +2/−0
- data/pptx/ppt/presProps.xml +2/−0
- data/pptx/ppt/presentation.xml +2/−0
- data/pptx/ppt/slideLayouts/_rels/slideLayout1.xml.rels +2/−0
- data/pptx/ppt/slideLayouts/_rels/slideLayout10.xml.rels +2/−0
- data/pptx/ppt/slideLayouts/_rels/slideLayout11.xml.rels +2/−0
- data/pptx/ppt/slideLayouts/_rels/slideLayout2.xml.rels +2/−0
- data/pptx/ppt/slideLayouts/_rels/slideLayout3.xml.rels +2/−0
- data/pptx/ppt/slideLayouts/_rels/slideLayout4.xml.rels +2/−0
- data/pptx/ppt/slideLayouts/_rels/slideLayout5.xml.rels +2/−0
- data/pptx/ppt/slideLayouts/_rels/slideLayout6.xml.rels +2/−0
- data/pptx/ppt/slideLayouts/_rels/slideLayout7.xml.rels +2/−0
- data/pptx/ppt/slideLayouts/_rels/slideLayout8.xml.rels +2/−0
- data/pptx/ppt/slideLayouts/_rels/slideLayout9.xml.rels +2/−0
- data/pptx/ppt/slideLayouts/slideLayout1.xml +2/−0
- data/pptx/ppt/slideLayouts/slideLayout10.xml +2/−0
- data/pptx/ppt/slideLayouts/slideLayout11.xml +2/−0
- data/pptx/ppt/slideLayouts/slideLayout2.xml +2/−0
- data/pptx/ppt/slideLayouts/slideLayout3.xml +2/−0
- data/pptx/ppt/slideLayouts/slideLayout4.xml +2/−0
- data/pptx/ppt/slideLayouts/slideLayout5.xml +2/−0
- data/pptx/ppt/slideLayouts/slideLayout6.xml +2/−0
- data/pptx/ppt/slideLayouts/slideLayout7.xml +2/−0
- data/pptx/ppt/slideLayouts/slideLayout8.xml +2/−0
- data/pptx/ppt/slideLayouts/slideLayout9.xml +2/−0
- data/pptx/ppt/slideMasters/_rels/slideMaster1.xml.rels +2/−0
- data/pptx/ppt/slideMasters/slideMaster1.xml +2/−0
- data/pptx/ppt/slides/_rels/slide1.xml.rels +2/−0
- data/pptx/ppt/slides/_rels/slide2.xml.rels +2/−0
- data/pptx/ppt/slides/_rels/slide3.xml.rels +2/−0
- data/pptx/ppt/slides/_rels/slide4.xml.rels +2/−0
- data/pptx/ppt/slides/slide1.xml +2/−0
- data/pptx/ppt/slides/slide2.xml +2/−0
- data/pptx/ppt/slides/slide3.xml +2/−0
- data/pptx/ppt/slides/slide4.xml +2/−0
- data/pptx/ppt/tableStyles.xml +2/−0
- data/pptx/ppt/theme/theme1.xml +2/−0
- data/pptx/ppt/theme/theme2.xml +2/−0
- data/pptx/ppt/viewProps.xml +2/−0
- data/reference.docx binary
- data/reference.odt binary
- data/sample.lua +0/−314
- data/templates/affiliations.jats +36/−0
- data/templates/after-header-includes.latex +10/−0
- data/templates/article.jats_publishing +252/−0
- data/templates/common.latex +263/−0
- data/templates/default.ansi +21/−0
- data/templates/default.asciidoc +22/−5
- data/templates/default.bbcode +1/−0
- data/templates/default.beamer +139/−112
- data/templates/default.biblatex +10/−0
- data/templates/default.bibtex +10/−0
- data/templates/default.chunkedhtml +103/−0
- data/templates/default.commonmark +21/−0
- data/templates/default.context +158/−40
- data/templates/default.djot +27/−0
- data/templates/default.docbook +0/−32
- data/templates/default.docbook4 +32/−0
- data/templates/default.docbook5 +37/−0
- data/templates/default.dzslides +110/−41
- data/templates/default.epub +0/−35
- data/templates/default.epub2 +77/−0
- data/templates/default.epub3 +52/−15
- data/templates/default.html +0/−61
- data/templates/default.html4 +70/−0
- data/templates/default.html5 +33/−27
- data/templates/default.icml +8/−3
- data/templates/default.jats_archiving +7/−0
- data/templates/default.jats_articleauthoring +109/−0
- data/templates/default.jats_publishing +7/−0
- data/templates/default.jira +9/−0
- data/templates/default.latex +85/−132
- data/templates/default.man +9/−2
- data/templates/default.markdown +1/−1
- data/templates/default.markua +21/−0
- data/templates/default.ms +124/−0
- data/templates/default.muse +44/−0
- data/templates/default.opendocument +138/−3
- data/templates/default.openxml +65/−0
- data/templates/default.org +14/−3
- data/templates/default.plain +1/−1
- data/templates/default.revealjs +302/−57
- data/templates/default.rst +43/−13
- data/templates/default.rtf +2/−2
- data/templates/default.s5 +26/−13
- data/templates/default.slideous +18/−6
- data/templates/default.slidy +19/−7
- data/templates/default.tei +51/−0
- data/templates/default.texinfo +11/−23
- data/templates/default.typst +154/−0
- data/templates/default.vimdoc +16/−0
- data/templates/default.xwiki +13/−0
- data/templates/default.zimwiki +16/−0
- data/templates/document-metadata.latex +20/−0
- data/templates/font-settings.latex +103/−0
- data/templates/fonts.latex +23/−0
- data/templates/hypersetup.latex +34/−0
- data/templates/passoptions.latex +9/−0
- data/templates/styles.citations.html +23/−0
- data/templates/styles.html +216/−0
- data/templates/template.typst +120/−0
- data/translations/af.yaml +20/−0
- data/translations/alt.yaml +5/−0
- data/translations/am.yaml +20/−0
- data/translations/ar.yaml +21/−0
- data/translations/as.yaml +21/−0
- data/translations/ast.yaml +21/−0
- data/translations/az.yaml +21/−0
- data/translations/be.yaml +21/−0
- data/translations/bg.yaml +21/−0
- data/translations/bn.yaml +21/−0
- data/translations/bo.yaml +14/−0
- data/translations/br.yaml +21/−0
- data/translations/bs.yaml +21/−0
- data/translations/bua.yaml +17/−0
- data/translations/ca.yaml +21/−0
- data/translations/ckb-Arab.yaml +21/−0
- data/translations/ckb-Latn.yaml +21/−0
- data/translations/cs.yaml +21/−0
- data/translations/cu.yaml +21/−0
- data/translations/cy.yaml +21/−0
- data/translations/cz.yaml +21/−0
- data/translations/da.yaml +21/−0
- data/translations/de.yaml +22/−0
- data/translations/dsb.yaml +21/−0
- data/translations/el.yaml +21/−0
- data/translations/en.yaml +22/−0
- data/translations/eo.yaml +21/−0
- data/translations/es-ES.yaml +21/−0
- data/translations/es-MX.yaml +21/−0
- data/translations/es.yaml +21/−0
- data/translations/et.yaml +22/−0
- data/translations/eu.yaml +21/−0
- data/translations/fa.yaml +21/−0
- data/translations/fi.yaml +21/−0
- data/translations/fil.yaml +18/−0
- data/translations/fr.yaml +20/−0
- data/translations/fur.yaml +21/−0
- data/translations/ga.yaml +21/−0
- data/translations/gd.yaml +21/−0
- data/translations/gl.yaml +21/−0
- data/translations/grc.yaml +21/−0
- data/translations/gu.yaml +9/−0
- data/translations/ha.yaml +21/−0
- data/translations/he.yaml +21/−0
- data/translations/hi.yaml +18/−0
- data/translations/hr.yaml +21/−0
- data/translations/hsb.yaml +21/−0
- data/translations/hu.yaml +21/−0
- data/translations/hy.yaml +20/−0
- data/translations/ia.yaml +21/−0
- data/translations/id.yaml +21/−0
- data/translations/is.yaml +21/−0
- data/translations/it.yaml +21/−0
- data/translations/ja.yaml +21/−0
- data/translations/ka.yaml +21/−0
- data/translations/km.yaml +21/−0
- data/translations/kmr-Arab.yaml +21/−0
- data/translations/kmr-Latn.yaml +21/−0
- data/translations/kn.yaml +20/−0
- data/translations/ko.yaml +17/−0
- data/translations/la.yaml +20/−0
- data/translations/lb.yaml +21/−0
- data/translations/lo.yaml +21/−0
- data/translations/lt.yaml +21/−0
- data/translations/lv.yaml +20/−0
- data/translations/mk.yaml +21/−0
- data/translations/ml.yaml +12/−0
- data/translations/mn.yaml +19/−0
- data/translations/mr.yaml +21/−0
- data/translations/ms.yaml +21/−0
- data/translations/nb.yaml +21/−0
- data/translations/nko.yaml +21/−0
- data/translations/nl.yaml +21/−0
- data/translations/nn.yaml +21/−0
- data/translations/no.yaml +21/−0
- data/translations/oc.yaml +21/−0
- data/translations/or.yaml +21/−0
- data/translations/pa.yaml +20/−0
- data/translations/pl.yaml +21/−0
- data/translations/pms.yaml +21/−0
- data/translations/pt-BR.yaml +21/−0
- data/translations/pt-PT.yaml +21/−0
- data/translations/pt.yaml +21/−0
- data/translations/rm.yaml +21/−0
- data/translations/ro.yaml +21/−0
- data/translations/ru.yaml +21/−0
- data/translations/se.yaml +21/−0
- data/translations/si.yaml +21/−0
- data/translations/sk.yaml +21/−0
- data/translations/sl.yaml +21/−0
- data/translations/sq.yaml +21/−0
- data/translations/sr-Cyrl.yaml +21/−0
- data/translations/sr-Latn.yaml +21/−0
- data/translations/sr.yaml +21/−0
- data/translations/sv.yaml +21/−0
- data/translations/ta.yaml +11/−0
- data/translations/te.yaml +21/−0
- data/translations/th.yaml +20/−0
- data/translations/tk.yaml +21/−0
- data/translations/tr.yaml +21/−0
- data/translations/ua.yaml +22/−0
- data/translations/ug.yaml +21/−0
- data/translations/uk.yaml +21/−0
- data/translations/ur.yaml +21/−0
- data/translations/vi.yaml +21/−0
- data/translations/zh-Hans.yaml +22/−0
- data/translations/zh-Hant.yaml +22/−0
- man/make-pandoc-man-pages.hs +0/−104
- man/man1/pandoc.1 +0/−1766
- man/man1/pandoc.1.template +0/−16
- man/man5/pandoc_markdown.5 +0/−2420
- man/man5/pandoc_markdown.5.template +0/−11
- pandoc.cabal +933/−459
- pandoc.hs +0/−1314
- src/Text/Pandoc.hs +37/−320
- src/Text/Pandoc/App.hs +427/−0
- src/Text/Pandoc/App/CommandLineOptions.hs +1315/−0
- src/Text/Pandoc/App/Input.hs +138/−0
- src/Text/Pandoc/App/Opt.hs +921/−0
- src/Text/Pandoc/App/OutputSettings.hs +343/−0
- src/Text/Pandoc/Asciify.hs +18/−408
- src/Text/Pandoc/CSS.hs +55/−0
- src/Text/Pandoc/CSV.hs +91/−0
- src/Text/Pandoc/Char.hs +59/−0
- src/Text/Pandoc/Chunks.hs +444/−0
- src/Text/Pandoc/Citeproc.hs +667/−0
- src/Text/Pandoc/Citeproc/BibTeX.hs +1374/−0
- src/Text/Pandoc/Citeproc/CslJson.hs +42/−0
- src/Text/Pandoc/Citeproc/Data.hs +32/−0
- src/Text/Pandoc/Citeproc/Locator.hs +334/−0
- src/Text/Pandoc/Citeproc/MetaValue.hs +251/−0
- src/Text/Pandoc/Citeproc/Name.hs +153/−0
- src/Text/Pandoc/Citeproc/Util.hs +82/−0
- src/Text/Pandoc/Class.hs +33/−0
- src/Text/Pandoc/Class/CommonState.hs +95/−0
- src/Text/Pandoc/Class/IO.hs +296/−0
- src/Text/Pandoc/Class/PandocIO.hs +79/−0
- src/Text/Pandoc/Class/PandocMonad.hs +603/−0
- src/Text/Pandoc/Class/PandocPure.hs +241/−0
- src/Text/Pandoc/Class/Sandbox.hs +61/−0
- src/Text/Pandoc/Compat/Directory.hs +0/−21
- src/Text/Pandoc/Compat/Except.hs +0/−37
- src/Text/Pandoc/Compat/Monoid.hs +0/−20
- src/Text/Pandoc/Compat/TagSoupEntity.hs +0/−15
- src/Text/Pandoc/Data.hs +245/−0
- src/Text/Pandoc/Data.hsb +0/−7
- src/Text/Pandoc/Data/BakedIn.hs +32/−0
- src/Text/Pandoc/Emoji.hs +24/−0
- src/Text/Pandoc/Error.hs +208/−0
- src/Text/Pandoc/Extensions.hs +668/−0
- src/Text/Pandoc/Filter.hs +118/−0
- src/Text/Pandoc/Filter/Environment.hs +27/−0
- src/Text/Pandoc/Filter/JSON.hs +82/−0
- src/Text/Pandoc/Format.hs +251/−0
- src/Text/Pandoc/Highlighting.hs +241/−103
- src/Text/Pandoc/Image.hs +38/−0
- src/Text/Pandoc/ImageSize.hs +591/−335
- src/Text/Pandoc/Logging.hs +505/−0
- src/Text/Pandoc/MIME.hs +69/−314
- src/Text/Pandoc/MediaBag.hs +89/−64
- src/Text/Pandoc/Options.hs +370/−281
- src/Text/Pandoc/PDF.hs +609/−137
- src/Text/Pandoc/Parsing.hs +355/−1225
- src/Text/Pandoc/Parsing/Capabilities.hs +137/−0
- src/Text/Pandoc/Parsing/Citations.hs +57/−0
- src/Text/Pandoc/Parsing/Future.hs +49/−0
- src/Text/Pandoc/Parsing/General.hs +763/−0
- src/Text/Pandoc/Parsing/GridTable.hs +308/−0
- src/Text/Pandoc/Parsing/Lists.hs +217/−0
- src/Text/Pandoc/Parsing/Math.hs +102/−0
- src/Text/Pandoc/Parsing/Smart.hs +179/−0
- src/Text/Pandoc/Parsing/State.hs +189/−0
- src/Text/Pandoc/Pretty.hs +0/−534
- src/Text/Pandoc/Process.hs +71/−63
- src/Text/Pandoc/Readers.hs +210/−0
- src/Text/Pandoc/Readers/AsciiDoc.hs +416/−0
- src/Text/Pandoc/Readers/BibTeX.hs +78/−0
- src/Text/Pandoc/Readers/CSV.hs +73/−0
- src/Text/Pandoc/Readers/CommonMark.hs +196/−0
- src/Text/Pandoc/Readers/Creole.hs +295/−0
- src/Text/Pandoc/Readers/CslJson.hs +54/−0
- src/Text/Pandoc/Readers/Djot.hs +273/−0
- src/Text/Pandoc/Readers/DocBook.hs +1502/−976
- src/Text/Pandoc/Readers/Docx.hs +923/−568
- src/Text/Pandoc/Readers/Docx/Combine.hs +189/−0
- src/Text/Pandoc/Readers/Docx/Fields.hs +167/−0
- src/Text/Pandoc/Readers/Docx/Fonts.hs +0/−238
- src/Text/Pandoc/Readers/Docx/Lists.hs +111/−105
- src/Text/Pandoc/Readers/Docx/Parse.hs +1502/−813
- src/Text/Pandoc/Readers/Docx/Parse/Styles.hs +352/−0
- src/Text/Pandoc/Readers/Docx/Reducible.hs +0/−182
- src/Text/Pandoc/Readers/Docx/Symbols.hs +1085/−0
- src/Text/Pandoc/Readers/Docx/Util.hs +45/−0
- src/Text/Pandoc/Readers/DokuWiki.hs +571/−0
- src/Text/Pandoc/Readers/EPUB.hs too large to diff
- src/Text/Pandoc/Readers/EndNote.hs too large to diff
- src/Text/Pandoc/Readers/FB2.hs too large to diff
- src/Text/Pandoc/Readers/HTML.hs too large to diff
- src/Text/Pandoc/Readers/HTML/Parsing.hs too large to diff
- src/Text/Pandoc/Readers/HTML/Table.hs too large to diff
- src/Text/Pandoc/Readers/HTML/TagCategories.hs too large to diff
- src/Text/Pandoc/Readers/HTML/Types.hs too large to diff
- src/Text/Pandoc/Readers/Haddock.hs too large to diff
- src/Text/Pandoc/Readers/Ipynb.hs too large to diff
- src/Text/Pandoc/Readers/JATS.hs too large to diff
- src/Text/Pandoc/Readers/Jira.hs too large to diff
- src/Text/Pandoc/Readers/LaTeX.hs too large to diff
- src/Text/Pandoc/Readers/LaTeX/Citation.hs too large to diff
- src/Text/Pandoc/Readers/LaTeX/Inline.hs too large to diff
- src/Text/Pandoc/Readers/LaTeX/Lang.hs too large to diff
- src/Text/Pandoc/Readers/LaTeX/Macro.hs too large to diff
- src/Text/Pandoc/Readers/LaTeX/Math.hs too large to diff
- src/Text/Pandoc/Readers/LaTeX/Parsing.hs too large to diff
- src/Text/Pandoc/Readers/LaTeX/SIunitx.hs too large to diff
- src/Text/Pandoc/Readers/LaTeX/Table.hs too large to diff
- src/Text/Pandoc/Readers/Man.hs too large to diff
- src/Text/Pandoc/Readers/Markdown.hs too large to diff
- src/Text/Pandoc/Readers/Mdoc.hs too large to diff
- src/Text/Pandoc/Readers/Mdoc/Lex.hs too large to diff
- src/Text/Pandoc/Readers/Mdoc/Macros.hs too large to diff
- src/Text/Pandoc/Readers/Mdoc/Standards.hs too large to diff
- src/Text/Pandoc/Readers/MediaWiki.hs too large to diff
- src/Text/Pandoc/Readers/Metadata.hs too large to diff
- src/Text/Pandoc/Readers/Muse.hs too large to diff
- src/Text/Pandoc/Readers/Native.hs too large to diff
- src/Text/Pandoc/Readers/ODT.hs too large to diff
- src/Text/Pandoc/Readers/ODT/Arrows/State.hs too large to diff
- src/Text/Pandoc/Readers/ODT/Arrows/Utils.hs too large to diff
- src/Text/Pandoc/Readers/ODT/Base.hs too large to diff
- src/Text/Pandoc/Readers/ODT/ContentReader.hs too large to diff
- src/Text/Pandoc/Readers/ODT/Generic/Fallible.hs too large to diff
- src/Text/Pandoc/Readers/ODT/Generic/Namespaces.hs too large to diff
- src/Text/Pandoc/Readers/ODT/Generic/SetMap.hs too large to diff
- src/Text/Pandoc/Readers/ODT/Generic/Utils.hs too large to diff
- src/Text/Pandoc/Readers/ODT/Generic/XMLConverter.hs too large to diff
- src/Text/Pandoc/Readers/ODT/Namespaces.hs too large to diff
- src/Text/Pandoc/Readers/ODT/StyleReader.hs too large to diff
- src/Text/Pandoc/Readers/OOXML/Shared.hs too large to diff
- src/Text/Pandoc/Readers/OPML.hs too large to diff
- src/Text/Pandoc/Readers/Org.hs too large to diff
- src/Text/Pandoc/Readers/Org/BlockStarts.hs too large to diff
- src/Text/Pandoc/Readers/Org/Blocks.hs too large to diff
- src/Text/Pandoc/Readers/Org/DocumentTree.hs too large to diff
- src/Text/Pandoc/Readers/Org/ExportSettings.hs too large to diff
- src/Text/Pandoc/Readers/Org/Inlines.hs too large to diff
- src/Text/Pandoc/Readers/Org/Meta.hs too large to diff
- src/Text/Pandoc/Readers/Org/ParserState.hs too large to diff
- src/Text/Pandoc/Readers/Org/Parsing.hs too large to diff
- src/Text/Pandoc/Readers/Org/Shared.hs too large to diff
- src/Text/Pandoc/Readers/Pod.hs too large to diff
- src/Text/Pandoc/Readers/Pptx.hs too large to diff
- src/Text/Pandoc/Readers/Pptx/Parse.hs too large to diff
- src/Text/Pandoc/Readers/Pptx/Shapes.hs too large to diff
- src/Text/Pandoc/Readers/Pptx/Slides.hs too large to diff
- src/Text/Pandoc/Readers/Pptx/SmartArt.hs too large to diff
- src/Text/Pandoc/Readers/RIS.hs too large to diff
- src/Text/Pandoc/Readers/RST.hs too large to diff
- src/Text/Pandoc/Readers/RTF.hs too large to diff
- src/Text/Pandoc/Readers/Roff.hs too large to diff
- src/Text/Pandoc/Readers/Roff/Escape.hs too large to diff
- src/Text/Pandoc/Readers/TWiki.hs too large to diff
- src/Text/Pandoc/Readers/TeXMath.hs too large to diff
- src/Text/Pandoc/Readers/Textile.hs too large to diff
- src/Text/Pandoc/Readers/TikiWiki.hs too large to diff
- src/Text/Pandoc/Readers/Txt2Tags.hs too large to diff
- src/Text/Pandoc/Readers/Typst.hs too large to diff
- src/Text/Pandoc/Readers/Typst/Math.hs too large to diff
- src/Text/Pandoc/Readers/Typst/Parsing.hs too large to diff
- src/Text/Pandoc/Readers/Vimwiki.hs too large to diff
- src/Text/Pandoc/Readers/XML.hs too large to diff
- src/Text/Pandoc/Readers/Xlsx.hs too large to diff
- src/Text/Pandoc/Readers/Xlsx/Cells.hs too large to diff
- src/Text/Pandoc/Readers/Xlsx/Parse.hs too large to diff
- src/Text/Pandoc/Readers/Xlsx/Sheets.hs too large to diff
- src/Text/Pandoc/RoffChar.hs too large to diff
- src/Text/Pandoc/Scripting.hs too large to diff
- src/Text/Pandoc/SelfContained.hs too large to diff
- src/Text/Pandoc/Shared.hs too large to diff
- src/Text/Pandoc/Slides.hs too large to diff
- src/Text/Pandoc/Sources.hs too large to diff
- src/Text/Pandoc/TeX.hs too large to diff
- src/Text/Pandoc/Templates.hs too large to diff
- src/Text/Pandoc/Transforms.hs too large to diff
- src/Text/Pandoc/Translations.hs too large to diff
- src/Text/Pandoc/Translations/Types.hs too large to diff
- src/Text/Pandoc/URI.hs too large to diff
- src/Text/Pandoc/UTF8.hs too large to diff
- src/Text/Pandoc/UUID.hs too large to diff
- src/Text/Pandoc/Version.hs too large to diff
- src/Text/Pandoc/Writers.hs too large to diff
- src/Text/Pandoc/Writers/ANSI.hs too large to diff
- src/Text/Pandoc/Writers/AnnotatedTable.hs too large to diff
- src/Text/Pandoc/Writers/AsciiDoc.hs too large to diff
- src/Text/Pandoc/Writers/BBCode.hs too large to diff
- src/Text/Pandoc/Writers/BibTeX.hs too large to diff
- src/Text/Pandoc/Writers/Blaze.hs too large to diff
- src/Text/Pandoc/Writers/ChunkedHTML.hs too large to diff
- src/Text/Pandoc/Writers/CommonMark.hs too large to diff
- src/Text/Pandoc/Writers/ConTeXt.hs too large to diff
- src/Text/Pandoc/Writers/CslJson.hs too large to diff
- src/Text/Pandoc/Writers/Custom.hs too large to diff
- src/Text/Pandoc/Writers/Djot.hs too large to diff
- src/Text/Pandoc/Writers/DocBook.hs too large to diff
- src/Text/Pandoc/Writers/Docbook.hs too large to diff
- src/Text/Pandoc/Writers/Docx.hs too large to diff
- src/Text/Pandoc/Writers/Docx/OpenXML.hs too large to diff
- src/Text/Pandoc/Writers/Docx/StyleMap.hs too large to diff
- src/Text/Pandoc/Writers/Docx/Table.hs too large to diff
- src/Text/Pandoc/Writers/Docx/Types.hs too large to diff
- src/Text/Pandoc/Writers/DokuWiki.hs too large to diff
- src/Text/Pandoc/Writers/EPUB.hs too large to diff
- src/Text/Pandoc/Writers/FB2.hs too large to diff
- src/Text/Pandoc/Writers/GridTable.hs too large to diff
- src/Text/Pandoc/Writers/HTML.hs too large to diff
- src/Text/Pandoc/Writers/Haddock.hs too large to diff
- src/Text/Pandoc/Writers/ICML.hs too large to diff
- src/Text/Pandoc/Writers/Ipynb.hs too large to diff
- src/Text/Pandoc/Writers/JATS.hs too large to diff
- src/Text/Pandoc/Writers/JATS/References.hs too large to diff
- src/Text/Pandoc/Writers/JATS/Table.hs too large to diff
- src/Text/Pandoc/Writers/JATS/Types.hs too large to diff
- src/Text/Pandoc/Writers/Jira.hs too large to diff
- src/Text/Pandoc/Writers/LaTeX.hs too large to diff
- src/Text/Pandoc/Writers/LaTeX/Caption.hs too large to diff
- src/Text/Pandoc/Writers/LaTeX/Citation.hs too large to diff
- src/Text/Pandoc/Writers/LaTeX/Lang.hs too large to diff
- src/Text/Pandoc/Writers/LaTeX/Notes.hs too large to diff
- src/Text/Pandoc/Writers/LaTeX/Table.hs too large to diff
- src/Text/Pandoc/Writers/LaTeX/Types.hs too large to diff
- src/Text/Pandoc/Writers/LaTeX/Util.hs too large to diff
- src/Text/Pandoc/Writers/Man.hs too large to diff
- src/Text/Pandoc/Writers/Markdown.hs too large to diff
- src/Text/Pandoc/Writers/Markdown/Inline.hs too large to diff
- src/Text/Pandoc/Writers/Markdown/Table.hs too large to diff
- src/Text/Pandoc/Writers/Markdown/Types.hs too large to diff
- src/Text/Pandoc/Writers/Math.hs too large to diff
- src/Text/Pandoc/Writers/MediaWiki.hs too large to diff
- src/Text/Pandoc/Writers/Ms.hs too large to diff
- src/Text/Pandoc/Writers/Muse.hs too large to diff
- src/Text/Pandoc/Writers/Native.hs too large to diff
- src/Text/Pandoc/Writers/ODT.hs too large to diff
- src/Text/Pandoc/Writers/OOXML.hs too large to diff
- src/Text/Pandoc/Writers/OPML.hs too large to diff
- src/Text/Pandoc/Writers/OpenDocument.hs too large to diff
- src/Text/Pandoc/Writers/Org.hs too large to diff
- src/Text/Pandoc/Writers/Powerpoint.hs too large to diff
- src/Text/Pandoc/Writers/Powerpoint/Output.hs too large to diff
- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs too large to diff
- src/Text/Pandoc/Writers/RST.hs too large to diff
- src/Text/Pandoc/Writers/RTF.hs too large to diff
- src/Text/Pandoc/Writers/Roff.hs too large to diff
- src/Text/Pandoc/Writers/Shared.hs too large to diff
- src/Text/Pandoc/Writers/TEI.hs too large to diff
- src/Text/Pandoc/Writers/Texinfo.hs too large to diff
- src/Text/Pandoc/Writers/Textile.hs too large to diff
- src/Text/Pandoc/Writers/Typst.hs too large to diff
- src/Text/Pandoc/Writers/Vimdoc.hs too large to diff
- src/Text/Pandoc/Writers/XML.hs too large to diff
- src/Text/Pandoc/Writers/XWiki.hs too large to diff
- src/Text/Pandoc/Writers/ZimWiki.hs too large to diff
- src/Text/Pandoc/XML.hs too large to diff
- src/Text/Pandoc/XMLFormat.hs too large to diff
- test/Tests/Command.hs too large to diff
- test/Tests/Helpers.hs too large to diff
- test/Tests/MediaBag.hs too large to diff
- test/Tests/Old.hs too large to diff
- test/Tests/Readers/Creole.hs too large to diff
- test/Tests/Readers/Docx.hs too large to diff
- test/Tests/Readers/DokuWiki.hs too large to diff
- test/Tests/Readers/EPUB.hs too large to diff
- test/Tests/Readers/FB2.hs too large to diff
- test/Tests/Readers/HTML.hs too large to diff
- test/Tests/Readers/JATS.hs too large to diff
- test/Tests/Readers/Jira.hs too large to diff
- test/Tests/Readers/LaTeX.hs too large to diff
- test/Tests/Readers/Man.hs too large to diff
- test/Tests/Readers/Markdown.hs too large to diff
- test/Tests/Readers/Mdoc.hs too large to diff
- test/Tests/Readers/Muse.hs too large to diff
- test/Tests/Readers/ODT.hs too large to diff
- test/Tests/Readers/Org.hs too large to diff
- test/Tests/Readers/Org/Block.hs too large to diff
- test/Tests/Readers/Org/Block/CodeBlock.hs too large to diff
- test/Tests/Readers/Org/Block/Figure.hs too large to diff
- test/Tests/Readers/Org/Block/Header.hs too large to diff
- test/Tests/Readers/Org/Block/List.hs too large to diff
- test/Tests/Readers/Org/Block/Table.hs too large to diff
- test/Tests/Readers/Org/Directive.hs too large to diff
- test/Tests/Readers/Org/Inline.hs too large to diff
- test/Tests/Readers/Org/Inline/Citation.hs too large to diff
- test/Tests/Readers/Org/Inline/Note.hs too large to diff
- test/Tests/Readers/Org/Inline/Smart.hs too large to diff
- test/Tests/Readers/Org/Meta.hs too large to diff
- test/Tests/Readers/Org/Shared.hs too large to diff
- test/Tests/Readers/Pod.hs too large to diff
- test/Tests/Readers/Pptx.hs too large to diff
- test/Tests/Readers/RST.hs too large to diff
- test/Tests/Readers/RTF.hs too large to diff
- test/Tests/Readers/Txt2Tags.hs too large to diff
- test/Tests/Readers/Xlsx.hs too large to diff
- test/Tests/Shared.hs too large to diff
- test/Tests/Writers/AnnotatedTable.hs too large to diff
- test/Tests/Writers/AsciiDoc.hs too large to diff
- test/Tests/Writers/BBCode.hs too large to diff
- test/Tests/Writers/ConTeXt.hs too large to diff
- test/Tests/Writers/DocBook.hs too large to diff
- test/Tests/Writers/Docx.hs too large to diff
- test/Tests/Writers/FB2.hs too large to diff
- test/Tests/Writers/HTML.hs too large to diff
- test/Tests/Writers/JATS.hs too large to diff
- test/Tests/Writers/Jira.hs too large to diff
- test/Tests/Writers/LaTeX.hs too large to diff
- test/Tests/Writers/Markdown.hs too large to diff
- test/Tests/Writers/Markua.hs too large to diff
- test/Tests/Writers/Ms.hs too large to diff
- test/Tests/Writers/Muse.hs too large to diff
- test/Tests/Writers/Native.hs too large to diff
- test/Tests/Writers/OOXML.hs too large to diff
- test/Tests/Writers/Org.hs too large to diff
- test/Tests/Writers/Plain.hs too large to diff
- test/Tests/Writers/Powerpoint.hs too large to diff
- test/Tests/Writers/RST.hs too large to diff
- test/Tests/Writers/TEI.hs too large to diff
- test/Tests/XML.hs too large to diff
- test/ansi-test.ansi too large to diff
- test/ansi-test.txt too large to diff
- test/asciidoc-reader-include.adoc too large to diff
- test/asciidoc-reader-include.rb too large to diff
- test/asciidoc-reader.adoc too large to diff
- test/asciidoc-reader.native too large to diff
- test/bodybg.gif too large to diff
- test/command/01.csv too large to diff
- test/command/10002.md too large to diff
- test/command/10057.md too large to diff
- test/command/10062.md too large to diff
- test/command/10071.md too large to diff
- test/command/10093.md too large to diff
- test/command/10094.md too large to diff
- test/command/10105.md too large to diff
- test/command/10127.md too large to diff
- test/command/10145.md too large to diff
- test/command/10148.md too large to diff
- test/command/10149.md too large to diff
- test/command/10152.md too large to diff
- test/command/10160.md too large to diff
- test/command/10185.md too large to diff
- test/command/10236.md too large to diff
- test/command/10271.md too large to diff
- test/command/10279.md too large to diff
- test/command/10281.md too large to diff
- test/command/10318.md too large to diff
- test/command/10328.md too large to diff
- test/command/10338-rst-multiple-header-rows.md too large to diff
- test/command/10385.md too large to diff
- test/command/10390.md too large to diff
- test/command/10414.md too large to diff
- test/command/10459.md too large to diff
- test/command/10484.md too large to diff
- test/command/10490.md too large to diff
- test/command/10491.md too large to diff
- test/command/10497.md too large to diff
- test/command/10537.md too large to diff
- test/command/10594.md too large to diff
- test/command/10621.md too large to diff
- test/command/10631.md too large to diff
- test/command/10635.md too large to diff
- test/command/10643.md too large to diff
- test/command/10650.md too large to diff
- test/command/10659.md too large to diff
- test/command/10672.md too large to diff
- test/command/10708.md too large to diff
- test/command/10730.md too large to diff
- test/command/10747.md too large to diff
- test/command/10755.md too large to diff
- test/command/10758.md too large to diff
- test/command/10781.md too large to diff
- test/command/10791.md too large to diff
- test/command/10805.md too large to diff
- test/command/10812.md too large to diff
- test/command/10816.md too large to diff
- test/command/10825.md too large to diff
- test/command/10836.md too large to diff
- test/command/10848.md too large to diff
- test/command/10855.md too large to diff
- test/command/10862.md too large to diff
- test/command/10867.md too large to diff
- test/command/10884.md too large to diff
- test/command/10889.md too large to diff
- test/command/10890.md too large to diff
- test/command/10912.md too large to diff
- test/command/10915.md too large to diff
- test/command/10919.md too large to diff
- test/command/10926.md too large to diff
- test/command/10942.md too large to diff
- test/command/10965.md too large to diff
- test/command/10983.md too large to diff
- test/command/10984.md too large to diff
- test/command/11006.md too large to diff
- test/command/11013.md too large to diff
- test/command/11014.md too large to diff
- test/command/11017.md too large to diff
- test/command/11046.md too large to diff
- test/command/11047.md too large to diff
- test/command/11048.md too large to diff
- test/command/11090.md too large to diff
- test/command/11090/ch1.typ too large to diff
- test/command/11101.md too large to diff
- test/command/11113.docx too large to diff
- test/command/11113.md too large to diff
- test/command/11124.md too large to diff
- test/command/11128.md too large to diff
- test/command/11140.md too large to diff
- test/command/11150.md too large to diff
- test/command/11162.md too large to diff
- test/command/11188.md too large to diff
- test/command/11210.md too large to diff
- test/command/11211.md too large to diff
- test/command/11253.md too large to diff
- test/command/1126.md too large to diff
- test/command/11266.md too large to diff
- test/command/11270.md too large to diff
- test/command/11299.md too large to diff
- test/command/11300.md too large to diff
- test/command/11309.md too large to diff
- test/command/11312.md too large to diff
- test/command/11323.md too large to diff
- test/command/11341.md too large to diff
- test/command/11342.md too large to diff
- test/command/11348.md too large to diff
- test/command/11362.md too large to diff
- test/command/11364.md too large to diff
- test/command/11374.md too large to diff
- test/command/11384.md too large to diff
- test/command/11409.md too large to diff
- test/command/11420.md too large to diff
- test/command/11422.md too large to diff
- test/command/11450.md too large to diff
- test/command/11455.md too large to diff
- test/command/11463.md too large to diff
- test/command/11479.md too large to diff
- test/command/11486.md too large to diff
- test/command/11486/scroll.revealjs too large to diff
- test/command/11490.md too large to diff
- test/command/11494.md too large to diff
- test/command/11498.md too large to diff
- test/command/11498.png too large to diff
- test/command/11511.md too large to diff
- test/command/11534.md too large to diff
- test/command/11542.md too large to diff
- test/command/11562.md too large to diff
- test/command/11571.md too large to diff
- test/command/11583.md too large to diff
- test/command/11588.md too large to diff
- test/command/11589.md too large to diff
- test/command/11598.md too large to diff
- test/command/11604.md too large to diff
- test/command/11608.md too large to diff
- test/command/11635.md too large to diff
- test/command/1166.md too large to diff
- test/command/11664.md too large to diff
- test/command/11668.md too large to diff
- test/command/11682.md too large to diff
- test/command/1279.md too large to diff
- test/command/1390.md too large to diff
- test/command/1592.md too large to diff
- test/command/1608.md too large to diff
- test/command/1629.md too large to diff
- test/command/168.md too large to diff
- test/command/1710.md too large to diff
- test/command/1718.md too large to diff
- test/command/1745.md too large to diff
- test/command/1762.md too large to diff
- test/command/1773.md too large to diff
- test/command/1841.md too large to diff
- test/command/1881.md too large to diff
- test/command/1905.md too large to diff
- test/command/2103.md too large to diff
- test/command/2118.md too large to diff
- test/command/2228.md too large to diff
- test/command/2337.md too large to diff
- test/command/2378.md too large to diff
- test/command/2397.md too large to diff
- test/command/2434.md too large to diff
- test/command/2465.md too large to diff
- test/command/2549.md too large to diff
- test/command/2552.md too large to diff
- test/command/256.md too large to diff
- test/command/2602.md too large to diff
- test/command/2606.md too large to diff
- test/command/262.md too large to diff
- test/command/2649.md too large to diff
- test/command/2662.md too large to diff
- test/command/2834.md too large to diff
- test/command/2874.md too large to diff
- test/command/2994.md too large to diff
- test/command/3113.md too large to diff
- test/command/3123.md too large to diff
- test/command/3236.md too large to diff
- test/command/3257.md too large to diff
- test/command/3309.md too large to diff
- test/command/3314.md too large to diff
- test/command/3324.md too large to diff
- test/command/3337.md too large to diff
- test/command/3348.md too large to diff
- test/command/3401.md too large to diff
- test/command/3407.md too large to diff
- test/command/3422.md too large to diff
- test/command/3432.md too large to diff
- test/command/3432a.md too large to diff
- test/command/3450.md too large to diff
- test/command/3475.md too large to diff
- test/command/3487.md too large to diff
- test/command/3494.md too large to diff
- test/command/3497.md too large to diff
- test/command/3499.md too large to diff
- test/command/3510-export.latex too large to diff
- test/command/3510-src.hs too large to diff
- test/command/3510-subdoc.org too large to diff
- test/command/3510.md too large to diff
- test/command/3511.md too large to diff
- test/command/3512.md too large to diff
- test/command/3516.md too large to diff
- test/command/3518.md too large to diff
- test/command/3523.md too large to diff
- test/command/3526.md too large to diff
- test/command/3529.md too large to diff
- test/command/3530.md too large to diff
- test/command/3531.md too large to diff
- test/command/3533-rst-csv-tables.csv too large to diff
- test/command/3533-rst-csv-tables.md too large to diff
- test/command/3534.md too large to diff
- test/command/3537.md too large to diff
- test/command/3539.md too large to diff
- test/command/3558.md too large to diff
- test/command/3568.md too large to diff
- test/command/3570.md too large to diff
- test/command/3577.md too large to diff
- test/command/3585.md too large to diff
- test/command/3587.md too large to diff
- test/command/3596.md too large to diff
- test/command/3615.md too large to diff
- test/command/3619.md too large to diff
- test/command/3630.md too large to diff
- test/command/3667.md too large to diff
- test/command/3674.md too large to diff
- test/command/3675.md too large to diff
- test/command/3681.md too large to diff
- test/command/3690.md too large to diff
- test/command/3701.md too large to diff
- test/command/3706.md too large to diff
- test/command/3708.md too large to diff
- test/command/3715.md too large to diff
- test/command/3716.md too large to diff
- test/command/3730.md too large to diff
- test/command/3733.md too large to diff
- test/command/3734.md too large to diff
- test/command/3736.md too large to diff
- test/command/3752.md too large to diff
- test/command/3755.md too large to diff
- test/command/3771.md too large to diff
- test/command/3773.md too large to diff
- test/command/3779.md too large to diff
- test/command/3792.md too large to diff
- test/command/3794.md too large to diff
- test/command/3803.md too large to diff
- test/command/3804.md too large to diff
- test/command/3816.md too large to diff
- test/command/3824.md too large to diff
- test/command/3840.md too large to diff
- test/command/3853.md too large to diff
- test/command/3880.md too large to diff
- test/command/3880.txt too large to diff
- test/command/3916.md too large to diff
- test/command/3937.md too large to diff
- test/command/3947.md too large to diff
- test/command/3958.md too large to diff
- test/command/3968.md too large to diff
- test/command/3971.md too large to diff
- test/command/3971b.tex too large to diff
- test/command/3974.md too large to diff
- test/command/3978.md too large to diff
- test/command/3983.md too large to diff
- test/command/3989.md too large to diff
- test/command/4007.md too large to diff
- test/command/4012.md too large to diff
- test/command/4016.md too large to diff
- test/command/4019.md too large to diff
- test/command/4038.md too large to diff
- test/command/4054.md too large to diff
- test/command/4056.md too large to diff
- test/command/4061.md too large to diff
- test/command/4062.md too large to diff
- test/command/4063.md too large to diff
- test/command/4068.md too large to diff
- test/command/4091.md too large to diff
- test/command/4102.md too large to diff
- test/command/4113.md too large to diff
- test/command/4119.md too large to diff
- test/command/4125.md too large to diff
- test/command/4134.md too large to diff
- test/command/4156.md too large to diff
- test/command/4159.md too large to diff
- test/command/4162.md too large to diff
- test/command/4164.md too large to diff
- test/command/4171.md too large to diff
- test/command/4172.md too large to diff
- test/command/4183.md too large to diff
- test/command/4186.md too large to diff
- test/command/4193.md too large to diff
- test/command/4199.md too large to diff
- test/command/4208.md too large to diff
- test/command/4235.md too large to diff
- test/command/4240.md too large to diff
- test/command/4253.md too large to diff
- test/command/4254.md too large to diff
- test/command/4280.md too large to diff
- test/command/4281.md too large to diff
- test/command/4284.md too large to diff
- test/command/4306.md too large to diff
- test/command/4320.md too large to diff
- test/command/4374.md too large to diff
- test/command/4382.md too large to diff
- test/command/4420.md too large to diff
- test/command/4424.md too large to diff
- test/command/4442.md too large to diff
- test/command/4454.md too large to diff
- test/command/4465.md too large to diff
- test/command/4470.md too large to diff
- test/command/4499.md too large to diff
- test/command/4513.md too large to diff
- test/command/4527.md too large to diff
- test/command/4528.md too large to diff
- test/command/4529.md too large to diff
- test/command/4545.md too large to diff
- test/command/4550.md too large to diff
- test/command/4553.md too large to diff
- test/command/4564.md too large to diff
- test/command/4576.md too large to diff
- test/command/4578.md too large to diff
- test/command/4579.md too large to diff
- test/command/4589.md too large to diff
- test/command/4594.md too large to diff
- test/command/4598.md too large to diff
- test/command/4624.md too large to diff
- test/command/4635.md too large to diff
- test/command/4637.md too large to diff
- test/command/4639.md too large to diff
- test/command/4653.md too large to diff
- test/command/4667.md too large to diff
- test/command/4669.md too large to diff
- test/command/4677.md too large to diff
- test/command/4690.md too large to diff
- test/command/4715.md too large to diff
- test/command/4722.md too large to diff
- test/command/4742.md too large to diff
- test/command/4743.md too large to diff
- test/command/4746.md too large to diff
- test/command/4748.md too large to diff
- test/command/4768.md too large to diff
- test/command/4781.md too large to diff
- test/command/4794.md too large to diff
- test/command/4805-beamer-columns-alignment.md too large to diff
- test/command/4811.md too large to diff
- test/command/4817.md too large to diff
- test/command/4819.md too large to diff
- test/command/4832.md too large to diff
- test/command/4833.md too large to diff
- test/command/4842.md too large to diff
- test/command/4845.md too large to diff
- test/command/4848.md too large to diff
- test/command/4860.md too large to diff
- test/command/4877.md too large to diff
- test/command/4880.md too large to diff
- test/command/4885.md too large to diff
- test/command/4908.md too large to diff
- test/command/4913.md too large to diff
- test/command/4919.md too large to diff
- test/command/4928.md too large to diff
- test/command/4933.md too large to diff
- test/command/4960.md too large to diff
- test/command/5010.md too large to diff
- test/command/5014.md too large to diff
- test/command/5039.md too large to diff
- test/command/5050.md too large to diff
- test/command/5053.md too large to diff
- test/command/5071.md too large to diff
- test/command/5072.md too large to diff
- test/command/5079.md too large to diff
- test/command/5080.md too large to diff
- test/command/5081.md too large to diff
- test/command/5099.md too large to diff
- test/command/5107.md too large to diff
- test/command/5116.md too large to diff
- test/command/5119.md too large to diff
- test/command/512.md too large to diff
- test/command/5121.md too large to diff
- test/command/5128.md too large to diff
- test/command/5177.md too large to diff
- test/command/5178.md too large to diff
- test/command/5182.md too large to diff
- test/command/5182.txt too large to diff
- test/command/5195.md too large to diff
- test/command/5233.md too large to diff
- test/command/5241.md too large to diff
- test/command/5271.md too large to diff
- test/command/5285.md too large to diff
- test/command/5304.md too large to diff
- test/command/5321.md too large to diff
- test/command/5340.md too large to diff
- test/command/5360.md too large to diff
- test/command/5367.md too large to diff
- test/command/5368.md too large to diff
- test/command/5369.md too large to diff
- test/command/5407.md too large to diff
- test/command/5410.md too large to diff
- test/command/5416.md too large to diff
- test/command/5420.md too large to diff
- test/command/5439.md too large to diff
- test/command/5446.md too large to diff
- test/command/5474-figures.md too large to diff
- test/command/5474-tables.md too large to diff
- test/command/5476.md too large to diff
- test/command/5495.md too large to diff
- test/command/5519.md too large to diff
- test/command/5529.md too large to diff
- test/command/5540.md too large to diff
- test/command/5541-localLink.md too large to diff
- test/command/5541-nesting.md too large to diff
- test/command/5541-urlLink.md too large to diff
- test/command/5543.md too large to diff
- test/command/5549.md too large to diff
- test/command/5565.md too large to diff
- test/command/5566.md too large to diff
- test/command/5574.md too large to diff
- test/command/5619.md too large to diff
- test/command/5620.md too large to diff
- test/command/5627.md too large to diff
- test/command/5635.md too large to diff
- test/command/5642.md too large to diff
- test/command/5650.md too large to diff
- test/command/5654.md too large to diff
- test/command/5655.md too large to diff
- test/command/5682.md too large to diff
- test/command/5684.md too large to diff
- test/command/5686.md too large to diff
- test/command/5690.md too large to diff
- test/command/5700-metadata-file-1.yml too large to diff
- test/command/5700-metadata-file-2.yml too large to diff
- test/command/5700.md too large to diff
- test/command/5705.md too large to diff
- test/command/5708.md too large to diff
- test/command/5711.md too large to diff
- test/command/5714.md too large to diff
- test/command/5740.md too large to diff
- test/command/5753.md too large to diff
- test/command/5793.md too large to diff
- test/command/5795.md too large to diff
- test/command/5797.md too large to diff
- test/command/5805.md too large to diff
- test/command/5813.md too large to diff
- test/command/5819.md too large to diff
- test/command/5836.md too large to diff
- test/command/5845.md too large to diff
- test/command/5846.md too large to diff
- test/command/5849-prefix.md too large to diff
- test/command/5857.md too large to diff
- test/command/5876.md too large to diff
- test/command/5876.yaml too large to diff
- test/command/5876/metadata/5876.yaml too large to diff
- test/command/5876/metadata/command/5876.yaml too large to diff
- test/command/5878.md too large to diff
- test/command/5881.md too large to diff
- test/command/5885.md too large to diff
- test/command/5898.md too large to diff
- test/command/5899.md too large to diff
- test/command/5904.md too large to diff
- test/command/5918.md too large to diff
- test/command/5936.md too large to diff
- test/command/5967.md too large to diff
- test/command/5986.md too large to diff
- test/command/6009.md too large to diff
- test/command/6021.md too large to diff
- test/command/6026.md too large to diff
- test/command/6030.md too large to diff
- test/command/6033.md too large to diff
- test/command/6034.md too large to diff
- test/command/6043.md too large to diff
- test/command/6062.md too large to diff
- test/command/6107.md too large to diff
- test/command/6114.md too large to diff
- test/command/6119.md too large to diff
- test/command/6133.md too large to diff
- test/command/6137.md too large to diff
- test/command/6194.md too large to diff
- test/command/6265.md too large to diff
- test/command/6285.md too large to diff
- test/command/6288.md too large to diff
- test/command/6296.md too large to diff
- test/command/6308.md too large to diff
- test/command/6324.md too large to diff
- test/command/6348.md too large to diff
- test/command/6350.md too large to diff
- test/command/6360.md too large to diff
- test/command/6367.md too large to diff
- test/command/6384.md too large to diff
- test/command/6385.md too large to diff
- test/command/6388.md too large to diff
- test/command/6424.md too large to diff
- test/command/6441.md too large to diff
- test/command/645.md too large to diff
- test/command/6466-beg.hs too large to diff
- test/command/6466-end.hs too large to diff
- test/command/6466-mid.hs too large to diff
- test/command/6466-whole.hs too large to diff
- test/command/6466.md too large to diff
- test/command/6481.md too large to diff
- test/command/6541.md too large to diff
- test/command/6549.md too large to diff
- test/command/6588.md too large to diff
- test/command/6620.md too large to diff
- test/command/6658.md too large to diff
- test/command/6675.md too large to diff
- test/command/6699.md too large to diff
- test/command/6709.md too large to diff
- test/command/6719.md too large to diff
- test/command/6723.md too large to diff
- test/command/6739.md too large to diff
- test/command/6740.md too large to diff
- test/command/6741.md too large to diff
- test/command/6752.md too large to diff
- test/command/6755.md too large to diff
- test/command/6765.md too large to diff
- test/command/6768.md too large to diff
- test/command/6774.md too large to diff
- test/command/6783.md too large to diff
- test/command/6791.md too large to diff
- test/command/6792.md too large to diff
- test/command/6796.md too large to diff
- test/command/6802.md too large to diff
- test/command/6821.md too large to diff
- test/command/6836.md too large to diff
- test/command/6837.md too large to diff
- test/command/6844.md too large to diff
- test/command/6855.md too large to diff
- test/command/6858.md too large to diff
- test/command/6869.md too large to diff
- test/command/6873.md too large to diff
- test/command/6890.md too large to diff
- test/command/6925.md too large to diff
- test/command/6948.md too large to diff
- test/command/6951.md too large to diff
- test/command/6958.md too large to diff
- test/command/6959.md too large to diff
- test/command/6970.md too large to diff
- test/command/6992.md too large to diff
- test/command/6993.md too large to diff
- test/command/7003.md too large to diff
- test/command/7006.md too large to diff
- test/command/7009.md too large to diff
- test/command/7016.md too large to diff
- test/command/7041.md too large to diff
- test/command/7042.md too large to diff
- test/command/7058.md too large to diff
- test/command/7064.md too large to diff
- test/command/7067.md too large to diff
- test/command/7080.md too large to diff
- test/command/7092.md too large to diff
- test/command/7099.md too large to diff
- test/command/7112.md too large to diff
- test/command/7129.md too large to diff
- test/command/7132.md too large to diff
- test/command/7134.md too large to diff
- test/command/7145.md too large to diff
- test/command/7155.md too large to diff
- test/command/7172.md too large to diff
- test/command/7173.md too large to diff
- test/command/7181.md too large to diff
- test/command/7201.md too large to diff
- test/command/7208.md too large to diff
- test/command/7214.md too large to diff
- test/command/7216.md too large to diff
- test/command/7219.md too large to diff
- test/command/7266.md too large to diff
- test/command/7272.md too large to diff
- test/command/7278.md too large to diff
- test/command/7282.md too large to diff
- test/command/7288.md too large to diff
- test/command/7299.md too large to diff
- test/command/7321.md too large to diff
- test/command/7323.md too large to diff
- test/command/7324.md too large to diff
- test/command/7326.md too large to diff
- test/command/7329.md too large to diff
- test/command/7339.md too large to diff
- test/command/7340.md too large to diff
- test/command/7376.md too large to diff
- test/command/7394.md too large to diff
- test/command/7397.md too large to diff
- test/command/7400.md too large to diff
- test/command/7416.md too large to diff
- test/command/7434.md too large to diff
- test/command/7436.md too large to diff
- test/command/7473.md too large to diff
- test/command/7482.md too large to diff
- test/command/7494.md too large to diff
- test/command/7497.md too large to diff
- test/command/7512.md too large to diff
- test/command/7520.md too large to diff
- test/command/7521.md too large to diff
- test/command/7525.md too large to diff
- test/command/7529.md too large to diff
- test/command/7546.md too large to diff
- test/command/7557.md too large to diff
- test/command/7568.md too large to diff
- test/command/7573.md too large to diff
- test/command/7582.md too large to diff
- test/command/7589.md too large to diff
- test/command/7615.md too large to diff
- test/command/7623.md too large to diff
- test/command/7632.md too large to diff
- test/command/7668.md too large to diff
- test/command/7678.md too large to diff
- test/command/7691.docx too large to diff
- test/command/7691.md too large to diff
- test/command/7692.md too large to diff
- test/command/7697.md too large to diff
- test/command/7713.md too large to diff
- test/command/7723.md too large to diff
- test/command/7726.md too large to diff
- test/command/7738.md too large to diff
- test/command/7743.md too large to diff
- test/command/7761.md too large to diff
- test/command/7778.md too large to diff
- test/command/7803.md too large to diff
- test/command/7808.md too large to diff
- test/command/7810.md too large to diff
- test/command/7813-meta.yaml too large to diff
- test/command/7813.md too large to diff
- test/command/7826.md too large to diff
- test/command/7847.md too large to diff
- test/command/7857.md too large to diff
- test/command/7858.md too large to diff
- test/command/7861.md too large to diff
- test/command/7861.yaml too large to diff
- test/command/7861/metadata/placeholder too large to diff
- test/command/7863.md too large to diff
- test/command/7871.md too large to diff
- test/command/7884.md too large to diff
- test/command/7894.md too large to diff
- test/command/7919.md too large to diff
- test/command/7920.md too large to diff
- test/command/7930.md too large to diff
- test/command/7939.md too large to diff
- test/command/7941.md too large to diff
- test/command/7953.md too large to diff
- test/command/7965.md too large to diff
- test/command/8003.md too large to diff
- test/command/8011.md too large to diff
- test/command/8024.md too large to diff
- test/command/8024a.yaml too large to diff
- test/command/8024b.yaml too large to diff
- test/command/8028.md too large to diff
- test/command/8047.md too large to diff
- test/command/8070.md too large to diff
- test/command/8079.md too large to diff
- test/command/8088.md too large to diff
- test/command/8097.md too large to diff
- test/command/8098.md too large to diff
- test/command/8110.md too large to diff
- test/command/8131.md too large to diff
- test/command/8150.md too large to diff
- test/command/8170.md too large to diff
- test/command/8174.md too large to diff
- test/command/8178.md too large to diff
- test/command/8179.md too large to diff
- test/command/8182.md too large to diff
- test/command/8201.md too large to diff
- test/command/8204.md too large to diff
- test/command/8216.md too large to diff
- test/command/8219.md too large to diff
- test/command/8236.md too large to diff
- test/command/8243.md too large to diff
- test/command/8251.md too large to diff
- test/command/8254.md too large to diff
- test/command/8256.md too large to diff
- test/command/8257.md too large to diff
- test/command/8281.md too large to diff
- test/command/8302.md too large to diff
- test/command/8307.md too large to diff
- test/command/8344.md too large to diff
- test/command/8354.md too large to diff
- test/command/8364.md too large to diff
- test/command/8365.md too large to diff
- test/command/8380.md too large to diff
- test/command/8402.md too large to diff
- test/command/8437.md too large to diff
- test/command/8486.md too large to diff
- test/command/8487.md too large to diff
- test/command/8504.md too large to diff
- test/command/8508.md too large to diff
- test/command/8511.md too large to diff
- test/command/8513.md too large to diff
- test/command/853.md too large to diff
- test/command/8534.md too large to diff
- test/command/8573.md too large to diff
- test/command/8611.md too large to diff
- test/command/8638.md too large to diff
- test/command/8652.md too large to diff
- test/command/8653.md too large to diff
- test/command/8659.md too large to diff
- test/command/8661.md too large to diff
- test/command/8665.md too large to diff
- test/command/8666.md too large to diff
- test/command/8681.md too large to diff
- test/command/8689.md too large to diff
- test/command/8711.md too large to diff
- test/command/8738.md too large to diff
- test/command/8745.md too large to diff
- test/command/8764.md too large to diff
- test/command/8770-block.md too large to diff
- test/command/8770-document.md too large to diff
- test/command/8770-section.md too large to diff
- test/command/8777.md too large to diff
- test/command/8783.md too large to diff
- test/command/8789.md too large to diff
- test/command/8852.md too large to diff
- test/command/8853.md too large to diff
- test/command/8863.md too large to diff
- test/command/8867.md too large to diff
- test/command/8869.md too large to diff
- test/command/8872.md too large to diff
- test/command/8880.md too large to diff
- test/command/8948.md too large to diff
- test/command/8956.md too large to diff
- test/command/8957.md too large to diff
- test/command/8966.md too large to diff
- test/command/8981.md too large to diff
- test/command/8984.md too large to diff
- test/command/8992.md too large to diff
- test/command/8997.md too large to diff
- test/command/9000.md too large to diff
- test/command/9002.docx too large to diff
- test/command/9002.md too large to diff
- test/command/9017.md too large to diff
- test/command/9021.md too large to diff
- test/command/9038.md too large to diff
- test/command/9042.md too large to diff
- test/command/9043.md too large to diff
- test/command/9045.md too large to diff
- test/command/9047.md too large to diff
- test/command/9088.md too large to diff
- test/command/9090.md too large to diff
- test/command/9121.md too large to diff
- test/command/9136.md too large to diff
- test/command/9150.md too large to diff
- test/command/9159.md too large to diff
- test/command/9171.md too large to diff
- test/command/9193.md too large to diff
- test/command/9196.md too large to diff
- test/command/9201.md too large to diff
- test/command/9202.md too large to diff
- test/command/9209.md too large to diff
- test/command/9218.md too large to diff
- test/command/9236.md too large to diff
- test/command/9275.md too large to diff
- test/command/9279.md too large to diff
- test/command/9293.md too large to diff
- test/command/934.md too large to diff
- test/command/9346.md too large to diff
- test/command/9350.md too large to diff
- test/command/9358.docx too large to diff
- test/command/9358.md too large to diff
- test/command/9366.md too large to diff
- test/command/9371.md too large to diff
- test/command/9386.md too large to diff
- test/command/9387.md too large to diff
- test/command/9388.md too large to diff
- test/command/9391.docx too large to diff
- test/command/9391.md too large to diff
- test/command/9420.md too large to diff
- test/command/9420.svg too large to diff
- test/command/9445.md too large to diff
- test/command/9452.md too large to diff
- test/command/9467.md too large to diff
- test/command/9467.svg too large to diff
- test/command/9472.md too large to diff
- test/command/9475.md too large to diff
- test/command/9478.md too large to diff
- test/command/9481.md too large to diff
- test/command/9516.md too large to diff
- test/command/9517.md too large to diff
- test/command/9555.md too large to diff
- test/command/9569.md too large to diff
- test/command/9576.md too large to diff
- test/command/9579.md too large to diff
- test/command/9585.md too large to diff
- test/command/9586.md too large to diff
- test/command/9597.md too large to diff
- test/command/9603.docx too large to diff
- test/command/9603.md too large to diff
- test/command/9616.md too large to diff
- test/command/9630.md too large to diff
- test/command/9632.md too large to diff
- test/command/9635.md too large to diff
- test/command/9639.md too large to diff
- test/command/9644.md too large to diff
- test/command/9652.md too large to diff
- test/command/9652.svg too large to diff
- test/command/9657.md too large to diff
- test/command/9676.md too large to diff
- test/command/9700.md too large to diff
- test/command/9716.md too large to diff
- test/command/9777-b.md too large to diff
- test/command/9777.md too large to diff
- test/command/9792.md too large to diff
- test/command/9797.md too large to diff
- test/command/9805.md too large to diff
- test/command/9807.md too large to diff
- test/command/9809.md too large to diff
- test/command/982.md too large to diff
- test/command/9865.md too large to diff
- test/command/987.md too large to diff
- test/command/9878.md too large to diff
- test/command/9902.md too large to diff
- test/command/9904.md too large to diff
- test/command/9905.md too large to diff
- test/command/9908.md too large to diff
- test/command/9943.md too large to diff
- test/command/9945.md too large to diff
- test/command/9953.md too large to diff
- test/command/9987.md too large to diff
- test/command/A.txt too large to diff
- test/command/B.txt too large to diff
- test/command/C.txt too large to diff
- test/command/D.txt too large to diff
- test/command/SVG_logo-without-xml-declaration.svg too large to diff
- test/command/SVG_logo.svg too large to diff
- test/command/abbrevs too large to diff
- test/command/adjacent_latex_blocks.md too large to diff
- test/command/advanced-optical-materials.csl too large to diff
- test/command/alerts.md too large to diff
- test/command/american-medical-association.csl too large to diff
- test/command/annales.csl too large to diff
- test/command/apa.csl too large to diff
- test/command/archeologie-medievale.csl too large to diff
- test/command/ascii.md too large to diff
- test/command/author-in-text-move-note.md too large to diff
- test/command/averroes.bib too large to diff
- test/command/bar-endinput.tex too large to diff
- test/command/bar.tex too large to diff
- test/command/biblatex-266.md too large to diff
- test/command/biblatex-aksin.md too large to diff
- test/command/biblatex-almendro.md too large to diff
- test/command/biblatex-angenendt.md too large to diff
- test/command/biblatex-aristotle-anima.md too large to diff
- test/command/biblatex-aristotle-physics.md too large to diff
- test/command/biblatex-aristotle-poetics.md too large to diff
- test/command/biblatex-aristotle-rhetoric.md too large to diff
- test/command/biblatex-article.md too large to diff
- test/command/biblatex-augustine.md too large to diff
- test/command/biblatex-averroes-bland.md too large to diff
- test/command/biblatex-averroes-hannes.md too large to diff
- test/command/biblatex-averroes-hercz.md too large to diff
- test/command/biblatex-baez-article.md too large to diff
- test/command/biblatex-baez-online.md too large to diff
- test/command/biblatex-basic.md too large to diff
- test/command/biblatex-bertram.md too large to diff
- test/command/biblatex-bibstring-resolution.md too large to diff
- test/command/biblatex-book-averroes.md too large to diff
- test/command/biblatex-book-coleridge.md too large to diff
- test/command/biblatex-book-title-maintitle-series.md too large to diff
- test/command/biblatex-book-vazques-de-parga.md too large to diff
- test/command/biblatex-brandt.md too large to diff
- test/command/biblatex-britannica.md too large to diff
- test/command/biblatex-chiu.md too large to diff
- test/command/biblatex-cicero.md too large to diff
- test/command/biblatex-cms.md too large to diff
- test/command/biblatex-coleridge.md too large to diff
- test/command/biblatex-companion.md too large to diff
- test/command/biblatex-cotton.md too large to diff
- test/command/biblatex-crossref-inbook-mvbook.md too large to diff
- test/command/biblatex-crossref-nested.md too large to diff
- test/command/biblatex-ctan.md too large to diff
- test/command/biblatex-dates.md too large to diff
- test/command/biblatex-doody.md too large to diff
- test/command/biblatex-edtf-date.md too large to diff
- test/command/biblatex-escapedquotes.md too large to diff
- test/command/biblatex-formatting.md too large to diff
- test/command/biblatex-gaonkar-in.md too large to diff
- test/command/biblatex-gaonkar.md too large to diff
- test/command/biblatex-geer.md too large to diff
- test/command/biblatex-gerhardt.md too large to diff
- test/command/biblatex-gillies.md too large to diff
- test/command/biblatex-glashow.md too large to diff
- test/command/biblatex-gonzalez.md too large to diff
- test/command/biblatex-hammond.md too large to diff
- test/command/biblatex-herrmann.md too large to diff
- test/command/biblatex-hyman.md too large to diff
- test/command/biblatex-iliad.md too large to diff
- test/command/biblatex-inbook-title-booktitle-maintitle-series-2.md too large to diff
- test/command/biblatex-inbook-title-booktitle-maintitle-series.md too large to diff
- test/command/biblatex-inbook.md too large to diff
- test/command/biblatex-incollection-2.md too large to diff
- test/command/biblatex-incollection.md too large to diff
- test/command/biblatex-inproceedings.md too large to diff
- test/command/biblatex-issue288.md too large to diff
- test/command/biblatex-itzhaki.md too large to diff
- test/command/biblatex-jaffe.md too large to diff
- test/command/biblatex-jcg.md too large to diff
- test/command/biblatex-kant-kpv.md too large to diff
- test/command/biblatex-kant-ku.md too large to diff
- test/command/biblatex-kastenholz.md too large to diff
- test/command/biblatex-knuth-ct-a.md too large to diff
- test/command/biblatex-knuth-ct-b.md too large to diff
- test/command/biblatex-knuth-ct-c.md too large to diff
- test/command/biblatex-knuth-ct-d.md too large to diff
- test/command/biblatex-knuth-ct-e.md too large to diff
- test/command/biblatex-knuth-ct-related.md too large to diff
- test/command/biblatex-knuth-ct.md too large to diff
- test/command/biblatex-kowalik.md too large to diff
- test/command/biblatex-kullback-related.md too large to diff
- test/command/biblatex-kullback-reprint.md too large to diff
- test/command/biblatex-kullback.md too large to diff
- test/command/biblatex-laufenberg.md too large to diff
- test/command/biblatex-loh.md too large to diff
- test/command/biblatex-malinowski.md too large to diff
- test/command/biblatex-manual.md too large to diff
- test/command/biblatex-markey.md too large to diff
- test/command/biblatex-maron.md too large to diff
- test/command/biblatex-massa.md too large to diff
- test/command/biblatex-moore-related.md too large to diff
- test/command/biblatex-moore.md too large to diff
- test/command/biblatex-moraux.md too large to diff
- test/command/biblatex-murray.md too large to diff
- test/command/biblatex-nietzsche-historie.md too large to diff
- test/command/biblatex-nietzsche-ksa.md too large to diff
- test/command/biblatex-nietzsche-ksa1.md too large to diff
- test/command/biblatex-online.md too large to diff
- test/command/biblatex-options-url-false-doi-false.md too large to diff
- test/command/biblatex-padhye.md too large to diff
- test/command/biblatex-patent.md too large to diff
- test/command/biblatex-periodical.md too large to diff
- test/command/biblatex-piccato.md too large to diff
- test/command/biblatex-pines.md too large to diff
- test/command/biblatex-quotes.md too large to diff
- test/command/biblatex-reese.md too large to diff
- test/command/biblatex-report.md too large to diff
- test/command/biblatex-salam.md too large to diff
- test/command/biblatex-sarfraz.md too large to diff
- test/command/biblatex-shore.md too large to diff
- test/command/biblatex-sigfridsson.md too large to diff
- test/command/biblatex-sorace.md too large to diff
- test/command/biblatex-spiegelberg.md too large to diff
- test/command/biblatex-springer.md too large to diff
- test/command/biblatex-strings.md too large to diff
- test/command/biblatex-test-case-conversion.md too large to diff
- test/command/biblatex-textnormal.md too large to diff
- test/command/biblatex-thesis.md too large to diff
- test/command/biblatex-title-and-shorttitle.md too large to diff
- test/command/biblatex-vangennep-related.md too large to diff
- test/command/biblatex-vangennep-trans.md too large to diff
- test/command/biblatex-vangennep.md too large to diff
- test/command/biblatex-vazques-de-parga-mvbook.md too large to diff
- test/command/biblatex-vazques-de-parga.md too large to diff
- test/command/biblatex-video.md too large to diff
- test/command/biblatex-vizedom-related.md too large to diff
- test/command/biblatex-wassenberg.md too large to diff
- test/command/biblatex-weinberg.md too large to diff
- test/command/biblatex-westfahl-frontier.md too large to diff
- test/command/biblatex-westfahl-space.md too large to diff
- test/command/biblatex-wilde.md too large to diff
- test/command/biblatex-worman.md too large to diff
- test/command/biblatex-yoon.md too large to diff
- test/command/biblio.bib too large to diff
- test/command/bibtex-basic.md too large to diff
- test/command/bioethics.csl too large to diff
- test/command/bits-book-meta.md too large to diff
- test/command/bits-book-part-wrapper-meta.md too large to diff
- test/command/bits-book-part-wrapper.md too large to diff
- test/command/bits-book.md too large to diff
- test/command/bits-index-elements.md too large to diff
- test/command/bits-legend.md too large to diff
- test/command/bits-named-boook-parts.md too large to diff
- test/command/bits-title-display-as.md too large to diff
- test/command/bits-title-supress.md too large to diff
- test/command/bits-toc-elements.md too large to diff
- test/command/chap1/spider.png too large to diff
- test/command/chap1/text.md too large to diff
- test/command/chap2/spider.png too large to diff
- test/command/chap2/text.md too large to diff
- test/command/chicago-annotated-bibliography.csl too large to diff
- test/command/chicago-author-date-with-original-date-and-status.csl too large to diff
- test/command/chicago-fullnote-bibliography.csl too large to diff
- test/command/chicago-note-bibliography.csl too large to diff
- test/command/chinese-gb7714-2005-numeric.csl too large to diff
- test/command/cite-in-inline-note.md too large to diff
- test/command/citeproc-17.md too large to diff
- test/command/citeproc-20.md too large to diff
- test/command/citeproc-7a.md too large to diff
- test/command/citeproc-7b.md too large to diff
- test/command/citeproc-87.md too large to diff
- test/command/citeproc-author-in-text-suffix.md too large to diff
- test/command/corrupt.svg too large to diff
- test/command/csv.md too large to diff
- test/command/defaults-inheritance-1.md too large to diff
- test/command/defaults-inheritance-2.md too large to diff
- test/command/defaults-inheritance-3.md too large to diff
- test/command/defaults1.yaml too large to diff
- test/command/defaults2.yaml too large to diff
- test/command/defaults3.yaml too large to diff
- test/command/defaults4.yaml too large to diff
- test/command/defaults5.yaml too large to diff
- test/command/defaults6.yaml too large to diff
- test/command/defaults7.yaml too large to diff
- test/command/defaults8.yaml too large to diff
- test/command/defaults9.yaml too large to diff
- test/command/din-1505-2.csl too large to diff
- test/command/docbook-bibliography.md too large to diff
- test/command/dokuwiki-quote.md too large to diff
- test/command/dots.md too large to diff
- test/command/duplicate_attributes.md too large to diff
- test/command/emoji.md too large to diff
- test/command/empty_paragraphs.md too large to diff
- test/command/figures-context.md too large to diff
- test/command/figures-fb2.md too large to diff
- test/command/figures-haddock.md too large to diff
- test/command/figures-html.md too large to diff
- test/command/figures-jats.md too large to diff
- test/command/figures-jira.md too large to diff
- test/command/figures-latex.md too large to diff
- test/command/figures-markdown.md too large to diff
- test/command/figures-mediawiki.md too large to diff
- test/command/figures-org.md too large to diff
- test/command/figures-rst.md too large to diff
- test/command/figures-texinfo.md too large to diff
- test/command/figures-textile.md too large to diff
- test/command/figures-xwiki.md too large to diff
- test/command/figures-zimwiki.md too large to diff
- test/command/file1.txt too large to diff
- test/command/file2.txt too large to diff
- test/command/gfm.md too large to diff
- test/command/grid-table-indented.md too large to diff
- test/command/harvard-university-of-kent.csl too large to diff
- test/command/hspace.md too large to diff
- test/command/html-read-figure.md too large to diff
- test/command/html-trim-definition-list-terms.md too large to diff
- test/command/html-writer-a-in-a.md too large to diff
- test/command/hyphenat.md too large to diff
- test/command/ieee.csl too large to diff
- test/command/ifstrequal.md too large to diff
- test/command/indented-fences.md too large to diff
- test/command/inkscape-cube.svg too large to diff
- test/command/input-with-endinput.md too large to diff
- test/command/issue160.csl too large to diff
- test/command/issue437.csl too large to diff
- test/command/issue58.csl too large to diff
- test/command/jabberwocky.md too large to diff
- test/command/jats-figure-alt-text.md too large to diff
- test/command/latex-center.md too large to diff
- test/command/latex-color.md too large to diff
- test/command/latex-command-comment.md too large to diff
- test/command/latex-fontawesome.md too large to diff
- test/command/latex-math-trailing-space.md too large to diff
- test/command/latex-tabular-column-specs.md too large to diff
- test/command/le-tapuscrit-note.csl too large to diff
- test/command/lettrine.md too large to diff
- test/command/lists-inside-definition.md too large to diff
- test/command/locators.csl too large to diff
- test/command/lstlisting.md too large to diff
- test/command/macro-defs-in-preamble.md too large to diff
- test/command/macros.md too large to diff
- test/command/make-section-column-divs.md too large to diff
- test/command/man-defines.md too large to diff
- test/command/md-abbrevs.md too large to diff
- test/command/mdoc-An.md too large to diff
- test/command/mdoc-Bd-unfilled.md too large to diff
- test/command/mdoc-Bl-column.md too large to diff
- test/command/mdoc-Bl-tag.md too large to diff
- test/command/mediawiki_behavior_switches.md too large to diff
- test/command/minimal.svg too large to diff
- test/command/mmd-metadata.md too large to diff
- test/command/modern-humanities-research-association.csl too large to diff
- test/command/multiple-metadata-blocks.md too large to diff
- test/command/nested-spanlike.md too large to diff
- test/command/nested-table-to-asciidoc-6942.md too large to diff
- test/command/newif.md too large to diff
- test/command/oscola.csl too large to diff
- test/command/pandoc-citeproc-118.md too large to diff
- test/command/pandoc-citeproc-119.md too large to diff
- test/command/pandoc-citeproc-13.md too large to diff
- test/command/pandoc-citeproc-136.md too large to diff
- test/command/pandoc-citeproc-14.md too large to diff
- test/command/pandoc-citeproc-152.md too large to diff
- test/command/pandoc-citeproc-160.md too large to diff
- test/command/pandoc-citeproc-175.md too large to diff
- test/command/pandoc-citeproc-197.md too large to diff
- test/command/pandoc-citeproc-213.md too large to diff
- test/command/pandoc-citeproc-25.md too large to diff
- test/command/pandoc-citeproc-250.md too large to diff
- test/command/pandoc-citeproc-27.md too large to diff
- test/command/pandoc-citeproc-292.md too large to diff
- test/command/pandoc-citeproc-301.md too large to diff
- test/command/pandoc-citeproc-307.md too large to diff
- test/command/pandoc-citeproc-31.md too large to diff
- test/command/pandoc-citeproc-312.md too large to diff
- test/command/pandoc-citeproc-320.md too large to diff
- test/command/pandoc-citeproc-320a.md too large to diff
- test/command/pandoc-citeproc-322.md too large to diff
- test/command/pandoc-citeproc-325.md too large to diff
- test/command/pandoc-citeproc-327.md too large to diff
- test/command/pandoc-citeproc-338.md too large to diff
- test/command/pandoc-citeproc-351.md too large to diff
- test/command/pandoc-citeproc-356.md too large to diff
- test/command/pandoc-citeproc-360.md too large to diff
- test/command/pandoc-citeproc-361.md too large to diff
- test/command/pandoc-citeproc-365.md too large to diff
- test/command/pandoc-citeproc-371.md too large to diff
- test/command/pandoc-citeproc-38.md too large to diff
- test/command/pandoc-citeproc-386.md too large to diff
- test/command/pandoc-citeproc-392.md too large to diff
- test/command/pandoc-citeproc-399.md too large to diff
- test/command/pandoc-citeproc-401.md too large to diff
- test/command/pandoc-citeproc-408.md too large to diff
- test/command/pandoc-citeproc-416.md too large to diff
- test/command/pandoc-citeproc-437.md too large to diff
- test/command/pandoc-citeproc-47.md too large to diff
- test/command/pandoc-citeproc-51.md too large to diff
- test/command/pandoc-citeproc-53.md too large to diff
- test/command/pandoc-citeproc-57.md too large to diff
- test/command/pandoc-citeproc-58.md too large to diff
- test/command/pandoc-citeproc-61.md too large to diff
- test/command/pandoc-citeproc-64.md too large to diff
- test/command/pandoc-citeproc-65.md too large to diff
- test/command/pandoc-citeproc-68.md too large to diff
- test/command/pandoc-citeproc-7.md too large to diff
- test/command/pandoc-citeproc-70.md too large to diff
- test/command/pandoc-citeproc-75.md too large to diff
- test/command/pandoc-citeproc-76.md too large to diff
- test/command/pandoc-citeproc-77.md too large to diff
- test/command/pandoc-citeproc-82.md too large to diff
- test/command/pandoc-citeproc-87.md too large to diff
- test/command/pandoc-citeproc-chicago-author-date.md too large to diff
- test/command/pandoc-citeproc-chicago-fullnote-bibliography.md too large to diff
- test/command/pandoc-citeproc-ieee.md too large to diff
- test/command/pandoc-citeproc-locators-delimited.md too large to diff
- test/command/pandoc-citeproc-locators-integrated.md too large to diff
- test/command/pandoc-citeproc-move-period-inside-quote.md too large to diff
- test/command/pandoc-citeproc-no-author.md too large to diff
- test/command/pandoc-citeproc-number-of-volumes.md too large to diff
- test/command/pandoc-citeproc-page-range.md too large to diff
- test/command/parse-raw.md too large to diff
- test/command/pdfstandard.md too large to diff
- test/command/refs.md too large to diff
- test/command/reset-citation-positions.md too large to diff
- test/command/rst-links.md too large to diff
- test/command/rst-writer-gridtable-if-rowspans.md too large to diff
- test/command/rst_block_subst.md too large to diff
- test/command/sage-harvard.csl too large to diff
- test/command/science.csl too large to diff
- test/command/section-divs.md too large to diff
- test/command/setext-fenced-div.md too large to diff
- test/command/shift-heading-level-by.md too large to diff
- test/command/short-caption.md too large to diff
- test/command/sloppypar.md too large to diff
- test/command/smart.md too large to diff
- test/command/style399.csl too large to diff
- test/command/sub-file-chapter-1.tex too large to diff
- test/command/sub-file-chapter-2.tex too large to diff
- test/command/svg.md too large to diff
- test/command/table-with-cell-align.md too large to diff
- test/command/table-with-column-span.md too large to diff
- test/command/tabularx.md too large to diff
- test/command/tasklist.md too large to diff
- test/command/tex-group.md too large to diff
- test/command/three.txt too large to diff
- test/command/toc.md too large to diff
- test/command/translations.md too large to diff
- test/command/typst-hs-80.md too large to diff
- test/command/typst-image-alt.md too large to diff
- test/command/typst-images.md too large to diff
- test/command/typst-property-output.md too large to diff
- test/command/unicode-collation.md too large to diff
- test/command/vancouver.csl too large to diff
- test/command/vars-and-metadata.md too large to diff
- test/command/video-audio.md too large to diff
- test/command/wikilinks_title_after_pipe.md too large to diff
- test/command/wikilinks_title_before_pipe.md too large to diff
- test/command/write18.md too large to diff
- test/command/yaml-metadata-blocks.md too large to diff
- test/command/yaml-metadata.yaml too large to diff
- test/command/yaml-with-chomp.md too large to diff
- test/command/zeitschrift-fur-kunstgeschichte.csl too large to diff
- test/creole-reader.native too large to diff
- test/creole-reader.txt too large to diff
- test/djot-reader.djot too large to diff
- test/djot-reader.native too large to diff
- test/docbook-chapter.docbook too large to diff
- test/docbook-chapter.native too large to diff
- test/docbook-reader.docbook too large to diff
- test/docbook-reader.native too large to diff
- test/docbook-xref.docbook too large to diff
- test/docbook-xref.native too large to diff
- test/docx/0_level_headers.docx too large to diff
- test/docx/0_level_headers.native too large to diff
- test/docx/adjacent_codeblocks.docx too large to diff
- test/docx/adjacent_codeblocks.native too large to diff
- test/docx/already_auto_ident.docx too large to diff
- test/docx/already_auto_ident.native too large to diff
- test/docx/alternate_document_path.docx too large to diff
- test/docx/alternate_document_path.native too large to diff
- test/docx/anchor_header_after_anchor.docx too large to diff
- test/docx/anchor_header_after_anchor.native too large to diff
- test/docx/block_quotes.docx too large to diff
- test/docx/block_quotes.native too large to diff
- test/docx/char_styles.docx too large to diff
- test/docx/char_styles.native too large to diff
- test/docx/codeblock.docx too large to diff
- test/docx/codeblock.native too large to diff
- test/docx/comments.docx too large to diff
- test/docx/comments.native too large to diff
- test/docx/comments_no_comments.native too large to diff
- test/docx/comments_warning.docx too large to diff
- test/docx/compact-style-removal.docx too large to diff
- test/docx/compact-style-removal.native too large to diff
- test/docx/cross_reference.docx too large to diff
- test/docx/cross_reference.native too large to diff
- test/docx/custom-style-no-styles.native too large to diff
- test/docx/custom-style-preserve.native too large to diff
- test/docx/custom-style-reference.docx too large to diff
- test/docx/custom-style-roundtrip-end.native too large to diff
- test/docx/custom-style-with-styles.native too large to diff
- test/docx/custom_style.native too large to diff
- test/docx/deep_normalize.docx too large to diff
- test/docx/deep_normalize.native too large to diff
- test/docx/definition_list.docx too large to diff
- test/docx/definition_list.native too large to diff
- test/docx/diagram.docx too large to diff
- test/docx/diagram.native too large to diff
- test/docx/document-properties-short-desc.native too large to diff
- test/docx/document-properties.native too large to diff
- test/docx/drop_cap.docx too large to diff
- test/docx/drop_cap.native too large to diff
- test/docx/dummy_item_after_list_item.docx too large to diff
- test/docx/dummy_item_after_list_item.native too large to diff
- test/docx/dummy_item_after_paragraph.docx too large to diff
- test/docx/dummy_item_after_paragraph.native too large to diff
- test/docx/empty_field.docx too large to diff
- test/docx/empty_field.native too large to diff
- test/docx/enumerated_headings.docx too large to diff
- test/docx/enumerated_headings.native too large to diff
- test/docx/german-reference.docx too large to diff
- test/docx/german_styled_lists.docx too large to diff
- test/docx/german_styled_lists.native too large to diff
- test/docx/golden/block_quotes.docx too large to diff
- test/docx/golden/codeblock.docx too large to diff
- test/docx/golden/comments.docx too large to diff
- test/docx/golden/custom_style_no_reference.docx too large to diff
- test/docx/golden/custom_style_preserve.docx too large to diff
- test/docx/golden/custom_style_reference.docx too large to diff
- test/docx/golden/definition_list.docx too large to diff
- test/docx/golden/document-properties-short-desc.docx too large to diff
- test/docx/golden/document-properties.docx too large to diff
- test/docx/golden/headers.docx too large to diff
- test/docx/golden/image.docx too large to diff
- test/docx/golden/inline_code.docx too large to diff
- test/docx/golden/inline_formatting.docx too large to diff
- test/docx/golden/inline_images.docx too large to diff
- test/docx/golden/link_in_notes.docx too large to diff
- test/docx/golden/links.docx too large to diff
- test/docx/golden/lists.docx too large to diff
- test/docx/golden/lists_9994.docx too large to diff
- test/docx/golden/lists_continuing.docx too large to diff
- test/docx/golden/lists_div_bullets.docx too large to diff
- test/docx/golden/lists_multiple_initial.docx too large to diff
- test/docx/golden/lists_restarting.docx too large to diff
- test/docx/golden/nested_anchors_in_header.docx too large to diff
- test/docx/golden/notes.docx too large to diff
- test/docx/golden/raw-blocks.docx too large to diff
- test/docx/golden/raw-bookmarks.docx too large to diff
- test/docx/golden/table_one_row.docx too large to diff
- test/docx/golden/table_with_list_cell.docx too large to diff
- test/docx/golden/tables-default-widths.docx too large to diff
- test/docx/golden/tables.docx too large to diff
- test/docx/golden/tables_separated_with_rawblock.docx too large to diff
- test/docx/golden/task_list.docx too large to diff
- test/docx/golden/track_changes_deletion.docx too large to diff
- test/docx/golden/track_changes_insertion.docx too large to diff
- test/docx/golden/track_changes_move.docx too large to diff
- test/docx/golden/track_changes_scrubbed_metadata.docx too large to diff
- test/docx/golden/unicode.docx too large to diff
- test/docx/golden/verbatim_subsuper.docx too large to diff
- test/docx/hanging_indent.docx too large to diff
- test/docx/hanging_indent.native too large to diff
- test/docx/headers.docx too large to diff
- test/docx/headers.native too large to diff
- test/docx/i18n_blocks.docx too large to diff
- test/docx/i18n_blocks.native too large to diff
- test/docx/image.docx too large to diff
- test/docx/image_no_embed.native too large to diff
- test/docx/image_no_embed_writer.native too large to diff
- test/docx/image_vml.docx too large to diff
- test/docx/image_vml.native too large to diff
- test/docx/image_vml_as_object.docx too large to diff
- test/docx/image_vml_as_object.native too large to diff
- test/docx/image_with_textbox_caption.docx too large to diff
- test/docx/image_with_textbox_caption.native too large to diff
- test/docx/image_writer_test.native too large to diff
- test/docx/inline_code.docx too large to diff
- test/docx/inline_code.native too large to diff
- test/docx/inline_formatting.docx too large to diff
- test/docx/inline_formatting.native too large to diff
- test/docx/inline_formatting_writer.native too large to diff
- test/docx/inline_images.docx too large to diff
- test/docx/inline_images.native too large to diff
- test/docx/inline_images_writer.native too large to diff
- test/docx/inline_images_writer_test.native too large to diff
- test/docx/instrText_hyperlink.docx too large to diff
- test/docx/instrText_hyperlink.native too large to diff
- test/docx/link_in_notes.docx too large to diff
- test/docx/link_in_notes.native too large to diff
- test/docx/links.docx too large to diff
- test/docx/links.native too large to diff
- test/docx/links_writer.native too large to diff
- test/docx/lists-compact.docx too large to diff
- test/docx/lists-compact.native too large to diff
- test/docx/lists.docx too large to diff
- test/docx/lists.native too large to diff
- test/docx/lists_9994.native too large to diff
- test/docx/lists_continuing.docx too large to diff
- test/docx/lists_continuing.native too large to diff
- test/docx/lists_div_bullets.native too large to diff
- test/docx/lists_level_override.docx too large to diff
- test/docx/lists_level_override.native too large to diff
- test/docx/lists_multiple_initial.native too large to diff
- test/docx/lists_restarting.docx too large to diff
- test/docx/lists_restarting.native too large to diff
- test/docx/lists_sublist_reset.docx too large to diff
- test/docx/lists_sublist_reset.native too large to diff
- test/docx/lists_writer.native too large to diff
- test/docx/mendeley_citations.docx too large to diff
- test/docx/mendeley_citations_minus.native too large to diff
- test/docx/mendeley_citations_plus.native too large to diff
- test/docx/metadata.docx too large to diff
- test/docx/metadata.native too large to diff
- test/docx/metadata_after_normal.docx too large to diff
- test/docx/metadata_after_normal.native too large to diff
- test/docx/nested_anchors_in_header.docx too large to diff
- test/docx/nested_anchors_in_header.native too large to diff
- test/docx/nested_instrText.docx too large to diff
- test/docx/nested_instrText.native too large to diff
- test/docx/nested_sdt.docx too large to diff
- test/docx/nested_sdt.native too large to diff
- test/docx/nested_smart_tags.docx too large to diff
- test/docx/nested_smart_tags.native too large to diff
- test/docx/normalize.docx too large to diff
- test/docx/normalize.native too large to diff
- test/docx/notes.docx too large to diff
- test/docx/notes.native too large to diff
- test/docx/numbered_header.docx too large to diff
- test/docx/numbered_header.native too large to diff
- test/docx/overlapping_targets.docx too large to diff
- test/docx/overlapping_targets.native too large to diff
- test/docx/pageref.docx too large to diff
- test/docx/pageref.native too large to diff
- test/docx/paragraph_insertion_deletion.docx too large to diff
- test/docx/paragraph_insertion_deletion_accept.native too large to diff
- test/docx/paragraph_insertion_deletion_all.native too large to diff
- test/docx/paragraph_insertion_deletion_reject.native too large to diff
- test/docx/raw-blocks.native too large to diff
- test/docx/raw-bookmarks.native too large to diff
- test/docx/relative_indentation_blockquotes.docx too large to diff
- test/docx/relative_indentation_blockquotes.native too large to diff
- test/docx/sdt_elements.docx too large to diff
- test/docx/sdt_elements.native too large to diff
- test/docx/sdt_in_footnote.docx too large to diff
- test/docx/sdt_in_footnote.native too large to diff
- test/docx/special_punctuation.docx too large to diff
- test/docx/special_punctuation.native too large to diff
- test/docx/table_captions_no_field.docx too large to diff
- test/docx/table_captions_no_field.native too large to diff
- test/docx/table_captions_with_field.docx too large to diff
- test/docx/table_captions_with_field.native too large to diff
- test/docx/table_gridbefore.docx too large to diff
- test/docx/table_gridbefore.native too large to diff
- test/docx/table_header_rowspan.docx too large to diff
- test/docx/table_header_rowspan.native too large to diff
- test/docx/table_one_header_row.docx too large to diff
- test/docx/table_one_header_row.native too large to diff
- test/docx/table_one_row.docx too large to diff
- test/docx/table_one_row.native too large to diff
- test/docx/table_variable_width.docx too large to diff
- test/docx/table_variable_width.native too large to diff
- test/docx/table_with_list_cell.docx too large to diff
- test/docx/table_with_list_cell.native too large to diff
- test/docx/tables-default-widths.native too large to diff
- test/docx/tables.docx too large to diff
- test/docx/tables.native too large to diff
- test/docx/tables_separated_with_rawblock.native too large to diff
- test/docx/tabs.docx too large to diff
- test/docx/tabs.native too large to diff
- test/docx/task_list.docx too large to diff
- test/docx/task_list.native too large to diff
- test/docx/text_in_shape_format.docx too large to diff
- test/docx/text_in_shape_format.native too large to diff
- test/docx/textbox_image.docx too large to diff
- test/docx/textbox_image.native too large to diff
- test/docx/textbox_image_duplicate_encoding.docx too large to diff
- test/docx/textbox_image_duplicate_encoding.native too large to diff
- test/docx/track_changes_deletion.docx too large to diff
- test/docx/track_changes_deletion_accept.native too large to diff
- test/docx/track_changes_deletion_all.native too large to diff
- test/docx/track_changes_deletion_reject.native too large to diff
- test/docx/track_changes_insertion.docx too large to diff
- test/docx/track_changes_insertion_accept.native too large to diff
- test/docx/track_changes_insertion_all.native too large to diff
- test/docx/track_changes_insertion_reject.native too large to diff
- test/docx/track_changes_move.docx too large to diff
- test/docx/track_changes_move_accept.native too large to diff
- test/docx/track_changes_move_all.native too large to diff
- test/docx/track_changes_move_reject.native too large to diff
- test/docx/track_changes_scrubbed_metadata.docx too large to diff
- test/docx/track_changes_scrubbed_metadata.native too large to diff
- test/docx/trailing_spaces_in_formatting.docx too large to diff
- test/docx/trailing_spaces_in_formatting.native too large to diff
- test/docx/trim_last_inline.docx too large to diff
- test/docx/trim_last_inline.native too large to diff
- test/docx/unicode.docx too large to diff
- test/docx/unicode.native too large to diff
- test/docx/unused_anchors.docx too large to diff
- test/docx/unused_anchors.native too large to diff
- test/docx/verbatim_subsuper.docx too large to diff
- test/docx/verbatim_subsuper.native too large to diff
- test/docx/zotero_citations.docx too large to diff
- test/docx/zotero_citations_minus.native too large to diff
- test/docx/zotero_citations_plus.native too large to diff
- test/dokuwiki_external_images.dokuwiki too large to diff
- test/dokuwiki_external_images.native too large to diff
- test/dokuwiki_inline_formatting.dokuwiki too large to diff
- test/dokuwiki_inline_formatting.native too large to diff
- test/dokuwiki_multiblock_table.dokuwiki too large to diff
- test/dokuwiki_multiblock_table.native too large to diff
- test/endnotexml-reader.native too large to diff
- test/endnotexml-reader.xml too large to diff
- test/epub/epub2_cover.epub too large to diff
- test/epub/epub2_no_cover.epub too large to diff
- test/epub/epub2_picture.epub too large to diff
- test/epub/features.epub too large to diff
- test/epub/features.native too large to diff
- test/epub/formatting.epub too large to diff
- test/epub/formatting.native too large to diff
- test/epub/img.epub too large to diff
- test/epub/img_no_cover.epub too large to diff
- test/epub/wasteland.epub too large to diff
- test/epub/wasteland.native too large to diff
- test/fb2/basic.fb2 too large to diff
- test/fb2/basic.markdown too large to diff
- test/fb2/images-embedded.fb2 too large to diff
- test/fb2/images-embedded.html too large to diff
- test/fb2/images.fb2 too large to diff
- test/fb2/images.markdown too large to diff
- test/fb2/math.fb2 too large to diff
- test/fb2/math.markdown too large to diff
- test/fb2/meta.fb2 too large to diff
- test/fb2/meta.markdown too large to diff
- test/fb2/reader/emphasis.fb2 too large to diff
- test/fb2/reader/emphasis.native too large to diff
- test/fb2/reader/epigraph.fb2 too large to diff
- test/fb2/reader/epigraph.native too large to diff
- test/fb2/reader/meta.fb2 too large to diff
- test/fb2/reader/meta.native too large to diff
- test/fb2/reader/notes.fb2 too large to diff
- test/fb2/reader/notes.native too large to diff
- test/fb2/reader/poem.fb2 too large to diff
- test/fb2/reader/poem.native too large to diff
- test/fb2/reader/titles.fb2 too large to diff
- test/fb2/reader/titles.native too large to diff
- test/fb2/test-small.png too large to diff
- test/fb2/test.jpg too large to diff
- test/fb2/titles.fb2 too large to diff
- test/fb2/titles.markdown too large to diff
- test/haddock-reader.haddock too large to diff
- test/haddock-reader.native too large to diff
- test/html-reader.html too large to diff
- test/html-reader.native too large to diff
- test/insert too large to diff
- test/ipynb/mime.ipynb too large to diff
- test/ipynb/mime.native too large to diff
- test/ipynb/mime.out.ipynb too large to diff
- test/ipynb/rank.ipynb too large to diff
- test/ipynb/rank.out.html too large to diff
- test/ipynb/simple.in.native too large to diff
- test/ipynb/simple.ipynb too large to diff
- test/ipynb/simple.out.native too large to diff
- test/jats-reader.native too large to diff
- test/jats-reader.xml too large to diff
- test/jira-reader.jira too large to diff
- test/jira-reader.native too large to diff
- test/lalune.jpg too large to diff
- test/latex-reader.latex too large to diff
- test/latex-reader.native too large to diff
- test/lhs-test-markdown.native too large to diff
- test/lhs-test.fragment.html+lhs too large to diff
- test/lhs-test.html too large to diff
- test/lhs-test.html+lhs too large to diff
- test/lhs-test.latex too large to diff
- test/lhs-test.latex+lhs too large to diff
- test/lhs-test.markdown too large to diff
- test/lhs-test.markdown+lhs too large to diff
- test/lhs-test.native too large to diff
- test/lhs-test.rst too large to diff
- test/lhs-test.rst+lhs too large to diff
- test/man-reader.man too large to diff
- test/man-reader.native too large to diff
- test/markdown-citations.native too large to diff
- test/markdown-citations.txt too large to diff
- test/markdown-reader-more.native too large to diff
- test/markdown-reader-more.txt too large to diff
- test/media/rId25.jpg too large to diff
- test/media/rId26.jpg too large to diff
- test/media/rId27.jpg too large to diff
- test/mediawiki-reader.native too large to diff
- test/mediawiki-reader.wiki too large to diff
- test/movie.jpg too large to diff
- test/odt/markdown/blockquote2.md too large to diff
- test/odt/markdown/bold.md too large to diff
- test/odt/markdown/citation.md too large to diff
- test/odt/markdown/endnote.md too large to diff
- test/odt/markdown/externalLink.md too large to diff
- test/odt/markdown/footnote.md too large to diff
- test/odt/markdown/formula.md too large to diff
- test/odt/markdown/headers.md too large to diff
- test/odt/markdown/horizontalRule.md too large to diff
- test/odt/markdown/image.md too large to diff
- test/odt/markdown/imageIndex.md too large to diff
- test/odt/markdown/imageWithCaption.md too large to diff
- test/odt/markdown/italic.md too large to diff
- test/odt/markdown/listBlocks.md too large to diff
- test/odt/markdown/paragraph.md too large to diff
- test/odt/markdown/strikeout.md too large to diff
- test/odt/markdown/trackedChanges.md too large to diff
- test/odt/markdown/underlined.md too large to diff
- test/odt/native/blockquote.native too large to diff
- test/odt/native/image.native too large to diff
- test/odt/native/imageIndex.native too large to diff
- test/odt/native/imageRelative.native too large to diff
- test/odt/native/imageWithCaption.native too large to diff
- test/odt/native/inlinedCode.native too large to diff
- test/odt/native/listContinueNumbering.native too large to diff
- test/odt/native/listContinueNumbering2.native too large to diff
- test/odt/native/orderedListHeader.native too large to diff
- test/odt/native/orderedListMixed.native too large to diff
- test/odt/native/orderedListRoman.native too large to diff
- test/odt/native/orderedListSimple.native too large to diff
- test/odt/native/preformattedText.native too large to diff
- test/odt/native/preformattedTextParentStyle.native too large to diff
- test/odt/native/referenceToChapter.native too large to diff
- test/odt/native/referenceToListItem.native too large to diff
- test/odt/native/referenceToText.native too large to diff
- test/odt/native/simpleTable.native too large to diff
- test/odt/native/simpleTableWithCaption.native too large to diff
- test/odt/native/simpleTableWithHeader.native too large to diff
- test/odt/native/simpleTableWithMultipleHeaderRows.native too large to diff
- test/odt/native/sourceText.native too large to diff
- test/odt/native/tab.native too large to diff
- test/odt/native/tableWithContents.native too large to diff
- test/odt/native/tableWithSpans.native too large to diff
- test/odt/native/textMixedStyles.native too large to diff
- test/odt/native/unicode.native too large to diff
- test/odt/native/unorderedList.native too large to diff
- test/odt/native/unorderedListHeader.native too large to diff
- test/odt/odt/blockquote.odt too large to diff
- test/odt/odt/blockquote2.odt too large to diff
- test/odt/odt/bold.odt too large to diff
- test/odt/odt/citation.odt too large to diff
- test/odt/odt/endnote.odt too large to diff
- test/odt/odt/expression.odt too large to diff
- test/odt/odt/expressionUnevaluated.odt too large to diff
- test/odt/odt/externalLink.odt too large to diff
- test/odt/odt/footnote.odt too large to diff
- test/odt/odt/formula.odt too large to diff
- test/odt/odt/headers.odt too large to diff
- test/odt/odt/hiddenTextByStyle.odt too large to diff
- test/odt/odt/hiddenTextByVariable.odt too large to diff
- test/odt/odt/horizontalRule.odt too large to diff
- test/odt/odt/image.odt too large to diff
- test/odt/odt/imageIndex.odt too large to diff
- test/odt/odt/imageRelative.odt too large to diff
- test/odt/odt/imageWithCaption.odt too large to diff
- test/odt/odt/inlinedCode.odt too large to diff
- test/odt/odt/italic.odt too large to diff
- test/odt/odt/listBlocks.odt too large to diff
- test/odt/odt/listContinueNumbering.odt too large to diff
- test/odt/odt/listContinueNumbering2.odt too large to diff
- test/odt/odt/orderedListHeader.odt too large to diff
- test/odt/odt/orderedListMixed.odt too large to diff
- test/odt/odt/orderedListRoman.odt too large to diff
- test/odt/odt/orderedListSimple.odt too large to diff
- test/odt/odt/paragraph.odt too large to diff
- test/odt/odt/preformattedText.odt too large to diff
- test/odt/odt/preformattedTextParentStyle.odt too large to diff
- test/odt/odt/referenceAllInOne.odt too large to diff
- test/odt/odt/referenceToChapter.odt too large to diff
- test/odt/odt/referenceToListItem.odt too large to diff
- test/odt/odt/referenceToText.odt too large to diff
- test/odt/odt/simpleTable.odt too large to diff
- test/odt/odt/simpleTableWithCaption.odt too large to diff
- test/odt/odt/simpleTableWithHeader.odt too large to diff
- test/odt/odt/simpleTableWithMultipleHeaderRows.odt too large to diff
- test/odt/odt/sourceText.odt too large to diff
- test/odt/odt/strikeout.odt too large to diff
- test/odt/odt/tab.odt too large to diff
- test/odt/odt/table.odt too large to diff
- test/odt/odt/tableWithCaption.odt too large to diff
- test/odt/odt/tableWithContents.odt too large to diff
- test/odt/odt/tableWithSpans.odt too large to diff
- test/odt/odt/textMixedStyles.odt too large to diff
- test/odt/odt/trackedChanges.odt too large to diff
- test/odt/odt/underlined.odt too large to diff
- test/odt/odt/unicode.odt too large to diff
- test/odt/odt/unorderedList.odt too large to diff
- test/odt/odt/unorderedListHeader.odt too large to diff
- test/odt/odt/variable.odt too large to diff
- test/opml-reader.native too large to diff
- test/opml-reader.opml too large to diff
- test/org-select-tags.native too large to diff
- test/org-select-tags.org too large to diff
- test/pipe-tables.native too large to diff
- test/pipe-tables.txt too large to diff
- test/pod-reader.native too large to diff
- test/pod-reader.pod too large to diff
- test/pptx-reader/basic.native too large to diff
- test/pptx-reader/basic.pptx too large to diff
- test/pptx/background-image/input.native too large to diff
- test/pptx/background-image/output.pptx too large to diff
- test/pptx/background-image/templated.pptx too large to diff
- test/pptx/blanks/just-speaker-notes/input.native too large to diff
- test/pptx/blanks/just-speaker-notes/output.pptx too large to diff
- test/pptx/blanks/just-speaker-notes/templated.pptx too large to diff
- test/pptx/blanks/nbsp-in-body/input.native too large to diff
- test/pptx/blanks/nbsp-in-body/output.pptx too large to diff
- test/pptx/blanks/nbsp-in-body/templated.pptx too large to diff
- test/pptx/blanks/nbsp-in-heading/input.native too large to diff
- test/pptx/blanks/nbsp-in-heading/output.pptx too large to diff
- test/pptx/blanks/nbsp-in-heading/templated.pptx too large to diff
- test/pptx/code-custom/output.pptx too large to diff
- test/pptx/code-custom/templated.pptx too large to diff
- test/pptx/code/input.native too large to diff
- test/pptx/code/output.pptx too large to diff
- test/pptx/code/templated.pptx too large to diff
- test/pptx/comparison/both-columns/input.native too large to diff
- test/pptx/comparison/both-columns/output.pptx too large to diff
- test/pptx/comparison/both-columns/templated.pptx too large to diff
- test/pptx/comparison/extra-image/input.native too large to diff
- test/pptx/comparison/extra-image/output.pptx too large to diff
- test/pptx/comparison/extra-image/templated.pptx too large to diff
- test/pptx/comparison/extra-text/input.native too large to diff
- test/pptx/comparison/extra-text/output.pptx too large to diff
- test/pptx/comparison/extra-text/templated.pptx too large to diff
- test/pptx/comparison/non-text-first/input.native too large to diff
- test/pptx/comparison/non-text-first/output.pptx too large to diff
- test/pptx/comparison/non-text-first/templated.pptx too large to diff
- test/pptx/comparison/one-column/input.native too large to diff
- test/pptx/comparison/one-column/output.pptx too large to diff
- test/pptx/comparison/one-column/templated.pptx too large to diff
- test/pptx/content-with-caption/heading-text-image/input.native too large to diff
- test/pptx/content-with-caption/heading-text-image/output.pptx too large to diff
- test/pptx/content-with-caption/heading-text-image/templated.pptx too large to diff
- test/pptx/content-with-caption/image-text/input.native too large to diff
- test/pptx/content-with-caption/image-text/output.pptx too large to diff
- test/pptx/content-with-caption/image-text/templated.pptx too large to diff
- test/pptx/content-with-caption/text-image/input.native too large to diff
- test/pptx/content-with-caption/text-image/output.pptx too large to diff
- test/pptx/content-with-caption/text-image/templated.pptx too large to diff
- test/pptx/document-properties-short-desc/input.native too large to diff
- test/pptx/document-properties-short-desc/output.pptx too large to diff
- test/pptx/document-properties-short-desc/templated.pptx too large to diff
- test/pptx/document-properties/input.native too large to diff
- test/pptx/document-properties/output.pptx too large to diff
- test/pptx/document-properties/templated.pptx too large to diff
- test/pptx/endnotes-toc/output.pptx too large to diff
- test/pptx/endnotes-toc/templated.pptx too large to diff
- test/pptx/endnotes/input.native too large to diff
- test/pptx/endnotes/output.pptx too large to diff
- test/pptx/endnotes/templated.pptx too large to diff
- test/pptx/footer/basic/output.pptx too large to diff
- test/pptx/footer/basic/reference.pptx too large to diff
- test/pptx/footer/fixed-date/output.pptx too large to diff
- test/pptx/footer/fixed-date/reference.pptx too large to diff
- test/pptx/footer/higher-slide-number/output.pptx too large to diff
- test/pptx/footer/higher-slide-number/reference.pptx too large to diff
- test/pptx/footer/input.native too large to diff
- test/pptx/footer/no-title-slide/output.pptx too large to diff
- test/pptx/footer/no-title-slide/reference.pptx too large to diff
- test/pptx/images/input.native too large to diff
- test/pptx/images/output.pptx too large to diff
- test/pptx/images/templated.pptx too large to diff
- test/pptx/incremental-lists/with-flag/input.native too large to diff
- test/pptx/incremental-lists/with-flag/output.pptx too large to diff
- test/pptx/incremental-lists/with-flag/templated.pptx too large to diff
- test/pptx/incremental-lists/without-flag/input.native too large to diff
- test/pptx/incremental-lists/without-flag/output.pptx too large to diff
- test/pptx/incremental-lists/without-flag/templated.pptx too large to diff
- test/pptx/inline-formatting/input.native too large to diff
- test/pptx/inline-formatting/output.pptx too large to diff
- test/pptx/inline-formatting/templated.pptx too large to diff
- test/pptx/layouts/deleted.pptx too large to diff
- test/pptx/layouts/input.native too large to diff
- test/pptx/layouts/moved.pptx too large to diff
- test/pptx/list-level/input.native too large to diff
- test/pptx/list-level/output.pptx too large to diff
- test/pptx/list-level/templated.pptx too large to diff
- test/pptx/lists/input.native too large to diff
- test/pptx/lists/output.pptx too large to diff
- test/pptx/lists/templated.pptx too large to diff
- test/pptx/metadata-speaker-notes/input.native too large to diff
- test/pptx/metadata-speaker-notes/output.pptx too large to diff
- test/pptx/metadata-speaker-notes/templated.pptx too large to diff
- test/pptx/pauses/without-incremental/output.pptx too large to diff
- test/pptx/pauses/without-incremental/templated.pptx too large to diff
- test/pptx/raw-ooxml/input.native too large to diff
- test/pptx/raw-ooxml/output.pptx too large to diff
- test/pptx/raw-ooxml/templated.pptx too large to diff
- test/pptx/reference-deleted-layouts.pptx too large to diff
- test/pptx/reference-depth.pptx too large to diff
- test/pptx/reference-moved-layouts.pptx too large to diff
- test/pptx/reference-no-slides.pptx too large to diff
- test/pptx/reference-no-slides/add-slides/input.native too large to diff
- test/pptx/reference-no-slides/add-slides/output.pptx too large to diff
- test/pptx/reference-no-slides/with-notes/input.native too large to diff
- test/pptx/reference-no-slides/with-notes/output.pptx too large to diff
- test/pptx/remove-empty-slides/input.native too large to diff
- test/pptx/remove-empty-slides/output.pptx too large to diff
- test/pptx/remove-empty-slides/templated.pptx too large to diff
- test/pptx/single-column/image/input.native too large to diff
- test/pptx/single-column/image/output.pptx too large to diff
- test/pptx/single-column/image/templated.pptx too large to diff
- test/pptx/single-column/text/input.native too large to diff
- test/pptx/single-column/text/output.pptx too large to diff
- test/pptx/single-column/text/templated.pptx too large to diff
- test/pptx/slide-breaks-slide-level-1/output.pptx too large to diff
- test/pptx/slide-breaks-slide-level-1/templated.pptx too large to diff
- test/pptx/slide-breaks-toc/output.pptx too large to diff
- test/pptx/slide-breaks-toc/templated.pptx too large to diff
- test/pptx/slide-breaks/input.native too large to diff
- test/pptx/slide-breaks/output.pptx too large to diff
- test/pptx/slide-breaks/templated.pptx too large to diff
- test/pptx/slide-level-0/h1-h2-with-table/input.native too large to diff
- test/pptx/slide-level-0/h1-h2-with-table/output.pptx too large to diff
- test/pptx/slide-level-0/h1-h2-with-table/templated.pptx too large to diff
- test/pptx/slide-level-0/h1-with-image/input.native too large to diff
- test/pptx/slide-level-0/h1-with-image/output.pptx too large to diff
- test/pptx/slide-level-0/h1-with-image/templated.pptx too large to diff
- test/pptx/slide-level-0/h1-with-table/input.native too large to diff
- test/pptx/slide-level-0/h1-with-table/output.pptx too large to diff
- test/pptx/slide-level-0/h1-with-table/templated.pptx too large to diff
- test/pptx/slide-level-0/h2-with-image/input.native too large to diff
- test/pptx/slide-level-0/h2-with-image/output.pptx too large to diff
- test/pptx/slide-level-0/h2-with-image/templated.pptx too large to diff
- test/pptx/speaker-notes-after-metadata/input.native too large to diff
- test/pptx/speaker-notes-after-metadata/output.pptx too large to diff
- test/pptx/speaker-notes-after-metadata/templated.pptx too large to diff
- test/pptx/speaker-notes-afterheader/input.native too large to diff
- test/pptx/speaker-notes-afterheader/output.pptx too large to diff
- test/pptx/speaker-notes-afterheader/templated.pptx too large to diff
- test/pptx/speaker-notes-afterseps/input.native too large to diff
- test/pptx/speaker-notes-afterseps/output.pptx too large to diff
- test/pptx/speaker-notes-afterseps/templated.pptx too large to diff
- test/pptx/speaker-notes/input.native too large to diff
- test/pptx/speaker-notes/output.pptx too large to diff
- test/pptx/speaker-notes/templated.pptx too large to diff
- test/pptx/start-numbering-at/input.native too large to diff
- test/pptx/start-numbering-at/output.pptx too large to diff
- test/pptx/start-numbering-at/templated.pptx too large to diff
- test/pptx/tables/input.native too large to diff
- test/pptx/tables/output.pptx too large to diff
- test/pptx/tables/templated.pptx too large to diff
- test/pptx/two-column/all-text/input.native too large to diff
- test/pptx/two-column/all-text/output.pptx too large to diff
- test/pptx/two-column/all-text/templated.pptx too large to diff
- test/pptx/two-column/text-and-image/input.native too large to diff
- test/pptx/two-column/text-and-image/output.pptx too large to diff
- test/pptx/two-column/text-and-image/templated.pptx too large to diff
- test/rst-reader.native too large to diff
- test/rst-reader.rst too large to diff
- test/rtf/accent.native too large to diff
- test/rtf/accent.rtf too large to diff
- test/rtf/bookmark.native too large to diff
- test/rtf/bookmark.rtf too large to diff
- test/rtf/footnote.native too large to diff
- test/rtf/footnote.rtf too large to diff
- test/rtf/formatting.native too large to diff
- test/rtf/formatting.rtf too large to diff
- test/rtf/heading.native too large to diff
- test/rtf/heading.rtf too large to diff
- test/rtf/image.native too large to diff
- test/rtf/image.rtf too large to diff
- test/rtf/link.native too large to diff
- test/rtf/link.rtf too large to diff
- test/rtf/list_complex.native too large to diff
- test/rtf/list_complex.rtf too large to diff
- test/rtf/list_simple.native too large to diff
- test/rtf/list_simple.rtf too large to diff
- test/rtf/table_error_codes.native too large to diff
- test/rtf/table_error_codes.rtf too large to diff
- test/rtf/table_simple.native too large to diff
- test/rtf/table_simple.rtf too large to diff
- test/rtf/unicode.native too large to diff
- test/rtf/unicode.rtf too large to diff
- test/s5-basic.html too large to diff
- test/s5-fancy.html too large to diff
- test/s5-fragment.html too large to diff
- test/s5-inserts.html too large to diff
- test/s5.native too large to diff
- test/tables-rstsubset.native too large to diff
- test/tables.asciidoc too large to diff
- test/tables.asciidoc_legacy too large to diff
- test/tables.bbcode too large to diff
- test/tables.context too large to diff
- test/tables.djot too large to diff
- test/tables.docbook4 too large to diff
- test/tables.docbook5 too large to diff
- test/tables.dokuwiki too large to diff
- test/tables.fb2 too large to diff
- test/tables.haddock too large to diff
- test/tables.html4 too large to diff
- test/tables.html5 too large to diff
- test/tables.icml too large to diff
- test/tables.jats_archiving too large to diff
- test/tables.jats_articleauthoring too large to diff
- test/tables.jats_publishing too large to diff
- test/tables.jira too large to diff
- test/tables.latex too large to diff
- test/tables.man too large to diff
- test/tables.markdown too large to diff
- test/tables.markua too large to diff
- test/tables.mediawiki too large to diff
- test/tables.ms too large to diff
- test/tables.muse too large to diff
- test/tables.native too large to diff
- test/tables.opendocument too large to diff
- test/tables.org too large to diff
- test/tables.plain too large to diff
- test/tables.rst too large to diff
- test/tables.rtf too large to diff
- test/tables.tei too large to diff
- test/tables.texinfo too large to diff
- test/tables.textile too large to diff
- test/tables.txt too large to diff
- test/tables.typst too large to diff
- test/tables.vimdoc too large to diff
- test/tables.xwiki too large to diff
- test/tables.zimwiki too large to diff
- test/tables/nordics.html4 too large to diff
- test/tables/nordics.html5 too large to diff
- test/tables/nordics.jats_archiving too large to diff
- test/tables/nordics.latex too large to diff
- test/tables/nordics.markdown too large to diff
- test/tables/nordics.mediawiki too large to diff
- test/tables/nordics.native too large to diff
- test/tables/nordics.typst too large to diff
- test/tables/planets.html4 too large to diff
- test/tables/planets.html5 too large to diff
- test/tables/planets.jats_archiving too large to diff
- test/tables/planets.latex too large to diff
- test/tables/planets.markdown too large to diff
- test/tables/planets.mediawiki too large to diff
- test/tables/planets.native too large to diff
- test/tables/planets.typst too large to diff
- test/tables/students.html4 too large to diff
- test/tables/students.html5 too large to diff
- test/tables/students.jats_archiving too large to diff
- test/tables/students.latex too large to diff
- test/tables/students.markdown too large to diff
- test/tables/students.mediawiki too large to diff
- test/tables/students.native too large to diff
- test/tables/students.typst too large to diff
- test/test-pandoc.hs too large to diff
- test/testsuite.native too large to diff
- test/testsuite.txt too large to diff
- test/textile-reader.native too large to diff
- test/textile-reader.textile too large to diff
- test/tikiwiki-reader.native too large to diff
- test/tikiwiki-reader.tikiwiki too large to diff
- test/twiki-reader.native too large to diff
- test/twiki-reader.twiki too large to diff
- test/txt2tags.native too large to diff
- test/txt2tags.t2t too large to diff
- test/typst-reader.native too large to diff
- test/typst-reader.typ too large to diff
- test/undergradmath.typ too large to diff
- test/vimdoc/definition-lists.markdown too large to diff
- test/vimdoc/definition-lists.vimdoc too large to diff
- test/vimdoc/headers-numbered.vimdoc too large to diff
- test/vimdoc/headers.markdown too large to diff
- test/vimdoc/headers.vimdoc too large to diff
- test/vimdoc/vim-online-doc.markdown too large to diff
- test/vimdoc/vim-online-doc.vimdoc too large to diff
- test/vimwiki-reader.native too large to diff
- test/vimwiki-reader.wiki too large to diff
- test/writer.asciidoc too large to diff
- test/writer.asciidoc_legacy too large to diff
- test/writer.bbcode too large to diff
- test/writer.context too large to diff
- test/writer.djot too large to diff
- test/writer.docbook4 too large to diff
- test/writer.docbook5 too large to diff
- test/writer.dokuwiki too large to diff
- test/writer.fb2 too large to diff
- test/writer.haddock too large to diff
- test/writer.html4 too large to diff
- test/writer.html5 too large to diff
- test/writer.icml too large to diff
- test/writer.jats_archiving too large to diff
- test/writer.jats_articleauthoring too large to diff
- test/writer.jats_publishing too large to diff
- test/writer.jira too large to diff
- test/writer.latex too large to diff
- test/writer.man too large to diff
- test/writer.markdown too large to diff
- test/writer.markua too large to diff
- test/writer.mediawiki too large to diff
- test/writer.ms too large to diff
- test/writer.muse too large to diff
- test/writer.native too large to diff
- test/writer.opendocument too large to diff
- test/writer.opml too large to diff
- test/writer.org too large to diff
- test/writer.plain too large to diff
- test/writer.rst too large to diff
- test/writer.rtf too large to diff
- test/writer.tei too large to diff
- test/writer.texinfo too large to diff
- test/writer.textile too large to diff
- test/writer.typst too large to diff
- test/writer.vimdoc too large to diff
- test/writer.xwiki too large to diff
- test/writer.zimwiki too large to diff
- test/writers-lang-and-dir.context too large to diff
- test/writers-lang-and-dir.latex too large to diff
- test/writers-lang-and-dir.native too large to diff
- test/xlsx-reader/basic.native too large to diff
- test/xlsx-reader/basic.xlsx too large to diff
- tests/Tests/Arbitrary.hs too large to diff
- tests/Tests/Helpers.hs too large to diff
- tests/Tests/Old.hs too large to diff
- tests/Tests/Readers/Docx.hs too large to diff
- tests/Tests/Readers/EPUB.hs too large to diff
- tests/Tests/Readers/LaTeX.hs too large to diff
- tests/Tests/Readers/Markdown.hs too large to diff
- tests/Tests/Readers/Org.hs too large to diff
- tests/Tests/Readers/RST.hs too large to diff
- tests/Tests/Readers/Txt2Tags.hs too large to diff
- tests/Tests/Shared.hs too large to diff
- tests/Tests/Walk.hs too large to diff
- tests/Tests/Writers/AsciiDoc.hs too large to diff
- tests/Tests/Writers/ConTeXt.hs too large to diff
- tests/Tests/Writers/Docbook.hs too large to diff
- tests/Tests/Writers/HTML.hs too large to diff
- tests/Tests/Writers/LaTeX.hs too large to diff
- tests/Tests/Writers/Markdown.hs too large to diff
- tests/Tests/Writers/Native.hs too large to diff
- tests/Tests/Writers/Plain.hs too large to diff
- tests/bodybg.gif too large to diff
- tests/docbook-reader.docbook too large to diff
- tests/docbook-reader.native too large to diff
- tests/docx/already_auto_ident.docx too large to diff
- tests/docx/already_auto_ident.native too large to diff
- tests/docx/block_quotes.docx too large to diff
- tests/docx/block_quotes_parse_indent.native too large to diff
- tests/docx/char_styles.docx too large to diff
- tests/docx/char_styles.native too large to diff
- tests/docx/codeblock.docx too large to diff
- tests/docx/codeblock.native too large to diff
- tests/docx/deep_normalize.docx too large to diff
- tests/docx/deep_normalize.native too large to diff
- tests/docx/definition_list.docx too large to diff
- tests/docx/definition_list.native too large to diff
- tests/docx/drop_cap.docx too large to diff
- tests/docx/drop_cap.native too large to diff
- tests/docx/hanging_indent.docx too large to diff
- tests/docx/hanging_indent.native too large to diff
- tests/docx/headers.docx too large to diff
- tests/docx/headers.native too large to diff
- tests/docx/image.docx too large to diff
- tests/docx/image_no_embed.native too large to diff
- tests/docx/inline_code.docx too large to diff
- tests/docx/inline_code.native too large to diff
- tests/docx/inline_formatting.docx too large to diff
- tests/docx/inline_formatting.native too large to diff
- tests/docx/inline_images.docx too large to diff
- tests/docx/inline_images.native too large to diff
- tests/docx/links.docx too large to diff
- tests/docx/links.native too large to diff
- tests/docx/lists.docx too large to diff
- tests/docx/lists.native too large to diff
- tests/docx/metadata.docx too large to diff
- tests/docx/metadata.native too large to diff
- tests/docx/metadata_after_normal.docx too large to diff
- tests/docx/metadata_after_normal.native too large to diff
- tests/docx/normalize.docx too large to diff
- tests/docx/normalize.native too large to diff
- tests/docx/notes.docx too large to diff
- tests/docx/notes.native too large to diff
- tests/docx/tables.docx too large to diff
- tests/docx/tables.native too large to diff
- tests/docx/tabs.docx too large to diff
- tests/docx/tabs.native too large to diff
- tests/docx/track_changes_deletion.docx too large to diff
- tests/docx/track_changes_deletion_accept.native too large to diff
- tests/docx/track_changes_deletion_all.native too large to diff
- tests/docx/track_changes_deletion_reject.native too large to diff
- tests/docx/track_changes_insertion.docx too large to diff
- tests/docx/track_changes_insertion_accept.native too large to diff
- tests/docx/track_changes_insertion_all.native too large to diff
- tests/docx/track_changes_insertion_reject.native too large to diff
- tests/docx/trailing_spaces_in_formatting.docx too large to diff
- tests/docx/trailing_spaces_in_formatting.native too large to diff
- tests/docx/unicode.docx too large to diff
- tests/docx/unicode.native too large to diff
- tests/dokuwiki_inline_formatting.dokuwiki too large to diff
- tests/dokuwiki_inline_formatting.native too large to diff
- tests/dokuwiki_multiblock_table.dokuwiki too large to diff
- tests/dokuwiki_multiblock_table.native too large to diff
- tests/epub/features.epub too large to diff
- tests/epub/features.native too large to diff
- tests/epub/formatting.epub too large to diff
- tests/epub/formatting.native too large to diff
- tests/epub/wasteland.epub too large to diff
- tests/epub/wasteland.native too large to diff
- tests/fb2/basic.fb2 too large to diff
- tests/fb2/basic.markdown too large to diff
- tests/fb2/images-embedded.fb2 too large to diff
- tests/fb2/images-embedded.html too large to diff
- tests/fb2/images.fb2 too large to diff
- tests/fb2/images.markdown too large to diff
- tests/fb2/math.fb2 too large to diff
- tests/fb2/math.markdown too large to diff
- tests/fb2/test-small.png too large to diff
- tests/fb2/test.jpg too large to diff
- tests/fb2/titles.fb2 too large to diff
- tests/fb2/titles.markdown too large to diff
- tests/haddock-reader.haddock too large to diff
- tests/haddock-reader.native too large to diff
- tests/html-reader.html too large to diff
- tests/html-reader.native too large to diff
- tests/insert too large to diff
- tests/lalune.jpg too large to diff
- tests/latex-reader.latex too large to diff
- tests/latex-reader.native too large to diff
- tests/lhs-test-markdown.native too large to diff
- tests/lhs-test.fragment.html+lhs too large to diff
- tests/lhs-test.html too large to diff
- tests/lhs-test.html+lhs too large to diff
- tests/lhs-test.latex too large to diff
- tests/lhs-test.latex+lhs too large to diff
- tests/lhs-test.markdown too large to diff
- tests/lhs-test.markdown+lhs too large to diff
- tests/lhs-test.native too large to diff
- tests/lhs-test.rst too large to diff
- tests/lhs-test.rst+lhs too large to diff
- tests/markdown-citations.native too large to diff
- tests/markdown-citations.txt too large to diff
- tests/markdown-reader-more.native too large to diff
- tests/markdown-reader-more.txt too large to diff
- tests/mediawiki-reader.native too large to diff
- tests/mediawiki-reader.wiki too large to diff
- tests/movie.jpg too large to diff
- tests/opml-reader.native too large to diff
- tests/opml-reader.opml too large to diff
- tests/pipe-tables.native too large to diff
- tests/pipe-tables.txt too large to diff
- tests/rst-reader.native too large to diff
- tests/rst-reader.rst too large to diff
- tests/s5-basic.html too large to diff
- tests/s5-fancy.html too large to diff
- tests/s5-fragment.html too large to diff
- tests/s5-inserts.html too large to diff
- tests/s5.native too large to diff
- tests/tables-rstsubset.native too large to diff
- tests/tables.asciidoc too large to diff
- tests/tables.context too large to diff
- tests/tables.docbook too large to diff
- tests/tables.dokuwiki too large to diff
- tests/tables.fb2 too large to diff
- tests/tables.haddock too large to diff
- tests/tables.html too large to diff
- tests/tables.icml too large to diff
- tests/tables.latex too large to diff
- tests/tables.man too large to diff
- tests/tables.markdown too large to diff
- tests/tables.mediawiki too large to diff
- tests/tables.native too large to diff
- tests/tables.opendocument too large to diff
- tests/tables.org too large to diff
- tests/tables.plain too large to diff
- tests/tables.rst too large to diff
- tests/tables.rtf too large to diff
- tests/tables.texinfo too large to diff
- tests/tables.textile too large to diff
- tests/tables.txt too large to diff
- tests/test-pandoc.hs too large to diff
- tests/testsuite.native too large to diff
- tests/testsuite.txt too large to diff
- tests/textile-reader.native too large to diff
- tests/textile-reader.textile too large to diff
- tests/txt2tags.native too large to diff
- tests/txt2tags.t2t too large to diff
- tests/writer.asciidoc too large to diff
- tests/writer.context too large to diff
- tests/writer.docbook too large to diff
- tests/writer.dokuwiki too large to diff
- tests/writer.fb2 too large to diff
- tests/writer.haddock too large to diff
- tests/writer.html too large to diff
- tests/writer.icml too large to diff
- tests/writer.latex too large to diff
- tests/writer.man too large to diff
- tests/writer.markdown too large to diff
- tests/writer.mediawiki too large to diff
- tests/writer.native too large to diff
- tests/writer.opendocument too large to diff
- tests/writer.opml too large to diff
- tests/writer.org too large to diff
- tests/writer.plain too large to diff
- tests/writer.rst too large to diff
- tests/writer.rtf too large to diff
- tests/writer.texinfo too large to diff
- tests/writer.textile too large to diff
- trypandoc/Makefile too large to diff
- trypandoc/index.html too large to diff
- trypandoc/trypandoc.hs too large to diff
- xml-light/Text/Pandoc/XML/Light.hs too large to diff
- xml-light/Text/Pandoc/XML/Light/Output.hs too large to diff
- xml-light/Text/Pandoc/XML/Light/Proc.hs too large to diff
- xml-light/Text/Pandoc/XML/Light/Types.hs too large to diff
@@ -0,0 +1,540 @@+# Contributors++- Aaron Wolen+- Adelar da Silva Queiróz+- Agriya Khetarpal+- Agustín Martín Barbero+- Akash Patel+- Akos Marton+- Albert Krewinkel+- Albert Lei+- Alex Ivkin+- Alex Toldaiev+- Alex Vong+- Alexander Batischev+- Alexander Kondratskiy+- Alexander Krotov+- Alexander Sulfrian+- Alexander V Vershilov+- Alexandre Franke+- Alfred Wechselberger+- Amar Al-Zubaidi+- Amir Dekel+- Amneesh Singh+- Amogh Rathore+- Amy de Buitléir+- Anabra+- Anders Waldenborg+- Andreas Deininger+- Andreas Lööw+- Andreas Scherer+- Andres Freund+- Andrew Dunning+- Andy Morris+- Aner Lucero+- Anti-Distinctlyminty+- Antoine Latter+- Anton Antich+- Anton Melnikov+- Antonio Terceiro+- Arata Mizuki+- Arata Mizuki+- Arfon Smith+- Arlo O'Keeffe+- Artem Pelenitsyn+- Artyom Kazak+- Asliddinbek Azizovich+- B. Scott Michel+- Bastien Dumont+- Ben Firshman+- Ben Gamari+- Ben Steinberg+- Beni Cherniavsky-Paskin+- Benjamin Bray+- Benjamin Esham+- Benjamin Wuethrich+- Benoit Schweblin+- Benson Muite+- Bjorn Buckwalter+- Blake Eryx+- Bodigrim+- Bradley Kuhn+- Brent Yorgey+- Brian Leung+- Bryan O'Sullivan+- Caleb McDaniel+- Caleb Mclennan+- Calvin Beck+- Carlos Scheidegger+- Carlos Sosa+- Carsten Allefeld+- Castedo Ellerman+- Cécile Chemin+- Cédric Couralet+- Cezary Drożak+- Chandrahas77+- Charanjit Singh+- Charles Tapley Hoyt+- Charlotte Koch+- Chris Black+- Chris Callison-Burch+- Christian Conkle+- Christian Christiansen+- Christian Despres+- Christoffer Ackelman+- Christoffer Sawicki+- Christophe Dervieux+- Christopher Kenny+- Clare Macrae+- Clint Adams+- Conal Elliott+- Cormac Relf+- Craig S. Bosma+- Damien Clochard+- Dan Jacobson+- Daniel Bergey+- Daniel Kessler+- Daniel Maslowski+- Daniel T. Staal+- Daniele D'Orazio+- David A Roberts+- David Lazar+- David Martschenko+- David Röthlisberger+- Denis Laxalde+- Denis Maier+- Derek Chen-Becker+- Diego Balseiro+- Diogo Almiro+- Dimitri Sabadie+- Dimitris Apostolou+- Dmitry Pogodin+- Dmitry Volodin+- Douglas Calvert+- Edwin Török+- Eigil Rischel+- Elliot Bobrow+- Emanuel Evans+- Emmanuel Ferdman+- Emerson Harkin+- Emily Bourke+- Emily Eisenberg+- Eric Kow+- Eric Schrijver+- Eric Seidel+- Erik Post+- Erik Rask+- Ethan Riley+- Étienne Bersac+- Evan Silberman+- Even Brenden+- Ezwal+- Fabián Heredia Montiel+- Félix Baylac-Jacqué+- Felix Yan+- Florian Beeres+- Florian Eitel+- Florian Klink+- Florian Kohrt+- FoxChillz+- Francesco Mazzoli+- Francesco Occhipinti+- François Gannaz+- Frank Seifferth+- Frederik Elwert+- Freiric Barral+- Freirich Raabe+- Frerich Raabe+- Fyodor Sheremetyev+- Gabor Pali+- Gabriel Lewertowski+- Gavin Beatty+- George Stagg+- Georgi Lyubenov+- GHyman83+- Gokul Rajiv+- Gordon Woodhull+- Gottfried Haider+- Greg Maslov+- Greg Rundlett+- Grégory Bataille+- Guriy Samarin+- Gwern Branwen+- Hamish Mackenzie+- Hans-Peter Deifel+- Hendrik Erz+- Heiko Schlittermann+- Henrik Tramberend+- Henry de Valence+- Herwig Stuetz+- Hikaru Ibayashi+- Hos Es+- Hubert Plociniczak+- Iacobus1983+- Ian Max Andolina+- Igor Khorlo+- Igor Pashev+- Ilona Silverwood+- Ilya V. Portnov+- Ivan Panchenko+- Ivan Trubach+- Ivar de Bruin+- Ivo Clarysse+- Jaap de Jong+- Jacob Larkin+- James J Balamuta+- J. B. Rainsberger+- J. Lewis Muir+- Jackson Schuster+- Jaehwang Jung+- Jaime Marquínez Ferrándiz+- Jake Zimmerman+- Jakob Voß+- James Aspnes+- James P. Ascher+- James Barlow+- James Scott-Brown+- Jamie F. Olson+- Jan Larres+- Jan Schulz+- Jan Tojnar+- Jannik Buhr+- Jan-Otto Kröpke+- Jared Lander+- Jason Ronallo+- Jeff Arnold+- Jeff Runningen+- Jens Getreu+- Jens Petersen+- Jens Oehlschlägel+- Jesse Hathaway+- Jeremie Knuesel+- Jérémy Bobbio+- Jeroen de Haas+- Jerry Sky+- Jesse Rosenthal+- Jez Cope+- Joe Hermaszewski+- Joe Hillenbrand+- Johan Larsson+- John KetzerX+- John Luke Bentley+- John MacFarlane+- John Muccigrosso+- John Purnell+- Jonas Scholl+- Jonas Smedegaard+- Jonathan+- Jonathan Daugherty+- Jonathan Dönszelmann+- Jose Luis Duran+- José de Mattos Neto+- Josef Svenningsson+- Joseph C. Sible+- Julia Diaz+- Julien Cretel+- Julien Dutant+- Juliette Fourcot+- Juliusz Gonera+- Justin Bogner+- Justin Wood+- Karl Pettersson+- Keenan Brock+- Keiichiro Shikano+- Kelsey Hightower+- Kevin Broch+- Kolen Cheung+- Konstantin Zudov+- Kristof Bastiaensen+- Krystof Beuermann+- Lars-Dominik Braun+- Laurent P. René de Cotret+- Lawrence Chonavel+- Leif Metcalf+- Leo Heitmann Ruiz+- Leonard Rosenthol+- Lila+- Link Swanson+- Loïc Grobol+- Lorenzo+- Lucas Escot+- Lucas Viana+- Lucas V. R+- Luis Rivera+- Luke Plant+- Manolis Stamatogiannakis+- Marc Schreiber+- Marcin Serwin+- Mario Lang+- Mark Gardner+- Mark Szepieniec+- Mark Wright+- Martin Joerg+- Martin Linn+- Martin Michlmayr+- Martín Pozo+- Masataka Ogawa+- Masayoshi Takahashi+- Matej Kollar+- Mathias Schenner+- Mathias Walter+- Mathieu Boespflug+- Mathieu Duponchelle+- Matt Dodson+- Matthew Doty+- Matthew Eddey+- Matthew Pickering+- Matthias C. M. Troffaes+- Mauro Bieg+- Max Bolingbroke+- Max Heller+- Max Rydahl Andersen+- Meher Chaitanya+- Merijn Verstraaten+- Michael Beaumont+- Michael Chladek+- Michael Hoffmann+- Michael McClurg+- Michael Peyton Jones+- Michael Reed+- Michael Snoyman+- Michael Stahl+- Michael Thompson+- Mickaël Canouil+- Mike Tzou+- Mikołaj Machowski+- Milan Bracke+- MinRK+- Mohamed Akram+- Morgan Willcock+- Morton Fox+- Nathan Gass+- Naveen+- Neil Mayhew+- Nick Bart+- Nick Berendsen+- Nick Fleisher+- Nicolas Kaiser+- Niklas Eicker+- Nikolai Korobeinikov+- Nikolay Yakimov+- Nils Carlson+- Nixon Enraght-Moony+- Noah Malmed+- Nokome Bentley+- Norwid Behrnd+- OCzarnecki+- Ola Wolska+- Ole Martin Ruud+- Oliver Fabel+- Oliver Matthews+- Olivier Benz+- Olivier Dossmann+- Ophir Lifshitz+- Or Neeman+- OvidiusCicero+- Owen McGrath+- Pablo Rodríguez+- Pascal Wagler+- Pau RE+- Paul Rivier+- Paul Tilley+- Paulo Tanimoto+- Pavol Otto+- Per Christian Gaustad+- Pete Ryland+- Peter Briggs+- Peter Fabinksi+- Peter Wang+- Philip Pesca+- Philippe Ombredanne+- Phillip Alday+- Pranesh Prakash+- Prat+- Prayag Verma+- Puneeth Chaganti+- Quinn+- R. N. West+- Ralf Stephan+- Raniere Silva+- Raymond Berger+- Raymond Ehlers+- Recai Oktaş+- Repetitive+- Reuben Thomas+- Rowan Rodrik van der Molen+- Roland Hieber+- Roman Beránek+- Ruqi+- RyanGlScott+- Ryan Gibb+- S.P.H+- Sai Asish Y+- Salim B+- Sam S. Almahri+- Sam May+- Samuel Tardieu+- Saumel Lemmenmeier+- Santiago Zarate+- Sascha Wilde+- Scott Morrison+- Sean Soon+- Sebastian Talmon+- Sebbones+- Sen-wen Deng+- Sergei Trofimovich+- Sergey Astanin+- Seth Speaks+- Shahbaz Youssefi+- Shaun Attfield+- Shim Myeongseob+- Shin Sang-jae+- Sidarth Kapur+- Sidney Mau+- Sidharth Kapur+- Simon Hengel+- Simon Schuster+- Siphalor+- Stefan Dresselhaus+- Stephan Daus+- Stephan Meijer+- Stephen Altamirano+- Stephen Huan+- Stephen Reindl+- Stéphane Guillou+- Sukil Etxenike+- Sukka+- Sumit Sahrawat+- Suraj Patil+- Sven Wick+- TEC+- Tarik Graba+- Tatiana Porras+- Terence Eden+- Thenaesh Elango+- Thomas Hodgson+- Thomas Soeiro+- Thomas Weißschuh+- Tiago-Manzato+- Tim Lin+- Tim Stewart+- Tim Wisotzki+- Timm Albers+- Timothy Humphries+- Tiziano Müller+- Todd Sifleet+- Tomas Dahlqvist+- TomBen+- Tom Leese+- Toni Dietze+- Tristan Stenner+- Tristan de Cacqueray+- Tristano Ajmone+- Tuong Nguyen Manh+- Uli Köhler+- Urs Liska+- Václav Haisman+- Václav Zeman+- Vaibhav Sagar+- Vanessa McHale+- Vasily Alferov+- Veratyr+- Viktor Kronvall+- Vincent+- Vlad Hanciuta+- Vladimir Alexiev+- Waldir Pimenta+- Wandmalfarbe+- Wentao Han+- Wikiwide+- William Lupton+- William Rusnack+- Winnie Hellmann+- Wout Gevaert+- Xavier Olive+- Yan Pashkovsky+- Yann Trividic+- Yehuda Katz+- YI+- Yoan Blanc+- You Jiangbin+- Yuchen Pei+- Zihang Chen+- 3w36zj6+- arcnmx+- a-vrma+- andrebauer+- benniekiss+- black-desk+- blmage+- bucklereed+- bumper314+- chinapedia+- cholonam+- closeobserve+- csforste+- d-dorazio+- damon-sava-stanley+- dbecher-ito+- ebiim+- ech0+- etclub+- favonia+- guqicun+- har7an+- harabat+- hseg+- infinity0x+- jeongminkim-islab+- josch+- kaizshang91+- lawcho+- lifeunleaded+- lux-lth+- luz paz+- lwolfsonkin+- massifrg+- mbracke+- mbrackeantidot+- mh4ckt3mh4ckt1c4s+- mjfs+- mt_caret+- nbehrnd+- nibras shami+- niszet+- nkalvi+- nuew+- obcat+- oltolm+- oquechy+- pacien+- perro tuerto+- piq9117+- priiduonu+- qerub+- quasicomputational+- reptee+- ricnorr+- robabla+- roblabla+- rodja.trappe+- rski+- samuel-weinhardt+- sdhoward+- shreevatsa.public+- takahashim+- taotieren+- tecosaur+- tgkokk+- the-solipsist+- thomjur+- thsutton+- thron7+- timo-a+- vijayphoenix+- vkraven+- wgevaert+- wiefling+- willj-dev+- wuffi+- λx.x
@@ -1,49 +1,183 @@ Contributing to pandoc ====================== +Welcome to pandoc! Very soon after its beginnings in 2006, pandoc+has been influenced, improved, and modified, by users, devs, and+newcomers alike. The project thrives on its active community. It is+great to have you here.++How can I help?+---------------++There are many ways in which you can support pandoc. Here are a few+ideas:++ * Participate in online discussions. The [discussion+ forum] is a good place for this.++ * Help with questions. Every request that is answered by the wider+ community frees time for programming contributors. This will+ speed up development of new features and issue fixes. Don't+ underestimate your knowledge, please share it!++ Good places to help are the [discussion forum], Q/A+ sites like StackOverflow, community forums (e.g.+ [RStudio][RStudio Community], [Zettlr][Zettlr Forum]), and, for+ technical questions, the GitHub [issue tracker].++ * Write or improve documentation. If you ran into a problem which+ took more time to figure out than expected, please consider to+ save other users from the same experience. People writing the+ documentation tend to lack an outside view, so please help+ provide one. Good documentation is both difficult and extremely+ important.++ The official docs are not the only place for documentation.+ Pandoc also has a [Wiki][pandoc wiki]. Private blogs can serve+ as documentation just as the official manual can.++ * Contribute code. No matter whether it's a small fix in a format+ template or a huge lump of Haskell code: help is welcome. It's+ usually a good idea to talk about the plans early, as this can+ prevent unnecessary work. See below for more information.++ * Last but not least: consider funding the development and+ maintenance of pandoc financially. You can find sponsor buttons+ on the [pandoc website] and the [GitHub repository][GitHub+ repo].++A rich ecosystem of libraries, editors, filters, and templates has+developed around pandoc; conversely, pandoc builds and depends on a+large number of libraries. Contributing to any of these projects is+another way that can help to ensure stability, and to keep pushing+the boundaries of what is possible with pandoc.++[RStudio Community]: https://community.rstudio.com/+[Zettlr Forum]: https://forum.zettlr.com/+[pandoc wiki]: https://github.com/jgm/pandoc/wiki+[pandoc website]: https://pandoc.org+[GitHub repo]: https://github.com/jgm/pandoc++Have a question?+----------------++Ask on the [discussion forum].++ Found a bug? ------------ -Bug reports are welcome! Please report all bugs on pandoc's github+Bug reports are welcome! Please report all bugs on pandoc's GitHub [issue tracker]. -Before you submit a bug report, search the (open *and* closed) issues to make-sure the issue hasn't come up before. Also, check the [User's Guide] and [FAQs]-for anything relevant.+Before you submit a bug report, search the [open issues] *and* [closed issues]+to make sure the issue hasn't come up before. Also, check the [User's Guide] and+[FAQs] for anything relevant. -Make sure you can reproduce the bug with the latest released version of pandoc-(or, even better, the development version).+Make sure you can reproduce the bug with the [latest released+version] of pandoc---or, even better, the development version,+since the bug may have been fixed since the last release.+[Nightly builds] are available, so you don't need to compile+from source to test against the development version.+(To fetch a nightly, visit the link, click the topmost "Nightly"+in the table, then choose your platform under "Artifacts." Note+that you must be logged in with a GitHub account.) -Your report should give detailed instructions for how to reproduce the problem,-including+Your report should give detailed, *reproducible* instructions, including + * the pandoc version (check using `pandoc -v`) * the exact command line used * the exact input used * the output received * the output you expected instead A small test case (just a few lines) is ideal. If your input is large,-try to whittle it down to the minimum necessary to illustrate the problem.+try to whittle it down to a *minimum working example*. +Out of scope?+-------------++A less than perfect conversion does not necessarily mean there's+a bug in pandoc. Quoting from the MANUAL:++> 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+> Markdown can be expected to be lossy.++For example, both `docx` and `odt` formats can represent margin size, but+because pandoc's internal document model does not contain a representation of+margin size, this information will be lost on converting from docx+to `odt`. (You can, however, customize margin size using `--reference-doc`.)++So before submitting a bug report, consider whether it might be+"out of scope." If it concerns a feature of documents that isn't+representable in pandoc's Markdown, then it very likely is.+(If in doubt, you can always ask on the [discussion forum].)++Fixing bugs from the issue tracker+----------------------------------++Almost all the bugs on the issue tracker have one or more associated+tags. These are used to indicate the *complexity* and *nature* of a+bug. There is not yet a way to indicate priority. An up to date+summary of issues can be found on [GitHub labels].++* [good first issue] — The perfect starting point for new contributors. The+ issue is generic and can be resolved without deep knowledge of the code+ base.+* [enhancement] — A feature which would be desirable. We recommend+ you discuss any proposed enhancement on the [discussion forum]+ before writing code.+* [bug] — A problem which needs to be fixed.+* [complexity:low] — The fix should only be a couple of lines.+* [complexity:high] — The fix might require structural changes or in depth+ knowledge of the code base.+* [new:reader] — A request to add a new input format.+* [new:writer] — A request to add a new output format.+* [docs] — A discrepancy, or ambiguity in the documentation.+* [status:in-progress] — Someone is actively working on or planning to work on the+ ticket.+* [status:more-discussion-needed] — It is unclear what the correct approach+ to solving the ticket is. Before starting on tickets such as this it+ would be advisable to post on the ticket.+* [status:more-info-needed] — We require more information from a user before+ we can classify a report properly.++Issues related to a specific format are tagged accordingly, e.g. feature request+or bug reports related to Markdown are labelled with [format:markdown].+ Have an idea for a new feature? ------------------------------- -First, search [pandoc-discuss] and the issue tracker (both open and closed-issues) to make sure that the idea has not been discussed before.+First, search the [discussion forum]+and the issue tracker (both [open issues] *and*+[closed issues]) to make sure that the idea has not been discussed before. Explain the rationale for the feature you're requesting. Why would this feature be useful? Consider also any possible drawbacks, including backwards compatibility, new library dependencies, and performance issues. -It is best to discuss a potential new feature on [pandoc-discuss]-before opening an issue.+Features are very rarely "implement and forget", as all code must be+maintained. This is especially relevant for large or complex+contributions. It is helpful to be sympathetic to that fact, and to+communicate future plans and availability clearly. +Any potential new feature is best discussed on the [discussion+forum] before opening an issue.+ Patches and pull requests ------------------------- Patches and pull requests are welcome. Before you put time into a nontrivial-patch, it is a good idea to discuss it on [pandoc-discuss], especially if it is-for a new feature (rather than fixing a bug).+patch, it is a good idea to discuss it on the+[discussion forum], especially if it is for a new feature (rather+than fixing a bug). Please follow these guidelines: @@ -72,7 +206,7 @@ below under [Tests](#tests).) If you are adding a new writer or reader, you must include tests. -7. If you are adding a new feature, include updates to the README.+7. If you are adding a new feature, include updates to `MANUAL.txt`. 8. All code must be released under the general license governing pandoc (GPL v2).@@ -80,50 +214,164 @@ 9. It is better not to introduce new dependencies. Dependencies on external C libraries should especially be avoided. +10. We aim for compatibility with at least the last three+ released ghc versions, and sometimes more. Currently we+ support ghc versions 9.6 and higher. All pull requests+ and commits are tested automatically on GitHub Actions.+ Tests ----- Tests can be run as follows: + cabal install --only-dependencies --enable-tests cabal configure --enable-tests cabal build cabal test -The test program is `tests/test-pandoc.hs`.+or, if you're using [stack], -Benchmarks can be enabled by passing the `--enable-benchmarks` flag-to `cabal configure`, and run using `cabal bench`.+ stack setup+ stack test -The code---------+The test program is `test/test-pandoc.hs`. -Pandoc has a publicly accessible git repository on-github: <http://github.com/jgm/pandoc>. To get a local copy of the source:+To run particular tests (pattern-matching on their names), use+the `-p` option: - git clone git://github.com/jgm/pandoc.git+ cabal install pandoc --enable-tests+ cabal test --test-options='-p markdown' -Note: after cloning the repository (and in the future after pulling from it),-you should do+Or with stack: - git submodule update --init+ stack test --test-arguments='-p markdown' -to pull in changes to the templates (`data/templates/`). You can automate this-by creating a file `.git/hooks/post-merge` with the contents:+It is often helpful to add `-j4` (run tests in parallel) and+`--hide-successes` (don't clutter output with successes) to the test+arguments as well. Collecting all options in a `cabal.project.local`+file in the project's root directory can help to keep `cabal`+commands short. E.g.: + flags: +embed_data_files+ tests: True+ test-show-details: direct+ test-options: -j4 --hide-successes++If you add a new feature to pandoc, please add tests as well, following+the pattern of the existing tests. The test suite code is in+`test/test-pandoc.hs`. If you are adding a new reader or writer, it is+probably easiest to add some data files to the `test` directory, and+modify `test/Tests/Old.hs`. Otherwise, it is better to modify the module+under the `test/Tests` hierarchy corresponding to the pandoc module you+are changing. Alternatively, you may add a "command test" to+the `/test/command/` hierarchy, following the pattern of the tests there.+These test files should have a meaningful name, which can include the issue+number and/or the feature that's being tested. For example, `5474-tables.md`+refers to both issue and feature.++You can rebuild the golden tests in `tests/` by passing+`--accept` to the test script. (If you're using stack, `stack+test --test-arguments "--accept"`; or `make TESTARGS=--accept`).+Then check the changed golden files for accuracy, and+commit the changes. For docx or pptx tests, open the files in Word+or Powerpoint to ensure that they weren't corrupted and that+they had the expected result, and mention the Word/Powerpoint+version and OS in your commit comment.++Code style+----------++Pandoc uses [hlint] to identify opportunities for code improvements+like redundant brackets or unnecessary `Language` extensions.+However, sometimes there are cases where there are good reasons to+use code different from what hlint proposes. In these cases, the+respective warning should be disabled in the file `.hlint.yaml`.++There should be no errors when running `hlint .`; this is checked by+the continuous integration (CI) setup. It is recommended that+contributors check their code with a local hlint installation, but+relying on the CI is fine, too.++A good way to ensure no new warnings are introduced is to use a Git+[pre-commit hook] which runs hlint on all updated Haskell files+before creating a commit:+ #!/bin/sh- git submodule update --init+ git diff --diff-filter=MA --cached --name-only | grep '\.hs$' | \+ xargs hlint --hint .hlint.yaml -and making it executable:+(If you are using GNU `xargs`, add the `-r` option immediately+after `xargs`.) - chmod +x .git/hooks/post-merge+Saving this to `.git/hooks/pre-commit`, and making the script+executable, will prevent accidental introduction of potentially+problematic code. +Benchmarks+----------++To run benchmarks with cabal:++ cabal configure --enable-benchmarks+ cabal build+ cabal bench++With stack:++ stack bench+++Using the REPL+--------------++With a recent version of cabal, you can do `cabal repl` and get+a ghci REPL for working with pandoc. With [stack], use+`stack ghci`.++We recommend using the following `.ghci` file (which can be+placed in the source directory):++ :set -fobject-code+ :set -XTypeSynonymInstances+ :set -XScopedTypeVariables+ :set -XOverloadedStrings++Profiling+---------++To diagnose a performance issue with parsing, first try using+the `--trace` option. This will give you a record of when block+parsers succeed, so you can spot backtracking issues.++To use the GHC profiler with cabal:++ cabal clean+ cabal install --enable-library-profiling --enable-executable-profiling+ pandoc +RTS -p -RTS [file]...+ less pandoc.prof++With stack:++ stack clean+ stack install --profile+ pandoc +RTS -p -RTS [file]...+ less pandoc.prof++The code+--------++Pandoc has a publicly accessible git repository on+GitHub: <https://github.com/jgm/pandoc>. To get a local copy of the source:++ git clone https://github.com/jgm/pandoc.git+ The source for the main pandoc program is `pandoc.hs`. The source for the pandoc library is in `src/`, the source for the tests is in-`tests/`, and the source for the benchmarks is in `benchmark/`.+`test/`, and the source for the benchmarks is in `benchmark/`. The modules `Text.Pandoc.Definition`, `Text.Pandoc.Builder`, and-`Text.Pandoc.Generics` are in a separate library `pandoc-types`. The code can-be found in a <http://github.com/jgm/pandoc-types>.+`Text.Pandoc.Generic` are in a separate library `pandoc-types`. The code can+be found in <https://github.com/jgm/pandoc-types>. To build pandoc, you will need a working installation of the [Haskell platform].@@ -136,20 +384,20 @@ - `Text.Pandoc.Definition` (in `pandoc-types`) defines the types used for representing a pandoc document. - `Text.Pandoc.Builder` (in `pandoc-types`) provides functions for- building pandoc documents programatically.+ building pandoc documents programmatically. - `Text.Pandoc.Generics` (in `pandoc-types`) provides functions allowing you to promote functions that operate on parts of pandoc documents to functions that operate on whole pandoc documents, walking the tree automatically. - `Text.Pandoc.Readers.*` are the readers, and `Text.Pandoc.Writers.*` are the writers.- - `Text.Pandoc.Biblio` is a utility module for formatting citations- using citeproc-hs.+ - `Text.Pandoc.Citeproc.*` contain the code for citation handling,+ including an interface to the [citeproc] library. - `Text.Pandoc.Data` is used to embed data files when the `embed_data_files`- cabal flag is used. It is generated from `src/Text/Pandoc/Data.hsb` using- the preprocessor [hsb2hs].+ cabal flag is used.+ - `Text.Pandoc.Emoji` is a thin wrapper around [emojis]. - `Text.Pandoc.Highlighting` contains the interface to the- highlighting-kate library, which is used for code syntax highlighting.+ skylighting library, which is used for code syntax highlighting. - `Text.Pandoc.ImageSize` is a utility module containing functions for calculating image sizes from the contents of image files. - `Text.Pandoc.MIME` contains functions for associating MIME types@@ -158,15 +406,14 @@ - `Text.Pandoc.PDF` contains functions for producing a PDF from a LaTeX source. - `Text.Pandoc.Parsing` contains parsing functions used in multiple readers.- - `Text.Pandoc.Pretty` is a pretty-printing library specialized to the needs of pandoc. - `Text.Pandoc.SelfContained` contains functions for making an HTML file "self-contained," by importing remotely linked images, CSS,- and javascript and turning them into `data:` URLs.+ and JavaScript and turning them into `data:` URLs. - `Text.Pandoc.Shared` is a grab-bag of shared utility functions. - `Text.Pandoc.Writers.Shared` contains utilities used in writers only. - `Text.Pandoc.Slides` contains functions for splitting a markdown document- into slides, using the conventions described in the README.+ into slides, using the conventions described in the MANUAL. - `Text.Pandoc.Templates` defines pandoc's templating system. - `Text.Pandoc.UTF8` contains functions for converting text to and from UTF8 bytestrings (strict and lazy).@@ -175,10 +422,64 @@ - `Text.Pandoc.UUID` contains functions for generating UUIDs. - `Text.Pandoc.XML` contains functions for formatting XML. -[pandoc-discuss]: http://groups.google.com/group/pandoc-discuss+Adding a new command-line option+--------------------------------++To add a new command-line option, you'll need to make changes in several+places:++- `MANUAL.txt` -- documentation for new option, both in the list+ of options and in the section on defaults files.+- `Text.Pandoc.App.Opt` -- new constructor for Opt and default+ value+- `Text.Pandoc.App.CommandLineOptions` -- the option parser+- `Text.Pandoc.App` or `Text.Pandoc.App.OutputSettings` --+ handle the new option+- possibly in pandoc-server: `Text.Pandoc.Server` -- handle the+ new option++If your change requires a new field for ReaderOptions or+WriterOptions, you'll also need to++- `Text.Pandoc.Options` -- type change and default value+- in pandoc-lua-engine: Text.Pandoc.Lua.Marshal.WriterOptions+ and/or Text.Pandoc.Lua.Marshal.ReaderOptions++Lua filters+-----------++If you've written a useful pandoc [lua filter](./doc/lua-filters.md),+you may want to consider submitting a pull request to the+[lua-filters repository](https://github.com/pandoc/lua-filters).++[open issues]: https://github.com/jgm/pandoc/issues+[closed issues]: https://github.com/jgm/pandoc/issues?q=is%3Aissue+is%3Aclosed+[latest released version]: https://github.com/jgm/pandoc/releases/latest+[Nightly builds]: https://github.com/jgm/pandoc/actions?query=workflow%3ANightly+[pandoc-discuss]: https://groups.google.com/group/pandoc-discuss [issue tracker]: https://github.com/jgm/pandoc/issues-[User's Guide]: http://johnmacfarlane.net/pandoc/README.html-[FAQs]: http://johnmacfarlane.net/pandoc/faqs.html-[EditorConfig]: http://editorconfig.org/-[Haskell platform]: http://www.haskell.org/platform/-[hsb2hs]: http://hackage.haskell.org/package/hsb2hs+[User's Guide]: https://pandoc.org/MANUAL.html+[FAQs]: https://pandoc.org/faqs.html+[EditorConfig]: https://editorconfig.org/+[Haskell platform]: https://www.haskell.org/platform/+[hlint]: https://hackage.haskell.org/package/hlint+[citeproc]: https://hackage.haskell.org/package/citeproc+[emojis]: https://hackage.haskell.org/package/emojis+[hsb2hs]: https://hackage.haskell.org/package/hsb2hs+[pre-commit hook]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks+[GitHub labels]: https://github.com/jgm/pandoc/labels+[good first issue]:https://github.com/jgm/pandoc/labels/good%20first%20issue+[enhancement]: https://github.com/jgm/pandoc/labels/enhancement+[bug]: https://github.com/jgm/pandoc/labels/bug+[complexity:low]: https://github.com/jgm/pandoc/labels/complexity:low+[complexity:high]: https://github.com/jgm/pandoc/labels/complexity:high+[docs]: https://github.com/jgm/pandoc/labels/docs+[format:markdown]: https://github.com/jgm/pandoc/labels/format:markdown+[new:reader]: https://github.com/jgm/pandoc/labels/new:reader+[new:writer]: https://github.com/jgm/pandoc/labels/new:writer+[status:in-progress]: https://github.com/jgm/pandoc/labels/status:in-progress+[status:more-discussion-needed]: https://github.com/jgm/pandoc/labels/status:more-discussion-needed+[status:more-info-needed]: https://github.com/jgm/pandoc/labels/status:more-info-needed+[stack]: https://github.com/commercialhaskell/stack+[discussion forum]: https://github.com/jgm/pandoc/discussions+
@@ -1,346 +0,0 @@-GNU GENERAL PUBLIC LICENSE-==========================--Version 2, June 1991--Copyright (C) 1989, 1991 Free Software Foundation, Inc. -51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA--Everyone is permitted to copy and distribute verbatim copies-of this license document, but changing it is not allowed.--Preamble-----------The licenses for most software are designed to take away your-freedom to share and change it. By contrast, the GNU General Public-License is intended to guarantee your freedom to share and change free-software--to make sure the software is free for all its users. This-General Public License applies to most of the Free Software-Foundation's software and to any other program whose authors commit to-using it. (Some other Free Software Foundation software is covered by-the GNU Library General Public License instead.) You can apply it to-your programs, too.--When we speak of free software, we are referring to freedom, not-price. Our General Public Licenses are designed to make sure that you-have the freedom to distribute copies of free software (and charge for-this service if you wish), that you receive source code or can get it-if you want it, that you can change the software or use pieces of it-in new free programs; and that you know you can do these things.--To protect your rights, we need to make restrictions that forbid-anyone to deny you these rights or to ask you to surrender the rights.-These restrictions translate to certain responsibilities for you if you-distribute copies of the software, or if you modify it.--For example, if you distribute copies of such a program, whether-gratis or for a fee, you must give the recipients all the rights that-you have. You must make sure that they, too, receive or can get the-source code. And you must show them these terms so they know their-rights.--We protect your rights with two steps: (1) copyright the software, and-(2) offer you this license which gives you legal permission to copy,-distribute and/or modify the software.--Also, for each author's protection and ours, we want to make certain-that everyone understands that there is no warranty for this free-software. If the software is modified by someone else and passed on, we-want its recipients to know that what they have is not the original, so-that any problems introduced by others will not reflect on the original-authors' reputations.--Finally, any free program is threatened constantly by software-patents. We wish to avoid the danger that redistributors of a free-program will individually obtain patent licenses, in effect making the-program proprietary. To prevent this, we have made it clear that any-patent must be licensed for everyone's free use or not licensed at all.--The precise terms and conditions for copying, distribution and-modification follow.--GNU GENERAL PUBLIC LICENSE-----------------------------TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION--0. This License applies to any program or other work which contains- a notice placed by the copyright holder saying it may be distributed- under the terms of this General Public License. The "Program", below,- refers to any such program or work, and a "work based on the Program"- means either the Program or any derivative work under copyright law:- that is to say, a work containing the Program or a portion of it,- either verbatim or with modifications and/or translated into another- language. (Hereinafter, translation is included without limitation in- the term "modification".) Each licensee is addressed as "you".-- Activities other than copying, distribution and modification are not- covered by this License; they are outside its scope. The act of- running the Program is not restricted, and the output from the Program- is covered only if its contents constitute a work based on the- Program (independent of having been made by running the Program).- Whether that is true depends on what the Program does.--1. You may copy and distribute verbatim copies of the Program's- source code as you receive it, in any medium, provided that you- conspicuously and appropriately publish on each copy an appropriate- copyright notice and disclaimer of warranty; keep intact all the- notices that refer to this License and to the absence of any warranty;- and give any other recipients of the Program a copy of this License- along with the Program.-- You may charge a fee for the physical act of transferring a copy, and- you may at your option offer warranty protection in exchange for a fee.--2. You may modify your copy or copies of the Program or any portion- of it, thus forming a work based on the Program, and copy and- distribute such modifications or work under the terms of Section 1- above, provided that you also meet all of these conditions:-- a) You must cause the modified files to carry prominent notices- stating that you changed the files and the date of any change.-- b) You must cause any work that you distribute or publish, that in- whole or in part contains or is derived from the Program or any- part thereof, to be licensed as a whole at no charge to all third- parties under the terms of this License.-- c) If the modified program normally reads commands interactively- when run, you must cause it, when started running for such- interactive use in the most ordinary way, to print or display an- announcement including an appropriate copyright notice and a- notice that there is no warranty (or else, saying that you provide- a warranty) and that users may redistribute the program under- these conditions, and telling the user how to view a copy of this- License. (Exception: if the Program itself is interactive but- does not normally print such an announcement, your work based on- the Program is not required to print an announcement.)-- These requirements apply to the modified work as a whole. If- identifiable sections of that work are not derived from the Program,- and can be reasonably considered independent and separate works in- themselves, then this License, and its terms, do not apply to those- sections when you distribute them as separate works. But when you- distribute the same sections as part of a whole which is a work based- on the Program, the distribution of the whole must be on the terms of- this License, whose permissions for other licensees extend to the- entire whole, and thus to each and every part regardless of who wrote it.-- Thus, it is not the intent of this section to claim rights or contest- your rights to work written entirely by you; rather, the intent is to- exercise the right to control the distribution of derivative or- collective works based on the Program.-- In addition, mere aggregation of another work not based on the Program- with the Program (or with a work based on the Program) on a volume of- a storage or distribution medium does not bring the other work under- the scope of this License.--3. You may copy and distribute the Program (or a work based on it,- under Section 2) in object code or executable form under the terms of- Sections 1 and 2 above provided that you also do one of the following:-- a) Accompany it with the complete corresponding machine-readable- source code, which must be distributed under the terms of Sections- 1 and 2 above on a medium customarily used for software interchange; or,-- b) Accompany it with a written offer, valid for at least three- years, to give any third party, for a charge no more than your- cost of physically performing source distribution, a complete- machine-readable copy of the corresponding source code, to be- distributed under the terms of Sections 1 and 2 above on a medium- customarily used for software interchange; or,-- c) Accompany it with the information you received as to the offer- to distribute corresponding source code. (This alternative is- allowed only for noncommercial distribution and only if you- received the program in object code or executable form with such- an offer, in accord with Subsection b above.)-- The source code for a work means the preferred form of the work for- making modifications to it. For an executable work, complete source- code means all the source code for all modules it contains, plus any- associated interface definition files, plus the scripts used to- control compilation and installation of the executable. However, as a- special exception, the source code distributed need not include- anything that is normally distributed (in either source or binary- form) with the major components (compiler, kernel, and so on) of the- operating system on which the executable runs, unless that component- itself accompanies the executable.-- If distribution of executable or object code is made by offering- access to copy from a designated place, then offering equivalent- access to copy the source code from the same place counts as- distribution of the source code, even though third parties are not- compelled to copy the source along with the object code.--4. You may not copy, modify, sublicense, or distribute the Program- except as expressly provided under this License. Any attempt- otherwise to copy, modify, sublicense or distribute the Program is- void, and will automatically terminate your rights under this License.- However, parties who have received copies, or rights, from you under- this License will not have their licenses terminated so long as such- parties remain in full compliance.--5. You are not required to accept this License, since you have not- signed it. However, nothing else grants you permission to modify or- distribute the Program or its derivative works. These actions are- prohibited by law if you do not accept this License. Therefore, by- modifying or distributing the Program (or any work based on the- Program), you indicate your acceptance of this License to do so, and- all its terms and conditions for copying, distributing or modifying- the Program or works based on it.--6. Each time you redistribute the Program (or any work based on the- Program), the recipient automatically receives a license from the- original licensor to copy, distribute or modify the Program subject to- these terms and conditions. You may not impose any further- restrictions on the recipients' exercise of the rights granted herein.- You are not responsible for enforcing compliance by third parties to- this License.--7. If, as a consequence of a court judgment or allegation of patent- infringement or for any other reason (not limited to patent issues),- conditions are imposed on you (whether by court order, agreement or- otherwise) that contradict the conditions of this License, they do not- excuse you from the conditions of this License. If you cannot- distribute so as to satisfy simultaneously your obligations under this- License and any other pertinent obligations, then as a consequence you- may not distribute the Program at all. For example, if a patent- license would not permit royalty-free redistribution of the Program by- all those who receive copies directly or indirectly through you, then- the only way you could satisfy both it and this License would be to- refrain entirely from distribution of the Program.-- If any portion of this section is held invalid or unenforceable under- any particular circumstance, the balance of the section is intended to- apply and the section as a whole is intended to apply in other- circumstances.-- It is not the purpose of this section to induce you to infringe any- patents or other property right claims or to contest validity of any- such claims; this section has the sole purpose of protecting the- integrity of the free software distribution system, which is- implemented by public license practices. Many people have made- generous contributions to the wide range of software distributed- through that system in reliance on consistent application of that- system; it is up to the author/donor to decide if he or she is willing- to distribute software through any other system and a licensee cannot- impose that choice.-- This section is intended to make thoroughly clear what is believed to- be a consequence of the rest of this License.--8. If the distribution and/or use of the Program is restricted in- certain countries either by patents or by copyrighted interfaces, the- original copyright holder who places the Program under this License- may add an explicit geographical distribution limitation excluding- those countries, so that distribution is permitted only in or among- countries not thus excluded. In such case, this License incorporates- the limitation as if written in the body of this License.--9. The Free Software Foundation may publish revised and/or new versions- of the General Public License from time to time. Such new versions will- be similar in spirit to the present version, but may differ in detail to- address new problems or concerns.-- Each version is given a distinguishing version number. If the Program- specifies a version number of this License which applies to it and "any- later version", you have the option of following the terms and conditions- either of that version or of any later version published by the Free- Software Foundation. If the Program does not specify a version number of- this License, you may choose any version ever published by the Free Software- Foundation.--10. If you wish to incorporate parts of the Program into other free- programs whose distribution conditions are different, write to the author- to ask for permission. For software which is copyrighted by the Free- Software Foundation, write to the Free Software Foundation; we sometimes- make exceptions for this. Our decision will be guided by the two goals- of preserving the free status of all derivatives of our free software and- of promoting the sharing and reuse of software generally.--NO WARRANTY--11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,- REPAIR OR CORRECTION.--12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE- POSSIBILITY OF SUCH DAMAGES.--END OF TERMS AND CONDITIONS--How to Apply These Terms to Your New Programs------------------------------------------------If you develop a new program, and you want it to be of the greatest-possible use to the public, the best way to achieve this is to make it-free software which everyone can redistribute and change under these terms.--To do so, attach the following notices to the program. It is safest-to attach them to the start of each source file to most effectively-convey the exclusion of warranty; and each file should have at least-the "copyright" line and a pointer to where the full notice is found.-- <one line to give the program's name and a brief idea of what it does.>- Copyright (C) <year> <name of author>-- 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA--Also add information on how to contact you by electronic and paper mail.--If the program is interactive, make it output a short notice like this-when it starts in an interactive mode:-- Gnomovision version 69, Copyright (C) year name of author- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.- This is free software, and you are welcome to redistribute it- under certain conditions; type `show c' for details.--The hypothetical commands `show w' and `show c' should show the appropriate-parts of the General Public License. Of course, the commands you use may-be called something other than `show w' and `show c'; they could even be-mouse-clicks or menu items--whatever suits your program.--You should also get your employer (if you work as a programmer) or your-school, if any, to sign a "copyright disclaimer" for the program, if-necessary. Here is a sample; alter the names:-- Yoyodyne, Inc., hereby disclaims all copyright interest in the program- `Gnomovision' (which makes passes at compilers) written by James Hacker.-- <signature of Ty Coon>, 1 April 1989- Ty Coon, President of Vice--This General Public License does not permit incorporating your program into-proprietary programs. If your program is a subroutine library, you may-consider it more useful to permit linking proprietary applications with the-library. If this is what you want to do, use the GNU Library General-Public License instead of this License.
@@ -0,0 +1,360 @@+### GNU GENERAL PUBLIC LICENSE++Version 2, June 1991++ Copyright (C) 1989, 1991 Free Software Foundation, Inc. + <https://fsf.org/>+ + Everyone is permitted to copy and distribute verbatim copies+ of this license document, but changing it is not allowed.++### Preamble++The licenses for most software are designed to take away your freedom+to share and change it. By contrast, the GNU General Public License is+intended to guarantee your freedom to share and change free+software--to make sure the software is free for all its users. This+General Public License applies to most of the Free Software+Foundation's software and to any other program whose authors commit to+using it. (Some other Free Software Foundation software is covered by+the GNU Lesser General Public License instead.) You can apply it to+your programs, too.++When we speak of free software, we are referring to freedom, not+price. Our General Public Licenses are designed to make sure that you+have the freedom to distribute copies of free software (and charge for+this service if you wish), that you receive source code or can get it+if you want it, that you can change the software or use pieces of it+in new free programs; and that you know you can do these things.++To protect your rights, we need to make restrictions that forbid+anyone to deny you these rights or to ask you to surrender the rights.+These restrictions translate to certain responsibilities for you if+you distribute copies of the software, or if you modify it.++For example, if you distribute copies of such a program, whether+gratis or for a fee, you must give the recipients all the rights that+you have. You must make sure that they, too, receive or can get the+source code. And you must show them these terms so they know their+rights.++We protect your rights with two steps: (1) copyright the software, and+(2) offer you this license which gives you legal permission to copy,+distribute and/or modify the software.++Also, for each author's protection and ours, we want to make certain+that everyone understands that there is no warranty for this free+software. If the software is modified by someone else and passed on,+we want its recipients to know that what they have is not the+original, so that any problems introduced by others will not reflect+on the original authors' reputations.++Finally, any free program is threatened constantly by software+patents. We wish to avoid the danger that redistributors of a free+program will individually obtain patent licenses, in effect making the+program proprietary. To prevent this, we have made it clear that any+patent must be licensed for everyone's free use or not licensed at+all.++The precise terms and conditions for copying, distribution and+modification follow.++### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION++**0.** This License applies to any program or other work which+contains a notice placed by the copyright holder saying it may be+distributed under the terms of this General Public License. The+"Program", below, refers to any such program or work, and a "work+based on the Program" means either the Program or any derivative work+under copyright law: that is to say, a work containing the Program or+a portion of it, either verbatim or with modifications and/or+translated into another language. (Hereinafter, translation is+included without limitation in the term "modification".) Each licensee+is addressed as "you".++Activities other than copying, distribution and modification are not+covered by this License; they are outside its scope. The act of+running the Program is not restricted, and the output from the Program+is covered only if its contents constitute a work based on the Program+(independent of having been made by running the Program). Whether that+is true depends on what the Program does.++**1.** You may copy and distribute verbatim copies of the Program's+source code as you receive it, in any medium, provided that you+conspicuously and appropriately publish on each copy an appropriate+copyright notice and disclaimer of warranty; keep intact all the+notices that refer to this License and to the absence of any warranty;+and give any other recipients of the Program a copy of this License+along with the Program.++You may charge a fee for the physical act of transferring a copy, and+you may at your option offer warranty protection in exchange for a+fee.++**2.** You may modify your copy or copies of the Program or any+portion of it, thus forming a work based on the Program, and copy and+distribute such modifications or work under the terms of Section 1+above, provided that you also meet all of these conditions:++ +**a)** You must cause the modified files to carry prominent notices+stating that you changed the files and the date of any change.++ +**b)** You must cause any work that you distribute or publish, that in+whole or in part contains or is derived from the Program or any part+thereof, to be licensed as a whole at no charge to all third parties+under the terms of this License.++ +**c)** If the modified program normally reads commands interactively+when run, you must cause it, when started running for such interactive+use in the most ordinary way, to print or display an announcement+including an appropriate copyright notice and a notice that there is+no warranty (or else, saying that you provide a warranty) and that+users may redistribute the program under these conditions, and telling+the user how to view a copy of this License. (Exception: if the+Program itself is interactive but does not normally print such an+announcement, your work based on the Program is not required to print+an announcement.)++These requirements apply to the modified work as a whole. If+identifiable sections of that work are not derived from the Program,+and can be reasonably considered independent and separate works in+themselves, then this License, and its terms, do not apply to those+sections when you distribute them as separate works. But when you+distribute the same sections as part of a whole which is a work based+on the Program, the distribution of the whole must be on the terms of+this License, whose permissions for other licensees extend to the+entire whole, and thus to each and every part regardless of who wrote+it.++Thus, it is not the intent of this section to claim rights or contest+your rights to work written entirely by you; rather, the intent is to+exercise the right to control the distribution of derivative or+collective works based on the Program.++In addition, mere aggregation of another work not based on the Program+with the Program (or with a work based on the Program) on a volume of+a storage or distribution medium does not bring the other work under+the scope of this License.++**3.** You may copy and distribute the Program (or a work based on it,+under Section 2) in object code or executable form under the terms of+Sections 1 and 2 above provided that you also do one of the following:++ +**a)** Accompany it with the complete corresponding machine-readable+source code, which must be distributed under the terms of Sections 1+and 2 above on a medium customarily used for software interchange; or,++ +**b)** Accompany it with a written offer, valid for at least three+years, to give any third party, for a charge no more than your cost of+physically performing source distribution, a complete machine-readable+copy of the corresponding source code, to be distributed under the+terms of Sections 1 and 2 above on a medium customarily used for+software interchange; or,++ +**c)** Accompany it with the information you received as to the offer+to distribute corresponding source code. (This alternative is allowed+only for noncommercial distribution and only if you received the+program in object code or executable form with such an offer, in+accord with Subsection b above.)++The source code for a work means the preferred form of the work for+making modifications to it. For an executable work, complete source+code means all the source code for all modules it contains, plus any+associated interface definition files, plus the scripts used to+control compilation and installation of the executable. However, as a+special exception, the source code distributed need not include+anything that is normally distributed (in either source or binary+form) with the major components (compiler, kernel, and so on) of the+operating system on which the executable runs, unless that component+itself accompanies the executable.++If distribution of executable or object code is made by offering+access to copy from a designated place, then offering equivalent+access to copy the source code from the same place counts as+distribution of the source code, even though third parties are not+compelled to copy the source along with the object code.++**4.** You may not copy, modify, sublicense, or distribute the Program+except as expressly provided under this License. Any attempt otherwise+to copy, modify, sublicense or distribute the Program is void, and+will automatically terminate your rights under this License. However,+parties who have received copies, or rights, from you under this+License will not have their licenses terminated so long as such+parties remain in full compliance.++**5.** You are not required to accept this License, since you have not+signed it. However, nothing else grants you permission to modify or+distribute the Program or its derivative works. These actions are+prohibited by law if you do not accept this License. Therefore, by+modifying or distributing the Program (or any work based on the+Program), you indicate your acceptance of this License to do so, and+all its terms and conditions for copying, distributing or modifying+the Program or works based on it.++**6.** Each time you redistribute the Program (or any work based on+the Program), the recipient automatically receives a license from the+original licensor to copy, distribute or modify the Program subject to+these terms and conditions. You may not impose any further+restrictions on the recipients' exercise of the rights granted herein.+You are not responsible for enforcing compliance by third parties to+this License.++**7.** If, as a consequence of a court judgment or allegation of+patent infringement or for any other reason (not limited to patent+issues), conditions are imposed on you (whether by court order,+agreement or otherwise) that contradict the conditions of this+License, they do not excuse you from the conditions of this License.+If you cannot distribute so as to satisfy simultaneously your+obligations under this License and any other pertinent obligations,+then as a consequence you may not distribute the Program at all. For+example, if a patent license would not permit royalty-free+redistribution of the Program by all those who receive copies directly+or indirectly through you, then the only way you could satisfy both it+and this License would be to refrain entirely from distribution of the+Program.++If any portion of this section is held invalid or unenforceable under+any particular circumstance, the balance of the section is intended to+apply and the section as a whole is intended to apply in other+circumstances.++It is not the purpose of this section to induce you to infringe any+patents or other property right claims or to contest validity of any+such claims; this section has the sole purpose of protecting the+integrity of the free software distribution system, which is+implemented by public license practices. Many people have made+generous contributions to the wide range of software distributed+through that system in reliance on consistent application of that+system; it is up to the author/donor to decide if he or she is willing+to distribute software through any other system and a licensee cannot+impose that choice.++This section is intended to make thoroughly clear what is believed to+be a consequence of the rest of this License.++**8.** If the distribution and/or use of the Program is restricted in+certain countries either by patents or by copyrighted interfaces, the+original copyright holder who places the Program under this License+may add an explicit geographical distribution limitation excluding+those countries, so that distribution is permitted only in or among+countries not thus excluded. In such case, this License incorporates+the limitation as if written in the body of this License.++**9.** The Free Software Foundation may publish revised and/or new+versions of the General Public License from time to time. Such new+versions will be similar in spirit to the present version, but may+differ in detail to address new problems or concerns.++Each version is given a distinguishing version number. If the Program+specifies a version number of this License which applies to it and+"any later version", you have the option of following the terms and+conditions either of that version or of any later version published by+the Free Software Foundation. If the Program does not specify a+version number of this License, you may choose any version ever+published by the Free Software Foundation.++**10.** If you wish to incorporate parts of the Program into other+free programs whose distribution conditions are different, write to+the author to ask for permission. For software which is copyrighted by+the Free Software Foundation, write to the Free Software Foundation;+we sometimes make exceptions for this. Our decision will be guided by+the two goals of preserving the free status of all derivatives of our+free software and of promoting the sharing and reuse of software+generally.++**NO WARRANTY**++**11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO+WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR+OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE+PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.++**12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY+AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE+PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A+FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH+DAMAGES.++### END OF TERMS AND CONDITIONS++### How to Apply These Terms to Your New Programs++If you develop a new program, and you want it to be of the greatest+possible use to the public, the best way to achieve this is to make it+free software which everyone can redistribute and change under these+terms.++To do so, attach the following notices to the program. It is safest to+attach them to the start of each source file to most effectively+convey the exclusion of warranty; and each file should have at least+the "copyright" line and a pointer to where the full notice is found.++ one line to give the program's name and an idea of what it does.+ Copyright (C) yyyy name of author++ 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, see <https://www.gnu.org/licenses/>.++Also add information on how to contact you by electronic and paper+mail.++If the program is interactive, make it output a short notice like this+when it starts in an interactive mode:++ Gnomovision version 69, Copyright (C) year name of author+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details+ type `show w'. This is free software, and you are welcome+ to redistribute it under certain conditions; type `show c' + for details.++The hypothetical commands \`show w' and \`show c' should show the+appropriate parts of the General Public License. Of course, the+commands you use may be called something other than \`show w' and+\`show c'; they could even be mouse-clicks or menu items--whatever+suits your program.++You should also get your employer (if you work as a programmer) or+your school, if any, to sign a "copyright disclaimer" for the program,+if necessary. Here is a sample; alter the names:++ Yoyodyne, Inc., hereby disclaims all copyright+ interest in the program `Gnomovision'+ (which makes passes at compilers) written + by James Hacker.++ signature of Ty Coon, 1 April 1989+ Ty Coon, President of Vice++This General Public License does not permit incorporating your program+into proprietary programs. If your program is a subroutine library,+you may consider it more useful to permit linking proprietary+applications with the library. If this is what you want to do, use the+[GNU Lesser General Public+License](https://www.gnu.org/licenses/lgpl.html) instead of this+License.
@@ -1,7 +1,8 @@ Pandoc-Copyright (C) 2006-2014 John MacFarlane <jgm at berkeley dot edu>+Copyright (C) 2006-2024 John MacFarlane <jgm at berkeley dot edu> -This code is released under the [GPL], version 2 or later:+With the exceptions noted below, this code is released under the [GPL],+version 2 or later: 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@@ -13,72 +14,212 @@ 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA+ You should have received a copy of the GNU General Public License along+ with this program; if not, see <https://www.gnu.org/licenses/>. -The GNU General Public License is available in the file COPYING in+The GNU General Public License is available in the file COPYING.md in the source distribution. On Debian systems, the complete text of the GPL can be found in `/usr/share/common-licenses/GPL`. -[GPL]: http://www.gnu.org/copyleft/gpl.html+[GPL]: https://www.gnu.org/copyleft/gpl.html -Pandoc's complete source code is available from the [Pandoc home page].+The complete source code for pandoc version X.Y.Z is available at+<https://hackage.haskell.org/package/pandoc-X.Y.Z/pandoc-X.Y.Z.tar.gz>+and at <https://github.com/jgm/pandoc/tree/X.Y.Z>. -[Pandoc home page]: http://johnmacfarlane.net/pandoc/+Pandoc includes some code with different copyrights, or subject to different+licenses. The copyright and license statements for these sources are included+below. All are GPL-compatible licenses. -Pandoc includes some code from other authors. The copyright and license-statements for these sources are included below. All are GPL-compatible-licenses.+----------------------------------------------------------------------+The modules in the `pandoc-types` repository (Text.Pandoc.Definition,+Text.Pandoc.Builder, Text.Pandoc.Generics, Text.Pandoc.JSON,+Text.Pandoc.Walk) are licensed under the BSD 3-clause license: +Copyright (c) 2006-2024, John MacFarlane++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of John MacFarlane nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+ ----------------------------------------------------------------------+Pandoc's templates (in `data/templates`) are dual-licensed as either+GPL (v2 or higher, same as pandoc) or (at your option) the BSD+3-clause license.++Copyright (c) 2014--2024, John MacFarlane++----------------------------------------------------------------------+src/Text/Pandoc/Writers/Muse.hs+Copyright (C) 2017-2020 Alexander Krotov++Released under the GNU General Public License version 2 or later.++---------------------------------------------------------------------- src/Text/Pandoc/Writers/Texinfo.hs-Copyright (C) 2008-2014 John MacFarlane and Peter Wang+Copyright (C) 2008-2024 John MacFarlane and Peter Wang Released under the GNU General Public License version 2 or later. ---------------------------------------------------------------------- src/Text/Pandoc/Writers/OpenDocument.hs-Copyright (C) 2008-2014 Andrea Rossato and John MacFarlane+Copyright (C) 2008-2024 Andrea Rossato and John MacFarlane Released under the GNU General Public License version 2 or later. ---------------------------------------------------------------------- src/Text/Pandoc/Writers/Org.hs-Copyright (C) 2010-2014 Puneeth Chaganti and JohnMacFarlane+Copyright (C) 2010-2024 Puneeth Chaganti, John MacFarlane, and+ Albert Krewinkel Released under the GNU General Public License version 2 or later. ----------------------------------------------------------------------+src/Text/Pandoc/Writers/ZimWiki.hs+Copyright (C) 2017 Alex Ivkin++Released under the GNU General Public License version 2 or later.++----------------------------------------------------------------------+src/Text/Pandoc/Readers/Docx.hs+src/Text/Pandoc/Readers/Docx/*+Copyright (C) 2014-2020 Jesse Rosenthal++Released under the GNU General Public License version 2 or later.++---------------------------------------------------------------------- src/Text/Pandoc/Readers/Textile.hs-Copyright (C) 2010-2014 Paul Rivier and John MacFarlane+Copyright (C) 2010-2024 Paul Rivier and John MacFarlane Released under the GNU General Public License version 2 or later. ----------------------------------------------------------------------+src/Text/Pandoc/Readers/TikiWiki.hs+Copyright (C) 2017 Robin Lee Powell++Released under the GNU General Public License version 2 or later.++----------------------------------------------------------------------+src/Text/Pandoc/Readers/JATS.hs+Copyright (C) 2017-2018 Hamish Mackenzie++Released under the GNU General Public License version 2 or later.++----------------------------------------------------------------------+src/Text/Pandoc/Readers/EPUB.hs+Copyright (C) 2014-2024 Matthew Pickering and John MacFarlane++Released under the GNU General Public License version 2 or later.++---------------------------------------------------------------------- src/Text/Pandoc/Readers/Org.hs-tests/Tests/Readers/Org.hs-Copyright (C) 2014 Albert Krewinkel+src/Text/Pandoc/Readers/Org/*+test/Tests/Readers/Org/*+Copyright (C) 2014-2024 Albert Krewinkel Released under the GNU General Public License version 2 or later. -----------------------------------------------------------------------data/LaTeXMathML.js-Adapted by Jeff Knisely and Douglas Woodall from-ASCIIMathML.js v. 1.4.7-Copyright (C) 2005 Peter Jipsen+pandoc-lua-engine/src/Text/Pandoc/Lua.hs+pandoc-lua-engine/src/Text/Pandoc/Lua/*+pandoc-lua-engine/test/lua/*+Copyright (C) 2017--2024 Albert Krewinkel and John MacFarlane Released under the GNU General Public License version 2 or later. -----------------------------------------------------------------------data/MathMLinHTML.js-Copyright (C) 2004 Peter Jipsen http://www.chapman.edu/~jipsen+src/Text/Pandoc/Readers/Jira.hs+src/Text/Pandoc/Writers/Jira.hs+test/Tests/Readers/Jira.hs+Copyright (C) 2019--2024 Albert Krewinkel Released under the GNU General Public License version 2 or later. --------------------------------------------------------------------------The dzslides template contains javascript and CSS from Paul Rouget's+----------------------------------------------------------------------+src/Text/Pandoc/Readers/FB2.hs+Copyright (C) 2018--2019 Alexander Krotov++Released under the GNU General Public License version 2 or later.++----------------------------------------------------------------------+The dzslides template contains JavaScript and CSS from Paul Rouget's dzslides template.-http://github.com/apulrouget/dzslides+https://github.com/paulrouget/dzslides Released under the Do What the Fuck You Want To Public License.++------------------------------------------------------------------------+Pandoc embeds a Lua interpreter (via hslua).++Copyright © 1994--2023 Lua.org, PUC-Rio.++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be+included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.++------------------------------------------------------------------------+Some of the code in wasm/pandoc.js and the patches in wasm/patches is+from https://github.com/haskell-wasm/pandoc-wasm. It is released under+this license:++MIT License++Copyright (c) Tweag I/O Limited.++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.
@@ -1,203 +0,0 @@-% Installing pandoc--These instructions explain how to install pandoc from source.-Binary packages or ports of pandoc are available for freebsd-and several linux distributions, so check your package manager.-There are also binary installers for Windows and Mac OS X.--If you are installing the development version from github, see also:-https://github.com/jgm/pandoc/wiki/Installing-the-development-version-of-pandoc--Quick install----------------1. Install the [Haskell platform]. This will give you [GHC] and- the [cabal-install] build tool.--2. Update your package database:-- cabal update--3. Use `cabal` to install pandoc and its dependencies:-- cabal install pandoc-- This procedure will install the released version of pandoc,- which will be downloaded automatically from HackageDB.- If you want to install a modified or development version- of pandoc instead, switch to the source directory and do- as above, but without the 'pandoc':-- cabal install-- Note: If you obtained the source from the git repository (rather- than a release tarball), you'll need to do-- git submodule update --init-- to fetch the contents of `data/templates` before `cabal install`.--4. Make sure the `$CABALDIR/bin` directory is in your path. You should- now be able to run `pandoc`:-- pandoc --help-- [Not sure where `$CABALDIR` is?](http://www.haskell.org/haskellwiki/Cabal-Install#The_cabal-install_configuration_file)--5. Make sure the `$CABALDIR/share/man/man1` directory is in your `MANPATH`.- You should now be able to access the `pandoc` man page:-- man pandoc--6. If you want to process citations with pandoc, you will also need to- install a separate package, `pandoc-citeproc`. This can be installed- using cabal:-- cabal install pandoc-citeproc-- By default `pandoc-citeproc` uses the "i;unicode-casemap" method- to sort bibliography entries (RFC 5051). If you would like to- use the locale-sensitive unicode collation algorithm instead,- specify the `unicode_collation` flag:-- cabal install pandoc-citeproc -funicode_collation-- Note that this requires the `text-icu` library, which in turn- depends on the C library `icu4c`. Installation directions- vary by platform. Here is how it might work on OSX with homebrew:-- brew install icu4c- cabal install --extra-lib-dirs=/usr/local/Cellar/icu4c/51.1/lib \- --extra-include-dirs=/usr/local/Cellar/icu4c/51.1/include \- -funicode_collation text-icu pandoc-citeproc--[GHC]: http://www.haskell.org/ghc/-[Haskell platform]: http://hackage.haskell.org/platform/-[cabal-install]: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall--Custom install-----------------This is a step-by-step procedure that offers maximal control-over the build and installation. Most users should use the-quick install, but this information may be of use to packagers.-For more details, see the [Cabal User's Guide]. These instructions-assume that the pandoc source directory is your working directory.--1. Install dependencies: in addition to the [Haskell platform],- you will need a number of additional libraries. You can install- them all with-- cabal update- cabal install --only-dependencies--2. Configure:-- cabal configure --prefix=DIR --bindir=DIR --libdir=DIR \- --datadir=DIR --libsubdir=DIR --datasubdir=DIR --docdir=DIR \- --htmldir=DIR --program-prefix=PREFIX --program-suffix=SUFFIX \- --mandir=DIR --flags=FLAGSPEC-- All of the options have sensible defaults that can be overridden- as needed.-- `FLAGSPEC` is a list of Cabal configuration flags, optionally- preceded by a `-` (to force the flag to `false`), and separated- by spaces. Pandoc's flags include:-- - `embed_data_files`: embed all data files into the binary (default no).- This is helpful if you want to create a relocatable binary.- Note: if this option is selected, you need to install the- `hsb2hs` preprocessor:-- cabal install hsb2hs-- - `https`: enable support for downloading resources over https- (using the `http-client` and `http-client-tls` libraries).--3. Build:-- cabal build--4. Build API documentation:-- cabal haddock --html-location=URL --hyperlink-source--5. Copy the files:-- cabal copy --destdir=PATH-- The default destdir is `/`.--6. Register pandoc as a GHC package:-- cabal register-- Package managers may want to use the `--gen-script` option to- generate a script that can be run to register the package at- install time.--Creating a relocatable binary--------------------------------It is possible to compile pandoc such that the data files-pandoc uses are embedded in the binary. The resulting binary-can be run from any directory and is completely self-contained.-- cabal install hsb2hs # a required build tool- cabal install --flags="embed_data_files" citeproc-hs- cabal configure --flags="embed_data_files"- cabal build--You can find the pandoc executable in `dist/build/pandoc`. Copy this wherever-you please.--[zip-archive]: http://hackage.haskell.org/package/zip-archive-[highlighting-kate]: http://hackage.haskell.org/package/highlighting-kate-[blaze-html]: http://hackage.haskell.org/package/blaze-html-[Cabal User's Guide]: http://www.haskell.org/cabal/release/latest/doc/users-guide/builders.html#setup-configure-paths--Running tests----------------Pandoc comes with an automated test suite integrated to cabal.-To build the tests:-- cabal configure --enable-tests && cabal build--To run the tests:-- cabal test--To run particular tests (pattern-matching on their names), use-the `-t` option:-- cabal test --test-options='-t markdown'--If you add a new feature to pandoc, please add tests as well, following-the pattern of the existing tests. The test suite code is in-`tests/test-pandoc.hs`. If you are adding a new reader or writer, it is-probably easiest to add some data files to the `tests` directory, and-modify `tests/Tests/Old.hs`. Otherwise, it is better to modify the module-under the `tests/Tests` hierarchy corresponding to the pandoc module you-are changing.--Running benchmarks---------------------To build the benchmarks:-- cabal configure --enable-benchmarks && cabal build--To run the benchmarks:-- cabal bench--To use a smaller sample size so the benchmarks run faster:-- cabal bench --benchmark-options='-s 20'--To run just the markdown benchmarks:-- cabal bench --benchmark-options='markdown'-
@@ -0,0 +1,424 @@+# Installing pandoc++The simplest way to get the latest pandoc release is to use the installer.++<a href="https://github.com/jgm/pandoc/releases/latest"+ class="btn btn-primary" id="downloadInstallerBtn">+ Download the latest installer+</a>++For alternative ways to install pandoc, see below under the heading for+your operating system.++**Note**: the statically linked Pandoc binaries provided by us (or those+available on Conda Forge) have a limitation. They are unable to utilise Lua+filters that rely on Lua modules written in C. If you require the+functionality offered by these filters, please consider an alternative+method of installation.++## Windows++There is a package installer at pandoc's [download page].+This will install pandoc, replacing older versions, and+update your path to include the directory where pandoc's+binaries are installed.++If you prefer not to use the msi installer, we also provide+a zip file that contains pandoc's binaries and+documentation. Simply unzip this file and move the binaries+to a directory of your choice.++Alternatively, you can install pandoc using+[Chocolatey](https://chocolatey.org):++ choco install pandoc++Chocolatey can also install other software that integrates with Pandoc.+For example, to install `rsvg-convert` (from [librsvg], covering formats+without SVG support), [Python] (to use Pandoc filters), and+[MiKTeX] (to typeset PDFs with [LaTeX]):++ choco install rsvg-convert python miktex++Or, you can install pandoc using+[winget](https://github.com/microsoft/winget-pkgs):++ winget install --source winget --exact --id JohnMacFarlane.Pandoc++Or, you can install Pandoc using [Conda forge].++Using multiple installation methods can result in two separate+installations of pandoc; it is recommended to properly uninstall+pandoc before switching to an alternative installation method.++By default, Pandoc creates PDFs using LaTeX. We recommend+installing it via [MiKTeX]. With the option `--pdf-engine`,+you however can specify other programs for this task.++## macOS++There is a package installer at pandoc's [download page].+If you later want to uninstall the package, you can do so+by downloading [this script][uninstaller]+and running it with `perl uninstall-pandoc.pl`.++Alternatively, you can install pandoc using+[Homebrew](https://brew.sh):++ brew install pandoc++Homebrew can also install other software that integrates with Pandoc.+For example, to install [librsvg] (its `rsvg-convert` covers formats+without SVG support), [Python] (to use Pandoc filters), and+[BasicTeX] (to typeset PDFs with [LaTeX]):++ brew install librsvg python homebrew/cask/basictex++Note: On unsupported versions of macOS (more than three releases old),+Homebrew installs from source, which takes additional time and disk space+for the `ghc` compiler and dependent Haskell libraries.++You can also install pandoc using [MacPorts]:++ port install pandoc++Or, you can install Pandoc using [Conda forge].++We also provide a zip file containing the binaries and man+pages, for those who prefer not to use the installer. Simply+unzip the file and move the binaries and man pages to+whatever directory you like.++By default, Pandoc creates PDFs using LaTeX. Because a full [MacTeX]+installation uses four gigabytes of disk space, we recommend+[BasicTeX] or [TinyTeX](https://yihui.org/tinytex/)+and using the `tlmgr` tool to install additional packages+as needed. If you receive errors warning of fonts not found:++ tlmgr install collection-fontsrecommended++With the option `--pdf-engine`, you however can specify other programs+for this task.++## Linux++Check whether the pandoc version in your package manager is+not outdated. Pandoc is in the [Debian], [Ubuntu], [Slackware],+[Arch], [Fedora], [NixOS], [openSUSE], [gentoo] and [Void] repositories.++To get the latest release, we provide a binary package for amd64+architecture on the **[download page]**.++The executable is statically linked and+has no dynamic dependencies or dependencies on external+data files.++Both a tarball and a deb installer are provided. To install the deb:++ sudo dpkg -i $DEB++where `$DEB` is the path to the downloaded deb. This will+install the `pandoc` executable and man page.++If you use an RPM-based distro, you may be able to install+the deb from our download page using `alien`.++On any distro, you may install from the tarball into `$DEST`+(say, `/usr/local/` or `$HOME/.local`) by doing++ tar xvzf $TGZ --strip-components 1 -C $DEST++where `$TGZ` is the path to the downloaded zipped tarball.+For Pandoc versions before 2.0, which don't provide+a tarball, try instead++ ar p $DEB data.tar.gz | tar xvz --strip-components 2 -C $DEST++Or, you can install Pandoc using [Conda forge].++You can also install from source, using the+instructions below under [Compiling from source].++By default, Pandoc creates PDFs using LaTeX. We recommend installing+[TeX Live](https://www.tug.org/texlive/) via your package+manager. (On Debian/Ubuntu, `apt-get install texlive`.) With the option+`--pdf-engine`, you however can specify other programs for this task.++## Chrome OS++On Chrome OS, pandoc can be installed using the+[chromebrew](https://github.com/skycocker/chromebrew) package manager+with the command:++```sh+crew install pandoc+```++This will automatically build and configure pandoc for the specific+device you are using.++## BSD++Pandoc is in the [NetBSD], [FreeBSD], and [OpenBSD ports] repositories.++## Conda Forge++You can install Pandoc using a [Conda+Forge](https://anaconda.org/conda-forge/pandoc) tool, like+[Conda](https://conda.pydata.org/docs/intro.html),+[[Micro]Mamba](https://mamba.readthedocs.io/en/latest/index.html) or+[Pixi](https://prefix.dev). Conda forge also includes multiple LaTeX and+other relevant packages for Pandoc (including `pandoc-citeproc`,+`pandoc-plot`, `rsvg-convert` via `librsvg` etc.). **Note:** conda forge+installs a statically-linked executable.++ conda install -c conda-forge pandoc+ pixi global install pandoc+ micromamba install pandoc++## Docker++The official Docker images for pandoc can be found at+<https://github.com/pandoc/dockerfiles> and at+[dockerhub](https://hub.docker.com/).++The [pandoc/core](https://hub.docker.com/r/pandoc/core)+image contains `pandoc`.++The [pandoc/latex](https://hub.docker.com/r/pandoc/latex)+image also contains the minimal LaTeX installation needed+to produce PDFs using pandoc.++To run pandoc using Docker, converting `README.md` to `README.pdf`:++ docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` pandoc/latex README.md -o README.pdf++## GitHub Actions++Pandoc can be run through+[GitHub Actions](https://github.com/features/actions). For some+examples, see <https://github.com/pandoc/pandoc-action-example>.++## GitLab CI/CD++Pandoc can be run through [GitLab CI/CD]. For some+examples, see <https://gitlab.com/pandoc/pandoc-ci-example>.++## Compiling from source++If for some reason a binary package is not available for your+platform, or if you want to hack on pandoc or use a non-released+version, you can install from source.++### Getting the pandoc source code++Source tarballs can be found at+<https://hackage.haskell.org/package/pandoc>. For example, to+fetch the source for version 1.17.0.3:++ wget https://hackage.haskell.org/package/pandoc-1.17.0.3/pandoc-1.17.0.3.tar.gz+ tar xvzf pandoc-1.17.0.3.tar.gz+ cd pandoc-1.17.0.3++Or you can fetch the development code by cloning the repository:++ git clone https://github.com/jgm/pandoc+ cd pandoc++Note: there may be times when the development code is broken+or depends on other libraries which must be installed+separately. Unless you really know what you're doing, install+the last released version.++### Quick stack method++The easiest way to build pandoc from source is to use [stack][stack]:++1. Install [stack][stack]. Note that Pandoc requires stack >= 1.7.0.++2.+ stack setup+ stack install pandoc-cli++ `stack setup` will automatically download the ghc compiler+ if you don't have it. `stack install` will install the+ `pandoc` executable into `~/.local/bin`, which you should+ add to your `PATH`. This process will take a while, and+ will consume a considerable amount of disk space.+++### Quick cabal method++1. Install [ghcup](https://www.haskell.org/ghcup/install/).+ This will give you `ghc` and `cabal`.++2. Update your package database:++ cabal update++3. Use `cabal` to install pandoc and its dependencies:++ cabal install pandoc-cli++ This procedure will install the released version of pandoc,+ which will be downloaded automatically from HackageDB.+ The `pandoc` executable will be symlinked in`$HOME/.cabal/bin`+ on linux/unix/macOS and in `%APPDATA%\cabal\bin` on Windows.+ Make sure this directory is in your path. To specify a+ custom install directory, use `--installdir`. To have+ the executable copied instead of symlinked, use+ `--install-method=copy`.++ If you want to install a modified or development version of+ pandoc instead, switch to the source directory before running+ the above command -- cabal will use the local code for all+ projects mentioned in the `cabal.project`.++4. You should now be able to run `pandoc`:++ pandoc --help++5. Cabal does not install the `pandoc.1` man page, but you can+ copy it from the `man/` directory of the source code to+ `/usr/local/share/man/man1/` or wherever man pages go on+ your system.+++### Custom cabal method++This is a step-by-step procedure that offers maximal control+over the build and installation. Most users should use the+quick install, but this information may be of use to packagers.+For more details, see the [Cabal User's Guide]. These instructions+assume that the pandoc source directory is your working directory.+You will need cabal version 2.0 or higher.++1. Install dependencies:++ cabal update+ cabal build --only-dependencies++2. Configure:++ cabal configure --prefix=DIR --bindir=DIR --libdir=DIR \+ --datadir=DIR --libsubdir=DIR --datasubdir=DIR --docdir=DIR \+ --htmldir=DIR --program-prefix=PREFIX --program-suffix=SUFFIX \+ --mandir=DIR --flags=FLAGSPEC --enable-tests++ All of the options have sensible defaults that can be overridden+ as needed.++ `FLAGSPEC` is a list of Cabal configuration flags, optionally+ preceded by a `-` (to force the flag to `false`), and separated+ by spaces. `pandoc`'s flags include:++ - `embed_data_files`: embed all data files into the binary (default no).+ This is helpful if you want to create a relocatable binary.++ `pandoc-cli`'s flags include:++ - `lua`: compile in support for Lua filters and custom+ writers.++ - `server`: compile in support for running in HTTP server+ mode when the executable is renamed (or symlinked as)+ `pandoc-server`.++3. Build:++ cabal build+ cabal test++4. Build API documentation:++ cabal haddock --html-location=URL --hyperlink-source++5. Install++ cabal install pandoc-cli++### Creating a relocatable binary++It is possible to compile pandoc such that the data files+pandoc uses are embedded in the binary. The resulting binary+can be run from any directory and is completely self-contained.+With cabal, add `-fembed_data_files` to the `cabal configure`+or `cabal build` commands.++With stack, use `--flag pandoc:embed_data_files`.++### Running tests++Pandoc comes with an automated test suite.+To run with cabal, `cabal test`; to run with stack, `stack+test`.++To run particular tests (pattern-matching on their names), use+the `-p` option:++ cabal test --test-options='-p markdown'++Or with stack:++ stack test --test-arguments='-p markdown'++It is often helpful to add `-j4` (run tests in parallel)+and `--hide-successes` (don't clutter output with successes)+to the test arguments as well.++If you add a new feature to pandoc, please add tests as well, following+the pattern of the existing tests. The test suite code is in+`test/test-pandoc.hs`. If you are adding a new reader or writer, it is+probably easiest to add some data files to the `test` directory, and+modify `test/Tests/Old.hs`. Otherwise, it is better to modify the module+under the `test/Tests` hierarchy corresponding to the pandoc module you+are changing.++### Running benchmarks++To build and run the benchmarks:++ cabal configure --enable-benchmarks && cabal build+ cabal bench++or with stack:++ stack bench++To use a smaller sample size so the benchmarks run faster:++ cabal bench --benchmark-options='-s 20'++To run just the markdown benchmarks:++ cabal bench --benchmark-options='markdown'+++[Arch]: https://archlinux.org/packages/?q=pandoc+[Cabal User's Guide]: https://cabal.readthedocs.io/+[Debian]: https://packages.debian.org/search?keywords=pandoc+[Fedora]: https://packages.fedoraproject.org/pkgs/pandoc/pandoc/+[FreeBSD]: https://www.freshports.org/textproc/hs-pandoc/+[GHC]: https://www.haskell.org/ghc/+[GitLab CI/CD]: https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/+[MacPorts]: https://ports.macports.org/port/pandoc/+[MacTeX]: https://tug.org/mactex/+[OpenBSD ports]: https://cvsweb.openbsd.org/ports/textproc/pandoc/+[BasicTeX]: https://www.tug.org/mactex/morepackages.html+[LaTeX]: https://www.latex-project.org+[MiKTeX]: https://miktex.org/+[librsvg]: https://wiki.gnome.org/Projects/LibRsvg+[Python]: https://www.python.org+[NetBSD]: https://pkgsrc.se/converters/pandoc+[NixOS]: https://search.nixos.org/packages?query=pandoc+[Slackware]: https://www.slackbuilds.org/result/?search=pandoc&sv=+[Ubuntu]: https://packages.ubuntu.com/search?keywords=pandoc+[download page]: https://github.com/jgm/pandoc/releases/latest+[gentoo]: https://packages.gentoo.org/package/app-text/pandoc+[haskell repository]: https://wiki.archlinux.org/index.php/Haskell_Package_Guidelines#.5Bhaskell.5D+[openSUSE]: https://software.opensuse.org/package/pandoc+[source tarball]: https://hackage.haskell.org/package/pandoc+[stack]: https://docs.haskellstack.org/en/stable/install_and_upgrade.html+[cabal-install]: https://hackage.haskell.org/package/cabal-install+[Void]: https://voidlinux.org/packages/?arch=x86_64&q=pandoc+[uninstaller]: https://raw.githubusercontent.com/jgm/pandoc/main/macos/uninstall-pandoc.pl
@@ -0,0 +1,8054 @@+---+title: Pandoc User's Guide+author: John MacFarlane+date: 2026-06-03+---++# Synopsis++`pandoc` [*options*] [*input-file*]...++# Description++Pandoc is a [Haskell] library for converting from one markup format to+another, and a command-line tool that uses this library.++Pandoc can convert between numerous markup and word processing formats,+including, but not limited to, various flavors of [Markdown], [HTML],+[LaTeX] and [Word docx]. For the full lists of input and output formats,+see the `--from` and `--to` [options below][General options].+Pandoc can also produce [PDF] output: see [creating a PDF], below.++Pandoc's enhanced version of Markdown includes syntax for [tables],+[definition lists], [metadata blocks], [footnotes], [citations], [math],+and much more. See below under [Pandoc's Markdown].++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+(an _abstract syntax tree_ or AST), 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. Users can also+run custom [pandoc filters] to modify the intermediate AST.++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+Markdown can be expected to be lossy.++## Using pandoc++If no *input-files* are specified, input is read from *stdin*.+Output goes to *stdout* by default. For output to a file,+use the `-o`/`--output` option:++ pandoc -o output.html input.txt++By default, pandoc produces a document fragment. To produce a standalone+document (e.g. a valid HTML file including `<head>` and `<body>`),+use the `-s` or `--standalone` flag:++ pandoc -s -o output.html input.txt++For more information on how standalone documents are produced, see+[Templates] below.++If multiple input files are given, pandoc will concatenate them all (with+blank lines between them) before parsing. (Use `--file-scope` to parse files+individually.)++## Specifying formats++The format of the input and output can be specified explicitly using+command-line options. The input format can be specified using the+`-f/--from` option, the output format using the `-t/--to` option.+Thus, to convert `hello.txt` from Markdown to LaTeX, you could type:++ pandoc -f markdown -t latex hello.txt++To convert `hello.html` from HTML to Markdown:++ pandoc -f html -t markdown hello.html++Supported input and output formats are listed below under [Options]+(see `-f` for input formats and `-t` for output formats). You+can also use `pandoc --list-input-formats` and+`pandoc --list-output-formats` to print lists of supported+formats.++If the input or output format is not specified explicitly, pandoc+will attempt to guess it from the extensions of the filenames.+Thus, for example,++ pandoc -o hello.tex hello.txt++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.++## Character encoding++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 and output through [`iconv`]:++ iconv -t utf-8 input.txt | pandoc | iconv -f utf-8++Note that in some output formats (such as HTML, LaTeX, ConTeXt,+RTF, OPML, DocBook, and Texinfo), information about+the character encoding is included in the document header, which+will only be included if you use the `-s/--standalone` option.++[`iconv`]: https://www.gnu.org/software/libiconv/++## Creating a PDF++To produce a PDF, specify an output file with a `.pdf` extension:++ pandoc test.txt -o test.pdf++By default, pandoc will use LaTeX to create the PDF, which requires+that a LaTeX engine be installed (see `--pdf-engine` below).+Alternatively, pandoc can use ConTeXt, roff ms, or HTML as an+intermediate format. To do this, specify an output file with a+`.pdf` extension, as before, but add the `--pdf-engine` option+or `-t context`, `-t html`, or `-t ms` to the command line.+The tool used to generate the PDF from the intermediate format+may be specified using `--pdf-engine`.++You can control the PDF style using variables, depending on+the intermediate format used: see [variables for LaTeX],+[variables for ConTeXt], [variables for `wkhtmltopdf`],+[variables for ms]. When HTML is used as an intermediate+format, the output can be styled using `--css`.++To debug the PDF creation, it can be useful to look at the intermediate+representation: instead of `-o test.pdf`, use for example `-s -o test.tex`+to output the generated LaTeX. You can then test it with `pdflatex test.tex`.++When using LaTeX, the following packages need to be available+(they are included with all recent versions of [TeX Live]):+[`amsfonts`], [`amsmath`], [`lm`], [`unicode-math`],+[`iftex`], [`listings`] (if the+`--listings` option is used), [`fancyvrb`], [`longtable`],+[`booktabs`], [`multirow`] (if the document contains a table with+cells that cross multiple rows), [`graphicx`] (if the document+contains images), [`bookmark`], [`xcolor`],+[`soul`], [`geometry`] (with the `geometry` variable set),+[`setspace`] (with `linestretch`), and+[`babel`] (with `lang`). If `CJKmainfont` is set, [`xeCJK`]+is needed if `xelatex` is used, else [`luatexja`] is needed if+`lualatex` is used. [`framed`] is required if code is highlighted in a+scheme that use a colored background. The use of `xelatex` or+`lualatex` as the PDF engine requires [`fontspec`]. `lualatex`+uses [`selnolig`] and [`lua-ul`]. `xelatex` uses [`bidi`] (with+the `dir` variable set).+If the `mathspec` variable is set, `xelatex` will use [`mathspec`]+instead of [`unicode-math`]. The [`csquotes`] package will be used+for [typography] if the `csquotes` variable or metadata field is+set to a true value. The [`natbib`], [`biblatex`], [`bibtex`],+and [`biber`] packages can optionally be used for [citation+rendering]. If math with `\cancel`, `\bcancel`, or `\xcancel`+is used, the [`cancel`] package is needed.+The following packages will be used to improve+output quality if present, but pandoc does not require them to+be present: [`upquote`] (for straight quotes in verbatim+environments), [`microtype`] (for better spacing adjustments),+[`parskip`] (for better inter-paragraph spaces), [`xurl`] (for+better line breaks in URLs), and [`footnotehyper`] or+[`footnote`] (to allow footnotes in tables).++[TeX Live]: https://www.tug.org/texlive/+[`amsfonts`]: https://ctan.org/pkg/amsfonts+[`amsmath`]: https://ctan.org/pkg/amsmath+[`babel`]: https://ctan.org/pkg/babel+[`biber`]: https://ctan.org/pkg/biber+[`biblatex`]: https://ctan.org/pkg/biblatex+[`bibtex`]: https://ctan.org/pkg/bibtex+[`bidi`]: https://ctan.org/pkg/bidi+[`bookmark`]: https://ctan.org/pkg/bookmark+[`booktabs`]: https://ctan.org/pkg/booktabs+[`csquotes`]: https://ctan.org/pkg/csquotes+[`fancyvrb`]: https://ctan.org/pkg/fancyvrb+[`fontspec`]: https://ctan.org/pkg/fontspec+[`footnote`]: https://ctan.org/pkg/footnote+[`footnotehyper`]: https://ctan.org/pkg/footnotehyper+[`framed`]: https://ctan.org/pkg/framed+[`geometry`]: https://ctan.org/pkg/geometry+[`graphicx`]: https://ctan.org/pkg/graphicx+[`cancel`]: https://ctan.org/pkg/cancel+[`hyperref`]: https://ctan.org/pkg/hyperref+[`iftex`]: https://ctan.org/pkg/iftex+[`listings`]: https://ctan.org/pkg/listings+[`lm`]: https://ctan.org/pkg/lm+[`lua-ul`]: https://ctan.org/pkg/lua-ul+[`luatexja`]: https://ctan.org/pkg/luatexja+[`longtable`]: https://ctan.org/pkg/longtable+[`mathspec`]: https://ctan.org/pkg/mathspec+[`microtype`]: https://ctan.org/pkg/microtype+[`multirow`]: https://ctan.org/pkg/multirow+[`natbib`]: https://ctan.org/pkg/natbib+[`parskip`]: https://ctan.org/pkg/parskip+[`polyglossia`]: https://ctan.org/pkg/polyglossia+[`prince`]: https://www.princexml.com/+[`setspace`]: https://ctan.org/pkg/setspace+[`soul`]: https://ctan.org/pkg/soul+[`unicode-math`]: https://ctan.org/pkg/unicode-math+[`upquote`]: https://ctan.org/pkg/upquote+[`weasyprint`]: https://weasyprint.org+[`wkhtmltopdf`]: https://wkhtmltopdf.org+[`xcolor`]: https://ctan.org/pkg/xcolor+[`xeCJK`]: https://ctan.org/pkg/xecjk+[`xurl`]: https://ctan.org/pkg/xurl+[`selnolig`]: https://ctan.org/pkg/selnolig++++## Reading from the Web++Instead of an input file, an absolute URI may be given. In this case+pandoc will fetch the content using HTTP:++ pandoc -f html -t markdown https://www.fsf.org++It is possible to supply a custom User-Agent string or other+header when requesting a document from a URL:++ pandoc -f html -t markdown --request-header User-Agent:"Mozilla/5.0" \+ https://www.fsf.org++# Options++## General options {.options}++`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*++: Specify input format. *FORMAT* can be:++ ::: {#input-formats}+ - `asciidoc` ([AsciiDoc] markup)+ - `bibtex` ([BibTeX] bibliography)+ - `biblatex` ([BibLaTeX] bibliography)+ - `bits` ([BITS] XML, alias for `jats`)+ - `commonmark` ([CommonMark] Markdown)+ - `commonmark_x` ([CommonMark] Markdown with extensions)+ - `creole` ([Creole 1.0])+ - `csljson` ([CSL JSON] bibliography)+ - `csv` ([CSV] table)+ - `tsv` ([TSV] table)+ - `djot` ([Djot markup])+ - `docbook` ([DocBook])+ - `docx` ([Word docx])+ - `dokuwiki` ([DokuWiki markup])+ - `endnotexml` ([EndNote XML bibliography])+ - `epub` ([EPUB])+ - `fb2` ([FictionBook2] e-book)+ - `gfm` ([GitHub-Flavored Markdown]),+ or the deprecated and less accurate `markdown_github`;+ use [`markdown_github`](#markdown-variants) only+ if you need extensions not supported in [`gfm`](#markdown-variants).+ - `haddock` ([Haddock markup])+ - `html` ([HTML])+ - `ipynb` ([Jupyter notebook])+ - `jats` ([JATS] XML)+ - `jira` ([Jira]/Confluence wiki markup)+ - `json` (JSON version of native AST)+ - `latex` ([LaTeX])+ - `markdown` ([Pandoc's Markdown])+ - `markdown_mmd` ([MultiMarkdown])+ - `markdown_phpextra` ([PHP Markdown Extra])+ - `markdown_strict` (original unextended [Markdown])+ - `mediawiki` ([MediaWiki markup])+ - `man` ([roff man])+ - `mdoc` ([mdoc] manual page markup)+ - `muse` ([Muse])+ - `native` (native Haskell)+ - `odt` ([OpenDocument text document][ODT])+ - `opml` ([OPML])+ - `org` ([Emacs Org mode])+ - `pod` (Perl's [Plain Old Documentation])+ - `pptx` ([PowerPoint])+ - `ris` ([RIS] bibliography)+ - `rtf` ([Rich Text Format])+ - `rst` ([reStructuredText])+ - `t2t` ([txt2tags])+ - `textile` ([Textile])+ - `tikiwiki` ([TikiWiki markup])+ - `twiki` ([TWiki markup])+ - `typst` ([typst])+ - `vimwiki` ([Vimwiki])+ - `xlsx` ([Excel spreadsheet][XLSX])+ - `xml` (XML version of native AST)+ - the path of a custom Lua reader, see [Custom readers and writers] below+ :::++ Extensions can be individually enabled or disabled by+ appending `+EXTENSION` or `-EXTENSION` to the format name.+ See [Extensions] below, for a list of extensions and+ their names. See `--list-input-formats` and `--list-extensions`,+ below.++`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*++: Specify output format. *FORMAT* can be:++ ::: {#output-formats}+ - `ansi` (text with [ANSI escape codes], for terminal viewing)+ - `asciidoc` (modern [AsciiDoc] as interpreted by [AsciiDoctor])+ - `asciidoc_legacy` ([AsciiDoc] as interpreted by [`asciidoc-py`]).+ - `asciidoctor` (deprecated synonym for `asciidoc`)+ - `bbcode` [BBCode]+ - `bbcode_fluxbb` [BBCode (FluxBB)]+ - `bbcode_phpbb` [BBCode (phpBB)]+ - `bbcode_steam` [BBCode (Steam)]+ - `bbcode_hubzilla` [BBCode (Hubzilla)]+ - `bbcode_xenforo` [BBCode (xenForo)]+ - `beamer` ([LaTeX beamer][`beamer`] slide show)+ - `bibtex` ([BibTeX] bibliography)+ - `biblatex` ([BibLaTeX] bibliography)+ - `chunkedhtml` (zip archive of multiple linked HTML files)+ - `commonmark` ([CommonMark] Markdown)+ - `commonmark_x` ([CommonMark] Markdown with extensions)+ - `context` ([ConTeXt])+ - `csljson` ([CSL JSON] bibliography)+ - `djot` ([Djot markup])+ - `docbook` or `docbook4` ([DocBook] 4)+ - `docbook5` (DocBook 5)+ - `docx` ([Word docx])+ - `dokuwiki` ([DokuWiki markup])+ - `epub` or `epub3` ([EPUB] v3 book)+ - `epub2` (EPUB v2)+ - `fb2` ([FictionBook2] e-book)+ - `gfm` ([GitHub-Flavored Markdown]),+ or the deprecated and less accurate `markdown_github`;+ use [`markdown_github`](#markdown-variants) only+ if you need extensions not supported in [`gfm`](#markdown-variants).+ - `haddock` ([Haddock markup])+ - `html` or `html5` ([HTML], i.e. [HTML5]/XHTML [polyglot markup])+ - `html4` ([XHTML] 1.0 Transitional)+ - `icml` ([InDesign ICML])+ - `ipynb` ([Jupyter notebook])+ - `jats_archiving` ([JATS] XML, Archiving and Interchange Tag Set)+ - `jats_articleauthoring` ([JATS] XML, Article Authoring Tag Set)+ - `jats_publishing` ([JATS] XML, Journal Publishing Tag Set)+ - `jats` (alias for `jats_archiving`)+ - `jira` ([Jira]/Confluence wiki markup)+ - `json` (JSON version of native AST)+ - `latex` ([LaTeX])+ - `man` ([roff man])+ - `markdown` ([Pandoc's Markdown])+ - `markdown_mmd` ([MultiMarkdown])+ - `markdown_phpextra` ([PHP Markdown Extra])+ - `markdown_strict` (original unextended [Markdown])+ - `markua` ([Markua])+ - `mediawiki` ([MediaWiki markup])+ - `ms` ([roff ms])+ - `muse` ([Muse])+ - `native` (native Haskell)+ - `odt` ([OpenDocument text document][ODT])+ - `opml` ([OPML])+ - `opendocument` ([OpenDocument XML])+ - `org` ([Emacs Org mode])+ - `pdf` ([PDF])+ - `plain` (plain text)+ - `pptx` ([PowerPoint] slide show)+ - `rst` ([reStructuredText])+ - `rtf` ([Rich Text Format])+ - `texinfo` ([GNU Texinfo])+ - `textile` ([Textile])+ - `slideous` ([Slideous] HTML and JavaScript slide show)+ - `slidy` ([Slidy] HTML and JavaScript slide show)+ - `dzslides` ([DZSlides] HTML5 + JavaScript slide show)+ - `revealjs` ([reveal.js] HTML5 + JavaScript slide show)+ - `s5` ([S5] HTML and JavaScript slide show)+ - `tei` ([TEI Simple])+ - `typst` ([typst])+ - `vimdoc` ([Vimdoc])+ - `xml` (XML version of native AST)+ - `xwiki` ([XWiki markup])+ - `zimwiki` ([ZimWiki markup])+ - the path of a custom Lua writer, see [Custom readers and writers] below+ :::++ Note that `odt`, `docx`, `epub`, and `pdf` output will not be directed+ to *stdout* unless forced with `-o -`.++ Extensions can be individually enabled or+ disabled by appending `+EXTENSION` or `-EXTENSION` to the format+ name. See [Extensions] below, for a list of extensions and their+ names. See `--list-output-formats` and `--list-extensions`, below.++`-o` *FILE*, `--output=`*FILE*++: Write output to *FILE* instead of *stdout*. If *FILE* is+ `-`, output will go to *stdout*, even if a non-textual format+ (`docx`, `odt`, `epub2`, `epub3`) is specified. If the+ output format is `chunkedhtml` and *FILE* has no extension,+ then instead of producing a `.zip` file pandoc will create+ a directory *FILE* and unpack the zip archive there+ (unless *FILE* already exists, in which case an error+ will be raised).++`--data-dir=`*DIRECTORY*++: Specify the user data directory to search for pandoc data files.+ If this option is not specified, the default user data directory+ will be used. On \*nix and macOS systems this will be the `pandoc`+ subdirectory of the XDG data directory (by default,+ `$HOME/.local/share`, overridable by setting the `XDG_DATA_HOME`+ environment variable). If that directory does not exist and+ `$HOME/.pandoc` exists, it will be used (for backwards compatibility).+ On Windows the default user data directory is `%APPDATA%\pandoc`.+ You can find the default user data directory on your system by+ looking at the output of `pandoc --version`.+ Data files placed in this directory (for example, `reference.odt`,+ `reference.docx`, `epub.css`, `templates`) will override+ pandoc's normal defaults. (Note that the user data directory+ is not created by pandoc, so you will need to create it yourself+ if you want to make use of it.)++`-d` *FILE*, `--defaults=`*FILE*++: Specify a set of default option settings. *FILE* is a YAML or JSON+ file whose fields correspond to command-line option+ settings. All options for document conversion, including input+ and output files, can be set using a defaults file. The file will+ be searched for first in the working directory, and then in+ the `defaults` subdirectory of the user data directory+ (see `--data-dir`). The `.yaml` extension will be added if+ *FILE* lacs an extension. See the section [Defaults files]+ for more information on the file format. Settings from the+ defaults file may be overridden or extended by subsequent+ options on the command line.++`--bash-completion`++: Generate a bash completion script. To enable bash completion+ with pandoc, add this to your `.bashrc`:++ eval "$(pandoc --bash-completion)"++`--sandbox[=true|false]`++: Run pandoc in a sandbox, limiting IO operations in readers+ and writers to reading the files specified on the command line.+ Note that this option does not limit IO operations by+ filters or in the production of PDF documents. But it does+ offer security against, for example, disclosure of files+ through the use of `include` directives. Anyone using+ pandoc on untrusted user input should use this option.++ Note: some readers and writers (e.g., `docx`) need access to data+ files. If these are stored on the file system, then pandoc+ will not be able to find them when run in `--sandbox` mode+ and will raise an error. For these applications, we+ recommend using a pandoc binary compiled with the `embed_data_files`+ option, which causes the data files to be baked into the binary+ instead of being stored on the file system.++`--verbose`++: Give verbose debugging output.++`--quiet`++: Suppress warning messages.++`--fail-if-warnings[=true|false]`++: Exit with error status if there are any warnings.++`--log=`*FILE*++: Write log messages in machine-readable JSON format to+ *FILE*. All messages above DEBUG level will be written,+ regardless of verbosity settings (`--verbose`, `--quiet`).++`--list-input-formats`++: List supported input formats, one per line.++`--list-output-formats`++: List supported output formats, one per line.++`--list-extensions`[`=`*FORMAT*]++: List supported extensions for *FORMAT*, one per line, preceded+ by a `+` or `-` indicating whether it is enabled by default+ in *FORMAT*. If *FORMAT* is not specified, defaults for+ pandoc's Markdown are given.++`--list-highlight-languages`++: List supported languages for syntax highlighting, one per+ line.++`--list-highlight-styles`++: List supported styles for syntax highlighting, one per line.+ See `--syntax-highlighting`.++`-v`, `--version`++: Print version.++`-h`, `--help`++: Show usage message.++[ANSI escape codes]: https://en.wikipedia.org/wiki/ANSI_escape_code+[Markdown]: https://daringfireball.net/projects/markdown/+[CommonMark]: https://commonmark.org+[PHP Markdown Extra]: https://michelf.ca/projects/php-markdown/extra/+[GitHub-Flavored Markdown]: https://help.github.com/articles/github-flavored-markdown/+[MultiMarkdown]: https://fletcherpenney.net/multimarkdown/+[reStructuredText]: https://docutils.sourceforge.io/docs/ref/rst/introduction.html+[S5]: https://meyerweb.com/eric/tools/s5/+[Slidy]: https://www.w3.org/Talks/Tools/Slidy2/+[Slideous]: https://goessner.net/articles/slideous/+[HTML]: https://www.w3.org/html/+[HTML5]: https://html.spec.whatwg.org/+[polyglot markup]: https://www.w3.org/TR/html-polyglot/+[XHTML]: https://www.w3.org/TR/xhtml1/+[LaTeX]: https://www.latex-project.org/+[`beamer`]: https://ctan.org/pkg/beamer+[Beamer User's Guide]: http://mirrors.ctan.org/macros/latex/contrib/beamer/doc/beameruserguide.pdf+[ConTeXt]: https://www.contextgarden.net/+[Rich Text Format]: https://en.wikipedia.org/wiki/Rich_Text_Format+[DocBook]: https://docbook.org+[Djot markup]: https://djot.net+[JATS]: https://jats.nlm.nih.gov+[BITS]: https://jats.nlm.nih.gov/extensions/bits/+[Jira]: https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all+[txt2tags]: https://txt2tags.org+[EPUB]: http://idpf.org/epub+[OPML]: https://opml.org/spec2.opml+[OpenDocument XML]: https://www.oasis-open.org/2021/06/16/opendocument-v1-3-oasis-standard-published/+[ODT]: https://en.wikipedia.org/wiki/OpenDocument+[Plain Old Documentation]: https://perldoc.perl.org/perlpod+[Textile]: https://textile-lang.com+[MediaWiki markup]: https://www.mediawiki.org/wiki/Help:Formatting+[DokuWiki markup]: https://www.dokuwiki.org/dokuwiki+[ZimWiki markup]: https://zim-wiki.org/manual/Help/Wiki_Syntax.html+[XWiki markup]: https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/+[XLSX]: https://en.wikipedia.org/wiki/Microsoft_Excel#File_formats+[Vimdoc]: https://vimhelp.org/helphelp.txt.html#help-writing+[TWiki markup]: https://twiki.org/cgi-bin/view/TWiki/TextFormattingRules+[TikiWiki markup]: https://doc.tiki.org/Wiki-Syntax-Text#The_Markup_Language_Wiki-Syntax+[Haddock markup]: https://www.haskell.org/haddock/doc/html/ch03s08.html+[Creole 1.0]: http://www.wikicreole.org/wiki/Creole1.0+[CSV]: https://tools.ietf.org/html/rfc4180+[TSV]: https://www.iana.org/assignments/media-types/text/tab-separated-values+[roff man]: https://man.cx/groff_man(7)+[roff ms]: https://man.cx/groff_ms(7)+[Haskell]: https://www.haskell.org+[GNU Texinfo]: https://www.gnu.org/software/texinfo/+[RIS]: https://en.wikipedia.org/wiki/RIS_(file_format)+[Emacs Org mode]: https://orgmode.org+[AsciiDoc]: https://asciidoc.org/+[AsciiDoctor]: https://asciidoctor.org/+[`asciidoc-py`]: https://github.com/asciidoc-py/asciidoc-py+[DZSlides]: https://paulrouget.com/dzslides/+[Word docx]: https://en.wikipedia.org/wiki/Office_Open_XML+[PDF]: https://www.adobe.com/pdf/+[reveal.js]: https://revealjs.com/+[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1+[Jupyter notebook]: https://nbformat.readthedocs.io/en/latest/+[InDesign ICML]: https://web.archive.org/web/20211006210211/https://wwwimages.adobe.com/www.adobe.com/content/dam/acom/en/devnet/indesign/sdk/cs6/idml/idml-cookbook.pdf+[TEI Simple]: https://github.com/TEIC/TEI-Simple+[Muse]: https://amusewiki.org/library/manual+[PowerPoint]: https://en.wikipedia.org/wiki/Microsoft_PowerPoint+[Vimwiki]: https://vimwiki.github.io+[CSL JSON]: https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html+[BibTeX]: https://ctan.org/pkg/bibtex+[BibLaTeX]: https://ctan.org/pkg/biblatex+[Markua]: https://leanpub.com/markua/read+[EndNote XML bibliography]: https://support.clarivate.com/Endnote/s/article/EndNote-XML-Document-Type-Definition+[typst]: https://typst.app+[mdoc]: https://mandoc.bsd.lv/man/mdoc.7.html+[BBCode]: https://www.bbcode.org/reference.php+[BBCode (FluxBB)]: https://web.archive.org/web/20210623155046/https://fluxbb.org/forums/help.php#bbcode+[BBCode (Hubzilla)]: https://hubzilla.org/help/member/bbcode+[BBCode (Steam)]: https://steamcommunity.com/comment/ForumTopic/formattinghelp+[BBCode (phpBB)]: https://www.phpbb.com/community/help/bbcode+[BBCode (xenForo)]: https://www.xenfocus.com/community/help/bb-codes/++## Reader options {.options}++`--shift-heading-level-by=`*NUMBER*++: Shift heading levels by a positive or negative integer.+ For example, with `--shift-heading-level-by=-1`, level 2+ headings become level 1 headings, and level 3 headings+ become level 2 headings. Headings cannot have a level+ less than 1, so a heading that would be shifted below level 1+ becomes a regular paragraph. Exception: with a shift of -N,+ a level-N heading at the beginning of the document+ replaces the metadata title. `--shift-heading-level-by=-1`+ is a good choice when converting HTML or Markdown documents that+ use an initial level-1 heading for the document title and+ level-2+ headings for sections. `--shift-heading-level-by=1`+ may be a good choice for converting Markdown documents that+ use level-1 headings for sections to HTML, since pandoc uses+ a level-1 heading to render the document title.++`--base-header-level=`*NUMBER*++: *Deprecated. Use `--shift-heading-level-by`=X instead,+ where X = NUMBER - 1.* Specify the base level for headings+ (defaults to 1).++`--indented-code-classes=`*CLASSES*++: Specify classes to use for indented code blocks---for example,+ `perl,numberLines` or `haskell`. Multiple classes may be separated+ by spaces or commas.++`--default-image-extension=`*EXTENSION*++: 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.++`--file-scope[=true|false]`++: Parse each file individually before combining for multifile+ documents. This will allow footnotes in different files with the+ same identifiers to work as expected. If this option is set,+ footnotes and links will not work across files. Reading binary+ files (docx, odt, epub) implies `--file-scope`.++ If two or more files are processed using `--file-scope`,+ prefixes based on the filenames will be added to identifiers+ in order to disambiguate them, and internal links will+ be adjusted accordingly. For example, a header with+ identifier `foo` in `subdir/file1.txt` will have its+ identifier changed to `subdir__file1.txt__foo`.++`-F` *PROGRAM*, `--filter=`*PROGRAM*++: 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's own+ JSON input and output. The name of the output format will be+ passed to the filter as the first argument. Hence,++ pandoc --filter ./caps.py -t latex++ is equivalent to++ pandoc -t json | ./caps.py latex | pandoc -f json -t latex++ The latter form may be useful for debugging filters.++ Filters may be written in any language. `Text.Pandoc.JSON`+ exports `toJSONFilter` to facilitate writing filters in Haskell.+ Those who would prefer to write filters in python can use the+ module [`pandocfilters`], installable from PyPI. There are also+ pandoc filter libraries in [PHP], [perl], and+ [JavaScript/node.js].++ In order of preference, pandoc will look for filters in++ 1. a specified full or relative path (executable or+ non-executable),++ 2. `$DATADIR/filters` (executable or non-executable)+ where `$DATADIR` is the user data directory (see+ `--data-dir`, above),++ 3. `$PATH` (executable only).++ Filters, Lua-filters, and citeproc processing are applied in+ the order specified on the command line.++`-L` *SCRIPT*, `--lua-filter=`*SCRIPT*++: Transform the document in a similar fashion as JSON filters (see+ `--filter`), but use pandoc's built-in Lua filtering system. The given+ Lua script is expected to return a list of Lua filters which will be+ applied in order. Each Lua filter must contain element-transforming+ functions indexed by the name of the AST element on which the filter+ function should be applied.++ The `pandoc` Lua module provides helper functions for element+ creation. It is always loaded into the script's Lua environment.++ See the [Lua filters documentation] for further details.++ In order of preference, pandoc will look for Lua filters in++ 1. a specified full or relative path,++ 2. `$DATADIR/filters` where `$DATADIR` is the user data+ directory (see `--data-dir`, above).++ Filters, Lua filters, and citeproc processing are applied in+ the order specified on the command line.++`-M` *KEY*[`=`*VAL*], `--metadata=`*KEY*[`:`*VAL*]++: Set the metadata field *KEY* to the value *VAL*. A value specified+ on the command line overrides a value specified in the document+ using [YAML metadata blocks][Extension: `yaml_metadata_block`].+ Values will be parsed as YAML boolean or string values. If no value is+ specified, the value will be treated as Boolean true. Like+ `--variable`, `--metadata` causes template variables to be set.+ But unlike `--variable`, `--metadata` affects the metadata of the+ underlying document (which is accessible from filters and may be+ printed in some output formats) and metadata values will be escaped+ when inserted into the template.++`--metadata-file=`*FILE*++: Read metadata from the supplied YAML (or JSON) file. This+ option can be used with every input format, but string scalars+ in the metadata file will always be parsed as Markdown. (If the+ input format is Markdown or a Markdown variant, then the+ same variant will be used to parse the metadata file;+ if it is a non-Markdown format, pandoc's default Markdown+ extensions will be used.) This option can be used+ repeatedly to include multiple metadata files; values in+ files specified later on the command line will be preferred+ over those specified in earlier files. Metadata values+ specified inside the document, or by using `-M`, overwrite+ values specified with this option. The file will be searched+ for first in the working directory, and then in the `metadata`+ subdirectory of the user data directory (see `--data-dir`).++`-p`, `--preserve-tabs[=true|false]`++: Preserve tabs instead of converting them to spaces. (By default, pandoc+ converts tabs to spaces before parsing its input.) Note that this will+ only affect tabs in literal code spans and code blocks. Tabs in regular+ text are always treated as spaces.++`--tab-stop=`*NUMBER*++: Specify the number of spaces per tab (default is 4).++`--track-changes=accept`|`reject`|`all`++: Specifies what to do with insertions, deletions, and comments+ produced by the MS Word "Track Changes" feature. `accept` (the+ default) processes all the insertions and deletions.+ `reject` ignores them. Both `accept` and `reject` ignore comments.+ `all` includes all insertions, deletions, and comments, wrapped+ in spans with `insertion`, `deletion`, `comment-start`, and+ `comment-end` classes, respectively. The author and time of+ change is included. `all` is useful for scripting: only+ accepting changes from a certain reviewer, say, or before a+ certain date. If a paragraph is inserted or deleted,+ `track-changes=all` produces a span with the class+ `paragraph-insertion`/`paragraph-deletion` before the+ affected paragraph break. This option only affects the docx+ reader.++`--extract-media=`*DIR*|*FILE*`.zip`++: Extract images and other media contained in or linked from+ the source document to the path *DIR*, creating it if+ necessary, and adjust the images references in the document+ so they point to the extracted files. Media are downloaded,+ read from the file system, or extracted from a binary+ container (e.g. docx), as needed. The original file paths+ are used if they are relative paths not containing `..`.+ Otherwise filenames are constructed from the SHA1 hash of+ the contents.++ If the path given ends in `.zip`, then instead of creating+ a directory, pandoc will create a zip archive containing the+ media files.++`--abbreviations=`*FILE*++: Specifies a custom abbreviations file, with abbreviations+ one to a line. If this option is not specified, pandoc will+ read the data file `abbreviations` from the user data+ directory or fall back on a system default. To see the+ system default, use+ `pandoc --print-default-data-file=abbreviations`. The only+ use pandoc makes of this list is in the Markdown reader.+ Strings found in this list will be followed by a nonbreaking+ space, and the period will not produce sentence-ending space+ in formats like LaTeX. The strings may not contain spaces.++`--typst-input=`*KEY*[`=`*VAL*]++: Set a parameter value that will be made available to the typst+ parser in `sys.inputs`, like `--input` in the `typst` CLI.+ Either `:` or `=` may be used to separate *KEY* from *VAL*.+ Values containing spaces must be quoted.++`--trace[=true|false]`++: Print diagnostic output tracing parser progress to stderr.+ This option is intended for use by developers in diagnosing+ performance issues.++[`pandocfilters`]: https://github.com/jgm/pandocfilters+[PHP]: https://github.com/vinai/pandocfilters-php+[perl]: https://metacpan.org/pod/Pandoc::Filter+[JavaScript/node.js]: https://github.com/mvhenderson/pandoc-filter-node+[Lua filters documentation]: https://pandoc.org/lua-filters.html++## General writer options {.options}++`-s`, `--standalone`++: Produce output with an appropriate header and footer (e.g. a+ standalone HTML, LaTeX, TEI, or RTF file, not a fragment). This option+ is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`+ output. For `native` output, this option causes metadata to+ be included; otherwise, metadata is suppressed.++`--template=`*FILE*|*URL*++: Use the specified file as a custom template for the generated document.+ Implies `--standalone`. See [Templates], below, for a+ description of template syntax. If the template is not found,+ pandoc will search for it in the `templates` subdirectory of+ the user data directory (see `--data-dir`). If no extension+ is specified and an extensionless template is not found,+ pandoc will look for a template with an extension+ corresponding to the writer, so that `--template=special`+ looks for `special.html` for HTML output. If this option is+ not used, a default template appropriate for the output+ format will be used (see `-D/--print-default-template`).++`-V` *KEY*[`=`*VAL*], `--variable=`*KEY*[`=`*VAL*]++: Set the template variable *KEY* to the string value *VAL* when rendering+ the document in standalone mode. Either `:` or `=` may be used+ to separate *KEY* from *VAL*. If no *VAL* is specified, the+ key will be given the value `true`. Structured values (lists, maps)+ cannot be assigned using this option, but they can be assigned in+ the `variables` section of a [defaults file][Defaults files] or+ using the `--variable-json` option. If the variable already has+ a *list* value, the value will be added to the list. If it already+ has another kind of value, it will be made into a list containing+ the previous and the new value. For example,+ `-V author=Joe -V author=Sue` makes `author` contain a list+ of strings: `Joe` and `Sue`.++`--variable-json=`*KEY*[`=`*JSON*]++: Set the template variable *KEY* to the value specified by a JSON+ string (this may be a boolean, a string, a list, or a mapping;+ a number will be treated as a string). For example,+ `--variable-json foo=false` will give `foo` the boolean false+ value, while `--variable-json foo='"false"'` will give it the+ string value `"false"`. Either `:` or `=` may be used to+ separate *KEY* from *VAL*. If the variable already has a+ value, this value will be replaced.++`-D` *FORMAT*, `--print-default-template=`*FORMAT*++: Print the system default template for an output *FORMAT*. (See `-t`+ for a list of possible *FORMAT*s.) Templates in the user data+ directory are ignored. This option may be used with+ `-o`/`--output` to redirect output to a file, but+ `-o`/`--output` must come before `--print-default-template`+ on the command line.++ Note that some of the default templates use partials, for+ example `styles.html`. To print the partials, use+ `--print-default-data-file`: for example,+ `--print-default-data-file=templates/styles.html`.++`--print-default-data-file=`*FILE*++: Print a system default data file. Files in the user data directory+ are ignored. This option may be used with `-o`/`--output` to+ redirect output to a file, but `-o`/`--output` must come before+ `--print-default-data-file` on the command line.++`--eol=crlf`|`lf`|`native`++: Manually specify line endings: `crlf` (Windows), `lf`+ (macOS/Linux/UNIX), or `native` (line endings appropriate+ to the OS on which pandoc is being run). The default is+ `native`.++`--dpi`=*NUMBER*++: Specify the default dpi (dots per inch) value for conversion+ from pixels to inch/centimeters and vice versa. (Technically,+ the correct term would be ppi: pixels per inch.) The default+ is 96dpi. When images contain information about dpi+ internally, the encoded value is used instead of the default+ specified by this option.++`--wrap=auto`|`none`|`preserve`++: Determine how text is wrapped in the output (the source+ code, not the rendered version). With `auto` (the default),+ pandoc will attempt to wrap lines to the column width specified by+ `--columns` (default 72). With `none`, pandoc will not wrap+ lines at all. With `preserve`, pandoc will attempt to+ preserve the wrapping from the source document (that is,+ where there are nonsemantic newlines in the source, there+ will be nonsemantic newlines in the output as well).+ In `ipynb` output, this option affects wrapping of the+ contents of Markdown cells.++`--columns=`*NUMBER*++: Specify length of lines in characters. This affects text wrapping+ in the generated source code (see `--wrap`). It also affects+ calculation of column widths for plain text tables (see [Tables] below).++`--toc[=true|false]`, `--table-of-contents[=true|false]`++: Include an automatically generated table of contents (or, in+ the case of `latex`, `context`, `docx`, `odt`,+ `opendocument`, `rst`, or `ms`, an instruction to create+ one) in the output document. This option has no effect+ unless `-s/--standalone` is used, and it has no effect+ on `man`, `docbook4`, `docbook5`, or `jats` output.++ Note that if you are producing a PDF via `ms` and using+ (the default) `groff` as a `--pdf-engine`, the table of+ contents will appear at the end of the document. If you would+ prefer it to be at the beginning of the document, before the+ title, you can use `--pdf-engine=pdfroff`.++`--toc-depth=`*NUMBER*++: Specify the number of section levels to include in the table+ of contents. The default is 3 (which means that level-1, 2, and 3+ headings will be listed in the contents).++`--lof[=true|false]`, `--list-of-figures[=true|false]`++: Include an automatically generated list of figures (or, in+ some formats, an instruction to create one) in the output+ document. This option has no effect unless `-s/--standalone`+ is used, and it only has an effect on `latex`, `context`, and+ `docx` output.++`--lot[=true|false]`, `--list-of-tables[=true|false]`++: Include an automatically generated list of tables (or, in+ some formats, an instruction to create one) in the output+ document. This option has no effect unless `-s/--standalone`+ is used, and it only has an effect on `latex`, `context`, and+ `docx` output.++`--strip-comments[=true|false]`++: Strip out HTML comments in the Markdown or Textile source,+ rather than passing them on to Markdown, Textile or HTML+ output as raw HTML. This does not apply to HTML comments+ inside raw HTML blocks when the `markdown_in_html_blocks`+ extension is not set.++`--syntax-highlighting=default|none|idiomatic|`*STYLE*`|`*FILE*++: The method to use for code syntax highlighting. Setting a+ specific *STYLE* causes highlighting to be performed with the+ internal highlighting engine, using KDE syntax definitions and+ styles. The `idiomatic` method uses a format-specific+ highlighter if one is available, or the default style if the+ target format has no idiomatic highlighting method. Setting this+ option to `none` disables all syntax highlighting. The+ `default` method uses a format-specific default.++ The default for HTML, EPUB, Docx, Ms, Man, and LaTeX output is+ to use the internal highlighter with the default style; for Typst+ it is to use Typst's own syntax highlighting system.++ Style options are `pygments` (the default), `kate`,+ `monochrome`, `breezeDark`, `espresso`, `zenburn`, `haddock`,+ and `tango`. For more information on syntax highlighting in+ pandoc, see [Syntax highlighting], below. See also+ `--list-highlight-styles`.++ Instead of a *STYLE* name, a JSON file with extension+ `.theme` may be supplied. This will be parsed as a KDE+ syntax highlighting theme and (if valid) used as the+ highlighting style.++ To generate the JSON version of an existing style,+ use `--print-highlight-style`.++`--no-highlight`++: *Deprecated, use `--syntax-highlighting=none` instead.*++ Disables syntax highlighting for code blocks and inlines, even when+ a language attribute is given.++`--highlight-style=`*STYLE*|*FILE*++: _Deprecated, use `--syntax-highlighting=`*STYLE*|*FILE* instead._++ Specifies the coloring style to be used in highlighted source code.++`--print-highlight-style=`*STYLE*|*FILE*++: Prints a JSON version of a highlighting style, which can+ be modified, saved with a `.theme` extension, and used+ with `--syntax-highlighting`. This option may be used with+ `-o`/`--output` to redirect output to a file, but+ `-o`/`--output` must come before `--print-highlight-style`+ on the command line.++`--syntax-definition=`*FILE*++: Instructs pandoc to load a KDE XML syntax definition file,+ which will be used for syntax highlighting of appropriately+ marked code blocks. This can be used to add support for+ new languages or to use altered syntax definitions for+ existing languages. This option may be repeated to add+ multiple syntax definitions.++`-H` *FILE*, `--include-in-header=`*FILE*|*URL*++: Include contents of *FILE*, verbatim, at the end of the header.+ This can be used, for example, to include special+ CSS or JavaScript in HTML documents. This option can be used+ repeatedly to include multiple files in the header. They will be+ included in the order specified. Implies `--standalone`.++`-B` *FILE*, `--include-before-body=`*FILE*|*URL*++: Include contents of *FILE*, verbatim, at the beginning of the+ document body (e.g. after the `<body>` tag in HTML, or the+ `\begin{document}` command in LaTeX). This can be used to include+ navigation bars or banners in HTML documents. This option can be+ used repeatedly to include multiple files. They will be included in+ the order specified. Implies `--standalone`. Note that if the+ output format is `odt`, this file must be in OpenDocument XML format+ suitable for insertion into the body of the document, and if+ the output is `docx`, this file must be in appropriate+ OpenXML format.++`-A` *FILE*, `--include-after-body=`*FILE*|*URL*++: Include contents of *FILE*, verbatim, at the end of the document+ body (before the `</body>` tag in HTML, or the+ `\end{document}` command in LaTeX). This option can be used+ repeatedly to include multiple files. They will be included in the+ order specified. Implies `--standalone`. Note that if the+ output format is `odt`, this file must be in OpenDocument XML format+ suitable for insertion into the body of the document, and if+ the output is `docx`, this file must be in appropriate+ OpenXML format.++`--resource-path=`*SEARCHPATH*++: List of paths to search for images and other resources.+ The paths should be separated by `:` on Linux, UNIX, and+ macOS systems, and by `;` on Windows. If `--resource-path`+ is not specified, the default resource path is the working+ directory. Note that, if `--resource-path` is specified,+ the working directory must be explicitly listed or it+ will not be searched. For example:+ `--resource-path=.:test` will search the working directory+ and the `test` subdirectory, in that order.+ This option can be used repeatedly. Search path components+ that come later on the command line will be searched before+ those that come earlier, so+ `--resource-path foo:bar --resource-path baz:bim` is+ equivalent to `--resource-path baz:bim:foo:bar`.+ Note that this option only has an effect when pandoc+ itself needs to find an image (e.g., in producing a+ PDF or docx, or when `--embed-resources` is used.)+ It will not cause image paths to be rewritten in other+ cases (e.g., when pandoc is generating LaTeX or HTML).++`--request-header=`*NAME*`:`*VAL*++: Set the request header *NAME* to the value *VAL* when making+ HTTP requests (for example, when a URL is given on the+ command line, or when resources used in a document must be+ downloaded). If you're behind a proxy, you also need to set+ the environment variable `http_proxy` to `http://...`.++`--no-check-certificate[=true|false]`++: Disable the certificate verification to allow access to+ unsecure HTTP resources (for example when the certificate+ is no longer valid or self signed).++## Options affecting specific writers {.options}++`--self-contained[=true|false]`++: *Deprecated synonym for `--embed-resources --standalone`.*++`--embed-resources[=true|false]`++: Produce a standalone HTML file with no external dependencies, using+ `data:` URIs to incorporate the contents of linked scripts, stylesheets,+ images, and videos. The resulting file should be "self-contained," in the+ sense that it needs no external files and no net access to be displayed+ properly by a browser. This option works only with HTML output formats,+ including `html4`, `html5`, `html+lhs`, `html5+lhs`, `s5`, `slidy`,+ `slideous`, `dzslides`, and `revealjs`. Scripts, images, and stylesheets at+ absolute URLs will be downloaded; those at relative URLs will be sought+ relative to the working directory (if the first source+ file is local) or relative to the base URL (if the first source+ file is remote). Elements with the attribute+ `data-external="1"` will be left alone; the documents they+ link to will not be incorporated in the document.+ Limitation: resources that are loaded dynamically through+ JavaScript cannot be incorporated; as a result, fonts may+ be missing when `--mathjax` is used, and some+ advanced features (e.g. zoom or speaker notes) may not work+ in an offline "self-contained" `reveal.js` slide show.++ For SVG images, `img` tags with `data:` URIs are used,+ unless the image has the class `inline-svg`, in which case+ an inline SVG element is inserted. This approach is+ recommended when there are many occurrences of the same+ SVG in a document, as `<use>` elements will be used to+ reduce duplication.++`--link-images[=true|false]`++: Include links to images instead of embedding the images in ODT.+ (This option currently only affects ODT output.)++`--html-q-tags[=true|false]`++: Use `<q>` tags for quotes in HTML. (This option only has an+ effect if the `smart` extension is enabled for the input+ format used.)++`--ascii[=true|false]`++: Use only ASCII characters in output. Currently supported for XML+ and HTML formats (which use entities instead of UTF-8 when this+ option is selected), CommonMark, gfm, and Markdown (which use+ entities), roff man and ms (which use hexadecimal escapes), and to a+ limited degree LaTeX (which uses standard commands for accented+ characters when possible).++`--reference-links[=true|false]`++: Use reference-style links, rather than inline links, in writing Markdown+ or reStructuredText. By default inline links are used. The+ placement of link references is affected by the+ `--reference-location` option.++`--reference-location=block`|`section`|`document`++: Specify whether footnotes (and references, if `reference-links` is+ set) are placed at the end of the current (top-level) block, the+ current section, or the document. The default is+ `document`. Currently this option only affects the+ `markdown`, `muse`, `html`, `epub`, `slidy`, `s5`, `slideous`,+ `dzslides`, and `revealjs` writers. In slide formats,+ specifying `--reference-location=section` will cause notes+ to be rendered at the bottom of a slide.++`--figure-caption-position=above`|`below`++: Specify whether figure captions go above or below figures+ (default is `below`). This option only affects HTML,+ LaTeX, Docx, ODT, and Typst output.++`--table-caption-position=above`|`below`++: Specify whether table captions go above or below tables+ (default is `above`). This option only affects HTML,+ LaTeX, Docx, ODT, and Typst output.++`--markdown-headings=setext`|`atx`++: Specify whether to use ATX-style (`#`-prefixed) or+ Setext-style (underlined) headings for level 1 and 2+ headings in Markdown output. (The default is `atx`.)+ ATX-style headings are always used for levels 3+.+ This option also affects Markdown cells in `ipynb` output.++`--list-tables[=true|false]`++: Render tables as list tables in RST output.++`--top-level-division=default`|`section`|`chapter`|`part`++: Treat top-level headings as the given division type in+ LaTeX, ConTeXt, DocBook, and TEI output. The hierarchy+ order is part, chapter, then section; all headings are+ shifted such that the top-level heading becomes the+ specified type. The default behavior is to determine the+ best division type via heuristics: unless other conditions+ apply, `section` is chosen. When the `documentclass`+ variable is set to `report`, `book`, or `memoir` (unless the+ `article` option is specified), `chapter` is implied as the+ setting for this option. If `beamer` is the output format,+ specifying either `chapter` or `part` will cause top-level+ headings to become `\part{..}`, while second-level headings+ remain as their default type.++ In Docx output, this option adds section breaks before first-level+ headings if `chapter` is selected, and before first- and second-level+ headings if `part` is selected. Footnote numbers will restart+ with each section break unless the reference doc modifies this.++`-N`, `--number-sections=[true|false]`++: Number section headings in LaTeX, ConTeXt, HTML, Docx, ms, or EPUB+ output. By default, sections are not numbered. Sections with class+ `unnumbered` will never be numbered, even if `--number-sections`+ is specified.++`--number-offset=`*NUMBER*[`,`*NUMBER*`,`*...*]++: Offsets for section heading numbers. The first number is added+ to the section number for level-1 headings, the second for+ level-2 headings, and so on. So, for example, if you+ want the first level-1 heading in your document to be+ numbered "6" instead of "1", specify `--number-offset=5`.+ If your document starts with a level-2 heading which you want+ to be numbered "1.5", specify `--number-offset=1,4`.+ `--number-offset` only directly affects the number of the+ first section heading in a document; subsequent numbers+ increment in the normal way. Implies `--number-sections`.+ Currently this feature only affects HTML and Docx output.++`--listings[=true|false]`++: *Deprecated, use `--syntax-highlighting=idiomatic` or+ `--syntax-highlighting=default` instead.++ Use the [`listings`] package for LaTeX code blocks. The package+ does not support multi-byte encoding for source code. To handle UTF-8+ you would need to use a custom template. This issue is fully+ documented here: [Encoding issue with the listings package].++`-i`, `--incremental[=true|false]`++: Make list items in slide shows display incrementally (one by one).+ The default is for lists to be displayed all at once.++`--slide-level=`*NUMBER*++: Specifies that headings with the specified level create+ slides (for `beamer`, `revealjs`, `pptx`, `s5`, `slidy`,+ `slideous`, `dzslides`). Headings above this level in the+ hierarchy are used to divide the slide show into sections;+ headings below this level create subheads within a slide.+ Valid values are 0-6. If a slide level of 0 is specified,+ slides will not be split automatically on headings, and+ horizontal rules must be used to indicate slide boundaries.+ If a slide level is not specified explicitly, the slide level+ will be set automatically based on the contents of the+ document; see [Structuring the slide show].++`--section-divs[=true|false]`++: Wrap sections in `<section>` tags (or `<div>` tags for `html4`),+ and attach identifiers to the enclosing `<section>` (or `<div>`)+ rather than the heading itself (see+ [Heading identifiers], below). This option only affects+ HTML output (and does not affect HTML slide formats).++`--email-obfuscation=none`|`javascript`|`references`++: 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. The default+ is `none`.++`--id-prefix=`*STRING*++: Specify a prefix to be added to all identifiers and internal links+ in HTML and DocBook output, and to footnote numbers in Markdown+ and Haddock output. This is useful for preventing duplicate+ identifiers when generating fragments to be included in other pages.++`-T` *STRING*, `--title-prefix=`*STRING*++: Specify *STRING* as a prefix at the beginning of the title+ that appears in the HTML header (but not in the title as it+ appears at the beginning of the HTML body). Implies `--standalone`.++`-c` *URL*, `--css=`*URL*++: Link to a CSS style sheet. This option can be used repeatedly to+ include multiple files. They will be included in the order specified.+ This option only affects HTML (including HTML slide shows)+ and EPUB output. It should be used together with+ `-s/--standalone`, because the link to the stylesheet goes+ in the document header.++ A stylesheet is required for generating EPUB. If none is+ provided using this option (or the `css` or `stylesheet`+ metadata fields), pandoc will look for a file `epub.css` in the+ user data directory (see `--data-dir`). If it is not+ found there, sensible defaults will be used.++[`--reference-doc=`*FILE*|*URL*]{#option--reference-doc}++: Use the specified file as a style reference in producing a+ docx or ODT file.++ Docx++ : For best results, the reference docx should be a modified+ version of a docx file produced using pandoc. The contents+ of the reference docx are ignored, but its stylesheets and+ document properties (including margins, page size, header,+ and footer) are used in the new docx. If no reference docx+ is specified on the command line, pandoc will look for a+ file `reference.docx` in the user data directory (see+ `--data-dir`). If this is not found either, sensible+ defaults will be used.++ To produce a custom `reference.docx`, first get a copy of+ the default `reference.docx`: `pandoc+ -o custom-reference.docx --print-default-data-file reference.docx`.+ Then open `custom-reference.docx` in Word or LibreOffice, modify the+ styles as you wish, and save the file. For best+ results, do not make changes to this file other than+ modifying the styles used by pandoc:++ Paragraph styles:++ - Normal+ - Body Text+ - First Paragraph+ - Compact+ - Title+ - Subtitle+ - Author+ - Date+ - Abstract+ - AbstractTitle+ - Bibliography+ - Heading 1+ - Heading 2+ - Heading 3+ - Heading 4+ - Heading 5+ - Heading 6+ - Heading 7+ - Heading 8+ - Heading 9+ - Block Text [for block quotes]+ - Footnote Block Text [for block quotes in footnotes]+ - Source Code+ - Footnote Text+ - Definition Term+ - Definition+ - Caption+ - Table Caption+ - Image Caption+ - Figure+ - Captioned Figure+ - TOC Heading++ Character styles:++ - Default Paragraph Font+ - Verbatim Char+ - Footnote Reference+ - Hyperlink+ - Section Number++ Table style:++ - Table++ ODT++ : For best results, the reference ODT should be a modified+ version of an ODT produced using pandoc. The contents of+ the reference ODT are ignored, but its stylesheets are used+ in the new ODT. If no reference ODT is specified on the+ command line, pandoc will look for a file `reference.odt` in+ the user data directory (see `--data-dir`). If this is not+ found either, sensible defaults will be used.++ To produce a custom `reference.odt`, first get a copy of+ the default `reference.odt`: `pandoc+ -o custom-reference.odt --print-default-data-file reference.odt`.+ Then open `custom-reference.odt` in LibreOffice, modify+ the styles as you wish, and save the file.++ PowerPoint++ : Templates included with Microsoft PowerPoint 2013 (either with+ `.pptx` or `.potx` extension) are known to work, as are most+ templates derived from these.++ The specific requirement is that the template should contain layouts+ with the following names (as seen within PowerPoint):++ - Title Slide+ - Title and Content+ - Section Header+ - Two Content+ - Comparison+ - Content with Caption+ - Blank++ For each name, the first layout found with that name will be used.+ If no layout is found with one of the names, pandoc will output a+ warning and use the layout with that name from the default reference+ doc instead. (How these layouts are used is described in [PowerPoint+ layout choice](#powerpoint-layout-choice).)++ All templates included with a recent version of MS PowerPoint+ will fit these criteria. (You can click on `Layout` under the+ `Home` menu to check.)++ You can also modify the default `reference.pptx`: first run+ `pandoc -o custom-reference.pptx --print-default-data-file+ reference.pptx`, and then modify `custom-reference.pptx`+ in MS PowerPoint (pandoc will use the layouts with the names+ listed above).++`--split-level=`*NUMBER*++: Specify the heading level at which to split an EPUB or+ chunked HTML document into separate files. The default is to split+ into chapters at level-1 headings. In the case of EPUB, this+ option only affects the internal composition of the EPUB, not the way+ chapters and sections are displayed to users. Some+ readers may be slow if the chapter files are too large, so for large+ documents with few level-1 headings, one might want to use a chapter+ level of 2 or 3. For chunked HTML, this option determines+ how much content goes in each "chunk."++`--chunk-template=`*PATHTEMPLATE*++: Specify a template for the filenames in a `chunkedhtml` document.+ In the template, `%n` will be replaced by the chunk number (padded+ with leading 0s to 3 digits), `%s` with the section number of the chunk,+ `%h` with the heading text (with formatting removed), `%i` with+ the section identifier. For example, `section-%s-%i.html` might+ be resolved to `section-1.1-introduction.html`. The characters+ `/` and `\` are not allowed in chunk templates and will be+ ignored. The default is `%s-%i.html`.++`--epub-chapter-level=`*NUMBER*++: *Deprecated synonym for `--split-level`.*++`--epub-cover-image=`*FILE*++: 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 YAML metadata block (see [EPUB Metadata], below).++`--epub-title-page=true`|`false`++: Determines whether a the title page is included in the EPUB+ (default is `true`).++`--epub-metadata=`*FILE*++: Look in the specified XML file for metadata for the EPUB.+ The file should contain a series of [Dublin Core elements].+ For example:++ <dc:rights>Creative Commons</dc:rights>+ <dc:language>es-AR</dc:language>++ By default, pandoc will include the following metadata elements:+ `<dc:title>` (from the document title), `<dc:creator>` (from the+ document authors), `<dc:date>` (from the document date, which should+ be in [ISO 8601 format]), `<dc:language>` (from the `lang`+ variable, or, if is not set, the locale), and `<dc:identifier+ 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+ in the document can be used instead. See below under+ [EPUB Metadata].++`--epub-embed-font=`*FILE*++: Embed the specified font in the EPUB. This option can be repeated+ to embed multiple fonts. Wildcards can also be used: for example,+ `DejaVuSans-*.ttf`. However, if you use wildcards on the command+ line, be sure to escape them or put the whole filename in single quotes,+ to prevent them from being interpreted by the shell. To use the+ embedded fonts, you will need to add declarations like the following+ to your CSS (see `--css`):++ @font-face {+ font-family: DejaVuSans;+ font-style: normal;+ font-weight: normal;+ src:url("../fonts/DejaVuSans-Regular.ttf");+ }+ @font-face {+ font-family: DejaVuSans;+ font-style: normal;+ font-weight: bold;+ src:url("../fonts/DejaVuSans-Bold.ttf");+ }+ @font-face {+ font-family: DejaVuSans;+ font-style: italic;+ font-weight: normal;+ src:url("../fonts/DejaVuSans-Oblique.ttf");+ }+ @font-face {+ font-family: DejaVuSans;+ font-style: italic;+ font-weight: bold;+ src:url("../fonts/DejaVuSans-BoldOblique.ttf");+ }+ body { font-family: "DejaVuSans"; }++`--epub-subdirectory=`*DIRNAME*++: Specify the subdirectory in the OCF container that is to hold+ the EPUB-specific contents. The default is `EPUB`. To put+ the EPUB contents in the top level, use an empty string.++`--ipynb-output=all|none|best`++: Determines how ipynb output cells are treated. `all` means+ that all of the data formats included in the original are+ preserved. `none` means that the contents of data cells+ are omitted. `best` causes pandoc to try to pick the+ richest data block in each output cell that is compatible+ with the output format. The default is `best`.++`--pdf-engine=`*PROGRAM*++: Use the specified engine when producing PDF output.+ Valid values are `pdflatex`, `lualatex`, `xelatex`, `latexmk`,+ `tectonic`, `wkhtmltopdf`, `weasyprint`, `pagedjs-cli`,+ `prince`, `context`, `groff`, `pdfroff`, and `typst`.+ If the engine is not in your PATH, the full path of the engine+ may be specified here. If this option is not specified,+ pandoc uses the following defaults depending on the output+ format specified using `-t/--to`:++ - `-t latex` or none: `pdflatex` (other options: `xelatex`, `lualatex`,+ `tectonic`, `latexmk`)+ - `-t context`: `context`+ - `-t html`: `weasyprint` (other options: `prince`, `wkhtmltopdf`,+ `pagedjs-cli`;+ see [print-css.rocks](https://print-css.rocks) for a good+ introduction to PDF generation from HTML/CSS)+ - `-t ms`: `groff`+ - `-t typst`: `typst`++ This option is normally intended to be used when a PDF+ file is specified as `-o/--output`. However, it may still+ have an effect when other output formats are requested.+ For example, `ms` output will include `.pdfhref` macros+ only if a `--pdf-engine` is selected, and the macros will+ be differently encoded depending on whether `groff` or+ `pdfroff` is specified.++`--pdf-engine-opt=`*STRING*++: Use the given string as a command-line argument to the `pdf-engine`.+ For example, to use a persistent directory `foo` for `latexmk`'s+ auxiliary files, use `--pdf-engine-opt=-outdir=foo`.+ Note that no check for duplicate options is done.++[Dublin Core elements]: https://www.dublincore.org/specifications/dublin-core/dces/+[ISO 8601 format]: https://www.w3.org/TR/NOTE-datetime+[Encoding issue with the listings package]:+ https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Encoding_issue++## Citation rendering {.options}++`-C`, `--citeproc`++: Process the citations in the file, replacing them with+ rendered citations and adding a bibliography.+ Citation processing will not take place unless bibliographic+ data is supplied, either through an external file specified+ using the `--bibliography` option or the `bibliography`+ field in metadata, or via a `references` section in metadata+ containing a list of citations in CSL YAML format with+ Markdown formatting. The style is controlled by a [CSL]+ stylesheet specified using the `--csl` option or the `csl`+ field in metadata. (If no stylesheet is specified,+ the `chicago-author-date` style will be used by default.)+ The citation processing transformation may be applied before+ or after filters or Lua filters (see `--filter`,+ `--lua-filter`): these transformations are applied in the+ order they appear on the command line. For more+ information, see the section on [Citations].++ Note: if this option is specified, the `citations` extension+ will be disabled automatically in the writer, to ensure that+ the citeproc-generated citations will be rendered instead of+ the format's own citation syntax.++`--bibliography=`*FILE*++: Set the `bibliography` field in the document's metadata to *FILE*,+ overriding any value set in the metadata. If you supply+ this argument multiple times, each *FILE* will be added to+ bibliography. If *FILE* is a URL, it will be fetched+ via HTTP. If *FILE* is not found relative to the+ working directory, it will be sought in the resource path+ (see `--resource-path`).++`--csl=`*FILE*++: Set the `csl` field in the document's metadata to *FILE*,+ overriding any value set in the metadata. (This is equivalent to+ `--metadata csl=FILE`.) If *FILE* is a URL, it will be+ fetched via HTTP. If *FILE* is not found relative to the+ working directory, it will be sought in the resource path+ (see `--resource-path`) and finally in the `csl`+ subdirectory of the pandoc user data directory.++`--citation-abbreviations=`*FILE*++: Set the `citation-abbreviations` field in the document's metadata to+ *FILE*, overriding any value set in the metadata. (This is equivalent to+ `--metadata citation-abbreviations=FILE`.)+ If *FILE* is a URL, it will be fetched via HTTP. If *FILE* is not+ found relative to the working directory, it will be sought+ in the resource path (see `--resource-path`) and finally in+ the `csl` subdirectory of the pandoc user data directory.++`--natbib`++: Use [`natbib`] for citations in LaTeX output. This option+ is not for use with the `--citeproc` option or with PDF+ output. It is intended for use in producing a LaTeX file+ that can be processed with [`bibtex`].++`--biblatex`++: Use [`biblatex`] for citations in LaTeX output. This option+ is not for use with the `--citeproc` option or with PDF+ output. It is intended for use in producing a LaTeX file+ that can be processed with [`bibtex`] or [`biber`].++## Math rendering in HTML {.options}++The default is to render TeX math as far as possible using+Unicode characters. Formulas are put inside a `span` with+`class="math"`, so that they may be styled differently from the+surrounding text if needed. However, this gives acceptable+results only for basic math, usually you will want to use+`--mathjax` or another of the following options.++`--mathjax`[`=`*URL*]++: Use [MathJax] to display embedded TeX math in HTML output.+ TeX math will be put between `\(...\)` (for inline math)+ or `\[...\]` (for display math) and wrapped in `<span>` tags+ with class `math`. Then the MathJax JavaScript will render it.+ The *URL* should point to the `MathJax.js` load script.+ If a *URL* is not provided, a link to the Cloudflare CDN will+ be inserted.++`--mathml`++: Convert TeX math to [MathML] (in `epub3`, `docbook4`,+ `docbook5`, `jats`, `html4` and `html5`). This is the+ default in `odt` output. MathML is supported natively by+ the main web browsers and select e-book readers.++`--webtex`[`=`*URL*]++: Convert TeX formulas to `<img>` tags that link to an external script+ that converts formulas to images. The formula will be URL-encoded+ and concatenated with the URL provided. For SVG images you can for+ example use `--webtex https://latex.codecogs.com/svg.latex?`.+ If no URL is specified, the CodeCogs URL generating PNGs+ will be used (`https://latex.codecogs.com/png.latex?`).+ Note: the `--webtex` option will affect Markdown output+ as well as HTML, which is useful if you're targeting a+ version of Markdown without native math support.++`--katex`[`=`*URL*]++: Use [KaTeX] to display embedded TeX math in HTML output.+ The *URL* is the base URL for the KaTeX library. That directory+ should contain a `katex.min.js` and a `katex.min.css` file.+ If a *URL* is not provided, a link to the KaTeX CDN will be inserted.++`--gladtex`++: Enclose TeX math in `<eq>` tags in HTML output. The resulting HTML+ can then be processed by [GladTeX] to produce SVG images of the typeset+ formulas and an HTML file with these images embedded.++ pandoc -s --gladtex input.md -o myfile.htex+ gladtex -d image_dir myfile.htex+ # produces myfile.html and images in image_dir++[MathML]: https://www.w3.org/Math/+[MathJax]: https://www.mathjax.org+[KaTeX]: https://github.com/Khan/KaTeX+[GladTeX]: https://humenda.github.io/GladTeX/++## Options for wrapper scripts {.options}++`--dump-args[=true|false]`++: Print information about command-line arguments to *stdout*, then exit.+ This option is intended primarily for use in wrapper scripts.+ The first line of output contains the name of the output file specified+ 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+ after a `--` separator at the end of the line.++`--ignore-args[=true|false]`++: Ignore command-line arguments (for use in wrapper scripts).+ Regular pandoc options are not ignored. Thus, for example,++ pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1++ is equivalent to++ pandoc -o foo.html -s++# Exit codes++If pandoc completes successfully, it will return exit code 0.+Nonzero exit codes have the following meanings:++ Code Error+----- ------------------------------------+ 1 PandocIOError+ 3 PandocFailOnWarningError+ 4 PandocAppError+ 5 PandocTemplateError+ 6 PandocOptionError+ 21 PandocUnknownReaderError+ 22 PandocUnknownWriterError+ 23 PandocUnsupportedExtensionError+ 24 PandocCiteprocError+ 25 PandocBibliographyError+ 31 PandocEpubSubdirectoryError+ 43 PandocPDFError+ 44 PandocXMLError+ 47 PandocPDFProgramNotFoundError+ 61 PandocHttpError+ 62 PandocShouldNeverHappenError+ 63 PandocSomeError+ 64 PandocParseError+ 66 PandocMakePDFError+ 67 PandocSyntaxMapError+ 83 PandocFilterError+ 84 PandocLuaError+ 89 PandocNoScriptingEngine+ 91 PandocMacroLoop+ 92 PandocUTF8DecodingError+ 93 PandocIpynbDecodingError+ 94 PandocUnsupportedCharsetError+ 95 PandocInputNotTextError+ 97 PandocCouldNotFindDataFileError+ 98 PandocCouldNotFindMetadataFileError+ 99 PandocResourceNotFound+----- ------------------------------------++# Defaults files++The `--defaults` option may be used to specify a package+of options, in the form of a YAML or JSON file. Examples in+this section will be given in YAML, but the equivalent forms in+JSON will also work.++Fields that are omitted will just have their regular+default values. So a defaults file can be as simple as+one line:++``` yaml+verbosity: INFO+```++or in JSON:++``` json+{ "verbosity": "INFO" }+```++In fields that expect a file path (or list of file paths), the+following syntax may be used to interpolate environment variables:++``` yaml+csl: ${HOME}/mycsldir/special.csl+```++`${USERDATA}` may also be used; this will always resolve to the+user data directory that is current when the defaults file is+parsed, regardless of the setting of the environment+variable `USERDATA`.++`${.}` will resolve to the directory containing the defaults+file itself. This allows you to refer to resources contained+in that directory:++``` yaml+epub-cover-image: ${.}/cover.jpg+epub-metadata: ${.}/meta.xml+resource-path:+- . # the working directory from which pandoc is run+- ${.}/images # the images subdirectory of the directory+ # containing this defaults file+```++This environment variable interpolation syntax *only* works in+fields that expect file paths.++Defaults files can be placed in the `defaults` subdirectory of+the user data directory and used from any directory. For+example, one could create a file specifying defaults for writing+letters, save it as `letter.yaml` in the `defaults` subdirectory+of the user data directory, and then invoke these defaults+from any directory using `pandoc --defaults letter`+or `pandoc -dletter`.++When multiple defaults are used, their contents will be combined.++Note that, where command-line arguments may be repeated+(`--metadata-file`, `--css`, `--include-in-header`,+`--include-before-body`, `--include-after-body`, `--variable`,+`--metadata`, `--syntax-definition`), the values specified on+the command line will combine with values specified in the+defaults file, rather than replacing them.++The following tables show the mapping between the command line and+defaults file entries.+++----------------------------------+-----------------------------------++| command line | defaults file |++:=================================+:==================================++| ``` | ``` yaml |+| foo.md | input-file: foo.md |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| foo.md bar.md | input-files: |+| | - foo.md |+| | - bar.md |+| ``` | ``` |++----------------------------------+-----------------------------------+++The value of `input-files` may be left empty to indicate input from+stdin, and it can be an empty sequence `[]` for no input.++## General options+++----------------------------------+-----------------------------------++| command line | defaults file |++:=================================+:==================================++| ``` | ``` yaml |+| --from markdown+emoji | from: markdown+emoji |+| ``` | ``` |+| | ``` yaml |+| | reader: markdown+emoji |+| | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --to markdown+hard_line_breaks | to: markdown+hard_line_breaks |+| ``` | ``` |+| | ``` yaml |+| | writer: markdown+hard_line_breaks |+| | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --output foo.pdf | output-file: foo.pdf |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --output - | output-file: |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --data-dir dir | data-dir: dir |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --defaults file | defaults: |+| ``` | - file |+| | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --verbose | verbosity: INFO |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --quiet | verbosity: ERROR |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --fail-if-warnings | fail-if-warnings: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --sandbox | sandbox: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --log=FILE | log-file: FILE |+| ``` | ``` |++----------------------------------+-----------------------------------+++Options specified in a defaults file itself always have priority over+those in another file included with a `defaults:` entry.++`verbosity` can have the values `ERROR`, `WARNING`, or `INFO`.++## Reader options+++----------------------------------+-----------------------------------++| command line | defaults file |++:=================================+:==================================++| ``` | ``` yaml |+| --shift-heading-level-by -1 | shift-heading-level-by: -1 |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --indented-code-classes python | indented-code-classes: |+| | - python |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --default-image-extension ".jpg" | default-image-extension: '.jpg' |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --file-scope | file-scope: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --citeproc \ | filters: |+| --lua-filter count-words.lua \ | - citeproc |+| --filter special.lua | - count-words.lua |+| | - type: json |+| | path: special.lua |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --metadata key=value \ | metadata: |+| --metadata key2 | key: value |+| | key2: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --metadata-file meta.yaml | metadata-files: |+| | - meta.yaml |+| ``` | ``` |+| | ``` yaml |+| | metadata-file: meta.yaml |+| | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --preserve-tabs | preserve-tabs: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --tab-stop 8 | tab-stop: 8 |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --track-changes accept | track-changes: accept |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --extract-media dir | extract-media: dir |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --abbreviations abbrevs.txt | abbreviations: abbrevs.txt |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --typst-input foo=bar | typst-inputs: |+| | foo: bar |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --trace | trace: true |+| ``` | ``` |++----------------------------------+-----------------------------------+++Metadata values specified in a defaults file are parsed as literal+string text, not Markdown.++Filters will be assumed to be Lua filters if they have the `.lua`+extension, and JSON filters otherwise. But the filter type can also be+specified explicitly, as shown. Filters are run in the order specified.+To include the built-in citeproc filter, use either `citeproc` or+`{type: citeproc}`.++## General writer options+++----------------------------------+-----------------------------------++| command line | defaults file |++:=================================+:==================================++| ``` | ``` yaml |+| --standalone | standalone: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --template letter | template: letter |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --variable key=val \ | variables: |+| --variable key2 | key: val |+| | key2: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --eol nl | eol: nl |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --dpi 300 | dpi: 300 |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --wrap preserve | wrap: "preserve" |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --columns 72 | columns: 72 |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --table-of-contents | table-of-contents: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --toc | toc: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --toc-depth 3 | toc-depth: 3 |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --strip-comments | strip-comments: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --no-highlight | syntax-highlighting: 'none' |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --syntax-highlighting kate | syntax-highlighting: kate |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --syntax-definition mylang.xml | syntax-definitions: |+| | - mylang.xml |+| ``` | ``` |+| | ``` yaml |+| | syntax-definition: mylang.xml |+| | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --include-in-header inc.tex | include-in-header: |+| | - inc.tex |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --include-before-body inc.tex | include-before-body: |+| | - inc.tex |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --include-after-body inc.tex | include-after-body: |+| | - inc.tex |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --resource-path .:foo | resource-path: ['.','foo'] |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --request-header foo:bar | request-headers: |+| | - ["User-Agent", "Mozilla/5.0"] |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --no-check-certificate | no-check-certificate: true |+| ``` | ``` |++----------------------------------+-----------------------------------++++## Options affecting specific writers+++----------------------------------+-----------------------------------++| command line | defaults file |++:=================================+:==================================++| ``` | ``` yaml |+| --self-contained | self-contained: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --link-images | link-images: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --html-q-tags | html-q-tags: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --ascii | ascii: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --reference-links | reference-links: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --reference-location block | reference-location: block |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --figure-caption-position=above | figure-caption-position: above |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --table-caption-position=below | table-caption-position: below |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --markdown-headings atx | markdown-headings: atx |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --list-tables | list-tables: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --top-level-division chapter | top-level-division: chapter |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --number-sections | number-sections: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --number-offset=1,4 | number-offset: \[1,4\] |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --listings | listings: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --list-of-figures | list-of-figures: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --lof | lof: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --list-of-tables | list-of-tables: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --lot | lot: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --incremental | incremental: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --slide-level 2 | slide-level: 2 |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --section-divs | section-divs: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --email-obfuscation references | email-obfuscation: references |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --id-prefix ch1 | identifier-prefix: ch1 |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --title-prefix MySite | title-prefix: MySite |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --css styles/screen.css \ | css: |+| --css styles/special.css | - styles/screen.css |+| | - styles/special.css |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --reference-doc my.docx | reference-doc: my.docx |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --epub-cover-image cover.jpg | epub-cover-image: cover.jpg |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --epub-title-page=false | epub-title-page: false |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --epub-metadata meta.xml | epub-metadata: meta.xml |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --epub-embed-font special.otf \ | epub-fonts: |+| --epub-embed-font headline.otf | - special.otf |+| | - headline.otf |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --split-level 2 | split-level: 2 |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --chunk-template="%i.html" | chunk-template: "%i.html" |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --epub-subdirectory="" | epub-subdirectory: '' |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --ipynb-output best | ipynb-output: best |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --pdf-engine xelatex | pdf-engine: xelatex |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --pdf-engine-opt=--shell-escape | pdf-engine-opts: |+| | - '-shell-escape' |+| ``` | ``` |+| | ``` yaml |+| | pdf-engine-opt: '-shell-escape' |+| | ``` |++----------------------------------+-----------------------------------+++## Citation rendering+++----------------------------------+-----------------------------------++| command line | defaults file |++:=================================+:==================================++| ``` | ``` yaml |+| --citeproc | citeproc: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --bibliography logic.bib | bibliography: logic.bib |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --csl ieee.csl | csl: ieee.csl |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --citation-abbreviations ab.json | citation-abbreviations: ab.json |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --natbib | cite-method: natbib |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --biblatex | cite-method: biblatex |+| ``` | ``` |++----------------------------------+-----------------------------------+++`cite-method` can be `citeproc`, `natbib`, or `biblatex`. This only+affects LaTeX output. If you want to use citeproc to format citations,+you should also set 'citeproc: true'.++If you need control over when the citeproc processing is done relative+to other filters, you should instead use `citeproc` in the list+of `filters` (see [Reader options](#reader-options-1)).++## Math rendering in HTML+++----------------------------------+-----------------------------------++| command line | defaults file |++:=================================+:==================================++| ``` | ``` yaml |+| --mathjax | html-math-method: |+| | method: mathjax |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --mathml | html-math-method: |+| | method: mathml |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --webtex | html-math-method: |+| | method: webtex |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --katex | html-math-method: |+| | method: katex |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --gladtex | html-math-method: |+| | method: gladtex |+| ``` | ``` |++----------------------------------+-----------------------------------+++In addition to the values listed above, `method` can have the+value `plain`.++If the command line option accepts a URL argument, an `url:` field can+be added to `html-math-method:`.++## Options for wrapper scripts+++----------------------------------+-----------------------------------++| command line | defaults file |++:=================================+:==================================++| ``` | ``` yaml |+| --dump-args | dump-args: true |+| ``` | ``` |++----------------------------------+-----------------------------------++| ``` | ``` yaml |+| --ignore-args | ignore-args: true |+| ``` | ``` |++----------------------------------+-----------------------------------+++# Templates++When the `-s/--standalone` option is used, pandoc uses a template to+add header and footer material that is needed for a self-standing+document. To see the default template that is used, just type++ pandoc -D *FORMAT*++where *FORMAT* is the name of the output format. A custom template+can be specified using the `--template` option. You can also override+the system default templates for a given output format *FORMAT*+by putting a file `templates/default.*FORMAT*` in the user data+directory (see `--data-dir`, above). *Exceptions:*++- For `odt` output, customize the `default.opendocument` template.+- For `docx` output, customize the `default.openxml` template.+- For `pdf` output, customize the `default.latex` template+ (or the `default.context` template, if you use `-t context`,+ or the `default.ms` template, if you use `-t ms`, or the+ `default.html` template, if you use `-t html`).+- `pptx` has no template.++Note that `docx`, `odt`, and `pptx` output can also be customized+using `--reference-doc`. Use a reference doc to adjust the styles+in your document; use a template to handle variable interpolation and+customize the presentation of metadata, the position of the table+of contents, boilerplate text, etc.++Templates contain *variables*, which allow for the inclusion of+arbitrary information at any point in the file. They may be set at the+command line using the `-V/--variable` option. If a variable is not set,+pandoc will look for the key in the document's metadata, which can be set+using either [YAML metadata blocks][Extension: `yaml_metadata_block`]+or with the `-M/--metadata` option. In addition, some variables+are given default values by pandoc. See [Variables] below for+a list of variables used in pandoc's default templates.++If you use custom templates, you may need to revise them as pandoc+changes. We recommend tracking the changes in the default templates,+and modifying your custom templates accordingly. An easy way to do this+is to fork the [pandoc-templates] repository and merge in+changes after each pandoc release.++ [pandoc-templates]: https://github.com/jgm/pandoc-templates++## Template syntax++### Comments++Anything between the sequence `$--` and the end of the+line will be treated as a comment and omitted from the output.++### Delimiters++To mark variables and control structures in the template,+either `$`...`$` or `${`...`}` may be used as delimiters.+The styles may also be mixed in the same template, but the+opening and closing delimiter must match in each case. The+opening delimiter may be followed by one or more spaces+or tabs, which will be ignored. The closing delimiter may+be preceded by one or more spaces or tabs, which will be+ignored.++To include a literal `$` in the document, use `$$`.++### Interpolated variables++A slot for an interpolated variable is a variable name surrounded+by matched delimiters. Variable names must begin with a letter+and can contain letters, numbers, `_`, `-`, and `.`. The+keywords `it`, `if`, `else`, `endif`, `for`, `sep`, and `endfor` may+not be used as variable names. Examples:++```+$foo$+$foo.bar.baz$+$foo_bar.baz-bim$+$ foo $+${foo}+${foo.bar.baz}+${foo_bar.baz-bim}+${ foo }+```++Variable names with periods are used to get at structured+variable values. So, for example, `employee.salary` will return the+value of the `salary` field of the object that is the value of+the `employee` field.++- If the value of the variable is a simple value, it will be+ rendered verbatim. (Note that no escaping is done;+ the assumption is that the calling program will escape+ the strings appropriately for the output format.)+- If the value is a list, the values will be concatenated.+- If the value is a map, the string `true` will be rendered.+- Every other value will be rendered as the empty string.++### Conditionals++A conditional begins with `if(variable)` (enclosed in+matched delimiters) and ends with `endif` (enclosed in matched+delimiters). It may optionally contain an `else` (enclosed in+matched delimiters). The `if` section is used if+`variable` has a true value, otherwise the `else`+section is used (if present). The following values count+as true:++- any map+- any array containing at least one true value+- any nonempty string+- boolean True++Note that in YAML metadata (and metadata specified on the+command line using `-M/--metadata`), unquoted `true` and `false` will be+interpreted as Boolean values. But a variable specified on the+command line using `-V/--variable` will always be given a string+value. Hence a conditional `if(foo)` will be triggered if you+use `-V foo=false`, but not if you use `-M foo=false`.++Examples:++```+$if(foo)$bar$endif$++$if(foo)$+ $foo$+$endif$++$if(foo)$+part one+$else$+part two+$endif$++${if(foo)}bar${endif}++${if(foo)}+ ${foo}+${endif}++${if(foo)}+${ foo.bar }+${else}+no foo!+${endif}+```++The keyword `elseif` may be used to simplify complex nested+conditionals:++```+$if(foo)$+XXX+$elseif(bar)$+YYY+$else$+ZZZ+$endif$+```++### For loops++A for loop begins with `for(variable)` (enclosed in+matched delimiters) and ends with `endfor` (enclosed in matched+delimiters).++- If `variable` is an array, the material inside the loop will+ be evaluated repeatedly, with `variable` being set to each+ value of the array in turn, and concatenated.+- If `variable` is a map, the material inside will be set to+ the map.+- If the value of the associated variable is not an array or+ a map, a single iteration will be performed on its value.++Examples:++```+$for(foo)$$foo$$sep$, $endfor$++$for(foo)$+ - $foo.last$, $foo.first$+$endfor$++${ for(foo.bar) }+ - ${ foo.bar.last }, ${ foo.bar.first }+${ endfor }++$for(mymap)$+$it.name$: $it.office$+$endfor$+```++You may optionally specify a separator between consecutive+values using `sep` (enclosed in matched delimiters). The+material between `sep` and the `endfor` is the separator.++```+${ for(foo) }${ foo }${ sep }, ${ endfor }+```++Instead of using `variable` inside the loop, the special+anaphoric keyword `it` may be used.++```+${ for(foo.bar) }+ - ${ it.last }, ${ it.first }+${ endfor }+```++### Partials++Partials (subtemplates stored in different files) may be+included by using the name of the partial, followed+by `()`, for example:++```+${ styles() }+```++Partials will be sought in the directory containing+the main template. The file name will be assumed to+have the same extension as the main template if it+lacks an extension. When calling the partial, the+full name including file extension can also be used:++```+${ styles.html() }+```++(If a partial is not found in the directory of the+template and the template path is given as a relative+path, it will also be sought in the `templates`+subdirectory of the user data directory.)++Partials may optionally be applied to variables using+a colon:++```+${ date:fancy() }++${ articles:bibentry() }+```++If `articles` is an array, this will iterate over its+values, applying the partial `bibentry()` to each one. So the+second example above is equivalent to++```+${ for(articles) }+${ it:bibentry() }+${ endfor }+```++Note that the anaphoric keyword `it` must be used when+iterating over partials. In the above examples,+the `bibentry` partial should contain `it.title`+(and so on) instead of `articles.title`.++Final newlines are omitted from included partials.++Partials may include other partials.++A separator between values of an array may be specified+in square brackets, immediately after the variable name+or partial:++```+${months[, ]}++${articles:bibentry()[; ]}+```++The separator in this case is literal and (unlike with `sep`+in an explicit `for` loop) cannot contain interpolated+variables or other template directives.++### Nesting++To ensure that content is "nested," that is, subsequent lines+indented, use the `^` directive:++```+$item.number$ $^$$item.description$ ($item.price$)+```++In this example, if `item.description` has multiple lines,+they will all be indented to line up with the first line:++```+00123 A fine bottle of 18-year old+ Oban whiskey. ($148)+```++To nest multiple lines to the same level, align them+with the `^` directive in the template. For example:++```+$item.number$ $^$$item.description$ ($item.price$)+ (Available til $item.sellby$.)+```++will produce++```+00123 A fine bottle of 18-year old+ Oban whiskey. ($148)+ (Available til March 30, 2020.)+```++If a variable occurs by itself on a line, preceded by whitespace+and not followed by further text or directives on the same line,+and the variable's value contains multiple lines, it will be+nested automatically.++### Breakable spaces++Normally, spaces in the template itself (as opposed to values of+the interpolated variables) are not breakable, but they can be+made breakable in part of the template by using the `~` keyword+(ended with another `~`).++```+$~$This long line may break if the document is rendered+with a short line length.$~$+```++### Pipes++A pipe transforms the value of a variable or partial. Pipes are+specified using a slash (`/`) between the variable name (or partial)+and the pipe name. Example:++```+$for(name)$+$name/uppercase$+$endfor$++$for(metadata/pairs)$+- $it.key$: $it.value$+$endfor$++$employee:name()/uppercase$+```++Pipes may be chained:++```+$for(employees/pairs)$+$it.key/alpha/uppercase$. $it.name$+$endfor$+```++Some pipes take parameters:++```+|----------------------|------------|+$for(employee)$+$it.name.first/uppercase/left 20 "| "$$it.name.salary/right 10 " | " " |"$+$endfor$+|----------------------|------------|+```++Currently the following pipes are predefined:++- `pairs`: Converts a map or array to an array of maps,+ each with `key` and `value` fields. If the original+ value was an array, the `key` will be the array index,+ starting with 1.++- `uppercase`: Converts text to uppercase.++- `lowercase`: Converts text to lowercase.++- `length`: Returns the length of the value: number+ of characters for a textual value, number of elements+ for a map or array.++- `reverse`: Reverses a textual value or array,+ and has no effect on other values.++- `first`: Returns the first value of an array, if+ applied to a non-empty array; otherwise returns+ the original value.++- `last`: Returns the last value of an array, if+ applied to a non-empty array; otherwise returns+ the original value.++- `rest`: Returns all but the first value of an array, if+ applied to a non-empty array; otherwise returns+ the original value.++- `allbutlast`: Returns all but the last value of an array, if+ applied to a non-empty array; otherwise returns+ the original value.++- `chomp`: Removes trailing newlines (and breakable space).++- `nowrap`: Disables line wrapping on breakable spaces.++- `alpha`: Converts textual values that can be+ read as an integer into lowercase alphabetic+ characters `a..z` (mod 26). This can be used to get lettered+ enumeration from array indices. To get uppercase+ letters, chain with `uppercase`.++- `roman`: Converts textual values that can be+ read as an integer into lowercase roman numerals.+ This can be used to get lettered enumeration from array indices.+ To get uppercase roman, chain with `uppercase`.++- `left n "leftborder" "rightborder"`: Renders a textual value+ in a block of width `n`, aligned to the left, with an optional+ left and right border. Has no effect on other values. This+ can be used to align material in tables. Widths are positive+ integers indicating the number of characters. Borders+ are strings inside double quotes; literal `"` and `\` characters+ must be backslash-escaped.++- `right n "leftborder" "rightborder"`: Renders a textual value+ in a block of width `n`, aligned to the right, and has no+ effect on other values.++- `center n "leftborder" "rightborder"`: Renders a textual+ value in a block of width `n`, aligned to the center, and has+ no effect on other values.+++## Variables++### Metadata variables++`title`, `author`, `date`+: allow identification of basic aspects of the document. Included+ in PDF metadata through LaTeX and ConTeXt. These can be set+ through a [pandoc title block][Extension: `pandoc_title_block`],+ which allows for multiple authors, or through a+ [YAML metadata block][Extension: `yaml_metadata_block`]:++ ---+ author:+ - Aristotle+ - Peter Abelard+ ...++ Note that if you just want to set PDF or HTML metadata, without+ including a title block in the document itself, you can+ set the `title-meta`, `author-meta`, and `date-meta`+ variables. (By default these are set automatically, based+ on `title`, `author`, and `date`.) The page title in HTML+ is set by `pagetitle`, which is equal to `title` by default.++`subtitle`+: document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx+ documents++`abstract`+: document summary, included in HTML, LaTeX, ConTeXt, AsciiDoc, and docx+ documents++`abstract-title`+: title of abstract, currently used only in HTML, EPUB, docx, and Typst.+ This will be set automatically to a localized value,+ depending on `lang`, but can be manually overridden.++`keywords`+: list of keywords to be included in HTML, PDF, ODT, pptx, docx+ and AsciiDoc metadata; repeat as for `author`, above++`subject`+: document subject, included in ODT, PDF, docx, EPUB, and pptx metadata++`description`+: document description, included in ODT, docx and pptx metadata. Some+ applications show this as `Comments` metadata.++`category`+: document category, included in docx and pptx metadata++Additionally,+any root-level string metadata, not included in ODT, docx+or pptx metadata is added as a *custom property*.+The following [YAML] metadata block for instance:++ ---+ title: 'This is the title'+ subtitle: "This is the subtitle"+ author:+ - Author One+ - Author Two+ description: |+ This is a long+ description.++ It consists of two paragraphs+ ...++will include `title`, `author` and `description` as standard document+properties and `subtitle` as a custom property when converting to docx,+ODT or pptx.++### Language variables++`lang`+: identifies the main language of the document using IETF language+ tags (following the [BCP 47] standard), such as `en` or `en-GB`.+ The [Language subtag lookup] tool can look up or verify these tags.+ This affects most formats, and controls hyphenation in PDF output+ when using LaTeX (through [`babel`] and [`polyglossia`]) or ConTeXt.++ Use native pandoc [Divs and Spans] with the `lang` attribute to+ switch the language:++ ---+ lang: en-GB+ ...++ Text in the main document language (British English).++ ::: {lang=fr-CA}+ > Cette citation est écrite en français canadien.+ :::++ More text in English. ['Zitat auf Deutsch.']{lang=de}++`dir`+: the base script direction, either `rtl` (right-to-left)+ or `ltr` (left-to-right).++ For bidirectional documents, native pandoc `span`s and+ `div`s with the `dir` attribute (value `rtl` or `ltr`) can+ be used to override the base direction in some output+ formats. This may not always be necessary if the final+ renderer (e.g. the browser, when generating HTML) supports+ the [Unicode Bidirectional Algorithm].++ When using LaTeX for bidirectional documents, only the+ `xelatex` engine is fully supported (use+ `--pdf-engine=xelatex`).++[BCP 47]: https://tools.ietf.org/html/bcp47+[Unicode Bidirectional Algorithm]: https://www.w3.org/International/articles/inline-bidi-markup/uba-basics+[Language subtag lookup]: https://r12a.github.io/app-subtags/++### Variables for HTML++`document-css`+: Enables inclusion of most of the [CSS] in the `styles.html`+ [partial](#partials) (have a look with+ `pandoc --print-default-data-file=templates/styles.html`).+ Unless you use `--css`, this variable+ is set to `true` by default. You can disable it with+ e.g. `pandoc -M document-css=false`.++`mainfont`+: sets the CSS `font-family` property on the `html` element.++`fontsize`+: sets the base CSS `font-size`, which you'd usually set+ to e.g. `20px`, but it also accepts `pt`+ (12pt = 16px in most browsers).++`fontcolor`+: sets the CSS `color` property on the `html` element.++`linkcolor`+: sets the CSS `color` property on all links.++`monofont`+: sets the CSS `font-family` property on `code` elements.++`monobackgroundcolor`+: sets the CSS `background-color` property on `code` elements+ and adds extra padding.++`linestretch`+: sets the CSS `line-height` property on the `html` element,+ which is preferred to be unitless.++`maxwidth`+: sets the CSS `max-width` property (default is 36em).++`backgroundcolor`+: sets the CSS `background-color` property on the `html` element.++`margin-left`, `margin-right`, `margin-top`, `margin-bottom`+: sets the corresponding CSS `padding` properties on the `body` element.++To override or extend some [CSS] for just one document, include for example:++ ---+ header-includes: |+ <style>+ blockquote {+ font-style: italic;+ }+ tr.even {+ background-color: #f0f0f0;+ }+ td, th {+ padding: 0.5em 2em 0.5em 0.5em;+ }+ tbody {+ border-bottom: none;+ }+ </style>+ ---++[CSS]: https://developer.mozilla.org/en-US/docs/Learn/CSS++### Variables for HTML math++`classoption`+: when using `--katex`, you can render display math equations+ flush left using [YAML metadata](#layout) or with `-M+ classoption=fleqn`.++### Variables for HTML slides++These affect HTML output when [producing slide shows with+pandoc](#slide-shows).++`institute`+: author affiliations: can be a list when there are multiple authors++`revealjs-url`+: base URL for reveal.js documents (defaults to+ `https://unpkg.com/reveal.js@^5`)++`s5-url`+: base URL for S5 documents (defaults to `s5/default`)++`slidy-url`+: base URL for Slidy documents (defaults to+ `https://www.w3.org/Talks/Tools/Slidy2`)++`slideous-url`+: base URL for Slideous documents (defaults to `slideous`)++`title-slide-attributes`+: additional attributes for the title slide of reveal.js slide shows.+ See [background in reveal.js, beamer, and pptx] for an example.++`highlightjs-theme`+: highlight.js theme for code highlighting when using+ `--syntax-highlighting=idiomatic` with reveal.js (defaults to+ `monokai`). See the [highlight.js demo page] for available themes.++[highlight.js demo page]: https://highlightjs.org/demo++All [reveal.js configuration options] are available as variables.+To turn off boolean flags that default to true in reveal.js, use `0`.++[reveal.js configuration options]: https://revealjs.com/config/++### Variables for Beamer slides++These variables change the appearance of PDF slides using [`beamer`].++`aspectratio`+: slide aspect ratio (`43` for 4:3 [default], `169` for 16:9,+ `1610` for 16:10, `149` for 14:9, `141` for 1.41:1, `54` for 5:4,+ `32` for 3:2)++`beameroption`+: add extra beamer option with `\setbeameroption{}`++`institute`+: author affiliations: can be a list when there are multiple authors++`logo`+: logo image for slides++`logooptions`+: options for logo image (e.g., `width`, `height`)++`navigation`+: controls navigation symbols (default is `empty` for no navigation+ symbols; other valid values are `frame`, `vertical`, and `horizontal`)++`section-titles`+: enables "title pages" for new sections (default is true)++`theme`, `colortheme`, `fonttheme`, `innertheme`, `outertheme`+: beamer themes++`themeoptions`, `colorthemeoptions`, `fontthemeoptions`, `innerthemeoptions`, `outerthemeoptions`+: options for LaTeX beamer themes (lists)++`titlegraphic`+: image for title slide: can be a list++`titlegraphicoptions`+: options for title slide image (e.g., `width`, `height`)++`shorttitle`, `shortsubtitle`, `shortauthor`, `shortinstitute`, `shortdate`+: some beamer themes use short versions of the title, subtitle, author,+ institute, date++### Variables for PowerPoint++These variables control the visual aspects of a slide show that+are not easily controlled via templates.++`monofont`+: font to use for code.++### Variables for LaTeX++Pandoc uses these variables when [creating a PDF] with a LaTeX engine.++#### Layout++`block-headings`+: make `\paragraph` and `\subparagraph` (fourth- and+ fifth-level headings, or fifth- and sixth-level with book+ classes) free-standing rather than run-in; requires further+ formatting to distinguish from `\subsubsection` (third- or+ fourth-level headings). Instead of using this option,+ [KOMA-Script] can adjust headings more extensively:++ ---+ documentclass: scrartcl+ header-includes: |+ \RedeclareSectionCommand[+ beforeskip=-10pt plus -2pt minus -1pt,+ afterskip=1sp plus -1sp minus 1sp,+ font=\normalfont\itshape]{paragraph}+ \RedeclareSectionCommand[+ beforeskip=-10pt plus -2pt minus -1pt,+ afterskip=1sp plus -1sp minus 1sp,+ font=\normalfont\scshape,+ indent=0pt]{subparagraph}+ ...++`classoption`+: option for document class, e.g. `oneside`; repeat for multiple options:++ ---+ classoption:+ - twocolumn+ - landscape+ ...++`documentclass`+: document class: usually one of the standard classes,+ [`article`], [`book`], and [`report`]; the [KOMA-Script]+ equivalents, `scrartcl`, `scrbook`, and `scrreprt`, which+ default to smaller margins; or [`memoir`]++`geometry`+: option for [`geometry`] package, e.g. `margin=1in`;+ repeat for multiple options:++ ---+ geometry:+ - top=30mm+ - left=20mm+ - heightrounded+ ...++`shorthands`+: Enable language-specific shorthands when loading `babel`.+ (By default, pandoc includes `shorthands=off` when loading+ `babel`, disabling language-specific shorthands.)++`hyperrefoptions`+: option for [`hyperref`] package, e.g. `linktoc=all`;+ repeat for multiple options:++ ---+ hyperrefoptions:+ - linktoc=all+ - pdfwindowui+ - pdfpagemode=FullScreen+ ...++`indent`+: if true, pandoc will use document class settings for+ indentation (the default LaTeX template otherwise removes+ indentation and adds space between paragraphs)++`linestretch`+: adjusts line spacing using the [`setspace`]+ package, e.g. `1.25`, `1.5`++`margin-left`, `margin-right`, `margin-top`, `margin-bottom`+: sets margins if `geometry` is not used (otherwise `geometry`+ overrides these)++`pagestyle`+: control `\pagestyle{}`: the default article class+ supports `plain` (default), `empty` (no running heads or page numbers),+ and `headings` (section titles in running heads)++`papersize`+: paper size, e.g. `letter`, `a4`++`secnumdepth`+: numbering depth for sections (with `--number-sections` option+ or `numbersections` variable)++`beamerarticle`+: produce an article from Beamer slides. Note: if you set+ this variable, you must specify the beamer writer but use the+ default *LaTeX* template: for example,+ `pandoc -Vbeamerarticle -t beamer --template default.latex`.++`handout`+: produce a handout version of Beamer slides (with overlays condensed+ into single slides)++`csquotes`+: load `csquotes` package and use `\enquote` or `\enquote*` for quoted text.++`csquotesoptions`+: options to use for `csquotes` package (repeat for multiple options).++`babeloptions`+: options to pass to the babel package (may be repeated for+ multiple options). This defaults to `provide=*` if the main+ language isn't a European language written with Latin or+ Cyrillic script or Vietnamese. Most users will not need to+ adjust the default setting.++#### Fonts++`fontenc`+: allows font encoding to be specified through `fontenc` package (with+ `pdflatex`); default is `T1` (see [LaTeX font encodings guide])++`fontfamily`+: font package for use with `pdflatex`:+ [TeX Live] includes many options, documented in the [LaTeX Font Catalogue].+ The default is [Latin Modern][`lm`].++`fontfamilyoptions`+: options for package used as `fontfamily`; repeat for multiple options.+ For example, to use the Libertine font with proportional lowercase+ (old-style) figures through the [`libertinus`] package:++ ---+ fontfamily: libertinus+ fontfamilyoptions:+ - osf+ - p+ ...++`fontsize`+: font size for body text. The standard classes allow 10pt, 11pt, and+ 12pt. To use another size, set `documentclass` to one of+ the [KOMA-Script] classes, such as `scrartcl` or `scrbook`.++`mainfont`, `sansfont`, `monofont`, `mathfont`, `CJKmainfont`, `CJKsansfont`, `CJKmonofont`+: font families for use with `xelatex` or+ `lualatex`: take the name of any system font, using the+ [`fontspec`] package. `CJKmainfont` uses the [`xecjk`] package if `xelatex` is used,+ or the [`luatexja`] package if `lualatex` is used.++`mainfontoptions`, `sansfontoptions`, `monofontoptions`, `mathfontoptions`, `CJKoptions`, `luatexjapresetoptions`+: options to use with `mainfont`, `sansfont`, `monofont`, `mathfont`,+ `CJKmainfont` in `xelatex` and `lualatex`. Allow for any+ choices available through [`fontspec`]; repeat for multiple+ options. For example, to use the [TeX Gyre] version of+ Palatino with lowercase figures:++ ---+ mainfont: TeX Gyre Pagella+ mainfontoptions:+ - Numbers=Lowercase+ - Numbers=Proportional+ ...++`mainfontfallback`, `sansfontfallback`, `monofontfallback`+: fonts to try if a glyph isn't found in `mainfont`, `sansfont`, or `monofont`+ respectively. These are lists. The font name must be followed by a colon+ and optionally a set of options, for example:++ ---+ mainfontfallback:+ - "FreeSans:"+ - "NotoColorEmoji:mode=harf"+ ...++ Font fallbacks currently only work with `lualatex`.++`babelfonts`+: a map of Babel language names (e.g. `chinese`) to the font+ to be used with the language:++ ---+ babelfonts:+ chinese-hant: "Noto Serif CJK TC"+ russian: "Noto Serif"+ ...++`microtypeoptions`+: options to pass to the microtype package++#### Links++`colorlinks`+: add color to link text; automatically enabled if any of+ `linkcolor`, `filecolor`, `citecolor`, `urlcolor`, or `toccolor` are set++`boxlinks`+: add visible box around links (has no effect if `colorlinks` is set)++`linkcolor`, `filecolor`, `citecolor`, `urlcolor`, `toccolor`+: color for internal links, external links, citation links, linked+ URLs, and links in table of contents, respectively: uses options+ allowed by [`xcolor`], including the `dvipsnames`, `svgnames`, and+ `x11names` lists++`links-as-notes`+: causes links to be printed as footnotes++`urlstyle`+: style for URLs (e.g., `tt`, `rm`, `sf`, and, the default, `same`)++#### Front matter++`lof`, `lot`+: include list of figures, list of tables (can also be set using+ `--lof/--list-of-figures`, `--lot/--list-of-tables`)++`thanks`+: contents of acknowledgments footnote after document title++`toc`+: include table of contents (can also be set using+ `--toc/--table-of-contents`)++`toc-depth`+: level of section to include in table of contents++#### BibLaTeX Bibliographies++These variables function when using BibLaTeX for [citation rendering].++`biblatexoptions`+: list of options for biblatex++`biblio-style`+: bibliography style, when used with `--natbib` and `--biblatex`++`biblio-title`+: bibliography title, when used with `--natbib` and `--biblatex`++`bibliography`+: bibliography to use for resolving references++`natbiboptions`+: list of options for natbib++#### Other++`pdf-trailer-id`+: the PDF trailer ID; must be two PDF byte strings if set,+ conventionally with 16 bytes each. E.g.,+ `<00112233445566778899aabbccddeeff>+ <00112233445566778899aabbccddeeff>`.++ See the section on [reproducible builds].++`pdfstandard`+: PDF standard(s) for the document, e.g. `ua-2`, `a-4f`.+ Supports PDF/A, PDF/X, and PDF/UA variants.+ Requires LuaLaTeX and LaTeX 2023+. Repeat for multiple standards:++ ---+ pdfstandard:+ - ua-2+ - a-4f+ ...++[KOMA-Script]: https://ctan.org/pkg/koma-script+[LaTeX Font Catalogue]: https://tug.org/FontCatalogue/+[LaTeX font encodings guide]: https://ctan.org/pkg/encguide+[TeX Gyre]: http://www.gust.org.pl/projects/e-foundry/tex-gyre+[`article`]: https://ctan.org/pkg/article+[`book`]: https://ctan.org/pkg/book+[`libertinus`]: https://ctan.org/pkg/libertinus+[`memoir`]: https://ctan.org/pkg/memoir+[`report`]: https://ctan.org/pkg/report++### Variables for ConTeXt++Pandoc uses these variables when [creating a PDF] with ConTeXt.++`fontsize`+: font size for body text (e.g. `10pt`, `12pt`)++`headertext`, `footertext`+: text to be placed in running header or footer (see [ConTeXt Headers and+ Footers]); repeat up to four times for different placement++`indenting`+: controls indentation of paragraphs, e.g. `yes,small,next` (see+ [ConTeXt Indentation]); repeat for multiple options++`interlinespace`+: adjusts line spacing, e.g. `4ex` (using [`setupinterlinespace`]);+ repeat for multiple options++`layout`+: options for page margins and text arrangement (see [ConTeXt Layout]);+ repeat for multiple options++`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`++`lof`, `lot`+: include list of figures, list of tables++`mainfont`, `sansfont`, `monofont`, `mathfont`+: font families: take the name of any system font (see+ [ConTeXt Font Switching])++`mainfontfallback`, `sansfontfallback`, `monofontfallback`+: list of fonts to try, in order, if a glyph is not found in the+ main font. Use `\definefallbackfamily`-compatible font name syntax.+ Emoji fonts are unsupported.++`margin-left`, `margin-right`, `margin-top`, `margin-bottom`+: sets margins, if `layout` is not used (otherwise `layout`+ overrides these)++`pagenumbering`+: page number style and location (using [`setuppagenumbering`]);+ repeat for multiple options++`papersize`+: paper size, e.g. `letter`, `A4`, `landscape` (see [ConTeXt Paper Setup]);+ repeat for multiple options++`pdfa`+: adds to the preamble the setup necessary to generate PDF/A+ of the type specified, e.g. `1a:2005`, `2a`. If no type is+ specified (i.e. the value is set to True, by e.g.+ `--metadata=pdfa` or `pdfa: true` in a YAML metadata block),+ `1b:2005` will be used as default, for reasons of backwards+ compatibility. Using `--variable=pdfa` without specified value+ is not supported. To successfully generate PDF/A the required+ ICC color profiles have to be available and the content and all+ included files (such as images) have to be standard-conforming.+ The ICC profiles and output intent may be specified using the+ variables `pdfaiccprofile` and `pdfaintent`. See also [ConTeXt+ PDFA] for more details.++`pdfaiccprofile`+: when used in conjunction with `pdfa`, specifies the ICC profile to use+ in the PDF, e.g. `default.cmyk`. If left unspecified, `sRGB.icc` is+ used as default. May be repeated to include multiple profiles. Note that+ the profiles have to be available on the system. They can be obtained+ from [ConTeXt ICC Profiles].++`pdfaintent`+: when used in conjunction with `pdfa`, specifies the output intent for+ the colors, e.g. `ISO coated v2 300\letterpercent\space (ECI)`+ If left unspecified, `sRGB IEC61966-2.1` is used as default.++`toc`+: include table of contents (can also be set using+ `--toc/--table-of-contents`)++`urlstyle`+: typeface style for links without link text, e.g. `normal`, `bold`, `slanted`, `boldslanted`,+ `type`, `cap`, `small`++`whitespace`+: spacing between paragraphs, e.g. `none`, `small` (using+ [`setupwhitespace`])++`includesource`+: include all source documents as file attachments in the PDF file++[ConTeXt Paper Setup]: https://wiki.contextgarden.net/Document_layout_and_layers/Paper_setup+[ConTeXt Layout]: https://wiki.contextgarden.net/Document_layout_and_layers/Tutorials+[ConTeXt Font Switching]: https://wiki.contextgarden.net/Characters_words_and_fonts/Tutorials+[ConTeXt Color]: https://wiki.contextgarden.net/Color+[ConTeXt Headers and Footers]: https://wiki.contextgarden.net/Document_layout_and_layers/Headers_and_footers+[ConTeXt Indentation]: https://wiki.contextgarden.net/Text_blocks/Typography/Indentation+[ConTeXt PDFA]: https://wiki.contextgarden.net/Input_and_compilation/PDF/PDFA+[ConTeXt ICC Profiles]: https://wiki.contextgarden.net/Input_and_compilation/PDF/PDFX#ICC_profiles+[`setupwhitespace`]: https://wiki.contextgarden.net/Command/setupwhitespace+[`setupinterlinespace`]: https://wiki.contextgarden.net/Command/setupinterlinespace+[`setuppagenumbering`]: https://wiki.contextgarden.net/Command/setuppagenumbering++### Variables for `wkhtmltopdf`++Pandoc uses these variables when [creating a PDF] with [`wkhtmltopdf`].+The `--css` option also affects the output.++`footer-html`, `header-html`+: add information to the header and footer++`margin-left`, `margin-right`, `margin-top`, `margin-bottom`+: set the page margins++`papersize`+: sets the PDF paper size++### Variables for man pages++`adjusting`+: adjusts text to left (`l`), right (`r`), center (`c`),+ or both (`b`) margins++`footer`+: footer in man pages++`header`+: header in man pages++`section`+: section number in man pages++### Variables for Texinfo++`version`+: version of software (used in title and title page)++`filename`+: name of info file to be generated (defaults to a name based on the+ texi filename)++### Variables for Typst++`template`+: Typst template to use (relative path only).++`margin`+: A dictionary with the fields defined in the Typst documentation:+ `x`, `y`, `top`, `bottom`, `left`, `right`.++`papersize`+: Paper size: `a4`, `us-letter`, etc.++`mainfont`+: Name of system font to use for the main font.++`fontsize`+: Font size (e.g., `12pt`).++`section-numbering`+: Schema to use for numbering sections, e.g. `1.A.1`.++`page-numbering`+: Schema to use for numbering pages, e.g. `1` or `i`, or+ an empty string to omit page numbering.++`columns`+: Number of columns for body text.++`thanks`+: contents of acknowledgments footnote after document title++`mathfont`, `codefont`+: Name of system font to use for math and code, respectively.++`linestretch`+: adjusts line spacing, e.g. `1.25`, `1.5`++`linkcolor`, `filecolor`, `citecolor`+: color for external links, internal links, and citation links,+ respectively: expects a hexadecimal color code++### Variables for ms++`fontfamily`+: `A` (Avant Garde), `B` (Bookman), `C` (Helvetica), `HN`+ (Helvetica Narrow), `P` (Palatino), or `T` (Times New Roman).+ This setting does not affect source code, which is always+ displayed using monospace Courier. These built-in fonts are+ limited in their coverage of characters. Additional fonts may+ be installed using the script [`install-font.sh`] provided+ by Peter Schaffter and documented in detail on [his web+ site][ms-font-steps].++`indent`+: paragraph indent (e.g. `2m`)++`lineheight`+: line height (e.g. `12p`)++`pointsize`+: point size (e.g. `10p`)++[`install-font.sh`]: https://www.schaffter.ca/mom/bin/install-font.sh+[ms-font-steps]: https://www.schaffter.ca/mom/momdoc/appendices.html#steps++### Variables set automatically++Pandoc sets these variables automatically in response to [options] or+document contents; users can also modify them. These vary depending+on the output format, and include the following:++`body`+: body of document++`date-meta`+: the `date` variable converted to ISO 8601 YYYY-MM-DD,+ included in all HTML based formats (dzslides, epub,+ html, html4, html5, revealjs, s5, slideous, slidy).+ The recognized formats for `date` are: `mm/dd/yyyy`,+ `mm/dd/yy`, `yyyy-mm-dd` (ISO 8601), `dd MM yyyy`+ (e.g. either `02 Apr 2018` or `02 April 2018`),+ `MM dd, yyyy` (e.g. `Apr. 02, 2018` or `April 02, 2018),+ `yyyy[mm[dd]]` (e.g. `20180402, `201804` or `2018`).++`header-includes`+: contents specified by `-H/--include-in-header` (may have multiple+ values)++`include-before`+: contents specified by `-B/--include-before-body` (may have+ multiple values)++`include-after`+: contents specified by `-A/--include-after-body` (may have+ multiple values)++`meta-json`+: JSON representation of all of the document's metadata. Field+ values are transformed to the selected output format.++`numbersections`+: non-null value if `-N/--number-sections` was specified++`sourcefile`, `outputfile`+: source and destination filenames, as given on the command line.+ `sourcefile` can also be a list if input comes from multiple files,+ or empty if input is from stdin. You can use the following snippet in+ your template to distinguish them:++ $if(sourcefile)$+ $for(sourcefile)$+ $sourcefile$+ $endfor$+ $else$+ (stdin)+ $endif$++ Similarly, `outputfile` can be `-` if output goes to the terminal.++ If you need absolute paths, use e.g. `$curdir$/$sourcefile$`.++`pdf-engine`+: name of PDF engine if provided using `--pdf-engine`, or the+ default engine for the format if PDF output is requested.++`curdir`+: working directory from which pandoc is run.++`pandoc-version`+: pandoc version.++`toc`+: non-null value if `--toc/--table-of-contents` was specified++`toc-title`+: title of table of contents (works only with EPUB,+ HTML, revealjs, opendocument, odt, docx, pptx, beamer, LaTeX).+ Note that in docx and pptx a custom `toc-title` will be+ picked up from metadata, but cannot be set as a variable.++[pandoc-templates]: https://github.com/jgm/pandoc-templates++# Extensions++The behavior of some of the readers and writers can be adjusted by+enabling or disabling various extensions.++An extension can be enabled by adding `+EXTENSION`+to the format name and disabled by adding `-EXTENSION`. For example,+`--from markdown_strict+footnotes` is strict Markdown with footnotes+enabled, while `--from markdown-footnotes-pipe_tables` is pandoc's+Markdown without footnotes or pipe tables.++The Markdown reader and writer make by far the most use of extensions.+Extensions only used by them are therefore covered in the+section [Pandoc's Markdown] below (see [Markdown variants] for+`commonmark` and `gfm`). In the following, extensions that also work+for other formats are covered.++Note that Markdown extensions added to the `ipynb` format+affect Markdown cells in Jupyter notebooks (as do command-line+options like `--markdown-headings`).++## Typography++### Extension: `smart` ###++Interpret straight quotes as curly quotes, `---` as em-dashes,+`--` as en-dashes, and `...` as ellipses. Nonbreaking spaces are+inserted after certain abbreviations, such as "Mr."++This extension can be enabled/disabled for the following formats:++input formats+: `markdown`, `commonmark`, `latex`, `mediawiki`, `org`, `rst`, `twiki`,+ `html`++output formats+: `markdown`, `latex`, `context`, `org`, `rst`++enabled by default in+: `markdown`, `latex`, `context` (both input and output)++Note: If you are *writing* Markdown, then the `smart` extension+has the reverse effect: what would have been curly quotes comes+out straight.++In LaTeX, `smart` means to use the standard TeX ligatures+for quotation marks (` `` ` and ` '' ` for double quotes,+`` ` `` and `` ' `` for single quotes) and dashes (`--` for+en-dash and `---` for em-dash). If `smart` is disabled,+then in reading LaTeX pandoc will parse these characters+literally. In writing LaTeX, enabling `smart` tells pandoc+to use the ligatures when possible; if `smart` is disabled+pandoc will use unicode quotation mark and dash characters.++## Headings and sections++### Extension: `auto_identifiers` ###++A heading without an explicitly specified identifier will be+automatically assigned a unique identifier based on the heading text.++This extension can be enabled/disabled for the following formats:++input formats+: `markdown`, `latex`, `rst`, `mediawiki`, `textile`, `man`++output formats+: `markdown`, `muse`++enabled by default in+: `markdown`, `muse`, `man`++The default algorithm used to derive the identifier from the+heading text is:++ - Remove all formatting, links, etc.+ - Remove all footnotes.+ - Remove all non-alphanumeric characters,+ except underscores, hyphens, and periods.+ - Replace all spaces and newlines with hyphens.+ - Convert all alphabetic characters to lowercase.+ - Remove everything up to the first letter (identifiers may+ not begin with a number or punctuation mark).+ - If nothing is left after this, use the identifier `section`.++Thus, for example,++ Heading Identifier+ ------------------------------- ----------------------------+ `Heading identifiers in HTML` `heading-identifiers-in-html`+ `Maître d'hôtel` `maître-dhôtel`+ `*Dogs*?--in *my* house?` `dogs--in-my-house`+ `[HTML], [S5], or [RTF]?` `html-s5-or-rtf`+ `3. Applications` `applications`+ `33` `section`++These rules should, in most cases, allow one to determine the identifier+from the heading text. The exception is when several headings have the+same text; in this case, the first will get an identifier as described+above; the second will get the same identifier with `-1` appended; the+third with `-2`; and so on.++(However, a different algorithm is used if+`gfm_auto_identifiers` is enabled; see below.)++These identifiers are used to provide link targets in the table of+contents generated by the `--toc|--table-of-contents` option. They+also make it easy to provide links from one section of a document to+another. A link to this section, for example, might look like this:++ See the section on+ [heading identifiers](#heading-identifiers-in-html-latex-and-context).++Note, however, that this method of providing links to sections works+only in HTML, LaTeX, and ConTeXt formats.++If the `--section-divs` option is specified, then each section will+be wrapped in a `section` (or a `div`, if `html4` was specified),+and the identifier will be attached to the enclosing `<section>`+(or `<div>`) tag rather than the heading itself. This allows entire+sections to be manipulated using JavaScript or treated differently in+CSS.++### Extension: `ascii_identifiers` ###++Causes the identifiers produced by `auto_identifiers` to be pure ASCII.+Accents are stripped off of accented Latin letters, and non-Latin+letters are omitted.++### Extension: `gfm_auto_identifiers` ###++Changes the algorithm used by `auto_identifiers` to conform to+GitHub's method. Spaces are converted to dashes (`-`),+uppercase characters to lowercase characters, and punctuation+characters other than `-` and `_` are removed.+Emojis are replaced by their names.++## Math Input++The extensions [`tex_math_dollars`](#extension-tex_math_dollars),+[`tex_math_gfm`](#extension-tex_math_gfm),+[`tex_math_single_backslash`](#extension-tex_math_single_backslash), and+[`tex_math_double_backslash`](#extension-tex_math_double_backslash)+are described in the section about Pandoc's Markdown.++However, they can also be used with HTML input. This is handy for+reading web pages formatted using MathJax, for example.++## Raw HTML/TeX++The following extensions are described in more detail in+their respective sections of [Pandoc's Markdown]:++- [`raw_html`](#extension-raw_html) allows HTML elements which+ are not representable in pandoc's AST to be parsed as raw HTML.+ By default, this is disabled for HTML input.++- [`raw_tex`](#extension-raw_tex) allows raw LaTeX, TeX, and ConTeXt+ to be included in a document. This extension can be enabled/disabled+ for the following formats (in addition to `markdown`):++ input formats+ : `latex`, `textile`, `html` (environments, `\ref`, and+ `\eqref` only), `ipynb`++ output formats+ : `textile`, `commonmark`++ Note: as applied to `ipynb`, `raw_html` and `raw_tex` affect not+ only raw TeX in Markdown cells, but data with mime type+ `text/html` in output cells. Since the `ipynb` reader attempts+ to preserve the richest possible outputs when several options+ are given, you will get best results if you disable `raw_html`+ and `raw_tex` when converting to formats like `docx` which don't+ allow raw `html` or `tex`.++- [`native_divs`](#extension-native_divs) causes HTML `div`+ elements to be parsed as native pandoc Div blocks.+ If you want them to be parsed as raw HTML, use+ `-f html-native_divs+raw_html`.++- [`native_spans`](#extension-native_spans) causes HTML `span`+ elements to be parsed as native pandoc Span inlines.+ If you want them to be parsed as raw HTML, use+ `-f html-native_spans+raw_html`. If you want to drop all+ `div`s and `span`s when converting HTML to Markdown, you+ can use `pandoc -f html-native_divs-native_spans -t markdown`.++## Literate Haskell support++### Extension: `literate_haskell` ###++Treat the document as literate Haskell source.++This extension can be enabled/disabled for the following formats:++input formats+: `markdown`, `rst`, `latex`++output formats+: `markdown`, `rst`, `latex`, `html`++If you append `+lhs` (or `+literate_haskell`) to one of the formats+above, pandoc will treat the document as literate Haskell source.+This means that++ - 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 headings the character '=' will be used instead of '#'.++ - 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, headings will be rendered setext-style (with underlines)+ rather than ATX-style (with '#' characters). (This is because ghc+ treats '#' characters in column 1 as introducing line numbers.)++ - In restructured text input, "bird track" sections will be parsed+ as Haskell code.++ - In restructured text output, code blocks with class `haskell` will+ be rendered using bird tracks.++ - In LaTeX input, text in `code` environments will be parsed as+ Haskell code.++ - In LaTeX output, code blocks with class `haskell` will be rendered+ inside `code` environments.++ - In HTML output, code blocks with class `haskell` will be rendered+ with class `literatehaskell` and bird tracks.++Examples:++ pandoc -f markdown+lhs -t html++reads literate Haskell source formatted with Markdown conventions and writes+ordinary HTML (without bird tracks).++ pandoc -f markdown+lhs -t html+lhs++writes HTML with the Haskell code in bird tracks, so it can be copied+and pasted as literate Haskell source.++Note that GHC expects the bird tracks in the first column, so indented+literate code blocks (e.g. inside an itemized environment) will not be+picked up by the Haskell compiler.++## Other extensions++### Extension: `empty_paragraphs` ###++Allows empty paragraphs. By default empty paragraphs are+omitted.++This extension can be enabled/disabled for the following formats:++input formats+: `docx`, `html`++output formats+: `docx`, `odt`, `opendocument`, `html`, `latex`++### Extension: `native_numbering` ###++Enables native numbering of figures and tables. Enumeration+starts at 1.++This extension can be enabled/disabled for the following formats:++output formats+: `odt`, `opendocument`, `docx`++### Extension: `xrefs_name` ###++Links to headings, figures and tables inside the document are+substituted with cross-references that will use the name or caption+of the referenced item. The original link text is replaced once+the generated document is refreshed. This extension can be combined+with `xrefs_number` in which case numbers will appear before the+name.++Text in cross-references is only made consistent with the referenced+item once the document has been refreshed.++This extension can be enabled/disabled for the following formats:++output formats+: `odt`, `opendocument`++### Extension: `xrefs_number` ###++Links to headings, figures and tables inside the document are+substituted with cross-references that will use the number+of the referenced item. The original link text is discarded.+This extension can be combined with `xrefs_name` in which case+the name or caption numbers will appear after the number.++For the `xrefs_number` to be useful heading numbers must be enabled+in the generated document, also table and figure captions must be enabled+using for example the `native_numbering` extension.++Numbers in cross-references are only visible in the final document once+it has been refreshed.++This extension can be enabled/disabled for the following formats:++output formats+: `odt`, `opendocument`++### Extension: `styles` ### {#ext-styles}++When converting from docx, add `custom-styles` attributes+for all docx styles, regardless of whether pandoc understands+the meanings of these styles. Because attributes cannot be+added directly to paragraphs or text in the pandoc AST,+paragraph styles will cause Divs to be created and character+styles will cause Spans to be created to hold the attributes.+(Table styles will be added to the Table elements directly.)+This extension can be used with [docx custom styles](#custom-styles).++input formats+: `docx`++### Extension: `amuse` ###++In the `muse` input format, this enables Text::Amuse+extensions to Emacs Muse markup.++### Extension: `raw_markdown` ###++In the `ipynb` input format, this causes Markdown cells+to be included as raw Markdown blocks (allowing lossless+round-tripping) rather than being parsed. Use this only+when you are targeting `ipynb` or a Markdown-based+output format.++### Extension: `citations` (typst) {#typst-citations}++When the `citations` extension is enabled in `typst`+(as it is by default), `typst` citations will+be parsed as native pandoc citations, and native+pandoc citations will be rendered as `typst` citations.++### Extension: `citations` (org) {#org-citations}++When the `citations` extension is enabled in `org`,+org-cite and org-ref style citations will be parsed as+native pandoc citations, and org-cite citations will+be used to render native pandoc citations.++ [org-cite]: https://orgmode.org/manual/Citations.html+ [org-ref]: https://github.com/jkitchin/org-ref++### Extension: `citations` (docx) {#docx-citations}++When `citations` is enabled in `docx`, citations inserted+by Zotero or Mendeley or EndNote plugins will be parsed as native+pandoc citations. (Otherwise, the formatted citations generated+by the bibliographic software will be parsed as regular text.)++### Extension: `fancy_lists` (org) {#org-fancy-lists}++Some aspects of [Pandoc's Markdown fancy lists](#extension-fancy_lists) are also+accepted in `org` input, mimicking the option `org-list-allow-alphabetical` in+Emacs. As in Org Mode, enabling this extension allows lowercase and uppercase+alphabetical markers for ordered lists to be parsed in addition to arabic ones.+Note that for Org, this does not include roman numerals or the `#` placeholder+that are enabled by the extension in Pandoc's Markdown.++### Extension: `element_citations` ###++In the `jats` output formats, this causes reference items to+be replaced with `<element-citation>` elements. These+elements are not influenced by CSL styles, but all information+on the item is included in tags.++### Extension: `ntb` ###++In the `context` output format this enables the use of [Natural Tables+(TABLE)](https://wiki.contextgarden.net/TABLE) instead of the default+[Extreme Tables (xtables)](https://wiki.contextgarden.net/xtables).+Natural tables allow more fine-grained global customization but come+at a performance penalty compared to extreme tables.++### Extension: `smart_quotes` (org) ###++Interpret straight quotes as curly quotes during parsing. When+*writing* Org, then the `smart_quotes` extension has the reverse+effect: what would have been curly quotes comes out straight.++This extension is implied if `smart` is enabled.++### Extension: `special_strings` (org) ###++Interpret `---` as em-dashes, `--` as en-dashes, `\-` as shy+hyphen, and `...` as ellipses.++This extension is implied if `smart` is enabled.++### Extension: `tagging` ### {#extension--tagging}++Enabling this extension with `context` output will produce markup+suitable for the production of tagged PDFs. This includes+additional markers for paragraphs and alternative markup for+emphasized text. The `emphasis-command` template variable is set+if the extension is enabled.++# 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 original Markdown. Except where noted, these+differences can be suppressed by using the `markdown_strict` format instead+of `markdown`. Extensions can be enabled or disabled to specify the+behavior more granularly. They are described in the following. See also+[Extensions] above, for extensions that work also on other formats.++## Philosophy++Markdown is designed to be easy to write, and, even more importantly,+easy to read:++> A Markdown-formatted document should be publishable as-is, as plain+> text, without looking like it's been marked up with tags or formatting+> instructions.\+> -- [John Gruber](https://daringfireball.net/projects/markdown/syntax#philosophy)++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+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 elements like definition lists, tables, mathematics, and+footnotes.++## Paragraphs++A paragraph is one or more lines of text followed by one or more blank lines.+Newlines are treated as spaces, so you can reflow your paragraphs as you like.+If you need a hard line break, put two or more spaces at the end of a line.++### Extension: `escaped_line_breaks` ###++A backslash followed by a newline is also a hard line break.+Note: in multiline and grid table cells, this is the only way+to create a hard line break, since trailing spaces in the cells+are ignored.++## Headings++There are two kinds of headings: Setext and ATX.++### Setext-style headings ###++A setext-style heading is a line of text "underlined" with a row of `=` signs+(for a level-one heading) or `-` signs (for a level-two heading):++ A level-one heading+ ===================++ A level-two heading+ -------------------++The heading text can contain inline formatting, such as emphasis (see+[Inline formatting], below).+++### ATX-style headings ###++An ATX-style heading consists of one to six `#` signs and a line of+text, optionally followed by any number of `#` signs. The number of+`#` signs at the beginning of the line is the heading level:++ ## A level-two heading++ ### A level-three heading ###++As with setext-style headings, the heading text can contain formatting:++ # A level-one heading with a [link](/url) and *emphasis*++### Extension: `blank_before_header` ###++Original Markdown syntax does not require a blank line before a heading.+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+wrapping). Consider, for example:++ I like several of their flavors of ice cream:+ #22, for example, and #5.++### Extension: `space_in_atx_header` ###++Many Markdown implementations do not require a space between the+opening `#`s of an ATX heading and the heading text, so that+`#5 bolt` and `#hashtag` count as headings. With this extension,+pandoc does require the space.++### Heading identifiers ###++See also the [`auto_identifiers`+extension](#extension-auto_identifiers) above.++### Extension: `header_attributes` ###++Headings can be assigned attributes using this syntax at the end+of the line containing the heading text:++ {#identifier .class .class key=value key=value}++Thus, for example, the following headings will all be assigned the identifier+`foo`:++ # My heading {#foo}++ ## My heading ## {#foo}++ My other heading {#foo}+ ---------------++(This syntax is compatible with [PHP Markdown Extra].)++Note that although this syntax allows assignment of classes and key/value+attributes, writers generally don't use all of this information. Identifiers,+classes, and key/value attributes are used in HTML and HTML-based formats such+as EPUB and slidy. Identifiers are used for labels and link anchors in the+LaTeX, ConTeXt, Textile, Jira markup, and AsciiDoc writers.++Headings with the class `unnumbered` will not be numbered, even if+`--number-sections` is specified. A single hyphen (`-`) in an attribute+context is equivalent to `.unnumbered`, and preferable in non-English+documents. So,++ # My heading {-}++is just the same as++ # My heading {.unnumbered}++If the `unlisted` class is present in addition to `unnumbered`,+the heading will not be included in a table of contents.+(Currently this feature is only implemented for certain+formats: those based on LaTeX and HTML, PowerPoint, and RTF.)++### Extension: `implicit_header_references` ###++Pandoc behaves as if reference links have been defined for each heading.+So, to link to a heading++ # Heading identifiers in HTML++you can simply write++ [Heading identifiers in HTML]++or++ [Heading identifiers in HTML][]++or++ [the section on heading identifiers][heading identifiers in+ HTML]++instead of giving the identifier explicitly:++ [Heading identifiers in HTML](#heading-identifiers-in-html)++If there are multiple headings with identical text, the corresponding+reference will link to the first one only, and you will need to use explicit+links to link to the others, as described above.++Like regular reference links, these references are case-insensitive.++Explicit link reference definitions always take priority over+implicit heading references. So, in the following example, the+link will point to `bar`, not to `#foo`:++ # Foo++ [foo]: bar++ See [foo]++## Block quotations++Markdown uses email conventions for quoting blocks of text.+A block quotation is one or more paragraphs or other block elements+(such as lists or headings), with each line preceded by a `>` character+and an optional space. (The `>` need not start at the left margin, but+it should not be indented more than three spaces.)++ > This is a block quote. This+ > paragraph has two lines.+ >+ > 1. This is a list inside a block quote.+ > 2. Second item.++A "lazy" form, which requires the `>` character only on the first+line of each block, is also allowed:++ > This is a block quote. This+ paragraph has two lines.++ > 1. This is a list inside a block quote.+ 2. Second item.++Among the block elements that can be contained in a block quote are+other block quotes. That is, block quotes can be nested:++ > This is a block quote.+ >+ > > A block quote within a block quote.++If the `>` character is followed by an optional space, that space+will be considered part of the block quote marker and not part of+the indentation of the contents. Thus, to put an indented code+block in a block quote, you need five spaces after the `>`:++ > code++### Extension: `blank_before_blockquote` ###++Original 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 wrapping). So,+unless the `markdown_strict` format is used, the following does+not produce a nested block quote in pandoc:++ > This is a block quote.+ >> Not nested, since `blank_before_blockquote` is enabled by default+++## Verbatim (code) blocks++### Indented code blocks ###++A block of text indented four spaces (or one tab) is treated as verbatim+text: that is, special characters do not trigger special formatting,+and all spaces and line breaks are preserved. For example,++ if (a > 3) {+ moveShip(5 * gravity, DOWN);+ }++The initial (four space or one tab) indentation is not considered part+of the verbatim text, and is removed in the output.++Note: blank lines in the verbatim text need not begin with four spaces.+++### Fenced code blocks ###++### Extension: `fenced_code_blocks` ###++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+indentation is necessary:++ ~~~~~~~+ if (a > 3) {+ moveShip(5 * gravity, DOWN);+ }+ ~~~~~~~++Like regular code blocks, fenced code blocks must be separated+from surrounding text by blank lines.++If the code itself contains a row of tildes or backticks, just use a longer+row of tildes or backticks at the start and end:++ ~~~~~~~~~~~~~~~~+ ~~~~~~~~~~+ code including tildes+ ~~~~~~~~~~+ ~~~~~~~~~~~~~~~~++### Extension: `backtick_code_blocks` ###++Same as `fenced_code_blocks`, but uses backticks (`` ` ``) instead of tildes+(`~`).++### Extension: `fenced_code_attributes` ###++Optionally, you may attach attributes to fenced or backtick code block using+this syntax:++ ~~~~ {#mycode .haskell .numberLines startFrom="100"}+ qsort [] = []+ qsort (x:xs) = qsort (filter (< x) xs) ++ [x] +++ qsort (filter (>= x) xs)+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~++Here `mycode` is an identifier, `haskell` and `numberLines` are+classes, and `startFrom` is an attribute with value `100`. Some+output formats can use this information to do syntax+highlighting. Currently, the only output formats that use this+information are HTML, LaTeX, Docx, Ms, and PowerPoint. If+highlighting is supported for your output format and language,+then the code block above will appear highlighted, with numbered+lines. (To see which languages are supported, type `pandoc+--list-highlight-languages`.) Otherwise, the code block above+will appear as follows:++ <pre id="mycode" class="haskell numberLines" startFrom="100">+ <code>+ ...+ </code>+ </pre>++The `numberLines` (or `number-lines`) class will cause the lines+of the code block to be numbered, starting with `1` or the value+of the `startFrom` attribute. The `lineAnchors` (or+`line-anchors`) class will cause the lines to be clickable+anchors in HTML output.++A shortcut form can also be used for specifying the language of+the code block:++ ```haskell+ qsort [] = []+ ```++This is equivalent to:++ ``` {.haskell}+ qsort [] = []+ ```++This shortcut form may be combined with attributes:++ ```haskell {.numberLines}+ qsort [] = []+ ```++Which is equivalent to:++ ``` {.haskell .numberLines}+ qsort [] = []+ ```++If the `fenced_code_attributes` extension is disabled, but+input contains class attribute(s) for the code block, the first+class attribute will be printed after the opening fence as a bare+word.++To prevent all highlighting, use the `--syntax-highlighting=none`+option. To set the highlighting style or method, use+`--syntax-highlighting`. For more information on highlighting, see+[Syntax highlighting], below.++## Line blocks++### Extension: `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:++ | The limerick packs laughs anatomical+ | In space that is quite economical.+ | But the good ones I've seen+ | So seldom are clean+ | And the clean ones so seldom are comical++ | 200 Main St.+ | Berkeley, CA 94718++The lines can be hard-wrapped if needed, but the continuation+line must begin with a space.++ | The Right Honorable Most Venerable and Righteous Samuel L.+ Constable, Jr.+ | 200 Main St.+ | Berkeley, CA 94718++Inline formatting (such as emphasis) is allowed in the content+(though it can't cross line boundaries). Block-level formatting+(such as block quotes or lists) is not recognized.++This syntax is borrowed from [reStructuredText].++## Lists++### Bullet lists ###++A bullet list is a list of bulleted list items. A bulleted list+item begins with a bullet (`*`, `+`, or `-`). Here is a simple+example:++ * one+ * two+ * three++This will produce a "compact" list. If you want a "loose" list, in which+each item is formatted as a paragraph, put spaces between the items:++ * one++ * two++ * three++The bullets need not be flush with the left margin; they may be+indented one, two, or three spaces. The bullet must be followed+by whitespace.++List items look best if subsequent lines are flush with the first+line (after the bullet):++ * here is my first+ list item.+ * and my second.++But Markdown also allows a "lazy" format:++ * here is my first+ list item.+ * and my second.++### Block content in list items ###++A list item may contain multiple paragraphs and other block-level+content. However, subsequent paragraphs must be preceded by a blank line+and indented to line up with the first non-space content after+the list marker.++ * First paragraph.++ Continued.++ * Second paragraph. With a code block, which must be indented+ eight spaces:++ { code }++Exception: if the list marker is followed by an indented code+block, which must begin 5 spaces after the list marker, then+subsequent paragraphs must begin two columns after the last+character of the list marker:++ * code++ continuation paragraph++List items may include other lists. In this case the preceding blank+line is optional. The nested list must be indented to line up with+the first non-space character after the list marker of the+containing list item.++ * fruits+ + apples+ - macintosh+ - red delicious+ + pears+ + peaches+ * vegetables+ + broccoli+ + chard++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.++ + A lazy, lazy, list+ item.++ + Another one; this looks+ bad but is legal.++ Second paragraph of second+ list item.++### Ordered lists ###++Ordered lists work just like bulleted lists, except that the items+begin with enumerators rather than bullets.++In original 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:++ 1. one+ 2. two+ 3. three++and this one:++ 5. one+ 7. two+ 1. three++### Extension: `fancy_lists` ###++Unlike original 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-parenthesis or period. They must be separated from the+text that follows by at least one space, and, if the list marker is a+capital letter with a period, by at least two spaces.[^2]++[^2]: The point of this rule is to ensure that normal paragraphs+ starting with people's initials, like++ B. Russell won a Nobel Prize (but not for "On Denoting").++ do not get treated as list items.++ This rule will not prevent++ (C) 2007 Joe Smith++ from being interpreted as a list item. In this case, a backslash+ escape can be used:++ (C\) 2007 Joe Smith++The `fancy_lists` extension also allows '`#`' to be used as an+ordered list marker in place of a numeral:++ #. one+ #. two++Note: the '`#`' ordered list marker doesn't work with `commonmark`.++### Extension: `startnum` ###++Pandoc also pays attention to the type of list marker used, and to the+starting number, and both of these are preserved where possible in the+output format. Thus, the following yields a list with numbers followed+by a single parenthesis, starting with 9, and a sublist with lowercase+roman numerals:++ 9) Ninth+ 10) Tenth+ 11) Eleventh+ i. subone+ ii. subtwo+ iii. subthree++Pandoc will start a new list each time a different type of list+marker is used. So, the following will create three lists:++ (2) Two+ (5) Three+ 1. Four+ * Five++If default list markers are desired, use `#.`:++ #. one+ #. two+ #. three++### Extension: `task_lists` ###++Pandoc supports task lists, using the syntax of GitHub-Flavored Markdown.++ - [ ] an unchecked task list item+ - [x] checked item++### Definition lists ###++### Extension: `definition_lists` ###++Pandoc supports definition lists, using the syntax of+[PHP Markdown Extra] with some extensions.[^3]++ Term 1++ : Definition 1++ Term 2 with *inline markup*++ : Definition 2++ { some code, part of Definition 2 }++ Third paragraph of definition 2.++Each term must fit on one line, which may optionally be followed by+a blank line, and must be followed by one or more definitions.+A definition begins with a colon or tilde, which may be indented one+or two spaces.++A term may have multiple definitions, and each definition may+consist of one or more indented block elements (paragraph, code block,+list, etc.). The blocks in the definition shoud be indented to the column+of the first non-space content after the `:` or `~` marker, or+(if the `four_space_rule` extension is enabled) four spaces or+one tab stop. As with other Markdown lists, you can "lazily" omit+indentation in paragraph continuation lines:++ Term 1++ : Definition+ with lazy continuation.++ Second paragraph of the definition.++If you leave space before the definition (as in the example above),+the text of the definition will be treated as a paragraph. In some+output formats, this will mean greater spacing between term/definition+pairs. For a more compact definition list, omit the space before the+definition:++ Term 1+ ~ Definition 1++ Term 2+ ~ Definition 2a+ ~ Definition 2b++Note that space between items in a definition list is required.++[^3]: I have been influenced by the suggestions of [David+ Wheeler](https://justatheory.com/2009/02/modest-markdown-proposal/).++### Numbered example lists ###++### Extension: `example_lists` ###++The special list marker `@` can be used for sequentially numbered+examples. The first list item with a `@` marker will be numbered '1',+the next '2', and so on, throughout the document. The numbered examples+need not occur in a single list; each new list using `@` will take up+where the last stopped. So, for example:++ (@) My first example will be numbered (1).+ (@) My second example will be numbered (2).++ Explanation of examples.++ (@) My third example will be numbered (3).++Numbered examples can be labeled and referred to elsewhere in the+document:++ (@good) This is a good example.++ As (@good) illustrates, ...++The label can be any string of alphanumeric characters, underscores,+or hyphens.++Continuation paragraphs in example lists must always+be indented four spaces, regardless of the length of the+list marker. That is, example lists always behave as if the+`four_space_rule` extension is set. This is because example+labels tend to be long, and indenting content to the+first non-space character after the label would be awkward.++You can repeat an earlier numbered example by re-using its label:++ (@foo) Sample sentence.++ Intervening text...++ This theory can explain the case we saw earlier (repeated):++ (@foo) Sample sentence.++This only works reliably, though, if the repeated item is in a list+by itself, because each numbered example list will be numbered+continuously from its starting number.++### Ending a list ###++What if you want to put an indented code block after a list?++ - item one+ - item two++ { my code block }++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.++To "cut off" the list after item two, you can insert some non-indented+content, like an HTML comment, which won't produce visible output in+any format:++ - item one+ - item two++ <!-- end of list -->++ { my code block }++You can use the same trick if you want two consecutive lists instead+of one big list:++ 1. one+ 2. two+ 3. three++ <!-- -->++ 1. uno+ 2. dos+ 3. tres++## Horizontal rules++A line containing a row of three or more `*`, `-`, or `_` characters+(optionally separated by spaces) produces a horizontal rule:++ * * * *++ ---------------++We strongly recommend that horizontal rules be separated from+surrounding text by blank lines. If a horizontal rule is not+followed by a blank line, pandoc may try to interpret the+lines that follow as a YAML metadata block or a table.++## Tables++Four kinds of tables may be used. The first three kinds presuppose the use of+a fixed-width font, such as Courier. The fourth kind can be used with+proportionally spaced fonts, as it does not require lining up columns.++### Extension: `table_captions` ###++A caption may optionally be provided with all 4 kinds of tables (as+illustrated in the examples below). A caption is a paragraph beginning+with the string `Table:` (or `table:` or just `:`), which will be stripped+off. It may appear either before or after the table.++### Extension: `simple_tables` ###++Simple tables look like this:++ Right Left Center Default+ ------- ------ ---------- -------+ 12 12 12 12+ 123 123 123 123+ 1 1 1 1++ Table: Demonstration of simple table syntax.++The header and table rows must each fit on one line. Column+alignments are determined by the position of the header text relative+to the dashed line below it:[^4]++ - If the dashed line is flush with the header text on the right side+ but extends beyond it on the left, the column is right-aligned.+ - If the dashed line is flush with the header text on the left side+ but extends beyond it on the right, the column is left-aligned.+ - If the dashed line extends beyond the header text on both sides,+ the column is centered.+ - If the dashed line is flush with the header text on both sides,+ the default alignment is used (in most cases, this will be left).++[^4]: This scheme is due to Michel Fortin, who proposed it on the+ [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).++The table must end with a blank line, or a line of dashes followed by+a blank line.++The column header row may be omitted, provided a dashed line is used+to end the table. For example:++ ------- ------ ---------- -------+ 12 12 12 12+ 123 123 123 123+ 1 1 1 1+ ------- ------ ---------- -------++When the header row is omitted, column alignments are determined on the basis+of the first line of the table body. So, in the tables above, the columns+would be right, left, center, and right aligned, respectively.++### Extension: `multiline_tables` ###++Multiline tables allow header and table rows to span multiple lines+of text (but cells that span multiple columns or rows of the table are+not supported). Here is an example:++ -------------------------------------------------------------+ Centered Default Right Left+ Header Aligned Aligned Aligned+ ----------- ------- --------------- -------------------------+ First row 12.0 Example of a row that+ spans multiple lines.++ Second row 5.0 Here's another one. Note+ the blank line between+ rows.+ -------------------------------------------------------------++ Table: Here's the caption. It, too, may span+ multiple lines.++These work like simple tables, but with the following differences:++ - They must begin with a row of dashes, before the header text+ (unless the header row is omitted).+ - They must end with a row of dashes, then a blank line.+ - The rows must be separated by blank lines.++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.++The header may be omitted in multiline tables as well as simple tables:++ ----------- ------- --------------- -------------------------+ First row 12.0 Example of a row that+ spans multiple lines.++ Second row 5.0 Here's another one. Note+ the blank line between+ rows.+ ----------- ------- --------------- -------------------------++ : Here's a multiline table without a header.++It is possible for a multiline table to have just one row, but the row+should be followed by a blank line (and then the row of dashes that ends+the table), or the table may be interpreted as a simple table.++### Extension: `grid_tables` ###++Grid tables look like this:++ : Sample grid table.++ +---------------+---------------+--------------------++ | Fruit | Price | Advantages |+ +===============+===============+====================++ | Bananas | $1.34 | - built-in wrapper |+ | | | - bright color |+ +---------------+---------------+--------------------++ | Oranges | $2.10 | - cures scurvy |+ | | | - tasty |+ +---------------+---------------+--------------------+++The row of `=`s separates the header from the table body,+and can be omitted for a headerless table. The cells of grid+tables may contain arbitrary block elements (multiple+paragraphs, code blocks, lists, etc.).++Cells can span multiple columns or rows:++ +---------------------+----------++ | Property | Earth |+ +=============+=======+==========++ | | min | -89.2 °C |+ | Temperature +-------+----------++ | 1961-1990 | mean | 14 °C |+ | +-------+----------++ | | max | 56.7 °C |+ +-------------+-------+----------+++A table header may contain more than one row:++ +---------------------+-----------------------++ | Location | Temperature 1961-1990 |+ | | in degree Celsius |+ | +-------+-------+-------++ | | min | mean | max |+ +=====================+=======+=======+=======++ | Antarctica | -89.2 | N/A | 19.8 |+ +---------------------+-------+-------+-------++ | Earth | -89.2 | 14 | 56.7 |+ +---------------------+-------+-------+-------+++Alignments can be specified as with pipe tables, by putting+colons at the boundaries of the separator line after the+header:++ +---------------+---------------+--------------------++ | Right | Left | Centered |+ +==============:+:==============+:==================:++ | Bananas | $1.34 | built-in wrapper |+ +---------------+---------------+--------------------+++For headerless tables, the colons go on the top line instead:++ +--------------:+:--------------+:------------------:++ | Right | Left | Centered |+ +---------------+---------------+--------------------+++A table foot can be defined by enclosing it with separator lines+that use `=` instead of `-`:++ +---------------+---------------++ | Fruit | Price |+ +===============+===============++ | Bananas | $1.34 |+ +---------------+---------------++ | Oranges | $2.10 |+ +===============+===============++ | Sum | $3.44 |+ +===============+===============+++The foot must always be placed at the very bottom of the table.++Grid tables can be created easily using Emacs' table-mode+(`M-x table-insert`).++### Extension: `pipe_tables` ###++Pipe tables look like this:++ | Right | Left | Default | Center |+ |------:|:-----|---------|:------:|+ | 12 | 12 | 12 | 12 |+ | 123 | 123 | 123 | 123 |+ | 1 | 1 | 1 | 1 |++ : Demonstration of pipe table syntax.++The syntax is identical to [PHP Markdown Extra tables]. The beginning and+ending pipe characters are optional, but pipes are required between all+columns. The colons indicate column alignment as shown. The header+cannot be omitted. To simulate a headerless table, include a header+with blank cells.++Since the pipes indicate column boundaries, columns need not be vertically+aligned, as they are in the above example. So, this is a perfectly+legal (though ugly) pipe table:++ fruit| price+ -----|-----:+ apple|2.05+ pear|1.37+ orange|3.09++The cells of pipe tables cannot contain block elements like paragraphs+and lists, and cannot span multiple lines. If any line of the+Markdown source is longer than the column width (see `--columns`),+then the table will take up the full text width and the cell+contents will wrap, with the relative cell widths determined by+the number of dashes in the line separating the table header+from the table body. (For example `---|-` would make the first column 3/4+and the second column 1/4 of the full text width.)+On the other hand, if no lines are wider than column width, then+cell contents will not be wrapped, and the cells will be sized+to their contents.++Note: pandoc also recognizes pipe tables of the following+form, as can be produced by Emacs' orgtbl-mode:++ | One | Two |+ |-----+-------|+ | my | table |+ | is | nice |++The difference is that `+` is used instead of `|`. Other orgtbl features+are not supported. In particular, to get non-default column alignment,+you'll need to add colons as above.++[PHP Markdown Extra tables]: https://michelf.ca/projects/php-markdown/extra/#table++### Extension: `table_attributes` ###++Attributes may be attached to tables by including them at the end+of the caption. (For the syntax, see+[`header_attributes`][Extension: `header_attributes`].)++ : Here's the caption. {#ident .class key="value"}++## Metadata blocks++### Extension: `pandoc_title_block` ###++If the file begins with a title block++ % title+ % author(s) (separated by semicolons)+ % date++it will be parsed as bibliographic information, not regular text. (It+will be used, for example, in the title of standalone LaTeX or HTML+output.) The block may contain just a title, a date and an author,+or all three elements. If you want to include an author but no+title, or a title and a date but no author, you need a blank line:++```+%+% Author+```++```+% My title+%+% June 15, 2006+```++The title may occupy multiple lines, but continuation lines must+begin with leading space, thus:++```+% My title+ on multiple lines+```++If a document has multiple authors, the authors may be put on+separate lines with leading space, or separated by semicolons, or+both. So, all of the following are equivalent:++```+% Author One+ Author Two+```++```+% Author One; Author Two+```++```+% Author One;+ Author Two+```++The date must fit on one line.++All three metadata fields may contain standard inline formatting+(italics, links, footnotes, etc.).++Title blocks will always be parsed, but they will affect the output only+when the `--standalone` (`-s`) option is chosen. In HTML output, titles+will appear twice: once in the document head---this is the title that+will appear at the top of the window in a browser---and once at the+beginning of the document body. The title in the document head can have+an optional prefix attached (`--title-prefix` or `-T` option). The title+in the body appears as an H1 element with class "title", so it can be+suppressed or reformatted with CSS. If a title prefix is specified with+`-T` and no title block appears in the document, the title prefix will+be used by itself as the HTML title.++The man page writer extracts a title, man page section number, and+other header and footer information from the title line. The title+is assumed to be the first word on the title line, which may optionally+end with a (single-digit) section number in parentheses. (There should+be no space between the title and the parentheses.) Anything after+this is assumed to be additional footer and header text. A single pipe+character (`|`) should be used to separate the footer text from the header+text. Thus,++ % PANDOC(1)++will yield a man page with the title `PANDOC` and section 1.++ % PANDOC(1) Pandoc User Manuals++will also have "Pandoc User Manuals" in the footer.++ % PANDOC(1) Pandoc User Manuals | Version 4.0++will also have "Version 4.0" in the header.++### Extension: `yaml_metadata_block` ###++A [YAML] metadata block is a valid YAML object, delimited by a line of three+hyphens (`---`) at the top and a line of three hyphens (`---`) or three dots+(`...`) at the bottom. The initial line `---` must not be followed by a blank+line. 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 JSON may be used as well, because JSON is a subset of YAML.)++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:++ pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html++Just be sure that the YAML file begins with `---` and ends with `---` or+`...`. Alternatively, you can use the `--metadata-file` option. Using+that approach however, you cannot reference content (like footnotes)+from the main Markdown input document.++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+with names ending in an underscore will be ignored by pandoc. (They may be+given a role by external processors.) Field names must not be+interpretable as YAML numbers or boolean values (so, for+example, `yes`, `True`, and `15` cannot be used as field names).++A document may contain multiple metadata blocks. If two+metadata blocks attempt to set the same field, the value from+the second block will be taken.++Each metadata block is handled internally as an independent YAML document.+This means, for example, that any YAML anchors defined in a block cannot be+referenced in another block.++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.++Note that [YAML] escaping rules must be followed. Thus, for example,+if a title contains a colon, it must be quoted, and if it contains a+backslash escape, then it must be ensured that it is not treated as a+[YAML escape sequence]. The pipe character (`|`) can be used to begin+an indented block that will be interpreted literally, without need for+escaping. This form is necessary when the field contains blank lines+or block-level formatting:++ ---+ title: 'This is the title: it contains a colon'+ author:+ - Author One+ - Author Two+ keywords: [nothing, nothingness]+ abstract: |+ This is the abstract.++ It consists of two paragraphs.+ ...++The literal block after the `|` must be indented relative to the+line containing the `|`. If it is not, the YAML will be invalid+and pandoc will not interpret it as metadata. For an overview+of the complex rules governing YAML, see the [Wikipedia entry on+YAML syntax].++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:++ <p>This is the abstract.</p>+ <p>It consists of two paragraphs.</p>++Variables can contain arbitrary YAML structures, but the template must match+this structure. The `author` variable in the default templates expects a+simple list or string, but can be changed to support more complicated+structures. The following combination, for example, would add an affiliation+to the author if one is given:++ ---+ title: The document title+ author:+ - name: Author One+ affiliation: University of Somewhere+ - name: Author Two+ affiliation: University of Nowhere+ ...++To use the structured authors in the example above, you would need a custom+template:++ $for(author)$+ $if(author.name)$+ $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$+ $else$+ $author$+ $endif$+ $endfor$++Raw content to include in the document's header may be specified+using `header-includes`; however, it is important to mark up+this content as raw code for a particular output format, using+the [`raw_attribute` extension](#extension-raw_attribute), or it+will be interpreted as Markdown. For example:++ header-includes:+ - |+ ```{=latex}+ \let\oldsection\section+ \renewcommand{\section}[1]{\clearpage\oldsection{#1}}+ ```++Note: the `yaml_metadata_block` extension works not just with+`markdown` but with `commonmark` (and it is enabled by default in+`gfm` and `commonmark_x`). However, in `commonmark`, `gfm`,+and `commonmark_x`, the following restrictions apply:++- The YAML metadata block must occur at the beginning of the+ document (and there can be only one). If multiple files are+ given as arguments to pandoc, only the first can be a YAML+ metadata block.++- The leaf nodes of the YAML structure are parsed in isolation from+ each other and from the rest of the document. So, for+ example, you can't use a reference link in these contexts+ if the link definition is somewhere else in the document.++[YAML escape sequence]: https://yaml.org/spec/1.2/spec.html#id2776092+[Wikipedia entry on YAML syntax]: https://en.wikipedia.org/wiki/YAML#Syntax++## Backslash escapes++### Extension: `all_symbols_escapable` ###++Except inside a code block or inline code, any punctuation or space+character preceded by a backslash will be treated literally, even if it+would normally indicate formatting. Thus, for example, if one writes++ *\*hello\**++one will get++ <em>*hello*</em>++instead of++ <strong>hello</strong>++This rule is easier to remember than original Markdown's rule,+which allows only the following characters to be backslash-escaped:++ \`*_{}[]()>#+-.!++(However, if the `markdown_strict` format is used, the original Markdown rule+will be used.)++A backslash-escaped space is parsed as a nonbreaking space. In TeX output,+it will appear as `~`. In HTML and XML output, it will appear as a+literal unicode nonbreaking space character (note that it will thus+actually look "invisible" in the generated HTML source; you can still+use the `--ascii` command-line option to make it appear as an explicit+entity).++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+two trailing spaces on a line.++Backslash escapes do not work in verbatim contexts.++## Inline formatting++### Emphasis ###++To *emphasize* some text, surround it with `*`s or `_`, like this:++ This text is _emphasized with underscores_, and this+ is *emphasized with asterisks*.++Double `*` or `_` produces **strong emphasis**:++ This is **strong emphasis** and __with underscores__.++A `*` or `_` character surrounded by spaces, or backslash-escaped,+will not trigger emphasis:++ This is * not emphasized *, and \*neither is this\*.++### Extension: `intraword_underscores` ###++Because `_` is sometimes used inside words and identifiers,+pandoc does not interpret a `_` surrounded by alphanumeric+characters as an emphasis marker. If you want to emphasize+just part of a word, use `*`:++ feas*ible*, not feas*able*.++### Strikeout ###++### Extension: `strikeout` ###++To strike out a section of text with a horizontal line, begin and end it+with `~~`. Thus, for example,++ This ~~is deleted text.~~+++### Superscripts and subscripts ###++### Extension: `superscript`, `subscript` ###++Superscripts may be written by surrounding the superscripted text by `^`+characters; subscripts may be written by surrounding the subscripted+text by `~` characters. Thus, for example,++ H~2~O is a liquid. 2^10^ is 1024.++The text between `^...^` or `~...~` may not contain spaces or+newlines. If the superscripted or subscripted text contains+spaces, these spaces must be escaped with backslashes. (This is+to prevent accidental superscripting and subscripting through+the ordinary use of `~` and `^`, and also bad interactions with+footnotes.) Thus, if you want the letter P with 'a cat' in+subscripts, use `P~a\ cat~`, not `P~a cat~`.++### Verbatim ###++To make a short span of text verbatim, put it inside backticks:++ What is the difference between `>>=` and `>>`?++If the verbatim text includes a backtick, use double backticks:++ Here is a literal backtick `` ` ``.++(The spaces after the opening backticks and before the closing+backticks will be ignored.)++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).++Note that backslash-escapes (and other Markdown constructs) do not+work in verbatim contexts:++ This is a backslash followed by an asterisk: `\*`.++### Extension: `inline_code_attributes` ###++Attributes can be attached to verbatim text, just as with+[fenced code blocks]:++ `<$>`{.haskell}++### Underline ###++To underline text, use the `underline` class:++ [Underline]{.underline}++Or, without the `bracketed_spans` extension (but with `native_spans`):++ <span class="underline">Underline</span>++This will work in all output formats that support underline.++### Small caps ###++To write small caps, use the `smallcaps` class:++ [Small caps]{.smallcaps}++Or, without the `bracketed_spans` extension:++ <span class="smallcaps">Small caps</span>++For compatibility with other Markdown flavors, CSS is also supported:++ <span style="font-variant:small-caps;">Small caps</span>++This will work in all output formats that support small caps.++### Highlighting ###++To highlight text, use the `mark` class:++ [Mark]{.mark}++Or, without the `bracketed_spans` extension (but with `native_spans`):++ <span class="mark">Mark</span>++This will work in all output formats that support highlighting.+++## Math++### Extension: `tex_math_dollars` ###++Anything between two `$` characters will be treated as TeX math. The+opening `$` must have a non-space character immediately to its right,+while the closing `$` must have a non-space character immediately to its+left, and must not be followed immediately by a digit. Thus,+`$20,000 and $30,000` won't parse as math. If for some reason+you need to enclose text in literal `$` characters, backslash-escape+them and they won't be treated as math delimiters.++For display math, use `$$` delimiters. (In this case, the delimiters+may be separated from the formula by whitespace. However, there can be+no blank lines between the opening and closing `$$` delimiters.)++TeX math will be printed in all output formats. How it is rendered+depends on the output format:++LaTeX+ ~ It will appear verbatim surrounded by `\(...\)` (for inline+ math) or `\[...\]` (for display math).++Markdown, Emacs Org mode, ConTeXt, ZimWiki+ ~ It will appear verbatim surrounded by `$...$` (for inline+ math) or `$$...$$` (for display math).++XWiki+ ~ It will appear verbatim surrounded by `{{formula}}..{{/formula}}`.++reStructuredText+ ~ It will be rendered using an [interpreted text role `:math:`].++AsciiDoc+ ~ For AsciiDoc output math will appear verbatim surrounded by+ `latexmath:[...]`. For `asciidoc_legacy` the bracketed+ material will also include inline or display math delimiters.++Texinfo+ ~ It will be rendered inside a `@math` command.++roff man, Jira markup+ ~ It will be rendered verbatim without `$`'s.++MediaWiki, DokuWiki+ ~ It will be rendered inside `<math>` tags.++Textile+ ~ It will be rendered inside `<span class="math">` tags.++RTF, OpenDocument+ ~ It will be rendered, if possible, using Unicode characters,+ and will otherwise appear verbatim.++ODT+ ~ It will be rendered, if possible, using MathML.++DocBook+ ~ If the `--mathml` flag is used, it will be rendered using MathML+ in an `inlineequation` or `informalequation` tag. Otherwise it+ will be rendered, if possible, using Unicode characters.++Docx and PowerPoint+ ~ It will be rendered using OMML math markup.++FictionBook2+ ~ If the `--webtex` option is used, formulas are rendered as images+ using CodeCogs or other compatible web service, downloaded+ and embedded in the e-book. Otherwise, they will appear verbatim.++HTML, Slidy, DZSlides, S5, EPUB+ ~ The way math is rendered in HTML will depend on the+ command-line options selected. Therefore see [Math rendering in HTML]+ above.++[interpreted text role `:math:`]: https://docutils.sourceforge.io/docs/ref/rst/roles.html#math++## Raw HTML++### Extension: `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+be disabled if desired.)++The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,+DZSlides, EPUB, Markdown, CommonMark, Emacs Org mode, and Textile+output, and suppressed in other formats.++For a more explicit way of including raw HTML in a Markdown+document, see the [`raw_attribute` extension][Extension: `raw_attribute`].++In the CommonMark format, if `raw_html` is enabled, superscripts,+subscripts, strikeouts and small capitals will be represented as HTML.+Otherwise, plain-text fallbacks will be used. Note that even if+`raw_html` is disabled, tables will be rendered with HTML syntax if+they cannot use pipe syntax.++### Extension: `markdown_in_html_blocks` ###++Original 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 (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++ <table>+ <tr>+ <td>*one*</td>+ <td>[a link](https://google.com)</td>+ </tr>+ </table>++into++ <table>+ <tr>+ <td><em>one</em></td>+ <td><a href="https://google.com">a link</a></td>+ </tr>+ </table>++whereas `Markdown.pl` will preserve it as is.++There is one exception to this rule: text between `<script>`,+`<style>`, `<pre>`, and `<textarea>` tags is not interpreted as Markdown.++This departure from original 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` ###++Use native pandoc `Div` blocks for content inside `<div>` tags.+For the most part this should give the same output as+`markdown_in_html_blocks`, but it makes it easier to write pandoc+filters to manipulate groups of blocks.++### Extension: `native_spans` ###++Use native pandoc `Span` blocks for content inside `<span>` tags.+For the most part this should give the same output as `raw_html`,+but it makes it easier to write pandoc filters to manipulate groups+of inlines.++### Extension: `raw_tex` ###++In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be+included in a document. Inline TeX commands will be preserved and passed+unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use+LaTeX to include BibTeX citations:++ This result was proved in \cite{jones.1967}.++Note that in LaTeX environments, like++ \begin{tabular}{|l|l|}\hline+ Age & Frequency \\ \hline+ 18--25 & 15 \\+ 26--35 & 33 \\+ 36--45 & 22 \\ \hline+ \end{tabular}++the material between the begin and end tags will be interpreted as raw+LaTeX, not as Markdown.++For a more explicit and flexible way of including raw TeX in a+Markdown document, see the [`raw_attribute`+extension][Extension: `raw_attribute`].++Inline LaTeX is ignored in output formats other than Markdown, LaTeX,+Emacs Org mode, and ConTeXt.++### Generic raw attribute ###++### Extension: `raw_attribute` ###++Inline spans and fenced code blocks with a special+kind of attribute will be parsed as raw content with the+designated format. For example, the following produces a raw+roff `ms` block:++ ```{=ms}+ .MYMACRO+ blah blah+ ```+And the following produces a raw `html` inline element:++ This is `<a>html</a>`{=html}++This can be useful to insert raw xml into `docx` documents, e.g.+a pagebreak:++ ```{=openxml}+ <w:p>+ <w:r>+ <w:br w:type="page"/>+ </w:r>+ </w:p>+ ```++The format name should match the target format name (see+`-t/--to`, above, for a list, or use `pandoc+--list-output-formats`). Use `openxml` for `docx` output,+`opendocument` for `odt` output, `html5` for `epub3` output,+`html4` for `epub2` output, and `latex`, `beamer`,+`ms`, or `html5` for `pdf` output (depending on what you+use for `--pdf-engine`).++This extension presupposes that the relevant kind of+inline code or fenced code block is enabled. Thus, for+example, to use a raw attribute with a backtick code block,+`backtick_code_blocks` must be enabled.++The raw attribute cannot be combined with regular attributes.++## LaTeX macros++### Extension: `latex_macros` ###++When this extension is enabled, pandoc will parse LaTeX+macro definitions and apply the resulting macros to all LaTeX+math and raw LaTeX. So, for example, the following will work in+all output formats, not just LaTeX:++ \newcommand{\tuple}[1]{\langle #1 \rangle}++ $\tuple{a, b, c}$++Note that LaTeX macros will not be applied if they occur+inside a raw span or block marked with the+[`raw_attribute` extension](#extension-raw_attribute).++When `latex_macros` is disabled, the raw LaTeX and math will+not have macros applied. This is usually a better approach when+you are targeting LaTeX or PDF.++Macro definitions in LaTeX will be passed through as raw LaTeX+only if `latex_macros` is not enabled. Macro definitions in+Markdown source (or other formats allowing `raw_tex`) will+be passed through regardless of whether `latex_macros` is+enabled.++## Links++Markdown allows links to be specified in several ways.++### Automatic links ###++If you enclose a URL or email address in pointy brackets, it+will become a link:++ <https://google.com>+ <sam@green.eggs.ham>++### Inline links ###++An inline link consists of the link text in square brackets,+followed by the URL in parentheses. (Optionally, the URL can+be followed by a link title, in quotes.)++ This is an [inline link](/url), and here's [one with+ a title](https://fsf.org "click here for a good time!").++There can be no space between the bracketed part and the parenthesized part.+The link text can contain formatting (such as emphasis), but the title cannot.++Email addresses in inline links are not autodetected, so they have to be+prefixed with `mailto`:++ [Write me!](mailto:sam@green.eggs.ham)++### Reference links ###++An *explicit* reference link has two parts, the link itself and the link+definition, which may occur elsewhere in the document (either+before or after the link).++The link consists of link text in square brackets, followed by a label in+square brackets. (There cannot be space between the two unless the+`spaced_reference_links` extension is enabled.) If the label is empty+(`[]`), then it will be implicitly be taken to be the same as the link text;+thus `[foo][]` is equivalent to `[foo][foo]`. (If the+`shortcut_reference_links` extension is enabled, the empty `[]`+may be omitted.)++The link definition consists of the bracketed label, followed by+a colon and a space, followed by the URL, and optionally (after a+space) a link title either in quotes or in parentheses. The label+must not be parseable as a citation (assuming the `citations`+extension is enabled): citations take precedence over link+labels.++Here are some examples of reference links and link definitions;++ See [the website *I* built][my website].++ See [my website][] and [the bar page][1] and+ the [home page of the FSF][fsf].++ [my website]: http://foo.bar.baz+ [1]: /foo/bar.html "My title, optional"+ [fsf]: https://fsf.org (The Free Software Foundation)+ [special page]: /bar#special 'A title in single quotes'++The URL in a link definition may optionally be surrounded by+angle brackets:++ [my label 5]: <http://foo.bar.baz>++The title may go on the next line:++ [my label 3]: https://fsf.org+ "The Free Software Foundation"++Note that link labels are not case sensitive. So, this will work:++ Here is [my link][FOO]++ [Foo]: /bar/baz++The link definition may come either before or after a+reference link that uses the label.++Note: In some 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 not in+all implementations:++ > My block [quote].+ >+ > [quote]: /foo++### Extension: `shortcut_reference_links` ###++In a *shortcut* reference link, the second pair of brackets may+be omitted entirely:++ See [my website].++ [my website]: http://foo.bar.baz++### Internal links ###++To link to another section of the same document, use the automatically+generated identifier (see [Heading identifiers]). For example:++ See the [Introduction](#introduction).++or++ See the [Introduction].++ [Introduction]: #introduction++Internal links are currently supported for HTML formats (including+HTML slide shows and EPUB), LaTeX, and ConTeXt.++## Images++A link immediately preceded by a `!` will be treated as an image.+The link text will be used as the image's alt text:++ ++ ![movie reel]++ [movie reel]: movie.gif++### Extension: `implicit_figures` ###++An image with nonempty alt text, occurring by itself in a+paragraph, will be rendered as a figure with a caption. The+image's description will be used as the caption.++ ++How this is rendered depends on the output format. Some output+formats (e.g. RTF) do not yet support figures. In those+formats, you'll just get an image in a paragraph by itself, with+no caption.++If you just want a regular inline image, just make sure it is not+the only thing in the paragraph. One way to do this is to insert a+nonbreaking space after the image:++ \++Note that in reveal.js slide shows, an image in a paragraph+by itself that has the `r-stretch` class will fill the screen,+and the caption and figure tags will be omitted.++To specify an alt text for the image that is different+from the caption, you can use an explicit attribute (assuming the+`link_attributes` extension is set):++ {alt="description of image"}++For LaTeX output, you can specify a [figure's+positioning](https://www.overleaf.com/learn/latex/Positioning_images_and_tables#The_figure_environment)+by adding the `latex-placement` attribute.++ {latex-placement="ht"}++### Extension: `link_attributes` ###++Attributes can be set on links and images:++ An inline {#id .class width=30 height=20px}+ and a reference ![image][ref] with attributes.++ [ref]: foo.jpg "optional title" {#id .class key=val key2="val 2"}++(This syntax is compatible with [PHP Markdown Extra] when only `#id`+and `.class` are used.)++For HTML and EPUB, all known HTML5 attributes except `width` and+`height` (but including `srcset` and `sizes`) are passed through+as is. Unknown attributes are passed through as custom+attributes, with `data-` prepended. The other writers ignore+attributes that are not specifically supported by their output format.++The `width` and `height` attributes on images are treated specially. When+used without a unit, the unit is assumed to be pixels. However, any of+the following unit identifiers can be used: `px`, `cm`, `mm`, `in`, `inch`+and `%`. There must not be any spaces between the number and the unit.+For example:++```+{ width=50% }+```++- Dimensions may be converted to a form that is compatible with+ the output format (for example, dimensions given in pixels will+ be converted to inches when converting HTML to LaTeX). Conversion+ between pixels and physical measurements is affected by the+ `--dpi` option (by default, 96 dpi is assumed, unless the image+ itself contains dpi information).+- The `%` unit is generally relative to some available space.+ For example the above example will render to the following.+ - HTML: `<img href="file.jpg" style="width: 50%;" />`+ - LaTeX: `\includegraphics[width=0.5\textwidth,height=\textheight]{file.jpg}`+ (If you're using a custom template, you need to configure `graphicx`+ as in the default template.)+ - ConTeXt: `\externalfigure[file.jpg][width=0.5\textwidth]`+- Some output formats have a notion of a class+ ([ConTeXt](https://wiki.contextgarden.net/Using_Graphics#Multiple_Image_Settings))+ or a unique identifier (LaTeX `\caption`), or both (HTML).+- When no `width` or `height` attributes are specified, the fallback+ is to look at the image resolution and the dpi metadata embedded in+ the image file.++## Divs and Spans++Using the `native_divs` and `native_spans` extensions+(see [above][Extension: `native_divs`]), HTML syntax can+be used as part of Markdown to create native `Div` and `Span`+elements in the pandoc AST (as opposed to raw HTML).+However, there is also nicer syntax available:++### Extension: `fenced_divs` ###++Allow special fenced syntax for native `Div` blocks. A Div+starts with a fence containing at least three consecutive+colons plus some attributes. The attributes may optionally+be followed by another string of consecutive colons.++Note: the `commonmark` parser doesn't permit colons after+the attributes.++The attribute syntax is exactly as in fenced code blocks (see+[Extension: `fenced_code_attributes`]). As with fenced+code blocks, one can use either attributes in curly braces+or a single unbraced word, which will be treated as a class+name. The Div ends with another line containing a string of at+least three consecutive colons. The fenced Div should be+separated by blank lines from preceding and following blocks.++Example:++ ::::: {#special .sidebar}+ Here is a paragraph.++ And another.+ :::::++Fenced divs can be nested. Opening fences are distinguished+because they *must* have attributes:++ ::: Warning ::::::+ This is a warning.++ ::: Danger+ This is a warning within a warning.+ :::+ ::::::::::::::::::++Fences without attributes are always closing fences. Unlike+with fenced code blocks, the number of colons in the closing+fence need not match the number in the opening fence. However,+it can be helpful for visual clarity to use fences of different+lengths to distinguish nested divs from their parents.+++### Extension: `bracketed_spans` ###++A bracketed sequence of inlines, as one would use to begin+a link, will be treated as a `Span` with attributes if it is+followed immediately by attributes:++ [This is *some text*]{.class key="val"}++## Footnotes++### Extension: `footnotes` ###++Pandoc's Markdown allows footnotes, using the following syntax:++ Here is a footnote reference,[^1] and another.[^longnote]++ [^1]: Here is the footnote.++ [^longnote]: Here's one with multiple blocks.++ Subsequent paragraphs are indented to show that they+ belong to the previous footnote.++ { some.code }++ The whole paragraph can be indented, or just the first+ line. In this way, multi-paragraph footnotes work like+ multi-paragraph list items.++ This paragraph won't be part of the note, because it+ isn't indented.++The identifiers in footnote references may not contain spaces, tabs,+newlines, or the characters `^`, `[`, or `]`. These identifiers+are used only to correlate the footnote reference with the note+itself; in the output, footnotes will be numbered sequentially.++The footnotes themselves need not be placed at the end of the+document. They may appear anywhere except inside other block elements+(lists, block quotes, tables, etc.). Each footnote should be+separated from surrounding content (including other footnotes)+by blank lines.++### Extension: `inline_notes` ###++Inline footnotes are also allowed (though, unlike regular notes,+they cannot contain multiple paragraphs). The syntax is as follows:++ Here is an inline note.^[Inline notes are easier to write, since+ you don't have to pick an identifier and move down to type the+ note.]++Inline and regular footnotes may be mixed freely.++## Citation syntax++### Extension: `citations` ###++To cite a bibliographic item with an identifier foo, use the+syntax `@foo`. Normal citations should be included in square+brackets, with semicolons separating distinct items:++ Blah blah [@doe99; @smith2000; @smith2004].++How this is rendered depends on the citation style. In an+author-date style, it might render as++ Blah blah (Doe 1999, Smith 2000, 2004).++In a footnote style, it might render as++ Blah blah.[^1]++ [^1]: John Doe, "Frogs," *Journal of Amphibians* 44 (1999);+ Susan Smith, "Flies," *Journal of Insects* (2000);+ Susan Smith, "Bees," *Journal of Insects* (2004).++See the [CSL user documentation] for more information about CSL+styles and how they affect rendering.++Unless a citation key starts with a letter, digit, or `_`,+and contains only alphanumerics and single internal punctuation+characters (`:.#$%&-+?<>~/`), it must be surrounded+by curly braces, which are not considered part of the key.+In `@Foo_bar.baz.`, the key is `Foo_bar.baz` because the final+period is not *internal* punctuation, so it is not included in+the key. In `@{Foo_bar.baz.}`, the key is `Foo_bar.baz.`, including+the final period.+In `@Foo_bar--baz`, the key is `Foo_bar` because the repeated internal+punctuation characters terminate the key.+The curly braces are recommended if you use URLs as+keys: `[@{https://example.com/bib?name=foobar&date=2000}, p. 33]`.++Citation items may optionally include a prefix, a locator, and+a suffix. In++ Blah blah [see @doe99, pp. 33-35 and *passim*; @smith04, chap. 1].++the first item (`doe99`) has prefix `see `, locator `pp. 33-35`,+and suffix `and *passim*`. The second item (`smith04`) has+locator `chap. 1` and no prefix or suffix.++Pandoc uses some heuristics to separate the locator from the+rest of the subject. It is sensitive to the locator terms+defined in the [CSL locale files]. Either abbreviated or+unabbreviated forms are accepted. In the `en-US` locale, locator+terms can be written in either singular or plural forms, as+`book`, `bk.`/`bks.`; `chapter`, `chap.`/`chaps.`; `column`,+`col.`/`cols.`; `figure`, `fig.`/`figs.`; `folio`,+`fol.`/`fols.`; `number`, `no.`/`nos.`; `line`, `l.`/`ll.`;+`note`, `n.`/`nn.`; `opus`, `op.`/`opp.`; `page`, `p.`/`pp.`;+`paragraph`, `para.`/`paras.`; `part`, `pt.`/`pts.`; `section`,+`sec.`/`secs.`; `sub verbo`, `s.v.`/`s.vv.`; `verse`,+`v.`/`vv.`; `volume`, `vol.`/`vols.`; `¶`/`¶¶`; `§`/`§§`. If no+locator term is used, "page" is assumed.++In complex cases, you can force something to be treated as+a locator by enclosing it in curly braces or prevent parsing+the suffix as locator by prepending curly braces:++ [@smith{ii, A, D-Z}, with a suffix]+ [@smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]+ [@smith{}, 99 years later]++A minus sign (`-`) before the `@` will suppress mention of+the author in the citation. This can be useful when the+author is already mentioned in the text:++ Smith says blah [-@smith04].++You can also write an author-in-text citation, by omitting the+square brackets:++ @smith04 says blah.++ @smith04 [p. 33] says blah.++This will cause the author's name to be rendered, followed by+the bibliographical details. Use this form when you want to+make the citation the subject of a sentence.++When you are using a note style, it is usually better to let+citeproc create the footnotes from citations rather than writing+an explicit note. If you do write an explicit note that+contains a citation, note that normal citations will be put in+parentheses, while author-in-text citations will not. For+this reason, it is sometimes preferable to use the+author-in-text style inside notes when using a note style.++Many CSL styles will format citations differently when the+same source has been cited earlier. In documents with chapters,+it is usually desirable to reset this position information+at the beginning of every chapter. To do this, add the class+`reset-citation-positions` to the heading for each chapter:++ # The Beginning {.reset-citation-positions}++Note that this class only has an effect when placed on+top-level headings; it is ignored in nested blocks.++[CSL user documentation]: https://citationstyles.org/authors/+[CSL]: https://docs.citationstyles.org/en/stable/specification.html+[CSL markup specs]: https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html#html-like-formatting-tags+[Chicago Manual of Style]: https://chicagomanualofstyle.org+[Citation Style Language]: https://citationstyles.org+[Zotero Style Repository]: https://www.zotero.org/styles+[finding and editing styles]: https://citationstyles.org/authors/+[CSL locale files]: https://github.com/citation-style-language/locales++## Non-default extensions++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.++### Extension: `rebase_relative_paths` ###++Rewrite relative paths for Markdown links and images, depending+on the path of the file containing the link or image link. For+each link or image, pandoc will compute the directory of the+containing file, relative to the working directory, and prepend+the resulting path to the link or image path.++The use of this extension is best understood by example.+Suppose you have a subdirectory for each chapter of a book,+`chap1`, `chap2`, `chap3`. Each contains a file `text.md` and a+number of images used in the chapter. You would like to have+`` in `chap1/text.md` refer to+`chap1/spider.jpg` and `` in `chap2/text.md`+refer to `chap2/spider.jpg`. To do this, use++ pandoc chap*/*.md -f markdown+rebase_relative_paths++Without this extension, you would have to use+`` in `chap1/text.md` and+`` in `chap2/text.md`. Links with+relative paths will be rewritten in the same way as images.++Absolute paths and URLs are not changed. Neither are empty+paths or paths consisting entirely of a fragment, e.g., `#foo`.++Note that relative paths in reference links and images will+be rewritten relative to the file containing the link+reference definition, not the file containing the reference link+or image itself, if these differ.++### Extension: `mark` ###++To highlight out a section of text, begin and end it with+with `==`. Thus, for example,++ This ==is deleted text.==++### Extension: `attributes` ###++Allows attributes to be attached to any inline or block-level+element when parsing `commonmark`.+The syntax for the attributes is the same as that+used in [`header_attributes`][Extension: `header_attributes`].++- Attributes that occur immediately after an inline+ element affect that element. If they follow a space, then they+ belong to the space. (Hence, this option subsumes+ `inline_code_attributes` and `link_attributes`.)+- Attributes that occur immediately before a block+ element, on a line by themselves, affect that+ element.+- Consecutive attribute specifiers may be used,+ either for blocks or for inlines. Their attributes+ will be combined.+- Attributes that occur at the end of the text of+ a Setext or ATX heading (separated by whitespace+ from the text) affect the heading element. (Hence, this+ option subsumes `header_attributes`.)+- Attributes that occur after the opening fence+ in a fenced code block affect the code block element. (Hence,+ this option subsumes `fenced_code_attributes`.)+- Attributes that occur at the end of a reference+ link definition affect links that refer to that+ definition.++Note that pandoc's AST does not currently allow attributes+to be attached to arbitrary elements. Hence a Span or Div+container will be added if needed.++### Extension: `old_dashes` ###++Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:+`-` before a numeral is an en-dash, and `--` is an em-dash.+This option only has an effect if `smart` is enabled. It is+selected automatically for `textile` input.++### Extension: `angle_brackets_escapable` ###++Allow `<` and `>` to be backslash-escaped, as they can be in+GitHub flavored Markdown but not original Markdown. This is+implied by pandoc's default `all_symbols_escapable`.++### Extension: `lists_without_preceding_blankline` ###++Allow a list to occur right after a paragraph, with no intervening+blank space.++### Extension: `four_space_rule` ###++Selects the pandoc <= 2.0 behavior for parsing lists, so that+four spaces indent are needed for list item continuation+paragraphs.++### Extension: `spaced_reference_links` ###++Allow whitespace between the two components of a reference link,+for example,++ [foo] [bar].++### Extension: `hard_line_breaks` ###++Causes all newlines within a paragraph to be interpreted as hard line+breaks instead of spaces.++### Extension: `ignore_line_breaks` ###++Causes newlines within a paragraph to be ignored, rather than being+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: `east_asian_line_breaks` ###++Causes newlines within a paragraph to be ignored, rather than+being treated as spaces or as hard line breaks, when they occur+between two East Asian wide characters. This is a better choice+than `ignore_line_breaks` for texts that include a mix of East+Asian wide characters and other characters.++### Extension: `emoji` ###++Parses textual emojis like `:smile:` as Unicode emoticons.++### Extension: `tex_math_gfm` ###++Supports two GitHub-specific formats for math.+Inline math: ``$`e=mc^2`$``.++Display math:++````+``` math+e=mc^2+```+````++### Extension: `tex_math_single_backslash` ###++Causes anything between `\(` and `\)` to be interpreted as inline+TeX math, and anything between `\[` and `\]` to be interpreted+as display TeX math. Note: a drawback of this extension is that+it precludes escaping `(` and `[`.++### Extension: `tex_math_double_backslash` ###++Causes anything between `\\(` and `\\)` to be interpreted as inline+TeX math, and anything between `\\[` and `\\]` to be interpreted+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+inside block-level tags if the tags have the attribute `markdown=1`.++### Extension: `mmd_title_block` ###++Enables a [MultiMarkdown] style title block at the top of+the document, for example:++ Title: My title+ Author: John Doe+ Date: September 1, 2008+ Comment: This is a sample mmd title block, with+ a field spanning multiple lines.++See the MultiMarkdown documentation for details. If `pandoc_title_block` or+`yaml_metadata_block` is enabled, it will take precedence over+`mmd_title_block`.++### Extension: `abbreviations` ###++Parses PHP Markdown Extra abbreviation keys, like++ *[HTML]: Hypertext Markup Language++Note that the pandoc document model does not support+abbreviations, so if this extension is enabled, abbreviation keys are+simply skipped (as opposed to being parsed as paragraphs).++### Extension: `alerts` ###++Supports [GitHub-style Markdown alerts], like++ > [!TIP]+ > Helpful advice for doing things better or more easily.++ [GitHub-style Markdown alerts]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts++### Extension: `autolink_bare_uris` ###++Makes all absolute URIs into links, even when not surrounded by+pointy braces `<...>`.++### Extension: `mmd_link_attributes` ###++Parses MultiMarkdown-style key-value attributes on link+and image references. This extension should not be confused with the+[`link_attributes`](#extension-link_attributes) extension.++ This is a reference ![image][ref] with MultiMarkdown attributes.++ [ref]: https://path.to/image "Image title" width=20px height=30px+ id=myId class="myClass1 myClass2"++### Extension: `mmd_header_identifiers` ###++Parses MultiMarkdown-style heading identifiers (in square brackets,+after the heading but before any trailing `#`s in an ATX heading).++### Extension: `gutenberg` ###++Use [Project Gutenberg] conventions for `plain` output:+all-caps for strong emphasis, surround by underscores+for regular emphasis, add extra blank space around headings.++ [Project Gutenberg]: https://www.gutenberg.org++### Extension: `sourcepos` ###++Include source position attributes when parsing `commonmark`.+For elements that accept attributes, a `data-pos` attribute+is added; other elements are placed in a surrounding+Div or Span element with a `data-pos` attribute.++### Extension: `short_subsuperscripts` ###++Parse MultiMarkdown-style subscripts and superscripts, which start with+a '~' or '^' character, respectively, and include the alphanumeric sequence+that follows. For example:++ x^2 = 4++or++ Oxygen is O~2.++### Extension: `wikilinks_title_after_pipe` ###++Pandoc supports multiple Markdown wikilink syntaxes, regardless of+whether the title is before or after the pipe.++Using `--from=markdown+wikilinks_title_after_pipe` results in+```[[Wiki]]+[[URL|title]]+```++while using `--from=markdown+wikilinks_title_before_pipe` results+in+```[[Wiki]]+[[title|URL]]+```++## Markdown variants++In addition to pandoc's extended Markdown, the following Markdown+variants are supported:++- `markdown_phpextra` (PHP Markdown Extra)+- `markdown_github` (deprecated GitHub-Flavored Markdown)+- `markdown_mmd` (MultiMarkdown)+- `markdown_strict` (Markdown.pl)+- `commonmark` (CommonMark)+- `gfm` (Github-Flavored Markdown)+- `commonmark_x` (CommonMark with many pandoc extensions)++To see which extensions are supported for a given format,+and which are enabled by default, you can use the command++ pandoc --list-extensions=FORMAT++where `FORMAT` is replaced with the name of the format.++Note that the list of extensions for `commonmark`,+`gfm`, and `commonmark_x` are defined relative to default+commonmark. So, for example, `backtick_code_blocks`+does not appear as an extension, since it is enabled by+default and cannot be disabled.++# Citations++When the `--citeproc` option is used, pandoc can automatically generate+citations and a bibliography in a number of styles. Basic usage is++ pandoc --citeproc myinput.txt++To use this feature, you will need to have++- a document containing citations (see [Citation syntax]);+- a source of bibliographic data: either an external bibliography+ file or a list of `references` in the document's YAML metadata;+- optionally, a [CSL] citation style.++## Specifying bibliographic data++You can specify an external bibliography using the+`bibliography` metadata field in a YAML metadata section or the+`--bibliography` command line argument. If you want to use+multiple bibliography files, you can supply multiple+`--bibliography` arguments or set `bibliography` metadata field+to YAML array. A bibliography may have any of these formats:++ Format File extension+ ------------ --------------+ BibLaTeX .bib+ BibTeX .bibtex+ CSL JSON .json+ CSL YAML .yaml+ RIS .ris++Note that `.bib` can be used with both BibTeX and BibLaTeX files;+use the extension `.bibtex` to force interpretation as BibTeX.++In BibTeX and BibLaTeX databases, pandoc parses LaTeX markup+inside fields such as `title`; in CSL YAML databases, pandoc+Markdown; and in CSL JSON databases, an [HTML-like markup][CSL+markup specs]:++`<i>...</i>`+: italics++`<b>...</b>`+: bold++`<span style="font-variant:small-caps;">...</span>` or `<sc>...</sc>`+: small capitals++`<sub>...</sub>`+: subscript++`<sup>...</sup>`+: superscript++`<span class="nocase">...</span>`+: prevent a phrase from being capitalized as title case++As an alternative to specifying a bibliography file using+`--bibliography` or the YAML metadata field `bibliography`, you+can include the citation data directly in the `references` field+of the document's YAML metadata. The field should contain an+array of YAML-encoded references, for example:++ ---+ references:+ - type: article-journal+ id: WatsonCrick1953+ author:+ - family: Watson+ given: J. D.+ - family: Crick+ given: F. H. C.+ issued:+ date-parts:+ - - 1953+ - 4+ - 25+ title: 'Molecular structure of nucleic acids: a structure for+ deoxyribose nucleic acid'+ title-short: Molecular structure of nucleic acids+ container-title: Nature+ volume: 171+ issue: 4356+ page: 737-738+ DOI: 10.1038/171737a0+ URL: https://www.nature.com/articles/171737a0+ language: en-GB+ ...++If both an external bibliography and inline (YAML metadata)+references are provided, both will be used. In case of+conflicting `id`s, the inline references will take precedence.++Note that pandoc can be used to produce such a YAML metadata+section from a BibTeX, BibLaTeX, or CSL JSON bibliography:++ pandoc chem.bib -s -f biblatex -t markdown+ pandoc chem.json -s -f csljson -t markdown++Indeed, pandoc can convert between any of these+citation formats:++ pandoc chem.bib -s -f biblatex -t csljson+ pandoc chem.yaml -s -f markdown -t biblatex++Running pandoc on a bibliography file with the `--citeproc`+option will create a formatted bibliography in the format+of your choice:++ pandoc chem.bib -s --citeproc -o chem.html+ pandoc chem.bib -s --citeproc -o chem.pdf++### Capitalization in titles++If you are using a bibtex or biblatex bibliography, then observe+the following rules:++ - English titles should be in title case. Non-English titles should+ be in sentence case, and the `langid` field in biblatex should be+ set to the relevant language. (The following values are treated+ as English: `american`, `british`, `canadian`, `english`,+ `australian`, `newzealand`, `USenglish`, or `UKenglish`.)++ - As is standard with bibtex/biblatex, proper names should be+ protected with curly braces so that they won't be lowercased+ in styles that call for sentence case. For example:++ title = {My Dinner with {Andre}}++ - In addition, words that should remain lowercase (or camelCase)+ should be protected:++ title = {Spin Wave Dispersion on the {nm} Scale}++ Though this is not necessary in bibtex/biblatex, it is necessary+ with citeproc, which stores titles internally in sentence case,+ and converts to title case in styles that require it. Here we+ protect "nm" so that it doesn't get converted to "Nm" at this stage.++If you are using a CSL bibliography (either JSON or YAML), then observe+the following rules:++ - All titles should be in sentence case.++ - Use the `language` field for non-English titles to prevent their+ conversion to title case in styles that call for this. (Conversion+ happens only if `language` begins with `en` or is left empty.)++ - Protect words that should not be converted to title case using+ this syntax:++ Spin wave dispersion on the <span class="nocase">nm</span> scale++### Conference Papers, Published vs. Unpublished++For a formally published conference paper, use the biblatex entry type+`inproceedings` (which will be mapped to CSL `paper-conference`).++For an unpublished manuscript, use the biblatex entry type+`unpublished` without an `eventtitle` field (this entry type+will be mapped to CSL `manuscript`).++For a talk, an unpublished conference paper, or a poster+presentation, use the biblatex entry type `unpublished` with an+`eventtitle` field (this entry type will be mapped to CSL+`speech`). Use the biblatex `type` field to indicate the type,+e.g. "Paper", or "Poster". `venue` and `eventdate` may be useful+too, though `eventdate` will not be rendered by most CSL styles.+Note that `venue` is for the event's venue, unlike `location`+which describes the publisher's location; do not use the latter+for an unpublished conference paper.+++## Specifying a citation style++Citations and references can be formatted using any style supported by the+[Citation Style Language], listed in the [Zotero Style Repository].+These files are specified using the `--csl` option or the `csl`+(or `citation-style`) metadata field. By default, pandoc will+use the [Chicago Manual of Style] author-date format. (You can+override this default by copying a CSL style of your choice+to `default.csl` in your user data directory.)+The CSL project provides further information on [finding and+editing styles].++The `--citation-abbreviations` option (or the+`citation-abbreviations` metadata field) may be used to specify+a JSON file containing abbreviations of journals that should be+used in formatted bibliographies when `form="short"` is+specified. The format of the file can be illustrated with an+example:+++ { "default": {+ "container-title": {+ "Lloyd's Law Reports": "Lloyd's Rep",+ "Estates Gazette": "EG",+ "Scots Law Times": "SLT"+ }+ }+ }+++## Citations in note styles++Pandoc's citation processing is designed to allow you to+move between author-date, numerical, and note styles without+modifying the Markdown source. When you're using a note+style, avoid inserting footnotes manually. Instead, insert+citations just as you would in an author-date style---for+example,++ Blah blah [@foo, p. 33].++The footnote will be created automatically. Pandoc will take+care of removing the space and moving the note before or+after the period, depending on the setting of+`notes-after-punctuation`, as described below in [Other relevant+metadata fields].++In some cases you may need to put a citation inside a regular+footnote. Normal citations in footnotes (such as `[@foo, p.+33]`) will be rendered in parentheses. In-text citations (such+as `@foo [p. 33]`) will be rendered without parentheses. (A+comma will be added if appropriate.) Thus:++ [^1]: Some studies [@foo; @bar, p. 33] show that+ frubulicious zoosnaps are quantical. For a survey+ of the literature, see @baz [chap. 1].+++## Placement of the bibliography++If the style calls for a list of works cited, it will be placed+in a div with id `refs`, if one exists:[^note-on-refs]++ ::: {#refs}+ :::++Otherwise, it will be placed at the end of the document.+Generation of the bibliography can be suppressed by setting+`suppress-bibliography: true` in the YAML metadata.++[^note-on-refs]:+ Note that if `--file-scope` is used, a div written this way will be+ given an identifier of the form `FILE__refs`, to avoid duplicate+ identifiers (see `--file-scope`). In view of this possibility,+ pandoc will place the bibliography in any div whose identifier is+ `refs` *or* ends with `__refs`.++If you wish the bibliography to have a section heading, you can+set `reference-section-title` in the metadata, or put the heading+at the beginning of the div with id `refs` (if you are using it)+or at the end of your document:++ last paragraph...++ # References++The bibliography will be inserted after this heading. Note that+the `unnumbered` class will be added to this heading, so that the+section will not be numbered.++If you want to put the bibliography into a variable in your+template, one way to do that is to put the div with id `refs`+into a metadata field, e.g.++ ---+ refs: |+ ::: {#refs}+ :::+ ...++You can then put the variable `$refs$` into your template where+you want the bibliography to be placed.++## Including uncited items in the bibliography++If you want to include items in the bibliography without actually+citing them in the body text, you can define a dummy `nocite` metadata+field and put the citations there:++ ---+ nocite: |+ @item1, @item2+ ...++ @item3++In this example, the document will contain a citation for `item3`+only, but the bibliography will contain entries for `item1`, `item2`, and+`item3`.++It is possible to create a bibliography with all the citations,+whether or not they appear in the document, by using a wildcard:++ ---+ nocite: |+ @*+ ...++For LaTeX output, you can also use [`natbib`] or [`biblatex`] to+render the bibliography. In order to do so, specify bibliography+files as outlined above, and add `--natbib` or `--biblatex`+argument to pandoc invocation. Bear in mind that bibliography+files have to be in either BibTeX (for `--natbib`)+or BibLaTeX (for `--biblatex`) format.++## Other relevant metadata fields++A few other metadata fields affect bibliography formatting:++`link-citations`+: If true, citations will be hyperlinked to the+ corresponding bibliography entries (for author-date and+ numerical styles only). Defaults to false.++`link-bibliography`+: If true, DOIs, PMCIDs, PMID, and URLs in bibliographies will+ be rendered as hyperlinks. (If an entry contains a DOI, PMCID,+ PMID, or URL, but none of these fields are rendered by the style,+ then the title, or in the absence of a title the whole entry, will+ be hyperlinked.) Defaults to true.++`lang`+: The `lang` field will affect how the style is localized,+ for example in the translation of labels, the use+ of quotation marks, and the way items are sorted.+ (For backwards compatibility, `locale` may be used instead+ of `lang`, but this use is deprecated.)++ A BCP 47 language tag is expected: for example, `en`,+ `de`, `en-US`, `fr-CA`, `ug-Cyrl`. The unicode extension+ syntax (after `-u-`) may be used to specify options for+ collation (sorting) more precisely. Here are some examples:++ - `zh-u-co-pinyin`: Chinese with the Pinyin collation.+ - `es-u-co-trad`: Spanish with the traditional collation+ (with `Ch` sorting after `C`).+ - `fr-u-kb`: French with "backwards" accent sorting+ (with `coté` sorting after `côte`).+ - `en-US-u-kf-upper`: English with uppercase letters sorting+ before lower (default is lower before upper).++`notes-after-punctuation`+: If true (the default for note styles), pandoc will put+ footnote references or superscripted numerical citations+ after following punctuation. For example, if the source+ contains `blah blah [@jones99].`, the result will look like+ `blah blah.[^1]`, with the note moved after the period and+ the space collapsed. If false, the space will still be+ collapsed, but the footnote will not be moved after the+ punctuation. The option may also be used in numerical styles+ that use superscripts for citation numbers (but for these+ styles the default is not to move the citation).+++# Slide shows++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`], or+slide shows in Microsoft [PowerPoint] format.++Here's the Markdown source for a simple slide show, `habits.txt`:++ % Habits+ % John Doe+ % March 22, 2005++ # In the morning++ ## Getting up++ - Turn off alarm+ - Get out of bed++ ## Breakfast++ - Eat eggs+ - Drink coffee++ # In the evening++ ## Dinner++ - Eat spaghetti+ - Drink wine++ ------------------++ ++ ## Going to sleep++ - Get in bed+ - Count sheep++To produce an HTML/JavaScript slide show, simply type++ pandoc -t FORMAT -s habits.txt -o habits.html++where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.++For Slidy, Slideous, reveal.js, and S5, the file produced by+pandoc with the `-s/--standalone` option embeds a link to+JavaScript and CSS files, which are assumed to be available at+the relative path `s5/default` (for S5), `slideous` (for+Slideous), `reveal.js` (for reveal.js), or at the Slidy website+at `w3.org` (for Slidy). (These paths can be changed by setting+the `slidy-url`, `slideous-url`, `revealjs-url`, or `s5-url`+variables; see [Variables for HTML slides], above.) For+DZSlides, the (relatively short) JavaScript and CSS are included+in the file by default.++With all HTML slide formats, the `--self-contained` option can+be used to produce a single file that contains all of the data+necessary to display the slide show, including linked scripts,+stylesheets, images, and videos.++To produce a PDF slide show using beamer, type++ pandoc -t beamer habits.txt -o habits.pdf++Note that a reveal.js slide show can also be converted to a PDF+by printing it to a file from the browser.++To produce a PowerPoint slide show, type++ pandoc habits.txt -o habits.pptx++## Structuring the slide show++By default, the *slide level* is the highest heading level in+the hierarchy that is followed immediately by content, and not another+heading, somewhere in the document. In the example above, level-1 headings+are always followed by level-2 headings, which are followed by content,+so the slide level is 2. This default can be overridden using the+`--slide-level` option.++The document is carved up into slides according to the following+rules:++ * A horizontal rule always starts a new slide.++ * A heading at the slide level always starts a new slide.++ * Headings *below* the slide level in the hierarchy create+ headings *within* a slide. (In beamer, a "block" will be+ created. If the heading has the class `example`, an+ `exampleblock` environment will be used; if it has the class+ `alert`, an `alertblock` will be used; otherwise a regular+ `block` will be used.)++ * Headings *above* the slide level in the hierarchy create+ "title slides," which just contain the section title+ and help to break the slide show into sections.+ Non-slide content under these headings will be included+ on the title slide (for HTML slide shows) or in a+ subsequent slide with the same title (for beamer).++ * A title page is constructed automatically from the document's title+ block, if present. (In the case of beamer, this can be disabled+ by commenting out some lines in the default template.)++These rules are designed to support many different styles of slide show. If+you don't care about structuring your slides into sections and subsections,+you can either just use level-1 headings for all slides (in that case, level 1+will be the slide level) or you can set `--slide-level=0`.++Note: in reveal.js slide shows, if slide level is 2, a two-dimensional+layout will be produced, with level-1 headings building horizontally+and level-2 headings building vertically. It is not recommended that+you use deeper nesting of section levels with reveal.js unless you set+`--slide-level=0` (which lets reveal.js produce a one-dimensional layout+and only interprets horizontal rules as slide boundaries).++### PowerPoint layout choice++When creating slides, the pptx writer chooses from a number of pre-defined+layouts, based on the content of the slide:++Title Slide+: This layout is used for the initial slide, which is generated and+ filled from the metadata fields `date`, `author`, and `title`, if+ they are present.++Section Header+: This layout is used for what pandoc calls “title slides”, i.e.+ slides which start with a header which is above the slide level in+ the hierarchy.++Two Content+: This layout is used for two-column slides, i.e. slides containing a+ div with class `columns` which contains at least two divs with class+ `column`.++Comparison+: This layout is used instead of “Two Content” for any two-column+ slides in which at least one column contains text followed by+ non-text (e.g. an image or a table).++Content with Caption+: This layout is used for any non-two-column slides which contain text+ followed by non-text (e.g. an image or a table).++Blank+: This layout is used for any slides which only contain blank content,+ e.g. a slide containing only speaker notes, or a slide containing+ only a non-breaking space.++Title and Content+: This layout is used for all slides which do not match the criteria+ for another layout.++These layouts are chosen from the default pptx reference doc included with+pandoc, unless an alternative reference doc is specified using+`--reference-doc`.++## Incremental lists++By default, these writers produce lists that display "all at once."+If you want your lists to display incrementally (one item at a time),+use the `-i` option. If you want a particular list to depart from the+default, put it in a `div` block with class `incremental` or+`nonincremental`. So, for example, using the `fenced div` syntax, the+following would be incremental regardless of the document default:++ ::: incremental++ - Eat spaghetti+ - Drink wine++ :::++or++ ::: nonincremental++ - Eat spaghetti+ - Drink wine++ :::++While using `incremental` and `nonincremental` divs is the+recommended method of setting incremental lists on a per-case basis,+an older method is also supported: putting lists inside a blockquote+will depart from the document default (that is, it will display+incrementally without the `-i` option and all at once with the `-i`+option):++ > - Eat spaghetti+ > - Drink wine++Both methods allow incremental and nonincremental lists to be mixed+in a single document.++If you want to include a block-quoted list, you can work around+this behavior by putting the list inside a fenced div, so that+it is not the direct child of the block quote:++ > ::: wrapper+ > - a+ > - list in a quote+ > :::++## Inserting pauses++You can add "pauses" within a slide by including a paragraph containing+three dots, separated by spaces:++ # Slide with a pause++ content before the pause++ . . .++ content after the pause++Note: this feature is not yet implemented for PowerPoint output.++## Styling the slides++You can change the style of HTML slides by putting customized CSS files+in `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),+or `$DATADIR/slideous` (for Slideous),+where `$DATADIR` is the user data directory (see `--data-dir`, above).+The originals may be found in pandoc's system data directory (generally+`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any+files it does not find in the user data directory.++For dzslides, the CSS is included in the HTML file itself, and may+be modified there.++All [reveal.js configuration options] can be set through variables.+For example, themes can be used by setting the `theme` variable:++ -V theme=moon++Or you can specify a custom stylesheet using the `--css` option.++To style beamer slides, you can specify a `theme`, `colortheme`,+`fonttheme`, `innertheme`, and `outertheme`, using the `-V` option:++ pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf++Note that heading attributes will turn into slide attributes+(on a `<div>` or `<section>`) in HTML slide formats, allowing you+to style individual slides. In beamer, a number of heading+classes and attributes are recognized as frame options and+will be passed through as options to the frame: see+[Frame attributes in beamer], below.++## Speaker notes++Speaker notes are supported in reveal.js, PowerPoint (pptx),+and beamer output. You can add notes to your Markdown document thus:++ ::: notes++ This is my note.++ - It can contain Markdown+ - like this list++ :::++To show the notes window in reveal.js, press `s` while viewing the+presentation. Speaker notes in PowerPoint will be available, as usual,+in handouts and presenter view.++Notes are not yet supported for other slide formats, but the notes+will not appear on the slides themselves.++### Speaker notes on the title slide (PowerPoint)++For PowerPoint output, the title slide is generated from the document's+YAML metadata block. To add speaker notes to this slide, use a `notes`+field in the metadata:++ ---+ title: My Presentation+ author: Jane Doe+ notes: |+ Welcome everyone to this presentation.++ Remember to introduce yourself and mention the key topics.+ ---++The `notes` field can contain multiple paragraphs and Markdown formatting.++## Columns++To put material in side by side columns, you can use a native+div container with class `columns`, containing two or more div+containers with class `column` and a `width` attribute:++ :::::::::::::: {.columns}+ ::: {.column width="40%"}+ contents...+ :::+ ::: {.column width="60%"}+ contents...+ :::+ ::::::::::::::++Note: Specifying column widths does not currently work for PowerPoint.++### Additional columns attributes in beamer++The div containers with classes `columns` and `column` can optionally have+an `align` attribute.+The class `columns` can optionally have a `totalwidth` attribute or an+`onlytextwidth` class.++ :::::::::::::: {.columns align=center totalwidth=8em}+ ::: {.column width="40%"}+ contents...+ :::+ ::: {.column width="60%" align=bottom}+ contents...+ :::+ ::::::::::::::++The `align` attributes on `columns` and `column` can be used with the+values `top`, `top-baseline`, `center` and `bottom` to vertically align+the columns. It defaults to `top` in `columns`.++The `totalwidth` attribute limits the width of the columns to the given value.++ :::::::::::::: {.columns align=top .onlytextwidth}+ ::: {.column width="40%" align=center}+ contents...+ :::+ ::: {.column width="60%"}+ contents...+ :::+ ::::::::::::::++The class `onlytextwidth` sets the `totalwidth` to `\textwidth`.++See Section 12.7 of the [Beamer User's Guide] for more details.++## Frame attributes in beamer++Sometimes it is necessary to add the LaTeX `[fragile]` option to+a frame in beamer (for example, when using the `minted` environment).+This can be forced by adding the `fragile` class to the heading+introducing the slide:++ # Fragile slide {.fragile}++All of the other frame attributes described in Section 8.1 of+the [Beamer User's Guide] may also be used: `allowdisplaybreaks`,+`allowframebreaks`, `b`, `c`, `s`, `t`, `environment`, `label`, `plain`,+`shrink`, `standout`, `noframenumbering`, `squeeze`.+`allowframebreaks` is recommended especially for bibliographies, as+it allows multiple slides to be created if the content overfills the+frame:++ # References {.allowframebreaks}++In addition, the `frameoptions` attribute may be used to+pass arbitrary frame options to a beamer slide:++ # Heading {frameoptions="squeeze,shrink,customoption=foobar"}++## Background in reveal.js, beamer, and pptx++Background images can be added to self-contained reveal.js slide shows,+beamer slide shows, and pptx slide shows.++### On all slides (beamer, reveal.js, pptx)++With beamer and reveal.js, the configuration option `background-image` can be+used either in the YAML metadata block or as a command-line variable to get the same image on every slide.++Note that for reveal.js, the `background-image` will be used as+a `parallaxBackgroundImage` (see below).++For pptx, you can use a `--reference-doc` in which+background images have been set on the [relevant+layouts](#powerpoint-layout-choice).++#### `parallaxBackgroundImage` (reveal.js)++For reveal.js, there is also the reveal.js-native option+`parallaxBackgroundImage`, which produces a parallax scrolling background.+You must also set `parallaxBackgroundSize`, and can optionally set+`parallaxBackgroundHorizontal`+and `parallaxBackgroundVertical` to configure the scrolling behaviour.+See the [reveal.js+documentation](https://revealjs.com/backgrounds/#parallax-background)+for more details about the meaning of these options.++In reveal.js's overview mode, the parallaxBackgroundImage will show up+only on the first slide.++### On individual slides (reveal.js, pptx)++To set an image for a particular reveal.js or pptx slide, add+`{background-image="/path/to/image"}` to the first slide-level heading on the+slide (which may even be empty).++As the [HTML writers pass unknown attributes+through](#extension-link_attributes), other reveal.js background settings also+work on individual slides, including `background-size`, `background-repeat`,+`background-color`, `transition`, and `transition-speed`. (The `data-` prefix+will automatically be added.)++Note: `data-background-image` is also supported in pptx for consistency with+reveal.js – if `background-image` isn’t found, `data-background-image` will be+checked.++### On the title slide (reveal.js, pptx)++To add a background image to the automatically generated title slide for+reveal.js, use the `title-slide-attributes` variable in the YAML metadata block.+It must contain a map of attribute names and values. (Note that the `data-`+prefix is required here, as it isn’t added automatically.)++For pptx, pass a `--reference-doc` with the background+image set on the “Title Slide” layout.++### Example (reveal.js)++```+---+title: My Slide Show+parallaxBackgroundImage: /path/to/my/background_image.png+title-slide-attributes:+ data-background-image: /path/to/title_image.png+ data-background-size: contain+---++## Slide One++Slide 1 has background_image.png as its background.++## {background-image="/path/to/special_image.jpg"}++Slide 2 has a special image for its background, even though the heading has no content.+```++# EPUBs++## EPUB Metadata++There are two ways to specify metadata for an EPUB. The first is to use+the `--epub-metadata` option, which takes as its argument an XML file+with [Dublin Core elements].++The second way is to use YAML, either in a+[YAML metadata block][Extension: `yaml_metadata_block`] in a Markdown+document, or in a separate YAML file specified with `--metadata-file`.+Here is an example of a YAML metadata block with EPUB metadata:++ ---+ title:+ - type: main+ text: My Book+ - type: subtitle+ text: An investigation of metadata+ creator:+ - role: author+ text: John Smith+ - role: editor+ text: Sarah Jones+ identifier:+ - scheme: DOI+ text: doi:10.234234.234/33+ publisher: My Press+ rights: © 2007 John Smith, CC BY-NC+ ibooks:+ version: 1.3.4+ ...++The following fields are recognized:++`identifier`+ ~ Either a string value or an object with fields `text` and+ `scheme`. Valid values for `scheme` are `ISBN-10`,+ `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`,+ `ISBN-13`, `Legal deposit number`, `URN`, `OCLC number`,+ `Co-publisher’s ISBN-13`, `ISMN-13`, `ISBN-A`, `JP e-code`,+ `OLCC number`, `JP Magazine ID`, `UPC-12+5`, `BNF Control number`,+ `ISSN-13`, `ARK`, `Digital file internal version number`.++`title`+ ~ Either a string value, or an object with fields `file-as` and+ `type`, or a list of such objects. Valid values for `type` are+ `main`, `subtitle`, `short`, `collection`, `edition`, `extended`.++`creator`+ ~ Either a string value, or an object with fields `role`, `file-as`,+ and `text`, or a list of such objects. Valid values for `role` are+ [MARC relators], but+ pandoc will attempt to translate the human-readable versions+ (like "author" and "editor") to the appropriate marc relators.++`contributor`+ ~ Same format as `creator`.++`date`+ ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.)+ Pandoc will attempt to convert other common date formats.++`lang` (or legacy: `language`)+ ~ A string value in [BCP 47] format. Pandoc will default to the local+ language if nothing is specified.++`subject`+ ~ Either a string value, or an object with fields `text`, `authority`,+ and `term`, or a list of such objects. Valid values for `authority`+ are either a [reserved authority value] (currently `AAT`, `BIC`,+ `BISAC`, `CLC`, `DDC`, `CLIL`, `EuroVoc`, `MEDTOP`, `LCSH`, `NDC`,+ `Thema`, `UDC`, and `WGS`) or an absolute IRI identifying a custom+ scheme. Valid values for `term` are defined by the scheme.++`description`+ ~ A string value.++`type`+ ~ A string value.++`format`+ ~ A string value.++`relation`+ ~ A string value.++`coverage`+ ~ A string value.++`rights`+ ~ A string value.++`belongs-to-collection`+ ~ A string value. Identifies the name of a collection to which+ the EPUB Publication belongs.++`group-position`+ ~ The `group-position` field indicates the numeric position in which+ the EPUB Publication belongs relative to other works belonging to+ the same `belongs-to-collection` field.++`cover-image`+ ~ A string value (path to cover image).++`css` (or legacy: `stylesheet`)+ ~ A string value (path to CSS stylesheet).++`page-progression-direction`+ ~ Either `ltr` or `rtl`. Specifies the `page-progression-direction`+ attribute for the [`spine` element].++`accessModes`+ ~ An array of strings ([schema][accessibility schema]).+ Defaults to `["textual"]`.++`accessModeSufficient`+ ~ An array of strings ([schema][accessibility schema]).+ Defaults to `["textual"]`.++`accessibilityHazards`+ ~ An array of strings ([schema][accessibility schema]).+ Defaults to `["none"]`.++`accessibilityFeatures`+ ~ An array of strings ([schema][accessibility schema]).+ Defaults to++ - "alternativeText"+ - "readingOrder"+ - "structuralNavigation"+ - "tableOfContents"++`accessibilitySummary`+ ~ A string value.++`ibooks`+ ~ iBooks-specific metadata, with the following fields:++ - `version`: (string)+ - `specified-fonts`: `true`|`false` (default `false`)+ - `ipad-orientation-lock`: `portrait-only`|`landscape-only`+ - `iphone-orientation-lock`: `portrait-only`|`landscape-only`+ - `binding`: `true`|`false` (default `true`)+ - `scroll-axis`: `vertical`|`horizontal`|`default`++[accessibility schema]: https://kb.daisy.org/publishing/docs/metadata/schema.org/index.html+[MARC relators]: https://loc.gov/marc/relators/relaterm.html+[reserved authority value]: https://idpf.github.io/epub-registries/authorities/+[`spine` element]: http://idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem++## The `epub:type` attribute++For `epub3` output, you can mark up the heading that corresponds to an EPUB+chapter using the [`epub:type` attribute][epub-type]. For example, to set+the attribute to the value `prologue`, use this Markdown:++ # My chapter {epub:type=prologue}++Which will result in:++ <body epub:type="frontmatter">+ <section epub:type="prologue">+ <h1>My chapter</h1>++Pandoc will output `<body epub:type="bodymatter">`, unless+you use one of the following values, in which case either+`frontmatter` or `backmatter` will be output.++`epub:type` of first section `epub:type` of body+---------------------------- ------------------+prologue frontmatter+abstract frontmatter+acknowledgments frontmatter+copyright-page frontmatter+dedication frontmatter+credits frontmatter+keywords frontmatter+imprint frontmatter+contributors frontmatter+other-credits frontmatter+errata frontmatter+revision-history frontmatter+titlepage frontmatter+halftitlepage frontmatter+seriespage frontmatter+foreword frontmatter+preface frontmatter+frontispiece frontmatter+appendix backmatter+colophon backmatter+bibliography backmatter+index backmatter++[epub-type]: http://www.idpf.org/epub/31/spec/epub-contentdocs.html#sec-epub-type-attribute++## Linked media++By default, pandoc will download media referenced from any `<img>`, `<audio>`,+`<video>` or `<source>` element present in the generated EPUB,+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="https://example.com/music/toccata.mp3"+ data-external="1" type="audio/mpeg">+ </source>+ </audio>++If the input format already is HTML then `data-external="1"` will work+as expected for `<img>` elements. Similarly, for Markdown, external+images can be declared with `{external=1}`. Note that this+only works for images; the other media elements have no native+representation in pandoc's AST and require the use of raw HTML.++## EPUB styling++By default, pandoc will include some basic styling+contained in its `epub.css` data file. (To see this,+use `pandoc --print-default-data-file epub.css`.)+To use a different CSS file, just use the `--css` command+line option. A few inline styles are defined in addition; these+are essential for correct formatting of pandoc's HTML output.++The `document-css` variable may be set if the more opinionated+styling of pandoc's default HTML templates is desired (and+in that case the variables defined in [Variables for HTML] may+be used to fine-tune the style).++# Chunked HTML++`pandoc -t chunkedhtml` will produce a zip archive of linked+HTML files, one for each section of the original document.+Internal links will automatically be adjusted to point to+the right place, images linked to under the working directory+will be incorporated, and navigation links will be added.+In addition, a JSON file `sitemap.json` will be included+describing the hierarchical structure of the files.++If an output file without an extension is specified, then+it will be interpreted as a directory and the zip archive+will be automatically unpacked into it (unless it already+exists, in which case an error will be raised). Otherwise+a `.zip` file will be produced.++The navigation links can be customized by adjusting the+template. By default, a table of contents is included only+on the top page. To include it on every page, set the+`toc` variable manually.++# Jupyter notebooks++When creating a [Jupyter notebook], pandoc will try to infer the+notebook structure. Code blocks with the class `code` will be+taken as code cells, and intervening content will be taken as+Markdown cells. Attachments will automatically be created for+images in Markdown cells. Metadata will be taken from the+`jupyter` metadata field. For example:++````+---+title: My notebook+jupyter:+ nbformat: 4+ nbformat_minor: 5+ kernelspec:+ display_name: Python 2+ language: python+ name: python2+ language_info:+ codemirror_mode:+ name: ipython+ version: 2+ file_extension: ".py"+ mimetype: "text/x-python"+ name: "python"+ nbconvert_exporter: "python"+ pygments_lexer: "ipython2"+ version: "2.7.15"+---++# Lorem ipsum++**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus+bibendum felis dictum sodales.++``` code+print("hello")+```++## Pyout++``` code+from IPython.display import HTML+HTML("""+<script>+console.log("hello");+</script>+<b>HTML</b>+""")+```++## Image++This image  will be+included as a cell attachment.+````++If you want to add cell attributes, group cells differently, or+add output to code cells, then you need to include divs to+indicate the structure. You can use either [fenced+divs][Extension: `fenced_divs`] or [native divs][Extension:+`native_divs`] for this. Here is an example:++````+:::::: {.cell .markdown}+# Lorem++**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus+bibendum felis dictum sodales.+::::::++:::::: {.cell .code execution_count=1}+``` {.python}+print("hello")+```++::: {.output .stream .stdout}+```+hello+```+:::+::::::++:::::: {.cell .code execution_count=2}+``` {.python}+from IPython.display import HTML+HTML("""+<script>+console.log("hello");+</script>+<b>HTML</b>+""")+```++::: {.output .execute_result execution_count=2}+```{=html}+<script>+console.log("hello");+</script>+<b>HTML</b>+hello+```+:::+::::::+````++If you include raw HTML or TeX in an output cell, use the+[raw attribute](#extension-raw_attribute), as shown+in the last cell of the example above. Although pandoc can+process "bare" raw HTML and TeX, the result is often+interspersed raw elements and normal textual elements, and+in an output cell pandoc expects a single, connected raw+block. To avoid using raw HTML or TeX except when+marked explicitly using raw attributes, we recommend+specifying the extensions `-raw_html-raw_tex+raw_attribute` when+translating between Markdown and ipynb notebooks.++Note that options and extensions that affect reading and+writing of Markdown will also affect Markdown cells in ipynb+notebooks. For example, `--wrap=preserve` will preserve+soft line breaks in Markdown cells; `--markdown-headings=setext` will+cause Setext-style headings to be used; and `--preserve-tabs` will+prevent tabs from being turned to spaces.++# Vimdoc++Vimdoc writer generates Vim help files and makes use of the following metadata+variables:++``` yaml+abstract: "A short description"+author: Author+title: Title++# Vimdoc-specific+filename: "definition-lists.txt"+vimdoc-prefix: pandoc+```++Complete header requires `abstract`, `author`, `title` and `filename` to+be set. Compiling file with such metadata produces the following file+(assumes `--standalone`, see [Templates]):++``` vimdoc+*definition-lists.txt* A short description++ Title by Author+++ Type |gO| to see the table of contents.++[...]++ vim:tw=72:sw=4:ts=4:ft=help:norl:et:+```++If `vimdoc-prefix` is set, all non-command tags are prefixed with its+value, it is used to prevent tag collision: all headers have a tag+(either inferred or explicit) and multiple help pages can have the same+header names, therefore collision is to be expected. Let our input be+the following markdown file:++``` markdown+## Header++`:[range]Fnl {expr}`{#:Fnl}+: Evaluates {expr} or range++`vim.b`{#vim.b}+: Buffer-scoped (`:h b:`) variables for the current buffer. Invalid or unset+ key returns `nil`. Can be indexed with an integer to access variables for a+ specific buffer.++[Span]{#span}+: generic inline container for phrasing content, which does not inherently+ represent anything.+```++Convert it to vimdoc:++``` vimdoc+------------------------------------------------------------------------+Header *header*++:[range]Fnl {expr} *:Fnl*+ Evaluates {expr} or range+`vim.b` *vim.b*+ Buffer-scoped (|b:|) variables for the current buffer. Invalid or+ unset key returns `nil`. Can be indexed with an integer to access+ variables for a specific buffer.+Span *span*+ generic inline container for phrasing content, which does not+ inherently represent anything.+```++Convert it to vimdoc with metadata variable set (e.g. with+`-M vimdoc-prefix=pandoc`)++``` vimdoc+------------------------------------------------------------------------+Header *pandoc-header*++:[range]Fnl {expr} *:Fnl*+ Evaluates {expr} or range+`vim.b` *pandoc-vim.b*+ Buffer-scoped (|b:|) variables for the current buffer. Invalid or+ unset key returns `nil`. Can be indexed with an integer to access+ variables for a specific buffer.+Span *pandoc-span*+ generic inline container for phrasing content, which does not+ inherently represent anything.+```++`vim.b` and `Span` got their prefixes but not `:Fnl` because ex-commands+(those starting with `:`) don't get a prefix, since they are considered+unique across help pages.++In both cases `:help b:` became reference `|b:|` (also works with+`:h b:`). Links pointing to either <https://vimhelp.org/> or+<https://neovim.io/doc/user> become references too.++Vim traditionally wraps at 78, but Pandoc defaults to 72. Use+`--columns 78` to match Vim.++# Syntax highlighting++Pandoc will automatically highlight syntax in [fenced code blocks] that+are marked with a language name. The Haskell library [skylighting] is+used for highlighting. Currently highlighting is supported only for+HTML, EPUB, Docx, Ms, Man, Typst, and LaTeX/PDF output. To see a list+of language names that pandoc will recognize, type `pandoc+--list-highlight-languages`.++The color scheme can be selected using the `--syntax-highlighting`+option. The default color scheme is `pygments`, which imitates the+default color scheme used by the Python library pygments (though+pygments is not actually used to do the highlighting). To see a+list of highlight styles, type `pandoc --list-highlight-styles`.++If you are not satisfied with the predefined styles, you can use+`--print-highlight-style` to generate a JSON `.theme` file which+can be modified and used as the argument to+`--syntax-highlighting`. To get a JSON version of the `pygments`+style, for example:++ pandoc -o my.theme --print-highlight-style pygments++Then edit `my.theme` and use it like this:++ pandoc --syntax-highlighting my.theme++If you are not satisfied with the built-in highlighting, or you+want to highlight a language that isn't supported, you can use the+`--syntax-definition` option to load a [KDE-style XML syntax definition+file](https://docs.kde.org/stable5/en/kate/katepart/highlight.html).+Before writing your own, have a look at KDE's [repository of syntax+definitions](https://github.com/KDE/syntax-highlighting/tree/master/data/syntax).++If you receive an error that pandoc "Could not read highlighting theme",+check that the JSON file is encoded with UTF-8 and has no Byte-Order Mark (BOM).++To disable highlighting, use `--syntax-highlighting=none`.++To use a format's idiomatic syntax highlighting instead of+pandoc's built-in highlighting, use `--syntax-highlighting=idiomatic`.+Currently, `idiomatic` only affects the following formats:++- In reveal.js, it causes reveal.js's highlighting plugin to be+ used for source code highlighting. The style may be customized+ by setting the `highlightjs-theme` variable.++- In Typst, it causes Typst's built-in highlighting to be used.+ (This is also the default for Typst.)++- In LaTeX, it causes the [`listings`][] package to be used. Note that+ `listings` does not support multi-byte encoding for source code. To handle+ UTF-8 you would need to use a custom template. This issue is fully+ documented here: [Encoding issue with the listings package][].++- In other formats, `idiomatic` will have the same result as `default`.++[skylighting]: https://github.com/jgm/skylighting++# Custom Styles++Custom styles can be used in the docx, odt and ICML formats.++## Output++By default, pandoc's odt, docx and ICML output applies a predefined set of+styles for blocks such as paragraphs and block quotes, and uses largely+default formatting (italics, bold) for inlines. This will work for most+purposes, especially alongside a [reference doc](#option--reference-doc) file.+However, if you need to apply your own styles to blocks, or match a preexisting+set of styles, pandoc allows you to define custom styles for blocks and text+using `div`s and `span`s, respectively.++If you define a Div, Span, or Table with the attribute+`custom-style`, pandoc will apply your specified style to the+contained elements (with the exception of elements whose function+depends on a style, like headings, code blocks, block quotes, or+links). So, for example, using the `bracketed_spans` syntax,++ [Get out]{custom-style="Emphatically"}, he said.++would produce a file with "Get out" styled with character+style `Emphatically`. Similarly, using the `fenced_divs` syntax,++ Dickinson starts the poem simply:++ ::: {custom-style="Poetry"}+ | A Bird came down the Walk---+ | He did not know I saw---+ :::++would style the two contained lines with the `Poetry` paragraph style.++Styles will be defined in the output file as inheriting+from normal text (docx) or Default Paragraph Style (odt), if the+styles are not yet in your [reference doc](#option--reference-doc).+If they are already defined, pandoc will not alter the definition.++This feature allows for greatest customization in conjunction with+[pandoc filters]. If you want all paragraphs after block quotes to be+indented, you can write a filter to apply the styles necessary. If you+want all italics to be transformed to the `Emphasis` character style+(perhaps to change their color), you can write a filter which will+transform all italicized inlines to inlines within an `Emphasis`+custom-style `span`.++For docx or odt output, you don't need to enable any extensions for+custom styles to work.++For icml output, you can also set an `object-style` in images:++ {object-style="fixedSizeImage"}++In InDesign you'll see that object style given to the image,+and you'll be able to customize it, or load its definition from+a template of yours.++[pandoc filters]: https://pandoc.org/filters.html++## Input++The docx reader, by default, only reads those styles that it can+convert into pandoc elements, either by direct conversion or+interpreting the derivation of the input document's styles.++By enabling the [`styles` extension](#ext-styles) in the docx reader+(`-f docx+styles`), you can produce output that maintains the styles+of the input document, using the `custom-style` class. A `custom-style`+attribute will be added for each style. Divs will be created to+hold the paragraph styles, and Spans to hold the character styles.+Table styles will be applied directly to the Table.++For example, using the `custom-style-reference.docx` file in the test+directory, we have the following different outputs:++Without the `+styles` extension:++ $ pandoc test/docx/custom-style-reference.docx -f docx -t markdown+ This is some text.++ This is text with an *emphasized* text style. And this is text with a+ **strengthened** text style.++ > Here is a styled paragraph that inherits from Block Text.++And with the extension:++ $ pandoc test/docx/custom-style-reference.docx -f docx+styles -t markdown++ ::: {custom-style="First Paragraph"}+ This is some text.+ :::++ ::: {custom-style="Body Text"}+ This is text with an [emphasized]{custom-style="Emphatic"} text style.+ And this is text with a [strengthened]{custom-style="Strengthened"}+ text style.+ :::++ ::: {custom-style="My Block Style"}+ > Here is a styled paragraph that inherits from Block Text.+ :::++With these custom styles, you can use your input document as a+reference-doc while creating docx output (see below), and maintain the+same styles in your input and output files.++# Custom readers and writers++Pandoc can be extended with custom readers and writers written+in [Lua]. (Pandoc includes a Lua interpreter, so Lua need not+be installed separately.)++To use a custom reader or writer, simply specify the path to the+Lua script in place of the input or output format. For example:++ pandoc -t data/sample.lua+ pandoc -f my_custom_markup_language.lua -t latex -s++If the script is not found relative to the working directory,+it will be sought in the `custom` subdirectory of the user data+directory (see `--data-dir`).++A custom reader is a Lua script that defines one function,+Reader, which takes a string as input and returns a Pandoc+AST. See the [Lua filters documentation] for documentation+of the functions that are available for creating pandoc+AST elements. For parsing, the [lpeg] parsing library+is available by default. To see a sample custom reader:++ pandoc --print-default-data-file creole.lua++If you want your custom reader to have access to reader options+(e.g. the tab stop setting), you give your Reader function a+second `options` parameter.++A custom writer is a Lua script that defines a function+that specifies how to render each element in a Pandoc AST.+See the [djot-writer.lua] for a full-featured example.++Note that custom writers have no default template. If you want+to use `--standalone` with a custom writer, you will need to+specify a template manually using `--template` or add a new+default template with the name+`default.NAME_OF_CUSTOM_WRITER.lua` to the `templates`+subdirectory of your user data directory (see [Templates]).++[Lua]: https://www.lua.org+[lpeg]: http://www.inf.puc-rio.br/~roberto/lpeg/+[djot-writer.lua]: https://github.com/jgm/djot.lua/blob/main/djot-writer.lua++# Reproducible builds++Some of the document formats pandoc targets (such as EPUB,+docx, and ODT) include build timestamps in the generated document.+That means that the files generated on successive builds will+differ, even if the source does not. To avoid this, set the+`SOURCE_DATE_EPOCH` environment variable, and the timestamp will+be taken from it instead of the current time.+`SOURCE_DATE_EPOCH` should contain an integer unix timestamp+(specifying the number of seconds since midnight UTC January 1, 1970).++For reproducible builds with LaTeX, you can either specify the+`pdf-trailer-id` in the metadata or leave it undefined, in which+case pandoc will create a trailer-id based on a hash of the+`SOURCE_DATE_EPOCH` and the document's contents.++Some document formats also include a unique identifier. For+EPUB, this can be set explicitly by setting the `identifier`+metadata field (see [EPUB Metadata], above).++# Accessible PDFs and PDF archiving standards++PDF is a flexible format, and using PDF in certain contexts+requires additional conventions. For example, PDFs are not+accessible by default; they define how characters are placed on a+page but do not contain semantic information on the content.+However, it is possible to generate accessible PDFs, which use+tagging to add semantic information to the document.++Pandoc defaults to LaTeX to generate PDF. LaTeX's `\DocumentMetadata`+interface supports PDF standards and tagging when using LuaLaTeX;+set the `pdfstandard` variable to enable this (see below). For older+LaTeX installations, alternative engines must be used.++The PDF standards PDF/A and PDF/UA define further restrictions+intended to optimize PDFs for archiving and accessibility. Tagging+is commonly used in combination with these standards to ensure+best results.++Note, however, that standard compliance depends on many things,+including the colorspace of embedded images. Pandoc cannot check+this, and external programs must be used to ensure that generated+PDFs are in compliance.++## LaTeX++Set the `pdfstandard` variable to produce tagged PDFs conforming+to PDF/A, PDF/X, or PDF/UA standards. For example:++ pandoc -V pdfstandard=ua-2 --pdf-engine=lualatex doc.md -o doc.pdf++Multiple standards can be combined:++ ---+ pdfstandard:+ - ua-2+ - a-4f+ ---++The required PDF version is inferred automatically. This feature+requires LuaLaTeX in TeX Live 2025 with LaTeX kernel 2025-06-01+or newer.++## ConTeXt++ConTeXt always produces tagged PDFs, but the quality depends on+the input. The default ConTeXt markup generated by pandoc is+optimized for readability and reuse, not tagging. Enable the+[`tagging`](#extension--tagging) format extension to force markup+that is optimized for tagging. For example:++ pandoc -t context+tagging doc.md -o doc.pdf++A recent `context` version should be used, as older versions+contained a bug that lead to invalid PDF metadata.++## WeasyPrint++The HTML-based engine WeasyPrint includes experimental support for+PDF/A and PDF/UA since version 57. Tagged PDFs can created with++ pandoc --pdf-engine=weasyprint \+ --pdf-engine-opt=--pdf-variant=pdf/ua-1 ...++The feature is experimental and standard compliance should not be+assumed.++## Prince XML++The non-free HTML-to-PDF converter `prince` has extensive support+for various PDF standards as well as tagging. E.g.:++ pandoc --pdf-engine=prince \+ --pdf-engine-opt=--tagged-pdf ...++See the prince documentation for more info.++## Typst++Typst 0.12 can produce PDF/A-2b:++ pandoc --pdf-engine=typst --pdf-engine-opt=--pdf-standard=a-2b ...++## Word Processors++Word processors like LibreOffice and MS Word can also be used to+generate standardized and tagged PDF output. Pandoc does not+support direct conversions via these tools. However, pandoc can+convert a document to a `docx` or `odt` file, which can then be+opened and converted to PDF with the respective word processor.+See the documentation for [Word][word-accessible-pdfs] and+[LibreOffice][lo-pdf-export].++[word-accessible-pdfs]: https://support.microsoft.com/en-us/office/create-accessible-pdfs-064625e0-56ea-4e16-ad71-3aa33bb4b7ed+[lo-pdf-export]: https://help.libreoffice.org/latest/en-US/text/shared/01/ref_pdf_export_general.html+++# Running pandoc as a web server++If you rename (or symlink) the pandoc executable to+`pandoc-server`, or if you call pandoc with `server` as the first+argument, it will start up a web server with a JSON API. This+server exposes most of the conversion functionality of pandoc. For+full documentation, see the [pandoc-server] man page.++If you rename (or symlink) the pandoc executable to+`pandoc-server.cgi`, it will function as a CGI program+exposing the same API as `pandoc-server`.++`pandoc-server` is designed to be maximally secure; it uses+Haskell's type system to provide strong guarantees that no I/O+will be performed on the server during pandoc conversions.++[pandoc-server]: https://github.com/jgm/pandoc/blob/master/doc/pandoc-server.md++# Running pandoc as a Lua interpreter++Calling the pandoc executable under the name `pandoc-lua` or with+`lua` as the first argument will make it function as a standalone+Lua interpreter. The behavior is mostly identical to that of the+[standalone `lua` executable][lua standalone], version 5.4.+All `pandoc.*` packages, as well as the packages `re` and `lpeg`,+are available via global variables. Furthermore, the globals+`PANDOC_VERSION`, `PANDOC_STATE`, and `PANDOC_API_VERSION` are+set at startup. For full documentation, see the [pandoc-lua] man page.++[lua standalone]: https://www.lua.org/manual/5.4/manual.html#7+[pandoc-lua]: https://github.com/jgm/pandoc/blob/master/doc/pandoc-lua.md++# A note on security++1. Although pandoc itself will not create or modify any files other+ than those you explicitly ask it create (with the exception+ of temporary files used in producing PDFs), a filter or custom+ writer could in principle do anything on your file system. Please+ audit filters and custom writers very carefully before using them.++2. Several input formats (including LaTeX, Org, RST, and Typst)+ support `include` directives that allow the contents of a file to be+ included in the output. An untrusted attacker could use these+ to view the contents of files on the file system. (Using the+ `--sandbox` option can protect against this threat.)++3. Several output formats (including RTF, FB2, HTML with+ `--self-contained`, EPUB, Docx, and ODT) will embed encoded+ or raw images into the output file. An untrusted attacker+ could exploit this to view the contents of non-image files on the+ file system. (Using the `--sandbox` option can protect+ against this threat, but will also prevent including images in+ these formats.)++4. In reading HTML files, pandoc will attempt to include the+ contents of `iframe` elements by fetching content from the+ local file or URL specified by `src`. If untrusted HTML is+ processed on a server, this has the potential to reveal anything+ readable by the process running the server. Using the `-f html+raw_html`+ will mitigate this threat by causing the whole `iframe`+ to be parsed as a raw HTML block. Using `--sandbox` will also+ protect against the threat.++5. If your application uses pandoc as a Haskell library (rather than+ shelling out to the executable), it is possible to use it in a mode+ that fully isolates pandoc from your file system, by running the+ pandoc operations in the `PandocPure` monad. See the document+ [Using the pandoc API](https://pandoc.org/using-the-pandoc-api.html)+ for more details. (This corresponds to the use of the `--sandbox`+ option on the command line.)++6. Pandoc's parsers can exhibit pathological performance on some+ corner cases. It is wise to put any pandoc operations under+ a timeout, to avoid DOS attacks that exploit these issues.+ If you are using the pandoc executable, you can add the+ command line options `+RTS -M512M -RTS` (for example) to limit+ the heap size to 512MB. Note that the `commonmark` parser+ (including `commonmark_x` and `gfm`) is much less vulnerable+ to pathological performance than the `markdown` parser, so+ it is a better choice when processing untrusted input.++7. The HTML generated by pandoc is not guaranteed to be safe.+ If `raw_html` is enabled for the Markdown input, users can+ inject arbitrary HTML. Even if `raw_html` is disabled,+ users can include dangerous content in URLs and attributes.+ To be safe, you should run all HTML generated from untrusted+ user input through an HTML sanitizer.++# Authors++Copyright 2006--2024 John MacFarlane (jgm@berkeley.edu). Released+under the [GPL], version 2 or greater. This software carries no+warranty of any kind. (See COPYRIGHT for full copyright and+warranty notices.) For a full list of contributors, see the file+AUTHORS.md in the pandoc source code.++[GPL]: https://www.gnu.org/copyleft/gpl.html "GNU General Public License"+[YAML]: https://yaml.org/spec/1.2/spec.html "YAML v1.2 Spec"
@@ -1,60 +0,0 @@-version=$(shell grep '^Version:' pandoc.cabal | awk '{print $$2;}')-makemanpages=$(shell find dist -type f -name make-pandoc-man-pages)-ifeq "${makemanpages}" ""- makemanpages=@echo "You need to 'cabal configure -fmake-pandoc-man-pages && cabal build'" && exit 1-endif-setup=dist/setup/setup-MANPAGES=man/man1/pandoc.1 man/man5/pandoc_markdown.5--quick:- cabal configure --enable-tests --disable-optimization- cabal build--full:- cabal configure --enable-tests --enable-optimization -ftrypandoc -fmake-pandoc-man-pages -fembed_data_files --enable-benchmarks- cabal build- cabal haddock--deps:- cabal install --only-dependencies --enable-tests -ftrypandoc -fmake-pandoc-man-pages -fembed_data_files --enable-benchmarks--prof:- cabal configure --enable-library-profiling --enable-executable-profiling --enable-optimization --enable-tests- cabal build--test:- cabal test--bench:- cabal bench--install: full- cabal copy- cabal register--sdist: man- # note: cabal sdist doesn't work well with preprocessors for some cabal versions- ${setup} sdist--dist: sdist- 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}"--man: ${MANPAGES}--osxpkg:- ./make_osx_package.sh--%.1: %.1.template README- ${makemanpages}--%.5: %.5.template README- ${makemanpages}--clean:- cabal clean- -rm ${MANPAGES}--.PHONY: deps quick full install man clean test bench haddock sdist osxpkg dist prof
@@ -1,3179 +0,0 @@-% Pandoc User's Guide-% John MacFarlane-% August 30, 2014--Synopsis-========--pandoc [*options*] [*input-file*]...--Description-===========--Pandoc is a [Haskell] library for converting from one markup format to-another, and a command-line tool that uses this library. It can read-[markdown] and (subsets of) [Textile], [reStructuredText], [HTML],-[LaTeX], [MediaWiki markup], [Haddock markup], [OPML], [Emacs-Org-mode], [DocBook], [txt2tags], [EPUB] and [Word docx]; and it can write plain text,-[markdown], [reStructuredText], [XHTML], [HTML 5], [LaTeX] (including-[beamer] slide shows), [ConTeXt], [RTF], [OPML], [DocBook],-[OpenDocument], [ODT], [Word docx], [GNU 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.--Pandoc's enhanced version of markdown includes syntax for footnotes,-tables, flexible ordered lists, definition lists, fenced code blocks,-superscript, subscript, strikeout, title blocks, automatic tables of-contents, embedded LaTeX math, citations, and markdown inside HTML block-elements. (These enhancements, described below under-[Pandoc's markdown](#pandocs-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-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.--Using `pandoc`-----------------If no *input-file* is specified, input is read from *stdin*.-Otherwise, the *input-files* are concatenated (with a blank-line between each) and used as input. Output goes to *stdout* by-default (though output to *stdout* is disabled for the `odt`, `docx`,-`epub`, and `epub3` output formats). For output to a file, use the-`-o` option:-- pandoc -o output.html input.txt--Instead of a file, an absolute URI may be given. In this case-pandoc will fetch the content using HTTP:-- pandoc -f html -t markdown http://www.fsf.org--If multiple input files are given, `pandoc` will concatenate them all (with-blank lines between them) before parsing. This feature is disabled for- binary input formats such as `EPUB` and `docx`.--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:-- pandoc -f markdown -t latex hello.txt--To convert `hello.html` from html to markdown:-- pandoc -f html -t markdown hello.html--Supported output formats are listed below under the `-t/--to` option.-Supported input formats are listed below under the `-f/--from` option. Note-that the `rst`, `textile`, `latex`, and `html` readers are not complete;-there are some constructs that they do not parse.--If the input or output format is not specified explicitly, `pandoc`-will attempt to guess it from the extensions of-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-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.--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 and output through `iconv`:-- iconv -t utf-8 input.txt | pandoc | iconv -f utf-8--Creating a PDF-----------------Earlier versions of pandoc came with a program, `markdown2pdf`, that-used pandoc and pdflatex to produce a PDF. This is no longer needed,-since `pandoc` can now produce `pdf` output itself. To produce a PDF, simply-specify an output file with a `.pdf` extension. Pandoc will create a latex-file and use pdflatex (or another engine, see `--latex-engine`) to convert it-to PDF:-- pandoc test.txt -o test.pdf--Production of a PDF requires that a LaTeX engine be installed (see-`--latex-engine`, below), and assumes that the following LaTeX packages are-available: `amssymb`, `amsmath`, `ifxetex`, `ifluatex`, `listings` (if the-`--listings` option is used), `fancyvrb`, `longtable`, `booktabs`, `url`,-`graphicx`, `hyperref`, `ulem`, `babel` (if the `lang` variable is set),-`fontspec` (if `xelatex` or `lualatex` is used as the LaTeX engine), `xltxtra`-and `xunicode` (if `xelatex` is used).--`hsmarkdown`---------------A user who wants a drop-in replacement for `Markdown.pl` may create-a symbolic link to the `pandoc` executable called `hsmarkdown`. When-invoked under the name `hsmarkdown`, `pandoc` will behave as if-invoked with `-f markdown_strict --email-obfuscation=references`,-and all command-line options will be treated as regular arguments.-However, this approach does not work under Cygwin, due to problems with-its simulation of symbolic links.--[Cygwin]: http://www.cygwin.com/-[`iconv`]: http://www.gnu.org/software/libiconv/-[CTAN]: http://www.ctan.org "Comprehensive TeX Archive Network"-[TeX Live]: http://www.tug.org/texlive/-[MacTeX]: http://www.tug.org/mactex/--Options-=======--General options------------------`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*-: 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_github` (github extended markdown),- `textile` (Textile), `rst` (reStructuredText), `html` (HTML),- `docbook` (DocBook), `t2t` (txt2tags), `docx` (docx), `epub` (EPUB),- `opml` (OPML), `org` (Emacs Org-mode), `mediawiki` (MediaWiki markup),- `haddock` (Haddock markup), or `latex` (LaTeX). If `+lhs` is appended- to `markdown`, `rst`,- `latex`, or `html`, the input will be treated as literate Haskell- source: see [Literate Haskell support](#literate-haskell-support),- below. Markdown 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- without pipe tables and with hard line breaks. See [Pandoc's- markdown](#pandocs-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 extra- extended markdown), `markdown_github` (github extended markdown),- `rst` (reStructuredText), `html` (XHTML 1), `html5` (HTML 5),- `latex` (LaTeX), `beamer` (LaTeX beamer slide show),- `context` (ConTeXt), `man` (groff man), `mediawiki` (MediaWiki markup),- `dokuwiki` (DokuWiki markup),- `textile` (Textile), `org` (Emacs Org-Mode), `texinfo` (GNU Texinfo),- `opml` (OPML), `docbook` (DocBook), `opendocument` (OpenDocument), `odt`- (OpenOffice text document), `docx` (Word docx), `haddock` (Haddock- markup), `rtf` (rich text format), `epub` (EPUB v2 book), `epub3`- (EPUB v3), `fb2` (FictionBook2 e-book), `asciidoc` (AsciiDoc),- `icml` (InDesign ICML), `slidy` (Slidy HTML and javascript slide show),- `slideous` (Slideous HTML and javascript slide show), `dzslides`- (DZSlides HTML5 + javascript slide show), `revealjs` (reveal.js- HTML5 + javascript slide show), `s5` (S5 HTML and javascript slide show),- or the path of a custom lua writer (see [Custom writers](#custom-writers),- below). Note that `odt`, `epub`, and `epub3` output will not be directed- to *stdout*; an output filename must be specified using the `-o/--output`- option. If `+lhs` is appended to `markdown`, `rst`, `latex`, `beamer`,- `html`, or `html5`, the output will be rendered as literate Haskell- source: see [Literate Haskell support](#literate-haskell-support), below.- Markdown syntax extensions can be individually enabled or disabled by- appending `+EXTENSION` or `-EXTENSION` to the format name, as described- above under `-f`.--`-o` *FILE*, `--output=`*FILE*-: Write output to *FILE* instead of *stdout*. If *FILE* is- `-`, output will go to *stdout*. (Exception: if the output- format is `odt`, `docx`, `epub`, or `epub3`, output to stdout is disabled.)--`--data-dir=`*DIRECTORY*-: Specify the user data directory to search for pandoc data files.- If this option is not specified, the default user data directory- will be used. This is-- $HOME/.pandoc-- in unix,-- C:\Documents And Settings\USERNAME\Application Data\pandoc-- in Windows XP, and-- C:\Users\USERNAME\AppData\Roaming\pandoc-- in Windows 7. (You can find the default user data directory- on your system by looking at the output of `pandoc --version`.)- A `reference.odt`, `reference.docx`, `default.csl`,- `epub.css`, `templates`, `slidy`, `slideous`, or `s5` directory- placed in this directory will override pandoc's normal defaults.--`-v`, `--version`-: Print version.--`-h`, `--help`-: Show usage message.--Reader options-----------------`-R`, `--parse-raw`-: 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, Slideous, DZSlides, reveal.js, and S5 output; raw LaTeX- 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.)--`-S`, `--smart`-: Produce typographically correct output, converting straight quotes- to curly quotes, `---` to em-dashes, `--` to en-dashes, and- `...` to ellipses. Nonbreaking spaces are inserted after certain- abbreviations, such as "Mr." (Note: This option is significant only when- the input format is `markdown`, `markdown_strict`, or `textile`. It- is selected automatically when the input format is `textile` or the- output format is `latex` or `context`, unless `--no-tex-ligatures`- is used.)--`--old-dashes`-: Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes: `-` before- a numeral is an en-dash, and `--` is an em-dash. This option is selected- automatically for `textile` input.--`--base-header-level=`*NUMBER*-: Specify the base level for headers (defaults to 1).--`--indented-code-classes=`*CLASSES*-: Specify classes to use for indented code blocks--for example,- `perl,numberLines` or `haskell`. Multiple classes may be separated- by spaces or commas.--`--default-image-extension=`*EXTENSION*-: 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.--`--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- 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- passed to the filter as the first argument. Hence,-- pandoc --filter ./caps.py -t latex-- is equivalent to-- pandoc -t json | ./caps.py latex | pandoc -f json -t latex-- The latter form may be useful for debugging filters.-- Filters may be written in any language. `Text.Pandoc.JSON`- exports `toJSONFilter` to facilitate writing filters in Haskell.- Those who would prefer to write filters in python can use the- module `pandocfilters`, installable from PyPI. See- <http://github.com/jgm/pandocfilters> for the module and several- examples. Note that the *EXECUTABLE* will be sought in the user's- `PATH`, and not in the working directory, if no directory is- provided. If you want to run a script in the working directory,- preface the filename with `./`.--`-M` *KEY[=VAL]*, `--metadata=`*KEY[:VAL]*-: Set the metadata field *KEY* to the value *VAL*. A value specified- on the command line overrides a value specified in the document.- Values will be parsed as YAML boolean or string values. If no value is- specified, the value will be treated as Boolean true. Like- `--variable`, `--metadata` causes template variables to be set.- But unlike `--variable`, `--metadata` affects the metadata of the- underlying document (which is accessible from filters and may be- printed in some output formats).--`--normalize`-: Normalize the document after reading: merge adjacent- `Str` or `Emph` elements, for example, and remove repeated `Space`s.--`-p`, `--preserve-tabs`-: Preserve tabs instead of converting them to spaces (the default).- Note that this will only affect tabs in literal code spans and code- blocks; tabs in regular text will be treated as spaces.--`--tab-stop=`*NUMBER*-: Specify the number of spaces per tab (default is 4).--`--track-changes=`*accept|reject|all*-: Specifies what to do with insertions and deletions produced by the MS- Word "track-changes" feature. *accept* (the default), inserts all- insertions, and ignores all deletions. *reject* inserts all- deletions and ignores insertions. *all* puts in both insertions- and deletions, wrapped in spans with `insertion` and `deletion`- classes, respectively. The author and time of change is- included. *all* is useful for scripting: only accepting changes- from a certain reviewer, say, or before a certain date. This- option only affects the docx reader.--`--extract-media=`*DIR*-: Extract images and other media contained in a docx or epub container- to the path *DIR*, creating it if necessary, and adjust the images- references in the document so they point to the extracted files.- This option only affects the docx and epub readers.--General writer options-------------------------`-s`, `--standalone`-: Produce output with an appropriate header and footer (e.g. a- standalone HTML, LaTeX, or RTF file, not a fragment). This option- is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`- output.--`--template=`*FILE*-: Use *FILE* as a custom template for the generated document. Implies- `--standalone`. See [Templates](#templates) below for a description- of template syntax. If no extension is specified, an extension- corresponding to the writer will be added, so that `--template=special`- looks for `special.html` for HTML output. If the template is not- found, pandoc will search for it in the user data directory- (see `--data-dir`). If this option is not used, a default- template appropriate for the output format will be used (see- `-D/--print-default-template`).--`-V` *KEY[=VAL]*, `--variable=`*KEY[:VAL]*-: Set the template variable *KEY* to the value *VAL* when rendering the- document in standalone mode. This is generally only useful when the- `--template` option is used to specify a custom template, since- pandoc automatically sets the variables used in the default- templates. If no *VAL* is specified, the key will be given the- value `true`.--`-D` *FORMAT*, `--print-default-template=`*FORMAT*-: Print the default template for an output *FORMAT*. (See `-t`- for a list of possible *FORMAT*s.)--`--print-default-data-file=`*FILE*-: Print a default data file.--`--no-wrap`-: Disable text wrapping in output. By default, text is wrapped- appropriately for the output format.--`--columns`=*NUMBER*-: Specify length of lines in characters (for text wrapping).--`--toc`, `--table-of-contents`-: Include an automatically generated table of contents (or, in- the case of `latex`, `context`, and `rst`, an instruction to create- one) in the output document. This option has no effect on `man`,- `docbook`, `slidy`, `slideous`, `s5`, `docx`, or `odt` output.--`--toc-depth=`*NUMBER*-: Specify the number of section levels to include in the table- of contents. The default is 3 (which means that level 1, 2, and 3- headers will be listed in the contents).--`--no-highlight`-: Disables syntax highlighting for code blocks and inlines, even when- a language attribute is given.--`--highlight-style`=*STYLE*-: Specifies the coloring style to be used in highlighted source code.- Options are `pygments` (the default), `kate`, `monochrome`,- `espresso`, `zenburn`, `haddock`, and `tango`.--`-H` *FILE*, `--include-in-header=`*FILE*-: Include contents of *FILE*, verbatim, at the end of the header.- This can be used, for example, to include special- CSS or javascript in HTML documents. This option can be used- repeatedly to include multiple files in the header. They will be- included in the order specified. Implies `--standalone`.--`-B` *FILE*, `--include-before-body=`*FILE*-: Include contents of *FILE*, verbatim, at the beginning of the- document body (e.g. after the `<body>` tag in HTML, or the- `\begin{document}` command in LaTeX). This can be used to include- navigation bars or banners in HTML documents. This option can be- used repeatedly to include multiple files. They will be included in- the order specified. Implies `--standalone`.--`-A` *FILE*, `--include-after-body=`*FILE*-: Include contents of *FILE*, verbatim, at the end of the document- body (before the `</body>` tag in HTML, or the- `\end{document}` command in LaTeX). This option can be be used- repeatedly to include multiple files. They will be included in the- order specified. Implies `--standalone`.--Options affecting specific writers-------------------------------------`--self-contained`-: Produce a standalone HTML file with no external dependencies, using- `data:` URIs to incorporate the contents of linked scripts, stylesheets,- images, and videos. The resulting file should be "self-contained,"- in the sense that it needs no external files and no net access to be- displayed properly by a browser. This option works only with HTML output- formats, including `html`, `html5`, `html+lhs`, `html5+lhs`, `s5`,- `slidy`, `slideous`, `dzslides`, and `revealjs`. Scripts, images, and- stylesheets at absolute URLs will be downloaded; those at relative URLs- will be sought relative to the working directory (if the first source- file is local) or relative to the base URL (if the first source- file is remote). `--self-contained` does not work with `--mathjax`.--`--offline`-: Deprecated synonym for `--self-contained`.--`-5`, `--html5`-: Produce HTML5 instead of HTML4. This option has no effect for writers- other than `html`. (*Deprecated:* Use the `html5` output format instead.)--`--html-q-tags`-: Use `<q>` tags for quotes in HTML.--`--ascii`-: Use only ascii characters in output. Currently supported only- for HTML output (which uses numerical entities instead of- UTF-8 when this option is selected).--`--reference-links`-: 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- to use setext-style headers for levels 1-2, and then ATX headers.--`--chapters`-: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook- output. When the LaTeX template uses the report, book, or- memoir class, this option is implied. If `beamer` is the output- format, top-level headers will become `\part{..}`.--`-N`, `--number-sections`-: Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.- By default, sections are not numbered. Sections with class- `unnumbered` will never be numbered, even if `--number-sections`- is specified.--`--number-offset`=*NUMBER[,NUMBER,...]*,-: Offset for section headings in HTML output (ignored in other- output formats). The first number is added to the section number for- top-level headers, the second for second-level headers, and so on.- So, for example, if you want the first top-level header in your- document to be numbered "6", specify `--number-offset=5`.- If your document starts with a level-2 header which you want to- be numbered "1.5", specify `--number-offset=1,4`.- Offsets are 0 by default. Implies `--number-sections`.--`--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`.--`--listings`-: Use listings package for LaTeX code blocks--`-i`, `--incremental`-: Make list items in slide shows display incrementally (one by one).- The default is for lists to be displayed all at once.--`--slide-level`=*NUMBER*-: Specifies that headers with the specified level create- slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`). Headers- above this level in the hierarchy are used to divide the- slide show into sections; headers below this level create- subheads within a slide. The default is to set the slide level- based on the contents of the document; see- [Structuring the slide show](#structuring-the-slide-show), below.--`--section-divs`-: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),- and attach identifiers to the enclosing `<div>` (or `<section>`)- rather than the header itself.- See [Section identifiers](#header-identifiers-in-html-latex-and-context), below.--`--email-obfuscation=`*none|javascript|references*-: 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.--`--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.- This is useful for preventing duplicate identifiers when generating- fragments to be included in other pages.--`-T` *STRING*, `--title-prefix=`*STRING*-: Specify *STRING* as a prefix at the beginning of the title- that appears in the HTML header (but not in the title as it- appears at the beginning of the HTML body). Implies- `--standalone`.--`-c` *URL*, `--css=`*URL*-: Link to a CSS style sheet. This option can be be used repeatedly to- include multiple files. They will be included in the order specified.--`--reference-odt=`*FILE*-: Use the specified file as a style reference in producing an ODT.- For best results, the reference ODT should be a modified version- of an ODT produced using pandoc. The contents of the reference ODT- are ignored, but its stylesheets are used in the new ODT. If no- reference ODT is specified on the command line, pandoc will look- for a file `reference.odt` in the user data directory (see- `--data-dir`). If this is not found either, sensible defaults will be- used.--`--reference-docx=`*FILE*-: Use the specified file as a style reference in producing a docx file.- For best results, the reference docx should be a modified version- of a docx file produced using pandoc. The contents of the reference docx- are ignored, but its stylesheets and document properties (including- margins, page size, header, and footer) are used in the new docx. If no- reference docx is specified on the command line, pandoc will look- for a file `reference.docx` in the user data directory (see- `--data-dir`). If this is not found either, sensible defaults will be- used. The following styles are used by pandoc: [paragraph]- Normal, Compact, Title, Subtitle, Authors, Date, Abstract, Heading 1,- Heading 2, Heading 3, Heading 4, Heading 5, Block Quote, Definition Term,- Definition, Bibliography, Body Text, Table Caption, Image Caption;- [character] Default Paragraph Font, Body Text Char, Verbatim Char,- Footnote Ref, Link.--`--epub-stylesheet=`*FILE*-: Use the specified CSS file to style the EPUB. If no stylesheet- is specified, pandoc will look for a file `epub.css` in the- user data directory (see `--data-dir`). If it is not- found there, sensible defaults will be used.--`--epub-cover-image=`*FILE*-: 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 YAML metadata block (see [EPUB Metadata], below).--`--epub-metadata=`*FILE*-: Look in the specified XML file for metadata for the EPUB.- The file should contain a series of Dublin Core elements,- as documented at <http://dublincore.org/documents/dces/>.- For example:-- <dc:rights>Creative Commons</dc:rights>- <dc:language>es-AR</dc:language>-- By default, pandoc will include the following metadata elements:- `<dc:title>` (from the document title), `<dc:creator>` (from the- document authors), `<dc:date>` (from the document date, which should- be in [ISO 8601 format]), `<dc:language>` (from the `lang`- variable, or, if is not set, the locale), and `<dc:identifier- 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- in the document can be used instead. See below under- [EPUB Metadata].--`--epub-embed-font=`*FILE*-: Embed the specified font in the EPUB. This option can be repeated- to embed multiple fonts. To use embedded fonts, you- will need to add declarations like the following to your CSS (see- `--epub-stylesheet`):-- @font-face {- font-family: DejaVuSans;- font-style: normal;- font-weight: normal;- src:url("DejaVuSans-Regular.ttf");- }- @font-face {- font-family: DejaVuSans;- font-style: normal;- font-weight: bold;- src:url("DejaVuSans-Bold.ttf");- }- @font-face {- font-family: DejaVuSans;- font-style: italic;- font-weight: normal;- src:url("DejaVuSans-Oblique.ttf");- }- @font-face {- font-family: DejaVuSans;- font-style: italic;- font-weight: bold;- src:url("DejaVuSans-BoldOblique.ttf");- }- body { font-family: "DejaVuSans"; }--`--epub-chapter-level=`*NUMBER*-: Specify the header level at which to split the EPUB into separate- "chapter" files. The default is to split into chapters at level 1- headers. This option only affects the internal composition of the- EPUB, not the way chapters and sections are displayed to users. Some- readers may be slow if the chapter files are too large, so for large- documents with few level 1 headers, one might want to use a chapter- level of 2 or 3.--`--latex-engine=`*pdflatex|lualatex|xelatex*-: Use the specified LaTeX engine when producing PDF output.- The default is `pdflatex`. If the engine is not in your PATH,- the full path of the engine may be specified here.--Citation rendering---------------------`--bibliography=`*FILE*-: Set the `bibliography` field in the document's metadata to *FILE*,- overriding any value set in the metadata, and process citations- using `pandoc-citeproc`. (This is equivalent to- `--metadata bibliography=FILE --filter pandoc-citeproc`.)--`--csl=`*FILE*-: Set the `csl` field in the document's metadata to *FILE*,- overriding any value set in the metadata. (This is equivalent to- `--metadata csl=FILE`.)--`--citation-abbreviations=`*FILE*-: Set the `citation-abbreviations` field in the document's metadata to- *FILE*, overriding any value set in the metadata. (This is equivalent to- `--metadata citation-abbreviations=FILE`.)--`--natbib`-: Use natbib for citations in LaTeX output. This option is not for use- with the `pandoc-citeproc` filter or with PDF output. It is intended for- use in producing a LaTeX file that can be processed with pdflatex and- bibtex.--`--biblatex`-: Use biblatex for citations in LaTeX output. This option is not for use- with the `pandoc-citeproc` filter or with PDF output. It is intended for- use in producing a LaTeX file that can be processed with pdflatex and- bibtex or biber.--Math rendering in HTML-------------------------`-m` [*URL*], `--latexmathml`[=*URL*]-: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.- To insert a link to a local copy of the `LaTeXMathML.js` script,- provide a *URL*. If no *URL* is provided, the contents of the- script will be inserted directly into the HTML header, preserving- portability at the price of efficiency. If you plan to use math on- several pages, it is much better to link to a copy of the script,- so it can be cached.--`--mathml`[=*URL*]-: Convert TeX math to MathML (in `docbook` as well as `html` and `html5`).- In standalone `html` output, a small javascript (or a link to such a- script if a *URL* is supplied) will be inserted that allows the MathML to- be viewed on some browsers.--`--jsmath`[=*URL*]-: Use [jsMath] to display embedded TeX math in HTML output.- The *URL* should point to the jsMath load script (e.g.- `jsMath/easy/load.js`); if provided, it will be linked to in- the header of standalone HTML documents. If a *URL* is not provided,- no link to the jsMath load script will be inserted; it is then- up to the author to provide such a link in the HTML template.--`--mathjax`[=*URL*]-: Use [MathJax] to display embedded TeX math in HTML output.- The *URL* should point to the `MathJax.js` load script.- If a *URL* is not provided, a link to the MathJax CDN will- be inserted.--`--gladtex`-: Enclose TeX math in `<eq>` tags in HTML output. These can then- be processed by [gladTeX] to produce links to images of the typeset- formulas.--`--mimetex`[=*URL*]-: Render TeX math using the [mimeTeX] CGI script. If *URL* is not- specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.--`--webtex`[=*URL*]-: Render TeX formulas using an external script that converts TeX- formulas to images. The formula will be concatenated with the URL- provided. If *URL* is not specified, the Google Chart API will be used.--Options for wrapper scripts------------------------------`--dump-args`-: Print information about command-line arguments to *stdout*, then exit.- This option is intended primarily for use in wrapper scripts.- The first line of output contains the name of the output file specified- 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- 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,-- pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1-- is equivalent to-- pandoc -o foo.html -s--[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/-[jsMath]: http://www.math.union.edu/~dpvc/jsmath/-[MathJax]: http://www.mathjax.org/-[gladTeX]: http://ans.hsh.no/home/mgg/gladtex/-[mimeTeX]: http://www.forkosh.com/mimetex.html-[CSL]: http://CitationStyles.org--Templates-=========--When the `-s/--standalone` option is used, pandoc uses a template to-add header and footer material that is needed for a self-standing-document. To see the default template that is used, just type-- pandoc -D FORMAT--where `FORMAT` is the name of the output format. A custom template-can be specified using the `--template` option. You can also override-the system default templates for a given output format `FORMAT`-by putting a file `templates/default.FORMAT` in the user data-directory (see `--data-dir`, above). *Exceptions:* For `odt` output,-customize the `default.opendocument` template. For `pdf` output,-customize the `default.latex` template.--Templates may contain *variables*. Variable names are sequences of-alphanumerics, `-`, and `_`, starting with a letter. A variable name-surrounded by `$` signs will be replaced by its value. For example,-the string `$title$` in-- <title>$title$</title>--will be replaced by the document title.--To write a literal `$` in a template, use `$$`.--Some variables are set automatically by pandoc. These vary somewhat-depending on the output format, but include metadata fields (such-as `title`, `author`, and `date`) as well as the following:--`header-includes`-: contents specified by `-H/--include-in-header` (may have multiple- values)--`toc`-: non-null value if `--toc/--table-of-contents` was specified--`include-before`-: contents specified by `-B/--include-before-body` (may have- multiple values)--`include-after`-: contents specified by `-A/--include-after-body` (may have- multiple values)--`body`-: body of document--`lang`-: language code for HTML or LaTeX documents--`slidy-url`-: base URL for Slidy documents (defaults to- `http://www.w3.org/Talks/Tools/Slidy2`)--`slideous-url`-: base URL for Slideous documents (defaults to `slideous`)--`s5-url`-: base URL for S5 documents (defaults to `s5/default`)--`revealjs-url`-: base URL for reveal.js documents (defaults to `reveal.js`)--`theme`-: reveal.js or LaTeX beamer theme--`transition`-: reveal.js transition--`fontsize`-: font size (10pt, 11pt, 12pt) for LaTeX documents--`documentclass`-: document class for LaTeX documents--`classoption`-: option for LaTeX documentclass, e.g. `oneside`; may be repeated- for multiple options--`geometry`-: options for LaTeX `geometry` class, e.g. `margin=1in`;- may be repeated for multiple options--`linestretch`-: adjusts line spacing (requires the `setspace` package)--`fontfamily`-: font package to use for LaTeX documents (with pdflatex):- TeXLive has `bookman` (Bookman), `utopia` or `fourier` (Utopia),- `fouriernc` (New Century Schoolbook), `times` or `txfonts` (Times),- `mathpazo` or `pxfonts` or `mathpple` (Palatino),- `libertine` (Linux Libertine), `arev` (Arev Sans),- and the default `lmodern`, among others.--`mainfont`, `sansfont`, `monofont`, `mathfont`-: fonts for LaTeX documents (works only with xelatex- and lualatex)--`colortheme`-: colortheme for LaTeX beamer documents--`fonttheme`-: fonttheme for LaTeX beamer documents--`linkcolor`-: color for internal links in LaTeX documents (`red`, `green`,- `magenta`, `cyan`, `blue`, `black`)--`urlcolor`-: color for external links in LaTeX documents--`citecolor`-: color for citation links in LaTeX documents--`links-as-notes`-: causes links to be printed as footnotes in LaTeX documents--`toc`-: include table of contents in LaTeX documents--`toc-depth`-: level of section to include in table of contents in LaTeX documents--`lof`-: include list of figures in LaTeX documents--`lot`-: include list of tables in LaTeX documents--`biblio-style`-: bibliography style in LaTeX, when used with `--natbib`--`biblio-files`-: bibliography files to use in LaTeX, with `--natbib` or `--biblatex`--`section`-: section number in man pages--`header`-: header in man pages--`footer`-: footer in man pages--Variables may be set at the command line using the `-V/--variable`-option. Variables set in this way override metadata fields with-the same name.--Templates may contain conditionals. The syntax is as follows:-- $if(variable)$- X- $else$- Y- $endif$--This will include `X` in the template if `variable` has a non-null-value; otherwise it will include `Y`. `X` and `Y` are placeholders for-any valid template text, and may include interpolated variables or other-conditionals. The `$else$` section may be omitted.--When variables can have multiple values (for example, `author` in-a multi-author document), you can use the `$for$` keyword:-- $for(author)$- <meta name="author" content="$author$" />- $endfor$--You can optionally specify a separator to be used between-consecutive items:-- $for(author)$$author$$sep$, $endfor$--A dot can be used to select a field of a variable that takes-an object as its value. So, for example:-- $author.name$ ($author.affiliation$)--If you use custom templates, you may need to revise them as pandoc-changes. We recommend tracking the changes in the default templates,-and modifying your custom templates accordingly. An easy way to do this-is to fork the pandoc-templates repository-(<http://github.com/jgm/pandoc-templates>) and merge in changes after each-pandoc release.--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-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-enabled, while `markdown-footnotes-pipe_tables` is pandoc's-markdown without footnotes or pipe tables.--Philosophy-------------Markdown is designed to be easy to write, and, even more importantly,-easy to read:--> A Markdown-formatted document should be publishable as-is, as plain-> text, without looking like it's been marked up with tags or formatting-> instructions.-> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)--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-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 elements like definition lists, tables, mathematics, and-footnotes.--Paragraphs-------------A paragraph is one or more lines of text followed by one or more blank line.-Newlines are treated as spaces, so you can reflow your paragraphs as you like.-If you need a hard line break, put two or more spaces at the end of a line.--#### Extension: `escaped_line_breaks` ####--A backslash followed by a newline is also a hard line break.-Note: in multiline and grid table cells, this is the only way-to create a hard line break, since trailing spaces in the cells-are ignored.--Headers----------There are two kinds of headers, Setext and atx.--### Setext-style headers ###--A setext-style header is a line of text "underlined" with a row of `=` signs-(for a level one header) or `-` signs (for a level two header):-- A level-one header- ==================-- A level-two header- --------------------The header text can contain inline formatting, such as emphasis (see-[Inline formatting](#inline-formatting), below).---### Atx-style headers ###--An Atx-style header consists of one to six `#` signs and a line of-text, optionally followed by any number of `#` signs. The number of-`#` signs at the beginning of the line is the header level:-- ## A level-two header-- ### A level-three header ###--As with setext-style headers, the header text can contain formatting:-- # A level-one header with a [link](/url) and *emphasis*--#### Extension: `blank_before_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-wrapping). Consider, for example:-- I like several of their flavors of ice cream:- #22, for example, and #5.---### Header identifiers in HTML, LaTeX, and ConTeXt ###--#### Extension: `header_attributes` ####--Headers can be assigned attributes using this syntax at the end-of the line containing the header text:-- {#identifier .class .class key=value key=value}--Thus, for example, the following headers will all be assigned the identifier-`foo`:-- # My header {#foo}-- ## My header ## {#foo}-- My other header {#foo}- -----------------(This syntax is compatible with [PHP Markdown Extra].)--Note that although this syntax allows assignment of classes and key/value-attributes, writers generally don't use all of this information. Identifiers,-classes, and key/value attributes are used in HTML and HTML-based formats such-as EPUB and slidy. Identifiers are used for labels and link anchors in the-LaTeX, ConTeXt, Textile, and AsciiDoc writers.--Headers with the class `unnumbered` will not be numbered, even if-`--number-sections` is specified. A single hyphen (`-`) in an attribute-context is equivalent to `.unnumbered`, and preferable in non-English-documents. So,-- # My header {-}--is just the same as-- # My header {.unnumbered}--#### Extension: `auto_identifiers` ####--A header without an explicitly specified identifier will be-automatically assigned a unique identifier based on the header text.-To derive the identifier from the header text,-- - Remove all formatting, links, etc.- - Remove all footnotes.- - Remove all punctuation, except underscores, hyphens, and periods.- - Replace all spaces and newlines with hyphens.- - Convert all alphabetic characters to lowercase.- - Remove everything up to the first letter (identifiers may- not begin with a number or punctuation mark).- - If nothing is left after this, use the identifier `section`.--Thus, for example,-- Header Identifier- ------------------------------- ----------------------------- Header identifiers in HTML `header-identifiers-in-html`- *Dogs*?--in *my* house? `dogs--in-my-house`- [HTML], [S5], or [RTF]? `html-s5-or-rtf`- 3. Applications `applications`- 33 `section`--These rules should, in most cases, allow one to determine the identifier-from the header text. The exception is when several headers have the-same text; in this case, the first will get an identifier as described-above; the second will get the same identifier with `-1` appended; the-third with `-2`; and so on.--These identifiers are used to provide link targets in the table of-contents generated by the `--toc|--table-of-contents` option. They-also make it easy to provide links from one section of a document to-another. A link to this section, for example, might look like this:-- See the section on- [header identifiers](#header-identifiers-in-html-latex-and-context).--Note, however, that this method of providing links to sections works-only in HTML, LaTeX, and ConTeXt formats.--If the `--section-divs` option is specified, then each section will-be wrapped in a `div` (or a `section`, if `--html5` was specified),-and the identifier will be attached to the enclosing `<div>`-(or `<section>`) tag rather than the header itself. This allows entire-sections to be manipulated using javascript or treated differently in-CSS.--#### Extension: `implicit_header_references` ####--Pandoc behaves as if reference links have been defined for each header.-So, instead of-- [header identifiers](#header-identifiers-in-html)--you can simply write-- [header identifiers]--or-- [header identifiers][]--or-- [the section on header identifiers][header identifiers]--If there are multiple headers with identical text, the corresponding-reference will link to the first one only, and you will need to use explicit-links to link to the others, as described above.--Unlike regular reference links, these references are case-sensitive.--Note: if you have defined an explicit identifier for a header,-then implicit references to it will not work.--Block quotations-------------------Markdown uses email conventions for quoting blocks of text.-A block quotation is one or more paragraphs or other block elements-(such as lists or headers), with each line preceded by a `>` character-and a space. (The `>` need not start at the left margin, but it should-not be indented more than three spaces.)-- > This is a block quote. This- > paragraph has two lines.- >- > 1. This is a list inside a block quote.- > 2. Second item.--A "lazy" form, which requires the `>` character only on the first-line of each block, is also allowed:-- > This is a block quote. This- paragraph has two lines.-- > 1. This is a list inside a block quote.- 2. Second item.--Among the block elements that can be contained in a block quote are-other block quotes. That is, block quotes can be nested:-- > This is a block quote.- >- > > A block quote within a block quote.--#### Extension: `blank_before_blockquote` ####--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-wrapping). So, unless the `markdown_strict` format is used, the following does-not produce a nested block quote in pandoc:-- > This is a block quote.- >> Nested.---Verbatim (code) blocks-------------------------### Indented code blocks ###--A block of text indented four spaces (or one tab) is treated as verbatim-text: that is, special characters do not trigger special formatting,-and all spaces and line breaks are preserved. For example,-- if (a > 3) {- moveShip(5 * gravity, DOWN);- }--The initial (four space or one tab) indentation is not considered part-of the verbatim text, and is removed in the output.--Note: blank lines in the verbatim text need not begin with four spaces.---### Fenced code blocks ###--#### Extension: `fenced_code_blocks` ####--In addition to standard indented code blocks, Pandoc supports-*fenced* code blocks. These begin with a row of three or more-tildes (`~`) or backticks (`` ` ``) and end with a row of tildes or-backticks that must be at least as long as the starting row. Everything-between these lines is treated as code. No indentation is necessary:-- ~~~~~~~- if (a > 3) {- moveShip(5 * gravity, DOWN);- }- ~~~~~~~--Like regular code blocks, fenced code blocks must be separated-from surrounding text by blank lines.--If the code itself contains a row of tildes or backticks, just use a longer-row of tildes or backticks at the start and end:-- ~~~~~~~~~~~~~~~~- ~~~~~~~~~~- code including tildes- ~~~~~~~~~~- ~~~~~~~~~~~~~~~~--#### Extension: `fenced_code_attributes` ####--Optionally, you may attach attributes to the code block using-this syntax:-- ~~~~ {#mycode .haskell .numberLines startFrom="100"}- qsort [] = []- qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++- qsort (filter (>= x) xs)- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and-`startFrom` is an attribute with value `100`. Some output formats can use this-information to do syntax highlighting. Currently, the only output formats-that uses this information are HTML and LaTeX. If highlighting is supported-for your output format and language, then the code block above will appear-highlighted, with numbered lines. (To see which languages are supported, do-`pandoc --version`.) Otherwise, the code block above will appear as follows:-- <pre id="mycode" class="haskell numberLines" startFrom="100">- <code>- ...- </code>- </pre>--A shortcut form can also be used for specifying the language of-the code block:-- ```haskell- qsort [] = []- ```--This is equivalent to:-- ``` {.haskell}- qsort [] = []- ```--If the `fenced_code_attributes` extension is disabled, but-input contains class attribute(s) for the codeblock, the first-class attribute will be printed after the opening fence as a bare-word.--To prevent all highlighting, use the `--no-highlight` flag.-To set the highlighting style, use `--highlight-style`.--Line blocks--------------#### Extension: `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:-- | The limerick packs laughs anatomical- | In space that is quite economical.- | But the good ones I've seen- | So seldom are clean- | And the clean ones so seldom are comical-- | 200 Main St.- | Berkeley, CA 94718--The lines can be hard-wrapped if needed, but the continuation-line must begin with a space.-- | The Right Honorable Most Venerable and Righteous Samuel L.- Constable, Jr.- | 200 Main St.- | Berkeley, CA 94718--This syntax is borrowed from [reStructuredText].--Lists--------### Bullet lists ###--A bullet list is a list of bulleted list items. A bulleted list-item begins with a bullet (`*`, `+`, or `-`). Here is a simple-example:-- * one- * two- * three--This will produce a "compact" list. If you want a "loose" list, in which-each item is formatted as a paragraph, put spaces between the items:-- * one-- * two-- * three--The bullets need not be flush with the left margin; they may be-indented one, two, or three spaces. The bullet must be followed-by whitespace.--List items look best if subsequent lines are flush with the first-line (after the bullet):-- * here is my first- list item.- * and my second.--But markdown also allows a "lazy" format:-- * here is my first- list item.- * and my second.--### The four-space rule ###--A list item may contain multiple paragraphs and other block-level-content. However, subsequent paragraphs must be preceded by a blank line-and indented four spaces or a tab. The list will look better if the first-paragraph is aligned with the rest:-- * First paragraph.-- Continued.-- * Second paragraph. With a code block, which must be indented- eight spaces:-- { code }--List items may include other lists. In this case the preceding blank-line is optional. The nested list must be indented four spaces or-one tab:-- * fruits- + apples- - macintosh- - red delicious- + pears- + peaches- * vegetables- + broccoli- + chard--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.-- + A lazy, lazy, list- item.-- + Another one; this looks- bad but is legal.-- Second paragraph of second- list item.--**Note:** Although the four-space rule for continuation paragraphs-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-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]:- http://daringfireball.net/projects/markdown/syntax#list--### Ordered lists ###--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-by a period and a space. The numbers themselves are ignored, so-there is no difference between this list:-- 1. one- 2. two- 3. three--and this one:-- 5. one- 7. two- 1. three--#### Extension: `fancy_lists` ####--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-text that follows by at least one space, and, if the list marker is a-capital letter with a period, by at least two spaces.[^2]--[^2]: The point of this rule is to ensure that normal paragraphs- starting with people's initials, like-- B. Russell was an English philosopher.-- do not get treated as list items.-- This rule will not prevent-- (C) 2007 Joe Smith-- from being interpreted as a list item. In this case, a backslash- escape can be used:-- (C\) 2007 Joe Smith--The `fancy_lists` extension also allows '`#`' to be used as an-ordered list marker in place of a numeral:-- #. one- #. two--#### Extension: `startnum` ####--Pandoc also pays attention to the type of list marker used, and to the-starting number, and both of these are preserved where possible in the-output format. Thus, the following yields a list with numbers followed-by a single parenthesis, starting with 9, and a sublist with lowercase-roman numerals:-- 9) Ninth- 10) Tenth- 11) Eleventh- i. subone- ii. subtwo- iii. subthree--Pandoc will start a new list each time a different type of list-marker is used. So, the following will create three lists:-- (2) Two- (5) Three- 1. Four- * Five--If default list markers are desired, use `#.`:-- #. one- #. two- #. three---### Definition lists ###--#### Extension: `definition_lists` ####--Pandoc supports definition lists, using the syntax of-[PHP Markdown Extra] with some extensions.[^3]-- Term 1-- : Definition 1-- Term 2 with *inline markup*-- : Definition 2-- { some code, part of Definition 2 }-- Third paragraph of definition 2.--Each term must fit on one line, which may optionally be followed by-a blank line, and must be followed by one or more definitions.-A definition begins with a colon or tilde, which may be indented one-or two spaces.--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-at the beginning of a paragraph or other block element:-- Term 1-- : Definition- with lazy continuation.-- Second paragraph of the definition.--If you leave space before the definition (as in the example above),-the text of the definition will be treated as a paragraph. In some-output formats, this will mean greater spacing between term/definition-pairs. For a more compact definition list, omit the space before the-definition:-- Term 1- ~ Definition 1-- Term 2- ~ Definition 2a- ~ Definition 2b--Note that space between items in a definition list is required.-(A variant that loosens this requirement, but disallows "lazy"-hard wrapping, can be activated with `compact_definition_lists`: see-[Non-pandoc extensions](#non-pandoc-extensions), below.)--[^3]: I have been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).--[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/---### Numbered example lists ###--#### Extension: `example_lists` ####--The special list marker `@` can be used for sequentially numbered-examples. The first list item with a `@` marker will be numbered '1',-the next '2', and so on, throughout the document. The numbered examples-need not occur in a single list; each new list using `@` will take up-where the last stopped. So, for example:-- (@) My first example will be numbered (1).- (@) My second example will be numbered (2).-- Explanation of examples.-- (@) My third example will be numbered (3).--Numbered examples can be labeled and referred to elsewhere in the-document:-- (@good) This is a good example.-- As (@good) illustrates, ...--The label can be any string of alphanumeric characters, underscores,-or hyphens.---### Compact and loose lists ###--Pandoc behaves differently from `Markdown.pl` on some "edge-cases" involving lists. Consider this source:-- + First- + Second:- - Fee- - Fie- - Foe-- + Third--Pandoc transforms this into a "compact list" (with no `<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,-even though it is different from that of `Markdown.pl`.)---### Ending a list ###--What if you want to put an indented code block after a list?-- - item one- - item two-- { my code block }--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.--To "cut off" the list after item two, you can insert some non-indented-content, like an HTML comment, which won't produce visible output in-any format:-- - item one- - item two-- <!-- end of list -->-- { my code block }--You can use the same trick if you want two consecutive lists instead-of one big list:-- 1. one- 2. two- 3. three-- <!-- -->-- 1. uno- 2. dos- 3. tres--Horizontal rules-------------------A line containing a row of three or more `*`, `-`, or `_` characters-(optionally separated by spaces) produces a horizontal rule:-- * * * *-- ------------------Tables---------Four kinds of tables may be used. The first three kinds presuppose the use of-a fixed-width font, such as Courier. The fourth kind can be used with-proportionally spaced fonts, as it does not require lining up columns.--#### Extension: `table_captions` ####--A caption may optionally be provided with all 4 kinds of tables (as -illustrated in the examples below). A caption is a paragraph beginning-with the string `Table:` (or just `:`), which will be stripped off.-It may appear either before or after the table.--#### Extension: `simple_tables` ####--Simple tables look like this:-- Right Left Center Default- ------- ------ ---------- -------- 12 12 12 12- 123 123 123 123- 1 1 1 1-- Table: Demonstration of simple table syntax.--The headers and table rows must each fit on one line. Column-alignments are determined by the position of the header text relative-to the dashed line below it:[^4]-- - If the dashed line is flush with the header text on the right side- but extends beyond it on the left, the column is right-aligned.- - If the dashed line is flush with the header text on the left side- but extends beyond it on the right, the column is left-aligned.- - If the dashed line extends beyond the header text on both sides,- the column is centered.- - If the dashed line is flush with the header text on both sides,- the default alignment is used (in most cases, this will be left).--[^4]: This scheme is due to Michel Fortin, who proposed it on the- [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).--The table must end with a blank line, or a line of dashes followed by-a blank line.--The column headers may be omitted, provided a dashed line is used-to end the table. For example:-- ------- ------ ---------- -------- 12 12 12 12- 123 123 123 123- 1 1 1 1- ------- ------ ---------- ---------When headers are omitted, column alignments are determined on the basis-of the first line of the table body. So, in the tables above, the columns-would be right, left, center, and right aligned, respectively.--#### Extension: `multiline_tables` ####--Multiline tables allow headers and table rows to span multiple lines-of text (but cells that span multiple columns or rows of the table are-not supported). Here is an example:-- -------------------------------------------------------------- Centered Default Right Left- Header Aligned Aligned Aligned- ----------- ------- --------------- -------------------------- First row 12.0 Example of a row that- spans multiple lines.-- Second row 5.0 Here's another one. Note- the blank line between- rows.- --------------------------------------------------------------- Table: Here's the caption. It, too, may span- multiple lines.--These work like simple tables, but with the following differences:-- - They must begin with a row of dashes, before the header text- (unless the headers are omitted).- - They must end with a row of dashes, then a blank line.- - The rows must be separated by blank lines.--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.--Headers may be omitted in multiline tables as well as simple tables:-- ----------- ------- --------------- -------------------------- First row 12.0 Example of a row that- spans multiple lines.-- Second row 5.0 Here's another one. Note- the blank line between- rows.- ----------- ------- --------------- --------------------------- : Here's a multiline table without headers.--It is possible for a multiline table to have just one row, but the row-should be followed by a blank line (and then the row of dashes that ends-the table), or the table may be interpreted as a simple table.--#### Extension: `grid_tables` ####--Grid tables look like this:-- : Sample grid table.-- +---------------+---------------+--------------------+- | Fruit | Price | Advantages |- +===============+===============+====================+- | Bananas | $1.34 | - built-in wrapper |- | | | - bright color |- +---------------+---------------+--------------------+- | Oranges | $2.10 | - cures scurvy |- | | | - tasty |- +---------------+---------------+--------------------+--The row of `=`s separates the header from the table body, and can be-omitted for a headerless table. The cells of grid tables may contain-arbitrary block elements (multiple paragraphs, code blocks, lists,-etc.). Alignments are not supported, nor are cells that span multiple-columns or rows. Grid tables can be created easily using [Emacs table mode].-- [Emacs table mode]: http://table.sourceforge.net/--#### Extension: `pipe_tables` ####--Pipe tables look like this:-- | Right | Left | Default | Center |- |------:|:-----|---------|:------:|- | 12 | 12 | 12 | 12 |- | 123 | 123 | 123 | 123 |- | 1 | 1 | 1 | 1 |-- : Demonstration of pipe table syntax.--The syntax is [the same as in PHP markdown extra]. The beginning and-ending pipe characters are optional, but pipes are required between all-columns. The colons indicate column alignment as shown. The header-can be omitted, but the horizontal line must still be included, as-it defines column alignments.--Since the pipes indicate column boundaries, columns need not be vertically-aligned, as they are in the above example. So, this is a perfectly-legal (though ugly) pipe table:-- fruit| price- -----|-----:- apple|2.05- pear|1.37- orange|3.09--The cells of pipe tables cannot contain block elements like paragraphs-and lists, and cannot span multiple lines. Note also that in LaTeX/PDF-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.-- [the same as in PHP markdown extra]:- http://michelf.ca/projects/php-markdown/extra/#table--Note: Pandoc also recognizes pipe tables of the following-form, as can produced by Emacs' orgtbl-mode:-- | One | Two |- |-----+-------|- | my | table |- | is | nice |--The difference is that `+` is used instead of `|`. Other orgtbl features-are not supported. In particular, to get non-default column alignment,-you'll need to add colons as above.--Metadata blocks------------------#### Extension: `pandoc_title_block` ####--If the file begins with a title block-- % title- % author(s) (separated by semicolons)- % date--it will be parsed as bibliographic information, not regular text. (It-will be used, for example, in the title of standalone LaTeX or HTML-output.) The block may contain just a title, a title and an author,-or all three elements. If you want to include an author but no-title, or a title and a date but no author, you need a blank line:-- %- % Author-- % My title- %- % June 15, 2006--The title may occupy multiple lines, but continuation lines must-begin with leading space, thus:-- % My title- on multiple lines--If a document has multiple authors, the authors may be put on-separate lines with leading space, or separated by semicolons, or-both. So, all of the following are equivalent:-- % Author One- Author Two-- % Author One; Author Two-- % Author One;- Author Two--The date must fit on one line.--All three metadata fields may contain standard inline formatting-(italics, links, footnotes, etc.).--Title blocks will always be parsed, but they will affect the output only-when the `--standalone` (`-s`) option is chosen. In HTML output, titles-will appear twice: once in the document head -- this is the title that-will appear at the top of the window in a browser -- and once at the-beginning of the document body. The title in the document head can have-an optional prefix attached (`--title-prefix` or `-T` option). The title-in the body appears as an H1 element with class "title", so it can be-suppressed or reformatted with CSS. If a title prefix is specified with-`-T` and no title block appears in the document, the title prefix will-be used by itself as the HTML title.--The man page writer extracts a title, man page section number, and-other header and footer information from the title line. The title-is assumed to be the first word on the title line, which may optionally-end with a (single-digit) section number in parentheses. (There should-be no space between the title and the parentheses.) Anything after-this is assumed to be additional footer and header text. A single pipe-character (`|`) should be used to separate the footer text from the header-text. Thus,-- % PANDOC(1)--will yield a man page with the title `PANDOC` and section 1.-- % PANDOC(1) Pandoc User Manuals--will also have "Pandoc User Manuals" in the footer.-- % PANDOC(1) Pandoc User Manuals | Version 4.0--will also have "Version 4.0" in the header.--#### Extension: `yaml_metadata_block` ####--A YAML metadata block is a valid YAML object, delimited by a line of three-hyphens (`---`) at the top and a line of three hyphens (`---`) or three dots-(`...`) at the bottom. 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 files:-- pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html--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-with names ending in an underscore will be ignored by pandoc. (They may be-given a role by external processors.)--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.--Note that YAML escaping rules must be followed. Thus, for example,-if a title contains a colon, it must be quoted. The pipe character-(`|`) can be used to begin an indented block that will be interpreted-literally, without need for escaping. This form is necessary-when the field contains blank lines:-- ---- title: 'This is the title: it contains a colon'- author:- - name: Author One- affiliation: University of Somewhere- - name: Author Two- affiliation: University of Nowhere- tags: [nothing, nothingness]- abstract: |- This is the abstract.-- It consists of two paragraphs.- ...--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:-- <p>This is the abstract.</p>- <p>It consists of two paragraphs.</p>--Note: The `author` variable in the default templates expects a simple list or-string. To use the structured authors in the example, you would need a-custom template. For example:-- $for(author)$- $if(author.name)$- $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$- $else$- $author$- $endif$- $endfor$---Backslash escapes--------------------#### Extension: `all_symbols_escapable` ####--Except inside a code block or inline code, any punctuation or space-character preceded by a backslash will be treated literally, even if it-would normally indicate formatting. Thus, for example, if one writes-- *\*hello\**--one will get-- <em>*hello*</em>--instead of-- <strong>hello</strong>--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-will be used.)--A backslash-escaped space is parsed as a nonbreaking space. It will-appear in TeX output as `~` and in HTML and XML as `\ ` 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-two trailing spaces on a line.--Backslash escapes do not work in verbatim contexts.--Smart punctuation--------------------#### Extension ####--If the `--smart` option is specified, pandoc will produce typographically-correct output, converting straight quotes to curly quotes, `---` to-em-dashes, `--` to en-dashes, and `...` to ellipses. Nonbreaking spaces-are inserted after certain abbreviations, such as "Mr."--Note: if your LaTeX template uses the `csquotes` package, pandoc will-detect automatically this and use `\enquote{...}` for quoted text.--Inline formatting--------------------### Emphasis ###--To *emphasize* some text, surround it with `*`s or `_`, like this:-- This text is _emphasized with underscores_, and this- is *emphasized with asterisks*.--Double `*` or `_` produces **strong emphasis**:-- This is **strong emphasis** and __with underscores__.--A `*` or `_` character surrounded by spaces, or backslash-escaped,-will not trigger emphasis:-- This is * not emphasized *, and \*neither is this\*.--#### Extension: `intraword_underscores` ####--Because `_` is sometimes used inside words and identifiers,-pandoc does not interpret a `_` surrounded by alphanumeric-characters as an emphasis marker. If you want to emphasize-just part of a word, use `*`:-- feas*ible*, not feas*able*.---### Strikeout ###--#### Extension: `strikeout` ####--To strikeout a section of text with a horizontal line, begin and end it-with `~~`. Thus, for example,-- This ~~is deleted text.~~---### Superscripts and subscripts ###--#### Extension: `superscript`, `subscript` ####--Superscripts may be written by surrounding the superscripted text by `^`-characters; subscripts may be written by surrounding the subscripted-text by `~` characters. Thus, for example,-- H~2~O is a liquid. 2^10^ is 1024.--If the superscripted or subscripted text contains spaces, these spaces-must be escaped with backslashes. (This is to prevent accidental-superscripting and subscripting through the ordinary use of `~` and `^`.)-Thus, if you want the letter P with 'a cat' in subscripts, use-`P~a\ cat~`, not `P~a cat~`.---### Verbatim ###--To make a short span of text verbatim, put it inside backticks:-- What is the difference between `>>=` and `>>`?--If the verbatim text includes a backtick, use double backticks:-- Here is a literal backtick `` ` ``.--(The spaces after the opening backticks and before the closing-backticks will be ignored.)--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).--Note that backslash-escapes (and other markdown constructs) do not-work in verbatim contexts:-- This is a backslash followed by an asterisk: `\*`.--#### Extension: `inline_code_attributes` ####--Attributes can be attached to verbatim text, just as with-[fenced code blocks](#fenced-code-blocks):-- `<$>`{.haskell}--### Small caps ###--To write small caps, you can use an HTML span tag:-- <span style="font-variant:small-caps;">Small caps</span>--(The semicolon is optional and there may be space after the-colon.) This will work in all output formats that support small caps.--Math-------#### Extension: `tex_math_dollars` ####--Anything between two `$` characters will be treated as TeX math. The-opening `$` must have a character immediately to its right, while the-closing `$` must have a character immediately to its left. Thus,-`$20,000 and $30,000` won't parse as math. If for some reason-you need to enclose text in literal `$` characters, backslash-escape-them and they won't be treated as math delimiters.--TeX math will be printed in all output formats. How it is rendered-depends on the output format:--Markdown, LaTeX, Org-Mode, ConTeXt- ~ It will appear verbatim between `$` characters.--reStructuredText- ~ It will be rendered using an interpreted text role `:math:`, as described- [here](http://www.american.edu/econ/itex2mml/mathhack.rst).--AsciiDoc- ~ It will be rendered as `latexmath:[...]`.--Texinfo- ~ It will be rendered inside a `@math` command.--groff man- ~ It will be rendered verbatim without `$`'s.--MediaWiki, DokuWiki- ~ It will be rendered inside `<math>` tags.--Textile- ~ It will be rendered inside `<span class="math">` tags.--RTF, OpenDocument, ODT- ~ It will be rendered, if possible, using unicode characters,- and will otherwise appear verbatim.--Docbook- ~ If the `--mathml` flag is used, it will be rendered using mathml- in an `inlineequation` or `informalequation` tag. Otherwise it- will be rendered, if possible, using unicode characters.--Docx- ~ It will be rendered using OMML math markup.--FictionBook2- ~ If the `--webtex` option is used, formulas are rendered as images- using Google Charts or other compatible web service, downloaded- and embedded in the e-book. Otherwise, they will appear verbatim.--HTML, Slidy, DZSlides, S5, EPUB- ~ The way math is rendered in HTML will depend on the- command-line options selected:-- 1. The default is to render TeX math as far as possible using unicode- characters, as with RTF, DocBook, and OpenDocument output. Formulas- are put inside a `span` with `class="math"`, so that they may be- styled differently from the surrounding text if needed.-- 2. If the `--latexmathml` option is used, TeX math will be displayed- between `$` or `$$` characters and put in `<span>` tags with class `LaTeX`.- The [LaTeXMathML] script will be used to render it as formulas.- (This trick does not work in all browsers, but it works in Firefox.- In browsers that do not support LaTeXMathML, TeX math will appear- verbatim between `$` characters.)-- 3. If the `--jsmath` option is used, TeX math will be put inside- `<span>` tags (for inline math) or `<div>` tags (for display math)- with class `math`. The [jsMath] script will be used to render- it.-- 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will- be called to generate images for each TeX formula. This should- work in all browsers. The `--mimetex` option takes an optional URL- as argument. If no URL is specified, it will be assumed that the- mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.-- 5. If the `--gladtex` option is used, TeX formulas will be enclosed- in `<eq>` tags in the HTML output. The resulting `htex` file may then- be processed by [gladTeX], which will produce image files for each- formula and an `html` file with links to these images. So, the- procedure is:-- pandoc -s --gladtex myfile.txt -o myfile.htex- gladtex -d myfile-images myfile.htex- # produces myfile.html and images in myfile-images-- 6. If the `--webtex` option is used, TeX formulas will be converted- to `<img>` tags that link to an external script that converts- formulas to images. The formula will be URL-encoded and concatenated- with the URL provided. If no URL is specified, the Google Chart- API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).-- 7. If the `--mathjax` option is used, TeX math will be displayed- between `\(...\)` (for inline math) or `\[...\]` (for display- math) and put in `<span>` tags with class `math`.- The [MathJax] script will be used to render it as formulas.--Raw HTML-----------#### Extension: `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-be disabled if desired.)--The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,-DZSlides, EPUB, Markdown, and Textile output, and suppressed in other-formats.--#### Extension: `markdown_in_html_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;-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-- <table>- <tr>- <td>*one*</td>- <td>[a link](http://google.com)</td>- </tr>- </table>--into-- <table>- <tr>- <td><em>one</em></td>- <td><a href="http://google.com">a link</a></td>- </tr>- </table>--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.--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` ####--Use native pandoc `Div` blocks for content inside `<div>` tags.-For the most part this should give the same output as-`markdown_in_html_blocks`, but it makes it easier to write pandoc-filters to manipulate groups of blocks.--#### Extension: `native_spans` ####--Use native pandoc `Span` blocks for content inside `<span>` tags.-For the most part this should give the same output as `raw_html`,-but it makes it easier to write pandoc filters to manipulate groups-of inlines.--Raw TeX----------#### Extension: `raw_tex` ####--In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be-included in a document. Inline TeX commands will be preserved and passed-unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use-LaTeX to include BibTeX citations:-- This result was proved in \cite{jones.1967}.--Note that in LaTeX environments, like-- \begin{tabular}{|l|l|}\hline- Age & Frequency \\ \hline- 18--25 & 15 \\- 26--35 & 33 \\- 36--45 & 22 \\ \hline- \end{tabular}--the material between the begin and end tags will be interpreted as raw-LaTeX, not as markdown.--Inline LaTeX is ignored in output formats other than Markdown, LaTeX,-and ConTeXt.--LaTeX macros---------------#### Extension: `latex_macros` ####--For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and-`\renewcommand` definitions and apply the resulting macros to all LaTeX-math. So, for example, the following will work in all output formats,-not just LaTeX:-- \newcommand{\tuple}[1]{\langle #1 \rangle}-- $\tuple{a, b, c}$--In LaTeX output, the `\newcommand` definition will simply be passed-unchanged to the output.---Links--------Markdown allows links to be specified in several ways.--### Automatic links ###--If you enclose a URL or email address in pointy brackets, it-will become a link:-- <http://google.com>- <sam@green.eggs.ham>--### Inline links ###--An inline link consists of the link text in square brackets,-followed by the URL in parentheses. (Optionally, the URL can-be followed by a link title, in quotes.)-- This is an [inline link](/url), and here's [one with- a title](http://fsf.org "click here for a good time!").--There can be no space between the bracketed part and the parenthesized part.-The link text can contain formatting (such as emphasis), but the title cannot.---### Reference links ###--An *explicit* reference link has two parts, the link itself and the link-definition, which may occur elsewhere in the document (either-before or after the link).--The link consists of link text in square brackets, followed by a label in-square brackets. (There can be space between the two.) The link definition-consists of the bracketed label, followed by a colon and a space, followed by-the URL, and optionally (after a space) a link title either in quotes or in-parentheses.--Here are some examples:-- [my label 1]: /foo/bar.html "My title, optional"- [my label 2]: /foo- [my label 3]: http://fsf.org (The free software foundation)- [my label 4]: /bar#special 'A title in single quotes'--The URL may optionally be surrounded by angle brackets:-- [my label 5]: <http://foo.bar.baz>--The title may go on the next line:-- [my label 3]: http://fsf.org- "The free software foundation"--Note that link labels are not case sensitive. So, this will work:-- Here is [my link][FOO]-- [Foo]: /bar/baz--In an *implicit* reference link, the second pair of brackets is-empty, or omitted entirely:-- See [my website][], or [my website].-- [my website]: http://foo.bar.baz--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-not in most other implementations:-- > My block [quote].- >- > [quote]: /foo--### Internal links ###--To link to another section of the same document, use the automatically-generated identifier (see [Header identifiers in HTML, LaTeX, and-ConTeXt](#header-identifiers-in-html-latex-and-context), below).-For example:-- See the [Introduction](#introduction).--or-- See the [Introduction].-- [Introduction]: #introduction--Internal links are currently supported for HTML formats (including-HTML slide shows and EPUB), LaTeX, and ConTeXt.--Images---------A link immediately preceded by a `!` will be treated as an image.-The link text will be used as the image's alt text:-- -- ![movie reel]-- [movie reel]: movie.gif--#### Extension: `implicit_figures` ####--An image occurring by itself in a paragraph will be rendered as-a figure with a caption.[^5] (In LaTeX, a figure environment will be-used; in HTML, the image will be placed in a `div` with class-`figure`, together with a caption in a `p` with class `caption`.)-The image's alt text will be used as the caption.-- --[^5]: This feature is not yet implemented for RTF, OpenDocument, or- ODT. In those formats, you'll just get an image in a paragraph by- itself, with no caption.--If you just want a regular inline image, just make sure it is not-the only thing in the paragraph. One way to do this is to insert a-nonbreaking space after the image:-- \---Footnotes------------#### Extension: `footnotes` ####--Pandoc's markdown allows footnotes, using the following syntax:-- Here is a footnote reference,[^1] and another.[^longnote]-- [^1]: Here is the footnote.-- [^longnote]: Here's one with multiple blocks.-- Subsequent paragraphs are indented to show that they- belong to the previous footnote.-- { some.code }-- The whole paragraph can be indented, or just the first- line. In this way, multi-paragraph footnotes work like- multi-paragraph list items.-- This paragraph won't be part of the note, because it- isn't indented.--The identifiers in footnote references may not contain spaces, tabs,-or newlines. These identifiers are used only to correlate the-footnote reference with the note itself; in the output, footnotes-will be numbered sequentially.--The footnotes themselves need not be placed at the end of the-document. They may appear anywhere except inside other block elements-(lists, block quotes, tables, etc.).--#### Extension: `inline_notes` ####--Inline footnotes are also allowed (though, unlike regular notes,-they cannot contain multiple paragraphs). The syntax is as follows:-- Here is an inline note.^[Inlines notes are easier to write, since- you don't have to pick an identifier and move down to type the- note.]--Inline and regular footnotes may be mixed freely.---Citations------------#### Extension: `citations` ####--Using an external filter, `pandoc-citeproc`, pandoc can automatically generate-citations and a bibliography in a number of styles. Basic usage is-- pandoc --filter pandoc-citeproc myinput.txt--In order to use this feature, you will need to specify a bibliography file-using the `bibliography` metadata field in a YAML metadata section.-The bibliography may have any of these formats:-- Format File extension- ------------ --------------- MODS .mods- BibLaTeX .bib- BibTeX .bibtex- RIS .ris- EndNote .enl- EndNote XML .xml- ISI .wos- MEDLINE .medline- Copac .copac- JSON citeproc .json--Note that `.bib` can generally be used with both BibTeX and BibLaTeX-files, but you can use `.bibtex` to force BibTeX.--Alternatively you can use a `references` field in the document's YAML-metadata. This should include an array of YAML-encoded references,-for example:-- ---- references:- - id: fenner2012a- title: One-click science marketing- author:- - family: Fenner- given: Martin- container-title: Nature Materials- volume: 11- URL: 'http://dx.doi.org/10.1038/nmat3283'- DOI: 10.1038/nmat3283- issue: 4- publisher: Nature Publishing Group- page: 261-263- type: article-journal- issued:- year: 2012- month: 3- ...--(The program `mods2yaml`, which comes with `pandoc-citeproc`, can help produce-these from a MODS reference collection.)--By default, `pandoc-citeproc` will use a Chicago author-date format for-citations and references. To use another style, you will need to specify-a [CSL] 1.0 style file in the `csl` metadata field. A primer on creating and-modifying CSL styles can be found at-<http://citationstyles.org/downloads/primer.html>. A repository of CSL styles-can be found at <https://github.com/citation-style-language/styles>. See also-<http://zotero.org/styles> for easy browsing.--Citations go inside square brackets and are separated by semicolons.-Each citation must have a key, composed of '@' + the citation-identifier from the database, and may optionally have a prefix,-a locator, and a suffix. The citation key must begin with a letter-or `_`, and may contain alphanumerics, `_`, and internal punctuation-characters (`:.#$%&-+?<>~/`). Here are some examples:-- Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1].-- Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].-- Blah blah [@smith04; @doe99].--A minus sign (`-`) before the `@` will suppress mention of-the author in the citation. This can be useful when the-author is already mentioned in the text:-- Smith says blah [-@smith04].--You can also write an in-text citation, as follows:-- @smith04 says blah.-- @smith04 [p. 33] says blah.--If the style calls for a list of works cited, it will be placed-at the end of the document. Normally, you will want to end your-document with an appropriate header:-- last paragraph...-- # References--The bibliography will be inserted after this header. Note that-the `unnumbered` class will be added to this header, so that the-section will not be numbered.--If you want to include items in the bibliography without actually-citing them in the body text, you can define a dummy `nocite` metadata-field and put the citations there:-- ---- nocite: |- @item1, @item2- ...-- @item3--In this example, the document will contain a citation for `item3`-only, but the bibliography will contain entries for `item1`, `item2`, and-`item3`.--Non-pandoc extensions------------------------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.--#### Extension: `lists_without_preceding_blankline` ####--Allow a list to occur right after a paragraph, with no intervening-blank space.--#### Extension: `hard_line_breaks` ####--Causes all newlines within a paragraph to be interpreted as hard line-breaks instead of spaces.--#### Extension: `ignore_line_breaks` ####--Causes newlines within a paragraph to be ignored, rather than being-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: `tex_math_single_backslash` ####--Causes anything between `\(` and `\)` to be interpreted as inline-TeX math, and anything between `\[` and `\]` to be interpreted-as display TeX math. Note: a drawback of this extension is that-it precludes escaping `(` and `[`.--#### Extension: `tex_math_double_backslash` ####--Causes anything between `\\(` and `\\)` to be interpreted as inline-TeX math, and anything between `\\[` and `\\]` to be interpreted-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-inside block-level tags if the tags have the attribute `markdown=1`.--#### Extension: `mmd_title_block` ####--Enables a [MultiMarkdown] style title block at the top of-the document, for example:-- Title: My title- Author: John Doe- Date: September 1, 2008- Comment: This is a sample mmd title block, with- a field spanning multiple lines.--See the MultiMarkdown documentation for details. If `pandoc_title_block` or-`yaml_metadata_block` is enabled, it will take precedence over-`mmd_title_block`.-- [MultiMarkdown]: http://fletcherpenney.net/multimarkdown/--#### Extension: `abbreviations` ####--Parses PHP Markdown Extra abbreviation keys, like-- *[HTML]: Hyper Text Markup Language--Note that the pandoc document model does not support-abbreviations, so if this extension is enabled, abbreviation keys are-simply skipped (as opposed to being parsed as paragraphs).--#### Extension: `autolink_bare_uris` ####--Makes all absolute URIs into links, even when not surrounded by-pointy braces `<...>`.--#### Extension: `ascii_identifiers` ####--Causes the identifiers produced by `auto_identifiers` to be pure ASCII.-Accents are stripped off of accented latin letters, and non-latin-letters are omitted.--#### Extension: `link_attributes` ####--Parses multimarkdown style key-value attributes on link and image references.-Note that pandoc's internal document model provides nowhere to put-these, so they are presently just ignored.--#### Extension: `mmd_header_identifiers` ####--Parses multimarkdown style header identifiers (in square brackets,-after the header but before any trailing `#`s in an ATX header).--#### Extension: `compact_definition_lists` ####--Activates the definition list syntax of pandoc 1.12.x and earlier.-This syntax differs from the one described [above](#definition-lists)-in several respects:-- - No blank line is required between consecutive items of the- definition list.- - To get a "tight" or "compact" list, omit space between consecutive- items; the space between a term and its definition does not affect- anything.- - Lazy wrapping of paragraphs is not allowed: the entire definition must- be indented four spaces.[^6]--[^6]: To see why laziness is incompatible with relaxing the requirement- of a blank line between items, consider the following example:-- bar- : definition- foo- : definition-- Is this a single list item with two definitions of "bar," the first of- which is lazily wrapped, or two list items? To remove the ambiguity- we must either disallow lazy wrapping or require a blank line between- list items.--Markdown variants--------------------In addition to pandoc's extended markdown, the following markdown-variants are supported:--`markdown_phpextra` (PHP Markdown Extra)-: `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,- `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,- `header_attributes`, `abbreviations`.--`markdown_github` (Github-flavored Markdown)-: `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`--`markdown_mmd` (MultiMarkdown)-: `pipe_tables` `raw_html`, `markdown_attribute`, `link_attributes`,- `raw_tex`, `tex_math_double_backslash`, `intraword_underscores`,- `mmd_title_block`, `footnotes`, `definition_lists`,- `all_symbols_escapable`, `implicit_header_references`,- `auto_identifiers`, `mmd_header_identifiers`--`markdown_strict` (Markdown.pl)-: `raw_html`--Extensions with formats other than markdown----------------------------------------------Some of the extensions discussed above can be used with formats-other than markdown:--* `auto_identifiers` can be used with `latex`, `rst`, `mediawiki`,- and `textile` input (and is used by default).--* `tex_math_dollars`, `tex_math_single_backslash`, and- `tex_math_double_backslash` can be used with `html` input.- (This is handy for reading web pages formatted using MathJax,- for example.)--Producing slide shows with Pandoc-=================================--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`:-- % Habits- % John Doe- % March 22, 2005-- # In the morning-- ## Getting up-- - Turn off alarm- - Get out of bed-- ## Breakfast-- - Eat eggs- - Drink coffee-- # In the evening-- ## Dinner-- - Eat spaghetti- - Drink wine-- -------------------- -- ## Going to sleep-- - Get in bed- - Count sheep--To produce an HTML/javascript slide show, simply type-- pandoc -t FORMAT -s habits.txt -o habits.html--where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.--For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the-`-s/--standalone` option embeds a link to javascripts and CSS files, which are-assumed to be available at the relative path `s5/default` (for S5), `slideous`-(for Slideous), `reveal.js` (for reveal.js), or at the Slidy website at-`w3.org` (for Slidy). (These paths can be changed by setting the `slidy-url`,-`slideous-url`, `revealjs-url`, or `s5-url` variables; see `--variable`,-above.) For DZSlides, the (relatively short) javascript and css are included in-the file by default.--With all HTML slide formats, the `--self-contained` option can be used to-produce a single file that contains all of the data necessary to display the-slide show, including linked scripts, stylesheets, images, and videos.--To produce a PDF slide show using beamer, type-- pandoc -t beamer habits.txt -o habits.pdf--Note that a reveal.js slide show can also be converted to a PDF-by printing it to a file from the browser.--Structuring the slide show-----------------------------By default, the *slide level* is the highest header level in-the hierarchy that is followed immediately by content, and not another-header, somewhere in the document. In the example above, level 1 headers-are always followed by level 2 headers, which are followed by content,-so 2 is the slide level. This default can be overridden using-the `--slide-level` option.--The document is carved up into slides according to the following-rules:-- * A horizontal rule always starts a new slide.-- * A header at the slide level always starts a new slide.-- * Headers *below* the slide level in the hierarchy create- headers *within* a slide.-- * Headers *above* the slide level in the hierarchy create- "title slides," which just contain the section title- and help to break the slide show into sections.-- * A title page is constructed automatically from the document's title- block, if present. (In the case of beamer, this can be disabled- by commenting out some lines in the default template.)--These rules are designed to support many different styles of slide show. If-you don't care about structuring your slides into sections and subsections,-you can just use level 1 headers for all each slide. (In that case, level 1-will be the slide level.) But you can also structure the slide show into-sections, as in the example above.--Note: in reveal.js slide shows, if slide level is 2, a two-dimensional-layout will be produced, with level 1 headers building horizontally-and level 2 headers building vertically. It is not recommended that-you use deeper nesting of section levels with reveal.js.--Incremental lists--------------------By default, these writers produces lists that display "all at once."-If you want your lists to display incrementally (one item at a time),-use the `-i` option. If you want a particular list to depart from the-default (that is, to display incrementally without the `-i` option and-all at once with the `-i` option), put it in a block quote:-- > - Eat spaghetti- > - Drink wine--In this way incremental and nonincremental lists can be mixed in-a single document.--Inserting pauses-------------------You can add "pauses" within a slide by including a paragraph containing-three dots, separated by spaces:-- # Slide with a pause-- content before the pause-- . . .-- content after the pause--Styling the slides---------------------You can change the style of HTML slides by putting customized CSS files-in `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),-or `$DATADIR/slideous` (for Slideous),-where `$DATADIR` is the user data directory (see `--data-dir`, above).-The originals may be found in pandoc's system data directory (generally-`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any-files it does not find in the user data directory.--For dzslides, the CSS is included in the HTML file itself, and may-be modified there.--For reveal.js, themes can be used by setting the `theme` variable,-for example:-- -V theme=moon--Or you can specify a custom stylesheet using the `--css` option.--To style beamer slides, you can specify a beamer "theme" or "colortheme"-using the `-V` option:-- pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf--Note that header attributes will turn into slide attributes-(on a `<div>` or `<section>`) in HTML slide formats, allowing you-to style individual slides. In Beamer, the only header attribute-that affects slides is the `allowframebreaks` class, which sets the-`allowframebreaks` option, causing multiple slides to be created-if the content overfills the frame. This is recommended especially for-bibliographies:-- # References {.allowframebreaks}--Speaker notes----------------reveal.js has good support for speaker notes. You can add notes to your-markdown document thus:-- <div class="notes">- This is my note.-- - It can contain markdown- - like this list-- </div>--To show the notes window, press `s` while viewing the presentation.-Notes are not yet supported for other slide formats, but the notes-will not appear on the slides themselves.--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-block. Here is an example:-- ---- title:- - type: main- text: My Book- - type: subtitle- text: An investigation of metadata- creator:- - role: author- text: John Smith- - role: editor- text: Sarah Jones- identifier:- - scheme: DOI- text: doi:10.234234.234/33- publisher: My Press- rights: (c) 2007 John Smith, CC BY-NC- ...--The following fields are recognized:--`identifier`- ~ Either a string value or an object with fields `text` and- `scheme`. Valid values for `scheme` are `ISBN-10`,- `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`,- `ISBN-13`, `Legal deposit number`, `URN`, `OCLC`,- `ISMN-13`, `ISBN-A`, `JP`, `OLCC`.--`title`- ~ Either a string value, or an object with fields `file-as` and- `type`, or a list of such objects. Valid values for `type` are- `main`, `subtitle`, `short`, `collection`, `edition`, `extended`.--`creator`- ~ Either a string value, or an object with fields `role`, `file-as`,- and `text`, or a list of such objects. Valid values for `role` are- [marc relators](http://www.loc.gov/marc/relators/relaterm.html), but- pandoc will attempt to translate the human-readable versions- (like "author" and "editor") to the appropriate marc relators.--`contributor`- ~ Same format as `creator`.--`date`- ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.)- Pandoc will attempt to convert other common date formats.--`language`- ~ A string value in [RFC5646] format. Pandoc will default to the local- language if nothing is specified.--`subject`- ~ A string value or a list of such values.--`description`- ~ A string value.--`type`- ~ A string value.--`format`- ~ A string value.--`relation`- ~ A string value.--`coverage`- ~ A string value.--`rights`- ~ A string value.--`cover-image`- ~ A string value (path to cover image).--`stylesheet`- ~ A string value (path to CSS stylesheet).--`page-progression-direction`- ~ Either `ltr` or `rtl`. Specifies the `page-progression-direction`- spine [attribute][EPUBspine].--Literate Haskell support-========================--If you append `+lhs` (or `+literate_haskell`) to an appropriate input or output-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- code rather than block quotations. Text between `\begin{code}`- and `\end{code}` will also be treated as Haskell code.-- - 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)- rather than atx-style (with '#' characters). (This is because ghc- treats '#' characters in column 1 as introducing line numbers.)-- - In restructured text input, "bird track" sections will be parsed- as Haskell code.-- - In restructured text output, code blocks with class `haskell` will- be rendered using bird tracks.-- - In LaTeX input, text in `code` environments will be parsed as- Haskell code.-- - In LaTeX output, code blocks with class `haskell` will be rendered- inside `code` environments.-- - In HTML output, code blocks with class `haskell` will be rendered- with class `literatehaskell` and bird tracks.--Examples:-- pandoc -f markdown+lhs -t html--reads literate Haskell source formatted with markdown conventions and writes-ordinary HTML (without bird tracks).-- pandoc -f markdown+lhs -t html+lhs--writes HTML with the Haskell code in bird tracks, so it can be copied-and pasted as literate Haskell source.--Custom writers-==============--Pandoc can be extended with custom writers written in [lua]. (Pandoc-includes a lua interpreter, so lua need not be installed separately.)--To use a custom writer, simply specify the path to the lua script-in place of the output format. For example:-- pandoc -t data/sample.lua--Creating a custom writer requires writing a lua function for each-possible element in a pandoc document. To get a documented example-which you can modify according to your needs, do-- pandoc --print-default-data-file sample.lua--Authors-=======--© 2006-2013 John MacFarlane (jgm at berkeley dot edu). Released under the-[GPL], version 2 or greater. This software carries no warranty of-any kind. (See COPYRIGHT for full copyright and warranty notices.)-Other contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang,-Andrea Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public,-Puneeth Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton,-Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,-Christopher Sawicki, Kelsey Hightower, Masayoshi Takahashi, Antoine-Latter, Ralf Stephan, Eric Seidel, B. Scott Michel, Gavin Beatty,-Sergey Astanin, Arlo O'Keeffe, Denis Laxalde, Brent Yorgey, David Lazar,-Jamie F. Olson, Matthew Pickering, Albert Krewinkel, mb21, Jesse-Rosenthal.--[markdown]: http://daringfireball.net/projects/markdown/-[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html-[S5]: http://meyerweb.com/eric/tools/s5/-[Slidy]: http://www.w3.org/Talks/Tools/Slidy/-[Slideous]: http://goessner.net/articles/slideous/-[HTML]: http://www.w3.org/TR/html40/-[HTML 5]: http://www.w3.org/TR/html5/-[XHTML]: http://www.w3.org/TR/xhtml1/-[LaTeX]: http://www.latex-project.org/-[beamer]: http://www.tex.ac.uk/CTAN/macros/latex/contrib/beamer-[ConTeXt]: http://www.pragma-ade.nl/-[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format-[DocBook]: http://www.docbook.org/-[OPML]: http://dev.opml.org/spec2.html-[OpenDocument]: http://opendocument.xml.org/-[ODT]: http://en.wikipedia.org/wiki/OpenDocument-[Textile]: http://redcloth.org/textile-[MediaWiki markup]: http://www.mediawiki.org/wiki/Help:Formatting-[DokuWiki markup]: https://www.dokuwiki.org/dokuwiki-[Haddock markup]: http://www.haskell.org/haddock/doc/html/ch03s08.html-[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html-[Haskell]: http://www.haskell.org/-[GNU Texinfo]: http://www.gnu.org/software/texinfo/-[Emacs Org-Mode]: http://orgmode.org-[AsciiDoc]: http://www.methods.co.nz/asciidoc/-[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"-[DZSlides]: http://paulrouget.com/dzslides/-[ISO 8601 format]: http://www.w3.org/TR/NOTE-datetime-[Word docx]: http://www.microsoft.com/interop/openup/openxml/default.aspx-[PDF]: http://www.adobe.com/pdf/-[reveal.js]: http://lab.hakim.se/reveal-js/-[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1-[lua]: http://www.lua.org-[marc relators]: http://www.loc.gov/marc/relators/relaterm.html-[RFC5646]: http://tools.ietf.org/html/rfc5646-[InDesign ICML]: https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf-[txt2tags]: http://txt2tags.org/-[EPUB]: http://idpf.org/epub-[EPUBspine]: http://www.idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem
@@ -0,0 +1,300 @@+<!-- Do not edit this file. It is generated automatically from+README.template and MANUAL.txt via the command:+pandoc --lua-filter tools/update-readme.lua README.template -o README.md+-->++# Pandoc++[](https://github.com/jgm/pandoc/releases)+[](https://hackage.haskell.org/package/pandoc)+[](https://formulae.brew.sh/formula/pandoc)+[](https://www.stackage.org/lts/package/pandoc)+[](https://github.com/jgm/pandoc/actions)+[](https://www.gnu.org/licenses/gpl.html)+[](https://groups.google.com/forum/#!forum/pandoc-discuss)++## The universal markup converter++Pandoc is a [Haskell](https://haskell.org) library for converting from+one markup format to another, and a command-line tool that uses this+library.++It can convert *from*++<div id="input-formats">++- `asciidoc` ([AsciiDoc](https://asciidoc.org/) markup)+- `bibtex` ([BibTeX](https://ctan.org/pkg/bibtex) bibliography)+- `biblatex` ([BibLaTeX](https://ctan.org/pkg/biblatex) bibliography)+- `bits` ([BITS](https://jats.nlm.nih.gov/extensions/bits/) XML, alias+ for `jats`)+- `commonmark` ([CommonMark](https://commonmark.org) Markdown)+- `commonmark_x` ([CommonMark](https://commonmark.org) Markdown with+ extensions)+- `creole` ([Creole 1.0](http://www.wikicreole.org/wiki/Creole1.0))+- `csljson` ([CSL+ JSON](https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html)+ bibliography)+- `csv` ([CSV](https://tools.ietf.org/html/rfc4180) table)+- `tsv`+ ([TSV](https://www.iana.org/assignments/media-types/text/tab-separated-values)+ table)+- `djot` ([Djot markup](https://djot.net))+- `docbook` ([DocBook](https://docbook.org))+- `docx` ([Word docx](https://en.wikipedia.org/wiki/Office_Open_XML))+- `dokuwiki` ([DokuWiki markup](https://www.dokuwiki.org/dokuwiki))+- `endnotexml` ([EndNote XML+ bibliography](https://support.clarivate.com/Endnote/s/article/EndNote-XML-Document-Type-Definition))+- `epub` ([EPUB](http://idpf.org/epub))+- `fb2`+ ([FictionBook2](http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1)+ e-book)+- `gfm` ([GitHub-Flavored+ Markdown](https://help.github.com/articles/github-flavored-markdown/)),+ or the deprecated and less accurate `markdown_github`; use+ [`markdown_github`](https://pandoc.org/MANUAL.html#markdown-variants)+ only if you need extensions not supported in+ [`gfm`](https://pandoc.org/MANUAL.html#markdown-variants).+- `haddock` ([Haddock+ markup](https://www.haskell.org/haddock/doc/html/ch03s08.html))+- `html` ([HTML](https://www.w3.org/html/))+- `ipynb` ([Jupyter+ notebook](https://nbformat.readthedocs.io/en/latest/))+- `jats` ([JATS](https://jats.nlm.nih.gov) XML)+- `jira`+ ([Jira](https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all)/Confluence+ wiki markup)+- `json` (JSON version of native AST)+- `latex` ([LaTeX](https://www.latex-project.org/))+- `markdown` ([Pandoc’s+ Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown))+- `markdown_mmd`+ ([MultiMarkdown](https://fletcherpenney.net/multimarkdown/))+- `markdown_phpextra` ([PHP Markdown+ Extra](https://michelf.ca/projects/php-markdown/extra/))+- `markdown_strict` (original unextended+ [Markdown](https://daringfireball.net/projects/markdown/))+- `mediawiki` ([MediaWiki+ markup](https://www.mediawiki.org/wiki/Help:Formatting))+- `man` ([roff man](https://man.cx/groff_man(7)))+- `mdoc` ([mdoc](https://mandoc.bsd.lv/man/mdoc.7.html) manual page+ markup)+- `muse` ([Muse](https://amusewiki.org/library/manual))+- `native` (native Haskell)+- `odt` ([OpenDocument text+ document](https://en.wikipedia.org/wiki/OpenDocument))+- `opml` ([OPML](https://opml.org/spec2.opml))+- `org` ([Emacs Org mode](https://orgmode.org))+- `pod` (Perl’s [Plain Old+ Documentation](https://perldoc.perl.org/perlpod))+- `pptx`+ ([PowerPoint](https://en.wikipedia.org/wiki/Microsoft_PowerPoint))+- `ris` ([RIS](https://en.wikipedia.org/wiki/RIS_(file_format))+ bibliography)+- `rtf` ([Rich Text+ Format](https://en.wikipedia.org/wiki/Rich_Text_Format))+- `rst`+ ([reStructuredText](https://docutils.sourceforge.io/docs/ref/rst/introduction.html))+- `t2t` ([txt2tags](https://txt2tags.org))+- `textile` ([Textile](https://textile-lang.com))+- `tikiwiki` ([TikiWiki+ markup](https://doc.tiki.org/Wiki-Syntax-Text#The_Markup_Language_Wiki-Syntax))+- `twiki` ([TWiki+ markup](https://twiki.org/cgi-bin/view/TWiki/TextFormattingRules))+- `typst` ([typst](https://typst.app))+- `vimwiki` ([Vimwiki](https://vimwiki.github.io))+- `xlsx` ([Excel+ spreadsheet](https://en.wikipedia.org/wiki/Microsoft_Excel#File_formats))+- `xml` (XML version of native AST)+- the path of a custom Lua reader, see [Custom readers and+ writers](https://pandoc.org/MANUAL.html#custom-readers-and-writers)+ below++</div>++It can convert *to*++<div id="output-formats">++- `ansi` (text with [ANSI escape+ codes](https://en.wikipedia.org/wiki/ANSI_escape_code), for terminal+ viewing)+- `asciidoc` (modern [AsciiDoc](https://asciidoc.org/) as interpreted by+ [AsciiDoctor](https://asciidoctor.org/))+- `asciidoc_legacy` ([AsciiDoc](https://asciidoc.org/) as interpreted by+ [`asciidoc-py`](https://github.com/asciidoc-py/asciidoc-py)).+- `asciidoctor` (deprecated synonym for `asciidoc`)+- `bbcode` [BBCode](https://www.bbcode.org/reference.php)+- `bbcode_fluxbb` [BBCode+ (FluxBB)](https://web.archive.org/web/20210623155046/https://fluxbb.org/forums/help.php#bbcode)+- `bbcode_phpbb` [BBCode+ (phpBB)](https://www.phpbb.com/community/help/bbcode)+- `bbcode_steam` [BBCode+ (Steam)](https://steamcommunity.com/comment/ForumTopic/formattinghelp)+- `bbcode_hubzilla` [BBCode+ (Hubzilla)](https://hubzilla.org/help/member/bbcode)+- `bbcode_xenforo` [BBCode+ (xenForo)](https://www.xenfocus.com/community/help/bb-codes/)+- `beamer` ([LaTeX beamer](https://ctan.org/pkg/beamer) slide show)+- `bibtex` ([BibTeX](https://ctan.org/pkg/bibtex) bibliography)+- `biblatex` ([BibLaTeX](https://ctan.org/pkg/biblatex) bibliography)+- `chunkedhtml` (zip archive of multiple linked HTML files)+- `commonmark` ([CommonMark](https://commonmark.org) Markdown)+- `commonmark_x` ([CommonMark](https://commonmark.org) Markdown with+ extensions)+- `context` ([ConTeXt](https://www.contextgarden.net/))+- `csljson` ([CSL+ JSON](https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html)+ bibliography)+- `djot` ([Djot markup](https://djot.net))+- `docbook` or `docbook4` ([DocBook](https://docbook.org) 4)+- `docbook5` (DocBook 5)+- `docx` ([Word docx](https://en.wikipedia.org/wiki/Office_Open_XML))+- `dokuwiki` ([DokuWiki markup](https://www.dokuwiki.org/dokuwiki))+- `epub` or `epub3` ([EPUB](http://idpf.org/epub) v3 book)+- `epub2` (EPUB v2)+- `fb2`+ ([FictionBook2](http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1)+ e-book)+- `gfm` ([GitHub-Flavored+ Markdown](https://help.github.com/articles/github-flavored-markdown/)),+ or the deprecated and less accurate `markdown_github`; use+ [`markdown_github`](https://pandoc.org/MANUAL.html#markdown-variants)+ only if you need extensions not supported in+ [`gfm`](https://pandoc.org/MANUAL.html#markdown-variants).+- `haddock` ([Haddock+ markup](https://www.haskell.org/haddock/doc/html/ch03s08.html))+- `html` or `html5` ([HTML](https://www.w3.org/html/),+ i.e. [HTML5](https://html.spec.whatwg.org/)/XHTML [polyglot+ markup](https://www.w3.org/TR/html-polyglot/))+- `html4` ([XHTML](https://www.w3.org/TR/xhtml1/) 1.0 Transitional)+- `icml` ([InDesign+ ICML](https://web.archive.org/web/20211006210211/https://wwwimages.adobe.com/www.adobe.com/content/dam/acom/en/devnet/indesign/sdk/cs6/idml/idml-cookbook.pdf))+- `ipynb` ([Jupyter+ notebook](https://nbformat.readthedocs.io/en/latest/))+- `jats_archiving` ([JATS](https://jats.nlm.nih.gov) XML, Archiving and+ Interchange Tag Set)+- `jats_articleauthoring` ([JATS](https://jats.nlm.nih.gov) XML, Article+ Authoring Tag Set)+- `jats_publishing` ([JATS](https://jats.nlm.nih.gov) XML, Journal+ Publishing Tag Set)+- `jats` (alias for `jats_archiving`)+- `jira`+ ([Jira](https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all)/Confluence+ wiki markup)+- `json` (JSON version of native AST)+- `latex` ([LaTeX](https://www.latex-project.org/))+- `man` ([roff man](https://man.cx/groff_man(7)))+- `markdown` ([Pandoc’s+ Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown))+- `markdown_mmd`+ ([MultiMarkdown](https://fletcherpenney.net/multimarkdown/))+- `markdown_phpextra` ([PHP Markdown+ Extra](https://michelf.ca/projects/php-markdown/extra/))+- `markdown_strict` (original unextended+ [Markdown](https://daringfireball.net/projects/markdown/))+- `markua` ([Markua](https://leanpub.com/markua/read))+- `mediawiki` ([MediaWiki+ markup](https://www.mediawiki.org/wiki/Help:Formatting))+- `ms` ([roff ms](https://man.cx/groff_ms(7)))+- `muse` ([Muse](https://amusewiki.org/library/manual))+- `native` (native Haskell)+- `odt` ([OpenDocument text+ document](https://en.wikipedia.org/wiki/OpenDocument))+- `opml` ([OPML](https://opml.org/spec2.opml))+- `opendocument` ([OpenDocument+ XML](https://www.oasis-open.org/2021/06/16/opendocument-v1-3-oasis-standard-published/))+- `org` ([Emacs Org mode](https://orgmode.org))+- `pdf` ([PDF](https://www.adobe.com/pdf/))+- `plain` (plain text)+- `pptx`+ ([PowerPoint](https://en.wikipedia.org/wiki/Microsoft_PowerPoint)+ slide show)+- `rst`+ ([reStructuredText](https://docutils.sourceforge.io/docs/ref/rst/introduction.html))+- `rtf` ([Rich Text+ Format](https://en.wikipedia.org/wiki/Rich_Text_Format))+- `texinfo` ([GNU Texinfo](https://www.gnu.org/software/texinfo/))+- `textile` ([Textile](https://textile-lang.com))+- `slideous` ([Slideous](https://goessner.net/articles/slideous/) HTML+ and JavaScript slide show)+- `slidy` ([Slidy](https://www.w3.org/Talks/Tools/Slidy2/) HTML and+ JavaScript slide show)+- `dzslides` ([DZSlides](https://paulrouget.com/dzslides/) HTML5 ++ JavaScript slide show)+- `revealjs` ([reveal.js](https://revealjs.com/) HTML5 + JavaScript+ slide show)+- `s5` ([S5](https://meyerweb.com/eric/tools/s5/) HTML and JavaScript+ slide show)+- `tei` ([TEI Simple](https://github.com/TEIC/TEI-Simple))+- `typst` ([typst](https://typst.app))+- `vimdoc`+ ([Vimdoc](https://vimhelp.org/helphelp.txt.html#help-writing))+- `xml` (XML version of native AST)+- `xwiki` ([XWiki+ markup](https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/))+- `zimwiki` ([ZimWiki+ markup](https://zim-wiki.org/manual/Help/Wiki_Syntax.html))+- the path of a custom Lua writer, see [Custom readers and+ writers](https://pandoc.org/MANUAL.html#custom-readers-and-writers)+ below++</div>++Pandoc can also produce PDF output via LaTeX, Groff ms, or HTML.++Pandoc’s enhanced version of Markdown includes syntax for tables,+definition lists, metadata blocks, footnotes, citations, math, and much+more. See the User’s Manual below under [Pandoc’s+Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown).++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 (an *abstract syntax tree* or AST), 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. Users+can also run custom pandoc filters to modify the intermediate AST (see+the documentation for [filters](https://pandoc.org/filters.html) and+[Lua filters](https://pandoc.org/lua-filters.html)).++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 Markdown+can be expected to be lossy.++## Installing++Here’s [how to install pandoc](INSTALL.md).++## Documentation++Pandoc’s website contains a full [User’s+Guide](https://pandoc.org/MANUAL.html). It is also available+[here](MANUAL.txt) as pandoc-flavored Markdown. The website also+contains some [examples of the use of+pandoc](https://pandoc.org/demos.html), a limited [online+demo](https://pandoc.org/try), and a [WebAssembly-based online+demo](https://pandoc.org/app).++## Contributing++Pull requests, bug reports, and feature requests are welcome. Please+make sure to read [the contributor guidelines](CONTRIBUTING.md) before+opening a new issue.++## License++© 2006-2024 John MacFarlane (jgm@berkeley.edu). Released under the+[GPL](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html "GNU General Public License"),+version 2 or greater. This software carries no warranty of any kind.+(See COPYRIGHT for full copyright and warranty notices.)
@@ -1,51 +0,0 @@-{--Copyright (C) 2006-2014 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--}--import Distribution.Simple-import Distribution.Simple.PreProcess-import Distribution.PackageDescription (PackageDescription(..), Executable(..))-import System.Process ( rawSystem )-import System.FilePath ( (</>) )-import System.Directory ( findExecutable )-import Distribution.Simple.Utils (info)--main :: IO ()-main = defaultMainWithHooks $ simpleUserHooks {- -- enable hsb2hs preprocessor for .hsb files- hookedPreProcessors = [ppBlobSuffixHandler]- -- ensure that make-pandoc-man-pages doesn't get installed to bindir- , copyHook = \pkgdescr ->- (copyHook simpleUserHooks) pkgdescr{ executables =- [x | x <- executables pkgdescr, exeName x /= "make-pandoc-man-pages"] }- , instHook = \pkgdescr ->- (instHook simpleUserHooks) pkgdescr{ executables =- [x | x <- executables pkgdescr, exeName x /= "make-pandoc-man-pages"] }- }--ppBlobSuffixHandler :: PPSuffixHandler-ppBlobSuffixHandler = ("hsb", \_ _ ->- PreProcessor {- platformIndependent = True,- runPreProcessor = mkSimplePreProcessor $ \infile outfile verbosity ->- do info verbosity $ "Preprocessing " ++ infile ++ " to " ++ outfile- hsb2hsPath <- findExecutable "hsb2hs"- case hsb2hsPath of- Just p -> rawSystem p [infile, infile, outfile]- Nothing -> error "hsb2hs is needed to build this program: cabal install hsb2hs"- return ()- })
@@ -1,5 +1,6 @@+{-# LANGUAGE OverloadedStrings #-} {--Copyright (C) 2012-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2012-2024 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@@ -16,42 +17,89 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -} import Text.Pandoc-import Criterion.Main-import Criterion.Config-import System.Environment (getArgs)-import Data.Monoid+import Text.Pandoc.MIME+import Control.DeepSeq (force)+import Control.Monad.Except (throwError)+import qualified Text.Pandoc.UTF8 as UTF8+import qualified Data.ByteString as B+import qualified Data.Text as T+import Test.Tasty.Bench+-- import Gauge+import qualified Data.ByteString.Lazy as BL import Data.Maybe (mapMaybe)-import Debug.Trace (trace)+import Data.List (sortOn)+import Text.Pandoc.Format (FlavoredFormat(..)) readerBench :: Pandoc- -> (String, ReaderOptions -> String -> IO Pandoc)+ -> T.Text -> Maybe Benchmark-readerBench doc (name, reader) = case lookup name writers of- Just (PureStringWriter writer) ->- let inp = writer def{ writerWrapText = True} doc- in return $ bench (name ++ " reader") $ nfIO $- (reader def{ readerSmart = True }) inp- _ -> trace ("\nCould not find writer for " ++ name ++ "\n") Nothing+readerBench _ name+ | name `elem` ["bibtex", "biblatex", "csljson"] = Nothing+readerBench doc name = either (const Nothing) Just $+ runPure $ do+ (rdr, rexts) <- getReader $ FlavoredFormat name mempty+ (wtr, wexts) <- getWriter $ FlavoredFormat name mempty+ tmpl <- Just <$> compileDefaultTemplate name+ case (rdr, wtr) of+ (TextReader r, TextWriter w) -> do+ inp <- w def{ writerWrapText = WrapAuto+ , writerExtensions = wexts+ , writerTemplate = tmpl } doc+ return $ bench (T.unpack name) $+ nf (either (error . show) id . runPure . r def) inp+ (ByteStringReader r, ByteStringWriter w) -> do+ inp <- w def{ writerWrapText = WrapAuto+ , writerExtensions = wexts+ , writerTemplate = tmpl } doc+ return $ bench (T.unpack name) $+ nf (either (error . show) id .+ runPure . r def{readerExtensions = rexts}) inp+ _ -> throwError $ PandocSomeError $ "text/bytestring format mismatch: "+ <> name -writerBench :: Pandoc- -> (String, WriterOptions -> Pandoc -> String)- -> Benchmark-writerBench doc (name, writer) = bench (name ++ " writer") $ nf- (writer def{ writerWrapText = True }) doc+getImages :: IO [(FilePath, MimeType, BL.ByteString)]+getImages = do+ ll <- B.readFile "test/lalune.jpg"+ mv <- B.readFile "test/movie.jpg"+ return [("lalune.jpg", "image/jpg", BL.fromStrict ll)+ ,("movie.jpg", "image/jpg", BL.fromStrict mv)] +writerBench :: [(FilePath, MimeType, BL.ByteString)]+ -> Pandoc+ -> T.Text+ -> Maybe Benchmark+writerBench _ _ name+ | name `elem` ["bibtex", "biblatex", "csljson"] = Nothing+writerBench imgs doc name = either (const Nothing) Just $+ runPure $ do+ (wtr, wexts) <- getWriter $ FlavoredFormat name mempty+ case wtr of+ TextWriter writerFun ->+ return $ bench (T.unpack name)+ $ nf (\d -> either (error . show) id $+ runPure $ do+ mapM_ (\(fp,mt,bs) -> insertMedia fp (Just mt) bs) imgs+ writerFun def{ writerExtensions = wexts} d)+ doc+ ByteStringWriter writerFun ->+ return $ bench (T.unpack name)+ $ nf (\d -> either (error . show) id $+ runPure $ do+ mapM_ (\(fp,mt,bs) -> insertMedia fp (Just mt) bs) imgs+ writerFun def{ writerExtensions = wexts} d)+ doc+ main :: IO () main = do- args <- getArgs- (conf,_) <- parseArgs defaultConfig{ cfgSamples = Last $ Just 20 }- defaultOptions args- inp <- readFile "tests/testsuite.txt"- let opts = def{ readerSmart = True }- let doc = readMarkdown opts inp- let readers' = [(n,r) | (n, StringReader r) <- readers]- let readerBs = mapMaybe (readerBench doc)- $ filter (\(n,_) -> n /="haddock") readers'- let writers' = [(n,w) | (n, PureStringWriter w) <- writers]- let writerBs = map (writerBench doc)- $ writers'- defaultMainWith conf (return ()) $- writerBs ++ readerBs+ inp <- UTF8.toText <$> B.readFile "test/testsuite.txt"+ let opts = def+ let doc = either (error . show) force $ runPure $ readMarkdown opts inp+ defaultMain+ [ env getImages $ \imgs ->+ bgroup "writers" $ mapMaybe (writerBench imgs doc . fst)+ (sortOn fst+ writers :: [(T.Text, Writer PandocPure)])+ , bgroup "readers" $ mapMaybe (readerBench doc . fst)+ (sortOn fst+ readers :: [(T.Text, Reader PandocPure)])+ ]
@@ -1,7362 +0,0 @@-pandoc (1.13.1)-- * Fixed `--self-contained` with Windows paths (#1558).- Previously `C:\foo.js` was being wrongly interpreted as a URI.-- * HTML reader: improved handling of tags that can be block or inline.- Previously a section like this would be enclosed in a paragraph,- with RawInline for the video tags (since video is a tag that can- be either block or inline):-- <video controls="controls">- <source src="../videos/test.mp4" type="video/mp4" />- <source src="../videos/test.webm" type="video/webm" />- <p>- The videos can not be played back on your system.<br/>- Try viewing on Youtube (requires Internet connection):- <a href="http://youtu.be/etE5urBps_w">Relative Velocity on- Youtube</a>.- </p>- </video>-- This change will cause the video and source tags to be parsed- as RawBlock instead, giving better output.- The general change is this: when we're parsing a "plain" sequence- of inlines, we don't parse anything that COULD be a block-level tag.-- * Docx reader:-- + Be sensitive to user styles. Note that "Hyperlink" is- "blacklisted," as we don't want the default underline styling to be- inherited by all links by default (Jesse Rosenthal).- + Read single paragraph in table cell as `Plain` (Jesse Rosenthal).- This makes to docx reader's native output fit with the way the markdown- reader understands its markdown output.-- * Textile writer: Extended the range of cases where native textile- tables will be used (as opposed to raw HTML): we now handle any- alignment type, but only for simple tables with no captions.-- * Txt2Tags reader:-- + Header is now parsed only if standalone flag is set (Matthew Pickering).- + The header is now parsed as meta information. The first line is the- `title`, the second is the `author` and third line is the `date`- (Matthew Pickering).- + Corrected formatting of `%%mtime` macro (Matthew Pickering).- + Fixed crash when reading from stdin.-- * EPUB writer: Don't use page-progression-direction in EPUB2, which- doesn't support it. Also, if page-progression-direction not specified- in metadata, don't include the attribute even in EPUB3; not including it- is the same as including it with the value "default", as we did before.- (#1550)-- * Org writer: Accept example lines with indentation at the beginning- (Calvin Beck).-- * DokuWiki writer:-- + Refactor to use Reader monad (Matthew Pickering).- + Avoid using raw HTML in table cells; instead, use `\\`- instead of newlines (Jesse Rosenthal).- + Properly handle HTML table cell alignments, and use spacing- to make the tables look prettier (#1566).-- * Docx writer:-- + Bibliography entries get `Bibliography` style (#1559).- + Implement change tracking (Jesse Rosenthal).-- * LaTeX writer:-- + Fixed a bug that caused a table caption to repeat across all pages- (Jose Luis Duran).- + Improved vertical spacing in tables and made it customizable using- standard lengths set by booktab. See- <https://groups.google.com/forum/#!msg/pandoc-discuss/qMu6_5lYy0o/ZAU7lzAIKw0J>- (Jose Luis Duran).- + Added `\strut` to fix spacing in multiline tables (Jose Luis Duran).- + Use `\tabularnewline` instead of `\\` in table cells (Jose Luis Duran).- + Made horizontal rules more flexible (Jose Luis Duran).-- * Text.Pandoc.MIME:-- + Added `MimeType` (type synonym for `String`) and `getMimeTypeDef`.- Code cleanups (Artyom Kazak).-- * Templates:-- + LaTeX template: disable microtype protrusion for typewriter font (#1549,- thanks lemzwerg).-- * Improved OSX build procedure.-- * Added `network-uri` flag, to deal with split of `network-uri` from- `network`.-- * Fix build dependencies for the `trypandoc` flag, so that they are- ignored if `trypandoc` flag is set to False (Gabor Pali).-- * Updated README to remove outdated claim that `--self-contained`- looks in the user data directory for missing files.--pandoc (1.13.0.1)-- * Docx writer:-- + Fixed regression which bungled list numbering (#1544), causing- all lists to appear as basic ordered lists.- + Include row width in table rows (Christoffer Ackelman, Viktor Kronvall).- Added a property to all table rows where the sum of column widths- is specified in pct (fraction of 5000). This helps persuade Word- to lay out the table with the widths we specify.-- * Fixed a bug in Windows 8 which caused pandoc not to find the- `pandoc-citeproc` filter (#1542).-- * Docx reader: miscellaneous under-the-hood improvements (Jesse Rosenthal).- Most significantly, the reader now uses Builder, leading to some- performance improvements.-- * HTML reader: Parse appropriately styled span as SmallCaps.-- * Markdown writer: don't escape `$`, `^`, `~` when `tex_math_dollars`,- `superscript`, and `subscript` extensions, respectively, are- deactivated (#1127).-- * Added `trypandoc` flag to build CGI executable used in the online- demo.-- * Makefile: Added 'quick', 'osxpkg' targets.-- * Updated README in templates to indicate templates license.- The templates are dual-licensed, BSD3 and GPL2+.--pandoc (1.13)-- [new features]-- * Added `docx` as an input format (Jesse Rosenthal). The docx- reader includes conversion of native Word equations to pandoc- LaTeX `Math` elements. Metadata is taken from paragraphs at the- beginning of the document with styles `Author`, `Title`, `Subtitle`,- `Date`, and `Abstract`.-- * Added `epub` as an input format (Matthew Pickering). The epub- reader includes conversion of MathML to pandoc LaTeX `Math`- elements.-- * Added `t2t` (Txt2Tags) as an input format (Matthew Pickering).- Txt2tags is a lightweight markup format described at- <http://txt2tags.org/>.-- * Added `dokuwiki` as an output format (Clare Macrae).-- * Added `haddock` as an output format.-- * Added `--extract-media` option to extract media contained in a zip- container (docx or epub) while adjusting image paths to point to the- extracted images.-- * Added a new markdown extension, `compact_definition_lists`, that- restores the syntax for definition lists of pandoc 1.12.x, allowing- tight definition lists with no blank space between items, and- disallowing lazy wrapping. (See below under behavior changes.)-- * Added an extension `epub_html_exts` for parsing HTML in EPUBs.-- * Added extensions `native_spans` and `native_divs` to activate- parsing of material in HTML span or div tags as Pandoc Span- inlines or Div blocks.-- * `--trace` now works with the Markdown, HTML, Haddock, EPUB,- Textile, and MediaWiki readers. This is an option intended- for debugging parsing problems; ordinary users should not need- to use it.-- [behavior changes]-- * Changed behavior of the `markdown_attribute` extension, to bring- it in line with PHP markdown extra and multimarkdown. Setting- `markdown="1"` on an outer tag affects all contained tags,- recursively, until it is reversed with `markdown="0"` (#1378).-- * Revised markdown definition list syntax (#1429). Both the reader- and writer are affected. This change brings pandoc's definition list- syntax into alignment with that used in PHP markdown extra and- multimarkdown (with the exception that pandoc is more flexible about- the definition markers, allowing tildes as well as colons). Lazily- wrapped definitions are now allowed. Blank space is required- between list items. The space before a definition is used to determine- whether it is a paragraph or a "plain" element. **WARNING: This change- may break existing documents!** Either check your documents for- definition lists without blank space between items, or use- `markdown+compact_definition_lists` for the old behavior.-- * `.numberLines` now works in fenced code blocks even if no language- is given (#1287, jgm/highlighting-kate#40).-- * Improvements to `--filter`:-- + Don't search PATH for a filter with an explicit path.- This fixed a bug wherein `--filter ./caps.py` would run `caps.py` from- the system path, even if there was a `caps.py` in the working directory.- + Respect shebang if filter is executable (#1389).- + Don't print misleading error message.- Previously pandoc would say that a filter was not found,- even in a case where the filter had a syntax error.-- * HTML reader:-- + Parse `div` and `span` elements even without `--parse-raw`,- provided `native_divs` and `native_spans` extensions are set.- Motivation: these now generate native pandoc Div and Span- elements, not raw HTML.- + Parse EPUB-specific elements if the `epub_html_exts`- extension is enabled. These include `switch`, `footnote`,- `rearnote`, `noteref`.-- * Org reader:-- + Support for inline LaTeX. Inline LaTeX is now accepted and parsed by the- org-mode reader. Both math symbols (like `\tau`) and LaTeX commands (like- `\cite{Coffee}`), can be used without any further escaping (Albert- Krewinkel).-- * Textile reader and writer:-- + The `raw_tex` extension is no longer set by default. You can- enable it with `textile+raw_tex`.-- * DocBook reader:-- + Support `equation`, `informalequation`, `inlineequation` elements with- `mml:math` content. This is converted into LaTeX and put into a Pandoc- Math inline.-- * Revised `plain` output, largely following the style of Project- Gutenberg:-- + Emphasis is rendered with `_underscores_`, strong emphasis- with ALL CAPS.- + Headings are rendered differently, with space to set them off,- not with setext style underlines. Level 1 headers are ALL CAPS.- + Math is rendered using unicode when possible, but without the- distracting emphasis markers around variables.- + Footnotes use a regular `[n]` style.-- * Markdown writer:-- + Horizontal rules are now a line across the whole page.- + Prettier pipe tables. Columns are now aligned (#1323).- + Respect the `raw_html` extension. `pandoc -t markdown-raw_html`- no longer emits any raw HTML, including span and div tags- generated by Span and Div elements.- + Use span with style for `SmallCaps` (#1360).-- * HTML writer:-- + Autolinks now have class `uri`, and email autolinks have class- `email`, so they can be styled.-- * Docx writer:-- + Document formatting is carried over from `reference.docx`.- This includes margins, page size, page orientation, header,- and footer, including images in headers and footers.- + Include abstract (if present) with `Abstract` style (#1451).- + Include subtitle (if present) with `Subtitle` style, rather- than tacking it on to the title (#1451).-- * Org writer:-- + Write empty span elements with an id attribute as org anchors.- For example `Span ("uid",[],[]) []` becomes `<<uid>>`.-- * LaTeX writer:-- + Put table captions above tables, to match the conventional- standard. (Previously they appeared below tables.)- + Use `\(..\)` instead of `$..$` for inline math (#1464).- + Use `\nolinkurl` in email autolinks. This allows them to be styled- using `\urlstyle{tt}`. Thanks to Ulrike Fischer for the solution.- + Use `\textquotesingle` for `'` in inline code. Otherwise we get- curly quotes in the PDF output (#1364).- + Use `\footnote<.>{..}` for notes in beamer, so that footnotes- do not appear before the overlays in which their markers appear- (#1525).- + Don't produce a `\label{..}` for a Div or Span element. Do produce- a `\hyperdef{..}` (#1519).-- * EPUB writer:-- + If the metadata includes `page-progression-direction` (which can be- `ltr` or `rtl`, the `page-progression-direction` attribute will- be set in the EPUB spine (#1455).-- * Custom lua writers:-- + Custom writers now work with `--template`.- + Removed HTML header scaffolding from `sample.lua`.- + Made citation information available in lua writers.-- * `--normalize` and `Text.Pandoc.Shared.normalize` now consolidate- adjacent `RawBlock`s when possible.-- [API changes]-- * Added `Text.Pandoc.Readers.Docx`, exporting `readDocx` (Jesse Rosenthal).-- * Added `Text.Pandoc.Readers.EPUB`, exporting `readEPUB` (Matthew- Pickering).-- * Added `Text.Pandoc.Readers.Txt2Tags`, exporting `readTxt2Tags` (Matthew- Pickering).-- * Added `Text.Pandoc.Writers.DokuWiki`, exporting `writeDokuWiki`- (Clare Macrae).-- * Added `Text.Pandoc.Writers.Haddock`, exporting `writeHaddock`.-- * Added `Text.Pandoc.MediaBag`, exporting `MediaBag`, `lookupMedia`,- `insertMedia`, `mediaDirectory`, `extractMediaBag`. The docx and epub- readers return a pair of a `Pandoc` document and a `MediaBag` with- the media resources they contain. This can be extracted using- `--extract-media`. Writers that incorporate media (PDF, Docx,- ODT, EPUB, RTF, or HTML formats with `--self-contained`) will look- for resources in the `MediaBag` generated by the reader, in addition to- the file system or web.-- * `Text.Pandoc.Readers.TexMath`: Removed deprecated `readTeXMath`.- Renamed `readTeXMath'` to `texMathToInlines`.-- * `Text.Pandoc`: Added `Reader` data type (Matthew Pickering).- `readers` now associates names of readers with `Reader`- structures. This allows inclusion of readers, like the docx- reader, that take binary rather than textual input.-- * `Text.Pandoc.Shared`:-- + Added `capitalize` (Artyom Kazak), and replaced uses of- `map toUpper` (which give bad results for many languages).- + Added `collapseFilePath`, which removes intermediate `.` and- `..` from a path (Matthew Pickering).- + Added `fetchItem'`, which works like `fetchItem` but searches- a `MediaBag` before looking on the net or file system.- + Added `withTempDir`.- + Added `removeFormatting`.- + Added `extractSpaces` (from HTML reader) and generalized its type- so that it can be used by the docx reader (Matthew Pickering).- + Added `ordNub`.- + Added `normalizeInlines`, `normalizeBlocks`.- + `normalize` is now `Pandoc -> Pandoc` instead of- `Data a :: a -> a`. Some users may need to change their uses of- `normalize` to the newly exported `normalizeInlines` or- `normalizeBlocks`.-- * `Text.Pandoc.Options`:-- + Added `writerMediaBag` to `WriterOptions`.- + Removed deprecated and no longer used `readerStrict` in- `ReaderOptions`. This is handled by `readerExtensions` now.- + Added `Ext_compact_definition_lists`.- + Added `Ext_epub_html_exts`.- + Added `Ext_native_divs` and `Ext_native_spans`.- This allows users to turn off the default pandoc behavior of- parsing contents of div and span tags in markdown and HTML- as native pandoc Div blocks and Span inlines.-- * `Text.Pandoc.Parsing`:-- + Generalized `readWith` to `readWithM` (Matthew Pickering).- + Export `runParserT` and `Stream` (Matthew Pickering).- + Added `HasQuoteContext` type class (Matthew Pickering).- + Generalized types of `mathInline`, `smartPunctuation`, `quoted`,- `singleQuoted`, `doubleQuoted`, `failIfInQuoteContext`,- `applyMacros` (Matthew Pickering).- + Added custom `token` (Matthew Pickering).- + Added `stateInHtmlBlock` to `ParserState`. This is used to keep- track of the ending tag we're waiting for when we're parsing inside- HTML block tags.- + Added `stateMarkdownAttribute` to `ParserState`. This is used- to keep track of whether the markdown attribute has been set in- an enclosing tag.- + Generalized type of `registerHeader`, using new type classes- `HasReaderOptions`, `HasIdentifierList`, `HasHeaderMap` (Matthew- Pickering). These allow certain common functions to be reused- even in parsers that use custom state (instead of `ParserState`),- such as the MediaWiki reader.- + Moved `inlineMath`, `displayMath` from Markdown reader to Parsing,- and generalized their types (Matthew Pickering).-- * `Text.Pandoc.Pretty`:-- + Added `nestle`.- + Added `blanklines`, which guarantees a certain number of blank lines- (and no more).-- [bug fixes]-- * Markdown reader:-- + Fixed parsing of indented code in list items. Indented code- at the beginning of a list item must be indented eight spaces- from the margin (or edge of the container), or four spaces- from the list marker, whichever is greater.- + Fixed small bug in HTML parsing with `markdown_attribute`, which- caused incorrect tag nesting for input like- `<aside markdown="1">*hi*</aside>`.- + Fixed regression with intraword underscores (#1121).- + Improved parsing of inline links containing quote characters (#1534).- + Slight rewrite of `enclosure`/`emphOrStrong` code.- + Revamped raw HTML block parsing in markdown (#1330).- We no longer include trailing spaces and newlines in the- raw blocks. We look for closing tags for elements (but without- backtracking). Each block-level tag is its own `RawBlock`;- we no longer try to consolidate them (though `--normalize` will do so).- + Combine consecutive latex environments. This helps when you have- two minipages which can't have blank lines between them (#690, #1196).- + Support smallcaps through span.- `<span style="font-variant:small-caps;">foo</span>` will be- parsed as a `SmallCaps` inline, and will work in all output- formats that support small caps (#1360).- + Prevent spurious line breaks after list items (#1137). When the- `hard_line_breaks` option was specified, pandoc would formerly- produce a spurious line break after a tight list item.- + Fixed table parsing bug (#1333).- + Handle `c++` and `objective-c` as language identifiers in- github-style fenced blocks (#1318).- + Inline math must have nonspace before final `$` (#1313).-- * LaTeX reader:-- + Handle comments at the end of tables. This resolves the issue- illustrated in <http://stackoverflow.com/questions/24009489>.- + Correctly handle table rows with too few cells. LaTeX seems to- treat them as if they have empty cells at the end (#241).- + Handle leading/trailing spaces in `\emph` better.- `\emph{ hi }` gets parsed as `[Space, Emph [Str "hi"], Space]`- so that we don't get things like `* hi *` in markdown output.- Also applies to `\textbf` and some other constructions (#1146).- + Don't assume preamble doesn't contain environments (#1338).- + Allow (and discard) optional argument for `\caption` (James Aspnes).-- * HTML reader:-- + Fixed major parsing problem with HTML tables. Table cells were- being combined into one cell (#1341).- + Fixed performance issue with malformed HTML tables.- We let a `</table>` tag close an open `<tr>` or `<td>` (#1167).- + Allow space between `<col>` and `</col>`.- + Added `audio` and `source` in `eitherBlockOrInline`.- + Moved `video`, `svg`, `progress`, `script`, `noscript`, `svg` from- `blockTags` to `eitherBlockOrInline`.- + `map` and `object` were mistakenly in both lists; they have been removed- from `blockTags`.- + Ignore `DOCTYPE` and `xml` declarations.-- * MediaWiki reader:-- + Don't parse backslash escapes inside `<source>` (#1445).- + Tightened up template parsing.- The opening `{{` must be followed by an alphanumeric or `:`.- This prevents the exponential slowdown in #1033.- + Support "Bild" for images.-- * DocBook reader:-- + Better handle elements inside code environments. Pandoc's document- model does not allow structure inside code blocks, but at least this way- we preserve the text (#1449).- + Support `<?asciidoc-br?>` (#1236).-- * Textile reader:-- + Fixed list parsing. Lists can now start without an intervening- blank line (#1513).- + HTML block-level tags that do not start a line are parsed as- inline HTML and do not interrupt paragraphs (as in RedCloth).-- * Org reader:-- + Make tildes create inline code (#1345). Also relabeled `code` and- `verbatim` parsers to accord with the org-mode manual.- + Respect `:exports` header argument in code blocks (Craig Bosma).- + Fixed tight lists with sublists (#1437).-- * EPUB writer:-- + Avoid excess whitespace in `nav.xhtml`. This should improve- TOC view in iBooks (#1392).- + Fixed regression on cover image.- In 1.12.4 and 1.12.4.2, the cover image would not appear properly,- because the metadata id was not correct. Now we derive the id from the- actual cover image filename, which we preserve rather than using- "cover-image."- + Keep newlines between block elements. This allows- easier diff-ability (#1424).- + Use `stringify` instead of custom `plainify`.- + Use `renderTags'` for all tag rendering. This properly handles tags- that should be self-closing. Previously `<hr/>` would appear in EPUB- output as `<hr></hr>` (#1420).- + Better handle HTML media tags.- + Handle multiple dates with OPF `event` attributes. Note: in EPUB3 we- can have only one dc:date, so only the first one is used.-- * LaTeX writer:-- + Correctly handle figures in notes. Notes can't contain figures in- LaTeX, so we fake it to avoid an error (#1053).- + Fixed strikeout + highlighted code (#1294).- Previously strikeout highlighted code caused an error.-- * ConTeXt writer:-- + Improved detection of autolinks with URLs containing escapes.-- * RTF writer:-- + Improved image embedding: `fetchItem'` is now used to get the- images, and calculated image sizes are indicated in the RTF.- + Avoid extra paragraph tags in metadata (#1421).-- * HTML writer:-- + Deactivate "incremental" inside slide speaker notes (#1394).- + Don't include empty items in the table of contents for- slide shows. (These would result from creating a slide- using a horizontal rule.)-- * MediaWiki writer:-- + Minor renaming of `st` prefixed names.-- * AsciiDoc writer:-- + Double up emphasis and strong emphasis markers in intraword- contexts, as required by asciidoc (#1441).-- * Markdown writer:-- + Avoid wrapping that might start a list, blockquote, or header (#1013).- + Use Span instead of (hackish) `SmallCaps` in `plainify`.- + Don't use braced attributes for fenced code (#1416).- If `Ext_fenced_code_attributes` is not set, the first class- attribute will be printed after the opening fence as a bare word.- + Separate adjacent lists of the same kind with an HTML comment (#1458).-- * PDF writer:-- + Fixed treatment of data uris for images (#1062).-- * Docx writer:-- + Use Compact style for empty table cells (#1353).- Otherwise we get overly tall lines when there are empty- table cells and the other cells are compact.- + Create overrides per-image for `media/` in reference docx.- This should be somewhat more robust and cover more types of images.- + Improved `entryFromArchive` to avoid an unneeded parse.- + Section numbering carries over from reference.docx (#1305).- + Simplified `abstractNumId` numbering. Instead of sequential numbering,- we assign numbers based on the list marker styles.-- * `Text.Pandoc.Options`:-- + Removed `Ext_fenced_code_attributes` from `markdown_github`- extensions.-- * `Text.Pandoc.ImageSize`:-- + Use default instead of failing if image size not found- in exif header (#1358).- + ignore unknown exif header tag rather than crashing.- Some images seem to have tag type of 256, which was causing- a runtime error.-- * `Text.Pandoc.Shared`:-- + `fetchItem`: unescape URI encoding before reading local file (#1427).- + `fetchItem`: strip a fragment like `?#iefix` from the extension before- doing mime lookup, to improve mime type guessing.- + Improved logic of `fetchItem`: absolute URIs are fetched from the net;- other things are treated as relative URIs if `sourceURL` is `Just _`,- otherwise as file paths on the local file system.- + `fetchItem` now properly handles links without a protocol (#1477).- + `fetchItem` now escapes characters not allowed in URIs before trying- to parse the URIs.- + Fixed runtime error with `compactify'DL` on certain lists (#1452).-- * `pandoc.hs`: Don't strip path off of `writerSourceURL`: the path is- needed to resolve relative URLs when we fetch resources (#750).-- * `Text.Pandoc.Parsing`-- + Simplified `dash` and `ellipsis` (#1419).- + Removed `(>>~)` in favor of the equivalent `(<*)` (Matthew Pickering).- + Generalized functions to use `ParsecT` (Matthew Pickering).- + Added `isbn` and `pmid` to list of recognized schemes (Matthew- Pickering).-- [template changes]-- * Added haddock template.- * EPUB3: Added `type` attribute to `link` tags. They are supposed to- be "advisory" in HTML5, but kindlegen seems to require them.- * EPUB3: Put title page in section with `epub:type="titlepage"`.- * LaTeX: Made `\subtitle` work properly (#1327).- * LaTeX/Beamer: remove conditional around date (#1321).- * LaTeX: Added `lot` and `lof` variables, which can be set to- get `\listoftables` and `\listoffigures` (#1407). Note that- these variables can be set at the command line with `-Vlot -Vlof`- or in YAML metadata.-- [under the hood improvements]-- * Rewrote normalize for efficiency (#1385).-- * Rewrote Haddock reader to use `haddock-library` (#1346).-- + This brings pandoc's rendering of haddock markup in line- with the new haddock.- + Fixed line breaks in `@` code blocks.- + alex and happy are no longer build-depends.-- * Added `Text.Pandoc.Compat.Directory` to allow building against- different versions of the `directory` library.-- + Added `Text.Pandoc.Compat.Except` to allow building against- different verions of `mtl`.-- * Code cleanup in some writers, using Reader monad to avoid- passing options parameter around (Matej Kollar).-- * Improved readability in `pandoc.hs`.-- * Miscellaneous code cleanups (Artyom Kazak).-- * Avoid `import Prelude hiding (catch)` (#1309, thanks to Michael- Thompson).-- * Changed `http-conduit` flag to `https`. Depend on `http-client`- and `http-client-tls` instead of `http-conduit`. (Note: pandoc still- depends on `conduit` via `yaml`.)-- * Require `highlighting-kate >= 0.5.8.5` (#1271, #1317, Debian #753299).- This change to highlighting-kate means that PHP fragments no longer need- to start with `<?php`. It also fixes a serious bug causing failures with- ocaml and fsharp.-- * Require latest `texmath`. This fixes `\tilde{E}` and allows- `\left` to be used with `]`, `)` etc. (#1319), among many other- improvements.-- * Require latest `zip-archive`. This has fixes for unicode path names.-- * Added tests for plain writer.-- * `Text.Pandoc.Templates`:-- + Fail informatively on template syntax errors.- With the move from parsec to attoparsec, we lost good error- reporting. In fact, since we weren't testing for end of input,- malformed templates would fail silently. Here we revert back to- Parsec for better error messages.- + Use `ordNub` (#1022).-- * Benchmarks:-- + Made benchmarks compile again (Artyom Kazak).- + Fixed so that the failure of one benchmark does not prevent others- from running (Artyom Kazak).- + Use `nfIO` instead of the `getLength` trick to force full evaluation.- + Changed benchmark to use only the test suite, so that benchmarks- run more quickly.-- * Windows build script:-- + Add `-windows` to file name.- + Use one install command for pandoc, pandoc-citeproc.- + Force install of pandoc-citeproc.-- * `make_osx_package`: Call zip file `pandoc-VERSION-osx.zip`.- The zip should not be named `SOMETHING.pkg.zip`, or OSX finder- will extract it into a folder named `SOMETHING.pkg`, which it- will interpret as a defective package (#1308).-- * `README`:-- + Made headers for all extensions so they have IDs and can be- linked to (Beni Cherniavsky-Paskin).- + Fixed typos (Phillip Alday).- + Fixed documentation of attributes (#1315).- + Clarified documentation on small caps (#1360).- + Better documentation for `fenced_code_attributes` extension- (Caleb McDaniel).- + Documented fact that you can put YAML metadata in a separate file- (#1412).---pandoc (1.12.4.2)-- * Require highlighting-kate >= 0.5.8. Fixes a performance regression.-- * Shared: `addMetaValue` now behaves slightly differently:- if both the new and old values are lists, it concatenates their- contents to form a new list.-- * LaTeX reader:-- + Set `bibliography` in metadata from `\bibliography` or- `\addbibresource` command.- + Don't error on `%foo` with no trailing newline.-- * Org reader:-- + Support code block headers (`#+BEGIN_SRC ...`) (Albert Krewinkel).- + Fix parsing of blank lines within blocks (Albert Krewinkel).- + Support pandoc citation extension (Albert Krewinkel). This can- be turned off by specifying `org-citations` as the input format.-- * Markdown reader:-- + `citeKey` moved to `Text.Pandoc.Parsing` so it can be used by- other readers (Albert Krewinkel).-- * `Text.Pandoc.Parsing`:-- + Added `citeKey` (see above).- + Added `HasLastStrPosition` type class and `updateLastStrPos`- and `notAfterString` functions.-- * Updated copyright notices (Albert Krewinkel).-- * Added default.icml to data files so it installs with the package.-- * OSX package:-- + The binary is now built with options to ensure that it can be- used with OSX 10.6+.- + Moved OSX package materials to osx directory.- + Added OSX package uninstall script, included in the zip container- (thanks to Daniel T. Staal).--pandoc (1.12.4)-- * Made it possible to run filters that aren't executable (#1096).- Pandoc first tries to find the executable (searching the path- if path isn't given). If it fails, but the file exists and has- a `.py`, `.pl`, `.rb`, `.hs`, or `.php` extension, pandoc runs the filter- using the appropriate interpreter. This should make it easier to- use filters on Windows, and make it more convenient for everyone.-- * Added Emacs org-mode reader (Albert Krewinkel).-- * Added InDesign ICML Writer (mb21).-- * MediaWiki reader:-- + Accept image links in more languages (Jaime Marquínez Ferrándiz).- + Fixed bug in certain nested lists (#1213). If a level 2 list was- followed by a level 1 list, the first item of the level 1 list- would be lost.- + Handle table rows containing just an HTML comment (#1230).-- * LaTeX reader:-- + Give better location information on errors, pointing to line- numbers within included files (#1274).- + LaTeX reader: Better handling of `table` environment (#1204).- Positioning options no longer rendered verbatim.- + Better handling of figure and table with caption (#1204).- + Handle `@{}` and `p{length}` in tabular. The length is not actually- recorded, but at least we get a table (#1180).- + Properly handle `\nocite`. It now adds a `nocite` metadata- field. Citations there will appear in the bibliography but not- in the text (unless you explicitly put a `$nocite$` variable- in your template).-- * Markdown reader:-- + Ensure that whole numbers in YAML metadata are rendered without- decimal points. (This became necessary with changes to aeson- and yaml libraries. aeson >= 0.7 and yaml >= 0.8.8.2 are now required.)- + Fixed regression on line breaks in strict mode (#1203).- + Small efficiency improvements.- + Improved parsing of nested `div`s. Formerly a closing `div` tag- would be missed if it came right after other block-level tags.- + Avoid backtracking when closing `</div>` not found.- + Fixed bug in reference link parsing in `markdown_mmd`.- + Fixed a bug in list parsing (#1154). When reading a raw list- item, we now strip off up to 4 spaces.- + Fixed parsing of empty reference link definitions (#1186).- + Made one-column pipe tables work (#1218).-- * Textile reader:-- + Better support for attributes. Instead of being ignored, attributes- are now parsed and included in Span inlines. The output will be a bit- different from stock textile: e.g. for `*(foo)hi*`, we'll get- `<em><span class="foo">hi</span></em>` instead of- `<em class="foo">hi</em>`. But at least the data is not lost.- + Improved treatment of HTML spans (%) (#1115).- + Improved link parsing. In particular we now pick up on attributes.- Since pandoc links can't have attributes, we enclose the whole link in- a span if there are attributes (#1008).- + Implemented correct parsing rules for inline markup (#1175, Matthew- Pickering).- + Use Builder (Matthew Pickering).- + Fixed list parsing bug (#1500).- + Don't allow inline formatting to extend over newlines.- This matches the behavior of RedCarpet, avoids some ugly bugs,- and improves performance.-- * DocBook reader:-- + Better treatment of `formalpara`. We now emit the title (if present)- as a separate paragraph with boldface text (#1215).- + Set metadata `author` not `authors`.- + Added recognition of `authorgroup` and `releaseinfo` elements (#1214,- Matthew Pickering).- + Converted current meta information parsing in DocBook to a more- extensible version which is aware of the more recent meta- representation (Matthew Pickering).-- * HTML reader:-- + Require tagsoup 0.13.1, to fix a bug with parsing of script tags- (#1248).- + Treat processing instructions & declarations as block. Previously- these were treated as inline, and included in paragraph tags in HTML- or DocBook output, which is generally not what is wanted (#1233).- + Updated `closes` with rules from HTML5 spec.- + Use Builder (Matthew Pickering, #1162).-- * RST reader:-- + Remove duplicate `http` in PEP links (Albert Krewinkel).- + Make rst figures true figures (#1168, CasperVector)- + Enhanced Pandoc's support for rST roles (Merijn Verstaaten).- rST parser now supports: all built-in rST roles, new role definition,- role inheritance, though with some limitations.- + Use `author` rather than `authors` in metadata.- + Better handling of directives. We now correctly handle field- lists that are indented more than three spaces. We treat an- `aafig` directive as a code block with attributes, so it can be- processed in a filter (#1212).-- * LaTeX writer:-- + Mark span contents with label if span has an ID (Albert Krewinkel).- + Made `--toc-depth` work well with books in latex/pdf output (#1210).- + Handle line breaks in simple table cells (#1217).- + Workaround for level 4-5 headers in quotes. These previously produced- invalid LaTeX: `\paragraph` or `\subparagraph` in a `quote` environment.- This adds an `mbox{}` in these contexts to work around the problem.- See <http://tex.stackexchange.com/a/169833/22451> (#1221).- + Use `\/` to avoid en-dash ligature instead of `-{}-` (Vaclav Zeman).- This is to fix LuaLaTeX output. The `-{}-` sequence does not avoid the- ligature with LuaLaTeX but `\/` does.- + Fixed string escaping in `hyperref` and `hyperdef` (#1130).-- * ConTeXt writer: Improved autolinks (#1270).-- * DocBook writer:-- + Improve handling of hard line breaks in Docbook writer- (Neil Mayhew). Use a `<literallayout>` for the entire paragraph, not- just for the newline character.- + Don't let line breaks inside footnotes influence the enclosing- paragraph (Neil Mayhew).- + Distinguish tight and loose lists in DocBook output, using- `spacing="compact"` (Neil Mayhew, #1250).-- * Docx writer: When needed files are not present in the user's- `reference.docx`, fall back on the versions in the `reference.docx`- in pandoc's data files. This fixes a bug that occurs when a- `reference.docx` saved by LibreOffice is used. (#1185)-- * EPUB writer:-- + Include extension in epub ids. This fixes a problem with duplicate- extensions for fonts and images with the same base name but different- extensions (#1254).- + Handle files linked in raw `img` tags (#1170).- + Handle media in `audio` source tags (#1170).- Note that we now use a `media` directory rather than `images`.- + Incorporate files linked in `video` tags (#1170). `src` and `poster`- will both be incorporated into `content.opf` and the epub container.-- * HTML writer:-- + Add colgroup around col tags (#877). Also affects EPUB writer.- + Fixed bug with unnumbered section headings. Unnumbered section- headings (with class `unnumbered`) were getting numbers.- + Improved detection of image links. Previously image links with- queries were not recognized, causing `<embed>` to be used instead- of `<img>`.-- * Man writer: Ensure that terms in definition lists aren't line wrapped- (#1195).-- * Markdown writer:-- + Use proper escapes to avoid unwanted lists (#980). Previously we used- 0-width spaces, an ugly hack.- + Use longer backtick fences if needed (#1206). If the content contains a- backtick fence and there are attributes, make sure longer fences are- used to delimit the code. Note: This works well in pandoc, but github- markdown is more limited, and will interpret the first string of three- or more backticks as ending the code block.-- * RST writer: Avoid stack overflow with certain tables (#1197).-- * RTF writer: Fixed table cells containing paragraphs.-- * Custom writer:-- + Correctly handle UTF-8 in custom lua scripts (#1189).- + Fix bugs with lua scripts with mixed-case filenames and- paths containing `+` or `-` (#1267). Note that `getWriter`- in `Text.Pandoc` no longer returns a custom writer on input- `foo.lua`.-- * AsciiDoc writer: Handle multiblock and empty table cells- (#1245, #1246). Added tests.-- * `Text.Pandoc.Options`: Added `readerTrace` to `ReaderOptions`-- * `Text.Pandoc.Shared`:-- + Added `compactify'DL` (formerly in markdown reader) (Albert Krewinkel).- + Fixed bug in `toRomanNumeral`: numbers ending with '9' would- be rendered as Roman numerals ending with 'IXIV' (#1249). Thanks to- Jesse Rosenthal.- + `openURL`: set proxy with value of http_proxy env variable (#1211).- Note: proxies with non-root paths are not supported, due to- limitations in `http-conduit`.-- * `Text.Pandoc.PDF`:-- + Ensure that temp directories deleted on Windows (#1192). The PDF is- now read as a strict bytestring, ensuring that process ownership will- be terminated, so the temp directory can be deleted.- + Use `/` as path separators in a few places, even on Windows.- This seems to be necessary for texlive (#1151, thanks to Tim Lin).- + Use `;` for `TEXINPUTS` separator on Windows (#1151).- + Changes to error reporting, to handle non-UTF8 error output.-- * `Text.Pandoc.Templates`:-- + Removed unneeded datatype context (Merijn Verstraaten).-- + YAML objects resolve to "true" in conditionals (#1133).- Note: If `address` is a YAML object and you just have `$address$`- in your template, the word `true` will appear, which may be- unexpected. (Previously nothing would appear.)-- * `Text.Pandoc.SelfContained`:-- + `mkSelfContained` now takes just two arguments, `WriterOptions` and- the string.- * It no longer looks in data files. This only made sense when we- had copies of slidy and S5 code there.- * `fetchItem'` is used instead of the nearly duplicate `getItem`.- + Handle `poster` attribute in `video` tags (#1188).-- * `Text.Pandoc.Parsing`:-- + Made `F` an instance of Applicative (#1138).- + Added `stateCaption`.- + Added `HasMacros`, simplified other typeclasses.- Removed `updateHeaderMap`, `setHeaderMap`, `getHeaderMap`,- `updateIdentifierList`, `setIdentifierList`, `getIdentifierList`.- + Changed the smart punctuation parser to return `Inlines`- rather than `Inline` (Matthew Pickering).- + Changed `HasReaderOptions`, `HasHeaderMap`, `HasIdentifierList`- from typeclasses of monads to typeclasses of states. This simplifies- the instance definitions and provides more flexibility. Generalized- type of `getOption` and added a default definition. Removed- `askReaderOption`. Added `extractReaderOption`. Added- `extractHeaderMap` and `updateHeaderMap` in `HasHeaderMap`.- Gave default definitions for `getHeaderMap`, `putHeaderMap`,- `modifyHeaderMap`. Added `extractIdentifierList` and- `updateIdentifierList` in `HasIdentifierList`. Gave defaults- for `getIdentifierList`, `putIdentifierList`, and- `modifyIdentifierList`. The ultimate goal here is to allow different- parsers to use their own, tailored parser states (instead of- `ParserState`) while still using shared functions.-- * Template changes:-- + LaTeX template: Use `fontenc` package only with `pdflatex` (#1164).- + LaTeX template: Add `linestretch` and `fontfamily` variables.- + LaTeX template: Conditionalize author and date commands.- + Beamer template: Consistent styles for figure and table captions- (aaronwolen).- + LaTeX and beamer template: Adjust widths correctly for oversized- images. Use `\setkeys{Gin}{}` to set appropriate defaults for- `\includegraphics` (Yihui Xie, Garrick Aden-Buie). Load- `upquote` only after `fontenc` (Yihui Xie).- + Beamer template: Added caption package (#1200).- + Beamer template: changes for better unicode handling (KarolS).- + DocBook template: use `authorgroup` if there are authors.- + revealjs template: Move `include-after` to end (certainlyakey).- + revealjs template: Fixed PDF print function (#1220, kevinkenan).-- * Bumped version bounds of dependencies.-- * Added a `--trace` command line option, for debugging backtracking- bugs. So far this only works with the markdown reader.-- * MathMLinHTML: Fixed deprecation warning (#362, gwern, Albert Krewinkel).-- * Updated travis script to test with multiple GHC versions.-- * Force failure of a Travis build if GHC produces warnings (Albert- Krewinkel).-- * Add `.editorconfig` (Albert Krewinkel).- See <http://editorconfig.org/> for details.-- * Give more useful error message if '-t pdf' is specified (#1155).-- * Added `Cite`, `SmallCaps` to `Arbitrary` instance (#1269).-- * Allow `html4` as a synonym of `html` as a reader (it already works- as a writer).-- * README:-- + Added an explanation of how to use YAML metadata to- force items to appear in the bibliography without citations in- the text (like LaTeX `\nocite`).- + Added note to `--bibtex/--natbib`: not for use in making PDF- (#1194, thanks to nahoj).- + Added explanatory notes about `--natbib` and `--biblatex`.- + Added specification of legal syntax for citation keys.- + Fixed variable defaults documentation (Albert Krewinkel).-- * Removed copyright statements for files that have been removed- (Albert Krewinkel).-- * Moved some doc files from `data-files` to `extra-source-files` (#1123).- They aren't needed at runtime. We keep README and COPYRIGHT in data- to ensure that they'll be available on all systems on which pandoc- is installed.-- * Use cabal sandboxes in Windows build script.--pandoc (1.12.3.3)-- * To changes to source; recompiled tarball with latest alex and- happy, so they will work with GHC 7.8.--pandoc (1.12.3.2)-- * Bumped version bounds for blaze-html, blaze-markup.-- * ImageSize: Avoid use of lookAhead, which is not in binary >= 0.6- (#1124).-- * Fixed mediawiki ordered list parsing (#1122).-- * HTML reader: Fixed bug reading inline math with `$$` (#225).-- * Added support for LaTeX style literate Haskell code blocks in rST- (Merijn Verstraaten).--pandoc (1.12.3.1)-- * Relaxed version constraint on binary, allowing the use of binary 0.5.--pandoc (1.12.3)-- * The `--bibliography` option now sets the `biblio-files` variable.- So, if you're using `--natbib` or `--biblatex`, you can just use- `--bibliography=foo.bib` instead of `-V bibliofiles=foo`.-- * Don't run pandoc-citeproc filter if `--bibliography` is- used together with `--natbib` or `--biblatex` (Florian Eitel).-- * Template changes:-- + Updated beamer template to include booktabs.- + Added `abstract` variable to LaTeX template.- + Put `header-includes` after `title` in LaTeX template (#908).- + Allow use of `\includegraphics[size]` in beamer.- This just required porting a macro definition from the default- LaTeX template to the default beamer template.-- * `reference.docx`: Include `FootnoteText` style.- Otherwise Word ignores the style, even when specified in the `pPr`.- (#901)-- * `reference.odt`: Tidied `styles.xml`.-- * Relaxed version bounds for dependencies.-- * Added `withSocketsDo` around http conduit code in `openURL`,- so it works on Windows (#1080).-- * Added `Cite` function to `sample.lua`.-- * Markdown reader:-- + Fixed regression in title blocks (#1089).- If author field was empty, date was being ignored.- + Allow backslash-newline hard line breaks in grid and- multiline table cells.- + Citation keys may now start with underscores, and may contain- underscores adjacent to internal punctuation.-- * LaTeX reader:-- + Add support for `Verb` macro (jrnold) (#1090).- + Support babel-style quoting: `` "`..."' ``.-- * Properly handle script blocks in strict mode. (That is,- `markdown-markdown_in_html_blocks`.) Previously a spurious- `<p>` tag was being added (#1093).-- * Docbook reader: Avoid failure if `tbody` contains no `tr` or `row`- elements.-- * LaTeX writer:-- + Factored out function for table cell creation.- + Better treatment of footnotes in tables.- Notes now appear in the regular sequence, rather than in the- table cell. (This was a regression in 1.10.)-- * HTML reader: Parse name/content pairs from meta tags as metadata.- Closes #1106.-- * Moved `fixDisplayMath` from Docx writer to `Writer.Shared`.-- * OpenDocument writer: Fixed `RawInline`, `RawBlock` so they don't escape.-- * ODT writer: Use mathml for proper rendering of formulas.- Note: LibreOffice's support for this seems a bit buggy. But- it should be better than what we had before.-- * RST writer: Ensure no blank line after def in definition list (#992).-- * Markdown writer: Don't use tilde code blocks with braced attributes in- `markdown_github` output. A consequence of this change is that the- backtick form will be preferred in general if both are enabled. That- is good, as it is much more widespread than the tilde form. (#1084)-- * Docx writer: Fixed problem with some modified reference docx files.- Include `word/_rels/settings.xml.rels` if it exists, as well as other- `rels` files besides the ones pandoc generates explicitly.-- * HTML writer:-- + With `--toc`, headers no longer link to themselves (#1081).- + Omit footnotes from TOC entries. Otherwise we get doubled- footnotes when headers have notes!-- * EPUB writer:-- + Avoid duplicate notes when headings contain notes.- This arose because the headings are copied into the metadata- "title" field, and the note gets rendered twice. We strip the- note now before putting the heading in "title".- + Strip out footnotes from toc entries.- + Fixed bug with `--epub-stylesheet`. Now the contents of- `writerEpubStylesheet` (set by `--epub-stylesheet`)- should again work, and take precedence over a stylesheet specified- in the metadata.-- * `Text.Pandoc.MIME`: Added `wmf`, `emf`.-- * `Text.Pandoc.Shared`: `fetchItem` now handles image URLs beginning- with `//`.-- * `Text.Pandoc.ImageSize`: Parse EXIF format JPEGs. Previously- we could only get size information for JFIF format, which led- to squished images in Word documents. Closes #976.-- * Removed old `MarkdownTest_1.0.3` directory (#1104).--pandoc (1.12.2.1)-- * Markdown reader: Fixed regression in list parser, involving- continuation lines containing raw HTML (or even verbatim raw HTML).--pandoc (1.12.2)-- * Metadata may now be included in YAML blocks in a markdown document.- For example,-- ---- title:- - type: main- text: My Book- - type: subtitle- text: An investigation of metadata- creator:- - role: author- text: John Smith- - role: editor- text: Sarah Jones- identifier:- - scheme: DOI- text: doi:10.234234.234/33- publisher: My Press- rights: (c) 2007 John Smith, CC BY-NC- cover-image: img/mypic.jpg- ...-- Metadata may still be provided using `--epub-metadata`; it will- be merged with the metadata in YAML blocks.-- * EPUB writer:-- + `meta` tags are now used instead of `opf` attributes for EPUB3.- + Insert "svg" property as needed in opf (EPUB 3).- + Simplify `imageTypeOf` using `getMimeType`.- + Add properties attribute to `cover-image` item for EPUB 3.- + Don't include node for `cover.xhtml` if no cover!- + Ensure that same identifier is used throughout (#1044).- If an identifier is given in metadata, we use that; otherwise- we generate a random uuid.- + Add cover reference to guide element (EPUB 2) (Shaun Attfield).- Fixes an issue with Calibre putting the cover at the end of the book- if the spine has `linear="no"`. Apparently this is best practice- for other converters as well:- <http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.6>.- + Allow `stylesheet` in metadata. The value is a path to the stylesheet.- + Allow partial dates: `YYYY`, `YYYY-MM`.-- * Markdown writer: Fix rendering of tight sublists (#1050).- Previously a spurious blank line was included after a tight sublist.-- * ODT writer: Add `draw:name` attribute to `draw:frame` elements (#1069).- This is reported to be necessary to avoid an error from recent- versions of Libre Office when files contain more than one image- Thanks to wmanley for reporting and diagnosing the problem.-- * ConTeXt writer: Don't hardcode figure/table placement and numbering.- Instead, let this be set in the template, using `\setupfloat`.- Thanks to on4aa and Aditya Mahajan for the suggestion (#1067).-- * Implemented CSL flipflopping spans in DOCX, LaTeX, and HTML writers.-- * Fixed bug with markdown intraword emphasis. Closes #1066.-- * Docbook writer: Hierarchicalize block content in metadata.- Previously headers just disappeared from block-level metadata- when it was used in templates. Now we apply the 'hierarchicalize'- transformation. Note that a block headed by a level-2 header will- turn into a `<sect1>` element.-- * OpenDocument writer: Skip raw HTML (#1035).- Previously it was erroneously included as verbatim text.-- * HTML/EPUB writer, footnotes: Put `<sup>` tag inside `<a>` tags.- This allows better control of formatting, since the `<a>`- tags have a distinguishing class (#1049).-- * Docx writer:-- + Use mime type info returned by fetchItem.- + Fixed core metadata (#1046).- Don't create empty date nodes if no date given.- Don't create multiple `dc:creator` nodes; instead separate by- semicolons.- + Fix URL for core-properties in `_rels/.rels` (#1046).-- * Plain writer: don't print `<span>` tags.-- * LaTeX writer:-- + Fix definition lists with internal links in terms (#1032).- This fix puts braces around a term that contains an internal- link, to avoid problems with square brackets.- + Properly escape pdftitle, pdfauthor (#1059).- + Use booktabs package for tables (thanks to Jose Luis Duran).-- * Updated beamer template. Now references should work properly- (in a slide) when `--biblatex` or `--natbib` is used.-- * LaTeX reader:-- + Parse contents of curly quotes or matched `"` as quotes.- + Support `\textnormal` as span with class `nodecor`.- This is needed for pandoc-citeproc.- + Improved citation parsing. This fixes a run-time error that occured- with `\citet{}` (empty list of keys). It also ensures that empty keys- don't get produced.-- * MediaWiki reader: Add automatic header identifiers.-- * HTML reader:-- + Use pandoc `Div` and `Span` for raw `<div>`, `<span>` when- `--parse-raw`.- + Recognize `svg` tags as block level content (thanks to MinRK).- + Parse LaTeX math if appropriate options are set.-- * Markdown reader:-- + Yaml block must start immediately after `---`. If there's a blank- line after `---`, we interpreted it as a horizontal rule.- + Correctly handle empty bullet list items.- + Stop parsing "list lines" when we hit a block tag.- This fixes exponential slowdown in certain input, e.g.- a series of lists followed by `</div>`.-- * Slides: Preserve `<div class="references">` in references slide.-- * `Text.Pandoc.Writer.Shared`:-- + Fixed bug in `tagWithAttrs`. A space was omitted before key-value- attributes, leading to invalid HTML.- + `normalizeDate`: Allow dates with year only (thanks to Shaun Attfield).- + Fixed bug in `openURL` with `data:` URIs. Previously the base-64- encoded bytestring was returned. We now decode it so it's a proper- image!-- * DocBook reader: Handle numerical attributes starting with decimal.- Also use `safeRead` instead of `read`.-- * `Text.Pandoc.Readers.TexMath`: Export `readTeXMath'`, which attends- to display/inline. Deprecate `readTeXMath`, and use `readTeXMath'`- in all the writers. Require `texmath >= 0.6.5.2`.-- * `Text.Pandoc.MIME`:-- + Add entry for `jfif`.- + In looking up extensions, drop the encoding info.- E.g. for 'image/jpg;base64' we should lookup 'image/jpg'.-- * Templates: Changed how array variables are resolved. Previously if- `foo` is an array (which might be because multiple values were set on- the command line), `$foo$` would resolve to the concatenation of the- elements of foo. This is rarely useful behavior. It has been changed- so that the first value is rendered. Of course, you can still iterate- over the values using `$for(foo)$`. This has the result that you can- override earlier settings using `-V` by putting new values later on the- command line, which is useful for many purposes.-- * `Text.Pandoc`: Don't default to `pandocExtensions` for all writers.-- * Allow "epub2" as synonym for "epub", "html4" for "html".-- * Don't look for slidy files in data files with `--self-contained`.-- * Allow `https:` command line arguments to be downloaded.-- * Fixed `make_osx_package.sh` so data files embedded in `pandoc-citeproc`.--pandoc (1.12.1)-- * `Text.Pandoc.Definition`: Changed default JSON serialization format.- Instead of `{"Str": "foo"}`, for example, we now have `{"t": "Str",- "c": "foo"}`. This new format is easier to work with outside of Haskell.- Incidentally, "t" stands for "tag", "c" for "contents".-- * MediaWiki reader: Trim contents of `<math>` tags, to avoid problems- when converting to markdown (#1027).-- * LaTeX reader:-- + Ensure that preamble doesn't contribute to the text of- the document.- + Fixed character escaping in \url{}. Previously `\~` wasn't handled- properly, among others.- + Parse `{groups}` as `Span`. This is needed for accurate conversion of- bibtex titles, since we need to know what was protected from- titlecase conversions.-- * LaTeX writer:-- + Specially escape non-ascii characters in labels.- Otherwise we can get compile errors and other bugs when- compiled with pdflatex (#1007). Thanks to begemotv2718 for the fix.- + Add link anchors for code blocks with identifiers (#1025).-- * Throughout the code, use `isURI` instead of `isAbsoluteURI`.- It allows fragments identifiers.-- * Slide formats:-- + A Div element with class "notes" is treated as speaker- notes. Currently beamer goes to `\note{}`, revealjs to- `<aside class="notes">`, and the notes are simply suppressed in- other formats (#925).- + Fixed `. . .` (pause) on HTML slide formats. Closes #1029.- The old version caused a pause to be inserted before the first- material on a slide. This has been fixed.- + Removed data files for s5, slideous, slidy.- Users of s5 and slideous will have to download the needed- files, as has been documented for some time in the README.- By default, slidy code will be sought on the web, as before.-- * HTML writer: Insert command to typeset mathjax only in slideous output- (#966, #1012).-- * RST writer: Skip spaces after display math. Otherwise we get indentation- problems, and part of the next paragraph may be rendered as part of the- math.-- * OpenDocument writer: Fix formatting of strikeout code (#995),- thanks to wilx. don't use `font-face-decls` variable.-- * Fixed test suite so it works with cabal sandboxes.--pandoc (1.12.0.2)-- * Removed `stringable` dependency.--pandoc (1.12.0.1)-- * Allow `--metadata` to be repeated for the same key to form a list.- This also has the effect that `--bibliography` can be repeated,- as before.-- * Handle boolean values in `--metadata`. Note that anything not parseable- as a YAML boolean or string is treated as a literal string.- You can get a string value with "yes", or any of the strings interpretable- as booleans, by quoting it:-- -M boolvalue=yes -M stringvalue='"yes"'-- * LaTeX writer: Don't print references if `--natbib` or `--biblatex`- option used.-- * DOCX writer: Add `settings.xml` to the zip container. Fixes a bug- in which docx files could not be read by some versions of Word- and LibreOffice (#990).-- * Fixed a regression involving slide shows with bibliographies.- The Div container around references messed up the procedure for carving- a document into slides. So we now remove the surrounding Div in- `prepSlides`.-- * More informative error message when a filter is not found in path.-- * Depend on pandoc-types 1.12.1. This provide `ToJSONFilter`- instances for `Data a => a -> [a]` and `Data a => a -> IO [a]`.-- * Don't use unicode_collation in building OSX package:- it adds something like 50MB of dependencies to the package.-- * Declare alex and happy as build-tools (#986).--pandoc (1.12)-- [new features]-- * Much more flexible metadata, including arbitrary fields and structured- values. Metadata can be specified flexibly in pandoc markdown using- YAML metadata blocks, which may occur anywhere in the document:-- ---- title: Here is my title.- abstract: |- This is the abstract.-- 1. It can contain- 2. block content- and *inline markup*-- tags: [cat, dog, animal]- ...-- Metadata fields automatically populate template variables.-- * Added `opml` (OPML) as input and output format. The `_note` attribute,- used in OmniOutliner and supported by multimarkdown, is supported.- We treat the contents as markdown blocks under a section header.-- * Added `haddock` (Haddock markup) as input format (David Lazar).-- * Added `revealjs` output format, for reveal.js HTML 5 slide shows.- (Thanks to Jamie F. Olson for the initial patch.)- Nested vertical stacks are used for hierarchical structure.- Results for more than one level of nesting may be odd.-- * Custom writers can now be written in lua.-- pandoc -t data/sample.lua-- will load the script sample.lua and use it as a custom writer.- (For a sample, do `pandoc --print-default-data-file sample.lua`.)- Note that pandoc embeds a lua interpreter, so lua need not be- installed separately.-- * New `--filter/-F` option to make it easier to run "filters"- (Pandoc AST transformations that operate on JSON serializations).- Filters are always passed the name of the output format, so their- behavior can be tailored to it. The repository- <https://github.com/jgm/pandocfilters> contains- a python module for writing pandoc filters in python, with- a number of examples.-- * Added `--metadata/-M` option.- This is like `--variable/-V`, but actually adds to metadata, not- just variables.-- * Added `--print-default-data-file` option, which allows printing- of any of pandoc's data files. (For example,- `pandoc --print-default-data-file reference.odt` will print- `reference.odt`.)-- * Added syntax for "pauses" in slide shows:-- This gives-- . . .-- me pause.-- * New markdown extensions:-- + `ignore_line_breaks`: causes intra-paragraph line breaks to be ignored,- rather than being treated as hard line breaks or spaces. This is useful- for some East Asian languages, where spaces aren't used between words,- but text is separated into lines for readability.- + `yaml_metadata_block`: Parse YAML metadata blocks. (Default.)- + `ascii_identifiers`: This will force `auto_identifiers` to use ASCII- only. (Default for `markdown_github`.) (#807)- + `lists_without_preceding_blankline`: Allow lists to start without- preceding blank space. (Default for `markdown_github`.) (#972)-- [behavior changes]-- * `--toc-level` no longer implies `--toc`.- Reason: EPUB users who don't want a visible TOC may still want- to set the TOC level for in the book navigation.-- * `--help` now prints in and out formats in alphabetical order, and- says something about PDF output (#720).-- * `--self-contained` now returns less verbose output (telling you- which URLs it is fetching, but not giving the full header). In- addition, there are better error messages when fetching a URL fails.-- * Citation support is no longer baked in to core pandoc. Users who- need citations will need to install and use a separate filter- (`--filter pandoc-citeproc`). This filter will take `bibliography`,- `csl`, and `citation-abbreviations` from the metadata, though it- may still be specified on the command line as before.-- * A `Cite` element is now created in parsing markdown whether or not- there is a matching reference.-- * The `pandoc-citeproc` script will put the bibliography at the- end of the document, as before. However, it will be put inside a `Div`- element with class "references", allowing users some control- over the styling of references. A final header, if any, will- be included in the `Div`.-- * The markdown writer will not print a bibliography if the- `citations` extension is enabled. (If the citations are formatted- as markdown citations, it is redundant to have a bibliography,- since one will be generated automatically.)-- * Previously we used to store the directory of the first input file,- even if it was local, and used this as a base directory for finding- images in ODT, EPUB, Docx, and PDF. This has been confusing to many- users. So we now look for images relative to the current- working directory, even if the first file argument is in another- directory. Note that this change may break some existing workflows.- If you have been assuming that relative links will be interpreted- relative to the directory of the first file argument, you'll need- to make that the current directory before running pandoc. (#942)-- * Better error reporting in some readers, due to changes in `readWith`:- the line in which the error occured is printed, with a caret pointing- to the column.-- * All slide formats now support incremental slide view for definition lists.-- * Parse `\(..\)` and `\[..\]` as math in MediaWiki reader.- Parse `:<math>...</math>` as display math. These notations are used with- the MathJax MediaWiki extension.-- * All writers: template variables are set automatically from metadata- fields. However, variables specified on the command line with- `--variable` will completely shadow metadata fields.-- * If `--variable` is used to set many variables with the same name,- a list is created.-- * Man writer: The `title`, `section`, `header`, and `footer` can now- all be set individually in metadata. The `description` variable has been- removed. Quotes have been added so that spaces are allowed in the- title. If you have a title that begins-- COMMAND(1) footer here | header here-- pandoc will still parse it into a title, section, header, and- footer. But you can also specify these elements explicitly (#885).-- * Markdown reader-- + Added support for YAML metadata blocks, which can come anywhere- in the document (not just at the beginning). A document can contain- multiple YAML metadata blocks.- + HTML span and div tags are parsed as pandoc Span and Div elements.-- * Markdown writer-- + Allow simple tables to be printed as grid tables,- if other table options are disabled. This means you can do- `pandoc -t markdown-pipe_tables-simple_tables-multiline_tables`- and all tables will render as grid tables.- + Support YAML title block (render fields in alphabetical order- to make output predictable).-- [API changes]-- * `Meta` in `Text.Pandoc.Definition` has been changed to allow- structured metadata. (Note: existing code that pattern-matches- on `Meta` will have to be revised.) Metadata can now contain- indefinitely many fields, with content that can be a string,- a Boolean, a list of `Inline` elements, a list of `Block`- elements, or a map or list of these.-- * A new generic block container (`Div`) has been added to `Block`,- and a generic inline container (`Span`) has been added to `Inline`.- These can take attributes. They will render in HTML, Textile,- MediaWiki, Org, RST and and Markdown (with `markdown_in_html`- extension) as HTML `<div>` and `<span>` elements; in other formats- they will simply pass through their contents. But they can be- targeted by scripts.-- * `Format` is now a newtype, not an alias for String.- Equality comparisons are case-insensitive.-- * Added `Text.Pandoc.Walk`, which exports hand-written tree-walking- functions that are much faster than the SYB functions from- `Text.Pandoc.Generic`. These functions are now used where possible- in pandoc's code. (`Tests.Walk` verifies that `walk` and `query`- match the generic traversals `bottomUp` and `queryWith`.)-- * Added `Text.Pandoc.JSON`, which provides `ToJSON` and `FromJSON`- instances for the basic pandoc types. They use GHC generics and- should be faster than the old JSON serialization using- `Data.Aeson.Generic`.-- * Added `Text.Pandoc.Process`, exporting `pipeProcess`.- This is a souped-up version of `readProcessWithErrorcode` that- uses lazy bytestrings instead of strings and allows setting- environment variables. (Used in `Text.Pandoc.PDF`.)-- * New module `Text.Pandoc.Readers.OPML`.-- * New module `Text.Pandoc.Writers.OPML`.-- * New module `Text.Pandoc.Readers.Haddock` (David Lazar).- This is based on Haddock's own lexer/parser.-- * New module `Text.Pandoc.Writers.Custom`.-- * In `Text.Pandoc.Shared`, `openURL` and `fetchItem` now return an- Either, for better error handling.-- * Made `stringify` polymorphic in `Text.Pandoc.Shared`.-- * Removed `stripTags` from `Text.Pandoc.XML`.-- * `Text.Pandoc.Templates`:-- + Simplified `Template` type to a newtype.- + Removed `Empty`.- + Changed type of `renderTemplate`: it now takes a JSON context- and a compiled template.- + Export `compileTemplate`.- + Export `renderTemplate'` that takes a string instead of a compiled- template.- + Export `varListToJSON`.-- * `Text.Pandoc.PDF` exports `makePDF` instead of `tex2pdf`.-- * `Text.Pandoc`:-- + Made `toJsonFilter` an alias for `toJSONFilter` from `Text.Pandoc.JSON`.- + Removed `ToJsonFilter` typeclass. `ToJSONFilter` from- `Text.Pandoc.JSON` should be used instead. (Compiling against- pandoc-types instead of pandoc will also produce smaller executables.)- * Removed the deprecated `jsonFilter` function.- + Added `readJSON`, `writeJSON` to the API (#817).-- * `Text.Pandoc.Options`:-- + Added `Ext_lists_without_preceding_blankline`,- `Ext_ascii_identifiers`, `Ext_ignore_line_breaks`,- `Ext_yaml_metadataBlock` to `Extension`.- + Changed `writerSourceDirectory` to `writerSourceURL` and changed the- type to a `Maybe`. `writerSourceURL` is set to 'Just url' when the- first command-line argument is an absolute URL. (So, relative links- will be resolved in relation to the first page.) Otherwise, 'Nothing'.- + All bibliography-related fields have been removed from- `ReaderOptions` and `WriterOptions`: `writerBiblioFiles`,- `readerReferences`, `readerCitationStyle`.-- * The `Text.Pandoc.Biblio` module has been removed. Users of the- pandoc library who want citation support will need to use- `Text.CSL.Pandoc` from `pandoc-citeproc`.--- [bug fixes]-- * In markdown, don't autolink a bare URI that is followed by `</a>`- (#937).-- * `Text.Pandoc.Shared`-- + `openURL` now follows redirects (#701), properly handles `data:`- URIs, and prints diagnostic output to stderr rather than stdout.- + `readDefaultDataFile`: normalize the paths. This fixes bugs in- `--self-contained` on pandoc compiled with `embed_data_files` (#833).- + Fixed `readDefaultDataFile` so it works on Windows.- + Better error messages for `readDefaultDataFile`. Instead of- listing the last path tried, which can confuse people who are- using `--self-contained`, so now we just list the data file name.- + URL-escape pipe characters. Even though these are legal, `Network.URI`- doesn't regard them as legal in URLs. So we escape them first (#535).-- * Mathjax in HTML slide shows: include explicit "Typeset" call.- This seems to be needed for some formats (e.g. slideous) and won't- hurt in others (#966).-- * `Text.Pandoc.PDF`-- + On Windows, create temdir in working directory, since the system- temp directory path may contain tildes, which can cause- problems in LaTeX (#777).- + Put temporary output directory in `TEXINPUTS` (see #917).- + `makePDF` tries to download images that are not found locally,- if the first argument is a URL (#917).- + If compiling with `pdflatex` yields an encoding error, offer- the suggestion to use `--latex-engine=xelatex`.-- * Produce automatic header identifiers in parsing textile, RST,- and LaTeX, unless `auto_identifiers` extension is disabled (#967).-- * `Text.Pandoc.SelfContained`: Strip off fragment, query of relative URL- before treating as a filename. This fixes `--self-contained` when used- with CSS files that include web fonts using the method described here:- <http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/>- (#739). Handle `src` in `embed`, `audio`, `source`, `input` tags.-- * `Text.Pandoc.Parsing`: `uri` parser no longer treats punctuation before- percent-encoding, or a `+` character, as final punctuation.-- * `Text.Pandoc.ImageSize`: Handle EPS (#903). This change will make- EPS images properly sized on conversion to Word.-- * Slidy: Use slidy.js rather than slidy.js.gz.- Reason: some browsers have trouble with the gzipped js file,- at least on the local file system (#795).-- * Markdown reader-- + Properly handle blank line at beginning of input (#882).- + Fixed bug in unmatched reference links. The input- `[*infile*] [*outfile*]` was getting improperly parsed:- "infile" was emphasized, but "*outfile*" was literal (#883).- + Allow internal `+` in citation identifiers (#856).- + Allow `.` or `)` after `#` in ATX headers if no `fancy_lists`.- + Do not generate blank title, author, or date metadata elements.- Leave these out entirely if they aren't present.- + Allow backtick code blocks not to be preceded by blank line (#975).-- * Textile reader:-- + Correctly handle entities.- + Improved handling of `<pre>` blocks (#927). Remove internal HTML tags- in code blocks, rather than printing them verbatim. Parse attributes- on `<pre>` tag for code blocks.-- * HTML reader: Handle non-simple tables (#893). Column widths are read from- `col` tags if present, otherwise divided equally.-- * LaTeX reader-- + Support alltt environment (#892).- + Support `\textasciitilde`, `\textasciicircum` (#810).- + Treat `\textsl` as emphasized text reader (#850).- + Skip positional options after `\begin{figure}`.- + Support `\v{}` for hacek (#926).- + Don't add spurious ", " to citation suffixes.- This is added when needed in pandoc-citeproc.- + Allow spaces in alignment spec in tables, e.g. `{ l r c }`.- + Improved support for accented characters (thanks to Scott Morrison).- + Parse label after section command and set id (#951).-- * RST reader:-- + Don't insert paragraphs where docutils doesn't.- `rst2html` doesn't add `<p>` tags to list items (even when they are- separated by blank lines) unless there are multiple paragraphs in the- list. This commit changes the RST reader to conform more closely to- what docutils does (#880).- + Improved metadata. Treat initial field list as metadata when- standalone specified. Previously ALL fields "title", "author",- "date" in field lists were treated as metadata, even if not at- the beginning. Use `subtitle` metadata field for subtitle.- + Fixed 'authors' metadata parsing in reST. Semicolons separate- different authors.-- * MediaWiki reader-- + Allow space before table rows.- + Fixed regression for `<ref>URL</ref>`.- `<` is no longer allowed in URLs, according to the uri parser- in `Text.Pandoc.Parsing`. Added a test case.- + Correctly handle indented preformatted text without preceding- or following blank line.- + Fixed `|` links inside table cells. Improved attribute parsing.- + Skip attributes on table rows. Previously we just crashed if- rows had attributes, now we ignore them.- + Ignore attributes on headers.- + Allow `Image:` for images (#971).- + Parse an image with caption in a paragraph by itself as a figure.-- * LaTeX writer-- + Don't use ligatures in escaping inline code.- + Fixed footnote numbers in LaTeX/PDF tables. This fixes a bug- wherein notes were numbered incorrectly in tables (#827).- + Always create labels for sections. Previously the labels were only- created when there were links to the section in the document (#871).- + Stop escaping `|` in LaTeX math.- This caused problems with array environments (#891).- + Change `\` to `/` in paths. `/` works even on Windows in LaTeX.- `\` will cause major problems if unescaped.- + Write id for code block to label attribute in LaTeX when listings- is used (thanks to Florian Eitel).- + Scale LaTeX tables so they don't exceed columnwidth.- + Avoid problem with footnotes in unnumbered headers (#940).-- * Beamer writer: when creating beamer slides, add `allowframebreaks` option- to the slide if it is one of the header classes. It is recommended- that your bibliography slide have this attribute:-- # References {.allowframebreaks}-- This causes multiple slides to be created if necessary, depending- on the length of the bibliography.-- * ConTeXt writer: Properly handle tables without captions. The old output- only worked in MkII. This should work in MkIV as well (#837).-- * MediaWiki writer: Use native mediawiki tables instead of HTML (#720).-- * HTML writer:-- + Fixed `--no-highlight` (Alexander Kondratskiy).- + Don't convert to lowercase in email obfuscation (#839).- + Ensure proper escaping in `<title>` and `<meta>` fields.-- * AsciiDoc writer:-- + Support `--atx-headers` (Max Rydahl Andersen).- + Don't print empty identifier blocks `([[]])` on headers (Max- Rydahl Andersen).-- * ODT writer:-- + Fixing wrong numbered-list indentation in open document format- (Alexander Kondratskiy) (#369).- + `reference.odt`: Added pandoc as "generator" in `meta.xml`.- + Minor changes for ODF 1.2 conformance (#939). We leave the- nonconforming `contextual-spacing` attribute, which is provided by- LibreOffice itself and seems well supported.-- * Docx writer:-- + Fixed rendering of display math in lists.- In 1.11 and 1.11.1, display math in lists rendered as a new list- item. Now it always appears centered, just as outside of lists,- and in proper display math style, no matter how far indented the- containing list item is (#784).- + Use `w:br` with `w:type` `textWrapping` for linebreaks.- Previously we used `w:cr` (#873).- + Use Compact style for Plain block elements, to- differentiate between tight and loose lists (#775).- + Ignore most components of `reference.docx`.- We take the `word/styles.xml`, `docProps/app.xml`,- `word/theme/theme1.xml`, and `word/fontTable.xml` from- `reference.docx`, ignoring everything else. This should help- with the corruption problems caused when different versions of- Word resave the reference.docx and reorganize things.- + Made `--no-highlight` work properly.-- * EPUB writer-- + Don't add `dc:creator` tags if present in EPUB metadata.- + Add `id="toc-title"` to `h1` in `nav.xhtml` (#799).- + Don't put blank title page in reading sequence.- Set `linear="no"` if no title block. Addresses #797.- + Download webtex images and include as data URLs.- This allows you to use `--webtex` in creating EPUBs.- Math with `--webtex` is automatically made self-contained.- + In `data/epub.css`, removed highlighting styles (which- are no longer needed, since styles are added by the HTML- writer according to `--highlighting-style`). Simplified- margin fields.- + If resource not found, skip it, as in Docx writer (#916).-- * RTF writer:-- + Properly handle characters above the 0000-FFFF range.- Uses surrogate pairs. Thanks to Hiromi Ishii for the patch.- + Fixed regression with RTF table of contents.- + Only autolink absolute URIs. This fixes a regression, #830.-- * Markdown writer:-- + Only autolink absolute URIs. This fixes a regression, #830.- + Don't wrap attributes in fenced code blocks.- + Write full metadata in MMD style title blocks.- + Put multiple authors on separate lines in pandoc titleblock.- Also, don't wrap long author entries, as new lines get treated- as new authors.-- * `Text.Pandoc.Templates`:-- + Fixed bug retrieving default template for markdown variants.- + Templates can now contain "record lookups" in variables;- for example, `author.institution` will retrieve the `institution`- field of the `author` variable.- + More consistent behavior of `$for$`. When `foo` is not a list,- `$for(foo)$...$endfor$` should behave like $if(foo)$...$endif$.- So if `foo` resolves to "", no output should be produced.- See pandoc-templates#39.-- * Citation processing improvements (now part of pandoc-citeproc):-- + Fixed `endWithPunct` The new version correctly sees a sentence- ending in '.)' as ending with punctuation. This fixes a bug which- led such sentences to receive an extra period at the end: '.).'.- Thanks to Steve Petersen for reporting.- + Don't interfere with Notes that aren't citation notes.- This fixes a bug in which notes not generated from citations were- being altered (e.g. first letter capitalized) (#898).- + Only capitalize footnote citations when they have a prefix.- + Changes in suffix parsing. A suffix beginning with a digit gets 'p'- inserted before it before passing to citeproc-hs, so that bare numbers- are treated as page numbers by default. A suffix not beginning with- punctuation has a space added at the beginning (rather than a comma and- space, as was done before for not-author-in-text citations).- The result is that `\citep[23]{item1}` in LaTeX will be interpreted- properly, with '23' treated as a locator of type 'page'.- + Many improvements to citation rendering, due to fixes in citeproc-hs- (thanks to Andrea Rossato).- + Warnings are issued for undefined citations, which are rendered- as `???`.- + Fixed hanging behavior when locale files cannot be found.-- [template changes]-- * DocBook: Use DocBook 4.5 doctype.-- * Org: '#+TITLE:' is inserted before the title.- Previously the writer did this.-- * LaTeX: Changes to make mathfont work with xelatex.- We need the mathspec library, not just fontspec, for this.- We also need to set options for setmathfont (#734).-- * LaTeX: Use `tex-ansi` mapping for `monofont`.- This ensures that straight quotes appear as straight, rather than- being treated as curly. See #889.-- * Made `\includegraphics` more flexible in LaTeX template.- Now it can be used with options, if needed. Thanks to Bernhard Weichel.-- * LaTeX/Beamer: Added `classoption` variable.- This is intended for class options like `oneside`; it may- be repeated with different options. (Thanks to Oliver Matthews.)-- * Beamer: Added `fonttheme` variable. (Thanks to Luis Osa.)-- * LaTeX: Added `biblio-style` variable (#920).-- * DZSlides: title attribute on title section.-- * HTML5: add meta tag to allow scaling by user (Erik Evenson)-- [under-the-hood improvements]-- * Markdown reader:Improved strong/emph parsing, using the strategy of- <https://github.com/jgm/Markdown>. The new parsing algorithm requires- no backtracking, and no keeping track of nesting levels. It will give- different results in some edge cases, but these should not affect normal- uses.-- * Added `Text.Pandoc.Compat.Monoid`.- This allows pandoc to compile with `base` < 4.5, where `Data.Monoid`- doesn't export `<>`. Thanks to Dirk Ullirch for the patch.-- * Added `Text.Pandoc.Compat.TagSoupEntity`.- This allows pandoc to compile with `tagsoup` 0.13.x.- Thanks to Dirk Ullrich for the patch.-- * Most of `Text.Pandoc.Readers.TeXMath` has been moved to the- `texmath` module (0.6.4). (This allows `pandoc-citeproc` to- handle simple math in bibliography fields.)-- * Added `Text.Pandoc.Writers.Shared` for shared functions used- only in writers. `metaToJSON` is used in writers to create a- JSON object for use in the templates from the pandoc metadata- and variables. `getField`, `setField`, and `defField` are- for working with JSON template contexts.-- * Added `Text.Pandoc.Asciify` utility module.- This exports functions to create ASCII-only versions of identifiers.-- * `Text.Pandoc.Parsing`-- + Generalized state type on `readWith` (API change).- + Specialize readWith to `String` input. (API change).- + In `ParserState`, replace `stateTitle`, `stateAuthors`, `stateDate`- with `stateMeta` and `stateMeta'`.-- * `Text.Pandoc.UTF8`: use strict bytestrings in reading. The use of lazy- bytestrings seemed to cause problems using pandoc on 64-bit Windows- 7/8 (#874).-- * Factored out `registerHeader` from markdown reader, added to- `Text.Pandoc.Parsing`.-- * Removed `blaze_html_0_5` flag, require `blaze-html` >= 0.5.- Reason: < 0.5 does not provide a monoid instance for Attribute,- which is now needed by the HTML writer (#803).-- * Added `http-conduit` flag, which allows fetching https resources.- It also brings in a large number of dependencies (`http-conduit`- and its dependencies), which is why for now it is an optional flag- (#820).-- * Added CONTRIBUTING.md.-- * Improved INSTALL instructions.-- * `make-windows-installer.bat`: Removed explicit paths for executables.-- * `aeson` is now used instead of `json` for JSON.-- * Set default stack size to 16M. This is needed for some large- conversions, esp. if pandoc is compiled with 64-bit ghc.-- * Various small documentation improvements.- Thanks to achalddave and drothlis for patches.-- * Removed comment that chokes recent versions of CPP (#933).-- * Removed support for GHC version < 7.2, since pandoc-types now- requires at least GHC 7.2 for GHC generics.---pandoc (1.11.1)-- * Markdown reader:-- + Fixed regression in which parentheses were lost in link URLs.- Added tests. Closes #786.- + Better handling of unmatched double quotes in `--smart` mode.- These occur frequently in fiction, since it is customary not to- close quotes in dialogue if the speaker does not change between- paragraphs. The unmatched quotes now get turned into literal- left double quotes. (No `Quoted` inline is generated, however.)- Closes #99 (again).-- * HTML writer: Fixed numbering mismatch between TOC and sections.- `--number-offset` now affects TOC numbering as well- as section numbering, as it should have all along. Closes #789.-- * Markdown writer: Reverted 1.11 change that caused citations to be rendered- as markdown citations, even if `--bibliography` was specified, unless- `citation` extension is disabled. Now, formatted citations are always- printed if `--bibliography` was specified. If you want to reformat- markdown keeping pandoc markdown citations intact, don't use- `--bibliography`. Note that citations parsed from LaTeX documents will- be rendered as pandoc markdown citations when `--bibliography` is not- specified.-- * ODT writer: Fixed regression leading to corrupt ODTs.- This was due to a change in the `Show` instance for- `Text.Pandoc.Pretty.Doc`. Closes #780.-- * Fixed spacing bugs involving code block attributes in- RST reader and Markdown writer. Closes #763.-- * Windows package: Various improvements due to Fyodor Sheremetyev.-- + Automatically set installation path (Program Files or Local App Data).- + Set system PATH environment variable when installing for all users.- + Pandoc can installed for all users using the following command.- `msiexec /i pandoc-1.11.msi ALLUSERS=1`.-- * Bumped QuickCheck version bound.--pandoc (1.11)-- * Added `--number-offset` option. (See README for description.)-- * Added `--default-image-extension` option. (See README for description.)-- * `--number-sections` behavior change: headers with class `unnumbered`- will not be numbered.-- * `--version` now reports the default data directory.-- * `Text.Pandoc.Parsing` is no longer exposed. (API change.)-- * `Text.Pandoc.Highlighting` is no longer exposed. (API change.)-- * `Text.Pandoc.Shared`: Changed type of `Element`. `Sec` now includes- a field for `Attr` rather than just `String`. (API change.)-- * Added `markdown_github` as input format. This was an accidental- omission in 1.10.-- * Added `readerDefaultImageExtension` field to `ReaderOptions`. (API- change.)-- * Added `writerNumberOffset` field in `WriterOptions`. (API change.)-- * Beamer template:-- + Fixed captions with longtable. Thanks to Joost Kremers.- + Provide `\Oldincludegraphics` as in LaTeX template (Benjamin Bannier).-- * LaTeX template:-- + Load microtype after fonts. Microtype needs to know- what fonts are being used. Thanks to dfc for the patch.- + Set `secnumdepth` to 5 if `--number-sections` specified.- This yields behavior equivalent to the other writers, numbering- level 4 and 5 headers too. Closes #753.-- * HTML reader:-- + Handle `<colgroup>` tag.- + Preserve all header attributes.-- * LaTeX reader:-- + Parse `\hrule` as `HorizontalRule`. Closes #746.- + Parse starred variants of `\section` etc. as headers with- attribute `unnumbered`.- + Read optional attributes in `lstlisting` and `Verbatim` environments.- We convert these to pandoc standard names, e.g. `numberLines`- for `numbers=left`, `startFrom=100` from `firstnumber=100`.- + Handle language attribute for lstlistings.- + Better support for Verbatim and minted environments. Closes #763.-- * Markdown reader:-- + `-` in an attribute context = `.unnumbered`. The point of this- is to provide a way to specify unnumbered headers in non-English- documents.- + Fixed bug parsing key/value attributes. Parsing failed if you- had an unquoted attribute immediately before the final '}'.- + Make backslash escape work in attributes.- + Fix title block parsing. Now if `mmd_title_blocks` is specified,- pandoc will parse a MMD title block if it sees one, even if- `pandoc_title_blocks` is enabled.- + Refactoring: `litChar` now includes entities, so we don't need- to use `fromEntities` e.g. on titles.- + Allow spaces around borders in pipe tables. Closes #772.- + Allow all punctuation in angle-bracket autolinks. Previously- things like `----` were disallowed, because the uri parser- treated them as trailing punctuation. Closes #768.- + Make `implicit_header_references` work properly when- headers are given explicit identifiers.- + Check for tables before line blocks. Otherwise some pipe- tables get treated as line blocks.- + Allow `&` in emails (for entities).- + Properly handle entities in titles and links. A markdown link- `<http://göogle.com>` should be a link to `http://göogle.com`.- Closes #723.-- * Textile reader:-- + Handle attributes on headers.-- * LaTeX reader:-- + Add `fig:` as title for images with captions.- This is needed for them to be rendered as figures. Closes #766.- + Never emit an empty paragraph. See #761.- + Handle `\caption` for images in figures. Closes #766.- + Parse `\section*`, etc. as unnumbered sections.-- * HTML writer:-- + Support header attributes. The attributes go on- the enclosing `section` or `div` tag if `--section-divs` is specified.- + Fixed a regression (only now noticed) in html+lhs output.- Previously the bird tracks were being omitted.-- * LaTeX writer:-- + Omit lists with no items to avoid LaTeX errors.- + Support line numbering with `--listings`.- If `numberLines` class is present, we add `numbers=left`;- if `startFrom` is present, we add `firstnumber=`. (#763)-- * ConTeXt writer:-- + Removed `\placecontent`. This produced a duplicate toc,- in conjunction with `\placelist`.- + Use `\title`, `\subject` etc. for headers with- `unnumbered` class.-- * Textile writer:-- + Support header attributes.-- * Markdown writer:-- + Use grid tables when needed, and if enabled. Closes #740.- + Render citations as pandoc-markdown citations.- Previously citations were rendered as citeproc-formatted citations- by default. Now we render them as pandoc citations, e.g. `[@item1]`,- unless the `citations` extension is disabled.- If you still want formatted citations in your markdown output,- use `pandoc -t markdown-citations`.-- * RST writer:-- + Support `:number-lines:` in code blocks.-- * Docx writer:-- + Better treatment of display math. Display math inside a- paragraph is now put in a separate paragraph, so it will render- properly (centered and without extra blank lines around it).- Partially addresses #742.- + Content types and document rels xml files are now created from- scratch, rather than being taken over from `reference.docx`.- This fixes problems that arise when you edit the `reference.docx`- with Word.- + We also now encode mime types for each individual image rather- than using defaults. This should allow us to handle a wider- range of image types (including PDF). Closes #414.- + Changed style names in `reference docx`.- `FootnoteReference` -> `FootnoteRef`, `Hyperlink` -> `Link`.- The old names got changed by Word when the `reference.docx` was- edited. Closes #414.-- * EPUB writer:-- + Fix section numbering. Previously the numbering restarted from 1- in each chapter (with `--number-sections`), though the numbers in- the table of contents were correct.- + Headers with "unnumbered" attribute are not numbered. (Nor do they- cause an increment in running numbering.) Section numbers now work- properly, even when there is material before the first numbered section.- + Include HTML TOC, even in epub2. The TOC is included in `<spine>`,- but `linear` is set to `no` unless the `--toc` option is specified.- Include `<guide>` element in OPF. This should allow the TOC to- be useable in Kindles when converted with kindlegen. Closes #773.-- * `Text.Pandoc.Parsing`: Optimized `oneOfStringsCI`.- This dramatically reduces the speed penalty that comes from enabling the- `autolink_bare_uris` extension. The penalty is still substantial (in one- test, from 0.33s to 0.44s), but nowhere near what it used to be.- The RST reader is also much faster now, as it autodetects URIs.-- * `Text.Pandoc.Shared`: `hierarchicalize` will not number section- with class "unnumbered". Unnumbered sections get `[]` for their- section number.-- * `Text.Pandoc.Pretty`:-- + Fixed `chomp` so it works inside `Prefixed` elements.- + Changed `Show` instance so it is better for debugging.-- * `Text.Pandoc.ImageSize`: Added `Pdf` to `ImageType`.-- * `Text.Pandoc.UTF8`: Strip off BOM if present. Closes #743.-- * Windows installer improvements:-- + The installer is now signed with a certificate (thanks to- Fyodor Sheremetyev).- + WiX is used instead of InnoSetup. The installer is now a- standard msi file.- + The version number is now auto-detected, and need not be- updated separately.-- * OSX installer improvements:-- + The package and pandoc executable are now signed with a- certificate (thanks to Fyodor Sheremetyev).- + RTF version of license is used.- + Use full path for sysctl in `InstallationCheck` script (jonahbull).- Closes #580.-- * Converted COPYING to markdown.-- * pandoc.cabal: Require latest versions of highlighting-kate,- texmath, citeproc-hs, zip-archive.--pandoc (1.10.1)-- * Markdown reader: various optimizations, leading to a- significant performance boost.-- * RST reader: Allow anonymous form of inline links:- `` `hello <url>`__ `` Closes #724.-- * Mediawiki reader: Don't require newlines after tables.- Thanks to jrunningen for the patch. Closes #733.-- * Fixed LaTeX macro parsing. Now LaTeX macro definitions are preserved- when output is LaTeX, and applied when it is another format.- Partially addresses #730.-- * Markdown and RST readers: Added parser to `block` that skips blank- lines. This fixes a subtle regression involving grid tables with- empty cells. Also added test for grid table with empty cells.- Closes #732.-- * RST writer: Use `.. code:: language` for code blocks with language.- Closes #721.-- * DocBook writer: Fixed output for hard line breaks, adding a newline- between `<literallayout>` tags.-- * Markdown writer: Use an autolink when link text matches url.- Previously we also checked for a null title, but this- test fails for links produced by citeproc-hs in bibliographies.- So, if the link has a title, it will be lost on conversion- to an autolink, but that seems okay.-- * Markdown writer: Set title, author, date variables as before.- These are no longer used in the default template, since we use- titleblock, but we set them anyway for those who use custom templates.-- * LaTeX writer: Avoid extra space at start/end of table cell.- Thanks to Nick Bart for the suggestion of using @{}.-- * `Text.Pandoc.Parsing`:-- + More efficient version of `anyLine`.- + Type of `macro` has changed; the parser now returns `Blocks`- instead of `Block`.-- * Relaxed old-time version bound, allowing 1.0.*.-- * Removed obsolete `hsmarkdown` script. Those who need `hsmarkdown`- should create a symlink as described in the README.--pandoc (1.10.0.5)-- * Markdown reader: Try `lhsCodeBlock` before `rawTeXBlock`. Otherwise- `\begin{code}...\end{code}` isn't handled properly in markdown+lhs.- Thanks to Daniel Miot for noticing the bug and suggesting the fix.-- * Markdown reader: Fixed bug with headerless grid tables.- The 1.10 code assumed that each table header cell contains exactly one- block. That failed for headerless tables (0) and also for tables with- multiple blocks in a header cell. The code is fixed and tests provided.- Thanks to Andrew Lee for pointing out the bug.-- * Markdown reader: Fixed regressions in fenced code blocks. Closes #722.-- + Tilde code fences can again take a bare language string- (`~~~ haskell`), not just curly-bracketed attributes- (`~~~ {.haskell}`).- + Backtick code blocks can take the curly-bracketed attributes.- + Backtick code blocks don't *require* a language.- + Consolidated code for the two kinds of fenced code blocks.-- * LaTeX template: Use `\urlstyle{same}` to avoid monospace URLs.-- * Markdown writer: Use proportional font for email autolinks with- obfuscation. Closes #714.-- * Corrected name of `blank_before_blockquote` in README. Closes #718.-- * `Text.Pandoc.Shared`: Fixed bug in `uri` parser.- The bug prevented an autolink at the end of a string (e.g.- at the end of a line block line) from counting as a link. Closes #711.-- * Use the `hsb2hs` preprocessor instead of TH for embed_data_files.- This should work on Windows, unlike the TH solution with- file-embed.-- * Eliminated use of TH in test suite.-- * Added `Text.Pandoc.Data` (non-exported) to hold the association- list of embedded data files, if the `embed_data_files` flag is selected.- This isolates the code that needs special treatment with file-embed or- `hsb2hs`.-- * Changes to `make-windows-installer.bat`.-- + Exit batch file if any of the cabal-dev installs fail.- + There's no longer any need to reinstall `highlighting-kate`.- + Don't start with a `cabal update`; leave that to the user.- + Force reinstall of pandoc.-- * Fixed EPUB writer so it builds with blaze-html 0.4.x. Thanks to- Jens Petersen.--pandoc (1.10.0.4)-- * Fixed bug with escaped % in LaTeX reader. Closes #710.--pandoc (1.10.0.3)-- * Added further missing fb2 tests to cabal file.--pandoc (1.10.0.2)-- * Added fb2 tests to cabal file's extra-source-files.--pandoc (1.10.0.1)-- * Bump version bounds on test-framework packages.--pandoc (1.10)-- [new features]-- * New input formats: `mediawiki` (MediaWiki markup).-- * New output formats: `epub3` (EPUB v3 with MathML),- `fb2` (FictionBook2 ebooks).-- * New `--toc-depth` option, specifying how many levels of- headers to include in a table of contents.-- * New `--epub-chapter-level` option, specifying the header- level at which to divide EPUBs into separate files.- Note that this normally affects only performance, not the- visual presentation of the EPUB in a reader.-- * Removed the `--strict` option. Instead of using `--strict`,- one can now use the format name `markdown_strict` for either input- or output. This gives more fine-grained control that `--strict`- did, allowing one to convert from pandoc's markdown to strict- markdown or vice versa.-- * It is now possible to enable or disable specific syntax- extensions by appending them (with `+` or `-`) to the writer- or reader name. For example,-- pandoc -f markdown-footnotes+hard_line_breaks-- disables footnotes and enables treating newlines as hard- line breaks. The literate Haskell extensions are now implemented- this way as well, using either `+lhs` or `+literate_haskell`.- For a list of extension names, see the README under- "Pandoc's Markdown."-- * The following aliases have been introduced for specific- combinations of markdown extensions: `markdown_phpextra`,- `markdown_github`, `markdown_mmd`, `markdown_strict`. These aliases- work just like regular reader and writer names, and can be modified- with extension modifiers as described above. (Note that conversion- from one markdown dialect to another does not work perfectly,- because there are differences in markdown parsers besides- just the extensions, and because pandoc's internal document model is- not rich enough to capture all of the extensions.)-- * New `--html-q-tags` option. The previous default was to use `<q>`- tags for smart quotes in HTML5. But `<q>` tags are also valid HTML4.- Moreover, they are not a robust way of typesetting quotes, since- some user agents don't support them, and some CSS resets (e.g.- bootstrap) prevent pandoc's quotes CSS from working properly.- We now just insert literal quote characters by default in both- `html` and `html5` output, but this option is provided for- those who still want `<q>` tags.-- * The markdown reader now prints warnings (to stderr) about- duplicate link and note references. Closes #375.-- * Markdown syntax extensions:-- + Added pipe tables. Thanks to François Gannaz for the initial patch.- These conform to PHP Markdown Extra's pipe table syntax. A subset- of org-mode table syntax is also supported, which means that you can- use org-mode's nice table editor to create tables.-- + Added support for RST-style line blocks. These are- useful for verse and addresses.-- + Attributes can now be specified for headers, using the same- syntax as in code blocks. (However, currently only the- identifier has any effect in most writers.) For example,-- # My header {#foo}-- See [the header above](#foo).-- + Pandoc will now act as if link references have been defined- for all headers without explicit identifiers.- So, you can do this:-- # My header-- Link to [My header].- Another link to [it][My header].-- Closes #691.-- * LaTeX reader:-- + Command macros now work everywhere, including non-math.- Environment macros still not supported.- + `\input` now works, as well as `\include`. TEXINPUTS is used.- Pandoc looks recursively into included files for more included files.-- [behavior changes]-- * The Markdown reader no longer puts the text of autolinks in a- `Code` inline. This means that autolinks will no longer appear- in a monospace font.-- * The character `/` can now appear in markdown citation keys.-- * HTML blocks in strict_markdown are no longer required to begin- at the left margin. Technically this is required, according to- the markdown syntax document, but `Markdown.pl` and other markdown- processors are more liberal.-- * The `-V` option has been changed so that if there are duplicate- variables, those specified later on the command line take precedence.-- * Tight lists now work in LaTeX and ConTeXt output.-- * The LaTeX writer no longer relien on the `enumerate` package.- Instead, it uses standard LaTeX commands to change the list numbering- style.-- * The LaTeX writer now uses `longtable` instead of `ctable`. This allows- tables to be split over page boundaries.-- * The RST writer now uses a line block to render paragraphs containing- linebreaks (which previously weren't supported at all).-- * The markdown writer now applies the `--id-prefix` to footnote IDs.- Closes #614.-- * The plain writer no longer uses backslash-escaped line breaks- (which are not very "plain").-- * `Text.Pandoc.UTF8`: Better error message for invalid UTF8.- Read bytestring and use `Text`'s decodeUtf8 instead of using- `System.IO.hGetContents`. This way you get a message saying- "invalid UTF-8 stream" instead of "invalid byte sequence."- You are also told which byte caused the problem.-- * Docx, ODT, and EPUB writers now download images specified by a URL- instead of skipping them or raising an error.-- * EPUB writer:-- + The default CSS now left-aligns headers by default, instead of- centering. This is more consistent with the rest of the writers.- + A proper multi-level table of contents is now used in `toc.ncx`.- There is no longer a subsidiary table of contents at the beginning- of each chapter.- + Code highlighting now works by default.- + Section divs are used by default for better semantic markup.- + The title is used instead of "Title Page" in the table of contents.- Otherwise we have a hard-coded English string, which looks- strange in ebooks written in other languages. Closes #572.-- * HTML writer:-- + Put mathjax in span with class "math". Closes #562.- + Put citations in a span with class "citation." In HTML5, also include- a `data-cite` attribute with a space-separated list of citation- keys.-- * `Text.Pandoc.UTF8`: use universalNewlineMode in reading.- This treats both `\r\n` and `\n` as `\n` on input, no matter- what platform we're running on.-- * Citation processing is now done in the Markdown and LaTeX- readers, not in `pandoc.hs`. This makes it easier for library users- to use citations.-- [template changes]-- * HTML: Added css to template to preserve spaces in `<code>` tags.- Thanks to Dirk Laurie.-- * Beamer: Remove English-centric strings in section pages.- Section pages used to have "Section" and a number as well as the- section title. Now they just have the title. Similarly for part- and subsection. Closes #566.-- * LaTeX, ConTeXt: Added papersize variable.-- * LaTeX, Beamer templates: Use longtable instead of ctable.-- * LaTeX, Beamer templates: Don't require 'float' package for tables.- We don't actually seem to use the '[H]' option.-- * LaTeX: Use `upquote` package if it is available. This fixes- straight quotes in verbatim environments.-- * Markdown, plain: Fixed titleblock so it is just a single string.- Previously separate title, author, and date variables were used,- but this didn't allow different kinds of title blocks.-- * EPUB:-- + Rationalized templates. Previously there were three different- templates involved in epub production. There is now just one- template, `default.epub` or `default.epub3`. It can now be- overridden using `--template`, just like other templates.- The titlepage is now folded into the default template.- A `titlepage` variable selects it.- + UTF-8, lang tag, meta tags, title element.-- * Added scale-to-width feature to beamer template-- [API changes]-- * `Text.Pandoc.Definition`: Added `Attr` field to `Header`.- Previously header identifers were autogenerated by the writers.- Now they are added in the readers (either automatically or explicitly).-- * `Text.Pandoc.Builder`:-- + `Inlines` and `Blocks` are now synonyms for `Many Inline` and- `Many Block`. `Many` is a newtype wrapper around `Seq`, with- custom Monoid instances for `Many Inline` and `Many Block. This- allows `Many` to be made an instance of `Foldable` and `Traversable`.- + The old `Listable` class has been removed.- + The module now exports `isNull`, `toList`, `fromList`.- + The old `Read` and `Show` instances have been removed; derived- instances are now used.- + Added `headerWith`.-- * The readers now take a `ReaderOptions` rather than a `ParserState`- as a parameter. Indeed, not all parsers use the `ParserState` type;- some have a custom state. The motivation for this change was to separate- user-specifiable options from the accounting functions of parser state.-- * New module `Text.Pandoc.Options`. This includes the `WriterOptions`- formerly in `Text.Pandoc.Shared`, and its associated- data types. It also includes a new type `ReaderOptions`, which- contains many options formerly in `ParserState`, and its associated- data types:-- + `ParserState.stateParseRaw` -> `ReaderOptions.readerParseRaw`.- + `ParserState.stateColumns` -> `ReaderOptions.readerColumns`.- + `ParserState.stateTabStop` -> `ReaderOptions.readerTabStop`.- + `ParserState.stateOldDashes` -> `ReaderOptions.readerOldDashes`.- + `ParserState.stateLiterateHaskell` -> `ReaderOptions.readerLiterateHaskell`.- + `ParserState.stateCitations` -> `ReaderOptions.readerReferences`.- + `ParserState.stateApplyMacros` -> `ReaderOptions.readerApplyMacros`.- + `ParserState.stateIndentedCodeClasses` ->- `ReaderOptions.readerIndentedCodeClasses`.- + Added `ReaderOptions.readerCitationStyle`.-- * `WriterOptions` now includes `writerEpubVersion`, `writerEpubChapterLevel`,- `writerEpubStylesheet`, `writerEpubFonts`, `writerReferenceODT`,- `writerReferenceDocx`, and `writerTOCDepth`. `writerEPUBMetadata` has- been renamed `writerEpubMetadata` for consistency.-- * Changed signatures of `writeODT`, `writeDocx`, `writeEPUB`, since they no- longer stylesheet, fonts, reference files as separate parameters.-- * Removed `writerLiterateHaskell` from `WriterOptions`, and- `readerLiterateHaskell` from `ReaderOptions`. LHS is now handled- by an extension (`Ext_literate_haskell`).-- * Removed deprecated `writerXeTeX`.-- * Removed `writerStrict` from `WriterOptions`. Added `writerExtensions`.- Strict is now handled through extensions.-- * `Text.Pandoc.Options` exports `pandocExtensions`, `strictExtensions`,- `phpMarkdownExtraExtensions`, `githubMarkdownExtensions`,- and `multimarkdownExtensions`, as well as the `Extensions` type.-- * New `Text.Pandoc.Readers.MediaWiki` module, exporting- `readMediaWiki`.-- * New `Text.Pandoc.Writers.FB2` module, exporting `writeFB2`- (thanks to Sergey Astanin).-- * `Text.Pandoc`:-- + Added `getReader`, `getWriter` to `Text.Pandoc`.- + `writers` is now an association list `(String, Writer)`.- A `Writer` can be a `PureStringWriter`, an `IOStringWriter`, or- an `IOByteStringWriter`. ALL writers are now in the 'writers'- list, including the binary writers and FB2 writer. This allows- code in `pandoc.hs` to be simplified.- + Changed type of `readers`, so all readers are in IO.- Users who want pure readers can still get them form the reader- modules; this just affects the function `getReader` that looks up- a reader based on the format name. The point of this change is to- make it possible to print warnings from the parser.-- * `Text.Pandoc.Parsing`:-- + `Text.Parsec` now exports all Parsec functions used in pandoc code.- No other module directly imports Parsec. This will make it easier- to change the parsing backend in the future, if we want to.- + `Text.Parsec` is used instead of `Text.ParserCombinators.Parsec`.- + Export the type synonym `Parser`.- + Export `widthsFromIndices`, `NoteTable'`, `KeyTable'`, `Key'`, `toKey'`,- `withQuoteContext`, `singleQuoteStart`, `singleQuoteEnd`,- `doubleQuoteStart`, `doubleQuoteEnd`, `ellipses`, `apostrophe`,- `dash`, `nested`, `F(..)`, `askF`, `asksF`, `runF`, `lineBlockLines`.- + `ParserState` is no longer an instance of `Show`.- + Added `stateSubstitutions` and `stateWarnings` to `ParserState`.- + Generalized type of `withQuoteContext`.- + Added `guardEnabled`, `guardDisabled`, `getOption`.- + Removed `failIfStrict`.- + `lookupKeySrc` and `fromKey` are no longer exported.-- * `Data.Default` instances are now provided for `ReaderOptions`,- `WriterOptions`, and `ParserState`. `Text.Pandoc` re-exports `def`.- Now you can use `def` (which is re-exported by `Text.Pandoc`) instead- of `defaultWriterOptions` (which is still defined). Closes #546.-- * `Text.Pandoc.Shared`:-- + Added `safeRead`.- + Renamed `removedLeadingTrailingSpace` to `trim`,- `removeLeadingSpace` to `triml`, and `removeTrailingSpace` to `trimr`.- + Count `\r` as space in `trim` functions.- + Moved `renderTags'` from HTML reader and `Text.Pandoc.SelfContained`- to `Shared`.- + Removed `failUnlessLHS`.- + Export `compactify'`, formerly in Markdown reader.- + Export `isTightList`.- + Do not export `findDataFile`.- + `readDataFile` now returns a strict ByteString.- + Export `readDataFileUTF8` which returns a String, like the- old `readDataFile`.- + Export `fetchItem` and `openURL`.-- * `Text.Pandoc.ImageSize`: Use strict, not lazy bytestrings.- Removed `readImageSize`.-- * `Text.Pandoc.UTF8`: Export `encodePath`, `decodePath`,- `decodeArg`, `toString`, `fromString`, `toStringLazy`,- `fromStringLazy`.-- * `Text.Pandoc.UTF8` is now an exposed module.-- * `Text.Pandoc.Biblio`:-- + csl parameter now a `String` rather than a `FilePath`.- + Changed type of `processBiblio`. It is no longer in the IO monad.- It now takes a `Maybe Style` argument rather than parameters for CSL- and abbrev filenames. (`pandoc.hs` now calls the functions to parse- the style file and add abbreviations.)-- * Markdown reader now exports `readMarkdownWithWarnings`.-- * `Text.Pandoc.RTF` now exports `writeRTFWithEmbeddedImages` instead of- `rtfEmbedImage`.-- [bug fixes]-- * Make `--ascii` work properly with `--self-contained`. Closes #568.-- * Markdown reader:-- + Fixed link parser to avoid exponential slowdowns. Closes #620.- Previously the parser would hang on input like this:-- [[[[[[[[[[[[[[[[[[hi-- We fixed this by making the link parser parser characters- between balanced brackets (skipping brackets in inline code spans),- then parsing the result as an inline list. One change is that-- [hi *there]* bud](/url)-- is now no longer parsed as a link. But in this respect pandoc behaved- differently from most other implementations anyway, so that seems okay.-- + Look for raw html/latex blocks before tables.- Otherwise the following gets parsed as a table:-- \begin{code}- --------------- -- My comment.- \end{code}-- Closes #578.-- * RST reader:-- + Added support for `:target:` on `.. image::` blocks- and substitutions.- + Field list fixes:-- - Fixed field lists items with body beginning after a new line- (Denis Laxalde).- - Allow any char but ':' in names of field lists in RST reader- (Denis Laxalde).- - Don't allow line breaks in field names.- - Require whitespace after field list field names.- - Don't create empty definition list for metadata field lists.- Previously a field list consisting only of metadata fields (author,- title, date) would be parsed as an empty DefinitionList, which is- not legal in LaTeX and not needed in any format.-- + Don't recognize inline-markup starts inside words.- For example, `2*2 = 4*1` should not contain an emphasized- section. Added test case for "Literal symbols". Closes #569.- + Allow dashes as separator in simple tables. Closes #555.- + Added support for `container`, `compound`, `epigraph`,- `rubric`, `highlights`, `pull-quote`.- + Added support for `.. code::`.- + Made directive labels case-insensitive.- + Removed requirement that directives begin at left margin.- This was (correctly) not in earlier releases; docutils doesn't- make the requirement.- + Added support for `replace::` and `unicode::` substitutions.- + Ignore unknown interpreted roles.- + Renamed image parser to `subst`, since it now handles all- substitution references.-- * Textile reader:-- + Allow newlines before pipes in table. Closes #654.- + Fixed bug with list items containing line breaks.- Now pandoc correctly handles hard line breaks inside list items.- Previously they broke list parsing.- + Implemented comment blocks.- + Fixed bug affected words ending in hyphen.- + Properly handle links with surrounding brackets.- Square brackets need to be used when the link isn't surrounded by- spaces or punctuation, or when the URL ending may be ambiguous.- Closes #564.- + Removed nullBlock. Better to know about parsing problems than- to skip stuff when we get stuck.- + Allow ID attributes on headers.- + Textile reader: Avoid parsing dashes as strikeout.- Previously the input-- text--- text--- text--- text---- would be parsed with strikeouts rather than dashes. This fixes- the problem by requiring that a strikeout delimiting - not be- followed by a -. Closes #631.- + Expanded list of `stringBreakers`.- This fixes a bug on input like "(_hello_)" which should- be a parenthesized emphasized "hello".- The new list is taken from the PHP source of textile 2.4.- + Fixed autolinks. Previously the textile reader and writer- incorrectly implented RST-style autolinks for URLs and email- addresses. This has been fixed. Now an autolink is done this way:- `"$":http://myurl.com`.- + Fixed footnotes bug in textile. This affected notes occuring- before punctuation, e.g. `foo[1].`. Closes #518.-- * LaTeX reader:-- + Better handling of citation commands.- + Better handling of `\noindent`.- + Added a 'try' in rawLaTeXBlock, so we can handle `\begin` without `{`.- Closes #622.- + Made `rawLaTeXInline` try to parse block commands as well. This- is usually what we want, given how `rawLaTeXInline` is used in- the markdown and textile readers. If a block-level LaTeX command- is used in the middle of a paragraph (e.g. `\subtitle` inside a title),- we can treat it as raw inline LaTeX.- + Handle \slash command. Closes #605.- + Basic `\enquote` support.- + Fixed parsing of paragraphs beginning with a group. Closes #606.- + Use curly quotes for bare straight quotes.- + Support obeylines environment. Closes #604.- + Guard against "begin", "end" in inlineCommand and- blockCommand.- + Better error messages for environments. Now it should tell you that- it was looking for \end{env}, instead of giving "unknown parse error."-- * HTML reader:-- + Added HTML 5 tags to list of block-level tags.- + HTML reader: Fixed bug in `htmlBalanced`, which- caused hangs in parsing certain markdown input using- strict mode.- + Parse `<q>` as `Quoted DoubleQuote`.- + Handle nested `<q>` tags properly.- + Modified `htmlTag` for fewer false positives.- A tag must start with `<` followed by `!`,`?`, `/`, or a letter.- This makes it more useful in the wikimedia and markdown parsers.-- * DocBook reader: Support title in "figure" element. Closes #650.-- * MediaWiki writer:-- + Remove newline after `<br/>` in translation of `LineBreak`- There's no particular need for a newline (other than making the- generated MediaWiki source look nice to a human), and in fact- sometimes it is incorrect: in particular, inside an enumeration, list- items cannot have embedded newline characters. (Brent Yorgey)- + Use `<code>` not `<tt>` for Code.-- * Man writer: Escape `-` as `\-`.- Unescaped `-`'s become hyphens, while `\-`'s are left as ascii minus- signs. That is preferable for use with command-line options. See- <http://lintian.debian.org/tags/hyphen-used-as-minus-sign.html>. Thanks- to Andrea Bolognani for bringing the issue to our attention.-- * RST writer:-- + Improved line block output. Use nonbreaking spaces for- initial indent (otherwise lost in HTML and LaTeX).- Allow multiple paragraphs in a single line block.- Allow soft breaks w continuations in line blocks.- + Properly handle images with no alt text. Closes #678.- + Fixed bug with links with duplicate text. We now (a) use anonymous- links for links with inline URLs, and (b) use an inline link instead- of a reference link if the reference link would require a label that- has already been used for a different link. Closes #511.- + Fixed hyperlinked images. Closes #611. Use `:target:`- field when you have a simple linked image.- + Don't add `:align: center` to figures.-- * Texinfo writer: Fixed internal cross-references.- Now we insert anchors after each header, and use `@ref` instead of `@uref`- for links. Commas are now escaped as `@comma{}` only when needed;- previously all commas were escaped. (This change is needed, in part,- because `@ref` commands must be followed by a real comma or period.) Also- insert a blank line in from of `@verbatim` environments.-- * DocBook writer:-- + Made --id-prefix work in DocBook as well as HTML.- Closes #607.- + Don't include empty captions in figures. Closes #581.-- * LaTeX writer:-- + Use `\hspace*` for nonbreaking space after line break,- since `~` spaces after a line break are just ignored.- Closes #687.- + Don't escape `_` in URLs or hyperref identifiers.- + Properly escape strings inside \url{}. Closes #576.- + Use `[fragile]` only for slides containing code rendered- using listings. Closes #649.- + Escape `|` as `\vert` in LaTeX math. This avoids a clash with- highlighting-kate's macros, which redefine `|` as a short verbatim- delimiter. Thanks to Björn Peemöller for raising this issue.- + Use minipage rather than parbox for block containers in tables.- This allows verbatim code to be included in grid tables.- Closes #663.- + Prevent paragraphs containing only linebreaks or spaces.-- * HTML writer:-- + Included `highlighting-css` for code spans, too.- Previously it was only included if used in a code block. Closes #653.- + Improved line breaks with `<dd>` tags. We now put a newline between- `</dd>` and `<dd>` when there are multiple definitions.- + Changed mathjax cdn url so it doesn't use https. (This caused- problems when used with `--self-contained`.) See #609.-- * EPUB writer:-- + `--number-sections` now works properly.- + Don't strip meta and link elements in epub metadata.- Patch from aberrancy. Closes #589.- + Fixed a couple validation bugs.- + Use ch001, ch002, etc. for chapter filenames. This improves sorting- of chapters in some readers, which apparently sort ch2 after ch10.- Closes #610.-- * ODT writer: properly set title property (Arlo O'Keeffe).-- * Docx writer:-- + Fixed bug with nested lists. Previously a list like-- 1. one- - a- - b- 2. two-- would come out with a bullet instead of "2."- Thanks to Russell Allen for reporting the bug.- + Use `w:cr` in `w:r` instead of `w:br` for linebreaks.- This seems to fix a problem viewing pandoc-generated- docx files in LibreOffice.- + Use integer ids for bookmarks. Closes #626.- + Added nsid to abstractNum elements. This helps when merging- word documents with numbered or bulleted lists. Closes #627.- + Use separate footnotes.xml for notes.- This seems to help LibreOffice convert the file, even though- it was valid docx before. Closes #637.- + Use rIdNN identifiers for r:embed in images.- + Avoid reading image files again when we've already processed them.- + Fixed typo in `referenc.docx` that prevented image captions from- working. Thanks to Huashan Chen.-- * `Text.Pandoc.Parsing`:-- + Fixed bug in `withRaw`, which didn't correctly handle the case- where nothing is parsed.- + Made `emailAddress` parser more correct. Now it is based on RFC 822,- though it still doesn't implement quoted strings in email addresses.- + Revised URI parser. It now allows many more schemes, allows- uppercase URIs, and better handles trailing punctuation and- trailing slashes in bare URIs. Added many tests.- + Simplified and improved singleQuoteStart. This makes `'s'`, `'l'`,- etc. parse properly. Formerly we had some English-centric heuristics,- but they are no longer needed. Closes #698.-- * `Text.Pandoc.Pretty`: Added wide punctuation range to `charWidth`.- This fixes bug with Chinese commas in markdown and reST tables, and- a bug that caused combining characters to be dropped.-- * `Text.Pandoc.MIME`: Added MIME types for .wof and .eot. Closes #640.-- * `Text.Pandoc.Biblio`:-- + Run `mvPunc` and `deNote` on metadata too.- This fixed a bug with notes on titles using footnote styles.- + Fixed bug in fetching CSL files from CSL data directory.-- * `pandoc.hs`: Give correct value to `writerSourceDirectory` when a URL- is provided. It should be the URL up to the path.-- * Fixed/simplified diff output for tests.- Biblio: Make sure mvPunc and deNote run on metadata too.- This fixed a bug with notes on titles using footnote styles.-- [under the hood improvements]-- * We no longer depend on `utf8-string`. Instead we use functions- defined in `Text.Pandoc.UTF8` that use `Data.Text`'s conversions.-- * Use `safeRead` instead of using `reads` directly (various modules).-- * "Implicit figures" (images alone in a paragraph) are now handled- differently. The markdown reader gives their titles the prefix `fig:`; the- writers look for this before treating the image as a figure. Though this- is a bit of a hack, it has two advantages: (i) implicit figures can be- limited to the markdown reader, and (ii) they can be deactivated by turning- off the `implicit_figures` extension.-- * `catch` from `Control.Exception` is now used instead of the- old Preface `catch`.-- * `Text.Pandoc.Shared`: Improved algorithm for `normalizeSpaces`- and `oneOfStrings` (which is now non-backtracking).-- * `Text.Pandoc.Biblio`: Remove workaround for `toCapital`.- Now citeproc-hs is fixed upstream, so this is no longer needed.- Closes #531.-- * Textile reader: Improved speed of `hyphenedWords`.- This speeds up the textile reader by about a factor of 4.-- * Use `Text.Pandoc.Builder` in RST reader, for more flexibility,- better performance, and automatic normalization.-- * Major rewrite of markdown reader:-- + Use `Text.Pandoc.Builder` instead of lists. This also- means that everything is normalized automatically.- + Move to a one-pass parsing strategy, returning values in the reader- monad, which are then run (at the end of parsing) against the final- parser state.-- * In HTML writer, we now use `toHtml` instead of pre-escaping.- We work around the problem that blaze-html unnecessarily escapes `'`- by pre-escaping just the `'` characters, instead of the whole string.- If blaze-html later stops escaping `'` characters, we can simplify- `strToHtml` to `toHtml`. Closes #629.-- * Moved code for embedding images in RTFs from `pandoc.hs` to the- RTF writer (which now exports `writeRTFWithEmbeddedImages`).-- * Moved citation processing from `pandoc.hs` into the readers.- This makes things more convenient for library users.-- * The man pages are now built by an executable `make-pandoc-man-pages`,- which has its own stanza in the cabal file so that dependencies can be- handled by Cabal. Special treatment in `Setup.hs` ensures that this- executable never gets installed; it is only used to create the man pages.-- * The cabal file has been modified so that the pandoc library is used- in building the pandoc executable. (This required moving `pandoc.hs`- from `src` to `.`.) This cuts compile time in half.-- * `-O2` is no longer used in building pandoc. The performance improvement- it yields is so slight that it is not worth it. (Measured with- benchmarks on ghc 7.4.)-- * The `executable` and `library` flags have been removed.-- * `-threaded` has been removed from ghc-options.-- * Version bounds of dependencies have been raised, and the- `blaze_html_0_5` flag now defaults to True. Pandoc now compiles on- GHC 7.6.-- * We now require base >= 4.2.-- * Integrated the benchmark program into cabal. One can now do:-- cabal configure --enable-benchmarks && cabal build- cabal bench --benchmark-option='markdown' --benchmark-option='-s 20'-- The benchmark now uses README + testsuite, so benchmark results- from older versions aren't comparable.-- * Integrated test suite with cabal.- To run tests, configure with `--enable-tests`, then `cabal test`.- You can specify particular tests using `--test-options='-t markdown'`.- No output is shown unless tests fail. The Haskell test modules- have been moved from `src/` to `tests/`.-- * Moved all data files and templates to the `data/` subdirectory.-- * Added an `embed_data_files` cabal flag. This causes all- data files to be embedded in the binary, so that the binary- is self-sufficient and can be relocated anywhere, copied on- a USB key, etc. The Windows installer now uses this.- (Since we no longer have the option to build the executable- without the library, this is the only way to get a relocatable- binary on Windows.)-- * Removed pcre3.dll from windows package.- It isn't needed unless highlighting-kate is compilled with the- `pcre-light` flag. By default, regex-prce-builtin is used.---pandoc (1.9.4.2)-- * Don't encode/decode file paths if base >= 4.4.- Prior to base 4.4, filepaths and command line arguments were treated- as unencoded lists of bytes, not unicode strings, so we had to work- around that by encoding and decoding them. This commit adds CPP- checks for the base version that intelligibly enable encoding/decoding- when needed. Fixes a bug with multilingual filenames when pandoc was- compiled with ghc 7.4 (#540).-- * Don't generate an empty H1 after hrule slide breaks.- We now use a slide-level header with contents `[Str "\0"]` to mark- an hrule break. This avoids creation of an empty H1 in these- contexts. Closes #484.-- * Docbook reader: Added support for "bold" emphasis. Thanks to mb21.-- * In make_osx_package.sh, ensure citeproc-hs is built with the- embed_data_files flag.-- * MediaWiki writer: Avoid extra blank lines after sublists (Gavin Beatty).-- * ConTeXt writer: Don't escape `&`, `^`, `<`, `>`, `_`,- simplified escapes for `}` and `{` to `\{` and `\}` (Aditya Mahajan).-- * Fixed handling of absolute URLs in CSS imports with `--self-contained`.- Closes #535.-- * Added webm to mime types. Closes #543.-- * Added some missing exports and tests to the cabal file- (Alexander V Vershilov).-- * Compile with `-rtsopts` and `-threaded` by default.--pandoc (1.9.4.1)-- * Markdown reader: Added `cf.` and `cp.` to list of likely abbreviations.-- * LaTeX template: Added `linkcolor`, `urlcolor` and `links-as-notes`- variables. Make TOC links black.-- * LaTeX template improvements.-- + Don't print date unless one is given explicitly in the document.- + Simplified templates.- + Use fontenc [T1] by default, and lmodern.- + Use microtype if available.-- * Biblio:-- + Add comma to beginning of bare suffix, e.g. `@item1 [50]`.- Motivation: `@item1 [50]` should be as close as possible to- `[@item1, 50]`.- + Added workaround for a bug in citeproc-hs 0.3.4 that causes footnotes- beginning with a citation to be empty. Closes #531.-- * Fixed documentation on mixed lists. Closes #533.--pandoc (1.9.4)-- * Simplified `Text.Pandoc.Biblio` and fixed bugs with citations inside- footnotes and captions. We now handle note citations by inserting- footnotes during initial citation processing, and doing a separate- pass later to remove notes inside notes.-- * Added 'zenburn' highlight style from highlighting-kate.-- * Added Slideous writer. Slideous is an HTML + javascript slide show- format, similar to Slidy, but works with IE 7. (Jonas Smedegaard)-- * LaTeX writer:-- + Ensure we don't have extra blank lines at ends of cells.- This can cause LaTeX errors, as they are interpreted as new paragraphs.- + More consistent interblock spacing.- + Require highlighting-kate >= 0.5.1, for proper highlighted inline- code in LaTeX. Closes #527.- + Ensure that a Verbatim at the end of a footnote is followed by- a newline. (Fixes a regression in the previous version.)- + In default template, use black for internal links and TOC.- Added commented-out code to use footnotes for links, as would- be suitable in print output.-- * Beamer writer: When `--incremental` is used, lists inside- a block quote should appear all at once. (This makes Beamer- output consistent with the HTML slide show formats.)-- * ConTeXt writer:-- + Escape `%` as `\letterpercent{}` not `\letterpercent `,- to avoid gobbling spaces after the `%` sign.- + Ensure space after `\stopformula`.-- * Markdown writer:-- + Use `:` form instead of `~` in definition lists, for better- compatibility with other markdown implementations.- + Don't wrap the term, because it breaks definition lists.- + Use a nonzero space to prevent false recognition- of list marker in ordered lists. Closes #516.-- * Org writer: Add space before language name. Closes #523.-- * Docx writer: Simplified bullet characters so they work properly- with Word 2007. Closes #520.-- * LaTeX reader: Support `\centerline`.-- * RST reader: handle figures. Closes #522.-- * Textile reader: fix for `<notextile>` and `==`. Closes #517.- (Paul Rivier)--pandoc (1.9.3)-- * Fixed bug in `fromEntities`. The previous version would turn- `hi & low you know;` into `hi &`.-- * HTML reader:-- + Don't skip nonbreaking spaces.- Previously a paragraph containing just ` ` would be rendered- as an empty paragraph. Thanks to Paul Vorbach for pointing out the bug.- + Support `<col>` and `<caption>` in tables. Closes #486.-- * Markdown reader:-- + Don't recognize references inside delimited code blocks.- + Allow list items to begin with lists.-- * Added basic docbook reader (John MacFarlane and Mauro Bieg).-- * LaTeX reader:-- + Handle `\bgroup`, `\egroup`, `\begingroup`, `\endgroup`.- + Control sequences can't be followed by a letter.- This fixes a bug where `\begingroup` was parsed as `\begin`- followed by `group`.- + Parse 'dimension' arguments to unknown commands. e.g. `\parindent0pt`- + Make `\label` and `\ref` sensitive to `--parse-raw`.- If `--parse-raw` is selected, these will be parsed as raw latex- inlines, rather than bracketed text.- + Don't crash on unknown block commands (like `\vspace{10pt}`)- inside `\author`; just skip them. Closes #505.-- * Textile reader:-- + Implemented literal escapes with `==` and `<notextile>`. Closes #473.- + Added support for LaTeX blocks and inlines (Paul Rivier).- + Better conformance to RedCloth inline parsing (Paul Rivier).- + Parse '+text+' as emphasized (should be underlined, but this- is better than leaving literal plus characters in the output.-- * Docx writer: Fixed multi-paragraph list items. Previously they each- got a list marker. Closes #457.-- * LaTeX writer:-- + Added `--no-tex-ligatures` option to avoid replacing- quotation marks and dashes with TeX ligatures.- + Use `fixltx2e` package to provide '\textsubscript'.- + Improve spacing around LaTeX block environments:- quote, verbatim, itemize, description, enumerate.- Closes #502.- + Use blue instead of pink for URL links in latex/pdf output.-- * ConTeXt writer: Fixed escaping of `%`.- In text, `%` needs to be escaped as `\letterpercent`, not `\%`- Inside URLs, `%` needs to be escaped as `\%`- Thanks to jmarca and adityam for the fix. Closes #492.-- * Texinfo writer: Escape special characters in node titles.- This fixes a problem pointed out by Joost Kremers. Pandoc used- to escape an '@' in a chapter title, but not in the corresponding- node title, leading to invalid texinfo.-- * Fixed document encoding in texinfo template.- Resolves Debian Bug #667816.-- * Markdown writer:-- + Don't force delimited code blocks to be flush left.- Fixes bug with delimited code blocks inside lists etc.- + Escape `<` and `$`.-- * LaTeX writer: Use `\hyperref[ident]{text}` for internal links.- Previously we used `\href{\#ident}{text}`, which didn't work on- all systems. Thanks to Dirk Laurie.-- * RST writer: Don't wrap link references. Closes #487.-- * Updated to use latest versions of blaze-html, mtl.---pandoc (1.9.2)-- * LaTeX reader:-- + Made `lstlisting` work as a proper verbatim environment.- + Fixed bug parsing LaTeX tables with one column.-- * LaTeX writer:-- + Use `{}` around `ctable` caption, so that formatting can be used.- + Don't require eurosym package unless document has a €.-- * LaTeX template: Added variables for `geometry`, `romanfont`,- `sansfont`, `mathfont`, `mainfont` so users can more easily- customize fonts.-- * PDF writer:-- + Run latex engine at least two times, to ensure- that PDFs will have hyperlinked bookmarks.- + Added PDF metadata (title,author) in LaTeX standalone + PDF output.-- * Texinfo writer: retain directories in image paths. (Peter Wang)-- * RST writer: Better handling of inline formatting, in accord- with docutils' "inline markup recognition rules" (though we don't- implement the unicode rules fully). Now `hi*there*hi` gets- rendered properly as `hi\ *there*\ hi`, and unnecessary- `\ ` are avoided around `:math:`, `:sub:`, `:sup:`.-- * RST reader:-- + Parse `\ ` as null, not escaped space.- + Allow `` :math:`...` `` even when not followed by blank- or `\`. This does not implement the complex rule docutils follows,- but it should be good enough for most purposes.- + Add support for the rST default-role directive. (Greg Maslov)-- * Text.Pandoc.Parsing: Added `stateRstDefaultRole` field to `ParserState`.- (Greg Maslov)-- * Markdown reader: Properly handle citations nested in other inline- elements.-- * Markdown writer: don't replace empty alt in image with "image".-- * DZSlides: Updated template.html and styles in default template.- Removed bizarre CSS for `q` in dzslides template.-- * Avoid repeated `id` attribute in section and header in HTML slides.-- * README improvements: new instructions on internal links,- removed misleading note on reST math.-- * Build system:-- + Fixed Windows installer so that dzslides works.- + Removed stripansi.sh.- + Added .travis.yml for Travis continuous integration support..- + Fixed upper bound for zlib (Sergei Trofimovich).- + Fixed upper bound for test-framework.- + Updated haddocks for haddock-2.10 (Sergei Trofimovich).--pandoc (1.9.1.2)-- * Added `beamer+lhs` as output format.-- * Don't escape `<` in `<style>` tags with `--self-contained`.- This fixes a bug which prevented highlighting from working- when using `--self-contained`.-- * PDF: run latex engine three times if `--toc` specified.- This fixes page numbers in the table of contents.-- * Docx writer: Added TableNormal style to tables.-- * LaTeX math environment fixes. `aligned` is now used instead of- the nonexistent `aligned*`. `multline` instead of the nonexistent- `multiline`.-- * LaTeX writer: Use `\textasciitilde` for literal `~`.-- * HTML writer: Don't escape contents of EQ tags with --gladtex.- This fixes a regression from 1.8.-- * Use `<q>` tags for Quoted items for HTML5 output.- The quote style can be changed by modifying the template- or including a css file. A default quote style is included.-- * LaTeX reader: Fixed accents (\~{a}, `\c{c}`).- Correctly handle \^{}. Support "minted" as a LaTeX verbatim block.-- * Updated LaTeX template for better language support.- Use `polyglossia` instead of `babel` with xetex.- Set `lang` as documentclass option.- `\setmainlanguage` will use the last of a comma-separated- list of languages. Thanks to François Gannaz.-- * Fixed default LaTeX template so `\euro` and `€` work. The- `eurosym` package is needed if you are using pdflatex.-- * Fixed escaping of period in man writer (thanks to Michael Thompson).-- * Fixed list label positions in beamer.-- * Set `mainlang` variable in context writer.- This parallels behavior of latex writer. `mainlang` is the last- of a comma-separated list of languages in lang.-- * EPUB language metadat: convert e.g. `en_US` from locale to `en-US`.-- * Changed `-V` so that you can specify a key without a value.- Such keys get the value `true`.-- * Fixed permissions on installed man pages - thanks Magnus Therning.-- * Windows installer: require XP or higher. The installer is- now compiled on a Windows 7 machine, which fixes a problem- using citation functions on Windows 7.-- * OSX package: Check for 64-bit Intel CPU before installing.--pandoc (1.9.1.1)-- * Better handling of raw latex environments in markdown. Now-- \begin{equation}- a_1- \end{equation}-- turns into a raw latex block as expected.-- * Improvements to LaTeX reader:-- + Skip options after block commands.- + Correctly handle `{\\}` in braced.- + Added a needed 'try'.- + Citations: add `, ` to suffix if it doesn't start with space or- punctuation. Otherwise we get no space between the year and the- suffix in author-date styles.-- * Added two needed data files for S5. This fixes a problem with- `pandoc -t s5 --self-contained`. Also removed `slides.min.js`,- which was no longer being used.-- * Fixed some minor problems in `reference.docx`:- name on "Date" style, `xCs` instead of `xIs`.-- * Fixed a problem creating docx files using a reference docx- modified using Word. The problem seems to be that Word- modifies `_rels/.rels`, changing the Type of the Relationship to- `docProps/core.xml`. Pandoc now changes this back to the correct- value if it has been altered, fixing the problem.-- * Fixed html5 template so it works properly with highlighting.--pandoc (1.9.1)-- * LaTeX reader:-- + Fixed regression in 1.9; properly handle escaped $ in latex math.- + Put LaTeX verse environments in blockquotes.-- * Markdown reader:-- + Limit nesting of strong/emph. This avoids exponential lookahead- in parasitic cases, like `a**a*a**a*a**a*a**a*a**a*a**a*a**a*a**`.- + Improved attributes syntax (inn code blocks/spans):- (1) Attributes can contain line breaks. (2) Values in key-value- attributes can be surrounded by either double or single quotes, or- left unquoted if they contain no spaces.-- * Don't wrap headers in markdown or RST writers.-- * Added `stateMaxNestingLevel` to `ParserState`.- We set this to 6, so you can still have `Emph` inside `Emph`,- just not indefinitely.-- * More efficient implementation of `nowrap` in `Text.Pandoc.Pretty`.-- * `Text.Pandoc.PDF`: Only run latex twice if `\tableofcontents`- is present.-- * Require highlighting-kate >= 0.5.0.2, texmath >= 0.6.0.2.--pandoc (1.9.0.5)-- * Changed cabal file so that build-depends for the test program- are not required unless the tests flag is used.-- * LaTeX writer: insert `{}` between adjacent hyphens so they don't- form ligatures (dashes) in code spans.--pandoc (1.9.0.4)-- * Raised version bound on test-framework to avoid problems- compiling tests on GHC 7.4.1.-- * LaTeX reader: Use raw LaTeX as fallback inline text for Cites,- so citations don't just disappear unless you process with- citeproc. Ignore `\bibliographystyle`, `\nocite`.-- * Simplified tex2pdf; it will always run latex twice to- resolve table of contents and hyperrefs.--pandoc (1.9.0.3)-- * Require Cabal >= 1.10.- * Tweaked cabal file to meet Cabal 1.10 requirements.--pandoc (1.9.0.2)-- * Allow build with json 0.4 or 0.5. Otherwise we can't build with- ghc 6.12.--pandoc (1.9)-- [new features]-- * Added a Microsoft Word `docx` writer. The writer includes support- for highlighted code and for math (which is converted from TeX to OMML,- Office's native math markup language, using texmath's new OMML module).- A new option `--reference-docx` allows the user to customize the- styles.-- * Added an `asciidoc` writer (<http://www.methods.co.nz/asciidoc/>).-- * Better support for slide shows:-- + Added a `dzslides` writer. DZSlides is a lightweight HTML5/javascript- slide show format due to Paul Rouget (<http://paulrouget.com/dzslides/>).-- + Added a LaTeX `beamer` writer. Beamer is a LaTeX package for creating- slide presentations.-- + New, flexible rules for dividing documents into sections and slides- (see the "Structuring the slide show" in the User's Guide). These- are backward-compatible with the old rules, but they allow slide- shows to be organized into sections and subsections containing- multiple slides.-- + A new `--slide-level` option allows users to override defaults- and select a slide level below the first header level with content.-- * A new `--self-contained` option produces HTML output that does not- depend on an internet connection or the presence of any external- files. Linked images, CSS, and javascript is downloaded (or fetched- locally) and encoded in `data:` URIs. This is useful for making portable- `HTML slide shows. The --offline` option has been deprecated and is now- `treated as a synonym or --self-contained`.-- * Support for PDF output:-- + Removed the old `markdown2pdf`.- + `pandoc` can now create PDFs (assuming you have latex and a set of- appropriate packages installed): just specify an output file with the- `.pdf` extension.- + A new option `--latex-engine` allows you to specify `pdflatex`,- `xelatex`, or `lualatex` as the processor.-- * Highlighting changes:-- + Syntax highlighting is now a standard feature; the `highlighting`- flag is no longer needed when compiling.- + A new `--no-highlight` option allows highlighting to be disabled.- + Highlighting now works in `docx`, `latex`, and `epub`, as well as- `html`, `html5`, `dzslides`, `s5`, and `slidy`.- + A new `--highlight-style` option selects between various highlighting- color themes.-- * Internal links to sections now work in ConTeXt and LaTeX as well as HTML.-- * LaTeX `\include` and `\usepackage` commands are now processed,- provided the files are in the working directory.-- * EPUB improvements:-- + Internal and external links now work in EPUB.- + Raw HTML is allowed.- + New `--epub-embed-font` option.- + Customizable templates for EPUB pages offer more control over- formatting: `epub-page.html`, `epub-coverimage.html`,- `epub-titlepage.html`.-- * `--mathml` now works with DocBook.-- * Added support for math in RST reader and writer. Inline math uses the- `` :math:`...` `` construct. Display math uses-- .. math:: ...-- or if the math is multiline,-- .. math::-- ...-- These constructions are now supported now by `rst2latex.py`.-- * Github syntax for fenced code blocks is supported in pandoc's- markdown. You can now write-- ```ruby- x = 2- ```-- instead of-- ~~~ {.ruby}- x = 2- ~~~~-- * Easier scripting: a new `toJsonFilter` function makes it easier to- write Haskell scripts to manipulate the Pandoc AST.-- [behavior changes]-- * Fixed parsing of consecutive lists in markdown.- Pandoc previously behaved like Markdown.pl for consecutive- lists of different styles. Thus, the following would be parsed- as a single ordered list, rather than an ordered list followed- by an unordered list:-- 1. one- 2. two-- - one- - two-- This change makes pandoc behave more sensibly, parsing this as- two lists. Any change in list type (ordered/unordered) or in- list number style will trigger a new list. Thus, the following- will also be parsed as two lists:-- 1. one- 2. two-- a. one- b. two-- Since we regard this as a bug in Markdown.pl, and not something- anyone would ever rely on, we do not preserve the old behavior- even when `--strict` is selected.-- * Dashes work differently with `--smart`: `---` is always em-dash,- and `--` is always en-dash. Pandoc no longer tries to guess when- `-` should be en-dash. *Note:* This may change how existing documents- look when processed with pandoc. A new option, `--old-dashes`,- is provided for legacy documents.-- * The markdown writer now uses setext headers for levels 1-2.- The old behavior (ATX headers for all levels) can be restored- using the new `--atx-headers` option.-- * Links are now allowed in markdown image captions. They are also- allowed in links, but will appear there as regular text. So,-- [link with [link](/url)](/url)-- will turn into-- <p><a href="/url">link with link</a></p>-- * Improved handling of citations using `citeproc-hs-0.3.4`.- Added `--citation-abbreviations` option.-- * Citation keys can no longer end with a punctuation character.- This means that `@item1.` will be parsed as a citation with key- 'item1', followed by a period, instead of a citation with key- 'item1.', as was the case previously.-- * In HTML output, citations are now put in a span with class `citation`.-- * The markdown reader now recognizes DocBook block and inline tags.- It was always possible to include raw DocBook tags in a markdown- document, but now pandoc will be able to distinguish block from- inline tags and behave accordingly. Thus, for example,-- <sidebar>- hello- </sidebar>-- will not be wrapped in `<para>` tags.-- * The LaTeX parser has been completely rewritten; it is now much more- accurate, robust, and extensible. However, there are two important- changes in how it treats unknown LaTeX. (1) Previously, unknown- environments became BlockQuote elements; now, they are treated- as "transparent", so `\begin{unknown}xyz\end{unknown}` is the- same as `xyz`. (2) Previously, arguments of unknown commands- were passed through with their braces; now the braces are stripped- off.-- * `--smart` is no longer selected automatically with `man` output.-- * The deprecated `--xetex` option has been removed.-- * The `--html5`/`-5` option has been deprecated. Use `-t html5`- instead. `html5` and `html5+lhs` are now separate output formats.-- * Single quotes are no longer escaped in HTML output. They do not- need to be escaped outside of attributes.-- * Pandoc will no longer transform leading newlines in code- blocks to `<br/>` tags.-- * The ODT writer now sizes images appropriately, using the image- size and DPI information embedded in the image.-- * `--standalone` is once again implicitly for a non-text output format- (ODT, EPUB). You can again do `pandoc test.txt -o test.odt`- and get a standalone ODT file.-- * The Docbook writer now uses `<sect1>`, `<sect2>`, etc. instead of- `<section>`.-- * The HTML writer now uses `<del>` for strikeout.-- * In HTML output with `--section-divs`, the classes `section` and- `level[1,2,..6]` are put on the `div` tags so they can be styled.- In HTML 5 output with `--section-divs`, the classes- `level[1,2,...6]` are put on `section` tags.-- * EPUB writer changes:-- + The `lang` variable now sets the language- in the metadata (if it is not set, we default to the locale).- + EPUB: UTF-8 is used rather than decimal entities.-- * Added `titleslide` class to title slide in S5 template.-- * In HTML, EPUB, and docx metadata, the date is normalized into- YYYY-MM-DD format if possible. (This is required for validation.)-- * Attributes in highlighted code blocks are now preserved in HTML.- The container element will have the classes, id, and key-value attributes- you specified in the delimited code block. Previously these were stripped- off.-- * The reference backlink in the HTML writer no longer has a special- `footnoteBacklink` class.-- * The HTML template has been split into `html` and `html5` templates.-- * Author and date are treated more consistently in HTML templates.- Authors are now `<h2>`, date `<h3>`.-- * URLs are hyphenated in the ConTeXt writer (B. Scott Michel).-- * In `Text.Pandoc.Builder`, `+++` has been replaced by `<>`.-- [bug fixes]-- * Better support for combining characters and East Asian wide characters- in markdown and reST.-- * Better handling of single quotes with `--smart`.- Previously `D'oh l'*aide*` would be parsed with left and right single- quotes instead of apostrophes. This kind of error is now fixed.-- * Highlighting: Use `reads` instead of `read` for better error handling.- Fixes crash on `startNum="abc"`.-- * Added blank comment after directives in rst template.-- * Unescape entities in citation `refId`. The `refId`s coming- from citeproc contain XML numeric entities, and these don't match with the- citation keys parsed by pandoc. Solution is to unescape them.-- * HTML reader: Fixed bug parsing tables with both thead and tbody.-- * Markdown reader:-- + Better handling of escapes in link URLs and titles.- + Fixed backslash escapes in reference links.- + Fixed bug in table/hrule parsing, by checking that the top- line of a table is not followed by a blank line. This bug caused- slowdowns on some files with hrules and tables, as pandoc tried to- interpret the hrules as the tops of multiline tables.- + Fixed bug in code block attribute parser. Previously the ID attribute- got lost if it didn't come first. Now attributes can come in any order.-- * RST reader: allow footnotes followed by newline without space characters.-- * LaTeX reader:-- + Ignore empty groups {}, { }.- + LaTeX reader: Handle \@.- + LaTeX reader: Don't crash on commands like `\itemsep`.- + LaTeX reader: Better handling of letter environments.-- * RST writer: Fixed bug involving empty table cells. isSimple was being- calculated in a way that assumed there were no non-empty cells.-- * ConTeXt writer:-- + Made `--toc` work even without `--number-sections`.- + Escape # in link URLs.- + Use buffering for footnotes containing code blocks.- + Changed 'descr' to 'description', fixed alignment.-- * LaTeX writer:-- + Escape euro character.- + Don't escape ~ inside href{...}.- + Escape # in href URLs.- + Improved detection of book classes. We now check the- `documentclass` variable, and if that is not set, we look through- the template itself. Also, we have added the KOMA classes scrreprt- and scrbook. You can now make a book using- `pandoc -V documentclass:book mybook.txt -o mybook.pdf`- + LHS files now set the "listings" variable, so that the definition- of the `code` environment will be included in the template.- + Links are colored blue by default (this can be changed by- modifying `hyperref` settings in the template).- + Added `lang` variable to LaTeX template.-- * HTML writer:-- + Fixed bug in HTML template with html5 and mathml.- + Don't use self-closing img, br, hr tags for HTML5.- + Use `<section>` for footnotes if HTML5.- + Update HTML templates to use Content-Style-Type meta tag.- + Use separate variables for meta-date, meta-author.- This makes footnotes work in author and date fields.- + Use 'vertical-align:middle' in WebTeX math for better alignment.-- * S5/slidy writer: Make footnotes appear on separate slide at end.-- * MIME: Added 'layout-cache' to getMimeType. This ensures that the- META-INF/manifest.xml for ODT files will have everything it needs, so- that ODT files modified by LibreOffice can be used as `--reference-odt`.-- * `Text.Pandoc.Templates`: Return empty string for json template.-- * `Text.Pandoc.Biblio`:-- + Expand citations recursively inside nested inlines.- + Treat `\160` as space when parsing locator and suffix.- This fixes a bug with "p. 33" when `--smart` is used. Previously- the whole "p. 33" would be included in the suffix, with no locator.- + Put whole author-in-text citation in a Cite. Previously just the- date and other info went in the Cite.- + Don't add comma+space to prefix if it ends in punctuation.-- * Updated chicago-author-date.csl. The old version did not work- properly for edited volumes with no author.-- * EPUB writer:-- + Add date to EPUB titlepage and metadata.- + Added TOC identifier in EPUB page template.- + Don't generate superfluous file `cover-image.jpg`.-- [under the hood improvements]-- * Modified `make_osx_package.sh` to use cabal-dev.- Items are no longer installed as root.- Man pages are zipped and given proper permissions.-- * Modified windows installer generater to use cabal-dev.-- * Setup: Making man pages now works with cabal-dev (at least on OSX). In- Setup.hs we now invoke 'runghc' in a way that points it to the correct- package databases, instead of always falling back to the default user- package db.-- * Updated to work with GHC 7.4.1.-- * Removed dependency on old-time.-- * Removed dependency on dlist.-- * New slidy directory for "self-contained."-- * TeXMath writer: Use unicode thin spaces for thin spaces.-- * Markdown citations: don't strip off initial space in locator.-- [API changes]-- * Removed `Apostrophe`, `EmDash`, `EnDash`, and `Ellipses`- from the native `Inline` type in pandoc-types. Now we use `Str`- elements with unicode.-- * Improvements to `Text.Pandoc.Builder`:-- + `Inlines` and `Blocks` are now newtypes (not synonyms for- sequences).- + Instances are defined for `IsString`, `Show`, `Read`, `Monoid`,- and a new `Listable` class, which allows these to be manipulated- to some extent like lists. Monoid append includes automatic- normalization.- + `+++` has been replaced by `<>` (mappend).-- * Use blaze-html instead of xhtml for HTML generation.- This changes the type of `writeHtml`.-- * `Text.Pandoc.Shared`:-- + Added `warn` and `err`.- + Removed `unescapeURI`, modified `escapeURI`.- (See under [behavior changes], above.)-- * Changes in URI escaping: Previously the readers escaped URIs by- converting unicode characters to octets and then percent encoding.- Now unicode characters are left as they are, and `escapeURI` only- percent-encodes space characters. This gives more readable- URIs, and works well with modern user agents. URIs are no longer unescaped- at all on conversion to `markdown`, `asciidoc`, `rst`, `org`.-- * New module `Text.Pandoc.SelfContained`.-- * New module `Text.Pandoc.Docx`.-- * New module `Text.Pandoc.PDF`.-- * Added `writerBeamer` to `WriterOptions`.-- * Added `normalizeDate` to `Text.Pandoc.Shared`.-- * Added `splitStringWithIndices` in `Text.Pandoc.Shared`.- This is like `splitWithIndices`, but it is sensitive to distinctions- between wide, combining, and regular characters.-- * `Text.Pandoc.Pretty`:-- + Added `chomp` combinator.- + Added `beforeNonBreak` combinator. This allows you to include- something conditionally on it being before a nonblank.- Used for RST inline math.- + Added `charWidth` function. All characters marked W or F in the unicode- spec EastAsianWidth.txt get width 2.- + Added `realLength`, based on `charWidth`. `realLength` is now- used in calculating offsets.-- * New module `Text.Pandoc.Slides`, for common functions for breaking- a document into slides.-- * Removed `Text.Pandoc.S5`, which is no longer needed.-- * Removed `Text.Pandoc.CharacterReferences`. Moved- `characterReference` to `Text.Pandoc.Parsing`.- `decodeCharacterReferences` is replaced by `fromEntities`- in `Text.Pandoc.XML`.-- * Added `Text.Pandoc.ImageSize`. This is intened for use- in `docx` and `odt` writers, so the size and dpi of images- can be calculated.-- * Removed `writerAscii` in `WriterOptions`.-- * Added `writerHighlight` to `WriterOptions`.-- * Added `DZSlides` to `HTMLSlideVariant`.-- * `writeEPUB` has a new argument for font files to embed.-- * Added `stateLastStrPos` to `ParserState`. This lets us keep track- of whether we're parsing the position immediately after a regular- (non-space, non-symbol) string, which is useful for distinguishing- apostrophes from single quote starts.-- * `Text.Pandoc.Parsing`:-- + `escaped` now returns a `Char`.- + Removed `charsInBalanced'`, added a character parser as- a parameter of `charsInBalanced`. This is needed for- proper handling of escapes, etc.- + Added `withRaw`.-- * Added `toEntities` to `Text.Pandoc.XML`.-- * `Text.Pandoc.Readers.LaTeX`:-- + Export `handleIncludes`.- + Export `rawLaTeXBlock` instead of `rawLaTeXEnvironment'`.-- * Added `ToJsonFilter` class and `toJsonFilter` function to- `Text.Pandoc`, deprecating the old `jsonFilter` function.-- * `Text.Pandoc.Highlighting`:-- + Removed `highlightHtml`, `defaultHighlightingCss`.- + Export `formatLaTeXInline`, `formatLaTeXBlock`, and `highlight`, plus- key functions from highlighting-kate.- + Changed types of highlighting function. `highlight` returns a- `Maybe`, not an `Either`.--pandoc (1.8.2.1)-- * Relaxed cabal consntraints for test-framework (S. Trofimovich).-- * Relaxed cabal constraints for pandoc-types.-- * Adjusted Arbitrary instance to help avoid timeouts in tests.-- * Added `Tests.Writers.Markdown` to cabal file.--pandoc (1.8.2)-- * Added script to produce OS X package.-- * Made `templates` directory a git submodule. This should make it- easier for people to revise their custom templates when the default- templates change.-- * Changed template naming scheme: `FORMAT.template` -> `default.FORMAT`.- **Note:** If you have existing templates in `~/.pandoc/templates`, you- must rename them to conform to the new scheme!-- * Fixed smart quotes bug, now handling `'...hi'` properly.-- * RST reader:-- + Partial support for labeled footnotes.- + Improved accuracy of `simpleReferenceName` parser.-- * HTML reader:-- + Substitute correct unicode characters for- characters in the 128..159 range, which are often found even in- HTML that purports to be UTF-8.-- * LaTeX reader: Handle `\subtitle` command (a subtitle is added- to the title, after a colon and linebreak). Closes #280.-- * Leaner `reference.odt`.-- * Added unexported module `Text.Pandoc.MIME` for use in- the ODT writer.-- * ODT writer: Construct `manifest.xml` based on archive contents.- This fixes a bug in ODTs containing images. Recent versions of- LibreOffice would reject these as corrupt, because `manifest.xml`- did not contain a reference to the image files.-- * LaTeX writer:-- + Make verbatim environments flush to avoid spurious- blank lines. Closes #277.- + Use `\texttt` and escapes insntead of `\verb!...!`, which- is too fragile (doesn't work in command arguments).- + Use `\enquote{}` for quotes if the template includes- the `csquotes` package. This provides better support for- local quoting styles. (Thanks to Andreas Wagner for the idea.)-- * ConTeXt writer: Make `\starttyping`/`\stoptyping` flush with- margin, preventing spurious blank lines.-- * Slidy writer:-- + Use non-minimized version of `slidy.css` with `--offline`- option, so users can more easily edit it.- + Also fixed a bug in the CSS that prevented proper centering- of title (now reported and fixed upstream).-- * S5 writer:-- + Replaced `s5/default/slides.js.{comment,packed}` with- new compressed `s5/default/slides.min.js`.- + Use `data:` protocol to embed S5 CSS in `<link>` tags,- when `--offline` is specified. Using inline CSS didn't- work with Chrome or Safari. This fixes offline- S5 on those browsers.-- * HTML writer: Removed English title on footnote backlinks.- This is incongrous in non-English documents.-- * Docbook writer:-- + Use CALS tables. (Some older docbook software does not work- well with XHTML tables.) Closes #77.- + Use `programlisting` tags (instead of `screen`) for code blocks.-- * `markdown2pdf`:-- + Calls latex with `-halt-on-error -interaction nonstopmode` instead- of `-interaction=batchmode`, which essentially just ignored errors,- leading to bad results. Better to know when something is wrong.- + Fixed issues with non-UTF-8 output of `pdflatex`.- + Better error reporting.-- * `--mathjax` now takes an optional URL argument. If it is not- provided, pandoc links directly to the (secure) mathjax CDN,- as now recommended (thanks to dsanson).-- * Deprecated `--xetex` option in `pandoc`. It is no longer needed,- since the LaTeX writer now produces a file that can be processed by- `latex`, `pdflatex`, `lualatex`, or `xelatex`.-- * Introduced `--luatex` option to `markdown2pdf`. This causes `lualatex`- to be used to create the PDF.-- * If a template specified with `--template` is not found, look for it- in `datadir`. Also, if no extension is provided, supply one based- on the writer. So now you can put your `special.latex` template in- `~/.pandoc/templates`, and use it from any directory via- `pandoc -t latex --template special`.-- * Default template improvements:-- + HTML: Display author and date after title.- + HTML: Made table of contents more customizable. The container- for the TOC is now in the template, so users can insert a header- or other styling. (Thanks to Bruce D'Arcus for the suggestion.)- + HTML, Slidy, S5: Enclose scripts in CDATA tags.- + Slidy, S5: Added `s5-url` and `slidy-url` variables, instead of- hard-coding. If you want to put your slidy files in the slidy- subdirectory, for example, you can do- `pandoc -t slidy -V slidy-url=slidy -s`.- + LaTeX: Use `\and` to separate authors in LaTeX documents (reader- & writer). Closes #279.- + LaTeX: Use different `hyperref` options for `xetex`, fixing- problems with unicode bookmarks (thanks to CircleCode).- + LaTeX: Removed `ucs` package, use `utf8` rather than `utf8x`- with `inputenc`. This covers fewer characters but is more- robust with other packages, and `ucs` is unmaintained. Users- who need better unicode support should use xelatex or lualatex.--pandoc (1.8.1.2)-- * Added `--epub-cover-image` option.-- * Documented `--biblatex` and `--natbib` options.-- * Allow `--section-divs` with slidy output. Resolves Issue #296.-- * Disallow notes within notes in reST and markdown.- These previously caused infinite looping and stack overflows.- For example:-- [^1]-- [^1]: See [^1]-- Note references are allowed in reST notes, so this isn't a full- implementation of reST. That can come later. For now we need to- prevent the stack overflows. Partially resolves Issue #297.-- * EPUB writer: Allow non-plain math methods.-- * Forbid ()s in citation item keys. Resolves Issue #304: problems with- `(@item1; @item2)` because the final paren was being parsed as part of- the item key.-- * Changed URI parser so it doesn't include trailing punctuation.- So, in RST, `http://google.com.` should be parsed as a link followed by a- period. The parser is smart enough to recognize balanced parentheses, as- often occur in wikipedia links: `http://foo.bar/baz_(bam)`.-- * Markdown+lhs reader: Require space after inverse bird tracks, so that- HTML tags can be used freely at the left margin of a markdown+lhs document.- Thanks to Conal Elliot for the suggestion.-- * Markdown reader:-- + Improved emph/strong parsing; fixes bug found by Perry Wagle.- + Fixed bug in footnote order (reported by CircleCode).-- * RST reader:- + Fixed bug in in field lists with multi-line items at the- end of the list.- + Added parentheses to RST `specialChars`, so- `(http://google.com)` will be parsed as a link in parens.- Resolves Issue #291.- + Allow `|` followed by newline in RST line block.-- * LaTeX reader:- + Support `\dots`.- + Gobble option & space after linebreak `\\[10pt]`.-- * Textile reader:- + Make it possible to have colons after links. (qerub)- + Make it possible to have colons after links. (Christoffer Sawicki)-- * HTML reader:- + Skip spaces after `<b>`, `<emph>`, etc.- + Handle tbody, thead in simple tables. Closes #274.- + Implicit `Para`s instead of `Plains` in some contexts.-- * OpenDocument writer: Use special `First paragraph` style for- first paragraph after most non-paragraph blocks. This allows users to- specify e.g. that only paragraphs after the first paragraph of a block are- to be indented. Thanks to Andrea Rossato for the patch. Closes #20.-- * LaTeX writer: use `deVerb` on table and picture captions.- Otherwise LaTeX complains about `\verb` inside command argument.- Thanks to bbanier for reporting the bug.-- * Markdown writer: Insert HTML comment btw list and indented code block.- This prevents the code block from being interpreted as part of the list.-- * EPUB writer: Add a meta element specify the cover.- Some EPUB e-readers, such as the Nook, require a meta element inside the- OPF metadata block to ensure the cover image is properly displayed.- (Kelsey Hightower)-- * HTML writer: Use embed tag for images with non-image extensions.- (e.g. PDFs). Closes #264.-- * LaTeX writer: Improved tables.-- + More space between lines, top-align cells.- + Use ctable package, which allows footnotes and- provides additional options.- + Made cell alignments work in multiline tables.- + Closes #271, #272.-- * Un-URI-escape image filenames in LaTeX, ConTeXt, RTF, Texinfo.- Also do this when copying image files into EPUBs and ODTs.- Closes #263.-- * Changed to github issue tracker.-- * Added failing emph/strong markdown test case due to Perry Wagle.-- * Slidy improvements:- + Updated to use Slidy2.- + Fixed bug, unclosed div tag.- + Added `duration` variable in template.- Setting this activates the timer.- + Use 'titlepage' instead of 'cover' for title div.--pandoc (1.8.1.1)-- * `markdown2pdf`: Removed some debugging lines accidentally included- in the 1.8.1 release. With those lines, the temp directory is created- in the working directory, and it is not deleted. This fix restores- the original behavior.--pandoc (1.8.1)-- * Added `--ascii` option. Currently supported only in HTML writer,- which it causes to use numerical entities instead of UTF-8.-- * EPUB writer: `--toc` now works to provide a table of contents- at the beginning of each chapter.-- * LaTeX writer: Change figure defaults to `htbp`.- This prevents "too many unprocessed floats." Resolves- Issue #285.-- * `Text.Pandoc.UTF8`: Encode filenames even when using recent- base.-- * `markdown2pdf`: Fixed filename encoding issues. With help from Paulo- Tanimoto. Resolves Issue #286.-- * HTML writer: Put line breaks in section divs.-- * `Text.Pandoc.Shared`: Make `writerSectionDivs` default to False.--pandoc (1.8.0.3)-- * Fixed Source-repository stanza in cabal file.--pandoc (1.8.0.2)-- * HTML writer:-- + Stringify alt text instead of converting to HTML.- + Break lines after block elements, not inside tags.- HTML output now closely resembles that of tidy. Resolves Issue #134.-- * Markdown reader: Fixed bug in footnote block parser (pointed out- by Jesse Rosenthal). The problem arose when the blank line- at the end of a footnote block contained indenting spaces.-- * Shared: Improved 'normalize' function so it normalizes Spaces too.- In normal form, Space elements only occur to separate two non-Space- elements. So, we never have [Space], or [, ..., Space].-- * Tests:-- + Improved Arbitrary instance.- + Added timeout for test instances.-- * README:-- + Added section on four-space rule for lists. Resolves Issue #283.- + Clarified optional arguments on math options.-- * markdown2pdf: Fixed bug with output file extensions.- Previously `markdown2pdf test.txt -o test.en.pdf` would produce- `test.pdf`, not `test.en.pdf`. Thanks to Paolo Tanimoto for the fix.--pandoc (1.8.0.1)-- * Revised Interact.hs so that it works with the CPP macros- in the UTF8 module.-- * Revised Setup.hs so that we don't call MakeManPage.hs unless- the man pages are out of date.--pandoc (1.8)-- [new features]-- * Support for citations using Andrea Rossato's `citeproc-hs` 0.3.- You can now write, for example,-- Water is wet [see @doe99, pp. 33-35; also @smith04, ch. 1].-- and, when you process your document using `pandoc`, specifying- a citation style using `--csl` and a bibliography using `--bibliography`,- the citation will be replaced by an appropriately formatted- citation, and a list of works cited will be added to the end- of the document.-- This means that you can switch effortlessly between different citation- and bibliography styles, including footnote, numerical, and author-date- formats. The bibliography can be in any of the following formats: MODS,- BibTeX, BibLaTeX, RIS, EndNote, EndNote XML, ISI, MEDLINE, Copac, or JSON.- See the README for further details.-- Citations are supported in the markdown reader, using a special- syntax, and in the LaTeX reader, using natbib or biblatex syntax.- (Thanks to Nathan Gass for the natbib and biblatex support.)-- * New `textile` reader and writer. Thanks to Paul Rivier for contributing- the `textile` reader, an almost complete implementation of the textile- syntax used by the ruby [RedCloth library](http://redcloth.org/textile).- Resolves Issue #51.-- * New `org` writer, for Emacs Org-mode, contributed by Puneeth Chaganti.-- * New `json` reader and writer, for reading and writing a JSON- representation of the native Pandoc AST. These are much faster- than the `native` reader and writer, and should be used for- serializing Pandoc to text. To convert between the JSON representation- and native Pandoc, use `encodeJSON` and `decodeJSON` from- `Text.JSON.Generic`.-- * A new `jsonFilter` function in `Text.Pandoc` makes it easy- to write scripts that transform a JSON-encoded pandoc document.- For example:-- -- removelinks.hs - removes links from document- import Text.Pandoc- main = interact $ jsonFilter $ bottomUp removeLink- where removeLink (Link xs _) = Emph xs- removeLink x = x-- To use this to remove links while translating markdown to LaTeX:-- pandoc -t json | runghc removelinks.hs | pandoc -f json -t latex-- * Attributes are now allowed in inline `Code` elements, for example:-- In this code, `ulist ! [theclass "special"] << elts`{.haskell} is...-- The attribute syntax is the same as for delimited code blocks.- `Code` inline has an extra argument place for attributes, just like- `CodeBlock`. Inline code will be highlighted in HTML output, if pandoc- is compiled with highlighting support. Resolves Issue #119.-- * New `RawBlock` and `RawInline` elements (replacing `RawHtml`,- `HtmlInline`, and `TeX`) provide lots of flexibility in writing- scripts to transform Pandoc documents. Scripts can now change- how each element is rendered in each output format.-- * You can now define LaTeX macros in markdown documents, and pandoc- will apply them to TeX math. For example,-- \newcommand{\plus}[2]{#1 + #2}- $\plus{3}{4}$-- yields `3+4`. Since the macros are applied in the reader, they- will work in every output format, not just LaTeX.-- * LaTeX macros can also be used in LaTeX documents (both in math- and in non-math contexts).-- * A new `--mathjax` option has been added for displaying- math in HTML using MathJax. Resolves issue #259.-- * Footnotes are now supported in the RST reader. (Note, however,- that unlike docutils, pandoc ignores the numeral or symbol used in- the note; footnotes are put in an auto-numbered ordered list.)- Resolves Issue #258.-- * A new `--normalize` option causes pandoc to normalize the AST- before writing the document. This means that, for example,- `*hi**there*` will be rendered as `<em>hithere</em>`- instead of `<em>hi</em><em>there</em>`. This is not the default,- because there is a significant performance penalty.-- * A new `--chapters` command-line option causes headers- in DocBook, LaTeX, and ConTeXt to start with "chapter" (level one).- Resolves Issue #265.-- * In DocBook output, `<chapter>` is now used for top-level- headers if the template contains `<book>`. Resolves Issue #265.-- * A new `--listings` option in `pandoc` and `markdown2pdf` causes- the LaTeX writer to use the listings package for code blocks.- (Thanks to Josef Svennigsson for the pandoc patch, and Etienne- Millon for the markdown2pdf patch.)-- * `markdown2pdf` now supports `--data-dir`.-- * URLs in autolinks now have class "url" so they can be styled.-- * Improved prettyprinting in most formats. Lines will be wrapped- more evenly and duplicate blank lines avoided.-- * New `--columns` command-line option sets the column width for- line wrapping and relative width calculations for tables.-- * Made `--smart` work in HTML, RST, and Textile readers, as well- as markdown.-- * Added `--html5` option for HTML5 output.-- * Added support for listings package in LaTeX reader- (Puneeth Chaganti).-- * Added support for simple tables in the LaTeX reader.-- * Added support for simple tables in the HTML reader.-- * Significant performance improvements in many readers and writers.-- [API and program changes]-- * Moved `Text.Pandoc.Definition` from the `pandoc` package to a new- auxiliary package, `pandoc-types`. This will make it possible for other- programs to supply output in Pandoc format, without depending on the whole- pandoc package.-- * Added `Attr` field to `Code`.-- * Removed `RawHtml`, `HtmlInline`, and `TeX` elements; added generic- `RawBlock` and `RawInline`.-- * Moved generic functions to `Text.Pandoc.Generic`. Deprecated- `processWith`, replacing it with two functions, `bottomUp` and `topDown`.- Removed previously deprecated functions `processPandoc` and `queryPandoc`.-- * Added `Text.Pandoc.Builder`, for building `Pandoc` structures.-- * `Text.Pandoc` now exports association lists `readers` and `writers`.-- * Added `Text.Pandoc.Readers.Native`, which exports `readNative`.- `readNative` can now read full pandoc documents, block lists, blocks,- inline lists, or inlines. It will interpret `Str "hi"`- as if it were `Pandoc (Meta [] [] []) [Plain [Str "hi"]]`.- This should make testing easier.-- * Removed deprecated `-C/--custom-header` option.- Use `--template` instead.-- * `--biblio-file` has been replaced by `--bibliography`.- `--biblio-format` has been removed; pandoc now guesses the format- from the file extension (see README).-- * pandoc will treat an argument as a URI only if it has an- `http(s)` scheme. Previously pandoc would treat some- Windows pathnames beginning with `C:/` as URIs.-- * The `--sanitize-html` option and the `stateSanitize` field in- `ParserState` have been removed. Sanitization is better done in the- resulting HTML using `xss-sanitize`, which is based on pandoc's- sanitization, but improved.-- * pandoc now adds a newline to the end of its output in fragment- mode (= not `--standalone`).-- * Added support for `lang` in `html` tag in the HTML template,- so you can do `pandoc -s -V lang=es`, for example.-- * `highlightHtml` in `Text.Pandoc.Highlighting` now takes- a boolean argument that selects between "inline" and- "block" HTML.-- * `Text.Pandoc.Writers.RTF` now exports `rtfEmbedImage`.- Images are embedded in RTF output when possible (png, jpeg).- Resolves Issue #275.-- * Added `Text.Pandoc.Pretty`. This is better suited for pandoc than the- `pretty` package. Changed all writers that used- `Text.PrettyPrint.HughesPJ` to use `Text.Pandoc.Pretty` instead.-- * Rewrote `writeNative` using the new prettyprinting module. It is- now much faster. The output has been made more consistent and compressed.- `writeNative` is also now sensitive to writerStandalone`, and will simply- `print a block list if writerStandalone` is False.-- * Removed `Text.Pandoc.Blocks`. `Text.Pandoc.Pretty` allows you to define- blocks and concatenate them, so a separate module is no longer needed.-- * `Text.Pandoc.Shared`:-- + Added `writerColumns`, `writerChapters`, and `writerHtml5` to- `WriterOptions`.- + Added `normalize`.- + Removed unneeded prettyprinting functions:- `wrapped`, `wrapIfNeeded`, `wrappedTeX`, `wrapTeXIfNeeded`, `hang'`,- `BlockWrapper`, `wrappedBlocksToDoc`.- + Made `splitBy` take a test instead of an element.- + Added `findDataFile`, refactored `readDataFile`.- + Added `stringify`. Rewrote `inlineListToIdentifier` using `stringify`.- + Fixed `inlineListToIdentifier` to treat '\160' as ' '.-- * `Text.Pandoc.Readers.HTML`:-- + Removed `rawHtmlBlock`, `anyHtmlBlockTag`, `anyHtmlInlineTag`,- `anyHtmlTag`, `anyHtmlEndTag`, `htmlEndTag`, `extractTagType`,- `htmlBlockElement`, `htmlComment`- + Added `htmlTag`, `htmlInBalanced`, `isInlineTag`, `isBlockTag`,- `isTextTag`-- * Moved `smartPunctuation` from `Text.Pandoc.Readers.Markdown`- to `Text.Pandoc.Readers.Parsing`, and parameterized it with- an inline parser.-- * Added `nonspaceChar` to `Text.Pandoc.Parsing`.-- * Ellipses are no longer allowed to contain spaces.- Previously we allowed '. . .', ' . . . ', etc. This caused- too many complications, and removed author's flexibility in- combining ellipses with spaces and periods.-- * Allow linebreaks in URLs (treat as spaces). Also, a string of- consecutive spaces or tabs is now parsed as a single space. If you have- multiple spaces in your URL, use `%20%20`.-- * `Text.Pandoc.Parsing`:-- + Removed `refsMatch`.- + Hid `Key` constructor.- + Removed custom `Ord` and `Eq` instances for `Key`.- + Added `toKey` and `fromKey` to convert between `Key` and `[Inline]`.- + Generalized type on `readWith`.-- * Small change in calculation of relative widths of table columns.- If the size of the header > the specified column width, use- the header size as 100% for purposes of calculating- relative widths of columns.-- * Markdown writer now uses some pandoc-specific features when `--strict`- is not specified: `\` newline is used for a hard linebreak instead of- two spaces then a newline. And delimited code blocks are used when- there are attributes.-- * HTML writer: improved gladTeX output by setting ENV appropriately- for display or inline math (Jonathan Daugherty).-- * LaTeX writer: Use `\paragraph`, `\subparagraph` for level 4,5 headers.-- * LaTeX reader:-- + `\label{foo}` and `\ref{foo}` now become `{foo}` instead of `(foo)`.- + `\index{}` commands are skipped.-- * Added `fontsize` variable to default LaTeX template.- This makes it easy to set the font size using `markdown2pdf`:- `markdown2pdf -V fontsize=12pt input.txt`.-- * Fixed problem with strikeout in LaTeX headers when using- hyperref, by adding a command to the default LaTeX template- that disables `\sout` inside pdf strings. Thanks to Joost Kremers- for the fix.-- * The `COLUMNS` environment variable no longer has any effect.-- [under-the-hood improvements]-- * Pandoc now compiles with GHC 7. (This alone leads to a- significant performance improvement, 15-20%.)-- * Completely rewrote HTML reader using tagsoup as a lexer. The- new reader is faster and more accurate. Unlike the- old reader, it does not get bogged down on some input- (Issues #277, 255). And it handles namespaces in tags- (Issue #274).-- * Replaced `escapeStringAsXML` with a faster version.-- * Rewrote `spaceChar` and some other parsers in Text.Pandoc.Parsing- for a significant performance boost.-- * Improved performance of all readers by rewriting parsers.-- * Simplified Text.Pandoc.CharacterReferences by using- entity lookup functions from TagSoup.-- * `Text.Pandoc.UTF8` now uses the unicode-aware IO functions- from `System.IO` if base >= 4.2. This gives support for- windows line endings on windows.-- * Remove duplications in documentation by generating the- pandoc man page from README, using `MakeManPage.hs`.-- * README now includes a full description of markdown syntax,- including non-pandoc-specific parts. A new `pandoc_markdown`- man page is extracted from this, so you can look up markdown- syntax by doing `man pandoc_markdown`.-- * Completely revised test framework (with help from Nathan Gass).- The new test framework is built when the `tests` Cabal flag is set. It- includes the old integration tests, but also some new unit and quickcheck- tests. Test output has been much improved, and you can now specify a glob- pattern after `cabal test` to indicate which tests should be run;- for example `cabal test citations` will run all the citation tests.-- * Added a shell script, `stripansi.sh`, for filtering ANSI control- sequences from test output: `cabal test | ./stripansi.sh > test.log`.-- * Added `Interact.hs` to make it easier to use ghci while developing.- `Interact.hs` loads `ghci` from the `src` directory, specifying- all the options needed to load pandoc modules (including- specific package dependencies, which it gets by parsing- dist/setup-config).-- * Added `Benchmark.hs`, testing all readers + writers using criterion.-- * Added `stats.sh`, to make it easier to collect and archive- benchmark and lines-of-code stats.-- * Added upper bounds to all cabal dependencies.-- * Include man pages in extra-source-files. This allows users to- install pandoc from the tarball without needing to build the man- pages.-- [bug fixes]-- * Filenames are encoded as UTF8. Resolves Issue #252.-- * Handle curly quotes better in `--smart` mode. Previously, curly quotes- were just parsed literally, leading to problems in some output formats.- Now they are parsed as `Quoted` inlines, if `--smart` is specified.- Resolves Issue #270.-- * Text.Pandoc.Parsing: Fixed bug in grid table parser.- Spaces at end of line were not being stripped properly,- resulting in unintended LineBreaks.-- * Markdown reader:-- + Allow HTML comments as inline elements in markdown.- So, `aaa <!-- comment --> bbb` can be a single paragraph.- + Fixed superscripts with links: `^[link](/foo)^` gets- recognized as a superscripted link, not an inline note followed by- garbage.- + Fixed regression, making markdown reference keys case-insensitive again.- Resolves Issue #272.- + Properly handle abbreviations (like `Mr.`) at the end of a line.- + Better handling of intraword underscores, avoiding exponential- slowdowns in some cases. Resolves Issue #182.- + Fixed bug in alignments in tables with blank rows in the header.-- * RST reader:-- + Field lists now allow spaces in field names, and- block content in field values. (Thanks to Lachlan Musicman- for pointing out the bug.)- + Definition list items are now always `Para` instead of- `Plain`, matching behavior of `rst2xml.py`.- + In image blocks, the description is parsed properly and- used for the alt attribute, not also the title.- + Skip blank lines at beginning of file. Resolves- Debian #611328.-- * LaTeX reader:-- + Improved parsing of preamble.- Previously you'd get unexpected behavior on a document that- contained `\begin{document}` in, say, a verbatim block.- + Allow spaces between `\begin` or `\end` and `{`.- + Support `\L` and `\l`.- + Skip comments inside paragraphs.-- * LaTeX writer:-- + Escape strings in `\href{..}`.- + In nonsimple tables, put cells in `\parbox`.-- * OpenDocument writer: don't print raw TeX.-- * Markdown writer:-- + Fixed bug in `Image`. URI was getting unescaped twice!- + Avoid printing extra blank lines at the end if there are- no notes or references.-- * LaTeX and ConTeXt: Escape `[` and `]` as `{[}` and `{]}`.- This avoids unwanted interpretation as an optional argument.-- * ConTeXt writer: Fixed problem with inline code. Previously- `}` would be rendered `\type{}}`. Now we check the string for '}' and '{'.- If it contains neither, use `\type{}`; otherwise use `\mono{}`- with an escaped version of the string.-- * `:` now allowed in HTML tags. Resolves Issue #274.--pandoc (1.6)-- [ John MacFarlane ]-- * New EPUB and HTML Slidy writers. (Issue #122)-- - EPUB is a standard ebook format, used in Apple's iBooks for- the iPad and iPhone, Barnes and Noble's nook reader, the Sony- reader, and many other devices.- - Slidy, like S5, is a system for producing HTML+javascript slide- shows.-- * All input is assumed to be UTF-8, no matter what the locale and ghc- version, and all output is UTF-8. This reverts to pre-1.5 behavior.- Also, a BOM, if present, is stripped from the input.-- * Markdown now supports grid tables, whose cells can contain- arbitrary block elements. (Issue #43)-- * Sequentially numbered example lists in markdown with `@` marker.-- * Markdown table captions can begin with a bare colon and no longer need- to include the English word "table." Also, a caption can now occur- either before or after the table. (Issue #227)-- * New command-line options:-- - `--epub-stylesheet` allows you to specify a CSS file that will- be used to style your ebook.- - `--epub-metadata` allows you to specify metadata for the ebook.- - `--offline` causes the generated HTML slideshow to include all- needed scripts and stylesheets.- - `--webtex` causes TeX math to be converted to images using the- Google Charts API (unless a different URL is specified).- - `--section-divs` causes div tags to be added around each section- in an HTML document. (Issue #230, 239)-- * Default behavior of S5 writer in standalone mode has changed:- previously, it would include all needed scripts and stylesheets- in the generated HTML; now, only links are included unless- the `--offline` option is used.-- * Default behavior of HTML writer has changed. Between 1.2 and 1.5,- pandoc would enclose sections in div tags with identifiers on the- div tags, so that the sections can be manipulated in javascript.- This caused undesirable interactions with raw HTML div tags. So,- starting with 1.6, the default is to put the identifiers directly- on the header tags, and not to include the divs. The `--section-divs`- option selects the 1.2-1.5 behavior.-- * API changes:-- - `HTMLMathMethod`: Added `WebTeX`, removed `MimeTeX`.- - `WriterOptions`: Added `writerUserDataDir`, `writerSourceDirectory`,- `writerEPUBMetadata` fields. Removed `writerIncludeBefore`,- `writerIncludeAfter`.- - Added `headerShift` to `Text.Pandoc.Shared`.- - Moved parsing code and `ParserState` from `Text.Pandoc.Shared`- to a new module, `Text.Pandoc.Parsing`.- - Added `stateHasChapters` to `ParserState`.- - Added `HTMLSlideVariant`.- - Made `KeyTable` a map instead of an association list.- - Added accessors for `Meta` fields (`docTitle`, `docAuthors`,- `docDate`).- - `Pandoc`, `Meta`, `Inline`, and `Block` have been given `Ord`- instances.- - Reference keys now have a type of their own (`Key`), with its- own `Ord` instance for case-insensitive comparison.- - Added `Text.Pandoc.Writers.EPUB`.- - Added `Text.Pandoc.UUID`.- - Removed `Text.Pandoc.ODT`, added `Text.Pandoc.Writers.ODT`.- Removed `saveOpenDocumentAsODT`, added `writeODT`.- - Added `Text.Pandoc.Writers.Native` and `writeNative`.- Removed `prettyPandoc`.- - Added `Text.Pandoc.UTF8` for portable UTF8 string IO.- - Removed `Text.Pandoc.Writers.S5` and the `writeS5` function.- Moved `s5Includes` to a new module, `Text.Pandoc.S5`.- To write S5, you now use `writeHtml` with `writerSlideVariant`- set to `S5Slides` or `SlidySlides`.-- * Template changes. If you use custom templates, please update them,- particularly if you use syntax highlighting with pandoc. The old HTML- templates hardcoded highlighting CSS that will no longer work with- the most recent version of highlighting-kate.-- - HTML template: avoid empty meta tag if no date.- - HTML template: Use default highlighting CSS from highlighting-kate- instead of hard-coding the CSS into the template.- - HTML template: insert-before text goes before the title, and- immediately after the <body> tag, as documented. (Issue #241)- - Added slidy and s5 templates.- - Added amssymb to preamble of latex template. (github Issue 1)-- * Removed excess newlines at the end of output. Note: because output- will not contain an extra newline, you may need to make adjustments- if you are inserting pandoc's output into a template.-- * In S5 and slidy, horizontal rules now cause a new slide, so you- are no longer limited to one slide per section.-- * Improved handling of code in man writer. Inline code is now monospace,- not bold, and code blocks now use .nf (no fill) and .IP (indented para).-- * HTML reader parses `<tt>` as Code. (Issue #247)-- * html+lhs output now contains bird tracks, even when compiled without- highlighting support. (Issue #242)-- * Colons are now no longer allowed in autogenerated XML/HTML identifiers,- since they have a special meaning in XML.-- * Code improvements in ODT writer. Remote images are now replaced with- their alt text rather than a broken link.-- * LaTeX reader improvements:-- - Made latex `\section`, `\chapter` parsers more forgiving of- whitespace.- - Parse `\chapter{}` in latex.- - Changed `rawLaTeXInline` to accept `\section`, `\begin`, etc.- - Use new `rawLaTeXInline'` in LaTeX reader, and export `rawLaTeXInline`- for use in markdown reader.- - Fixes bug wherein `\section{foo}` was not recognized as raw TeX- in markdown document.-- * LaTeX writer: images are automatically shrunk if they would extend- beyond the page margin.-- * Plain, markdown, RST writers now use unicode for smart punctuation.-- * Man writer converts math to unicode when possible, as in other writers.-- * `markdown2pdf` can now recognize citeproc options.-- * Command-line arguments are converted to UTF-8. (Issue #234)-- * `Text.Pandoc.TeXMath` has been rewritten to use texmath's parser.- This allows it to handle a wider range of formulas. Also, if a formula- cannot be converted, it is left in raw TeX; formulas are no longer- partially converted.-- * Unicode curly quotes are left alone when parsing smart quotes. (Issue- #143)-- * Cabal file changes:-- - Removed parsec < 3 restriction.- - Added 'threaded' flag for architectures where GHC lacks a threaded- runtime.- - Use 'threaded' only for markdown2pdf; it is not needed for pandoc.- - Require highlighting-kate 0.2.7.-- * Use explicit imports from `Data.Generics`. Otherwise we have a- conflict with the 'empty' symbol, introduced in syb >= 0.2. (Issue #237)-- * New data files: slidy/slidy.min.js, slidy/slidy.min.css, epub.css.--pandoc (1.5.1.1)-- [ John MacFarlane ]-- * Fixed uniqueIdent in Shared so that header identifiers work as- advertized in the README and are are valid XHTML names.--pandoc (1.5.1)-- [ John MacFarlane ]-- * Fixed treatment of unicode characters in URIs.- + Shared now exports escapeURI and unescapeURI. These handle- UTF8 encoding and decoding as well as URI escaping/unescaping.- + Shared: uri and emailAddress now return a pair of the original- parsed text and the escaped URI (in the latter case, with- the mailto: prefix).- + HTML reader: unsanitaryURI has been modified to allow unicode- high characters in a URI.- + Readers: All link and image URIs are now escaped using- escapeURI.- + Markdown and RST writers: unescapeURI is used so that URIs- in these formats are human-readable.-- * Setup.hs: Don't assume that the build directory is "dist".- Instead, get it from localBuildInfo.-- * OpenDocument writer: Use a Map for stTextStyleAttr.- This avoids duplicates (and invalid xml). Resolves Issue #222.--pandoc (1.5.0.1)-- [ John MacFarlane ]-- * HTML writer: Fixed error in math writer (with MathML option)- that caused an infinite loop for unparsable MathML.--pandoc (1.5)-- [ John MacFarlane ]-- * Added --mathml option. When this is selected, pandoc will convert- TeX math into MathML.- + Added data/MathMLinHTML.js, which is included when no URL is- provided for --mathml. This allows MathML to be displayed (in- better browsers) as text/html.- + Removed Text.Pandoc.LaTeXMathML. The module was no longer- necessary; it was replaced by two lines in pandoc.hs.- + Replaced LaTeXMathML.js.commend and LaTeXMathML.js.packed with a- single combined file, LaTeXMathML.js.-- * Added --data-dir option.- This specifies a user data directory. If not specified, will default- to ~/.pandoc on unix or Application Data\pandoc on Windows.- Files placed in the user data directory will override system default- data files.-- * Added Maybe datadir parameter to readDataFile, saveOpenDocumentAsODT,- latexMathMLScript, s5HeaderIncludes, and getDefaultTemplate. If- Nothing, no user directory is searched for an override.-- * Added 'plain' output format. This is similar to markdown, but- removes links, pictures, inline formatting, and most anything that- looks even vaguely markupish. The function writePlain is exported by- Text.Pandoc.Writers.Markdown, with which it shares most of its code.-- * Allow multi-line titles and authors in meta block.- Titles may span multiple lines, provided continuation lines- begin with a space character. Separate authors may be put on- multiple lines, provided each line after the first begins with- a space character. Each author must fit on one line. Multiple- authors on a single line may still be separated by a semicolon.- Based on a patch by Justin Bogner.-- * When given an absolute URI as parameter, pandoc will try to fetch- the content via HTTP. So you can do:- 'pandoc -r html -w markdown http://www.fsf.org'- Adds dependency on HTTP.-- * Made HTML reader much more forgiving.- + Incorporated idea (from HXT) that an element can be closed- by an open tag for another element.- + Javascript is partially parsed to make sure that a <script>- section is not closed by a </script> in a comment or string.- + More lenient non-quoted attribute values.- Now we accept anything but a space character, quote, or <>.- This helps in parsing e.g. www.google.com!- + Bare & signs are now parsed as a string. This is a common- HTML mistake.- + Skip a bare < in malformed HTML.-- * Removed html2markdown and hsmarkdown.- + html2markdown is no longer needed, since you can now pass URI- arguments to pandoc and directly convert web pages. (Note,- however, that pandoc assumes the pages are UTF8. html2markdown- made an attempt to guess the encoding and convert them.)- + hsmarkdown is pointless -- a large executable that could be- replaced by 'pandoc --strict'.-- * In most writers, an image in a paragraph by itself is now rendered- as a figure, with the alt text as the caption. (Texinfo, HTML, RST,- MediaWiki, Docbook, LaTeX, ConTeXt, HTML.) Other images are- rendered inline.-- * Depend on extensible-exceptions. This allows pandoc to be compiled- on GHC 6.8.-- * Added --base-header-level option. For example, --base-header-level=2- will change level 1 headers to level 2, level 2 to level 3, etc.- Closes Debian #563416.-- * Incomplete support for RST tables (simple and grid).- Thanks to Eric Kow. Colspans and rowspans not yet supported.-- * Added accessors (docTitle, docAuthors, docDate) to Meta type.-- * MediaWiki writer: format links with relative URLs as wikilinks.- The new rule: If the link target is an absolute URL, an external- link is created. Otherwise, a wikilink is created.-- * Text.Pandoc.Shared: Export uniqueIdent, and don't allow tilde in- identifier. Note: This may break links to sections that involve- tildes.-- * Markdown(+lhs) reader: handle "inverse bird tracks."- Inverse bird tracks (<) are used for haskell example code that is not- part of the literate Haskell program. Resolves Issue #211.-- * LaTeX reader:- + Recognize '\ ' (interword space).- + Recognize nonbreaking space '~'.- + Ignore \section, \pdfannot, \pdfstringdef. Ignore alt title in- section headers. Don't treat \section as inline LaTeX.- Resolves Issue #202.- + LaTeX reader: allow any special character to be escaped.- Resolves Issue #221.- + LaTeX reader: treat \paragraph and \subparagraph as level 4, 5- headers. Resolves Issue #207.-- * Use template variables for include-before/after.- + These options now imply -s; previously they worked also in fragment- mode.- + Users can now adjust position of include-before and include-after- text in the templates.- + Default position of include-before moved back (as it was before 1.4)- before table of contents.- + Resolves Issue #217.-- * Don't print an empty table header: (all writers).- Resolves Issue #210.-- * HTML, Docbook writer: Use tbody, thead, and cols in tables.-- * HTML writer: Don't include TOC div if table of contents is empty.-- * Markdown writer: Fixed citations.- Previously the markdown writer printed raw citation codes, e.g.- [geach1970], rather than the expanded citations provided by- citeproc, e.g. (Geach 1970). Now it prints the expanded citations.- This means that the document produced can be processed as a markdown- document without citeproc. Thanks to dsanson for reporting, and- Andrea Rossato for the patch.-- * Improved and simplified title block in context template.- Previously it caused an error if there was no title.- This method should also be easier for users to customize.-- * Markdown reader:- + Treat p., pp., sec., ch., as abbreviations in smart mode.- + Disallow blank lines in inline code span.- + Allow footnotes to be indented < 4 spaces.- This fixes a regression. A test case has been added.- + Escape spaces in URLs as %20. Previously they were incorrectly- escaped as +, which is appropriate only for the query part of- a URL. Resolves Issue #220.- + Require two spaces after capital letter + period for list item.- Otherwise "E. coli" starts a list. This might change the semantics- of some existing documents, since previously the two-space- requirement was only enforced when the second word started- with a capital letter. But it is consistent with the existing- documentation and follows the principle of least surprise.- Resolves Issue #212.-- * LaTeX template: redefine labelwidth when using enumerate package.- Otherwise the list labels (numbers) often extend past the left- margin, which looks bad.-- * Mediawiki writer: Don't print a "== Notes ==" header before- references. This is too English-centric. Writers can provide their- own header at the end of the document.-- * Promoted mediawiki headers. '= head =' is now level 1, '== head =='- level 2, etc. This seems to be correct; it's only by convention- that wikipedia articles have level 2 headers at most.- Patch due to Eric Kow.-- * RunTests.hs: Set LANG to a UTF-8 locale. Use 'pandoc --data-dir=' so- data files don't need to have been installed. This removes the need to- set HOME.-- * HTML reader:- + Handle spaces before <html>. Resolves Issue #216.- + Be forgiving in parsing a bare list within a list.- The following is not valid xhtml, but the intent is clear:- <ol>- <li>one</li>- <ol><li>sub</li></ol>- <li>two</li>- </ol>- We'll treat the <ol> as if it's in a <li>. Resolves Issue #215.-- * Updated INSTALL instructions. cabal method is now promoted.-- * Updated markdown2pdf man page. It no longer says all pandoc options- are accepted.-- * README/man pages: Removed advice to pipe through tidy before HTML- reader. This is obsolete, now that we have a forgiving HTML parser.-- * LaTeX writer: set numbersections template variable, so- the section numbering options work again.-- * Removed obsolete Makefile.-- * Website: renamed index.txt.in -> index.txt.-- * New batch file to make-windows-installer.- + Removed old Makefile.windows- + Added make-windows-installer.bat- + Modified default installer name in pandoc-setup.iss-- * Removed freebsd and macports directories.- They are no longer up to date.-- * Setup.hs:- + Made man page building sensitive to build verbosity.- + Improved detection of highlighting support in test hook.- + Install wrapper scripts into cabal bin directory.- + Also simplified installManpages.- + Setup.hs: install manpages to mandir. Code borrowed from darcs.-- * Changed default of writerXeTeX to False.-- * HTML writer: don't include empty UL if --toc but no sections.- Resolves Issue #199.-- * LaTeX writer:-- + If book, report, or memoir documentclass, use \chapter{}- for first-level headers. Otherwise use \section{}.- + Removed stLink, link template variable. Reason: we now always- include hyperref in the template.-- * LaTeX template:-- + Only show \author if there are some.- + Always include hyperref package. It is used not just for links but- for toc, section heading bookmarks, footnotes, etc. Also added- unicode=true on hyperref options.-- * markdown2pdf: always do at least two runs. hyperref bookmarks- require this.-- * cabal file: Removed unneeded dependency on template-haskell.-- * Windows installer - fixed bug in data file locations.- Resolves Issue #197.-- * Deprecated --custom-header in documentation.- Removed old "Custom Headers" section in README.--pandoc (1.4)-- [ John MacFarlane ]-- * Pandoc will now compile with either GHC 6.10 or 6.12.- + Don't use System.IO.UTF8 when compiling with 6.12- + Use -fno-warn-unused-do-bind option when compiling with 6.12-- * Replaced old headers with templates. Now users have much more- control over the way documents appear in --standalone mode,- and writer code is simplified. Resolves Issues #59, 147.- Every effort has been made to retain backwards compatibilty.- So, the --custom-header option should still work as before.-- + Added Text.Pandoc.Templates. This provides functions for- retrieving default templates and for rendering templates.- + System templates (in the pandoc data directory) can be- overridden by user templates in $HOME/.pandoc/templates.- + Removed Text.Pandoc.DefaultHeaders.- + Removed data/headers directory.- + Added templates directory.- + Added writerTemplate and writerVariables fields to WriterOptions.- + Removed writerTitlePrefix, writerHeader fields from WriterOptions.- + Changed --print-default-header to --print-default-template.- + Added --template option.- + Added -V/--variable option to set custom template variables.-- * Pandoc no longer requires Template Haskell. Resolves Issue #186.-- + Removed need for TH in ODT module. Instead get reference.odt from- data file at run time.- + Removed TH dependency from S5 module. S5 module now exports- s5HeaderIncludes, which pandoc.hs includes if writer is s5 and- standalone.- + Refactored LaTeXMathML not to use TH.-- * Meta is now Meta [Inline] [[Inline]] [Inline] rather than- Meta [Inline] [String] String. Authors and date in Meta are now lists- of Inline elements rather than raw strings. This means that they can- be formatted and can include footnotes. NOTE: This may be a breaking- change for those using pandoc as a library.-- * Added readDataFile to Text.Pandoc.Shared. This retrieves- a data file from the user pandoc data directory (~/.pandoc- on unix), or, if not found there, from the system data- directory ($CABALDIR/shared/pandoc-VERSION/). All data- files, including templates, LaTeXMathML.js, s5 styles,- and reference.odt, can be overridden by the user.-- * s5 files moved from data/ui/default to s5/default.-- * Use unicode instead of entities in HTML and XML output. Resolves- Issue #163.-- * Prettier HTML footnote references: put anchor inside sup,- instead of other way. Resolves Issue #191. Thanks to- infinity0x.-- * Added --xetex option to pandoc and markdown2pdf.- If --xetex is specified, pandoc produces latex suitable for- processing by xelatex, and markdown2pdf uses xelatex to create- the PDF. Resolves Issue #185.-- * RTF writer: multiple authors now occupy multiple paragraphs rather- than using a line break.-- * Man writer: now the "--after-body" will come after the "AUTHORS"- section, whereas before it would come before it. This is a- slight break from backwards compatibility.-- * Added --reference-odt option, so users may customize the styles- used in pandoc-generated ODT files. Users may also place a- default reference.odt in the ~\.pandoc directory.-- * ODT writer:- + Indented and line-broke styles.xml so it can be modified more easily.- + Omitted some unnecessary style declarations.- + Don't wrap text in OpenDocument writer. The tags are too long, making- wrapping ugly and pointless.-- * LaTeX reader: use \\ to separate multiple authors.-- * Markdown reader: use ; as separator between authors.- This allows you to use ',' within author names: e.g. "John Jones, Jr."-- * S5 writer: use linebreak to separate authors in title page.-- * RST reader: Allow :: before lhs code block. The RST spec requires the- :: before verbatim blocks. This :: should not be treated as literal- colons. Resolves Issue #189.-- * Documented pandoc 1.3's new definition list syntax in README.- (An oversight in the last release.)-- * markdown2pdf.hs:- + interpret ! in a log as an error line.- + --toc now works properly.-- * Changes in RunTests.hs:- + Use the Diff library rather than a local copy of Diff.hs.- (This vastly increases performance.) This change means that 'cabal- test' presupposes that the Diff library is installed.- + Removed tests/Diff.hs from cabal file.- + Changed RunTests to use local environment. We need at least HOME, so- pandoc can find its data directory.-- * Updated windows installer to install data files in the app directory.-- * Windows installer now installs portable wrappers hsmarkdown and- markdown2pdf.--pandoc (1.3)-- [ John MacFarlane ]-- * Added --id-prefix option (Issue #41). This adds a prefix to all- automatically generated HTML identifiers, which helps prevent- duplicate identifiers when you're generating a fragment (say a blog- post).-- * Added --indented-code-classes option. This specifies classes- to use for indented code blocks. (Patch due to buttock; Issue #87.)-- * --number-sections now affects HTML output as well as ConTeXt and LaTeX- (Issue #150).-- * Improved syntax for markdown definition lists (Issue #24).- Definition lists are now more compatible with PHP Markdown Extra.- + You can have multiple definitions for a term (but still not- multiple terms).- + Multi-block definitions no longer need a column before each block- (indeed, this will now cause multiple definitions).- + The marker no longer needs to be flush with the left margin,- but can be indented at or two spaces. Also, ~ as well as :- can be used as the marker (this suggestion due to David- Wheeler.)- + There can now be a blank line between the term and the- definitions.-- * Better looking simple tables. Resolves Issue #180.- + Markdown reader: simple tables are now given column widths of 0.- + Column width of 0 is interpreted as meaning: use default column width.- + Writers now include explicit column width information only- for multiline tables. (Exception: RTF writer, which requires- column widths. In this case, columns are given equal widths,- adding up to the text width.)- + Simple tables should now look better in most output formats.-- * Allow markdown tables without headers (Issue #50).- The new syntax is described in README. Also allow optional line of- dashes at bottom of simple tables.-- * Compensate for width of final table column (Issue #144).-- * Treat a backslash followed by a newline as a hard line break- in markdown. Resolves Issue #154. This is a nice alternative- to markdown's "invisible" way of indicating hardline breaks- using lines that end with two spaces.-- * Improved performance of markdown reader by ~10% by eliminating the- need for a separate parsing pass for notes. Raw notes are now stored- on the first pass (which parses references), then parsed when the- note is inserted into the AST. The stateNotes field in ParserState- is now a list of [(String, String)] pairs instead of [(String,- [Block])].-- * In markdown reader, treat 4 or more * or _ in a row as literal- text. (Trying to parse long strings of * or _ as strong or emph- leads to exponential performance problems.)-- * Markdown reader: Use + rather than %20 for spaces in URLs.-- * Fixed htmlComment parser, adding a needed 'try'.-- * Don't print raw HTML in man output.-- * Allow . _ and ~ in header identifiers.-- * Specially mark code blocks that were "literate" in the input.- They can then be treated differently in the writers. This allows- authors to distinguish bits of the literate program they are writing- from source code examples, even if the examples are marked as- Haskell for highlighting. (Issue #174.)-- * Modified html+lhs output to use "haskell" highlighter instead- of "literateHaskell". The highlighting module now adds bird tracks- after highlighting (for HTML output), if the code block has the- "literate" class. This gives better results, because kate's- haskell highlighter is much better than the literateHaskell- highlighter.-- * Fixed handling of footnotes in titles (HTML) and headers (LaTeX).- (Issue #137.)-- * Support for "..code-block" directive in RST reader. Not core- RST, but used in Sphinx for code blocks annotated with syntax- information. Thanks to Luke Plant for the patch.-- * Added "head" to list of block-level HTML tags. Resolves- Issue #108.-- * Added stripTags to Text.Pandoc.XML. This is used in the HTML writer.-- * Set utf-8 encoding in texinfo headers.-- * Docbook writer: add ids to sections. Use link for internal links.- (Issue #60.)-- * Blank lines after lists in MediaWiki writer.-- * Properly handle commented-out list items in markdown.- Resolves Issue #142. Example:-- - a- <!--- - b- -->- - c-- * Changed heuristic in compactify. compactify has to decide whether a- Para that ends a list is a Para intentionally, or just because of- the blank lines at the end of every list. In the latter case the- Para is turned to a Plain. The old heuristic was: change final Para- to Plain iff the other items all end in Plain. This produces bad- results when, for example, an item contains just a Plain and an HTML- comment, as it does in the list above. The new heuristic: change- final Para to Plain iff the other items don't contain a Para.-- * Added % as an rst underline character. Resolves Issue #173.-- * Fix inline math parser so that \$ is allowed in math.- Resolves Issue #169.-- * Translate \int (integral) into unicode when using unicode math- method. Resolves Issue #177.-- * markdown2pdf.hs improvements:- + Use System.IO.UTF8.- + Print error messages on last attempt.- + Do not create a backup when overwriting a PDF (Issue #166).- + Accept --longopt=val options.- + Added man/man1/markdown2pdf.1 to extra-tmp-files in cabal, so that- it is properly cleaned.-- * Added haddock comments warning that readers assume \n line endings.-- * Updated COPYRIGHT file.-- * Makefile: Changed EXECSBASE so it doesn't pull in hsmarkdown &- markdown2pdf. Otherwise strip tries to strip shell scripts when you- install using 'make'.-- * Changed Makefile so it doesn't build Haskell wrappers.-- * Fixed Makefile so it doesn't try to build man pages in build-doc.-- * Install pcre3.dll in Windows install script; this allows us to- package a version of pandoc with highlighting support.--pandoc (1.2.1)-- [ John MacFarlane ]-- * Fixed regression with --preserveTabs. Brought back optPreserveTabs.- The trick of setting tabStop to 0 to mean "preserve tabs" had a bad- side effect: strings of 0 spaces were interpreted as indentation.- So, with --preserve-tabs, unindented paragraphs were treated as- code. Resolves Issue #138.-- * HTML writer: wrap sections in divs. Resolves Issue #70.-- + hierarchicalize has been rationalized; it builds a hierarchical- representation of the document from the headers, and simultaneously- gives each section a unique identifier based on the heading title.- + Identifiers are now attached to the divs rather than- to the headers themselves.- + Table of content backlinks go to the beginning of the table, rather- than to the section reference that was clicked.- + Code for constructing identifiers has been moved to Text.Pandoc.Shared- from the HTML writer, since it is now consumed only by- hierarchicalize.- + In --strict mode, pandoc just prints bare headings, as before- (unless --toc has been specified).- + In s5 output, it does not wrap sections in divs, as that seems to- confuse the s5 javascript.-- * Man writer: break lines at end of each sentence. groff expects this- and treats '.' and '?' differently when followed by line ending as- opposed to ordinary space. Also, don't escape periods. Instead, use- zero-width character \& to avoid unwanted interpretation of periods- at start of line. Resolves Issue #148.-- * Markdown writer: Added '#' and '>' to list of characters to be- escaped in markdown output. Removed '<', as it is not an officially- escapable character. This partially resolves Issue #96.-- * Make --smart the default for man output format. Otherwise we have- trouble dividing lists of endlines into sentences.-- * DocBook writer: Use language attribute to indicate source language- in code blocks.-- * RST reader:-- + Allow # to continue list, even if the list was started with an- explicit marker. For example:-- A. my list- #. continued-- Resolves Issue #140.- + Allow continuation lines in line blocks. Also added test cases for- line blocks for RST reader. Resolves Issue #149.- + Allow explicit links with spaces in URL: `link <to this>`_-- * Improved LaTeX reader's coverage of math modes. Remove displaymath*- (which is not in LaTeX) and recognize all the amsmath environments- that are alternatives to eqnarray, namely equation, equation*,- gather, gather*, gathered, multline, multline*, align, align*,- alignat, alignat*, aligned, alignedat, split. Resolves Issue #103.- Thanks to shreevatsa.public for the patch.-- * Markdown reader:-- + Allow -, _, :, . in markdown attribute names. These are legal in- XML attribute names.- + Use non-breaking spaces in abbreviations.- + Markdown reader: improved efficiency of abbreviation parsing.- Instead of a separate abbrev parser, we just check for- abbreviations each time we parse a string. This gives a huge- performance boost with -S. Resolves Issue #141.-- * Improved efficiency of shared parsers: hexNum, htmlComment,- whitespace, indentSpaces.-- * Export HTMLMathMethod in Text.Pandoc.-- * Export languagesByExtension in Text.Pandoc.Highlighting.-- * Added new Haskell version of markdown2pdf, due to- Paulo Tanimoto. This should be more portable than the old- shell script.-- * Made 'pandoc -v' more explicit about compiler options.- Resolves Issue #139.-- * pandoc.hs: Made --strict compatible with --standalone, --toc.-- * Use Paths_pandoc to get version number, instead of hard-coding it- into Text/Pandoc.hs.--pandoc (1.2)-- [ John MacFarlane ]-- * Added support for literate Haskell. lhs support is triggered by- '+lhs' suffixes in formats. For example, 'latex+lhs' is literate- Haskell LaTeX. '.lhs' files are treated by default as literate- markdown.-- + Added stateLiterateHaskell to parser state.- + Added parser for lhsCodeBlock to Markdown, RST, LaTeX readers.- + Added parser for |inline lhs| to LaTeX reader.- + Added writerLiterateHaskell to WriterOptions.- + Added lhs support to Markdown, RST, LaTeX, HTML writers.- + Added definition of code environment to LaTeX header.- + Added tests (run only if highlighting support compiled in).- + Documented lhs features in man page and README.-- * In Text.Pandoc.Definition, added processWith, processWithM,- and queryWith, and deprecated processPandoc and queryPandoc- for these more general functions.-- * Fixed bug in mediawiki writer: improper closing tags in tables.- Thanks to Benct Philip Jonsson for reporting the bug.-- * Added --email-obfuscation option.-- + Added writer option for email obfuscation.- + Implemented email obfuscation options in HTML writer.- + Added option to option parser.- + Documented in README and pandoc man page.- + Resolves Issue #97.-- * LaTeX writer: fixed bug with empty table cells.- Resolves Issue #107. Thanks to rodja.trappe for the patch.-- * Fixed bug with header spacing in Markdown and RST writers.- A null header (Meta [] [] []) should not cause a blank line- at the beginning of output. But a blank line is needed between- a non-null header and the main text.-- * Markdown reader: Relax spacing rules for $$ in display math. Now- space and newlines are allowed after the opening $$ and before the- closing $$. However, the display math cannot contain an entirely- blank line. Resolves Issue #105.-- * Markdown reader: Gobble space after Plain blocks containing only- raw html inline. Otherwise following header blocks are not parsed- correctly, since the parser sees blank space before them. Resolves- Issue #124.-- * Markdown reader: Allow " as well as '' to end a latex double-quote.-- * Conditionally depend on syb and base >= 4 if ghc >= 6.10.- Resolves Issue #109.-- * Fixed problems in RST and markdown output due to bug in pretty-1.0.1.0-- + Added hang' function to Text.Pandoc.Shared; this will be used instead- of hang, which doesn't work properly in pretty-1.0.1.0. When pretty- is upgraded, we can go back to hang.- See http://article.gmane.org/gmane.comp.lang.haskell.general/16687- + Use hang' (and some different techniques) in RST and markdown writers.- Some output is now a bit different.-- * Brought citeproc support up to date for citeproc-hs-0.2.- (Patch by Andrea Rossato.)-- * Moved all haskell source to src subdirectory. Renamed Main.hs to- pandoc.hs.-- * Rewrote hsmarkdown in Haskell for portability (src/hsmarkdown.hs).- For now, keeping the old shell script too.-- * Added TemplateHaskell to Extensions for executable, removed- -threaded for library. Thanks to duncan.coutts for the bug report.- Resolves Issue #121.-- * Moved some Extra-Source-Files to Data-Files.-- * Moved tabFilter to Shared.-- * In pandoc.hs, removed optPreserveTabs; instead, tabstop of 0 means- preserve tabs.-- * Minor code cleanup based on hlint suggestions.--pandoc (1.1)-- [ John MacFarlane ]-- * Main.hs:-- + Changed date on copyright message in Main.hs.- + Have the '-v' option print syntax highlighting languages- separated by commas, and wrapped in lines, instead of in five- columns as before.-- * Added --jsmath option. Resolves Issue #68.-- + Added --jsmath option to Main.hs- + Added JsMath to HTMLMathMethod in Text.Pandoc.Shared.- + Handle math appropriately in HTML writer when JsMath selected.- + Documented the option in README and man page.-- * Text.Pandoc.Shared: Changed compactify to use a better heuristic- for tight and loose lists. Final Para is changed to Plain if all- other list items *end* with a Plain block. Addresses Issue #99.-- * HTML reader:-- + Added colons to protocols in unsanitaryURI. Closes Issue #88.- + HTML reader: Don't interpret contents of <pre> blocks as markdown.- Added rawVerbatimBlock parser. Resolves Issue #94.-- * Markdown reader:-- + Allow URLs with spaces in them in links and references, but escape- them as "%20".- + Allow blank space at the end of horizontal rules.-- * RST reader: Modified 'unknownDirective' parser to handle comment- blocks correctly, and added tests for comment blocks. Resolves Issue- #86. Closes Debian Bug #500662.-- * HTML writer:-- + Include classes on tr elements in HTML output:- "header", "odd", "even". This allows tables to be styled with- lines in alternating colors. Resolves Issue #91.- + Enclose all LaTeXMathML bits in <span class="LaTeX">.- This prevents parts of the document that are not math from being- interpreted as math by LaTeXMathML.js.-- * OpenDocument and ODT writers: Added support for HorizontalRule elements,- which were formerly ignored. Resolves Issue #95.-- * Text.Pandoc.Shared: Modified wrappedTeX to eliminate the line break- between a footnote and immediately following nonspace characters in- LaTeX and ConTeXt output. (This gets interpreted as a space, which- is not desired in cases like "text^[note]---".) Resolves Issue #93.-- * Windows installer: Don't require admin privileges to run- installer. Modified pandoc-setup.iss, and changed modpath.iss to- modify HKCU path if user lacks admin privileges. Also fixed case- where oldpath is empty (previously this led to the new path- beginning with a semicolon).-- * Updated INSTALL instructions for Arch packages and OS X install using- cabal-install.-- * Removed the (now unneeded) debian directory.- Removed empty Codec and System directories.-- * Moved odt-styles/ to data/. Removed unneeded variable in Makefile.-- * Modified Setup.hs so that the "test" target returns an error status- when tests fail, and "build" returns a success status if- the build succeeds. Resolves Issue #100.-- * Added BUGS to files in tarball.---pandoc (1.0.0.1)-- [ John MacFarlane ]-- * Removed spurious reference to pdf output format from pandoc(1) man page.--pandoc (1.0)-- [ Andrea Rossato ]-- * Added new OpenDocument writer.-- * Added support for SmallCaps inline element.-- * Added support for integrating pandoc with citeproc-hs.-- + Added Cite element to definition and writers.- + Added Text.Pandoc.Biblio module- + Note: This support is included only if the 'citeproc'- Cabal configuration flag is set.-- * Made Pandoc data structure an instance of Typeable.- Added new processPandoc and queryPandoc functions, to query- or transform matching elements in a Pandoc structure.-- [ Peter Wang ]-- * Added new Texinfo writer.-- [ John MacFarlane ]-- * Changes to Texinfo writer:-- + No space between paragraph and following @verbatim (provides more- pleasing appearance in text formats)- + Blank line consistently after list environments.- + Removed deVerb.- + Use @code instead of @verb for inline code (this solves the character- escaping problem for texi2dvi and texi2pdf).- + Added news of Texinfo writer to README.- + Added Texinfo to list of formats in man page, and removed extra 'groff'.- + Added texi & texinfo extensions to Main.hs, and fixed bug in determining- default output extension.- + Modified disallowedInNode in Texinfo writer to correct list of disallowed characters.-- * Added tests for OpenDocument writer.-- * Added ODT writer (using zip-archive library to package output of- OpenDocument writer). Added odt-styles directory with default ODT styles.-- * Added new mediawiki writer and tests.-- * Markdown reader: Added support for delimited code blocks, with optional- syntax highlighting using highlighting-kate (if the 'highlighting'- configuration option is selected).-- + Currently highlighting is supported only in the HTML writer.- + Delimited code blocks can have attributes; using the language name as- class triggers highlighting.- + New Attributes parameter in CodeBlock structure.- + --version now indicates whether syntax highlighting support is compiled- in, and prints a list of supported languages-- * Removed debian directory. Pandoc is no longer a native debian package.-- * Changes to build process: pandoc can now be built from the repository- using Cabal. No unix tools are needed (so, pandoc can be built on Windows- without Cygwin).-- + Include shell scripts themselves in repo, rather than generating from wrappers.- Removed wrappers directory and wrappers Makefile target.- + Text/Pandoc/ASCIIMathML.hs, Text/Pandoc/DefaultHeaders.hs,- and Text/Pandoc/Writers/S5.hs are no longer built in Makefile- from templates in the templates/ directory. Instead, they use template- haskell to read data at compile time from the relevant files in data/.- Template haskell functions go in a new module, Text.Pandoc.TH.- + man pages are now generated in Setup.hs hook, not by Makefile- + Makefile 'tarball' target now calls Cabal's 'sdist'- + Added "Extra-Source-Files" to pandoc.cabal, so sdist contains everything needed- + Added "Build-Type" field to pandoc.cabal to avoid warning.- + Added to "Extra-source-files" and "Extra-tmp-files" in pandoc.cabal,- so 'sdist' and 'clean' will work properly.- + Setup.hs now generates man pages in a postbuild hook.- + Added dependency-checking to Setup.hs, so it only rebuilds things- that need rebuilding.- + Added 'library' and 'executable' configuration flags.- Cabal can now be told to build just the library or just the executable.- + CABALOPTS may now be specified with 'make' to pass Cabal configuration flags.- For example: CABALOPTS=-fhighlighting make-- * Rewrote test suite so it doesn't depend on perl or unix tools.-- + Replaced old runtests.pl with a Haskell script RunTests.hs.- + Added Diff.hs module to be used by RunTests.hs instead of unix 'diff'.- + Added test hook to Setup.hs, so tests may be run from cabal.- + Changed Makefile's 'test' target to run tests via cabal.- + Removed old generate.sh.- + Since we no longer have 'sed' to filter out raw HTML sections- from the docbook writer test, or raw LaTeX sections from the- context writer test, we now just include these sections.- They can be taken out if it is necessary to process the files.- + Updated latex and context writer tests to remove extra spaces- after '\\item'- + Added a markdown table reader test.- + Added markdown-reader-more.txt to test suite, for additional test cases- for raw ConTeXt environments and more.-- * Compatibility fixes for CPP, Cabal, and haddock:-- + Use CPP in "Extensions" field in pandoc.cabal.- + Removed use of backslash string continuations in source files.-- * Removed pandoc.cabal.ghc66. We now require Cabal >= 1.2, GHC >= 6.8,- base >= 3.-- * Require parsec < 3.- The compatibility module in parsec 3.0.0 gives far worse performance than- parsec 2.1. Eventually pandoc will be upgraded to use the new bytestring- version of parsec, and then we'll go to parsec 3.0.0.-- * Removed Text.Regex dependencies by rewriting using plain Haskell- (Text.Pandoc.Writers.RTF, Text.Pandoc.Writers.HTML, Main.hs)-- * Moved Text.Pandoc.Writers.DefaultHeaders -> Text.Pandoc.DefaultHeaders.-- * Makefile:-- + Added 'configure' as dependency of 'uninstall-all'.- (It uses the Cabal build program.)- + Makefile: only use --with-hc-pkg if GHC_PKG is defined.- Note that Cabal will automatically choose the ghc-pkg appropriate- for the compiler selected, so normally specifying GHC by itself- is sufficient.-- * Removed Text.Pandoc.UTF8 module; instead, depend on utf8-string and use- its IO and conversion functions.-- * Added -Wall to ghc-options in pandoc.cabal. Cleaned up modules so that- everything is -Wall clean.-- + Added pragma to HTML writer to avoid deprecation warning for use of "start" attribute.- + Added pragma to Text/Pandoc/Shared.hs to get rid of "orphan instance" warnings.- (These are caused by the Lift instance for ByteString.)-- * Changed the comment used to replace unsafe HTML if sanitize-html option- selected.-- * Made -c/--css option repeatable on the command line (like -H, -A, -B).-- * Moved XML-formatting functions to new unexported module Text.Pandoc.XML.-- * Escape '\160' as " ", not " " in XML.- "nbsp" isn't a predefined XML entity.-- * Fixed bug in RST reader, which would choke on: "p. one\ntwo\n".- Added some try's in ordered list parsers.-- * Man writer: don't escape " as \".-- * Allow newline before URL in markdown link references. Resolves Issue #81.- Added tests for this issue in new "markdown-reader-more" tests.- Changed RunTests.hs to run these tests.-- * Support for display math. Resolves Issue #47.-- + Added a DisplayMath/InlineMath selector to Math inlines.- + Markdown parser yields DisplayMath for $$...$$.- + LaTeX parser yields DisplayMath when appropriate. Removed- mathBlock parsers, since the same effect is achieved by the math- inline parsers, now that they handle display math.- + Writers handle DisplayMath as appropriate for the format.- + Modified tests accordingly; added new tests for display math.-- * Use LaTeXMathML instead of ASCIIMathML. LaTeXMathML is closer- to LaTeX in its display of math, and supports many non-math LaTeX environments.-- + Changed -m option to use LaTeXMathML rather than ASCIIMathML.- + Modified HTML writer to print raw TeX when LaTeXMathML is- being used instead of suppressing it.- + Removed ASCIIMathML files from data/ and added LaTeXMathML.- + Replaced ASCIIMathML with LaTeXMathML in source files.- + Modified README and pandoc man page source.- + Added --latexmathml option (kept --asciimathml as a synonym- for backwards compatibility)-- * Markdown reader: Parse setext headers before atx headers.- Test case:- # hi- ====- parsed by Markdown.pl as an H1 header with contents "# hi".-- * Markdown reader: Treat "mixed" lists the same way as Markdown.pl does.- The marker on the first list item determines the type of the whole- list. Thus, a list like- 1. one- - two- * three- gets parsed as a single ordered list. (Previous versions of pandoc- treated this as an ordered list with an unordered sublist.)-- * Markdown smart typography:-- + Em dashes no longer eat surrounding whitespace. Resolves Issue #69.- + Use nonbreaking spaces after known abbreviations in markdown parser.- Thus, for example, "Mr. Brown" comes out as "Mr.~Brown" in LaTeX, and does- not produce a sentence-separating space. Resolves Issue #75.-- * Markdown writer: Print unicode \160 literally, rather than as .-- * Treat '\ ' in (extended) markdown as nonbreaking space.- Print nonbreaking space appropriately in each writer (e.g. ~ in LaTeX).-- * The '--sanitize-html' option now examines URIs in markdown links- and images, and in HTML href and src attributes. If the URI scheme- is not on a whitelist of safe schemes, it is rejected. The main point- is to prevent cross-site scripting attacks using 'javascript:' URIs.- See http://www.mail-archive.com/markdown-discuss@six.pairlist.net/msg01186.html- and http://ha.ckers.org/xss.html. Resolves Issue #62.-- * HTML writer:-- + Override Text.XHtml's stringToHtml function,- so that characters below 0xff are not converted to numerical entity- references. Also convert '\160' to " ". This should aid readability- and editability of the HTML source. It does presuppose that the HTML- will be served as UTF-8.- + In code blocks, change leading newlines to <br /> tags.- (Some browsers ignore them.) Resolves Issue #71.- See http://six.pairlist.net/pipermail/markdown-discuss/2008-May/001297.html- + Use style attributes rather than css classes for strikethrough- and ordered list styles. This works better when fragments, rather than- standalone documents, are generated.-- * HTML reader: Count anything that isn't a known block (HTML) tag as an- inline tag (rather than the other way around). Added "html", "head", and- "body" to list of block tags. Resolves Issue #66, allowing- <lj> to count as an inline tag.-- * RTF writer: Fixed bug. Extra spaces were being printed after emphasized,- boldface, and other inline elements. Resolves Issue #64.-- * LaTeX reader: improvements in raw LaTeX parsing.-- + "loose punctuation" (like {}) parsed as Space- + Para elements must contain more than Str "" and Space elements- + Added parser for "\ignore" command used in literate haskell.- + Reworked unknownCommand and rawLaTeXInline: when not in "parse raw"- mode, these parsers simply strip off the command part and allow- the arguments to be parsed normally. So, for example,- \blorg{\emph{hi}} will be parsed as Emph "hi" rather than- Str "{\\emph{hi}}".- + Parse lhs "code" environments as verbatim.- Refactored parsers for verbatim environments.- + Removed specialEnvironment parser.- + parse '{}', if present, after \textless, \textgreater,- \textbar, \textbackslash, \ldots.- + Parse unescaped special characters verbatim rather than- changing them to spaces. This way arguments of unknown- commands will appear in braces.-- * Parse raw ConTeXt environments as TeX in markdown reader.- Resolves Issue #73.-- * Moved BlockWrapper and wrappedBlocksToDoc from ConTeXt writer to Shared.-- * Made some structural changes to parsing of raw LaTeX environments.- Previously there was a special block parser for LaTeX environments.- It returned a Para element containing the raw TeX inline. This has- been removed, and the raw LaTeX environment parser is now used in the- rawLaTeXInline parser. The effect is exactly the same, except that we- can now handle consecutive LaTeX and ConTeXt environments not separated- by spaces. This new flexibility is required by the example in- Issue #73:-- \placeformula \startformula- L_{1} = L_{2}- \stopformula-- API change: The LaTeX reader now exports rawLaTeXEnvironment' (which- returns a string) rather than rawLaTeXEnvironment (which returns a block- element). This is more likely to be useful in other applications.-- * Use \textsubscr instead of \textsubscript for LaTeX subscript macro.- \textsubscript conflicts with a definition in the memoir class.- Resolves Issue #65.-- * Removed unneeded space after "\\item" in LaTeX and ConTeXt output.-- * Added amsmath package to default LaTeX header. Resolves Issue #48.-- * Added \setupitemize[autointro] to ConTeXt header, to prevent orphaned- list introduction lines.-- * Changed Float to Double in definition of Table element.- (Double is more efficient in GHC.)-- * Fixed bug in Markdown parser: regular $s triggering math mode.- For example: "shoes ($20) and socks ($5)."- The fix consists in two new restrictions:-- + the $ that ends a math span may not be directly followed by a digit.- + no blank lines may be included within a math span.-- Thanks to Joseph Reagle for noticing the bug.-- * Use Data.List's 'intercalate' instead of custom 'joinWithSep'.- Removed 'joinWithSep' from Text.Pandoc.Shared.-- * Updated README and man pages. Acknowledge contributors in README.- Added paragraph to README about producing S5 with separate CSS/javascript.-- * Updated INSTALL to reflect new build system (including configuration- options) and document new dependencies. Added note to INSTALL that- Cabal >= 1.2 is required for build. Resolves Issue #74.-- * Fixed some haddock documentation errors.-- * Small fix to markdown2pdf man page: only input needs to be piped through iconv.--pandoc (0.46) unstable; urgency=low-- [ John MacFarlane ]-- * Made -H, -A, and -B options cumulative: if they are specified- multiple times, multiple files will be included.-- * Added optional HTML sanitization using a whitelist.- When this option is specified (--sanitize-html on the command line),- unsafe HTML tags will be replaced by HTML comments, and unsafe HTML- attributes will be removed. This option should be especially useful- for those who want to use pandoc libraries in web applications, where- users will provide the input.-- + Main.hs: Added --sanitize-html option.-- + Text.Pandoc.Shared: Added stateSanitizeHTML to ParserState.-- + Text.Pandoc.Readers.HTML:- - Added whitelists of sanitaryTags and sanitaryAttributes.- - Added parsers to check these lists (and state) to see if a given- tag or attribute should be counted unsafe.- - Modified anyHtmlTag and anyHtmlEndTag to replace unsafe tags- with comments.- - Modified htmlAttribute to remove unsafe attributes.- - Modified htmlScript and htmlStyle to remove these elements if- unsafe.-- + Modified README and man pages to document new option.-- * Improved handling of email addresses in markdown and reStructuredText.- Consolidated uri and email address parsers. (Resolves Issue #37.)-- + New emailAddress and uri parsers in Text.Pandoc.Shared.- - uri parser uses parseURI from Network.URI.- - emailAddress parser properly handles email addresses with periods- in them.-- + Removed uri and emailAddress parsers from Text.Pandoc.Readers.RST- and Text.Pandoc.Readers.Markdown.-- * Markdown reader:-- + Fixed emph parser so that "*hi **there***" is parsed as a Strong- nested in an Emph. (A '*' is only recognized as the end of the- emphasis if it's not the beginning of a strong emphasis.)-- + Moved blockQuote parser before list parsers for performance.-- + Modified 'source' parser to allow backslash-escapes in URLs.- So, for example, [my](/url\(1\)) yields a link to /url(1).- Resolves Issue #34.-- + Disallowed links within links. (Resolves Issue #35.)- - Replaced inlinesInBalanced with inlinesInBalancedBrackets, which- instead of hard-coding the inline parser takes an inline parser- as a parameter.- - Modified reference and inlineNote to use inlinesInBalancedBrackets.- - Removed unneeded inlineString function.- - Added inlineNonLink parser, which is now used in the definition of- reference.- - Added inlineParsers list and redefined inline and inlineNonLink parsers- in terms of it.- - Added failIfLink parser.-- + Better handling of parentheses in URLs and quotation marks in titles.- - 'source' parser first tries to parse URL with balanced parentheses;- if that doesn't work, it tries to parse everything beginning with- '(' and ending with ')'.- - source parser now uses an auxiliary function source'.- - linkTitle parser simplified and improved, under assumption that it- will be called in context of source'.-- + Make 'block' conditional on strictness state, instead of using- failIfStrict in block parsers. Use a different ordering of parsers- in strict mode (raw HTML block before paragraph) for performance.- In non-strict mode use rawHtmlBlocks instead of htmlBlock.- Simplified htmlBlock, since we know it's only called in strict- mode.-- + Improved handling of raw HTML. (Resolves Issue #36.)- - Tags that can be either block or inline (e.g. <ins>) should- be treated as block when appropriate and as inline when- appropriate. Thus, for example,- <ins>hi</ins>- should be treated as a paragraph with inline <ins> tags, while- <ins>- hi- </ins>- should be treated as a paragraph within <ins> tags.- - Moved htmlBlock after para in list of block parsers. This ensures- that tags that can be either block or inline get parsed as inline- when appropriate.- - Modified rawHtmlInline' so that block elements aren't treated as- inline.- - Modified para parser so that paragraphs containing only HTML tags and- blank space are not allowed. Treat these as raw HTML blocks instead.-- + Fixed bug wherein HTML preceding a code block could cause it to- be parsed as a paragraph. The problem is that the HTML parser- used to eat all blank space after an HTML block, including the- indentation of the code block. (Resolves Issue #39.)- - In Text.Pandoc.Readers.HTML, removed parsing of following space- from rawHtmlBlock.- - In Text.Pandoc.Readers.Markdown, modified rawHtmlBlocks so that- indentation is eaten *only* on the first line after the HTML- block. This means that in- <div>- foo- <div>- the foo won't be treated as a code block, but in- <div>-- foo-- </div>- it will. This seems the right approach for least surprise.-- * RST reader:-- + Fixed bug in parsing explicit links (resolves Issue #44).- The problem was that we were looking for inlines until a '<' character- signaled the start of the URL; so, if you hit a reference-style link,- it would keep looking til the end of the document. Fix: change- inline => (notFollowedBy (char '`') >> inline). Note that this won't- allow code inlines in links, but these aren't allowed in resT anyway.-- + Cleaned up parsing of reference names in key blocks and links.- Allow nonquoted reference links to contain isolated '.', '-', '_', so- so that strings like 'a_b_' count as links.-- + Removed unnecessary check for following link in str.- This is unnecessary now that link is above str in the definition of- 'inline'.-- * HTML reader:-- + Modified rawHtmlBlock so it parses </html> and </body> tags.- This allows these tags to be handled correctly in Markdown.- HTML reader now uses rawHtmlBlock', which excludes </html> and </body>,- since these are handled in parseHtml. (Resolves Issue #38.)-- + Fixed bug (emph parser was looking for `<IT>` tag, not `<I>`).-- + Don't interpret contents of style tags as markdown.- (Resolves Issue #40.)- - Added htmlStyle, analagous to htmlScript.- - Use htmlStyle in htmlBlockElement and rawHtmlInline.- - Moved "script" from the list of tags that can be either block or- inline to the list of block tags.-- + Modified rawHtmlBlock to use anyHtmlBlockTag instead of anyHtmlTag- and anyHtmlEndTag. This fixes a bug in markdown parsing, where- inline tags would be included in raw HTML blocks.-- + Modified anyHtmlBlockTag to test for (not inline) rather than- directly for block. This allows us to handle e.g. docbook in- the markdown reader.-- * LaTeX reader: Properly recognize --parse-raw in rawLaTeXInline.- Updated LaTeX reader test to use --parse-raw.-- * HTML writer:-- + Modified rules for automatic HTML header identifiers to- ensure that identifiers begin with an alphabetic character.- The new rules are described in README. (Resolves Issue #33.)-- + Changed handling of titles in HTML writer so you don't get- "titleprefix - " followed by nothing.-- * ConTeXt writer: Use wrappers around Doc elements to ensure proper- spacing. Each block element is wrapped with either Pad or Reg.- Pad'ed elements are guaranteed to have a blank line in between.-- * RST writer:-- + Refactored RST writer to use a record instead of a tuple for state,- and to include options in state so it doesn't need to be passed as- a parameter.-- + Use an interpreted text role to render math in restructuredText.- See http://www.american.edu/econ/itex2mml/mathhack.rst for the- strategy.-- [ Recai Oktaş ]-- * Debian packaging changes:-- + Remove the empty 'include' directory in -dev package, which lintian- complains about.- + Bump Standarts-Version to 3.7.3.- + Use new 'Homepage:' field to specify the upstream URL on suggestion of- lintian.-- -- Recai Oktaş <roktas@debian.org> Tue, 08 Jan 2008 05:13:31 +0200--pandoc (0.45) unstable; urgency=low-- [ John MacFarlane ]-- * Simplified parsing of reference keys and notes in markdown and RST- readers: The Reference data structure from Text.Pandoc.Shared is no- longer needed, since referenceKey and noteBlock parses return strings- (as many blank lines as were occupied by the key or note) and update- state themselves. getPosition and setPosition are now used to ensure- that error messages will give the correct line number. This yields- cleaner (and slightly faster) code, with more accurate parsing error- messages.-- * Added new Math inline element:-- + Markdown and LaTeX readers now convert TeX math into Math elements,- not TeX.- + This allows math to be treated differently from raw TeX in output.- TeX elements are no longer printed in output formats other than- Markdown, LaTeX, and ConTeXt. But Math elements are always printed.-- * New default handling of math in writers:-- + New module Text.Pandoc.Readers.TeXMath exports readTeXMath, which- parses raw TeX math and outputs a string of Pandoc inlines that- tries to render it as far as possible using unicode characters,- lapsing into literal TeX when needed.- + readTeXMath is now used for default HTML output in HTML, S5, RTF,- and Docbook, if no other method for displaying math in HTML is- specified. Enclosing $'s are no longer printed by default.- + By default, math is put inside `<span class="math">`. This way it can be- distinguished from the surrounding text, e.g. put in a different- font.-- * New --gladtex and --mimetex options for display of math in HTML:-- + If --gladtex is specified, math is output between `<eq>` tags, so- it can be processed by gladTeX.- + If --mimetex is specified, math is put in `<img>` tags with a link- to the mimetex CGI script (or any other script that takes TeX math- as input and outputs an image). The URL of the script may be- specified, but defaults to /cgi-bin/mimetex.cgi.- + HTMLMathMethod structure in WriterOptions keeps track of how to- display math in HTML output.- + Updated README with a description of the four options for displaying- math in HTML.-- * HTML reader:-- + Fixed bug: parser for minimized attributes should not swallow- trailing spaces.- + Simplified HTML attribute parsing.- + Changed parsing of code blocks in HTML reader: `<code>` tag is no- longer needed. `<pre>` suffices. All HTML tags in the code block- (e.g. for syntax highlighting) are skipped, because they are not- portable to other output formats. A `<code>...</code>` block not- surrounded by `<pre>` now counts as inline HTML, not a code block.- + Remove just one leading and one trailing newline from contents of- `<pre>...</pre>` in codeBlock parser.-- * Markdown reader:-- + Removed support for box-style block quotes.- + Require space before title in links and references.- This fixes a bug in parsing URLs like http://silly/url(withparen).- + Improved and simplified setextHeader parser.- + Fixed logic in smart quote parsing, adding some needed 'try'- statements.- + Fixed smart quote parsing so that unicode characters 8216 and 8217- are recognized as single quotes, and 8220 and 8221 as double quotes.-- * RST reader:-- + Fixed bug in parsing of code blocks. Previously a full tab indent- was required, but RST allows code to be indented any amount.- Resolves Issue #27.- + Allow field lists to be indented.- + Parse the contents of field lists instead of treating as a raw string.- + Represent field lists as definition lists instead of blockquotes.- + Fixed bug in which metadata would be overridden if the document- contained multiple field lists.- + Parse fields associated with '.. image::' blocks, and use 'alt'- field, if given, for image alt and title attributes.-- * LaTeX reader:-- + Modified specialChar so that '"' characters are parsed.- + Fixed a bug in parsing of \[ \] math blocks (thanks to Mark Kalderon).-- * HTML writer:-- + Changes in handling of math (see above).- + Don't produce HTML for table of contents if there are- no headers. (This would be an empty list, which is invalid XHTML.)-- * Markdown writer:-- + Don't print title attribute if title is empty. (This differs from- the behavior of Markdown.pl, and agrees with PHP Markdown. But John- Gruber has indicated that he prefers this behavior.) Adjusted test- suite accordingly.- + Fixed incorrect line wrapping in paragraphs including hard line- breaks. Resolves Issue #25.- + Fixed bug in markdown writer: If an ordered list item began with- a marker greater than 3 characters in width, and the item took more- than one line, it would appear on the line after the list marker,- e.g.:-- (12)- My list item.- Multiline.-- Now it works as follows:-- (12) My list item.- Multiline.-- * RST writer-- + Fixed bug in RST writer's handling of ordered lists. Previously,- list items with multiple lines would not always line up with- single-line list items. Now, list items are nested the length of- the list marker + 1. This looks better and ensures that list items- all line up. (Note that list markers are padded to the length of- the longest list marker in the series.)- + Use 3-space indent for unordered lists.- + If label for a link reference contains a colon, surround it by `- signs so it won't be interpreted as the end of the link label.-- * LaTeX writer:-- + Cleaner output for footnotes. Footnotes now always begin on a new- line, and the final } is on a line by itself only when it needs to- be (i.e. only when the note ends with a Verbatim environment).- + Added writer options to state, so state doesn't need to be passed as- a parameter.- + Text wrapping now provided, using wrapTeXIfNeeded.-- * ConTeXt writer: many improvements for more idiomatic ConTeXt output- (thanks to Idris Samawi Hamid for suggestions).-- + PrettyPrint module now used for output.- + Writer options are now in state, so they don't have to be passed as- a parameter.- + Text wrapping now provided, using wrapTeXIfNeeded.- + Better treatment of footnotes: footnotes are always on lines by- themselves, and the final } is on a line by itself only when- it needs to be (after \stoptyping).- + Use \subject, \subsubject, ... or \section, \subsection, ... for headings,- depending on whether --number-sections option is selected.- + Extra blank line inserted after \stopitemize- + Use new, "official" definition of blockquote environment. Also, use- blank line after \startblockquote to balance blank line at the end.- + Both itemized and enumerated lists are now generated using- \start-stopitemize, with appropriate options. Removed definitions- of ltxenum and ltxitem, which are no longer needed. Provided- defaults for itemized lists in the preamble. State keeps track of- ordered list level, so that when default numbering is specified,- the appropriate scheme can be used.- + Changed \useurl to \useURL.- + Changed link color from red to blue.- + Use \subsubsubsubsection etc., since these are supported- (up to at least sub x 5).-- * Text.Pandoc.Shared:-- + Save and restore position in parseFromString, so that accurate- error messages can be given.- + Improved efficiency of romanNumeral parser.- + Added wrappedTeX and wrapTeXIfNeeded functions. These ensure- that footnotes occur on lines by themselves (to make them- easier to see and move) and do not screw up line wrapping.-- * Text.Pandoc.UTF8: modified fromUTF8 to strip out the BOM- if present. Windows Notepad and other applications insert a- BOM at the beginning of a UTF8 file.-- * Main.hs (tabFilter): Treat '\r' at end of line as newline (in- addition to "\r\n" and '\n').-- * Added a writer option for wrapped text and a command-line option- '--no-wrap', which disables text wrapping and minimizes whitespace- in HTML. (Resolves Issue #26.)-- + Added support for '--no-wrap' to Main.hs.- + Added wrapIfNeeded function to Text.Pandoc.Shared.- + Use wrapIfNeeded instead of wrapped in the RST, Man, Docbook, and- Markdown writers.- + Added render and renderFragment helpers to HTML writer.-- * Modified html2markdown to run tidy only if the HTML cannot be- parsed. Previously html2markdown piped all input through tidy- before passing it to pandoc. This caused problems on certain pages- (e.g. http://daringfireball.com/markdown) which have well-formed- XHTML that causes tidy to choke. The solution is to pipe through- tidy only if pandoc cannot parse the input by itself. This means- that a temp file is now always used, even when input comes from a- local file or standard input.-- * Removed 'version' constant from Main.hs; added 'pandocVersion' to- Text.Pandoc library.-- * pandoc.cabal:-- + Modified to work with GHC 6.8 and Cabal configurations. (For GHC- 6.8, pretty and containers must be added to Build-Depends, and it- is desirable to use the -O2 compiler option.) Cabal configurations- allows one to select options depending on the compiler version.- For GHC 6.6, the splitBase option can be disabled.- + pandoc.cabal.ghc66 is provided for users with older versions of- Cabal, which do not support configurations.- + Use Ghc-Prof-Options to ensure that '-auto-all' is used when- '--enable-(executable|library)-profiling' is specified. Updated- PROFILING instructions accordingly.-- * Makefile:-- + Makefile now checks GHC version. If GHC is 6.6, pandoc.cabal.ghc66- is copied to pandoc.cabal, and the old pandoc.cabal is copied- to pandoc.cabal.orig. Otherwise, pandoc.cabal is copied to- pandoc.cabal.orig but otherwise unmodified. This way, the Makefile- will work properly with either GHC 6.6 or 6.8.- + Changed BUILDCONF to point to dist/setup-config, not .setup-config.- This is where current versions of Cabal put it.- + Added $(BUILDCMD) target, so setup doesn't get compiled every time.- + Removed dependency of templates on ./templates, which is circular- now that templates is a subdirectory of the top-level.-- * MacPorts Portfile:-- + Modified to install the pandoc library in addition to programs.- + Installation must be done manually rather than using Makefile's- install-all.- + Note that the library must be registered in the activate phase,- after the library files have been copied out of the destroot.- Cabal generates a 'register.sh' script that will do this.-- * debian/control: Added libghc6-network-dev, libghc6-xhtml-dev, and- libghc6-mtl-dev as dependencies for libghc6-pandoc-dev.- Closes: #445235-- * debian/rules: Converted to UTF-8.-- * Changed pandoc home page to http://johnmacfarlane.net/pandoc/.-- * Updated ASCIIMathML.js to latest version.-- * Directory structure:-- + Moved everything from src into the top-level directory.- + Changed references to source directory in Makefile and- pandoc.cabal.*.- + Moved ASCIIMathML.js, headers, and ui into templates directory.- + Modified fillTemplates.pl to reflect new paths.-- [ Recai Oktaş ]-- * Makefile: Fixed the issue of having two copies of the library- documentation under some usage scenarios.-- * Replaced 'ghc' with '$(GHC)' in Makefile, and made GHC- and GHC_PKG configurable through the environment, to support- unusual ghc installations. For example:- GHC=/opt/ghc/bin/ghc GHC_PKG=/opt/ghc/bin/ghc-pkg make-- -- Recai Oktaş <roktas@debian.org> Sun, 07 Oct 2007 20:51:43 +0300--pandoc (0.44) unstable; urgency=low-- [ John MacFarlane ]-- * Fixed bug in HTML writer: when --toc was used, anchors were put around- headers, which is invalid XHTML (block content within inline element).- Now the anchors are put inside the header tags. Resolves Issue #23.-- * Added xmlns attribute to html element in html writer tests.- This attribute is added by more recent versions of the- xhtml library (>= 3000), and is required for valid XHTML.-- [ Recai Oktaş ]-- * On configure, compile 'Setup.hs' to 'setup' and use 'setup' as the build- command instead of 'runhaskell', which, on some platforms (such as s390,- alpha, m68k), throws the following error:-- runhaskell Setup.hs configure --prefix=/usr- ghc-6.6.1: not built for interactive use-- This causes a serious FTBFS bug. Closes: #440668.-- -- Recai Oktaş <roktas@debian.org> Mon, 03 Sep 2007 18:24:02 +0300--pandoc (0.43) unstable; urgency=low-- [ John MacFarlane ]-- * The focus of this release is performance. The markdown parser- is about five times faster than in 0.42, based on benchmarks- with the TextMate manual.-- * Main.hs: Replaced CRFilter and tabFilter with single function- tabFilter, which operates on the whole string rather than breaking- it into lines, and handles dos-style line-endings as well as tabs.-- * Added separate LaTeX reader and native reader tests; removed- round-trip tests.-- * Text.Pandoc.Shared:-- + Removed tabsToSpaces and tabsInLine (they were used only in Main.hs.)- + General code cleanup (to elimante warnings when compiling with -Wall.)- + Added 'wrapped' function, which helps wrap text into paragraphs,- using the prettyprinting library.- + Rewrote charsInBalanced and charsInBalanced'.- - Documented restriction: open and close must be distinct characters.- - Rearranged options for greater efficiency.- - Bug fix: Changed inner call to charsInBalanced inside- charsInBalanced' to charsInBalanced'.- + anyLine now requires that the line end with a newline (not eof).- This is a harmless assumption, since we always add newlines to the- end of a block before parsing with anyLine, and it yields a 10% speed- boost.- + Removed unnecessary 'try' in anyLine.- + Removed unneeded 'try' from romanNumeral parser.- + Use notFollowedBy instead of notFollowedBy' in charsInBalanced.- + Removed unneeded 'try' in parseFromString.- + Removed unneeded 'try' from stringAnyCase. (Now it behaves- like 'string'.)- + Changed definition of 'enclosed' in Text.Pandoc.Shared so that- 'try' is not automatically applied to the 'end' parser. Added- 'try' in calls to 'enclosed' where needed. Slight speed increase.-- * Writers:-- + Replaced individual wrapping routines in RST, Man, and Markdown- writers with 'wrapped' from Text.Pandoc.Shared.- + Rewrote LaTeX writer to use the prettyprinting library,- so we get word wrapping, etc.- + Modified latex writer tests for new latex writer using prettyprinter.- + Fixed bug in LaTeX writer: autolinks would not cause- '\usepackage{url}' to be put in the document header. Also, changes- to state in enumerated list items would be overwritten.- + In Markdown writer, escape paragraphs that begin with ordered list- markers, so they don't get interpreted as ordered lists.-- * Text.Pandoc.Reades.LaTeX:-- + Fixed bug in LaTeX reader, which wrongly assumed that the roman- numeral after "enum" in "setcounter" would consist entirely of- "i"s. 'enumiv' is legitimate.- + LaTeX command and environment names can't contain numbers.- + Rearranged order of parsers in inline for slight speed improvement.- + Added '`' to special characters and 'unescapedChar'.-- * Text.Pandoc.Readers.RST:-- + Removed unneeded try's in RST reader; also minor code cleanup.- + Removed tabchar.- + Rearranged parsers in inline (doubled speed).-- * Text.Pandoc.Readers.Markdown:-- + Skip notes parsing if running in strict mode. (This yields a nice- speed improvement in strict mode.)- + Simplify autolink parsing code, using Network.URI to test for- URIs. Added dependency on network library to debian/control and- pandoc.cabal.- + More perspicuous definition of nonindentSpaces.- + Removed unneeded 'try' in 'rawLine'.- + Combined linebreak and whitespace into a new whitespace parser, to- avoid unnecessary reparsing of space characters.- + Removed unnecessary 'try' in 'codeBlock', 'ellipses', 'noteMarker',- 'multilineRow', 'dashedLine', 'rawHtmlBlocks'.- + Use lookAhead in parsers for setext headers and definition lists- to see if the next line begins appropriately; if not, don't waste- any more time parsing.- + Don't require blank lines after code block. (It's sufficient to- end code block with a nonindented line.)- + Changed definition of 'emph': italics with '_' must not- be followed by an alphanumeric character. This is to help- prevent interpretation of e.g. `[LC_TYPE]: my_type` as- `[LC<em>TYPE]:my</em>type`.- + Improved Markdown.pl-compatibility in referenceLink: the two parts- of a reference-style link may be separated by one space, but not- more... [a] [link], [not] [a link].- + Fixed markdown inline code parsing so it better accords with- Markdown.pl: the marker for the end of the code section is a clump- of the same number of `'s with which the section began, followed- by a non-` character. So, for example,- ` h ``` i ` -> `<code>h ``` i</code>`.- + Split 'title' into 'linkTitle' and 'referenceTitle', since the- rules are slightly different.- + Rewrote 'para' for greater efficiency.- + Rewrote link parsers for greater efficiency.- + Removed redundant 'referenceLink' in definition of inline (it's- already in 'link').- + Refactored escapeChar so it doesn't need 'try'.- + Refactored hrule for performance in Markdown reader.- + More intelligent rearranging of 'inline' so that most frequently- used parsers are tried first.- + Removed tabchar parser, as whitespace handles tabs anyway.-- * Text.Pandoc.CharacterReferences:-- + Refactored.- + Removed unnecessary 'try's for a speed improvement.- + Removed unnecessary '&' and ';' from the entity table.-- * Build process:-- + Makefile: Get VERSION from cabal file, not Main.hs.- + Modified MacPorts Portfile:- - Depend on haddock- - Build and install libraries and library documentation in- addition to pandoc executable- - Added template item for md5 sum in Portfile.in.- - Incorporated changes from MacPorts repository (r28278).- + FreeBSD port: Don't try to generate distinfo in Makefile.- It can be made using 'make makesum' in FreeBSD.- + Make both freebsd and macports targets depend on tarball.-- * Website and documentation:-- + Updated INSTALL instructions.- + Added pandocwiki demo to website.- + Removed local references to Portfile, since pandoc is now in the- MacPorts repository.-- -- Recai Oktaş <roktas@debian.org> Sun, 02 Sep 2007 15:50:11 +0300--pandoc (0.42) unstable; urgency=low-- [ John MacFarlane ]-- * Main.hs: Use utf8 conversion on the extra files loaded with- the -H, -C, -B, and -A options. This fixes problems with unicode- characters in these files.-- * Exposed Text.Pandoc.ASCIIMathML, since it is imported in- Text.Pandoc.Readers.HTML and without it we get a linking error when- using the library.-- * Markdown reader:-- + Added new rule for enhanced markdown ordered lists: if the list- marker is a capital letter followed by a period (including a- single-letter capital roman numeral), then it must be followed by- at least two spaces. The point of this is to avoid accidentally- treating people's initials as list markers: a paragraph might begin,- "B. Russell was an English philosopher," and this shouldn't be- treated as a list. Documented change in README.- + Blocks that start with "p. " and a digit are no longer treated- as ordered lists (it's a page number).- + Added a needed 'try' to listItem.- + Removed check for a following setext header in endline.- A full test is too inefficient (doubles benchmark time), and the- substitute we had before is not 100% accurate.- + Don't use Code elements for autolinks if --strict specified.-- * LaTeX writer: When a footnote ends with a Verbatim environment, the- close } of the footnote cannot occur on the same line or an error occurs.- Fixed this by adding a newline before the closing } of every footnote.-- * HTML writer:- + Removed incorrect "{}" around style information in HTML tables.- Column widths now work properly in HTML.- + If --strict option is specified (and --toc is not), don't include- identifiers in headers, for better Markdown compatibility.-- * Build process:-- + Separated $(web_dest) and website targets.- + In website, index.txt is now constructed from template index.txt.in.- + Added freebsd target to Markefile. This creates the freebsd Makefile- from Makefile.in, and creates distinfo. Removed Makefile and distinfo- from the repository.- + Added macport target to Makefile. Portfile is built from template- Portfile.in.- + Removed OSX package targets. (Too many difficulties involving- dependencies on dynamic libraries.)- + More complete INSTALL instructions for all architectures.-- * Website:- + Added a programming demo, pandocwiki.-- [ Recai Oktaş ]-- * Do not forget to close pandoc's ITP. Closes: #391666-- -- Recai Oktaş <roktas@debian.org> Sun, 26 Aug 2007 22:51:32 +0300--pandoc (0.41) unstable; urgency=low-- [ John MacFarlane ]-- * Fixed bugs in HTML reader:- + Skip material at end *only if* `</html>` is present (previously,- only part of the document would be parsed if an error was- found; now a proper error message is given).- + Added new constant eitherBlockOrInline with elements that may- count either as block-level or as inline. Modified isInline and- isBlock to take this into account.- + Modified rawHtmlBlock to accept any tag (even an inline tag):- this is innocuous, because rawHtmlBlock is tried only if a regular- inline element can't be parsed.- + Added a necessary 'try' in definition of 'para'.-- * Fixed bug in markdown ordered list parsing. The problem was that- anyOrderedListStart did not check for a space following the- ordered list marker. So in 'A.B. 2007' the parser would be- expecting a list item, but would not find one, causing an error.- Fixed a similar bug in the RST reader. Resolves Issue #22.-- * Refactored RST and Markdown readers using parseFromString.-- * LaTeX reader will now skip anything after \end{document}.-- * Fixed blockquote output in markdown writer: previously, block- quotes in indented contexts would be indented only in the first- line.-- * Added note to INSTALL about variations in versions of the xhtml- library that can lead to failed tests (thanks to Leif LeBaron).-- -- Recai Oktaş <roktas@debian.org> Sun, 19 Aug 2007 23:26:07 +0300--pandoc (0.4) unstable; urgency=low-- [ John MacFarlane ]-- * Added two new output formats: groff man pages and ConTeXt. By- default, output files with extensions ".ctx" and ".context" are- assumed to be ConTeXt, and output files with single-digit extensions- are assumed to be man pages.-- * Enhanced ordered lists (documented in README, under Lists):- + The OrderedList block element now stores information about- list number style, list number delimiter, and starting number.- + The readers parse this information when possible.- + The writers use this information to style ordered lists.- + The enhancement can be disabled using the --strict option.-- * Added support for tables (with a new Table block element). Two kinds- of tables are supported: a simple table with one-line rows, and a- more complex variety with multiline rows. All output formats are- supported, but only markdown tables are parsed at the moment. The- syntax is documented in README.-- * Added support for definition lists (with a new DefinitionList block- element). All output and input formats are supported. The syntax is- documented in README.-- * Added support for superscripts and subscripts (with new Superscript- and Subscript inline elements). All input and output- formats. The syntax is documented in README.-- * Added support for strikeout (with a new Strikeout inline element).- All input and output formats are supported. Thanks to Bradley Kuhn,- who contributed a patch. The syntax is documented in README. Resolves- Issue #18.-- * Added a --toc|--table-of-contents option. This causes an automatically- generated table of contents (or an instruction that creates one) to- be inserted at the beginning of the document. Not supported in S5,- DocBook, or man page writers.-- * Modified the -m|--asciimathml option:-- + If an optional URL argument is provided, a link is inserted- instead of the contents of the ASCIIMathML.js script.- + Nothing is inserted unless the document actually contains- LaTeX math.-- * Removed Blank block element as unnecessary.-- * Removed Key and Note blocks from the Pandoc data structure. All- links are now stored as explicit links, and note contents are- stored with the (inline) notes.-- + All link Targets are now explicit (URL, title) pairs; there- is no longer a 'Ref' target.- + Markdown and RST parsers now need to extract data from key and- note blocks and insert them into the relevant inline elements.- Other parsers have been simplified, since there is no longer any need- to construct separate key and note blocks.- + Markdown, RST, and HTML writers need to construct lists of- notes; Markdown and RST writers need to construct lists of link- references (when the --reference-links option is specified); and- the RST writer needs to construct a list of image substitution- references. All writers have been rewritten to use the State monad- when state is required.- + Several functions (generateReference, keyTable,- replaceReferenceLinks, replaceRefLinksBlockList, and some auxiliaries- used by them) have been removed from Text.Pandoc.Shared, since- they are no longer needed. New functions and data structures- (Reference, isNoteBlock, isKeyBlock, isLineClump) have been- added. The functions inTags, selfClosingTag, inTagsSimple, and- inTagsIndented have been moved to the DocBook writer, since that- is now the only module that uses them. NoteTable is now exported- in Text.Pandoc.Shared.- + Added stateKeys and stateNotes to ParserState; removed stateKeyBlocks,- stateKeysUsed, stateNoteBlocks, stateNoteIdentifiers, stateInlineLinks.- + Added writerNotes and writerReferenceLinks to WriterOptions.-- * Added Text.Pandoc module that exports basic readers, writers,- definitions, and utility functions. This should export everything- needed for most uses of Pandoc libraries. The haddock documentation- includes a short example program.-- * Text.Pandoc.ASCIIMathML is no longer an exported module.-- * Added Text.Pandoc.Blocks module to help in printing markdown- and RST tables. This module provides functions for working with- fixed-width blocks of text--e.g., placing them side by side, as- in a table row.-- * Refactored to avoid reliance on Haskell's Text.Regex library, which- (a) is slow, and (b) does not properly handle unicode. This fixed- some strange bugs, e.g. in parsing S-cedilla, and improved performance.-- + Replaced 'gsub' with a general list function 'substitute'- that does not rely on Text.Regex.- + Rewrote extractTagType in HTML reader so that it doesn't use- regexs.- + In Markdown reader, replaced email regex test with a custom email- autolink parser (autoLinkEmail). Also replaced selfClosingTag regex- with a custom function isSelfClosingTag.- + Modified Docbook writer so that it doesn't rely on Text.Regex for- detecting 'mailto' links.- + Removed escapePreservingRegex and reamped entity-handling- functions in Text.Pandoc.Shared and Text.Pandoc.CharacterReferences to- avoid reliance on Text.Regex (see below on character reference- handling changes).-- * Renamed Text.Pandoc.Entities as Text.Pandoc.CharacterReferences.-- * Changed handling of XML entities. Entities are now parsed (and unicode- characters returned) in the Markdown and HTML readers, rather than being- handled in the writers. In HTML and Docbook writers, UTF-8 is now used- instead of entities for characters above 128. This makes the HTML and- DocBook output much more readable and more easily editable.-- + Removed sgmlHexEntity, sgmlDecimalEntity, sgmlNamedEntity, and- sgmlCharacterEntity regexes from Text.Pandoc.Shared.- + Renamed escapeSGMLChar to escapeCharForXML. Added escapeStringForXML.- Moved both functions to Text.Pandoc.Writers.Docbook.- + Added characterReference parser to Text.Pandoc.CharacterReferences.- This parses a string and return a unicode character.- + Rewrote decodeCharacterReferences to use the new parser instead of- Text.Regex.- + Added new charRef parser for Markdown and HTML, which replaces the- old 'entity' parser. Added '&' as a special character in Markdown reader.- + Modified HTML and Markdown readers to call decodeEntities on all raw- strings (e.g. authors, dates, link titles), to ensure that no- unprocessed entities are included in the native representation of- the document. (In the HTML reader, most of this work is done by a- change in extractAttributeName.)- + In XML and Markdown output, escape unicode nonbreaking space as ' ',- since a unicode non-breaking space is impossible to distinguish visually- from a regular space. (Resolves Issue #3.)- + Removed encodeEntitiesNumerical.- + Use Data.Map for entityTable and (new) reverseEntityTable, for a- slight performance boost over the old association list.- + Removed unneeded decodeEntities from 'str' parser in HTML and- Markdown readers.-- * Text.Pandoc.UTF8: Renamed encodeUTF8 to toUTF8, decodeUTF8 to- fromUTF8, for clarity.-- * Replaced old haskell98 module names replaced by hierarchical module- names, e.g. List by Data.List. Removed haskell98 from dependencies- in pandoc.cabal, and added mtl (needed for state monad). Substituted- xhtml for html.-- * Refactored and cleaned up character escaping in writers, using- backslashEscapes and escapeStringUsing functions.-- * Instead of adding "\n\n" to the end of an input string in Main.hs,- this is now done in the readers. This makes the libraries behave- the way you'd expect from the pandoc program. Resolves Issue #10.-- * URLs and email addresses in autolinks are now typeset as Code.-- * In Main.hs, changed putStr to putStrLn -- mainly because MacOS X- doesn't display the whole output unless there's a line ending.-- * Major code cleanup in all modules, for greater consistency, concision,- and readability.-- * HTML reader:-- + Fixed several bugs (extractTagType, attribute parsing).- + Remove Null blocks in lists of blocks when possible.- + Allow HTML comments as raw HTML inline.-- * Markdown reader:-- + Ordered list items may no longer begin with uppercase letters, or- letters greater than 'n'. (This prevents first initials and page- reference, e.g. 'p. 400', from being parsed as beginning lists.)- Also, numbers beginning list items may no longer end with ')',- which is now allowed only after letters. Note: These changes- may cause documents to be parsed differently. Users should take- care in upgrading.- + Changed autoLink parsing to conform better to Markdown.pl's- behavior. `<google.com>` is not treated as a link, but- `<http://google.com>`, `<ftp://google.com>`, and- `<mailto:google@google.com>` are.- + Cleaned up handling of embedded quotes in link titles. Now these are- stored as a '"' character, not as '"'.- + Use lookAhead parser for the 'first pass' (looking for reference keys),- instead of parsing normally, then using setInput to reset input. This- yields a slight performance boost.- + Fixed several bugs in smart quote recognition.- + Fixed bug in indentSpaces (which didn't properly handle- cases with mixed spaces and tabs).- + Consolidated 'text', 'special', and 'inline' into 'inline'.- + Fixed bug which allowed URL and title to be separated by multiple blank- lines in links and reference keys. They can be on separate lines but- can't have blank lines between them.- + Correctly handle bracketed text inside inline footnotes and links,using- new function inlinesInBalanced. Resolves Issue #14.- + Fixed bug in footnotes: links in footnotes were not being- processed. Solution: three-stage parse. First, get all the- reference keys and add information to state. Next, get all the- notes and add information to state. (Reference keys may be needed- at this stage.) Finally, parse everything else.- + Replaced named constants like 'emphStart' with literals.- + Removed an extra occurance of escapedChar in definition of inline.-- * RST reader:-- + Allow the URI in a RST hyperlink target to start on the line- after the reference key.- + Added 'try' in front of 'string', where needed, or used a different- parser. This fixes a bug where ````` would not be correctly parsed as- a verbatim `.- + Fixed slow performance in parsing inline literals in RST reader. The- problem was that ``#`` was seen by 'inline' as a potential link or image.- Fix: inserted 'notFollowedBy (char '`')' in link parsers.- Resolves Issue #8.- + Use lookAhead instead of getInput/setInput in RST reader. Removed- unneeded getState call, since lookAhead automatically saves and- restores the parser state.- + Allow hyperlink target URIs to be split over multiple lines, and- to start on the line after the reference. Resolves Issue #7.- + Fixed handling of autolinks.-- * LaTeX reader:-- + Replaced 'choice [(try (string ...), ...]' idiom with 'oneOfStrings',- for clarity.- + Added clauses for tilde and caret. Tilde is \ensuremath{\sim}, and- caret is \^{}, not \^ as before.- + Added parsing for \url.- + Parse \texttt{} as code, provided there's nothing fancy inside.-- * HTML writer:-- + Modified HTML writer to use the Text.XHtml library. This results- in cleaner, faster code, and it makes it easier to use Pandoc in- other projects, like wikis, which use Text.XHtml. Two functions are- now provided, writeHtml and writeHtmlString: the former outputs an- Html structure, the latter a rendered string. The S5 writer is also- changed, in parallel ways (writeS5, writeS5String).- + The Html header is now written programmatically, so it has been- removed from the 'headers' directory. The S5 header is still- needed, but the doctype and some of the meta declarations have- been removed, since they are written programatically. This change- introduces a new dependency on the xhtml package.- + Fixed two bugs in email obfuscation involving improper escaping- of '&' in the `<noscript>` section and in `--strict` mode. Resolves- Issue #9.- + Fixed another bug in email obfuscation: If the text to be obfuscated- contains an entity, this needs to be decoded before obfuscation.- Thanks to thsutton for the patch. Resolves Issue #15.- + Changed the way the backlink is displayed in HTML footnotes.- Instead of appearing on a line by itself, it now generally- appears on the last line of the note. (Exception: when the- note does not end with a Plain or Para block.) This saves space- and looks better.- + Added automatic unique identifiers to headers:- - The identifier is derived from the header via a scheme- documented in README.- - WriterState now includes a list of header identifiers and a table- of contents in addition to notes.- - The function uniqueIdentifiers creates a list of unique identifiers- from a list of inline lists (e.g. headers).- - This list is part of WriterState and gets consumed by blockToHtml- each time a header is encountered.- + Include CSS for .strikethrough class in header only if strikethrough- text appears in the document.- + If the 'strict' option is specified, elements that do not appear in- standard markdown (like definition lists) are passed through as- raw HTML.- + Simplified treatment of autolinks, using pattern matching instead of- conditionals.-- * Markdown writer:-- + Links in markdown output are now printed as inline links by default,- rather than reference links. A --reference-links option has been added- that forces links to be printed as reference links. Resolves Issue #4.- + Use autolinks when possible. Instead of `[site.com](site.com)`,- use `<site.com>`.-- * LaTeX writer:-- + Rewrote to use the State monad. The preamble now includes only those- packages that are actually required, given the document's content.- Thus, for example, if strikeout is not used, ulem is not required.- Modified LaTeXHeader accordingly.- + Modified LaTeX writer to insert '\,' between consecutive quotes.- + Removed unused function tableRowColumnWidths.- + Simplified code for escaping special characters.- + Leave extra blank line after \maketitle.- + Include empty '\author{}' when no author specified to avoid LaTeX- errors.- + Include fancyvrb code in header only if needed -- that is, only- if there is actually code in a footnote.- + Use \url{} for autolinks.- + Include [mathletters] option in ucs package, so that basic unicode- Greek letters will work correctly.-- * RST writer: Force blank line before lists, so that sublists will- be handled correctly.-- * Docbook writer: Fixed a bug: email links with text, like- [foo](me@bar.baz), were being incorrectly treated as autolinks.-- * Removed Text.ParserCombinators.Pandoc and moved all its functions to- Text.Pandoc.Shared.-- * Text.Pandoc.Shared:-- + Added defaultWriterOptions.- + Added writerTableOfContents to WriterOptions.- + Added writerIgnoreNotes option to WriterOptions. This is needed- for processing header blocks for a table of contents, since notes on- headers should not appear in the TOC.- + Added prettyprinting for native Table format.- + Removed some unneeded imports.- + Moved escape and nullBlock parsers from- Text.ParserCombinators.Pandoc, since the latter is for- general-purpose parsers that don't depend on Text.Pandoc.Definition.- + Moved isHeaderBlock from Text.Pandoc.Writers.HTML.- + Moved Element, headerAtLeast, and hierarchicalize from Docbook- writer, because HTML writer now uses these in constructing a table- of contents.- + Added clauses for new inline elements (Strikeout, Superscript,- Subscript) to refsMatch.- + Removed backslashEscape; added new functions escapeStringUsing and- backslashEscapes.- + Moved failIfStrict from markdown reader, since it is now used also- by the HTML reader.- + Added a 'try' to the definition of indentSpaces.- + In definition of 'reference', added check to make sure it's not a note- reference.- + Added functions: camelCaseToHyphenated, toRomanNumeral,- anyOrderedListMarker, orderedListmarker, orderedListMarkers,- charsInBalanced', withHorizDisplacement, romanNumeral- + Fixed a bug in the anyLine parser. Previously it would parse an empty- string "", but it should fail on an empty string, or we get an error- when it is used inside "many" combinators.- + Removed followedBy' parser, replacing it with the lookAhead parser from- Parsec.- + Added some needed 'try's before multicharacter parsers, especially in- 'option' contexts.- + Removed the 'try' from the 'end' parser in 'enclosed', so that- 'enclosed' behaves like 'option', 'manyTill', etc.- + Added lineClump parser, which parses a raw line block up to and- including any following blank lines.- + Renamed parseFromStr to parseFromString.- + Added a 'try' to the 'end' parser in 'enclosed'. This makes errors in- the use of 'enclosed' less likely. Removed some now-unnecessary 'try's- in calling code.- + Removed unneeded 'try' in blanklines.- + Removed endsWith function and rewrote calling functions to use- isSuffixOf instead.- + Added >>~ combinator.- + Fixed bug in normalizeSpaces: Space:Str "":Space should compress to- Space.-- * Refactored runtests.pl; added separate tests for tables.-- * Shell scripts:-- + Added -asxhtml flag to tidy in html2markdown. This will- perhaps help the parser, which expects closing tags.- + Modified markdown2pdf to run pdflatex a second time if --toc or- --table-of-contents was specified; otherwise the table of- contents won't appear.- + Modified markdown2pdf to print a helpful message if the 'ulem'- LaTeX package is required and not found.-- * Changes to build process:-- + Dropped support for compilation with GHC 6.4. GHC 6.6 or higher- is now required.- + Removed cabalize and Pandoc.cabal.in. The repository now contains- pandoc.cabal itself.- + Pandoc.cabal has been changed to pandoc.cabal, because HackageDB- likes the cabal file to have the same name as the tarball.- + Expanded and revised the package description in pandoc.cabal.- Revised the package synopsis.- + The tarball built by 'make tarball' now contains files built from- templates (including man pages and shell scripts), so pandoc can- be built directly using Cabal tools, without preprocessing.- + Executable binaries are now stripped before installing.- + Man pages are now generated from markdown sources, using pandoc's- man page writer.- + Use HTML version of README (instead of RTF) in Mac OS X installer.- + Instead of testing for the existence of a pandoc symlink in build-exec,- use ln -f.-- * Documentation:-- + Updated README and man pages with information on new features.- + Updated INSTALL instructions with some useful clarifications and- links.- + Updated web content.-- * Added FreeBSD port.-- [ Recai Oktaş ]-- * debian/control:-- + Changed pandoc's Build-Depends to include libghc6-mtl-dev and- libghc6-xhtml-dev. Removed libghc6-html-dev.- + Suggest texlive-latex-recommended | tetex-extra instead of- tetex-bin. This brings in fancyvrb and unicode support.-- -- Recai Oktaş <roktas@debian.org> Tue, 16 Jan 2007 00:37:21 +0200--pandoc (0.3) unstable; urgency=low-- [ John MacFarlane ]-- * Changes in pandoc options:-- + Allow options to follow or precede arguments.- + Changed '--smartypants' to '--smart' and adjusted symbols accordingly.- + Added '--strict' option.- + Added '-o/--output' option.- + Added '--dump-args' and '--ignore-args' options (for use in wrappers).- + Modified '-v' and '-h' output to go to STDERR, not STDOUT, and return- error conditions. This is helpful for writing wrappers.- + Added copyright message to '-v' output, modeled after FSF messages.- + Reformatted usage message so that it doesn't wrap illegibly.- + Removed extra blanks after '-h' and '-D' output.-- * Added docbook writer.-- * Added implicit setting of default input and output format based- on input and output filename extensions. These defaults are- overridden if explicit input and output formats are specified using- '-t', '-f', '-r', or '-w' options. Documented in pandoc(1) man page- and README.-- * Allow ordered list items to begin with (single) letters, as well- as numbers. The list item marker may now be terminated either by- '.' or by ')'. This extension to standard markdown is documented- in README.-- * Revised footnote syntax. (See README for full details.) The- '[^1]' format now standard in markdown extensions is supported,- as are inline footnotes with this syntax: '^[My note.]'.- The earlier footnote syntax '^(1)' is no longer supported.-- * Improved HTML representation of footnotes. All footnotes- are now auto-numbered and appear in an ordered list at the- end of the HTML document. Since the default appearance is now- acceptable, the old footnote styles have been removed from the- HTML header.-- * Bug fixes:-- + Fixed a serious bug in the markdown, LaTeX, and RST readers.- These readers ran 'runParser' on processed chunks of text to handle- embedded block lists in lists and quotation blocks. But then- any changes made to the parser state in these chunks was lost,- as the state is local to the parser. So, for example, footnotes- didn't work in quotes or list items. The fix: instead of calling- runParser on some raw text, use setInput to make it the input, then- parse it, then use setInput to restore the input to what it was- before. This is shorter and more elegant, and it fixes the problem.- + Fixed bug in notFollowedBy' combinator (adding 'try' before- 'parser'). Adjusted code that uses this combinator accordingly.- + Fixed bug in RTF writer that caused improper indentation on- footnotes occurring in indented blocks like lists.- + Fixed parsing of metadata in LaTeX reader. Now the title, author,- and date are parsed correctly. Everything else in the preamble- is skipped.- + Modified escapedChar in LaTeX reader to allow a '\' at the end of a- line to count as escaped whitespace.- + Modified LaTeX reader to produce inline links rather than reference- links. Otherwise, links in footnotes aren't handled properly.- + Fixed handling of titles in links in Markdown reader, so that- embedded quotation marks are now handled properly.- + Fixed Markdown reader's handling of embedded brackets in links.- + Fixed Markdown reader so that it only parses bracketed material- as a reference link if there is actually a corresponding key.- + Revised inline code parsing in Markdown reader to conform to- markdown standard. Now any number of `s can begin inline code,- which will end with the same number of `s. For example, to- have two backticks as code, write ``` `` ```. Modified Markdown- writer accordingly.- + Fixed bug in text-wrapping routine in Markdown and RST writers.- Now LineBreaks no longer cause wrapping problems.- + Supported hexadecimal numerical entity references as well as- decimal ones.- + Fixed bug in Markdown reader's handling of underscores and other- inline formatting markers inside reference labels: for example,- in '[A_B]: /url/a_b', the material between underscores was being- parsed as emphasized inlines.- + Changed Markdown reader's handling of backslash escapes so that- only non-alphanumeric characters can be escaped. Strict mode- follows Markdown.pl in only allowing a select group of punctuation- characters to be escaped.- + Modified HTML reader to skip a newline following a `<br>` tag.- Otherwise the newline will be treated as a space at the beginning- of the next line.-- * Made handling of code blocks more consistent. Previously, some- readers allowed trailing newlines, while others stripped them.- Now, all readers strip trailing newlines in code blocks. Writers- insert a newline at the end of code blocks as needed.-- * Modified readers to make spacing at the end of output more consistent.-- * Minor improvements to LaTeX reader:-- + '\thanks' now treated like a footnote.- + Simplified parsing of LaTeX command arguments and options.- commandArgs now returns a list of arguments OR options (in- whatever order they appear). The brackets are included, and- a new stripFirstAndLast function is provided to strip them off- when needed. This fixes a problem in dealing with \newcommand- and \newenvironment.-- * Revised RTF writer:-- + Default font is now Helvetica.- + An '\f0' is added to each '\pard', so that font resizing works- correctly.-- * Moved handling of "smart typography" from the writers to the Markdown- and LaTeX readers. This allows great simplification of the writers- and more accurate smart quotes, dashes, and ellipses. DocBook can- now use `<quote>`. The '--smart' option now toggles an option in- the parser state rather than a writer option. Several new kinds- of inline elements have been added: Quoted, Ellipses, Apostrophe,- EmDash, EnDash.-- * Changes in HTML writer:-- + Include title block in header even when title is null.- + Made javascript obfuscation of emails even more obfuscatory,- by combining it with entity obfuscation.-- * Changed default ASCIIMathML text color to black.-- * Test suite:-- + Added --strip-trailing-cr option to diff in runtests.pl, for- compatibility with Windows.- + Added regression tests with footnotes in quote blocks and lists.-- * Makefile changes:-- + osx-pkg target creates a Mac OS X package (directory). New osx- directory contains files needed for construction of the package.- + osx-dmg target creates a compressed disk image containing the package.- + win-pkg target creates Windows binary package.- + tarball target creates distribution source tarball.- + website target generates pandoc's website automatically, including- demos. New 'web' directory containts files needed for construction- of the website (which will be created as the 'pandoc' subdirectory- of 'web').- + Makefile checks to see if we're running Windows/Cygwin; if so,- a '.exe' extension is added to each executable in EXECS.-- * Removed all wrappers except markdown2pdf and html2markdown.-- * Added new wrapper hsmarkdown, to be used as a drop-in replacement- for Markdown.pl. hsmarkdown calls pandoc with the '--strict'- option and disables other options.-- * Added code to html2markdown that tries to determine the character- encoding of an HTML file, by parsing the "Content-type" meta tag.-- + If the encoding can't be determined, then if the content is local,- the local encoding is used; if it comes from a URL, UTF-8 is used- by default.- + If input is from STDIN, don't try to determine character encoding.- + Encoding can be specified explicitly using '-e' option.-- * Improved warning messages in wrappers:-- + Print warning if iconv not available- + More user-friendly error messages in markdown2pdf, when- pdflatex fails.-- * Code cleanup:-- + Renamed 'Text/Pandoc/HtmlEntities' module to- 'Text/Pandoc/Entities'. Also changed function names so as- not to be HTML-specific.- + Refactored SGML string escaping functions from HTML and Docbook- writers into Text/Pandoc/Shared. (escapeSGML, stringToSGML)- + Removed 'BlockQuoteContext' from ParserContext, as it isn't- used anywhere.- + Removed splitBySpace and replaced it with a general, polymorphic- splitBy function.- + Refactored LaTeX reader for clarity (added isArg function).- + Converted some CR's to LF's in src/ui/default/print.css.- + Added license text to top of source files.- + Added module data for haddock to source files.- + Reformatted code for consistency.-- * Rewrote documentation and man pages. Split README into INSTALL- and README.-- * Split LICENSE into COPYING and COPYRIGHT.-- * Removed TODO, since we now maintain ToDo on the wiki.-- * Made COPYRIGHT in top level a symlink to debian/copyright, to avoid- duplication.-- [ Recai Oktaş ]-- * Revamped build process to conform to debian standards and created- a proper debian package. Closes: #391666.-- * Modified build process to support GHC 6.6.-- + The package can still be compiled using GHC 6.4.2, though because- of dependencies the "make deb" target works only with GHC 6.6+.- + The script 'cabalize' is used to create an appropriate- 'Pandoc.cabal' from 'Pandoc.cabal.in', depending on the GHC and- Cabal versions.-- * Refactored template processing (fillTemplates.pl).-- * Modified wrapper scripts to make them more robust and portable.- To avoid code duplication and ensure consistency, wrappers are- generated via a templating system from templates in src/wrappers.-- + Wrappers now accept multiple filenames, when appropriate.- + Spaces and tabs allowed in filenames.- + getopts shell builtin is used for portable option parsing.- + Improved html2markdown's web grabber code, making it more robust,- configurable and verbose. Added '-e', '-g' options.-- -- Recai Oktaş <roktas@debian.org> Fri, 05 Jan 2007 09:41:19 +0200--pandoc (0.2) unstable; urgency=low-- * Fixed unicode/utf-8 translation-- -- John MacFarlane <jgm@berkeley.edu> Mon, 14 Aug 2006 00:00:00 -0400--pandoc (0.1) unstable; urgency=low-- * Initial creation of debian package-- -- John MacFarlane <jgm@berkeley.edu> Mon, 14 Aug 2006 00:00:00 -0400
@@ -0,0 +1,29619 @@+# Revision history for pandoc++## pandoc 3.10 (2026-06-03)++ * Add `--typst-input` CLI option (#11588). This allows one to+ pass parameters to typst, which are available at `sys.inputs`,+ just as `typst` itself does with its `--input` option.++ * Avoid trailing spaces in `--help` output (#11623).++ * Make groff the default pdf-engine for `ms` output (#11558).+ Formerly it was pdfroff.++ * Set default User-Agent request header to `pandoc/VERSION`.+ This can be overridden using the `--request-header` option.++ * Markdown reader:++ + Allow grid tables to be indented (#11671, Johan Larsson). Like+ the other table syntaxes (pipe, simple, and multiline tables)+ and block-level constructs generally, a grid table may now be+ indented by up to three spaces and still be recognized as a+ table. Previously the grid-table parser required the table to+ begin at the left margin, so an indented grid table was parsed+ as a paragraph.+ + Fix calculation of column widths for default columns in grid tables+ (#11664). This fixes a bug which produced too-narrow columns in some+ cases.+ + Don't produce empty Raw element with `--strip-comments` (#11625).+ + Fix quotes in inline notes (#11613, Andrew Dunning).+ + Allow spaces inside attributes in super/sub (#11589).+ + Simplify `checkNotes`, remove dead code+ + Various small performance optimizations.++ * HTML reader:++ + Parse aside as a Div with class "aside" (instead of using+ raw HTML) (#11626).+ + Add "header" class to Divs created from headers.++ * Docx reader:++ + Fix bug in bitmask checking (#8299). This led to some table rows+ being wrongly considered header rows.+ + Improve treatment of `tblHeader` element (#8299).+ If `tblHeader` exists but has `w:val="0"`, then don't consider+ the element a header.+ + With `citations` extension, prefer `citation-key` as the key for+ item data, if it is defined (#11581; cf. #10366, #11567). The `id` key+ used by Zotero is not exposed by their API and is generally not what+ is wanted when converting to biblatex.+ + Don't look to `ext` tags for image extent (#11580).+ This reverts a change from 7ff1b798c4e6681ef9050899442d80883116573a.+ The change was mistaken and could cause images to be parsed with+ the wrong sizes.++ * Man reader:++ + Support `auto_identifiers`, `gfm_auto_identifiers`, and+ `ascii_identifiers` extensions (#8852, Meher Chaitanya).+ Section headings parsed from .SH and .SS macros now receive+ auto-generated id attributes when the extension is enabled (as+ it is by default). This enables `--toc` to produce working anchor links.+ + Better handling of `.TP` macro (#11668). We parse these as+ DefinitionList items, but we previously sometimes stopped prematurely+ in including material in the definition. We should include everything+ until we hit a new indentation-changing macro.++ * Roff reader:++ + Handle `\` line continuation in table cells (#11635).++ * LaTeX reader:++ + Evaluate theorem name when used rather than evaluating it when+ the `\newtheorem` command is encountered (#11608). It may include+ macros only defined later.+ + Put identifier from label on table attributes rather than adding+ an enclosing Div (#11604).++ * Typst reader:++ + Fix issue parsing figure inside rotate or box (#11598).+ + Implement "rotate" as pass-through (#11531). Information about the+ angle is encoded in an attribute of an enclosing span or div.++ * RTF reader:++ + Fix tables parsed as deeply nested tables (#11682).++ * Docx writer:++ + Fix display of paragraph with just inline math (#11674).+ Word displays a paragraph containing just one inline math+ element as if it were display math. We don't want that,+ so we add a zero-width space to defeat this behavior.+ + Fix FirstParagraph style lost after heading with footnote (#11573).+ + Fix empty keywords in core document properties (#11666, Sai Asish Y).++ * OpenDocument/ODT writer:++ + Use predefined styles (#9316, #5086, #2747, #3426, #7336).+ Previously the OpenDocument writer emitted a fresh automatic+ style (L1..Ln, P1..Pn, T1..Tn) for nearly every list, list-item+ paragraph, block quote, preformatted block, and inline text+ style. This commit teaches the writer to reference the+ predefined styles that LibreOffice ships and that pandoc's+ reference.odt now exports:++ - Bullet lists use `List_20_1`; ordered lists with default start and+ decimal format use `Numbering_20_1`. Non-default ordered lists+ generate a single named override style (`Pandoc_Numbering_N`)+ memoised by (ListNumberStyle, ListNumberDelim); a non-default start+ value with the default format is expressed via `text:start-value`+ on the `text:list` element instead of a new style.+ - List-item paragraphs use `List_20_Bullet[_Tight]` and+ `List_20_Number[_Tight]`. The Tight variants are pandoc-specific+ (zero top/bottom margin) and are injected into the user's+ reference.odt if missing, just like the Skylighting token styles.+ - Block quotes use the predefined `Quotations` paragraph style+ directly. Nested block quotes use a single automatic style that+ inherits from Quotations and only adds extra margin-left, so a list+ inside a block quote now inherits its container's indent (#2747).+ - Preformatted blocks use `Preformatted_20_Text` directly.+ - Emphasis, Strong, Strikeout, Subscript, Superscript and Code spans+ use the predefined `Emphasis`, `Strong_20_Emphasis`, `Strikeout`,+ `Subscript`, `Superscript` and `Source_20_Text` text styles.+ - `paraStyle`/`paraStyleFromParent` no longer emit a wrapper automatic+ style when its only attribute would be `parent-style-name`; the+ parent name is returned directly.++ * EPUB writer:++ + Support multiple EPUB versions for raw content (#11628,+ nibras shami). This change ensures that raw content marked `epub2`+ will appear in (only) EPUBv2 output and content marked `epub3` will+ appear in (only) EPUBv3 output.++ * Typst writer:++ + Add zero-width space before a Span label if otherwise the label+ doesn't come after anything (#11568). (In this case typst will+ raise an error.)+ + Add newline after `#set text` directive (#11583). This ensures that+ blocks such as lists are parsed correctly after a `set text`.++ * LaTeX writer:++ + Fix `fr-CA` babel language mapping (#11575, Christophe+ Dervieux). Map fr-CA to `french` instead of deprecated `canadien`.+ The babel-french package's `canadien.ldf` is deprecated and+ broken: it never calls `\ldf@finish`, so `\bbl@main@language` is+ left undefined, causing babel to crash at `\begin{document}`.+ Since `canadien` was always just an unconditional alias for+ `french`, use `french` directly.++ * MediaWiki writer:++ + Handle some technically malformed URLs (#11562).+ + Fix escaping to avoid accidental lists (#11563).++ * Markdown writer:++ + Fix spacing issues with definition lists.+ - Properly handle the case where the first item is an indented+ code block (#11542).+ - Use correct indentation when `four_space_rule` extension is+ disabled.+ + Escape `:::` to avoid triggering unintended divs (#11571).++ * Man writer:++ + Don't run together successive definitions in a tight definition list+ with multiple definitions after a term (#11547).++ * Text.Pandoc.Writers.Shared:++ + `htmlAttrs`: use `data-` prefix when needed (#11680). This now+ behaves like the HTML writer, adding the `data-` prefix for+ custom attributes. This will affect, e.g., the mediawiki writer.++ * Text.Pandoc.Error:++ + Display IOError without stack trace (#11676).+ + Use single quotes around paths and format names (#11645) in+ displayed messages.++ * Text.Pandoc.App.Opt:++ + Opt has a new field `optTypstInputs` [API change].++ * Text.Pandoc.Options:++ + Change `defaultMathJaxURL` to use MathJax v4 (#11669).+ + ReaderOptions has a new field `readerTypstInputs` [API change].++ * Text.Pandoc.Citeproc.BibTeX:++ + Prevent wrong combination of `subtitle` and `titleaddon` with+ `maintitle` (#11677, Amir Dekel). When `maintitle` is present, `subtitle`+ should not be added to `title`, but only to `volume-title`.+ + BibLaTeX `inbook` should be CSL `book`, not `chapter` (#11552).+ + Allow `doi` field in bibtex (input and output) (#11617, Thomas Hodson).++ * Text.Pandoc.Translations:++ + Find lang-script type translations (#11648).+ E.g. for `zh-Hant-TW` look for (in order) `zh-Hant-TW.yaml`,+ `zh-Hant.yaml`, `zh.yaml`.++ * Text.Pandoc.Parsing:++ + Various small optimizations.+ + Fix bug in `extractIdClass` to ensure that both `id` and+ `class` are stripped from key/value attributes..++ * Text.Pandoc.Shared:++ + Various small optimizations.++ * ODT reference doc: demonstrate predefined styles (310327).+ This mirrors the demonstration content already present in+ the Word reference doc.++ * HTML templates:++ + Include pandoc-version in generator meta tag (#11624).+ + Styles: make screen-only CSS conditional (#11524, Keenan Brock).++ * EPUB templates:++ + Add dir attribute to html element (#11554).++ * LaTeX template: Define `\xmpquote` if not defined (#11528).+ `\xmpquote` is defined by the hyperref driver hyperxmp; we need a+ fallback for those who aren't using that.++ * Lua subsystem:++ + Add constructor `pandoc.TableBody`.++ * doc/lua-filters.md: Re-indent definition list items+ (Albert Krewinkel).++ * wasm/index.js: include filter to embed images for pdf-via-typst.+ Auto-inject `embed_images` filter for PDF via Typst. Otherwise+ conversion fails because we can't write the images in a temporary+ directory in the WASM sandbox. See jgm/pandoc#11584.++ * Fix test suite parallel execution failures (#11566).++ * linux/make_artifacts.sh: add `loong64` support (#11597,+ Olivier Benz).++ * `bash_completion.tpl`: add `groff` to `--pdf-engine` completions (#11555).++ * MANUAL.txt:++ + Improve description of reference links (#11643).+ + Update instructions for modifying reference.docx+ (#11600, Dan Jacobson). Mention LibreOffice as an alternative.+ + Clarify indentation rules for definition lists (#11542).+ + Move `--sandbox` to general options.+ + Reword restrictions on YAML metadata in commonmark (#11561).++ * Bump upper bound for time, tls, aeson.++ * Use latest releases of doclayout, asciidoc, texmath, typst,+ typst-symbols, pandoc-types, citeproc, commonmark, commonmark-pandoc,+ commonmark-extensions.++ * Add missing NAME heading to pandoc-lua, pandoc-server man pages (#11634).++## pandoc 3.9.0.2 (2026-03-19)++ * Typst template: fix regression introduced in 3.9.0.1 (#11538).++## pandoc 3.9.0.1 (2026-03-17)++ * WASM GUI:++ + Don't block everything while pandoc.wasm loads.+ + Fix bug with Unicode filenames (#11447).+ + Catch errors loading pandoc.++ * Docx reader:++ + Recognize media inside textboxes (#11053, Raymond Berger).+ + Properly handle media stored with packaged-rooted paths+ such as `/media` (#11518). This can be produced by the online version of Word.+ With this change, media stored at an absolute path will be stored+ with its original name and not given a SHA1-based name.+ + Preserve non-textbox content when unwrapping textboxes (#11510, #6893,+ #11412, #5394, #9633). Treat text inside a textbox containing an image+ as a figure caption.+ + Support `w:gridBefore` table row property (#11464, Jan Tojnar).++ * Typst reader:++ + Handle bibliography command (#11460). If this is present, a+ bibliography section is added to the document and the bibliography+ paths are added to `bibliography` in the metadata. This sets things+ up for using `--citeproc`.++ * Textile reader:++ + Handle block content in cells (#11455).++ * LaTeX reader:++ + Support `\footnotemark` and `\footnotetext` (#11450).+ These commands allow separating the footnote mark from its content, useful+ in tables, minipages, and other contexts where \footnote cannot be used+ directly.+ + Support supertabular environment (#11523, bodigrim).++ * ODT Reader:++ + Fix relative linked images (#11369, Tuong Nguyen Manh).+ + Recognize `Preformatted_20_Text` style Jan Tojnar+ This is used by LibreOffice, and we will switch to that as well.+ + Add block smushing logic (Jan Tojnar).+ + Support Preformatted Text style (#4841, Jan Tojnar).++ * Markdown reader:++ + Fix bug with `lists_without_preceding_blankline` (#11534).++ * Typst writer:++ + Don't add a carriage return after `\` for hard break (#11446).+ They are not necessary. Note that they can still be included+ if you use `--wrap=preserve` and add a newline in your source document.+ + Improve handling of data: URIs in images. Instead of using an+ SVG with a link containing the data URI (the solution of #10460),+ we can now simply produce a `bytes` object with the requisite bytes.+ Typst figures out the format automatically.+ + Fix escaping of quotes (#11463).+ + Include alt attributes on images (mcanouil).+ + Properly escape `.` after bracketed argument (#11511).++ * Docx writer:++ + Don't depend on `extractTarget` from Docx reader.+ + Fix section breaks with `--top-level-division` (#11482, #10578).++ * EPUB writer:++ + Add cover metadata for EPUB3 (#11479). This allows+ file managers to show cover thumbnails for EPUB3 files as well.+ + Update allowed values for EPUB3 metadata `identifier.scheme` (#11481,+ Pascal Wagler).++ * ODT writer:++ + Rename inline source class to match LibreOffice (#3390, Jan Tojnar).+ Rename the text style we use to represent `Code` inlines from+ `Source_20_Text` to `Source_Text`. This is the same name LibreOffice+ Writer uses so it will be recognized by the Character Styles section+ of the Styles menu.+ + Remove font size from inline source class (Jan Tojnar). This matches+ what LibreOffice Writer is doing. Also fixes literals inside+ headings being too small.+ + Modernize `Preformatted Text` & `Source Text` styles (Jan Tojnar).+ Presumably, `font-family-generic` and `font-pitch` will allow to find a+ replacement on systems that do not have `Courier New`.++ * Markdown writer:++ + Fix rendering of alerts (#11479). We only properly handled the case+ where the alert started with a paragraph, but it can start with a list+ or other block type.+ + Escape literal `&` that would trigger entity (#11490).++ * HTML writer:++ + For revealjs, default `scrollProgress` to `auto` (Christophe Dervieux).++ * PPTX writer:++ + Register content type for embedded fonts (#11492).++ * MediaWiki writer:++ + Use appropriate syntax for external images (#11494).+ Note that they will only be rendered as images if an option+ `$wgAllowExternalImages` is enabled in the MediaWiki instance.++ * ICML writer:++ + Support for image object styles (#11498, massifrg).+ This change allows users to style images in InDesign bysetting the+ `object-style` attribute in a pandoc Image, which is mapped to the+ AppliedObjectStyle attribute in the Rectangle element around an Image+ element in the resulting ICML.++ * JATS writer:++ + Improve representation of Divs (Albert Krewinkel). The writer now+ checks if the element used to represent (non-special) Divs has any+ `<boxed-text>` specific attributes. If it does, the writer keeps+ wrapping the Div contents in a `<boxed-text>`, as it did before.+ Otherwise, the writer falls back to the more appropriate `<p>` element+ or simply unwraps the Div if the wrapping element wouldn't have any+ attributes. The new behavior gives better semantic results in most cases,+ as `<boxed-text>` should be used for text that "is outside the flow of the+ narrative text", which doesn't apply to most divs.+ "Special" divs, like those used to mark sections, are not+ affected by this change.++ * Text.Pandoc.Writers.GridTable:++ + Normalize tables (#8102). Previously, if an invalid table was passed to+ `toTable`, an array index error could be raised. Normalizing the table+ forces it into a shape that won't allow this error.++ * Lua subsystem (Albert Krewinkel):++ + Add new function `pandoc.types.Sources` (#11441).++ * LaTeX template: properly handle keywords with commas.+ These need to be put in an `\xmpquote{..}` command. Closes #11528.++ * HTML styles template: avoid duplicate code selector.+ Consolidate two clauses. Closes #11484.++ * Revealjs template: fix type rendering of scroll-view options+ (Christophe Dervieux, #11486).++ * Typst template:++ + Use both place and block for title (Gordon Woodhull).+ Otherwise the title will be confined to the left column+ + Put title block in a conditional (#11529). This avoids an+ empty block for documents that lack metadata information.+ The empty block causes problems if `#set page` is used, as+ it will cause a page break.++ * Beamer template: add `logooption` variable (#11452, Sidney Mau).++ * Text.Pandoc.ImageSize:++ + Correctly handle percentage width, height on SVG (#11530).+ Previously we were getting image size of 0 when a percentage+ was specified for width or height on SVG. With this change,+ we simply ignore these percentages (becaues ImageSize doesn't+ know the size of the containing element).++ * Re-add `-threaded` to compile options in pandoc-cli.++ * Use released djot, asciidoc, texmath, typst.++ * Allow crypton 1.1, tls 2.2, http-client-tls 0.4.++ * Require auto-update >= 0.2.6 to fix server on macOS (#11488).++ * pandoc-cli.cabal: bump base min bound to 4.18 (same as pandoc).++ * MANUAL.txt:++ + Note that JSON may be used in YAML metadata blocks (#11525).+ + Update link for ICML in manual.+ + Fix outdated OPML spec URL in MANUAL.txt (#11504, Peter Briggs).++## pandoc 3.9 (2026-02-03)++ * Add support for compiling pandoc to WASM. (To build, `make+ pandoc.wasm`.) A stanza in `cabal.project` contains the+ necessary build modifications. We owe this almost entirely to+ TerrorJack, who created the original proof of context and+ came up with the necessary build flags and patches to some+ dependencies.++ `pandoc.wasm` has almost all the power of regular pandoc. The+ main limitations is that it operates in a WASM sandbox and thus+ cannot use HTTP to fetch resources and cannot run system commands.+ As a result, JSON filters cannot be used, `--embed-resources`+ works only with resources that have been explicitly provided in+ the WASM sandbox, and PDFs cannot be produced (since that requires+ running external commands). However, Lua filters can be used,+ as long as they do not run system commands.++ A JavaScript bridge module, `wasm/pandoc.js`, is provided; this+ handles the setup necessary to run `pandoc.wasm` in a browser.++ In addition, a full-featured GUI interface is provided in the+ `wasm` subdirectory. `make serve` from that directory and it+ will run locally, or visit <https://pandoc.org/app>. Note that+ once the relevant code has been downloaded by the browser, it runs+ entirely in the browser, and the conversions never touch a server.+ The GUI was developed in interaction with Claude Code. This app+ includes a WASM version of Typst and can produce PDF output via+ Typst.++ * Defaults files may now be either JSON or YAML (though a `.yaml`+ extension will still be assumed if the file has no extension).+ The structure of a JSON defaults file is isomorphic to that of+ a YAML defaults file.++ * Variable expansion now works even for the `defaults` field of+ defaults files (#8024, Jacob Larkin).++ * `--extract-media` will now create a zip archive containing the media+ (instead of a directory) if the path provided has a `.zip` extension.++ * Processing with `--citeproc` is now affected by a+ `reset-citation-positions` class on headings. When the+ `reset-citation-positions` class is added to a top-level+ heading, `--citeproc` will reset position information at that+ point in the document. This is needed in order to ensure that+ the first citation in a chapter to a work that has been cited+ in a previous chapter will not be in abbreviated form.++ * RST reader:++ + Fix definition lists where term ends with `-` (#11323).+ This reverts some old code giving special treatment to+ lines ending in hyphens; I don't understand why it was+ there, because rst2html does not seem to do this.++ * HTML reader:++ + Revert an earlier change that caused style tags in the body+ to be ignored (#10643, #11246).+ + Parse inline style elements as RawInline (#10643, #11246).++ * Markdown reader:++ + Fix parsing of inline math (`$...$`) (#11311, benniekiss).+ Do not allow blank lines before closing `$` delimiter. This brings the+ parser in line with the documentation.+ + Allow superscripted spans (#11409). These were being parsed as inline+ notes. Now we disallow an inline note followed by+ attributes, as this is almost certainly meant to be a span.+ + Support `alerts` extension for pandoc markdown (#9716). It is not+ enabled by default.++ * MediaWiki reader:++ + Add behavior switches support (#11354, Anton Melnikov).+ They add a field to metadata without producing any text.+ + Handle non-recognized tags as plain text (#11299).+ + Better handling of inline tags (#11299). `<mark>`, `<var>`,+ `<samp>`, and `<kbd>` now produce Code or Span elements with+ classes, which can be handled by multiple output formats,+ instead of simply being parsed as raw HTML tags.++ * RTF reader:++ + Ensure a new paragraph on `\pard` (#11361, Tuong Nguyen Manh). New+ paragraphs may start with `\pard` alone without an explicit paragraph+ break with `\par` preceding it.+ + Improve hyperlink parsing more (#10942, Tuong Nguyen Manh).+ Both the field instruction and its result may be ungrouped.+ + Fix bug where list items were incorporated into a following table+ (#11364).++ * ODT reader:++ + Add table row and column spans (#11366, Tuong Nguyen Manh).+ Parse the number-rows-spanned and number-columns-spanned attributes to+ create Cells for the Table.++ * DocBook reader:++ + Support "role" attribute (#11255, Yann Trividic). The `role`+ attribute is parsed and added to Pandoc AST elements, using a+ wrapper Div if needed.+ + Omit empty title when not required (#11422).+ This affects example and sidebar elements.+ + Fix adding wrong metadata (#11300, Tuong Nguyen Manh). Now+ keep track of the current element stack to only add metadata+ if inside an appropriate parent element.++ * DocBook/JATS reader:++ + Don't export surrounding space from inline elements (#11398). Previously+ we would export leading and trailing space inside elements like+ emphasis or ulink so they appeared outside the resulting pandoc Inline+ (Emph or Link). This is not really motivated; DocBook and XML in general+ treats leading and trailing whitespace in this context as significant.++ * Docx reader:++ + Handle tables without `tblGrid` (#11380).+ + Look inside v:rect as well as v:shape (#11412).++ * LaTeX reader:++ + Handle more quote macros from fontspec and ngerman babel (#6120).++ * Org reader:++ + Don't include 'example' class when parsing org example blocks (#11339).+ These are just unmarked code blocks.++ * Texinfo writer:++ + Improve handling of certain code blocks (#11312).+ MediaWiki, for example, will parse a code block containing+ formatting as a sequence of Code elements separated by+ LineBreaks. For this we now use a texinfo example block.++ * Typst writer:++ + Escape hyphens when needed (#11334).++ * HTML writer:++ + Include all classes on highlighted code elements (#11423). Previously,+ only the language class was included, and the others were dropped.+ + Slide formats: Make `. . .` pause work in nested blocks (#7201, #7582).+ + For revealjs, add idiomatic highlight.js support (#11420, Claude Opus 4.5).+ When using `--syntax-highlighting=idiomatic` with reveal.js output, pandoc+ now generates HTML compatible with reveal.js's built-in highlight.js plugin:+ Code blocks use `<pre><code class="language-X">` format.+ The template loads highlight.js CSS, JS, and RevealHighlight plugin.++ * Markdown writer:++ + Ensure that `\ ` line breaks are used for commonmark.+ + Use setext for headers containing line breaks for commonmark (#11341).+ + Allow display math to start/end with space (#11384).+ This reverts to earlier < 3.7 behavior.+ + Properly handle tables with footers (#11416).++ * JATS writer:++ + Fix XML output for nested figures (#11362, Albert Krewinkel).+ Subfigures are now wrapped inside a `<fig-group>` element. Furthermore,+ figure content that isn't allowed as children of `<fig>` elements, such as+ raw text, gets wrapped in `<p>` elements to ensure schema-conforming XML.++ * AsciiDoc writer:++ + Use doubled delims in more contexts (#11362). Also escape the `#` character.+ + Use a span with role for SmallCaps (#11374).+ + Export spaces inside delimited constructs like emph.++ * Docx writer:++ + Skip directory entries when building media overrides (#11379, You Jiangbin).+ Pandoc's docx writer was previously adding an `<Override>` for+ `/word/media/` in `[Content_Types].xml` when the reference doc contains+ media, which violates OPC rules and causes Word to report corruption.+ + Refactor the monolithic `writeDocx` into a number of smaller functions+ (Claude Opus 4.5).+ + Replace generic XML traversal with direct path navigation (Claude+ Opus 4.5). Instead of using Data.Generics `everywhere` to traverse the+ entire XML tree when setting language attributes, navigate directly to+ the known path `w:docDefaults/w:rPr/w:lang`. This is more efficient and+ removes the dependency on `Data.Generics`.++ * EPUB writer:++ + Don't use footnote backlinks for EPUBv3. Here we use aside elements,+ which are popups, and the backlinks are not needed; in some readers+ they cause a redundant number to appear, since the reader adds a note number.++ * MediaWiki writer:++ + Use Doc Text instead of Text for document construction (with Claude Open 4.5).+ This refactors the writer to use Text.DocLayout combinators (vcat, hcat,+ literal, blankline, cr, chomp) for building output, following the pattern+ used by other text format writers (RST, Markdown, Man). This enables+ better control over line spacing and paragraph separation.+ + Improve blank space around div elements (#11417). This is merely cosmetic.++ * PPTX writer:++ + Support notes field in metadata for title slide (#5844, Chris Callison-Burch).+ This adds support for a `notes` field in the YAML metadata block that will+ be used as speaker notes for the title slide in PowerPoint output.+ Previously, there was no way to add speaker notes to the title slide since+ it is generated from metadata rather than from content blocks.++ * LaTeX writer:++ + Add PDF standard support via DocumentMetadata (#11407, Gordon Woodhull+ with Claude Opus 4.5). The `pdfstandard` variable can be+ used to specify PDF standards (PDF/A, PDF/X, PDF/UA) in+ LaTeX output. This uses LaTeX's `\DocumentMetadata`+ command, which requires LuaLaTeX. PDF version requirements+ are automatically inferred, but can be explicitly overridden.+ Automatic tagging is added for standards that require it.++ * Typst template:++ + Fix keywords usage. (#11317, har7an).+ + Disable hyphenation for title, subtitle (#11375).+ + Improve accessibility of definition lists (#11436). Before this+ change, our show rule produced an error when typst was run with+ `--pdf-standard=ua1`.++ * HTML5 template:++ + Conditionally include lang attribute, instead of providing+ it with an empty value.++ * JATS template:++ + Fix author prefix placeholder (#11381, Christophe Dervieux).++ * Text.Pandoc.Citeproc:++ + Fix biblatex parsing of `@commentary` entries (#11322).+ + Fix typo affecting `jurisdiction` biblatex type (#11321).+ + Avoid adding an extra space at the beginning of a Cite.++ * Text.Pandoc.Shared:++ + Export `hasLineBreaks` [API change]. This was formerly+ defined in the DocBook writer but more generally useful.++ * Text.Pandoc.PDF:++ + Add `SOURCE_DATE_EPOCH` to verbose environment variable info.++ * Text.Pandoc.Class:++ + Factor out `openURL` into Text.Pandoc.Class.IO.HTTP (unexported module).++ * Lua subsystem (Albert Krewinkel):++ + Mark readers and writers with their types (#11367). The+ `pandoc.readers` and `pandoc.writers` maps now have string values+ instead of boolean values. The string signals the type of the+ reader/writer, `"text"` for TextReader/TextWriter and `"bytestring"`+ for ByteStringReader/ByteStringWriter.+ + Support equallity checks of LogMessage objects.+ + Add function `pandoc.with_state` (#10859). The function allows+ to run a callback with a modified pandoc state. This provides+ the ability to temporarily modify the resource path, the user+ data directory, and the HTTP request headers.+ + Let `pandoc.with_state` error on unknown options (#11376).+ + Add function `pandoc.utils.documentation` (#10999).+ This is now used to generate much of the Lua API documentation.++ * Text.Pandoc.App:++ + Remove redundant check for asciidoc in UnknownReader.++ * Text.Pandoc.Logging:++ + Add `pretty` field to ToJSON instance for LogMessage.+ This just reproduces the output of `logMessage`, for convenience for those+ who are using the JSON output outside of Haskell.++ * Text.Pandoc.Error:++ + Change PandocHttpError constructor to take a Text instead of an+ HttpException as the second argument (see #10980) [API change]+ Motivation: exposing HttpException in the public API makes it+ difficult to provide a version of pandoc that can be compiled+ to wasm, which currently can't handle the network libraries.+ + Define `displayException` for PandocError. This is a behavior change,+ not an API change, since there was already a definition that defaulted+ to using Show. The change here is that we use `renderError` for+ a more human-readable version.++ * Drop support for compilation with GHC versions < 9.6.++ * Use released citeproc 0.13, djot 0.1.3, skylighting-format-blaze-html+ 0.1.2 (see #11423), texmath 0.13.1, asciidoc 0.1.0.1, typst-0.9,+ hslua 2.5.++ * Add `-Wno-deriving-typeble` to cabal ghc-options for ghc >= 9.12.++ * Add `http` cabal flag (#10980). This allows pandoc to be+ compiled without support for making HTTP requests, which is+ useful when WASM is the target.++ * pandoc-lua-engine has a new build flag `repl`, allowing support+ for the Lua repl to be disabled for the wasm build.++ * We now sign Windows artifacts with a code signing+ certificate provided by SignPath.++ * Mention Excel in cabal description.++ * Makefile: remove some obsolete targets.++ * MANUAL.txt:++ + Fix typo about `--chunk-template` (#11358, Albert Lei).+ + Fix link for bbcode_steam (#11389).+ + Small rewrite of syntax-highlighting info.+ + Fix defaults.yaml example for `wrap`.++ * Fix a few mistakes in the contributing docs. (#11318, har7an).++ * Fix a couple small errors in `doc/lua-filters.md`,+ `doc/custom-writers.md`, and `doc/custom-readers.md`+ (#11408, #11388).++## pandoc 3.8.3 (2025-12-01)++ * Add `asciidoc` as an input format (#1456).++ * Add `xlsx` (Microsoft Excel) as an input format (Anton Antich).+ Each worksheet turns into a section containing a table.++ * Add `pptx` (PowerPoint) as new input format (Anton Antich).++ * Add `bbcode` as a new output format (#11242, reptee). Several variants+ of BBCode are also supported: `bbcode_fluxbb` (FluxBB), `bbcode_phpbb`+ (phpBB), `bbcode_steam` (Hubzilla), `bbcode_hubzilla` (Hubzilla),+ and `bbcode_xenforo` (xenForo).++ * New exported module Text.Pandoc.Readers.AsciiDoc,+ exporting `readAsciiDoc` [API change].++ * New module `Text.Pandoc.Readers.Pptx`,+ exporting `readPptx` (Anton Antich) [API change].++ * New module `Text.Pandoc.Readers.Xlsx`,+ exporting `readXlsx` (Anton Antich) [API change].++ * LaTeX reader:++ + Revert `\linebreak` as LineBreak (#11272). `\linebreak` is more+ of a hint, it shouldn't produce a hard break.+ + Better handling of `\makeatletter` in parsing raw LaTeX (#11270).+ + Fix spurious paragraph breaks in math environments (#11265,+ Emmanuel Ferdman). Previously, a math environment with extra+ space before the `\end` would get rendered with a blank line,+ which LaTeX treats as a paragraph break.+ + Change type on `rawLaTeXParser` in Text.Pandoc.LaTeX.Parsing.+ The preparser doesn't need to return a value.+ + Fix `rawTeXParser` (#11253). Make macro expansion in raw LaTeX+ depend on the setting of the `latex_macros` extension. Previously+ macros were always expanded, even in raw TeX in markdown. In+ addition, there was previously a bug that caused content to be+ garbled in certain cases.+ + Handle `ifstrequal` at a lower level, like the other `if`+ commands (#11253).+ + Move `ifstrequal`, `iftoggle`, etc., which were misplaced in+ `environments`, to `blockCommands`, so these commands work properly.++ * Docx reader:++ + Handle REF link instruction (#11296, Ezwal).+ + Check recursively for caption styles (Albert Krewinkel).+ The docx reader uses caption styles to identify figures and+ captioned tables. It now checks for known caption styles in the+ full styles hierarchy of a paragraph instead of just checking+ the style directly. This allows to recognize caption styles that+ are built on top of the basic *caption* style, as is sometimes+ the case in sophisticated styles.++ * Markdown reader:++ + Fix performance issue in links with `'` (#10880).++ * Typst reader:++ + Handle document metadata and `#title` (jgm/typst-hs#80).+ Note that previously, the typst reader never returned document+ metadata. Now it does, even if the typst document does not contain+ a `#title` function that would result in actually printing the+ title block.++ * Djot reader:++ + Add Space elements (#11250). Previously we just got big+ Str elements with spaces included. But many pandoc writers+ assume that breakable spaces will be Space elements, and this+ is also required for automatic wrapping.++ * RST reader:++ + Correctly handle intraword emphasis (#11309).++ * Text.Pandoc.Readers:++ + Export `readAsciiDoc`, `readXlsx`, `readPptx` [API change].++ * New module Text.Pandoc.Writers.BBCode, exporting+ `writeBBCode`, `writeBBCodeSteam`, `writeBBCodeFluxBB`,+ `writeBBCodePhpBB`, `writeBBCodeHubzilla`, `writeBBCodeXenforo`+ [API change].++ * LaTeX writer:++ + Make level 1-3 headings work inside blockquotes (#11281, James Barlow).+ + Remove `split` from list of math environments (#11274).+ + Improve handling of math environments in tex math (#11266).++ * HTML writer:++ + Add reveal.js `scroll` and `scrollSnap` options to writer and+ template (#10052, Asliddinbek Azizovich).+ + Use 'defer' when including mathjax script, as recommended in+ MathJax docs (#11292).++ * ANSI writer:++ + Apply row spans in tables (#10149, Tuong Nguyen Manh).+ The ANSI writer is now able to keep track of row spans and apply+ them in rows.++ * Pptx writer:++ + Handle reference doc without slides (#7536, Tuong Nguyen Manh).++ * AsciiDoc writer:++ + Add more table features (#11267, Tuong Nguyen Manh):+ Row span and column span, footer row, individual horizontal+ cell alignment.++ * Typst template:++ + Fix font for compatibility with typst 0.14, which doesn't+ permit an empty array for `font` (#11238).+ + Re-add `columns` to typst template (#11259), fixing a+ pandoc 3.8 regression.+ + Fix syntax for bibliography inclusion (#11233, Mickaël Canouil).+ Previously the syntax was wrong when multiple bibliography files+ were specified. Typst expects an array.++ * Text.Pandoc.Writers:++ + Export `writeBBCode`, `writeBBCodeSteam`, `writeBBCodeFluxBB`,+ `writeBBCodePhpBB`, `writeBBCodeHubzilla`, `writeBBCodeXenforo`+ [API change].++ * Text.Pandoc.Writers.Shared:++ + Add functions `insertCurrentSpansAtColumn`, `takePreviousSpansAtColumn`+ and `decrementTrailingRowSpans` for applying and keeping track of+ RowSpans over multiple rows (#10149, Tuong Nguyen Manh). [API change]++ * Text.Pandoc.Logging:++ + Change message for missing HTML title warning (#11307). Suggest+ setting the `pagetitle` variable instead of setting `title` in metadata.++ * Lua subsystem:++ + Preserve common state of custom Lua readers (Albert Krewinkel).+ The common state is transferred to Lua when calling a custom Lua+ reader, and is now also transferred back after the reader has+ finished. This ensures that info messages, warnings, and+ mediabag entries are available to the main program and all+ subsequent processing steps.++ * Text.Pandoc.PDF:++ + Avoid converting SVG to PDF when non-TeX PDF engine is used (#11275).+ This fixes a 3.8 regression, which caused documents with SVGs to+ raise an error when converted to PDF using WeasyPrint.+ + Fix a 3.8 regression with typst and smart quotes (#11256).+ Before 3.8, the default behavior when producing a PDF `-t typst`+ was to produce smart quotes according to typst's defaults.+ (This could be defeated by specifying `-t typst-smart`.)+ This behavior broke in 3.8 because of a change to Text.Pandoc.PDF.+ This change caused `smart` to be disabled for all formats when+ producing PDFs, when before it was only disable for TeX-based+ formats (to avoid bad ligatures). This commit restores the old+ behavior. Possibly the regression also other affects other+ non-TeX formats, e.g. HTML.++ * Text.Pandoc.Shared:++ + Add functions `allRowsEmpty` and `tableBodiesToRows` from the+ RST writer for reuse in other writers. (Tuong Nguyen Manh) [API+ change].++ * Text.Pandoc.Citeproc:++ + Allow formatting in locator to be transmitted to citeproc.+ We do this indirectly, by rendering the formatting using the+ HTML tags that citeproc recognizes. Fixes jgm/citeproc#68+ and jgm/citeproc#163. Note that formatting is only possible for+ locators given in the explicit form, surrounded by curly braces.+ It won't work for implicit locators, since these expect+ number-like expressions.++ * New non-exported module Text.Pandoc.Readers.OOXML.Shared+ containing functions factored out from+ Text.Pandoc.Readers.Docx.Util (Anton Antich).++ * Tests: The common file `nativeDiff` has been extracted from+ the Docx and Pptx text files and put in Tests.Helpers.++ * Use asciidoc 0.1, djot 0.1.2.4, texmath 0.13.0.2, typst 0.8.1,+ citeproc 0.12.++ * MANUAL.txt:++ + Improve `implicit_figure` documentation (#11082).+ + Give both forms of options when referring to them (#11306).++ * Update INSTALL.md (#11271).++## pandoc 3.8.2.1 (2025-10-20)++ * HTML reader: allow blank space between open and close `iframe`.++ * RTF reader: improve hyperlink parsing (#11211).++ * Org reader:++ + Parse parameter lists on unknown blocks (#11188, Albert+ Krewinkel). The reader tries to parse the rest of the opening+ line of a block, e.g., `#+begin_myblock …`, as a parameters+ list. It first assumes that the parameters are in lisp-style+ (`:key value`), then alternatively tries to read python-style+ key-value pairs (`key=value`) and falls back to reading the+ entire remaining line as a single `parameter` attribute.+ + Add support for dynamic blocks.++ * Docx writer: properly handle nested comment spans (#8189, #6959,+ mourino).++ * RST writer: Don't use simple tables with RowSpans (#11214,+ Tuong Nguyen Manh).++ * Typst writer: Escape open paren after non-space (#11210).+ This fixes an issue that occurs if an open paren comes+ right after e.g. `#strong[test]`.++ * Typst template: ensure that title block is properly centered (#11221).++ * LaTeX writer/template: small fix for unnumbered tables for+ compatibility with older LaTeX installations (#11201).+ Thanks to @priiduonu for the solution.++ * MANUAL.txt: Fixed missing backtick (#11209, FoxChillz).++ * Correct anchor references to `pandoc.text` module documentation (#11111,+ Emmanuel Ferdman).++ * Fixed golden test regeneration in Docx reader test.++ * Allow unicode-data 0.8.++ * Use citeproc 0.11. This fixes a significant performance+ regression in pandoc 3.8, which was due to a rewrite of the+ default chicago-author-date.csl file. Performance with `--citeproc`+ is now on par with what we had in pandoc 3.7, even with the+ revised Chicago styles.++## pandoc 3.8.2 (2025-10-05)++ * Markdown reader/writer: implement new `table_attributes` extension+ (#10884). When `table_attributes` is enabled (as it is by default for+ pandoc's Markdown), attributes can be attached to a table by+ including them at the end of the caption. Previously the writer+ would emit an identifier in this position, but the reader didn't+ handle it. Now arbitrary attributes are allowed, and they work in+ both the reader and writer.++ * Typst writer: don't add superfluous semicolons (#11196).+ Previously we added semicolons after inline commands not+ followed by spaces, but mainly this was to deal with one issue:+ the presence of a semicolon after an inline command, which+ would be swallowed as a command separator (#9252).+ This commits adopts an approach that should avoid so many+ superfluous semicolons: it escapes semicolons that might come+ right after a command.++ * Typst template: fix 3.8 regression in which links disappear+ (#11194). A template change in 3.8 added a show rule for links which+ causes them to disappear except in special cases.++ * Text.Pandoc.Parsing: rewrite `oneOfStrings` more efficiently.++ * LaTeX writer: Fix strikeout in links (#11192, Tuong Nguyen Manh).+ As in #1294 `\url` and `\href` need to be protected+ inside an mbox for `soul` commands.++ * Text.Pandoc.Extensions: Add `Ext_table_attributes` constructor for+ `Extension` [API change].++ * Use released texmath 0.13.0.1.++ * Update FSF contact information in COPYING (#11183, Bensun Muite).++ * MANUAL.txt: remove some redundancy (#11178, Reuben Thomas).++## pandoc 3.8.1 (2025-09-29)++ * New output format `vimdoc` (Vim documentation format) (#11132, reptee).++ + [API change] Added module Text.Pandoc.Writers.Vimdoc, exporting+ `writeVimdoc`.++ * Markdown reader:++ + Improve superscript/subscript/inline note parsing (#8652).+ We do not allow inline notes to be followed by `(` or `[`.+ Otherwise, we parse inline notes before superscripts.+ Also, the sub/superscript parsers have been adjusted so that they+ really exclude unescaped spaces (as they did not before, when the+ spaces occurred in nested inlines).+ + Fix simple table alignment (#11136, Tuong Nguyen Manh). Take wide+ characters into account when determining the alignment.++ * LaTeX reader:++ + Ignore `\pandocbounded` (#11140).++ * XML reader:++ + Parse `<MetaString>` (#11137, massifrg).++ * Typst reader:++ + Add support for reading typst pagebreak (#11101, Raymond Berger).+ The pagebreak is parsed as a HorizontalRule inside a wrapper Div+ with class `page-break`.++ * Docx reader:++ + Handle figures in indented paragraphs (#11028).+ + Change default for textwidth. This should only be used if `sectPr`+ is not found.+ + Properly calculate table column widths (#9837, #11147).+ Previously we assumed that every table took up the full text+ width. Now we read the text width from the document's `sectPr`.+ + Use Tasty.Golden for Docx reader tests. This way we can update+ them with `--accept`.++ * RST reader:++ + Fix regression in simple table parsing (#11150).+ + SkippedContent warning if table directive contains+ non-tabular content.+ + Simple tables: leading space in a cell should not cause the contents+ to be parsed as a block quote (#11146).+ + Parse `:alt:` on figure (#11140). Also give a better default if+ `alt` is not specified, using the stringified caption rather+ than the filename.+ + Support col spans for simple tables (Tuong Nguyen Manh).++ * Markdown writer:++ + Improve handling of implicit figures (#11140).+ Allow implicit figures when alt text differs from caption+ (in this case, we use an image attribute to add the alt).+ + Use approximate pipe tables when it's the only option (#11128).+ If we have a table with row/colspans that can rendered as an+ approximate pipe table (without row/colspans), and no other table+ format is enabled that could render the table, we fall back to+ an "approximate" pipe table, with no row/colspans.++ * RST writer:++ + Ensure blank line before directives (#11162).+ + Add col spans for simple tables (#10127, Tuong Nguyen Manh).++ * OpenDocument writer:++ + Add missing table elements (#10002, Tuong Nguyen Manh).+ Add missing header rows after the first one,+ footer rows as well as TableBody header rows.++ * Docx writer:++ + Fix regression (from 3.8) in highlighted code (#11156).++ * Powerpoint writer:++ + Handle single column (Tuong Nguyen Manh).++ * Typst writer:++ + Fix syntax highlighting (#11171, completes #10525).+ Previously the native typst highlighting was always used, regardless+ of the setting of `--syntax-highlighting`. With this change,+ `--syntax-highlighting=none` and `--syntax-highlighting=<stylename>`+ (with skylighting style) will work.++ * LaTeX writer:++ + Make beamer footnotes compatible with pauses (#5954).+ Previously they would appear before the content to which+ the note was attached, when there were pauses in a slide.+ + Avoid `\_` in bibliography variable (#11152).+ + Ensure that unlabelled tables don't increment counter (#11141).+ + Protect VERB in caption (#11139, Tuong Nguyen Manh).+ + Don't add links to TOC (#11124, Albert Krewinkel).+ + Fix strikeouts in beamer title (#11168, Tuong Nguyen Manh).++ * LaTeX template: Add `shorthands` variable for LaTeX output+ (#11160). If true, pandoc will allow language-specific shorthands+ when loading babel. (This is helpful, for example, in getting+ proper spacing around French punctuation.)++ * epub.css: Remove coloring for `a, a:visiting` (#11174).+ This was causing links in iOS books app not to be distinguished in+ any way (since underlining is not used there).++ * Text.Pandoc.Parsing:++ + [API chage] (Tuong Nguyen Manh). New functions `tableWithSpans`,+ `tableWithSpans'`, `toTableComponentsWithSpans` and+ `toTableComponentsWithSpans'` take a list of lists of+ (Blocks, RowSpan, ColSpan) to parse a Table with different RowSpan and+ ColSpan values accordingly. New helper functions `singleRowSpans` and+ `singleColumnSpans` help set all RowSpans or ColSpans to be 1 in case+ the table format only allows setting one or the other.++ * Text.Pandoc.Class:++ + Let `fetchItem` fail if the HTTP request is not+ successful (Albert Krewinkel). HTTP requests that don't return a 200+ error code are now treated as an error. This ensures that a warning is+ triggered when using `--embed-resources` or `--extract-media`.++ * Text.Pandoc.Writers.Shared:++ + Add new function `removeLinks` [API change] (Albert Krewinkel).+ The function converts links to spans. It is used, for example, to avoid+ nested links. The HTML writer used to put the description of nested links+ into small caps, but uses a simple *span* now.++ * Text.Pandoc.Highlighting: export typst functions+ [API change]. New exported functions `formatTypstBlock`,+ `formatTypstInline`, `styleToTypst`.++ * Text.Pandoc.XML:++ + Add `fetchpriority` to list of HTML attributes (#11176).++ * Allow unicode-data 0.7.++ * Use released djot 0.1.2.3. Fixes a bug in which indentation+ was swallowed in a code block inside a blockquote.+++## pandoc 3.8 (2025-09-06)++ * Add a new input and output format `xml`, exactly representing a Pandoc+ AST and isomorphic to the existing `native` and `json` formats (massifrg).+ XML schemas for validation can be found in `tools/pandoc-xml.*`.+ The format is documented in `doc/xml.md`. Pandoc now defaults to this+ reader and writer when the `.xml` extension is used.++ Two new exported modules are added [API change]:+ Text.Pandoc.Readers.XML, exporting `readXML`, and+ Text.Pandoc.Writers.XML, exporting `writeXML`.+ A new unexported module Text.Pandoc.XMLFormat is also added.++ * Add a new command line option `--syntax-highlighting`; this takes+ the values `none`, `default`, `idiomatic`, a style name, or a path to a+ theme file. It replaces the `--no-highlighting`, `--highlighting-style`,+ and `--listings` options, which will still work but with a deprecation+ warning. (Albert Krewinkel)++ * Create directory of output file if it doesn't exist (#11040).++ * Update `--version` copyright dates (#10961), and use a hardcoded+ string "pandoc" for the program name in `--version`, per GNU+ guidelines.++ * Add `smart_quotes` and `special_strings` extensions (Albert Krewinkel).+ Currently these only affect `org`. Org mode makes a distinction between+ smart parsing of quotes, and smart parsing of special strings like `...`.+ The finer grained control over these features is necessary to truthfully+ reproduce Emacs Org mode behavior. Special strings are enabled by default,+ while smart quotes are disabled.++ * Remove the old `compact_definition_lists` extension. This was+ neded to preserve backwards compatibility after pandoc 1.12+ was released, but at this point we can get rid of it.++ * Make `-t chunkedhtml -o -` output to stdout (as documented), rather+ than creating a directory called `-` (#11068).++ * RST reader: Support multiple header rows (#10338, TuongNM).++ * LaTeX reader:++ + Support soft hyphens (Albert Krewinkel).+ + Parse `\minisec` as unlisted level 6 headings (#10635, Albert Krewinkel).+ + Support `\ifmmode` (#10915).+ + Change handling of math environments (#9711, #9296).+ Certain environments in LaTeX will trigger math mode and can't+ occur within math mode: e.g., `align` or `equation`. Previously+ we "downshifted" these, parsing an `align` environment as a+ Math element with `aligned`, and an `equation` environment as a+ regular display math element. With this shift, we put these in+ Math inlines but retain the original environments.+ texmath and MathJax both handle these environments well.++ * Typst reader:++ + Fix addition of image path prefix to use posix separator.+ + Properly resolve image paths in included files (#11090).+ + Handle inline-level show rules on block content (#11017).+ Typst allows things like `smallcaps` to be applied to block-level+ content like headings. This produces a type mismatch in pandoc,+ so before processing the output of typst-hs, we transform it,+ pulling the block-level elements outside of the inline-level+ elements.++ * Org reader:++ + Improve sub- and superscript parsing (Albert Krewinkel).+ Sub- and superscript must be preceded by a string in Org mode. Some text+ preceded by space or at the start of a paragraph was previously parsed+ incorrectly as sub- or superscript.+ + Allow "greater block" names to contain any non-space char (#4287,+ Albert Krewinkel).+ + Accept quoted values as argument values (#8869, Albert Krewinkel).+ + Recognize "fast access" characters in TODO state definitions+ (#10990, Ryan Gibb).+ + Improve org-cite parsing: Handle global prefix and suffix properly.+ Use all and only the styles mentioned in oc-basic.el.+ Allow space after `;`.++ * HTML reader:++ + Don't drop the initial newline in a `pre` element (#11064).++ * DocBook reader:++ + Add rowspan support (#10981, Sean Soon).+ + Be sensitive to startingnumber attribute on ordered lists (#10912).++ * POD reader:++ + Fix named entity lookup (#11015, Evan Silberman).++ * Man reader:++ + Support header and footer reader (Sean Soon).++ * Markdown reader:++ + Don't confuse a span after an author-in-text citation with a+ locator. E.g. `@foo [test]{.bar}`.+ See https://github.com/jgm/pandoc/issues/9080#issuecomment-3221689892.+ + Make definition lists behave like other lists (#10889).+ If the `four_space_rule` extension is not enabled,+ figure out the indentation needed for child blocks dynamically,+ by looking at the first nonspace content after the `:` marker.+ Previously the four-space rule was always obeyed.+ + Fix tight/loose detection for definition lists, to conform to+ the documentation.++ * ODT reader:++ + Support `table-header-rows` (Tuong Nguyen Manh).++ * Docx reader:++ + Don't add highlighting if highlight color is "none" (#10900).+ + Handle strict OpenXML as well as transitional (#7691).+ + Fix `stringToInteger` (#9184). It previously converted things like+ `11ccc` to an integer; now it requires that the whole string be parsable+ as an integer.+ + Improve handling of AlternateContent. This fixes handling of+ one representation of emojis in Word (#11113).++ * LaTeX writer:++ + Control figure placement with attribute (#10369, Sean Soon).+ If a `latex-placement` attribute is present on a figure, it will be used+ as the optional positioning hint in LaTeX (e.g. `ht`). With implicit+ figures, `latex-placement` will be added to the figure (and removed from+ the image) if it is present on the image.+ + Include cancel package only if there is math that contains `\cancel`,+ `\bcancel`, or `\xcancel`.+ + Add braces around comments in `title-meta` (#10501). This is needed to+ prevent PDFs from interpreting this as a sequence of titles.+ + Set `pdf-trailer-id` if `SOURCE_DATE_EPOCH` envvar is set (#6539, Albert+ Krewinkel). The `SOURCE_DATE_EPOCH` environment variable is used to trigger+ reproducible PDF compilation, i.e., PDFs that are identical down to the+ byte level for repeated runs.+ + Be more conservative about using `\url` (#8802). We only use it when the+ URL is all ASCII, since the `\url` macro causes problems when used with+ some non-ASCII characters.+ + Support soft hyphens (Albert Krewinkel).+ + Change handling of math environments (#9711, #9296).+ When certain math environments (e.g. `align`) are found in Math+ elements, we emit them "raw" instead of putting them in `$..$`.++ * Typst writer:++ + Check `XID_Continue` in identifiers (Tuong Nguyen Manh).+ + Add escapes to prevent inadvertent lists due to automatic wrapping+ (#10047). Also simplify existing code that was meant to do this.+ + Add parentheses around typst-native year-only citations (#11044).+ + Add native Typst support for `nocite` (#10680, Albert Krewinkel).+ The `nocite` metadata field can now be used to supply+ additional citations that don't appear in the text, just as with citeproc+ and LaTeX's bibtex and natbib.+ + Set `lang` attribute in Divs (#10965).+ + Rename `numbering` variable to `section-numbering` (Albert Krewinkel).+ This is the name expected by the default template.+ + Add support for custom and/or translated "Abstract" titles (Albert+ Krewinkel, #9724).++ * Org writer:++ + Don't wrap link descriptions (#9000). Org doesn't reliable display+ these as links if they have hard breaks.+ + Disable smart quotes by default (Albert Krewinkel).++ * Markdown writer:++ + Better handling of pandoc-generated code blocks (#10926).+ Omit the wrapper sourceCode divs added by pandoc around code blocks.+ More intelligently identify which class to use for the one class+ allowed in GFM code blocks. If there is a class of form `language-X`,+ use `X`; otherwise use the first class other than `sourceCode`.+ + Use fenced divs even with empty attributes (#10955, Carlos Scheidegger).+ Previously fenced divs were not used in this case, causing the writer to+ fall back to raw HTML.+ + Match indents in definition items (#10890, Albert Krewinkel).+ Previously, the first line of a definition details item always used a+ colon and three spaces instead of respecting the tab-stop setting, which+ could lead to round-tripping issues. Likewise, the indentation of+ continuation paragraphs in definition lists now matches the+ two-characters leader of the first line for Markua output.++ * DocBook writer:++ + Use `startingnumber` instead of `override` for start numbers on ordered+ lists (#10912).++ * ANSI writer:++ + Make `--wrap=none` work properly (#10898).++ * Djot writer:++ + Fix duplicate attributes before section headings (#10984).++ * Docx writer:++ + Ensure that documents don't start with a section separator+ (#10578, Albert Krewinkel). Any leading section separator is removed from+ the result.++ * HTML writer:++ + Unwrap "wrapper" divs (#11014). Some of the readers (e.g. djot) add+ "wrapper" divs to hold attributes for elements that have no slot for+ attributes in the pandoc AST. The HTML reader now "unwraps"+ these wrappers so that the attributes go on the intended elements.++ * Asciidoc writer:++ + Handle lists with sublists following continuations (#11006).+ These require an additional blank line in some cases.++ * HTML styles template: prefix default styles with informative CSS comment+ (Albert Krewinkel, #8819).++ * Org template: add `#+options` lines if necessary (Albert Krewinkel).+ The default template now adds `#+options` lines if non-default settings+ are used for the `smart_quotes` and `special_strings` extensions.++ * LaTeX template:++ + Don't emit empty `linkcolor=` in hypersetup (#11098).+ + Add RTL support for LuaTeX engine (Reuben Thomas).++ * Typst template:++ + Add several new variables (Christopher T. Kenny, #9956):+ `thanks`, `abstract-title`, `linestretch`, `mathfont`, `codefont`,+ `linkcolor`, `filecolor`, `citecolor`.++ * `reference.docx`:++ + Don't left-align table header row (R. N. West, #11019).+ + Update East Asia font theme in `styles.xml` to `minorEastAsia` (TomBen).+ + Update language settings in `styles.xml` for East Asia to Simplified+ Chinese (TomBen).++ * Text.Pandoc.PDF:++ + `makePDF`: automatically embed resources from media bag in HTML+ before trying to convert it with weasyprint, etc. (#11099).+ This will give better results when converting from formats like docx.+ + Use `utf8ToText` for LaTeX log messages.+ + Make images from MediaBag available in tmp dir for every PDF engine,+ not just LaTeX/ConTeXt (#10911).+ + Improve error readability when pdf-engine is not supported (Albert+ Krewinkel). Each supported engine is now printed on a line of its own.+ + Allow `pdflatex-dev` and `lualatex-dev` as PDF engines (#10991, Albert+ Krewinkel). These are the development versions of the LaTeX binaries;+ installable, e.g., with `tlmgr install latex-base-dev`.+ + Clean up `makePDF` (Albert Krewinkel).+ + Avoid encoding errors when reading LaTeX logs (#10954).++ * Text.Pandoc.Readers:++ + Raise unknown reader error for `ods`, `odp`, `odf`, `xls`,+ `xslx`, `zip` extensions.++ * Text.Pandoc.App:++ + Recognize binary signatures and fail early (Repetitive). Fail early when+ receiving binary input with recognized signature: zip[-based], including+ OpenDocument and Microsoft formats, PDF, CFBF-based (old Microsoft formats+ including .doc and .xls), DjVu.+ + Remove code duplication around version info.+ Text.Pandoc.App.CommandLineOptions and `pandoc-cli/src/pandoc.hs`+ had similar code for generating version information.+ To avoid duplication, we now export `versionInfo` from+ Text.Pandoc.App [API change]. This function has three parameters that can+ be filled in when it is called by `pandoc-cli`.++ * Text.Pandoc.Parsing:++ + `tableWith` and `tableWith'` now return a list of lists of Blocks, rather+ than a list of Blocks, for the header rows, allowing for multiple header+ rows [API change] (#10338, TuongNM).++ * Text.Pandoc.Citeproc:++ + Don't move footnotes around em-dashes (#11046).+ + Allow `--citeproc` to put the bibliography in a Div with id `refs`+ even when `--file-scope` is used (#11072). When `--file-scope`+ is used, a prefix will be added based on the filename, so the Div+ will end up having an identifier like `myfile.md__refs`.+ Previously, this prevented the bibliography from being added to+ the marked Div. Now pandoc will add the bibliography to any Div+ with the id `refs` or any id ending in `__refs`.++ * Text.Pandoc.Citeproc.BibTeX: Protect case in periodical titles (#11048).+ Thus, for example, `{npj} Quantum Information` should translate as+ `[npj]{.nocase} Quantum Information`.++ * Text.Pandoc.ImageSize:++ + Detect more JPEG file signatures (R. N. West and John MacFarlane, #11049).+ + Unpack compressed object streams in PDFs and look inside for MediaBox+ information (#10902).+ + Add Point and Pica as constructors of ImageSize [API change] (#8957).+ This will prevent unnecessary conversion of units.+ + Add Avif constructor on ImageType [API change] and support avif images+ (#10979).++ * Text.Pandoc.Writers.Shared:++ + Amend docs of `lookupMeta...` functions (#10634, Albert Krewinkel).++ * Text.Pandoc.Options:++ + Add and export `defaultWebTeXURL` WebTeX URL [API change] (#11029,+ Sean Soon). This fixes the `webtex` option when used without+ parameter in a defaults file.+ + Add type `HighlightMethod` and patterns [API Change] (Albert Krewinkel).+ + The `writerListings` and `writerHighlightStyle` fields of the+ `WriterOptions` type are replaced with `writerHighlightMethod`+ [API change] (Albert Krewinkel, #10525).++ * Text.Pandoc.Extensions:++ + Remove `Ext_compact_definition_lists` constructor for+ `Extension` [API change].+ + Add `Ext_smart_quotes` and `Ext_special_strings` constructors.+ [API change].++ * Text.Pandoc.SelfContained:++ + Try fetching relative resources without query or fragment if the original+ fetch fails. This provides a fix for #1477 in a way that doesn't raise+ the problems mentioned in #11021.++ * Text.Pandoc.Highlighting:++ + Export `defaultStyle` [API Change] (Albert Krewinkel).+ This allows to be more explicit about using a default style, and+ providing a single point of truth for its value. The variable is+ an alias for `pygments`.++ * Text.Pandoc.Class:++ + `downloadOrRead`: do not drop fragment/hash for local file paths (#11021).+ With the previous behavior it was impossible to have an image+ file containing `#` or `?`.+ + Export function `runSilently` [API Change] (Albert Krewinkel).+ The function runs an action in the PandocMonad, but returns all log+ messages reported by that action instead of adding them to the main log.+ + Make CommonState opaque. Text.Pandoc.Class now exports CommonState as+ an opaque object, without its fields. [API change]+ The internal module Text.Pandoc.Class.CommonState still exports+ the fields.+ + Text.Pandoc.Class now exports the following new functions:+ `getRequestHeaders`, `setRequestHeaders`, `getSourceURL`,+ `getTrace`. [API change]+ + CommonState now has a `stManager` field. This allows us to cache the HTTP+ client manager and reuse it for many requests, instead of creating it again+ (an expensive operation) for each request. This fixes a memory leak and+ performance issue in files with a large number of remote images (#10997).++ * Lua subsystem (Albert Krewinkel):++ + Add function `pandoc.structure.unique_identifier`.+ + Add functions `pandoc.text.superscript` and `subscript`.+ + Use proper interface functions to access the CommonState.+ The `PANDOC_STATE` is no longer a userdata object, but a table that+ behaves like the old object. Log messages in `PANDOC_STATE.log` are now+ in temporal order.+ + Add function `pandoc.path.exists`.+ + Add `normalize` function to *Pandoc* objects (#10356).+ This function performs a normalization of Pandoc documents. E.g.,+ multiple successive spaces are collapsed, and tables are normalized such+ that all rows and columns contain the same number of cells.+ + Add more UTF-8-aware file operations to `pandoc.system`.+ Functions that expect UTF-8-encoded filenames should make it easier to+ write platform-independent scripts, as the encoding of the actual+ filename depends on the system. In addition, there is a new+ generalized method to run commands, and functions to retrieve XDG+ directory names. The new functions are `command`, `copy`, `read_file`,+ `remove`, `rename`, `times`, `write_file`, `xdg`.+ + Allow hslua-2.4.+ + Require lua-module-system 1.2.3. This provides List methods to the value+ returned by `pandoc.system.list_directory` (#11032).++ * MANUAL.txt:++ + Fix broken ConTeXt links (R. N. West, #11055).+ + Add `xml` as input/output format.+ + Fix minor capitalization typo (#11052, Albert Krewinkel).++ * `doc/lua-filters`:++ + Fix docs for `pandoc.Cite` (Albert Krewinkel).+ + Don't encourage returning tables of filters from Lua filters+ (R. N. West, #10995). Use the `Pandoc:walk` method instead.++ * doc/extras.md: Fix link to pandoc-mode (Erik Post).++ * doc/lua-filters.md: Add example on using pandoc.Table constructor (#10956,+ Sean Soon).++ * Update `default.csl` from new chicago-author-date.csl, which is now+ for the 18th edition.++ * Use latest releases of citeproc, typst-hs, texmath, doclayout,+ skylighting-core, skylighting.++## pandoc 3.7.0.2 (2025-05-28)++ * RST writer:++ + Don't emit alignment markers in grid tables (#10857).++ * Asciidoc writer:++ + Add support for sidebars (GHyman83).++ * LaTeX writer:++ + Include alt option in `\includegraphics` (#6095).++ * Markdown writer:++ + Preserve figure attributes (Nikolay Yakimov, #10867).+ Fixes a regression introduced by 0d2114e, which caused the+ Markdown writer to ignore attributes on the figure if it+ has class or key-value attributes set.++ * HTML writer:++ + Use the ID prefix in the ID for the footnotes section (Benjamin Esham).++ * Text.Pandoc.Writers.Shared:++ + `gridTable`: fix (3.7) regression with missing cell alignments (#10853).+ + `gridTable`: fix headings with colspans (#10855). If the heading+ contains a colspan, we still need to include information in the header+ line about the colspecs.+ + `gridTable`: fix headerless tables. The top line should encode+ colspan information.++ * Text.Pandoc.SelfContained:++ + Fix handling of empty script element (#10862). Previously in this+ case the closing tag was dropped.+ + Do not drop `data-` attributes in script tags (#10861).++ * Lua subsystem (Albert Krewinkel):++ + Add function `pandoc.mediabag.make_data_uri` (#10876).+ The function takes a MIME type and raw data from which it creates an+ RFC 2397 data URI.++ * `tools/update-lua-module-docs`: fix handling of wikilinks+ (Albert Krewinkel).++ * `doc/lua-filters.md`: add missing docs for `pandoc.Caption`+ (Albert Krewinkel).++ * Require texmath 0.12.10.3, typst 0.8.0.1++## pandoc 3.7.0.1 (2025-05-17)++ * Text.Pandoc.Shared.Writer: Fix numerous problems with `gridTable` and add+ tests (#10848). These fixes affect the Markdown, RST, and Muse writers.++ * Fix context writer/template to produce tagged PDFs (#10846).+ As before, the `tagging` extension must be enabled.+ We now add the command that tells ConTeXt to start tagging.++## pandoc 3.7 (2025-05-14)++ * Add new command-line option `--variable-json` (#10341).+ This allows non-string values (booleans, lists, maps) to be given to+ template variables on the command line.++ * The `--pdf-engine` option can now take `groff` as a value.++ * Markdown writer:++ + Avoid spaces after/before open/close delimiters (#10696).+ E.g. instead of rendering `x<em> space </em>y` as `x* space *y` we render+ it as `x *space* y`.+ + Handle row/colspans in grid tables, and expand cells when it isn't+ possible to lay them out without breaking string of non-whitespace.+ + Render a figure with Para caption as implicit figure (#10755).+ + When falling back to a Div with class `figure` for a figure that+ can't be represented any other way, include a Div with class+ `caption` containing the caption.+ + Improve use of implicit figures when possible (#10758).+ When the alt differs from the caption, but only as regards formatting, we+ still use an implicit figure.+ + Omit initial newlines in gfm `math` blocks to avoid an ugly blank line.+ * Support the `four_space_rule` extension for `plain` output (#10813,+ Manolis Stamatogiannakis).++ * RST writer:++ + Handle row/colspans in grid tables, and expand cells when it isn't+ possible to lay them out without breaking string of non-whitespace.++ * Muse writer:++ + Handle row/colspans in grid tables, and expand cells when it isn't+ possible to lay them out without breaking string of non-whitespace.++ * JATS writer:++ + Fix escaping for writing-review-editing role (#10744).++ * HTML writer:++ + Remove trailing slash from default revealjs URL (#8749). This+ avoids a double slash in the URL's path component.++ * LaTeX writer:++ + Make alignment work within `multirow` in tables (#10772).++ * Typst writer:++ + Support `mark` class on spans (#10747).+ + Add equation label if math contains `\label{..}` (#10805).++ * Roff format writers (man, ms):++ + Use the most compatible form for roff escapes (#10716).+ For example, `\(xy` instead of `\[xy]`. This was the original+ AT&T troff form and is the most widely supported. The+ bracketed form causes problem for some tools, e.g.+ `makewhatis` on macOS. And emit `e` followed by an escape+ for a unicode combining accent rather than the form `\[e aa]`,+ which works for groff but not e.g. on macOS's man.+ This change affects Text.Pandoc.RoffChar,+ Text.Pandoc.Writers.Roff, and the Man and Ms writers.++ * Docx writer:++ + Ensure that figures and tables with custom styles are not dropped+ (#10705).+ + Preserve Relationships for images from reference docx (#10759).+ This should allow one to include an image in a reference.docx and+ reference it in an openxml template.+ + Don't renumber rels (#10769). We used to renumber the+ Relationships so they didn't conflict with the set of fixed+ Relationships we imposed. We are now preserving the ids+ from the reference doc's document.xml.refs, so we shouldn't+ renumber them or references introduced by the user (e.g. in+ a template) will fail.++ * Ms writer:++ + Improve PDF TOC labels. We now use the plain writer to render these,+ so that Greek characters etc. will show up properly.+ + When no `pdf-engine` variable is specified, do not use the+ `.pdfhref` macros at all (#10738). This gives better results for links+ in formats other than PDF, since the link text would simply+ disappear if it exists only in a `.pdfhref` macro. When a PDF+ engine is specified, escape the argument of `.pdfhref O` in a way+ that is appropriate.++ * OpenDocument writer:++ + Fix character styles in footnotes (#10791). Character+ styles governing the position of the footnote reference+ should not be imposed on the footnote text.++ * Powerpoint writer:++ + Use reference-doc font for captions (#9896, R. N. West).++ * DocBook writer:++ + Use literallayout element for LineBlock (#10825).++ * MediaWiki reader/writer:++ + Allow definition on same line as term (#10708).++ * LaTeX reader:++ + Skip at most one argument to LaTeX tabular newline (#7512,+ Evan Silberman).+ + Disable ligatures inside `\texttt` (#10781).+ + Support more symbol commands (#10782).++ * Commonmark Reader:++ + Handle GFM math irregularity with braces (#10631). In GFM, you need+ to use `\\{` rather than `\{` for a literal brace.++ * DocBook reader:++ + Improve handling of literallayout (#10825). This is now only made+ a CodeBlock when there is a `monospaced` class. Otherwise it is made+ a LineBlock.++ * Org reader:++ + Add AVIF to Org Reader image extensions (#10736, Christian Christiansen).+ + Don't include newlines in inine code/verbatim (#10730).+ Convert newlines to spaces as we do in other formats.+ + Change handling of inline TeX (#10836). Previously inline+ TeX was handled in a way that was different from org's own export,+ and that could lead to information loss. This was particularly noticeable+ for inline math environments such as `equation`. Previously, an+ `equation` environment starting at the beginning of a line would create+ a raw block, splitting up the paragraph containing it (see+ #10836). On the other hand, an `equation` environment not+ at the beginning of a line would be turned into regular+ inline elements representing the math. (This would cause+ the equation number to go missing and in some cases degrade+ the math formatting.) Now, we parse all of these as raw+ "latex" inlines, which will be omitted when converting to+ formats other than LaTeX (and other formats like pandoc's+ Markdown that allow raw LaTex).++ * Beamer template: fix regression in 3.6.4, reverting the omission of+ `\date` when the document does not have a date. By default, beamer+ will display a date when no `\date` is present in the title block,+ so this was an unintended behavior change. The reverted+ change was motivated by the desire to include a custom+ `\date` in the frontmatter via header-includes. This can be+ achieved more simply by simply setting the `date` variable.+ In markdown you can even use `date` in metadata and put some+ raw LaTeX there.++ * Ms template:++ + Use T rather than P as default font family (#10738).+ + Put PDF-specific things under a conditional.+ Don't include them if `pdf-engine` isn't set.++ * Upgrade reveal.js URL to v5 (#10740, Kolen Cheung).+ v4 is no longer available on unpkg.com.++ * Text.Pandoc.PDF: Allow `groff` to be used as `--pdf-engine` with `ms`+ (#10738). When `groff` is used as a PDF engine, the `groff`+ extension to `ms` is automatically enabled. Limitations:++ - `groff` currently produces larger PDFs than `pdfroff`.+ - With `groff`, a table of contents produced with+ `--table-of-contents/--toc` will always be placed at the end of+ the document.+ - Certain characters (e.g. Greek characters) may be dropped in+ the PDF outline.++ * Text.Pandoc.Writers.Shared:++ + Export `delimited` [API change].+ + New version of `gridTable` (#6344) [API change]. This+ handles row and colspans. It also ensures that cells won't+ wrap text in places where it wouldn't normally wrap, even+ if this means making the cells wider than requested by the+ colspec (#9001, #7641). Because the parameters are+ different, this is a breaking API change.++ * Text.Pandoc.App: set `pdf-engine` variable.+ If `--pdf-engine` is specified or if a PDF is being produced, we set the+ `pdf-engine` variable. This allows writers and templates to behave+ differently depending on the PDF engine.++ * Text.Pandoc.Class and Text.Pandoc.URI:++ + Fix parsing of base64 data URIs to allow URI escapes and+ whitespace (which will be ignored) (#10704).+ + Handle percent encoding in `pBase64URI` instead of+ unescaping later, for efficiency (#10704).++ * Text.Pandoc.Citeproc.BibTeX:++ + Recognize `en` as a `langid` in biblatex bibliographies (#10764).++ * Text.Pandoc.MIME:++ + Add mime type and extension for `avif` (#10704).+ + Handle `apng`, `avif`, `jxl` (#10704).++ * Text.Pandoc.Readers.LaTeX.Math: export `inlineEnvironmentNames`.+ Internal module, not a change to the public API.++ * `reference.docx` (Andrew Dunning):++ + Remove extra spaces around text placeholders.+ + Add footnote block text sample.++ * Text.Pandoc.Class.Sandbox:++ + Add `sandboxWithFileTree` function [API change] (Albert Krewinkel).++ * Lua subsystem (Albert Krewinkel):++ + pandoc-lua-engine: add all test files to the cabal file.+ + Allow `pandoc.read` to be called in "sandbox" mode for added+ security (#10831). Readers running in a sandbox will not be+ able to access the network or file system. The sandbox is+ enabled if the fourth parameter is a list of files or+ filename/content pairs. The files are read and then made+ available in the sandbox via en ersatz file system.++ * Makefile:++ + Add target `release-checkist`.+ + Install @daisy/ace from npm if not present.+ + Use pandoc lua instead of lua.+ + Fix typo in `latex-package-dependencies` target.+ + Use `jq` instead of `json_reformat` in `validate-docx-golden-tests2`.++ * NiX infrastructure: new working `flake.nix` and simpler `shell.nix`.+ Removed old `default.nix`.++ * Require random >= 1.3 and use `splitGen`. `split` has been deprecated.++ * Use citeproc-0.9. Bump citeproc bounds for pandoc, pandoc-lua-engine.++ * Use texmath-0.12.10.1.++ * Use released typst 0.8 (partially supporting typst 0.13).++ * Use citeproc 0.9.0.1.++ * MANUAL.txt:++ + Fix default URL for revealjs.+ + Add note that `alerts` extension only works with commonmark (#9716).+ + Remove "Body Text Char" from list of Word styles that can be customized+ using a reference.docx (#10646). This doesn't seem to be present in+ pandoc-generated docx files, nor is it a Word default.+ + For pandoc lua, add note about the environment.+ + Improve documentation of `--variable` option.++ * `doc/typst-property-output.md`: Mention that `typst:no-figure` is a+ class, not an attribute (#10826, Niklas Eicker).++ * Change RELEASE-CHECKLIST to RELEASE-CHECKLIST-TEMPLATE.org. Use org-babel+ to automate many of the steps of the release.++ * INSTALL.md: update MacPorts information (#10719, Mohamed Akram).++ * COPYRIGHT: fix link to source code.++ * CONTRIBUTING.md: Fix link to discussion forum. (#10834, R. N. West).++## pandoc 3.6.4 (2025-03-16)++ * Disable `citations` extension in writers if `--citeproc` is used (#10662).+ Otherwise we get undesirable results, as the format's native+ citation mechanism is used instead of (or in addition to) the+ citeproc-generated citations.++ * Markdown reader:++ + Allow line break between URL and title of link (#10621).+ + Give better position information when YAML metadata parsing fails+ with a YAML exception (#10231).+ + Fixed `escapedChar'` parser (#10672). It should not accept+ escaped newlines.+ + Remove some misguided list fanciness (#9865, #7778, cf. #5628).+ Previously we tried to handle things like commented out list items:+ ```+ - one+ <!--+ - two+ -->+ - three+ ```+ and also things like:+ ```+ - one `and+ - two` and+ ```+ But the code we added to handle these cases caused problems with+ other, more straightforward things, like:+ ````+ - one+ - ```+ code+ ```+ - three+ ````+ So we are rolling back all the fanciness, so that the markdown+ parser now behaves more like the commonmark parser, in which+ indicators of block-level structure always take priority over+ indicators of inline structure.++ * HTML reader:++ + Skip MathJaX-introduced cruft (#10673).+ + Ignore style tags in the body (#10643).++ * LaTeX reader:++ + Better handle comments/whitespace in option lists and includes (#10659).+ + Support `\newline`, `\linebreak`.++ * Docx reader/writer:++ + Revert commit adding row heads+ (cbe67b9602a736976ef6921aefbbc60d51c6755a) (#10627).+ Word sets `w:firstColumn="1"` by default for tables. You have to find+ the Table Design tab and explicitly uncheck "First Column" to make this+ go away. In most cases, I don't think writers intend to designate+ the first column as a row head, so this commit is going to produce+ unexpected results. In addition, because of the table normalization+ done by pandoc-type's `tableWith`, any table containing a colspanned+ cell in the left-hand column will get broken if the first column is+ designated a row head. For these reasons it seems best to revert this+ change, which was made in response to #9495.++ * LaTeX writer and template:++ + Remove `selnolig-langs` (#9863). We now specify the language as+ a global option again, so we no longer need to specify it when+ invoking selnolig.+ + Use babel options `shorthands=off` (#6817).+ + Use `*` for multirow width when no colwidth specified (#10685).+ Otherwise the multirow will be excessively wide.+ + Protect `\phantomsection` (#10688, etclub).++ * Markdown writer:++ + Omit extra space after bullets (#7172). Those who want the old+ behavior can obtain it by using `-t markdown+four_space_rule`.+ + Treat `Emph [Emph ils]]` as `ils` (#10642). Otherwise we get+ `**content**` which means strong emphasis.++ * EPUB writer:++ + Use a nonbreaking space after section number in nav.xhtml.+ This seems to be required for iOS books app to display the space.++ * Typst writer:++ + Better heuristics for escaping potential list markers (#10650).+ + Ensure that `citation-style` works as well as `csl` (#10661).++ * Powerpoint writer:++ + Avoid extra blank lines before author when there is no+ subtitle (#10619).++ * JATS template:++ + Fix typo in author prefix in article.jats_publishing template+ (#10622, Tiago-Manzato).++ * Text.Pandoc.Parsing:++ + Smart quote parsing: ignore curly quotes (#10610). Previously we+ tried to match curly quotes as well as straight quotes,+ producing Quoted inlines. But it seems better just to assume+ that those who use curly quotes want them passed through+ verbatim. This also fixes an (unintended) bug whereby curly+ single left quotes would sometimes be changed to single right quotes.++ * Text.Pandoc.Shared:++ + `makeSections`: put some attributes on section element only.+ Certain `role` and `epub:type` attributes should only be on the section+ (and indeed, many `role`s give a validation error if left on the+ heading element).++ * Text.Pandoc.Logging:++ + Change NoTitleElement from WARNING to INFO (#10671). Users+ commonly complain about the warning when producing HTML+ documents without an explicit title. It seems that an info+ message is more appropriate, since pandoc's default here (using+ the input's base name) ensures compliance with the standard and+ many users are happy with that default. Those who want to make+ sure the message is seen can use `--verbose`.++ * Beamer template: only emit `\date` if set (#10687, josch).++ * Fix invalid OOXML in definition_list.docx test (#10394).++ * MANUAL.txt:++ + Correct typo: 'date' for doubled 'title' (#10654, Olivier Dossmann).+ + Add note about `template` variable for typst.+ + Change maxwidth default in MANUAL.txt (#10683).+ + Improve EPUB metadata documentation.+ + In Security section, alert readers to a threat relating to iframe in+ HTML, and add LaTeX, Typst to the list of formats that have an+ `include` (#10682).++ * `doc/lua-filters.md`: Add missing html_math_method 'katex' (R. N. West).++ * Use texmath 0.12.9.++ * Use typst 0.7. Fixes an issue with package loading, a regression+ in pandoc 3.6.3.++## pandoc 3.6.3 (2025-02-09)++ * Track wikilinks with a class instead of a title (Evan Silberman).+ Previously wikilinks were distinguished by giving them the `title`+ `wikilink`. Now that we have link attributes, it makes more sense+ to give them the `class` `wikilink`. This change affects all readers+ and writers that support wikilinks.++ * DocBook reader:++ + Handle title inside `orderedlist` (#10594). Also some other+ elements that allow title: `blockquote`, `calloutlist`, etc.+ + Better handle `informalequation` (#10592, tombolano). Include `id`+ attribute.+ + Better handle `formalpara`, `example`, and `sidebar` (#8666, tombolano).+ Include identifiers and titles in each case.++ * Markdown reader:++ + Simplify and fix normal citation parsing (#10584).+ This fixes a bug that causes some normal citations to be+ parsed as bracketed regular citations.++ * ODT reader:++ + Create Figure elements for images that are figures (#10567).+ + Avoid producing spurious blockquotes in list items (#9505).+ + Fix unwanted block quotes (#10575). Previously the reader created+ block quotes whenever a paragraph was marked indented (even though+ this just affects the first line). With this change we still+ generate block quotes for content that has an altered left margin,+ but not for indented paragraphs.++ * Docx reader:++ + Do not issue warning for comments with `+styles` (#10571, Stephen Reindl).++ * LaTeX reader:++ + Test \{,re}newcommand arguments (#4470, Evan Silberman).++ * Pod reader:++ + Consume blanks after =encoding in pod reader (#10537, Evan Silberman).++ * JATS writer:++ + Add CRediT roles to JATS (Charles Tapley Hoyt and Jez Cope, #10152).+ Enable annotating author roles using the Contribution Role Taxonomy+ (CRediT) and export this information in conformant JATS.++ * LaTeX writer/templates:++ + Improve babel support (#8283). Previously we used the `.ini`+ files for every language, but for European languages these tend to+ provide inferior results to the `.ldf` files used by classic+ Babel. Currently Babel documentation recommends using the classic+ system for European languages written in Latin and Cyrillic+ scripts and Vietnamese. So the LaTeX writer and template now+ follow this guidance.++ Main languages in the list of languages with good "classic" support+ are added to global documentclass options and will be automatically+ handled by Babel using the `.ldf` files.++ If the main language is not in this list, the `babeloptions` variable+ will be set to `provide=*`, which will cause support to be loaded from+ the `.ini` file rather than an `.ldf`. So, for example, setting+ `-V babeloptions=''` with a polytonic Greek document will cause the+ `.ldf` support to be used instead of the `.ini`.++ The default setting of this variable can be overwritten, but in most+ cases the default should give good results.++ + Allow `csquotesoptions` to be specified.+ + Fix indentation bugs in `font-settings.latex`.++ * Docx writer:++ + Repeat reference doc's `sectPr` for each new section (#10577).+ Previously we were only carrying over the reference doc's `sectPr`+ at the end of the document, so it wouldn't affect the intermediate+ sections that are now added if `--top-level-division` is `chapter`+ or `part`. This could lead to bad results (e.g. page numbering+ starting only on the last chapter).+ + Create section divisions with `--top-level-division=part` (#10576).+ + Improve title style in reference.docx; base Author and Date+ on Title; remove condensed spacing (Andrew Dunning, #10581).++ * Typst writer:++ + Brace tables with `typst:no-figure` and `typst:text` attributes (#10563,+ Gordon Woodhull).++ * Ms writer:++ + Fix escaping of `-` (#10536). `-` should now be escaped in man+ output but not in ms output (where `\-` is a unicode minus sign).++ * HTML styles: fix style of `hr` so it works when printed (#10535, Hendrik Erz).+ Previously `background-color` was used to style the hr, but this gets ignored+ when printing. This commit uses `border-top` instead.++ * Text.Pandoc.Shared:++ + Handle `<abbr>` as a span-like inline in `htmlSpanLikeElements`+ (#5793, Evan Silberman).++ * Text.Pandoc.MediaBag:++ + Prefer MIME type when determining extensions for MediaBag items (#10557,+ Max Heller). This should give different results for remote images+ that are served at URLs that do not contain misleading extensions+ (e.g. `shields.io`).++ * Text.Pandoc.Citeproc:++ + Fix moving punctuation before citation notes. This previously worked with+ regular citations, but not author-in-text citations. Now it works with both.++ * `doc/lua-filters.md`:++ + Correct luacheck URL (#10589, R. N. West).+ + Add static analysis paragraph to debugging section (#10568, R. N. West).+ + Add note about extensions handling in `read` and `write` (Albert Krewinkel).++ * `doc/extras.md`:++ + Add entry for pandoc-subfigs (R. N. West).+ + Update diagram Lua filter URL and description (R. N. West).++ * MANUAL.txt:++ + Add note on using typst to produce pdf/a-2b.+ + Document top-level-division functionality with Docx (#10579, Andrew Dunning).++ * Raise xml-conduit upper bound.++ * Depend on latest commonmark-pandoc, commonmark-extensions,+ citeproc, typst.++ * Makefile: make `make binpath` quiet.++## pandoc 3.6.2 (2025-01-12)++ * New input format: `pod` (Evan Silberman). Pod ("Plain old documentation")+ is a markup languaged used principally to document Perl modules and+ programs.++ * New reader module Text.Pandoc.Readers.Pod, exporting `readPod`+ [API change].++ * Docx reader:++ + Support row heads in tables (#9495). Reader: When `w:tblLook` has+ `w:firstColumn` set (or an equivalent bit mask), we set row heads = 1+ in the AST.+ + Read table styles as custom styles when `styles` extension+ is enabled (#9603).++ * HTML reader:++ + Add size information for font awesome SVG icons (#10134).+ If the icon has class `fa-fw` or `fa-w16` or `fa-w14`, we add a width+ attribute to prevent the icon from appearing full-width in PDF or+ docx output.++ * Djot reader:++ + Use a Span with class "mark" rather than "highlighted" for+ highlighted text, for consistency with the other pandoc readers and+ writers.++ * mandoc reader:++ + Add mdoc St for C23 (Evan Silberman).++ * RST reader:++ + Fix handling of underscores (#10497). Fixes a a regression+ introduced in 3.6.++ * Docx writer:++ + Support row heads in tables (#9495). Writer: set `w:firstColumn` in+ `w:tblLook` when there are row heads. (Word only allows one, so this+ is triggered by any number of row heads > 0.)++ * Djot writer:++ + Render a Span with sole class "mark" as highlighted text.++ * Asciidoc writer:++ + Don't emit the class in a span if it's just "mark" (#10511).+ The "mark" class is used for highlighting, and Asciidoc treats+ bare `#...#` with no attributes as highlighted text.+ + Improve escaping (#10385, #2337, #6424).++ * EPUB v2 writer:++ + Fix cover image (#10505). This is a regression introduced in 3.6.++ * Typst writer:++ + Fix handling of pixel image dimensions (#9945).+ These are now converted to inches as in the LaTeX writer.++ * Improve error message given when users specify `asciidoc` as input+ format (#8416, Santiago Zarate).++ * Allow random 1.3.++ * Use texmath 0.12.8.13 (typst improvements).++ * `lua-filters.md`: document `system.os` return values (#10523).++ * `MANUAL.txt`:++ + Improve manual's coverage of custom styles.+ + Replace LibreOffice PDF documentation link to latest so it links+ to the latest major release rather than a specific major release+ (which there are two of every year) (Stéphane Guillou).+ + Improve links and descriptions for `odt`, `opendocument` (#10518).++## pandoc 3.6.1 (2024-12-23)++ * Allow YAML bibliographies to be arrays of references (#10452).+ Previously, they had to be YAML objects with a `references` key.++ * Change `--template` to allow use of extensionless templates (#5270).+ The intent is to allow bash process substitution: e.g.,+ `--template <(echo "foo")`. Previously pandoc *always* added an+ extension based on the output format, which caused problems+ with the absolute filenames used by bash process substitution+ (e.g. `/dev/fd/11`). Now, if the template has no extension,+ pandoc will first try to find it without the extension, and+ then add the extension if it can't be found. So, in general,+ extensionless templates can now be used. But this has been+ implemented in a way that should not cause problems for+ existing uses, unless you are using a template `NAME.FORMAT`+ but happen to have an extensionless file `NAME` in the template+ search path.++ * Allow `--shift-heading-level-by=-1` to work in djot in the same way+ it works for other formats (with the top-level heading being+ promoted to metadata title) (#10459). This needed special+ treatment because of the way djot surrounds sections with Divs.++ * RST reader:++ + Handle explicit reference links (#10484, Evan Silberman).+ This case was missed when changing the reference link strategy for+ RST to allow a single pass. (It is a regression in pandoc 3.6.)++ * Markdown reader:++ + Use T.P.URI's `pBase64DataURI` in parsing data URIs (#10075,+ Evan Silberman and John MacFarlane).+ + More efficient base64 data URI parsing (#10075, Evan+ Silberman and John MacFarlane). This should yield dramatic+ performance improvements for markdown documents containing+ large data URIs in images.++ * HTML reader:++ + Don't canonicalize data: URIs (#10075). It can be very expensive+ to call network-uri's URI parser on these.++ * LaTeX reader:++ + Handle `figure*` environment as a figure (#10472).++ * MediaWiki reader:++ + Allow empty quoted attributes (#10490).+ + Allow cells starting with `+` (#10491).++ * Textile reader:++ + Improve parsing of spans (#9878). The span needs to be separated+ from its surroundings by spaces. Also, a span can have attributes,+ which we now attach.+ + Inline constructors shouldn't trigger if closer is preceded by+ whitespace (#10414).++ * Docx writer:++ + Put chapters in separate sections, and restart footnotes+ by section by default (#2773). The main effect of this change is that+ when `--top-level-division=chapter` is used, chapters will start on+ a new page and footnote numbering will restart for each chapter.+ Both of these defaults can be overridden in the reference.docx.+ + Use styleIds not styleNames for Title, Subtitle, etc.+ (#10282). This fixes a regression introduced in pandoc 3.5.+ This change affects the default openxml template as well as the+ OpenXML writer.++ * Markdown writer:++ + Avoid collapsing of initial/final newline in markdown raw blocks.+ This makes it easy to write a filter that adds extra blank lines+ before certain elements (#10477).++ * Mediawiki writer:++ + Escape line-initial characters that would otherwise be interpreted+ as list starts (#9700).++ * LaTeX writer:++ + Properly handle boolean value for `csquotes` variable (#10403).+ + Use displayquote for block quotes with `csquotes` (#10456).++ * HTML writer:++ + Avoid calling parseURIString for data URIs (#10075).+ This was done to determine the "media category," but we can+ get that directly from the mime component of data: URIs.++ * Typst writer:++ + Properly handle data URIs in images (#10460).++ * LaTeX/Beamer templates:++ + Fix default.beamer `nocite` location (Thomas Hodgson).+ It must be inside a frame or it is ignored (#10465).+ + Move nocites from LaTeX preamble to body (#10461, Thomas+ Hodgson). Putting `\nocite` in the preamble works only with biblatex.++ * Text.Pandoc.Parsing:++ + Correct example in comment on `charsInBalanced` (Evan Silberman).++ * Text.Pandoc.Error:++ + Mention typst in rendering `PandocUnknownWriterError` for `pdf`+ (Evan Silberman).++ * Text.Pandoc.MediaBag:++ + `insertMedia`: fast path for data URIs. Avoid the slow URI+ parser from network-uri on large data URIs (#10075).++ * Text.Pandoc.Class:++ + Add shortcut for base64 data URIs in `downloadOrRead` (#10075).+ This avoids calling the slow URI parser from network-uri on+ data URIs, instead calling our own parser.++ * Text.Pandoc.MIME:++ + Fix `extensionFromMimeType`. We had a few special cases encoded,+ but as previously written they wouldn't work properly with+ modifiers like `;charset=utf-8`.++ * Text.Pandoc.URI:++ + Export `pBase64DataURI`. Modify `isURI` to use this and avoid+ calling network-uri's inefficient `parseURI` for data URIs.++ * Text.Pandoc.PDF:++ + Fix temp file extension in `toPdfViaTempFile` (#10468).+ This fixes a regression in pandoc 3.6, which changed+ the extension from `html` to `source`. Apparently+ `wkhtmltopdf` needs it to be `.html`. So now we have added+ a parameter to `toPdfViaTempFile` that allows the extension+ to be specified in a way that is appropriate to the PDF engine+ used.++ * Lua (Albert Krewinkel):++ + Support more elements as input to `pandoc.utils.stringify`+ (#10450). Elements of type Caption, Cell, TableHead, and TableFoot+ can now be stringified.+ + Add `Caption` constructor to `pandoc` module.++ * Miscellaneous code quality improvements (Joseph C. Sible).++ * Depend on citeproc 0.8.1.2, skylighting and skylighting-core+ 0.14.5.++ * `doc/lua-filters.md: Fix links to constructors (Albert Krewinkel).+++## pandoc 3.6 (2024-12-07)++ * Add `mdoc` as input format (Evan Silberman). This change+ introduces a reader for mdoc, a roff-derived semantic markup+ language for manual pages. This reader has been developed almost+ exclusively against mandoc's documentation and implementation of+ mdoc as a reference, and the real-world manual pages tested+ against are those from the OpenBSD base system. Of ~3500 manuals+ in mdoc format shipped with a fresh OpenBSD install, 17 cause the+ mdoc reader to exit with a parse error. Any further chasing of+ edge cases is deferred to future work.++ * New module: Text.Pandoc.Readers.Mdoc, exporting `readMdoc` [API change].++ * Issue warnings for duplicate YAML metadata keys (#10312).++ * Ensure that `--sandbox` affects `--embed-resources`. Previously it+ did not (contrary to what was implied by the manual), which means+ that an image with URL `/etc/passwd` would leak an encoded version+ of that file to HTML output with `--self-contained` or+ `--embed-resources`, even if `--sandbox` was used. Thanks to+ Samuel Mortenson for pointing out the issue.++ * Text.Pandoc.App.OutputSettings: add `sandbox'` function.+ This computes the sandboxed files from Opt and avoids code repetition.++ * Docx reader:++ + Parse index references as empty spans with attributes (#10171).+ Attributes included are `entry`, and optionally `bold`, `italic`,+ `yomi`, `see`.+ + Don't create multiple paragraphs for title or subtitle (#10359).+ If there are multiple paragraphs with Title or Subtitle style,+ use only the first for metadata.+ + Handle case where Zotero `itemData` has different id from the+ `citationItem` id. In this case we use the `citationItemId`+ in the bibliography as well, overriding the `referenceId`+ in the itemData (#10366).++ * LaTeX reader:++ + Put parsed minipage in specially marked Div (#10266).++ * HTML reader:++ + Parse footnotes defined by dpub-aria roles (#5294).++ * MediaWiki reader:++ + Fix indented tables with caption (#10390).+ + Fix parsing of col/rowspan (#6992).++ * Typst reader:++ + Avoid generating empty paragraphs.+ + Support `underparen`, `overparen`.+ + Fix `#quote` attribution. If attribution is not present, don't print+ the `--` (#10320).+ + Fix typo in unicode code point for em dash (see #10320).++ * Commonmark reader:++ + `implicit_figures` should check for empty caption+ and not produce an implicit figure in this case (#10429).++ * RST reader:++ + Use a new one-pass parsing strategy. Instead of having an initial pass+ where we collect reference definitions, we create links with target+ `##SUBST##something` or `##REF##something` or `##NOTE##something`,+ and resolve these in a pass over the parsed AST. This allows us to handle+ link references that are not at the top level (#10281).+ + Ignore newlines in URL in explicit link (#10279).+ + Handle block level substitutions.+ + Support `:file:` on raw directive (#8584).+ + Implement option lists (#10318).+ + Avoid putting metadata in Para (#7766). Create MetaInlines when possible,+ just as with markdown input. MetaBlocks is still used when there are+ multiple paragraphs or non-paragraph content.+ This change also affects field lists.+ + Fix linked substitutions (#6588). E.g. `|Python|_`.+ + Support inline anchors (#9196).+ + Explicit links define references (#5081). For example,+ ``Go to `g`_ `g <www.example.com>`_.`` should produce two links to+ www.example.com.++ * EPUB writer:++ + Use standardized filename for cover image instead of the original name+ (#10404). This avoids problems with e.g. filenames containing spaces.++ * Markdown writer:++ + Issue INFO warning when not rendering table, e.g., when `raw_html` is+ disabled and the table can't be fit into a supported markdown table+ format (#10407).+ + Respect empty LineBlock lines in `plain` output (Evan Silberman).+ The plain writer behaved as a markdown variant with `Ext_line_blocks`+ turned off, and so empty lines in a line block would get eliminated.++ * LaTeX writer:++ Ensure that beamer footnotes go on frame, not column (#5769).++ * HTML writer:++ + Unwrap empty incremental divs (#10328, Albert Krewinkel).+ Divs are unwrapped if the only purpose of the div seems to be to control+ whether lists are presented incrementally on slides.++ * Typst writer:++ + Make template sensitive to a `page-numbering` variable (#10370).+ This can be set to an empty string (or, in metadata, to false) for+ no page numbers.+ + Make `smart` extension work (#10271). If `smart` is not enabled, a command+ in the default template will disable smartquote substitutions.+ When `smart` is enabled, render curly apostrophes as straight+ and escape straight apostrophes. When `smart` is disabled,+ render curly apostrophes as curly and don't escape straight+ apostrophes. Similarly for quotes, em and en dashes. This should+ give more idiomatic typst output, with fewer unnecessary+ escapes.++ * ANSI writer:++ + Respect empty LineBlock lines (Evan Silberman).++ * JATS writer:++ + Correct spelling of suppress attribute (#10350, Andreas Deininger).++ * Typst template:++ + Remove `definitions.typst` partial.+ + Remove unnecessary definition of `endnote`.+ + Incorporate the one remaining definition into `default.typst`.+ + Use typst 0.12 code for two column layout (#10294, Luis Rivera).+ + Note: the new templates presuppose typst 0.12; if you try to use an+ earlier version of typst, an error will be raised.++ * LaTeX/Beamer template:++ + Split `fonts.latex` partial into two parts: `fonts.latex` and+ `font-settings.latex`.+ + In beamer template, load beamer theme between `fonts.latex` and+ `font-settings.latex`. This allows a theme (such as metropolis)+ to set its own default font, while still allowing the user to+ override it. This fixes a regression in pandoc 3.5 (#10297).+ + Note: Users who have custom templates based on pandoc 3.5 templates will+ need to add `font-settings.latex()` after `fonts.latex()` in the+ latex template. In a beamer template, the beamer theme-setting+ code needs to be moved between these two partials.++ * ConTeXt template: Ensure that font names don't wrap (#10305).++ * `epub.css`: remove background-color (#10264, Suraj Patil).+ With this greyish background color, epubs look bad on a Kindle (#10263).++ * Text.Pandoc.ImageSize: add WebP support (Evan Silberman, #10397).+ Add `Webp` constructor on ImageType [API change].++ * Text.Pandoc.Readers.Roff and a new unexported module+ Text.Pandoc.Readers.Roff.Escape: parameterize Roff+ escaping (Evan Silberman) [API change]. This allows code to+ be reused between the mdoc and man readers, despite the+ differing Token types.++ * Text.Pandoc.PDF:++ + PDF via LaTeX: always do max runs if `toc` is present (#10308).+ The old method (checking to see if toc hash had changed) is not+ completely reliable.+ + Use `.source` extension, not `.html`, in `toPdfViaTempFile` (#10314).++ * Text.Pandoc.Logging: add `YamlWarning` constructor to `LogMessage`+ [API change] (#10312).++ * Text.Pandoc.Format: remove duplicate typst entry (#10388, Caleb Mclennan).++ * Fix a typo in the `ua.yaml` localization for 'See' (Jens).++ * Lua subsystem (Albert Krewinkel):++ + Remove prefixes from Lua type names (#8574). Lua type names were+ inconsistent with regard to the use of prefixes; all prefixes+ are removed now, and Lua types now have the same name as the+ Haskell types. The use of app-specific prefixes is suggested by+ the Lua manual to avoid collisions. However, this shouldn't be a+ problem with pandoc, as it cannot be used as a Lua package.++ * doc/libraries.md: Add newly developed Haskell packages.+ Sort list alphabetically (Albert Krewinkel).++ * doc/lua-filters.md: document `pandoc.List:iter` method (Albert Krewinkel).+ List objects have a new function `iter` that returns an iterator+ function that returns the next list item on each call.++ * MANUAL.txt:++ + Clarify what the example of YAML EPUB metadata shows (#10405).+ + Fix typo in template syntax (#10265, Pascal Wagler).+ + Update manual with information on openxml template (#10273).+ + Clarify that `--variable` can only assign string values (#10298).++ * Fix comments in TEI writer referring to DocBook (#10430, Evan Silberman).++ * Fix several typos in documentation (#10349, Andreas Deininger).++ * Allow Diff 1.0.++ * Add font-settings.latex partial to pandoc.cabal (#10379).++ * Bump upper bound for data-default.++ * Use latest typst, texmath, pandoc-lua-marshal, commonmark-pandoc,+ commonmark-extensions, skylighting, skylighting-format-blaze-html.+++## pandoc 3.5 (2024-10-04)++ * Add command-line options `--list-of-figures/--lof` and+ `--list-of-tables/--lot` (#10029, Akash Patel).+ Only docx, latex, and context are affected by these options currently.+ Setting the `lof` and `lot` variables will also work for the formats+ that are currently supported.++ * Defaults files: interpolation of environment variables now+ works for `to` and `from` fields (#8024). This is needed because+ these files can contain paths of custom readers/writers.++ * Docx reader:++ + Reset lists after headers in same list `numId` (#10258).+ To accomplish this, we add a Heading constructor to BodyPart and+ include on it all the information list items have.++ * DocBook reader:++ + Parse id, class, and tabstyle on tables (#10181, Erik Rask).+ Add parsing of id (xml:id), class, and tabstyle XML attributes+ for table and informaltable in the DocBook reader.+ The tabstyle value is put in the 'custom-style' attribute.++ * Dokuwiki reader:++ + Be more forgiving about misaligned lists, like dokuwiki itself (#8863).+ + Improve blockquote parsing in dokuwiki. Allow for quoted code blocks.+ + Enable smart extension.+ + Properly parse `--` and `---` as dashes.+ + Fix block quote behavior (#6461). Blockquotes are not really block+ containers in DokuWiki; the lines are interpreted literally (so,+ e.g., you can't start a list), and line breaks are added at the ends.++ * EPUB reader:++ + Fix links to other files in the EPUB, making them internal links+ to a fragment derived from the filename (#10207). There was+ already code to handle links like `#foo`, but not to handle links+ like `ch0001.html#foo`.++ * LaTeX reader:++ + Add em, ex, px, mu to list of units for dimension args (#10212).++ * ANSI writer:++ + Fix subscripts (Evan Silberman).++ * DokuWiki writer:++ + Don't emit `<HTML>` tags (#7413). The use of these tags is now+ strongly discouraged for security reasons, and will be removed.+ We previously used them as a fallback for lists that could not+ be represented using DokuWiki syntax, e.g. ordered lists with+ fancy numbers or lists with multiple blocks in their items.+ We also used them for block quotes with multiple blocks as+ their contents. We now use the `<WRAP>` syntax (from the optional+ WRAP plugin) to handle lists with multiple blocks as their contents.+ A new method of handling block quotes with complex contents+ has the side benefit of also handling nested block quotes,+ which weren't supported before.+ `<HTML>` and `<html>` tags are only for raw HTML blocks and+ inlines, and only if the `raw_html` extension is enabled. (It is+ now a valid extension for `dokuwiki`, though off by default.)++ * Docx writer:++ + Support `--list-of-figures` and `--list-of-tables` (or `lof` and+ `lot` variables) (Akash Patel).++ * HTML writer:++ + Don't emit missing title/lang warnings if templates does not+ contain the `pagetitle` or `lang` variables respectively (#9370).++ * LaTeX writer:++ + Better fix for lists in definition lists (#10241).+ In commit a26ec96d89ccf532f7bca7591c96ba30d8544e4a we added an+ empty `\item[]` to the beginning of a list that occurs first+ in a definition list, to avoid having one item on the line with+ the label. This gave bad results in some cases (#10241) and there+ is a more idiomatic solution anyway: using `\hfill`.+ + Avoid error on `refs` div with empty citations (#10185).+ If there are no citations, don't emit an empty CSLReferences environment.++ * RST writer:++ + Change bullet list hang from 3 to 2. This accords with the style in+ the RST reference docs.+ + Handle cases where indented context starts with block quote (#10236).+ In these cases we emit an empty comment to fix the point from+ which indentation is measured; otherwise the block quote is not+ parsed as a block quote. This affects list items and admonitions.+ + Don't enclose the list table in a `.. table::`; this leads to+ doubled captions (#10226).+ + Fix alignment of list table items corresponding to cells (#10227).++ * JATS template:++ + Support `floats-group` (Albert Krewinkel, see #10196).+ The content of the `floats-group` variable is now rendered in a+ `<floats-group>` element when using the *publishing* or *archiving* tag+ sets.++ * LaTeX and Beamer templates:++ + Split old default.latex into two templates, `default.latex` and+ `default.beamer`, factoring common parts into partials:+ `fonts.latex`, `common.latex`, `passoptions.latex`,+ `hypersetup.latex`, `after-header-includes.latex`.+ + Make `default.beamer` the default template for beamer.+ + Add `shorttitle`, `shortsubtitle`, `shortauthor`, `shortinstitute`,+ `shortdate` variables to beamer template (#10248, Thomas Hodgson).+ + Make `--number-sections` work with beamer (#12045, Thomas Hodgson).+ + Support a list of images for `titlegraphic` in beamer template+ (#10246, Thomas Hodgson). Title graphic options will be+ applied to each title graphic. Images will be separated by `\enspace`.+ + Beamer theme options (#10243)+ + Add theme options to beamer template: `colorthemeoptions`,+ `fontthemeoptions`, `innerthemeoptions`, `outerthemeoptions` (#10243,+ Thomas Hodgson).+ + Don't load amsmath, amssym in beamer template. These are loaded by+ beamer automatically.++ * Text.Pandoc.SelfContained:++ + Improve handling of links to remote CSS (#10261).++ * Text.Pandoc.Class:++ + Allow extracting `data:` URIs even in PandocPure (`--sandbox`)+ (#10249).+ + Export `extractURIData` [API change].++ * Text.Pandoc.PDF:++ + Read `.toc` and `.log` files from output directory (#10186).+ When this is different from the input directory, this is+ where `.toc` and `.log` files are written.++ * Text.Pandoc.Shared:++ + Modify `addPandocAttributes` for changes in commonmark-pandoc.+ The new commonmark-pandoc version automatically adds the+ attribute `wrapper="1"` on all Divs and Spans that+ are introduced just as containers for attributes that belong+ properly to their contents. So we don't need to add the+ attribute here. This gives much better results in some cases.+ Previously the wrapper attribute was being added even for+ explicit Divs and Spans in djot, but it is not needed in these cases.++ * Text.Pandoc.Options:++ + Add `writerListOfFigures` and `writerListOfTables` fields+ to `WriterOptions` (#8245, Akash Patel). [API change]++ * Text.Pandoc.App:++ + Add `optListOfFigures` and `optListOfTables` to `Opt` (#8245)+ [API change].++ * Lua subsystem (Albert Krewinkel):++ + Update List module (#9835). The module now comes with a method+ `:at(index[, def])` that allows to access indices, accepts+ negative indices to count from the end, and will return the+ `def` value as a default if the list has no item at the given position.+ Furthermore, the list constructor `pandoc.List` now accepts iterators.+ E.g., `pandoc.List(text:gmatch '%S+')` returns the list of words+ in `text`.+ + Support character styling via `pandoc.layout`. The `Doc` values+ produced and handled by the `pandoc.layout` module can now+ be styled using `bold`, `italic`, `underlined`, or `strikeout`. The+ style is ignored in normal rendering, but becomes visible when+ rendering to ANSI output. The `pandoc.layout.render` function+ now takes a third parameter that defines the output style,+ either *plain* or *ansi*.+ + It is now possible to return a single filter from a filter file, e.g.+ ``` lua+ -- Switch single- and double quotes+ return {+ Quoted = function (q)+ elem.quotetype = elem.quotetype == 'SingleQuote'+ and 'DoubleQuote' or 'SingleQuote'+ return elem+ end+ }+ ```+ The filter must not contain numerical indexes, or it might be treated+ as a list of filters.+ + Add `list_of_figures` and `list_of_tables` to writer options+ (Akash Patel).++ * Use latest releases of commonmark, commonmark-pandoc, texmath, djot.++ * Stop depending on package SHA (Albert Krewinkel). Use `crypton` instead.++ * `linux/make_artifacts.sh`: add riscv64 support (Olivier Benz).++ * Fix invalid XML in `test/docx/normalize.docx` (#10242).++ * `doc/lua-filters.md`: list functions in `pandoc.utils` alphabetically+ (Albert Krewinkel).++ * MANUAL.txt:++ + Clarify use of `beamerarticle` variable (#10250).+ + Add clarification to address user issues like #6704 (Yehuda Katz).++## pandoc 3.4 (2024-09-09)++ * New output format: `ansi` (for formatted console output) (Evan Silberman).+ Most Pandoc elements are supported and printed in a reasonable way, if+ not always ideally. This version does no detection of terminal+ capabilities, nor does it fall back to different output styles for+ less-capable terminals.++ * Add command line options `--table-caption-position` and+ `--figure-caption-position`. These allow the user to specify whether+ to put captions above or below tables and figures, respectively.+ The following output formats are supported: HTML (and related such+ as EPUB), LaTeX (and Beamer), Docx, ODT/OpenDocument, Typst.++ * Change default `--pdf-engine` via HTML to WeasyPrint (#10142).+ `wkhtmltopdf` is deprecated. `weasyprint` is the easiest-to-install,+ maintained alternative. For better results, one might prefer+ `pagedjs-cli`.++ * Org reader:++ + Fix parsing of src blocks with an `-i` flag (#10071, Albert Krewinkel).+ Tabs are now preserved in the contents of *src* blocks if the the block+ has the `-i` flag.++ * RTF reader:++ + Handle images inside `shp` contexts (#10145).++ * RST reader:++ + Improve simple table support (#10093). Multiline rows occur+ only when the *first* cell is empty; we were previously treating+ lines with *any* empty cell as row continuations. In addition, we+ no longer wrap multiline cells in Para if they can be represented+ as Plain. This is consistent with docutils behavior.++ * LaTeX reader:++ + Math environments don't have bracketed options (#10160).+ + Parse nested tabular environments (#4746).++ * Typst reader:++ + Change how "block" elements are handled. Previously they were+ always parsed as divs. But actually they can occur in some "inline"+ contexts. Now we first try to parse them as inlines, and only as+ blocks if that fails. A surrounding Div or Span element is added+ only if there is an identifier.++ * HTML reader:++ + Only parse main element's contents (if present) (#10140).+ If main has an id or class, we include a div with that id or class;+ otherwise just the contents.+ + Read TeX annotation in MathML content if present (#9971).+ + Better handle KaTeX-generated math (#9971). KaTeX emits the mathml+ followed by a span with an HTML fallback. Previously pandoc was+ converting both. We now ignore the HTML fallback span, marked+ with class `katex-html`.++ * Docx reader:++ + Add "SuppressAuthor" and "AuthorOnly" to citationMode+ when `+citations` is used (thomjur).++ * New module: Text.Pandoc.Writers.ANSI [API change] (Evan Silberman).++ * Docx writer:++ + Support `custom-style` attribute for docx table (Sebbones).+ + Support `--number-offsets`.+ + Make table/figure rendering sensitive to caption position settings.++ * OpenDocument writer:++ + Make table/figure rendering sensitive to caption position settings.++ * Typst writer/template:++ + Implement figure caption positions by triggering a show rule in+ the default template, which determines caption positions for+ figures and tables globally.+ + Don't include trailing semicolon after `@` style citations with suffixes+ (#10148).+ + Template: move header-includes before show doc (#9996, Gordon Woodhull).++ * LaTeX writer:++ + Make table/figure rendering sensitive to caption position settings (#5116).+ + Preserve locator labels with `--natbib` (#10057).++ * HTML writer/template:++ + Make `<figcaption>` placement sensitive to caption position+ settings. For tables, `<caption>` must be the first element, and+ positioning is determined by CSS, for here we set a variable+ which the default template is sensitive to.+ + Use `makeSectionsWithOffsets` for `writerNumberOffsets`,+ instead of the old, inefficient code.+ + Don't add doc-biblioref role to every link in a citation;+ only to links to the bibliography (#10156).+ + Add `data-` when rendering `label` attribute (#10048).++ * Markdown writer:++ + Avoid emitting markdown caption if table has fallen back to raw HTML,+ which will then contain a `<caption>` tag (#10094).+ + Make math sensitive to `tex_math_gfm` extension (#9121).+ This means that in GFM output, the "new style" math will be used+ by default, e.g.++ $`x=y`$++ ```math+ x = y+ ```++ To defeat this and get the older behavior, namely++ $x=y$++ $$x=y$$++ one could use `-t gfm-tex_math_gfm`.++ * AsciiDoc writer:++ + Add `link:` prefix when needed (#10105). AsciiDoc requires it+ except for `http`, `https`, `irc`, `mailto`, `ftp` schemes (#10105).+ + Preserve original base level (#10062). We used to normalize so+ that the base level is always 1, but asciidoc no longer seems+ to care about that, and the behavior creates difficulties when+ we are converting fragments.+ + Don't emit empty figure caption (#10047).++ * ODT writer:++ + Add TableCaption to styles.xml (#10058, Ian Max Andolina).++ * LaTeX template:++ + Fix wrong beamer color in (sub)section page (Jonathan).++ * Text.Pandoc.Options:++ + Add `CaptionPosition` and new `WriterOptions` fields+ `writerFigureCaptionPosition` and `writerTableCaptionPosition`+ [API change].++ * Text.Pandoc.Opt:++ + Change default for optNumberOffset to `[]`. This behaves the same as+ `[0,0,0,0,0]`.+ + Add `Opt` fields `optFigureCaptionPosition` and+ `optTableCaptionPosition` [API change].++ * Text.Pandoc.Format: change `formatFromFilePaths` so that it is+ smarter about URLs. URLs are parsed, and we take the format from+ the path component, if present (#10141). This means that+ `https://emacs.org/` will be treated as HTML, while+ `https://emacs.org/sample.org` will be treated as Org.++ * Text.Pandoc.URI:++ + Add unofficial `gemini:` to list of URI schemes (Pau RE).++ * Text.Pandoc.Shared:++ + Add `makeSectionsWithOffsets` [API change].+ + Remove `stripEmptyParagraphs [API change] (Albert Krewinkel).+ This function is no longer used.++ * Text.Pandoc.Highlighting: Expose `formatANSI` [API change]+ (Evan Silberman).++ * Text.Pandoc.Writers.Shared: export `to{Sub,Super}scriptInline`+ [API change] (Evan Silberman).++ * Remove use of partial functions (e.g. `head`) in code.++ * Use latest skylighting-core, skylighting, doclayout, texmath, typst.++ * pandoc-lua-engine: Add accessors for several writer options, including+ some that were added in previous releases.++ * pandoc-server: Initialize some missing fields in WriterOptions:+ `writerEpubTitlePage`, `writerChunkTemplate`, `writerListTables`,+ `writerFigureCaptionPosition`, `writerTableCaptionPosition`.++ * CONTRIBUTING.md: Summarize steps for adding a new cli option.++ * MANUAL.txt:++ + Clarify that the `--number-offset` option should only+ directly affect numbering of the first section heading in+ a document; subsequent headings will increment normally.+ + Fix asciidoc link (#10039).+ + Fix CSL Docs broken link (#10100, Tristano Ajmone).+ + Document the use of `luatexja` when CJKmainfont is used with lualatex+ (#3873, Kolen Cheung).+ + Add a `citations` (typst) section to the manual (#9127).+ + Clarify that `citations` affects both input and output for `org`.+ + Add note on `--citeproc` that you may need to disable `citations`+ extension on the output format (e.g., `-t markdown-citations`) to+ see the rendered citation (#9127, #10012).++ * INSTALL.md — reorganise info on static binaries and add conda-forge+ install options (#10098, #10069, Ian Max Andolina).++## pandoc 3.3 (2024-07-28)++ * New cli option: `--link-images`. This causes images to be linked+ rather than embedded in ODT.++ * Allow `--number-sections` to take an optional `true|false` argument.++ * RTF reader:++ + Handle `\*\shppict` without dropping image (#10025).++ * TWiki Reader:++ + Recognize WikiWords as internal links (#9941).+ + Avoid partial function.++ * Typst reader:++ + Ignore 'pad' and just parse its body (#9958).+ + Use typst 0.5.0.5. Fixes parsing of equations like `$1.$`.++ * Docx writer:++ + Fix regression with nested lists (#9994). The bug affects e.g.+ ordered lists with bullet sublists; after the sublist the top-level+ list reverts to bullets instead of being properly numbered.+ This is a regression introduced in version 3.2.1.++ * BibTeX writer:++ + Ensure that "literal" names are enclosed in braces (#9987).++ * Man writer:++ + Use default middle header when metadata does not include `header`+ (#9943). This change causes pandoc to omit the middle+ header parameter when `header` is not set, rather than+ emitting `""`. The parameter is optional and man will use+ a default based on the section if it is not specified.++ * HTML templates: don't load polyfill (#9918).+ This was added in a period when MathJaX required polyfill.+ MathJaX no longer recommends this and polyfill should no+ longer be necessary on any reasonably modern browser.++ * Translations:++ + Add `ua.yaml` (Jens Oehlschlägel).+ + Add a script (`tools/update-translations.py`) and Makefile+ target (`update-translations`) to update translation data+ automatically from babel and polyglossia upstream+ (Stephen Huan).+ + Use this script to update language data, increasing the number+ of languages we cover (Stephen Huan). Fix a few small bugs in+ existing translations.++ * Fix some mistakes with Japanese language code (#9938).+ In several places we were mistakenly assuming that the BCP 47 code for+ Japanese language was `jp`. It is `ja`.++ * Text.Pandoc.Options:++ + New field in WriterOptions: `writerLinkImages` [API change] (#9815).++ * Text.Pandoc.App.Opt:++ + New field in Opt: `optLinkImages` [API change] (#9815).++ * Lua subsystem:++ + Keep `lpeg` and `re` as "loaded" modules (Albert Krewinkel).+ The modules `lpeg` and `re` are now treated as if they had been+ loaded with `require`. Previously the modules were only assigned+ to global values, but could be loaded again via `require`,+ thereby allowing to use a system-wide installation. However, this+ proved to be confusing.++ The old behavior can be restored by adding the following lines to+ the top of Lua scripts, or to the `init.lua` in the data dir.++ debug.registry()['_LOADED'].lpeg = nil+ debug.registry()['_LOADED'].re = nil++ * `pandoc-cli`: Include pandoc copyright in Lua version info (Albert+ Krewinkel).++ * `pandoc-cli`: Refer printing of version info to the Lua interpreter+ (Albert Krewinkel). The Lua interpreter no longer terminates when+ called with `-v` or `--version` arguments, thus improving+ compatibility with the default `lua` interpreter program.++ * Avoid partial functions in JATS reader, DocBook writer, Haddock reader.++ * Allow tls 2.1.x.++ * MANUAL.txt:++ + Make documentation of extensions clearer (#9060).+ + Fix section level for two Extensions entries.++ * lua-filters.md: Partially autogenerate docs for module `pandoc`+ (Albert Krewinkel). The documentation system isn't powerful enough to+ generate the full documentation automatically.++## pandoc 3.2.1 (2024-06-24)++ * Fix `gfm_auto_identifiers` to replace emojis with their aliases,+ as documented (#9876).++ * CSV reader:++ + Turn line breaks into LineBreaks not SoftBreaks (#9797).++ * Docx reader:++ + Support task lists (#8211).+ + Fix a small bug in parsing delimiters in numbered lists,+ which led to the default delimiter being used wrongly in some cases.+ + Improve handling of captions.+ - Turn captioned images into Figure elements. Closes #9391.+ - Improve the logic for associating elements with captions (#9358).+ - Ensure that captions that can't be associated with an+ element aren't just silently dropped (#9610).+ + Support HorizontalRule. We support both pandoc-style and the style+ described on a Microsoft support page, an empty paragraph with+ a bottom border (#6285).+ + React to `"left"` value on `jc` attribute.+ + Handle column and cell alignments (#8551). We take the column alignments+ from the first body row.+ + Fix a bug that caused comments inside insertions or deletions+ to be ignored (#9833).++ * HTML reader:++ + Better handle non-`li` elements in `ul` and `ol` (#9809).+ For example, a `p` after a closed `li` will be incorporated into+ the previous `li`. This mirrors what browsers do with this+ invalid HTML.++ * LaTeX reader:++ + Fix parsing of dimensions beginning with `.`, e.g. `\kern.1pt` (#9902).++ * Markdown reader:++ + Allow author-only textual citations (#7219). E.g. `-@reese2002`+ outside of brackets.++ * RST reader:++ + Tighten up rules for when emphasis can start (#9805).+ + Support `:cite:` role with citeproc (#9904). A subset of the+ functionality of the sphinxcontrib-bibtex extension to Sphinx+ is supported.++ * Textile reader:++ + Don't let spans begin right after a symbol (#9878).++ * Typst reader:++ + Fix an incomplete pattern match (#9807).+ + Handle inline bodies ending in a parbreak. E.g.+ ```+ `#strong[+ test+ ]+ ```++ * ConTeXt template: remove `\setupbackend[export=yes]` (#9820).++ * Docx writer:++ + Allow OpenXML templates to be used with `docx` (#8338, #9069, #7256,+ #2928). The `--reference-doc` option allows customization of styles in+ docx output, but it does not allow one to adjust the content of the output+ (e.g., changing the order in which metadata, the table of contents,+ and the body of the document are displayed), or adding boilerplate+ text before or after the document body. For these changes, one can+ now use `--template` with an OpenXML template. (See the default+ `openxml` template for a sample.) `--include-before-body` and+ `--include-after-body` can also now be used with `docx` output.+ The included files must be OpenXML fragments suitable for+ inclusion in the document body.+ + New unexported module Text.Pandoc.Writers.Docx.OpenXML.+ + Omit `jc` attribute on table cells with AlignDefault (#5662).+ + Better formatting for task lists. Task lists are now properly+ formatted, with no bullet (#5198).+ + Replace an expensive generic traverse to remove Space elements,+ for better performance.+ + Wrap figures with `id` in a bookmark (#8662).+ + Add eastAsia font hints to `w:r` (#9817). We do this when the text+ in the run contains any CJK characters. This ensures that ambiguous+ code points (e.g. quotation marks) will be represented as "wide"+ characters when together with CJK characters.+ + Clean up Abstract Title and Subtitle in default reference docx.+ Center Subtitle, remove color.++ * HTML writer:++ + Ensure URI escaping needed for `html4` (#9905).+ Unicode characters need not be escaped for html5, and still won't be.+ + Don't emit unnecessary classes in HTML tables (#9325, Thomas Soeiro).+ Pandoc used to emit a `header` class on the `tr` element that forms+ the table header. This is no longer needed, because `head > tr` will+ do the same thing. Similarly, pandoc used to emit `even` and `odd`+ classes on `tr`s, allowing striped styling. This is no longer needed,+ because one can use e.g. `tbody tr:nth-child(2n)`.+ Compatibility warning: users who relied on these classes to style+ tables may need to adjust their CSS.++ * JATS writer:++ + Support `supplementary-material` in metadata for `jats_articlepublishing`+ (#9818).++ * LaTeX writer:++ + New method for ensuring images don't overflow (#9660).+ Previously we relied on graphicx internals and made global+ changes to Gin to force images to be resized if they exceed+ textwidth. This approach is brittle and caused problems+ with `\includesvg` (see #9660). The new approach uses a new macro+ `\pandocbounded` that is now defined in the LaTeX template.+ (Thanks here to Falk Hanisch in https://github.com/mrpiggi/svg/issues/60.)+ The LaTeX writer has been changed to enclose `\includegraphics`+ and `\includesvg` commands in this macro when they don't explicitly+ specify a width or height. In addition, the writer now adds+ `keepaspectratio` to the `\includegraphics` or `\includesvg`+ options if `height` is specified without width, or vice versa.+ Previously, this was set in the preamble as a global option.+ Users should attend to the following compatibility issues:+ - If custom templates are used with the new LaTeX writer, they will have+ to be updated to include the new `\pandocbounded` macro, or an error+ will be raised because of the undefined macro.+ - Documents that specify explicit dimensions for an image may render+ differently, if the dimensions are greater than the line width or+ page height. Previously pandoc would shrink these images to fit,+ but the new behavior takes the specified dimensions literally.+ In addition, pandoc previously always enforced `keepaspectratio`,+ even when width and height were both specified, so images with+ width and height specified that do not conform to their intrinsic+ aspect ratio will appear differently.+ + Task lists must be unordered (#9185).+ + Specify language option for `selnolig` and only include it if+ `english` or `german` is used (#9863). (This includes changes to the+ LaTeX template.) This should restore proper ligature suppression when+ lualatex is used.+ + Fix `--toc-depth` with beamer output (#9861). Previously only top-level+ sections were ever included in the TOC, regardless of the setting of+ `--toc-depth`.+ + Use `\linewidth` instead of `\columnwidth` or `\textwidth`+ for resizing figures, table cells, etc. in LaTeX (#9775).+ `\linewidth`, unlike the others, is sensitive to indented environments+ like lists.++ * LaTeX template: put `babel-lang` in options to beamer (#9868).+ This is required to make beamer use proper localized terms for+ things like "Section."++ * Markdown writer:++ + Don't print extra caption when using `implicit_figures`.+ + Ensure blank line after HTML blocks in commonmark-based formats (#9792).+ + Fix bug rendering block quotes in lists (#9908).++ * Texinfo writer:++ + Ensure proper escaping in all node/link contexts.+ + Target node rather than anchor when possible in internal links.+ + Remove illegal characters from internal link anchors (#6177).+ + Use two commas not one in `@ref`.+ + Don't add anchors to headings. We don't need them, now that we+ make internal links use the node.+ + Avoid duplicate node names.+ + Improve menus. Properly handle the case where the node name is+ different from the descriptive title.++ * Texinfo template: add variables for filename and version.++ * Typst writer:++ + Support '.typst:no-figure' and 'typst:figure:kind=kind' attributes+ (#9778, Carlos Scheidegger). This extends support for fine-grained+ properties in Typst. If the `typst:no-figure` class is present on a+ Table, the table will not be placed in a figure. If the+ `typst:figure:kind` attribute is present, its value will be used+ for the figure's `kind` (#9777). These features are documented in+ `doc/typst-property-output.md`.++ * Typst template:++ + Add subtitle (#9747, Mickaël Canouil).+ + Use content rather than string for title, author, date, email (#9823).+ This allows formatting in title, author, date, and email fields.+ Since the PDF metadata requires a string, and typst only+ converts the title to a string (not the authors), we use++ * Textile writer:++ + Get rid of header, odd, even classes on `tr` (#9376).++ * Text.Pandoc.Class:++ + `fillMediaBag`: Convert IOErrors to warnings when fetching absolute+ paths (#9859, Albert Krewinkel). This will allow many conversions that+ would have failed with an error to succeed (albeit without images or+ other needed resources).++ * Text.Pandoc.ImageSize:++ + Don't prefer exif width/height when they conflict with image+ width/height (#9871). That was a mistaken call in #6936.+ Usually when these values disagree, it is because the image+ has been resized by a tool that leaves the original exif values+ the same, so the width/height metadata are more likely to be+ correct that exif width/height.++ * Text.Pandoc.SelfContained:++ + Strip CRs from XML before base64 encoding for data URI+ (so tests can work on Windows).+ + Only create `<svg>` elements for SVG images when the image has+ the class `inline-svg`. Otherwise just use a `data` URI as we do+ with other images (#9787).++ * Lua subsystem (Albert Krewinkel):++ + Split Init module into more modules. The module has grown unwieldy and+ is therefore split into three internal Haskell modules, `Init`,+ `Module`, and `Run`.+ + Add function `pandoc.utils.run_lua_filter` (#9803).+ + Add function `pandoc.template.get` (#9854, co-authored by Carsten Gips).+ The function allows to specify a template with the same argument value+ that would be used with the `--template` command line parameter.+ + Keep CommonState object in the registry. The state is an internal+ value and should be treated as such. The `PANDOC_STATE` global is+ merely a copy; unsetting the global no longer breaks the Lua engine.+ + Allow passing an environment to `run_lua_filter`.+ The default is now to use a *copy* of the global environment when running+ a filter; this ensures better separation when `run_lua_filter` is used+ multiple times. A custom environment can be specified via the+ optional third parameter.+ + Set `pandoc.List` as default metatable for JSON lists (#9834).+ Lists created by `pandoc.json.decode` now behave like lists generated+ via `pandoc.List`. This also ensures that `pandoc.List` tables are+ encoded as JSON arrays when passed to `pandoc.json.encode`.++ * Text.Pandoc.Writers.Shared: export `toTaskListItem` [API change].++ * Add unexported module Text.Pandoc.Char. This exports `isCJK`.+ Use this instead of locally defined `isCJK` in T.P.Readers.MediaWiki.++ * MANUAL.txt:++ + Remove false claim that Lua mode does not support `-i` (#9757,+ Ian Max Andolina).+ + Use level-3 headings for extensions (to avoid gaps).+ + Add anchor for tagging extension.+ + Remove explicit referencess to generate anchors.+ These will be linkified automatically.+ + Fixed links to `option--reference-doc`.+ + Add a note that column widths aren't supported in pptx for Divs+ with class `columns` (#9890).+ + Fix alerts example (#9826, Ian Max Andolina).+ + Fix markup of `babelfonts` example code (Albert Krewinkel).++ * `doc/custom-writers.md`:++ + Fix usage of Template in example (Albert Krewinkel).+ + Document the separator arg of `Writer.Blocks` (Albert Krewinkel).++ * `doc/lua-filters.md` (Albert Krewinkel):++ + Fix outdated documentation for math and quoting functions and fields.+ + Autogenerate docs for module `pandoc.template` and `pandoc.layout`.+ + Document operators of the "Doc" type.++ * pandoc-lua-engine: depend on pandoc >= 3.2 (see #9755).++ * Allow crypton-connection 0.4, time 1.14.++ * Allow tasty-quickcheck 0.11.++ * Use latest emojis, skylighting, skylighting-core, citeproc, djot,+ commonmark-extensions, typst-hs++## pandoc 3.2 (2024-05-11)++ * Change to `--file-scope` behavior (#8741): previously a Div with an+ identifier derived from the filename would be added around the contents+ of each file. This caused problems for "chunking" files into chapters,+ e.g. in EPUB. We no longer add the surrounding Div. This cooperates+ better with chunking. Note, however, that if you have relied on the old+ behavior to link to the beginning of the contents of a file using+ its filename as identifier, that will no longer work.++ * Markdown reader:++ + Allow repeated labels in numbered example lists.+ Previously if you tried to use the same label as an earlier+ example list item, you'd get a new number, not the old one,+ and references to the label would go to the second occurrence.+ Now an existing label will be reused, and no new number will+ be generated. Caveat: this only works reliably when the+ re-used example list item occurs by itself in a list, or+ occurs in a list of previously used example list items that+ occur in exactly the same order as previously.+ + Fix `normalCite` so it doesn't consume past a closing `]` boundary+ (#9710). This was causing an exponential performance bug on long+ lists of links containing potential emphasis characters.+ + Generalize `inlinesInBalancedBrackets` to `inBalancedBrackets`,+ with a parameter for the inner parser.+ + Auto-close unclosed divs (#9635). This applies to both fenced and+ HTML-ish varieties. Otherwise we face an exponential performance+ problem with backtracking. A warning is issued when a div is+ implicitly closed.++ * RST reader:++ + Fix `figclass` and `align` annotations for figures (#7473, Gokul+ Rajiv).++ * LaTeX writer:++ + Use `polytonicgreek` instead of `polutonikogreek` with babel (#9698).+ `polutonikogreek` is outdated. Also recognize both in the LaTeX+ reader.+ + Improve treatment of math inside soul commands (#1294, #5529).+ soul commands (`ul`, `hl`, `st`) are very fragile and the math+ must be handled specially.++ * LaTeX reader:++ + Fix over-eager macro expansion in conditionals (#9676).+ + Parse `flalign`, `flalign*` math environments (#9679). We parse+ these as Math elements with an `aligned` environment. Semantically+ it's not exactly the same, but better than falling back to raw LaTeX.++ * LaTeX template: add `titlegraphicoptions` variable (#9207, Guilhem+ Saurel).++ * Docx reader:++ + Issue warning rather than error when we can't parse EndNote citations+ (see #8433).+ + Fix anchor in header after anchor (#9626, mbracke).++ * RTF reader:++ + Don't try to handle non-default code pages (#9683). Emit a warning+ instead.++ * OpenDocument writer:++ + Implement custom-style for spans (#9657).++ * Typst writer:++ + Add blank line in definition lists with multiple definitions (see+ #9704).+ + Property output (#9648, Gordon Woodhull). The Typst writer will pass+ on specially marked attributes as raw Typst parameters on selected+ elements. This allows extensive customization using filters.+ A separate document (`doc/typst-property-output.md`) has been added+ that provides extensive documentation and examples of the use of+ this feature.++ * Markdown writer:++ + Don't try to align columns in pipe tables with lines greater than+ COLUMNS. The alignment just reduces readibility when the lines+ soft wrap.+ + Don't use `raw_attribute` syntax for raw blocks, unless there is no+ other option (see #9677). Macros in a `raw_attribute` block don't+ get interpreted when it is read again by pandoc's markdown reader.++ * ConTeXt writer:++ + Replace depreciated `\sc` with `\setsmallcaps` (#9518, James P.+ Ascher).++ * Docx writer:++ + Use conventional styles/indents for Word bullet lists (#7280).++ * `reference.docx`:++ + Use current standard Word theme (#7280). This includes using the+ sans-serif font Aptos instead of the serif font Cambria, and+ default colors for headings.+ + Remove duplicate `DefaultParagraphFont` in `styles.xml`.++ * New module Text.Pandoc.Transforms [API change] (Albert Krewinkel).+ This module exports the following functions which were formerly+ exported from Text.Pandoc.Shared: `headerShift`,+ `filterIpynbOutput`, `eastAsianLineBreakFilter`, as well as some+ functions that were previously not exported.++ * Text.Pandoc.Shared:++ + `headerShift`, `filterIpynbOutput`, and `eastAsianLineBreakFilter`+ are no longer exported from this module; they are now exported+ from Text.Pandoc.Transforms (Albert Krewinkel).++ * Text.Pandoc.Error:++ + Improve reporting of unsupported extensions errors (#9247, Albert+ Krewinkel).++ * Text.Pandoc.App:++ + Move "transforms" after filters (#9664). This will mean that+ `--shift-heading-level-by` affects a heading added by+ `reference-section-title`.++ * Text.Pandoc.App.CommandLineOptions:++ + Simplify output for `OptVersion`. Omit the information about versions+ of dependencies. We no longer emit version info at this level anyway;+ `pandoc-cli` intercepts and handles `--version`. This code would+ only be called if someone used the pandoc library function+ `handleWithOptInfo` in their own program.++ * Text.Pandoc.ImageSize:++ + Export `ImageSize` datatype.++ * Text.Pandoc.SelfContained:++ + Merge class attribute when both img and svg specify it (#9652,+ Carlos Scheidegger).++ * Text.Pandoc.Logging:++ + Add `ScriptingInfo` constructor for `LogMessage` [API change]+ (Albert Krewinkel).+ + Make `DocxParserWarning` a WARNING, not INFO. [API change].+ + Add `UnsupportedCodePage` constructor to `LogMessage` [API change].+ + Add `UnclosedDiv` constructor for `LogMessage` [API change].++ * Lua subsystem (Albert Krewinkel:++ + Add a `pandoc.log` module.+ + Uupdate to pandoc-lua-marshal version 0.2.7 (#8916).+ This fixes counterintuitive behavior of the `content` property on+ BulletList and OrderedList items. Unmarshalling of that field now+ matches the behavior of the constructor.+ + Use newest zip module. This adds a `symlink` function to Entry objects,+ allowing to check if an entry represents a symbolic link.+ + Improve `pandoc.json.decode` docs.+ + Update and fix docs for `pandoc.types.Version` and `pandoc.utils.type`.+ + Add new module `pandoc.image` The module provides basic querying+ functions for image properties.+ + Bump pandoc-lua-engine to 0.2.1.4.++ * Use latest KaTeX CDN asset (#9707, Salim B).++ * `pandoc-cli`: ensure UTF8 when emitting version info.++ * tools/update-lua-module-docs.lua: improve script-internal docs, cleanup+ (Albert Krewinkel).++ * Allow network 3.2.++ * Use latest versions of texmath, djot, skylighting-core, skylighting.++ * Fix command test for #9652.++ * Fix some typos in code comments (#9638, guqicun).++ * Command tests: include regular PATH after directory with the test+ executable (ensures that DLLs will be found on Windows).++ * MANUAL.txt:++ + Document `handout` variable for beamer (#9742).+ + Document formats affected by `--slide-level` (#9745).+ + Update the list of required LaTeX packages (#9728, Albert Krewinkel).+ + Use more descriptive link text for ODT (#9673).+ + Add clarification about `toc-title` in `docx`, `pptx` (#9645).+ + Better document truthiness for conditionals (#9661).+ + Mention that `custom-style` works with ODT (Ian Max Andolina).+ + Harmonize typographic dashes (#9688, Salim B). Standardize on `---`+ with no space.++ * INSTALL.md: Minor tweaks (#9705, Leo Heitmann Ruiz).++## pandoc 3.1.13 (2024-04-07)++ * Org reader:++ + Fix treatment of `id` property under heading (#9639).++ * DocBook reader:++ + Add empty title to admonition div if not present (#9569).+ This allows admonition elements (e.g. `<note>`) to work with+ `gfm` admonitions even if the `<title>` is not present.++ * DokuWiki reader:++ + Link text cannot contain formatting (e.g., `//` is not italics) (#9630).+ + An explicitly empty link text (`[[url|]]`) works the same as an omitted+ link text (#9632).++ * Typst reader:++ + Support Typst 0.11 table features: col/rowspans, table head+ and foot (#9588).+ + Parse cell col/rowspans.++ * CSLJson writer:++ + Put `$` or `$$` around math in `csljson` output (#9616).++ * ConTeXt writer:++ + Fix options order with `\externalfigure`. The dimensions should+ come after the class if both are present.++ * Typst writer:++ + Put label after Span, not before. Labels get applied to preceding markup+ item.+ + Support Typst 0.11 table features (#9588): colspans, rowspans,+ cell alignment overrides, relative column widths,+ header and footer, multiple table bodies with intermediate headers.+ Row heads are not yet supported.+ + The default typst template has been modified so that tables+ don't have lines by default. As is standard with pandoc, we only+ add a line under a header or over a footer. However, a different+ default stroke pattern can easily be added in a template.+ + More reliable escaping in inline `[..]` contexts (#9586). For example,+ we need to escape `[\1. April]` or it will be treated as an ordered list.+ + Handle `unnumbered` on headings (#9585).++ * LaTeX writer:++ + Fix math inside strikeout (#9597).++ * Text.Pandoc.Writers.Shared:++ + Export `isOrderedListMarker` [API change].++ * Change lhs tests so they don't use `--standalone`.+ This will avoid test failures due to minor changes in+ skylighting versions, e.g. #9589.++ * Use latest texmath, typst.++ * Require pandoc-lua-marshal 0.2.6 (#9613, Albert Krewinkel).+ Fixes an issue arising when the value of `content` properties+ on *BlockQuote*, *Figure*, and *Div* elements was an empty list.++ * Update lua-filters.md (#9611, Carlos Scheidegger).+++## pandoc 3.1.12.3 (2024-03-17)++ * Markdown reader: Fix bug with footnotes at end of fenced div (#9576).++ * LaTeX reader:++ + Improve tokenization of `@` (#9555). Make tokenization sensitive to+ `\makeatletter`/`\makeatother`. Previously we just always treated+ `@` as a letter. This led to bad results, e.g. with the sequence `\@`.+ E.g., `a\@ b` would parse as "ab" and `a\@b` as "a".+ + Make `withRaw` work inside `parseFromToks` (#9517).+ This is needed for raw environments to work inside table cells.+ + Better handling of table colwidths (#9579). Previously the parser just+ failed if the column width specified in `p{}` wasn't a multiple of+ `\linewidth`. This led to cases where content was skipped.++ * Typst writer:++ + Add 'kind' parameter to figures with tables (#9574).+ + Avoid unnecessary box around image in figure (#9236).+ + Omit width/height in images unless explicitly specified (#9236).+ Previously we computed width/heigth for images that didn't have+ size information, because otherwise typst would expand the image+ to fit page width. This typst behavior has changed in 0.11.+ This change fixes a bug in which images would sometimes overflow+ page margins, depending on their intrinsic size.+ + Don't add hard-coded `inset` to tables (#9580). Instead, set this+ globally in the default template, allowing it to be customized.++ * LaTeX template: Fix block headings support for unnumbered paragraphs+ (#9542, #6018, Oliver Fabel).++ * HTML templates: Replace polyfill provider (#9537, @SukkaW).+ Replace polyfill.io with cdnjs.cloudflare.com/polyfill.+ polyfill.io has been acquired by Funnull, and the service has+ become unstable.++ * Korean translations: delete colon in translation for 'to'.+ This was invalid YAML, and not desired anyway, since a colon+ is added.++ * Use latest commonmark, commonmark-extensions.+ This fixes a 3.12 regression in parsing of commonmark/gfm autolinks+ (jgm/commonmark-hs#151).++ * Depend on djot 0.1.1.3, which fixes a serious parsing bug affecting+ regular paragraphs after lists.++ * Depend on latest skylighting, skylighting-core, typst-hs, texmath.++ * MANUAL.txt: Change broken link to IDML cookbook (#9563).++## pandoc 3.1.12.2 (2024-02-29)++ * Docx reader:++ + Ensure that table captions are counted (#9518).+ + Detect caption by style name not id (#9518).+ The styleId can change depending on the localization.+ + Avoid emitting empty paragraph where caption was.++ * Markdown reader: fix regression in link parsing with wikilinks extensions+ (#9481). This fixes a regression introduced in 3.1.12.++ * Org reader/writer: support admonitions (#9475).++ * Org writer: omit extra blank line at end of quote block.++ * Typst writer: ensure that `-`, `+`, etc. are escaped at beginning of block+ (#9478). Our recent relaxing of escaping (#9386) caused problems for+ things like emphasized `-` characters that were rendered using+ `#strong[-]#`. This now gets rendered as `#strong[\-]`.++ * LaTeX writer: fix bug when a language is specified in two different ways+ (#9472). If you used `lang: de-DE` but then had a span or div with+ `lang=de`, the preamble would try to load `ngerman` twice, leading+ to an error. This fix ensures that a language is only loaded once.++ * Docx writer: Don't copy over `footnotePr` in `settings.xml`+ from reference.docx (#9522).++ * EPUB writer: omit EPUB2-specific meta tag on EPUB3 (#9493).+ This caused a validation failure in epubs with cover images.++ * Lua: avoid crashing when an error message is not valid UTF-8 (Albert+ Krewinkel).++ * Text.Pandoc.SelfContained:++ + Add `role="img"` to svgs.+ + Add `aria-label` to svg elements with `alt` text if present.+ Screen readers ignore `alt` attributes on svg elements but do+ pay attention to `aria-label` (#9525).++ * Text.Pandoc.Shared: Fix regression in section numbering in+ `makeSections` (#9516). Starting with pandoc 3.1.12, unnumbered+ sections incremented the section number.++ * Text.Pandoc.Class: fix `openUrl` TLS negotiation (#9483).+ With the release of TLS 2.0.0, the TLS library started requiring+ Extended Main Secret for the TLS handshake. This caused problems+ connecting to zotero's server and others that do not support TLS 1.3.+ This commit relaxes this requirement.++ * Depend on djot 0.1.1.0 (fixes rendering on multiline block attributes).++ * Use new releases of skylighting-format-blaze-html (#9520).+ Fixes auto-wrapping of long source lines in HTML print media.++ * Use new commonmark-extensions (fixes issue with the+ `rebase_relative_paths` extension when used with commonmark/gfm.++ * Makefile: improve epub-validation target (#9493).+ Use `--epub-cover-image` to catch issues that only arise with that.++## pandoc 3.1.12.1 (2024-02-17)++ * EPUB writer: omit EPUBv3-specific accessibility features on epub2+ (#9469). Fixes a regression in 3.1.12.++ * More fixes for SVG ids with `--self-contained` (#9467).+ This generalizes the fix to #9420 so it applies to things like+ `style="fill(url(#..."` and should fix problems with SVGs including+ gradients.++ * Powerpoint writer: properly handle math in headings and tables (#9465).+ This ensures that paragraphs containing math are wrapped in+ a `mc:AlternateContent` node as required.++ * Makefile: make validate-epub check v2 output too.++## pandoc 3.1.12 (2024-02-14)++ * Add `djot` as input and output format. Djot is a light markup syntax+ (https://djot.net).++ + New module Text.Pandoc.Readers.Djot [API change]. The function+ `readDjot` is also exported by Text.Pandoc.Readers.+ + New module Text.Pandoc.Writers.Djot [API change]. The function+ `writeDjot` is also exported by Text.Pandoc.Writers.++ * `--number-sections` now uses the first digit for the number of+ the top-level section, no matter what its level. So if the top-level+ section is level-2, numbers will be `1`, `2`, etc. rather than+ `0.1`, `0.2`, as in the past (#5071). For some backwards compatibility,+ we revert to the old behavior when the `--number-offset` option is used.++ * DocBook reader:++ + Better handling of `<procedure>` and `<substeps>` (#9341):+ `<procedure>` now gets parsed as an ordered list, and+ `<substeps>` as a sublist.++ * Man reader:++ + Move spaces outside of emph/strong (#9445).++ * MediaWiki reader:++ + Don't make leading blanks underscores in image links (#9425).+ + Allow lowercase `image:` (#9424).++ * BibTeX reader:++ + Support `pagetotal` in converting BibLaTeX.++ * Markdown reader:++ + Fix wikilinks extensions to allow newlines in titles (#9454).++ * EPUB reader:++ + Don't put `#` characters in identifiers.++ * LaTeX reader:++ + Improve treatment of `\cref`, `\Cref` (#7463). Use the+ reference-type `ref+label` and `ref+Label`. Also, associate with+ `\vref` `ref` instead of `ref+page`.+ + Limited support for `\Cref` (#7463).+ + Generate relative widths for `\linewidth`, `\textheight` (#9388).++ * Typst reader:++ + Fix handling of `\overline` (#9294). Due to a typo, it was being+ incorrectly rendered as an `\underset`.+ + Improve handling of inline `#quote` (#9413).+ + Fix handling of `dot()`, `tilde()`, `ddot()` (jgm/typst-hs#38).+ + Fix character used for `norm` (jgm/typst-hs#38).++ * Typst writer:++ + Use reference form (e.g. `@jones2000[p. 30]`) for citations when+ possible.+ + Use `#ref` or `@` for links with `reference-type="ref"` (#7463).+ This attribute is added to LaTeX `\cref`, for example.+ + Improve citation support (#9452). Emit `form: "prose"` or `form: "year"`+ qualifiers if the citation is author-in-text or suppress-author.+ Strip initial comma from suffix, since typst will add an extra one.+ + Unescape URI escapes in image paths (#9389).+ + Handle labels and citaiton ids with spaces and other special+ characters (#9387). In these cases, we produce an explicit `label()`+ rather than using `<>` or `@`.+ + Avoid producing illegal labels (#9387).+ + Avoid unnecessary escapes (#9386).++ * LaTeX writer:++ + Make writer sensitive to `empty_paragraphs` extension (#9443).+ + Fix beamer highlighting (mh4ckt3mh4ckt1c4s).+ + Create valid table even when table is empty (#9350).+ + Set font fallback for babel main font (Max Heller).+ + Add some kerns where needed between quotes (#9371).++ * HTML writer:++ + Add suffix to multiple footnote section ids, so they are+ unique (Sam May). This is necessary when `--reference-location`+ is `block` or `section`.++ * EPUB writer:++ + Add ARA roles for accessibility (#9378, Iacobus1983).+ Footnote references are given role "doc-noteref", footnote text+ gets "doc-footnote", and nav gets "doc-toc".+ + Ensure that an alt attribute is always added (#9354). This seems to+ be required by iBooks; even an empty alt attribute will satisfy it.+ + Add `xml:lang` to package element (#9372).+ + Add accessibility metadata to EPUB metadata (#9372, #9400,+ Iacobus1983 and John MacFarlane). Reasonable default values are+ used to ensure that pandoc's EPUBs conform to the EU Accessibilty Act+ requirements, but values can be overridden using metadata.++ * Docx writer:++ + Restore ability to center-justify table (#9393). The fix to+ #5947 caused all tables to be left indented. This was necessary+ to avoid extra indentation in table cells when a table appeared+ in a list item. This change makes the changes conditional, so+ that they only affect tables in list items.++ * Man writer:++ + Fix bug with long URLs (#9458). URLs with more than 68 characters didn't+ display properly because of wrapping.+ + Support (limited) syntax highlighting in code blocks (#9446).+ Currently only boldface and italics are supported. The `monochrome`+ style might be of use for those generating man pages.++ * Org writer:++ + Escape special lines in code blocks (#9218, Albert Krewinkel).++ * Markdown writer:++ + Use different width fences for nested divs (#9450). Outer divs+ have longer fences. This aids clarity for the reader, making it+ easier to see where the div ends. It also makes the output+ compatible with some other implementations, e.g. micromark,+ which require different-width fences for nesting.+ + Fix output for pipe tables with a huge number+ of columns (#9346). Previously we got invalid pipe tables when the+ number of table columns exceeded the setting of `--columns`.++ * Powerpoint writer:++ + Fix regression in layout for slides with figures (#9442).+ + Use internal column widths in pptx writer tables (#5706,+ Tomas Dahlqvist). The table writer used to only divide all+ available width evenly for all columns. In this update the code+ uses the incoming widths if they are available. If they are not+ set the earlier even distribution is used. Some of the golden+ templates are adjusted slightly because of different rounding when+ using the new calculation model.++ * Custom writers:++ + Fix handling of common state (#9229, Albert Krewinkel).+ The CommonState (`PANDOC_STATE` in Lua) may change between the time that+ a custom writer script is first loaded and when the writer is run.+ However, the writer was always using the initial state, which led to+ problems, e.g. when the mediabag was updated in a filter, as those+ updates where not visible to the writer. The state is now updated+ right before the writer function runs.++ * Text.Pandoc.SelfContained:++ + Fix id replacements in SVGs with clipping paths (#9420).+ This fixes `--embed-resources` when SVGs have `clip-path` attributes.+ + Fix size of duplicated SVGs with `--embed-resources` (#9439).++ * ConTeXt template: support font fallback (#9361, Lawrence Chonavel).++ * Text.Pandoc.Shared:++ + `addPandocAttributes`: use `wrapper` attribute, not `wrap`, for+ Divs and Spans added as wrappers to hold attributes on elements+ that do not accept them.+ + `makeSections` behavior changes:+ - When the optional base level parameter is provided, we no+ longer ensure that the sequence of heading levels is gapless+ (#9398). Instead, we set the lowest heading level to+ the specified base level, and adjust the others accordingly. If+ an author wants to skip a level, e.g. from level 1 to level 3,+ they can do that. In general, the heading levels specified+ in the source document are preserved; `makeSections` only+ puts them into a hierarchical structure.+ - Section numbers are now assigned differently, as described above+ under `--number-sections` changes (#5071).+ + Improve `makeSections` code for section number calculation.++ * Text.Pandoc.Chunks:++ + Autogenerate unique ids for sections missing them (#9383).+ This is needed for TOC generation to work properly. We can't+ create TOC links if there are no ids. This fixes some EPUB validation+ issues we've been getting since switching over to Chunks for chunking.+ + Improve `fixTOCTreePaths`. We weren't adding ids for section headings+ that don't head a chunk, but these headings are needed for a TOC.++ * Lua: catch encoding error in `pandoc.read` (#9385, Albert Krewinkel).+ Fixed a bug that could lead to an un-catchable error and program+ termination when `pandoc.read` was called with invalid UTF-8 input.++ * LaTeX template: support font fallback (lawcho). This support is+ LuaLaTeX-specific. See MANUAL.txt for documentation.++ * Text.Pandoc.Readers: Add `readMan` to exports [API change] (George Stagg).++ * Text.Pandoc.PDF:++ + Reliably detect when TOC has changed (#9295). Sometimes the TOC+ changes but there are no warnings: this happens when no labels+ are present. In this case we must rerun LaTeX. So we now take the+ SHA1 hash of the TOC file and rerun LaTeX if it changes between runs.+ + Increase maximum number of LaTeX runs to 4 (#9299). On some documents,+ 4 runs are needed (e.g. when a LastPage reference is used).+ + Avoid `readFileLazy`, which caused improperly cleaned-up+ temp directories on Windows (#9460).++ * MANUAL.txt:++ + Harmonize spelling of Markdown and MultiMarkdown (#9402, Salim B).+ + Add `<pre>` to list of exceptions for `markdown_in_html_blocks`+ extension (#9305).+ + Add clarification to docs for `--resource-path` (#9417).++ * Makefile: Validate generated EPUB as part of prerelease checks.++ * Add validation for docx golden files to CI (Edwin Török).++## pandoc 3.1.11.1 (2024-01-05)++ * Docx reader:++ + Fix HYPERLINK with only switch and no argument (#9246).++ * Org reader:++ + Parse caption and label for grid tables (#9279).++ * MediaWiki reader:++ + Handle multiline math in list items (#9293).++ * OPML writer:++ + Respect `--wrap` options & `--columns` in contents of notes (#9297).++ * ODT/OpenDocument writers:++ + Properly handle highlighting styles (#9287). These styles were+ going into an `office:styles` element in `content.xml`, but this+ is invalid. Instead they must go in `styles.xml`. The variable+ `highlighting-styles` no longer has any effect on the default+ opendocument template, and highlighting styles are not included+ in `opendocument` output.++ * Markdown writer:++ + Add table identifier at end of caption if present (#9279).++ * Text.Pandoc.PDF:++ + Expand list of environment variables to display in verbose output+ (#9303).+ + Ensure that we find all the LaTeX warnings requiring a rerun (#9284).+ This should fix a regression from 3.1.9 that led to incorrect+ alignments in tables (and possibly other issues).++ * Docx writer:++ + Ensure that pandoc's output validates (Edwin Török, #9273, #9269,+ John MacFarlane, #9265, #9266, #9264).+ + Don't emit empty table rows, which seem to cause problems for+ Word (#9224).++ * LaTeX writer:++ + Omit superfluous page locator label when used with `--natbib` or+ `--biblatex` (#9275). These will treat a bare number as a+ page locator, and they will be able to localize it. Note that the+ recognition of the locator label is locale-sensitive; if `lang` is+ `de`, then `S. 33` is a page reference, and `p. 33` is not!++ * Text.Pandoc.Chunks: Fine tune `makeChunks` (#9281).++ + Ensure that chunks not based on sections (those with the+ "preamble" class) get unique identifiers, by appending chunk number.+ + This will also ensure that they get unique path names when+ the path is generated from the identifier.++ * Default HTML5 template: remove html5shiv (and support for IE < 9).++ * Makefile:++ + Fix `make quick-stack`: `j` was expecting a number (Edwin Török).+ + Run built pandoc (instead of pandoc in path).+ + Add `validate-epub` target, using `epubcheck` to test the golden files.+ + Add `validate-docx-golden-tests` target.++## pandoc 3.1.11 (2023-12-15)++ * Typst writer:++ + Emit `;` after typst code, unless followed by space (#9252).+ Otherwise there's the potential that the typst code will swallow+ up a following character.++ * Text.Pandoc.Logging:++ + Add `MakePDFWarning` constructor to LogMessage [API change].+ + Add `MakePDFInfo` constructor to LogMessage [API change].++ * Text.Pandoc.PDF:++ + LaTeX warnings are passed on to the user as warnings.+ + Use `report` with `MakePDFWarning` and `MakePDFInfo` to relay+ verbose information and warnings, instead of writing directly+ to stderr.+ + Parse logs to determine whether additional runs needed, instead of+ running a fixed number of times (#9255). (The number of times+ that was appropriate given pandoc's default templates didn't+ always work for custom templates, and thus pandoc 3.1.10's+ change in the number of runs led to some regressions in PDF+ production.)++ * Makefile: in `make prelease`, add checks that pandoc-cli and+ pandoc have the same version, that pandoc-cli depends on this+ exact version of pandoc, that there is an entry for this version+ in the changelog, and that the version numbers in the+ generated man pages are correct.++ * Regenerate man pages with pandoc 3.1.10. This properly escapes hyphens+ and fixes version numbers in man pages for `pandoc-server` and+ `pandoc-lua`.++ * Depend on texmath 0.12.8.6. This omits unneeded `lr`s in typst+ math output.++ * Depend on typst 0.5. This allows the typst reader to support+ multiline strings, the version type, and the `as`+ keyword with `import`.++## pandoc 3.1.10 (2023-12-12)++ * Link pandoc-cli version to pandoc version. Henceforth pandoc-cli's+ version will be synchronized with pandoc's, and pandoc-cli will+ depend on an exact pandoc version. This will avoid confusion by+ ensuring that `cabal install pandoc-cli-X.Y.Z` installs pandoc+ version X.Y.Z. It will make things more straightforward for+ upstream packagers (see #9232). This scheme does not follow the+ Haskell PVP, but that should cause no harm, because this package+ does not expose a library.++ * Add `alerts` markdown extension. This enables GitHub style markdown+ alerts as a commonmark extension. This extension is now default for+ `gfm`. It can't be used with `markdown`, only with `commonmark` and+ variants.++ * Markdown reader:++ + Preserve newlines in math instead of changing to spaces.+ Otherwise we can get unwanted results if there's+ a `%` comment (#9193).+ + Make attributes work with reference links (#9171).++ * HTML reader:++ + Improve handling of invalidly nested sublists (#9187, cf. #8150).++ * MediaWiki reader:++ + Allow attribute keys with hyphens (#9178).++ * ODT reader:++ + Support attr `text:continue-numbering` (#8979, Stephan Meijer).++ * Typst reader:++ + Allow references (e.g. `@foo`) to become citations+ if there is no corresponding label in the document.+ + Collapse adjacent `cite` elements.+ + Handle supplements in `cite`.+ + Change `cite` (only one key allowed, a label) (typst 0.9 breaking change).+ + Support `quote` element (typst 0.9).++ * LaTeX reader:++ + Handle otherlanguage environment and language-name environments like+ `\begin{french}...\end{french}` (#9202).+ + Fix theorem label parsing (#8872, Hikaru Ibayashi).++ * Docx reader:++ + Unwrap content of shaped textboxes (Stephan Meijer, #9214).+ + Improve handling of `w:sym` (#9220). We now look up symbols in symbol+ fonts using the table defined at Text.Pandoc.Readers.Docx.Symbols.+ + Add unexported module Text.Pandoc.Readers.Docx.Symbols. This gives us a+ table to use to resolve characters included in docx via `w:sym` element.++ * Man reader:++ + Properly handle `.sp` macro inside lists and block quotes (#9201).++ * LaTeX writer:++ + Fix bug with big footnotes inside emphasis (#8982, Hikaru Ibayashi).+ + Handle identifiers inside heading contents. `\phantomsection` can't+ be used in this case, so we need `\hypertarget` (#9209).++ * LaTeX template:++ + Include `bookmark` package unconditionally. This package+ produces better PDF bookmarks than `hyperref` and does it on the+ first pass.++ * Typst writer:++ + Use `quote` for block quotes.+ + Support `--toc-depth` as in other writers (#9242).+ + Put inline image dimensions on enclosing box, not image (#9104).+ + Better handling of tables with captions (#9194).+ We now put these in a figure with a caption argument.+ + Update typst writer to typst 0.9 citation format (#9188).++ * Typst template:++ + Remove custom definition of `blockquote` in default template.+ (We now use built-in `quote`.)+ + Support table of contents.+ + Support csl (#9186, Ian Max Andolina). Typst now supports CSL for its+ native citation engine, so pandoc should use a specified `csl`+ style in the template, falling back to `bibliographystyle` if+ `csl` is not specified.++ * Docx writer:++ + Use different style for block quotes in notes (#9243).+ Using "Footnote Block Text" for the style name, so it can be+ given a different font size if footnotes are.+ + Allow embedded fonts to be used in reference.docx (#6728).++ * HTML5 writer:++ + To conform to validator's expectations, `doc-footnote` role is used+ with `aside` and `doc-endnotes` with `section`.+ + `aside` is used only for notes at ends of sections or blocks;+ if all the notes come at the end of the document, `section` is+ used so we can have the `doc-endnotes` role.++ * JATS writer:++ + Handle case where there is material after refs div (#9166). Previously in+ such cases the references were not being moved to back matter.++ * Ms writer:++ + Don't do normal escapes in filename arguments for PSPIC etc.++ * T.P.RoffChar: escape `-` as `\-`. The `groff_man (7)` man page indicates+ that `-` characters will be treated as typographic hyphens and are not+ appropriate for cases where the output should be copy-pasteable as an+ ASCII hyphen-minus character. (E.g. in command line options.)+ However, until a recent update groff man did not actually do this;+ it treated `-` and `\-` the same. With the new update (1.23.0)+ the two are distinguished (see https://lwn.net/Articles/947941/+ for background), so now it is important that pandoc escape `-`.++ * Text.Pandoc.Extension: add `Ext_alerts` constructor [API change].++ * Text.Pandoc.PDF: We now default to running LaTeX only+ once in producing a PDF (instead of twice). This is made possible by the+ shift to the `bookmark` package, which does not require a second pass for+ PDF bookmarks. If a table of contents is present, we still have to run+ three times to get the page numbers, and if beamer is used we still do a+ minimum of two runs.++ * Text.Pandoc.Shared:++ + `renderTags'`: use minimized tag for `rect`.+ + Allow svg `path` element to be minimized.+ + Export `combineAttr` [API change].+ + Improve `isTightList` so that it recognizes an item containing only a list+ which is itself tight as potentially an item in a tight list (#9161).++ * Text.Pandoc.MIME: Ensure we use `.svg` not `.svgz` as extension+ for `image/svg+xml` mime type. This fixes issues with embedded+ SVG images in docx output, among other things (#9195).++ * Text.Pandoc.Class: `openURL` improvements for data uris.+ Only treat data URI as `base64` if ';base64' is specified.+ Otherwise treat as UTF-8 (not 100% reliable but should cover most+ other cases). Strip off `;base64` (or `;charset=...` or whatever)+ from mime type (#9195).++ * Text.Pandoc.SelfContained: Improve treatment of embedded SVGs+ (#9206, #8948).++ + Ensure unique ids for elements by prefixing SVG id.+ + Ensure SVG `id` attribute except when `use` element is used.+ + Remove `width`, `height` attributes from svg element when `use`+ element is used. Instead, add `width` and `height` 100% to the+ `use` element. This seems to get the sizing right.++ * Text.Pandoc.Citeproc: Don't link citations if+ `suppress-bibliography` specified, for there will be nothing to+ link to (#9163).++ * epub.css: add styling for sup and sub (#9160).++ * Switch from `base64` to `base64-bytestring` (#9233).++ * Use newest versions of commonmark, commonmark-extensions,+ commonmark-pandoc, texmath, typst, skylighting, skylighting-core.++ * Benchmark: use standalone documents for reader tests.+ Otherwise typst reader benchmark fails. Note: this means that we are now+ parsing longer documents, so bench results on readers won't be comparable+ to before.++ * MANUAL.txt: update defaults file docs for bibliography fields (#9173).+ Recommend using top-level `bibliography` `csl`, etc. instead+ of a nested `metadata` field. Reason: `${USERDATA}` and `${HOME}`+ are only expanded in these contexts, not in `metadata`.++ * Move man pages to pandoc-cli package (#9245).++## pandoc 3.1.9 (2023-10-27)++ * Make `reference-section-title` work with `jats+element_citations`+ (#9021).++ * Add `bits` as synonym of `jats` as input format.++ * JATS reader:++ + Modify JATS reader to handle BITS too (#9138, Julia Diaz).+ Add provision for title-group, book, book-part-wrapper, book-meta,+ book-part-meta, book-title, book-title-group, index, toc, legend,+ title, collection-meta+ + Fix handling of alt-text (#9130, Julia Diaz). Previously we were+ looking for an attribute that doesn't exist in JATS; alt-text is+ provided by a child element.++ * CommonMark reader:++ + Handle `Ext_tex_math_gfm` (#9121). Parse GFM-specific math+ constructions when `tex_math_gfm` enabled.++ * DokuWiki reader:++ + Allow autolinks to be avoided using e.g. `https:%%//%%...` (#9153).+ + Parse `<code>` and `<file>` as block-level code (#9154).+ Previously we treated them as inline code in some contexts,+ but that is not how DokuWiki works.++ * LaTeX reader:++ + Better handle spacing commands `\hfill`, `\vfill`, `\hskip`,+ `\vskip`, etc. (#9150).+ + Fix incorrect abbreviation for astronomical unit (#9125,+ Michael McClurg).++ * Markdown reader:++ + Fix blindspot with superscript in links (#8981).+ Previously `[^super^](#ref)` wasn't parsed as a link, due to+ code that was meant to prevent footnote markers from being+ recognized as reference links. This commit tightens up that+ code to avoid this bad effect. We have also added a new+ restriction on footnote labels: they cannot contain the characters+ `^`, `[`, or `]`. Though this is technically a breaking change, we+ suspect that the impact will be minimal, as it's very unlikely+ people would be using these characters in their note labels.+ + Don't apply `--default-image-extension` to data URIs (#9118).+ + More accurate check that a normalCite is not a link,+ bracketed span, or reference (#9080).++ * HTML reader:++ + Allow th to close td and vice versa (#9090).+ + Parse task lists using input elements (#9047, Seth Speaks).++ * Creole reader:++ + Handle empty cells correctly (#9141, Sascha Wilde).++ * Org writer:++ + Escape literal `*`, `|`, `#` at beginning of line with ZWS (#9159).++ * ICML writer:++ + Prevent doubled attributes (#9158).++ * Powerpoint writer:++ + Fix a corruption error caused when the document used both a+ regular png and a png in a data URI (#9113). (Similarly for any+ other image format.) The problem was that duplicate entries in+ `[Content Types].xml` were being created, one for the mime type+ `image/png`, one for `image/png;base64`.++ * LaTeX writer:++ + Fix rowspans in tables so they use the width of+ the column (`=` as the width parameter) (#9140).+ + Don't treat table as "simple" if they have col widths.+ This should help fix a problem wherein some grid tables with+ colspans were overly wide (#9140).+ + Fix uneven indents in line block output (#9088).++ * JATS writer: fix 3.1.4 regression in handling block-level metadata+ (#9092).++ * Ms writer: improvements in image handling (#4475).++ + PDFPIC is now used for PDF images in figures.+ + Inline images that are postscript or PDF are rendered using+ PSPIC or PDFPIC. This isn't ideal, because they will still be+ rendered as if in a separate paragraph, but it's probably+ better than just printing the image name.+ + Units are included in height.++ * HTML writer:++ + If raw format is an HTML side deck format, emit it (James J Balamuta).++ * Typst writer:++ + Add `#box` around image to make it inline. (#9104)+ An `#image` by itself in typst is a block-level element.+ To force images to be inline (as they are in pandoc), we need+ to add a box with an explicit width. When a width is not given+ in image attributes, we compute one from the image itself, when+ possible.+ + Don't allow long heading to wrap (#9132).+ + Escape `(` (#9137). If unescaped `(` occurs in+ certain contexts, it can be parsed as function application.++ * Man writer:++ + Fix some spacing issues around links (#9120).+ We need to use `\c` before a `.UR` or `.MT`, to avoid+ an extra space, and also after. To ensure that a space+ at the beginning of the following line doesn't get swallowed+ up, we escape it with `\`.+ + Use UR, MT macros for URLs, emails (#9120).++ * Text.Pandoc.Extensions:++ + Add `Ext_tex_math_gfm` constructor to Extension (#9121).+ [API change]. This handles two GitHub-specific syntaxes for math.+ This is now default for `gfm`, in addition to `tex_math_dollars`.+ + Remove duplicates for `Ext_raw_html` and `Ext_pipe_tables`+ in some of the lists (Tim Stewart).++ * Text.Pandoc.Metadata: Add helpful message on some metadata+ YAML errors (#9155).++ * Text.Pandoc.Shared:++ + `splitSentences`: don't split after initials.+ This improves the man and ms writer output, preventing+ sentence breaks after initials.+ + Add `addPandocAttributes` function [API change].+ This is meant to simplify addition of attributes to Pandoc+ elements: for elements that don't have a slot for attributes, an+ enclosing Div or Span is added to hold the attributes.++ * MANUAL.txt:++ + Clarify that formatting can't cross line boundaries+ in line blocks (#9119).+ + Fix legacy option for citation (#8737, 3w36zj6)++ * Update `et` translations (priiduonu).++ * Updated `no` translations (Stephan Daus).+ Renamed no.yaml (macrolanguage Norwegian) to nb.yaml (Norwegian Bokmål).+ Created soft symbolic link from no.yaml pointing to nb.yaml.++ * Lua subsystem: Use the newest LPeg version (lpeg-1.1.*) (#9107,+ Albert Krewinkel).++ * Default `epub.css`: Apply style to h6, format styles, and+ combine identical styles under shared selectors (samuel-weinhardt).++ * Update nix flake with dependencies (piq9117).++ * LaTeX template: fix `\CSLBlock` vertical space (John Purnell).++ * Allow tasty 1.5 and Diff 0.5.++ * Require commonmark-extensions 0.2.4, commonmark 0.2.4.++ * Require texmath 0.12.8.4. This should improve math in+ powerpoint, fixing empty boxes around roots in some cases.++ * Require typst 0.3.2.1++## pandoc 3.1.8 (2023-09-08)++ * JATS reader:++ + Ignore `<processing-meta>` element (#9057, Julia Diaz).+ + Fix conversion of date to ISO 8601 format (#8865).++ * LaTeX template:++ + Add code allow `\cite` to break across lines (#9050).+ + Fix regression with CSL `display="block"` (#7363).+ This restores the line break before the block.+ + Rewrite `CSLReferences` environment to avoid depending on+ `enumitem`, which plays badly with beamer. Instead we use+ a regular list environment. Thanks to @jpcirrus for the+ concept (#9053).+ + Restore the pre-3.1.7 format of the `CSLReferences`+ environment, which again has two parameters. The first+ determines whether a hanging indent is used (1 = yes, 0 = no),+ and the second is the entry line spacing (0 = none).+ + Add a strut to avoid inconsistencies in spacing (#9058).+ - Remove a break at the end of `CSLRightInline` to avoid+ inconsistencies in spacing. It shouldn't be necessary+ because the paragraph should extend to the right margin (#9058).++ * LaTeX writer:++ + Fix regression with figure labels (#9045). In 3.1.7, pandoc+ added two labels to LaTeX figure environments, one with a+ phantomsection.+ + Fix default citeproc entry-spacing. According to the CSL manual,+ the default entry spacing is 1. We were treating it as 0 (#9058).++ * HTML writer:++ + Use the ID prefix in the ID for the footnotes section (#9044,+ Benjamin Esham).+ + Fix CSL entry-spacing default (#9058).++ * Text.Pandoc.Citeproc: always include an `entry-spacing` attribute+ in the Div if the bibliography element contains an entry-spacing+ attribute (previously we omitted it when it was 0) (#9058).++ * Clean up pandoc's own man pages by regenerating with pandoc 3.1.7.++ * pandoc-lua-engine: bump lower bound for pandoc (#9046).++ * Depend on texmath 0.12.8.2, fixing binom in typst writer (#9063).++## pandoc 3.1.7 (2023-08-31)++ * Org reader:++ + Don't parse alphabetical lists unless the `fancy_lists` extension is+ enabled (#9042).+ + Allow escaping commas in macro arguments (Amneesh Singh).++ * JATS reader:++ + Support for `<permissions>` metadata (#9037, Julia Diaz).+ metadata objects with multiple fields are created, matching the+ structure in JATS.+ + Correct name of JATS element `attrib`.++ * Markdown reader:++ + Support images with wikilink syntax, e.g. `![[foo|bar]]`, when+ one of the `wikilinks` extension is enabled (#8853).+ + Allow a citation or reference link to be parsed after a `!` (#8254).+ + Fix dropped `!` before nonexistent reference (#9038).++ * LaTeX writer:++ + Fix regression in escaping URLs (#9043).+ + Use `\cite` and `\bibitem` to link up citations, even with citeproc.+ (#9031). This will give us better accessibility; when tagging is+ enabled, the citation can be linked to the bibliography entry.+ This changes some of the details of the layout and the default+ template. We now make `CSLReferences` a special enumitem list+ that will contain `\bibitem`s. Internal links inside citations to+ ids beginning in `ref-` are creating using `\cite` instead of+ `\hyperref`.+ + Use `\phantomsection` and `\label` instead of `\hypertarget` (#9022).+ + Use `\hyperref` for LaTeX internal links, `\hyperlink` for+ beamer (since `\hyperref` doesn't seem to work) (#9022).+ + Backslash-escape `%` and `#` in URLs (#9014).++ * JATS writer:++ + Fix placement of ref-list when no title is specified for the+ reference section (#9017). (In this case we place it in `back`+ with an empty title.)++ * Man writer:++ + Avoid a `.PP` right after a section heading (#9020).+ This is at best a no-op (in groff man and mandoc) and at worst+ (in some formatters) may create extra whitespace.+ + We revert the fanciness introduced in #7506, which employs a+ custom font name `V` and a macro that makes this act like boldface+ in a terminal and monospace in other formats. Unfortunately,+ this code uses a mechanism that is not portable (and does not+ work in mandoc) (#9020).+ + Instead of using `V` for inline code, we simply use `CR`.+ Note that `\f[CR]` is emitted instead of plain `\f[C]`,+ because there is no `C` font in man. (This produces warnings+ in recent versions of groff, #9020.)+ + For code blocks, we now use the `.EX` and `.EE` macros,+ together with `.IP` for spacing and indentation. This gives+ more standard code that can be better interpreted e.g. by mandoc+ (#9020).++ * Man template: don't emit `.hy`, regardless of setting of+ `hyphenate` variable (#9020).++ * LaTeX template: special redefinition of `\st` for CJK (#9019).+ soul's version raises on error on CJK text.++ * Use latest skylighting-format-blaze-html (#7248).+ This works around a longstanding iOS Safari bug that caused long+ lines to be displayed in a different font size in highlighted code.++ * Allow skylighting 0.14 (and require it in pandoc core).++ * Allow text 2.1.++## pandoc 3.1.6.2 (2023-08-22)++ * Org reader: allow example lines to end immediately after the colon+ (Brian Leung).++ * Docx reader:++ + Omit "Table NN" from caption (#9002).+ + Avoid spurious block quotes in list items (#8836).++ * JATS reader: Fix display of block elements (#8889, Julia Diaz).+ A number of block elements, like disp-quote, list, and disp-formula, were+ always treated as inlines if appearing inside paragraphs, even if their+ usage granted a separate block.++ * HTML reader: avoid duplicate id on header and div (#8991).++ * Typst writer:++ + Use `~` for nonbreaking space, and escape literal `~` (#9010).+ + Put the label in right place for Div, use `#block` (#8991).+ Previously we were putting the label at the beginning of+ the Div's contents, but according to the documentation such a+ label gets attached to the *preceding* element. We now use an+ explicit `#block` and add the label at the end.++ * LaTeX writer:++ + Improve escaping of URIs in href, url (#8992).+ + Improve internal links and targets (#8744). We no longer+ wrap section headings in a `\hypertarget`. This is unnecessary+ (hyperref creates an anchor based on the label) and it interferes with+ tagging. In addition, we now use `\hyperref` rather than `\hyperlink`+ for internal links. Currently `\hypertarget` is still being used for+ link anchors not on headings. Thanks to @u-fischer.++ * HTML format templates (style.html): Fix typo in clause for svg+ (Jackson Schuster).++ * Use lastest texmath, typst-symbols, typst. Targets typst 0.7.+++## pandoc 3.1.6.1 (2023-08-11)++ * HTML reader: properly calculate RowHeadColumns (#8984). This fixes a+ bug in the calculation of the number of header columns in table row.+ It also changes the algorithm for determining the table body's+ RowHeadColumns based on the numbers of head columns in each row.+ Previously we used the max, and #8634 switched to the min, which+ led to bad results. Now we only set RowHeadColumns to a non-zero value+ if *all* rows have the same number of head columns.++ * OpenDocument writer:++ + Implement syntax highlighting for inline and block code (#6710).+ + Support highlighted text in ODT/OpenDocument writers for Span+ with class `mark` (#8960). The color can be adjusted by+ modifying the Highlighted style.++ * Typst writer: escape `//` so it doesn't get interpreted as a comment+ (#8966).++ * ChunkedHTML writer: Fix regression including MathJax script (#8967).+ The fix for #8620 caused the script to be included when the table of+ contents but not the body text of a page contains math. But it broke the+ case where the table of contents doesn't contain math but the page does.+ This patch fixes the issue.++ * Text.Pandoc.SelfContained:++ + Retain attributes in SVG tag when referring to another+ SVG's content using `<use>` (#8969).+ + Allow units in width and height for SVG. Units are optional but allowed.+ + Don't coerce calculated SVG dimensions to Int.+ + fix calculation of SVG width and height. We were computing width and+ height from viewBox incorrectly (#8969).+ + Add clause for SVG to default CSS for HTML (#8969).+ + Ensure that width and height attributes don't get specified+ twice is both the img tag and the svg include them (#8965).+ + Omit unnecessary attributes xmlns, xmlns:xlink, and version on+ SVG element (#8965).+ + Use 20 character rather than 40 character hashes for generated IDs+ (#8965).++ * Use pandoc-types 1.23.1. This fixes a regression with toJSONFilter (#8976),+ which in 1.23.0.1 no longer worked on pure values of type `a -> [a]`.++ * Use ghc 9.6 for release builds (#8947).++ * Fix some links in FAQs (Diogo Almiro).+++## pandoc 3.1.6 (2023-07-20)++ * Fix CVE-2023-38745, a variant of the vulnerability in CVE-2023-35936.+ Guilhem Moulin noticed that the fix to CVE-2023-35936 was incomplete.+ An attacker could get around it by double-encoding the malicious+ extension to create or override arbitrary files.++ * `--embed-resources`: Use inline SVG instead of data uris for SVG+ images in HTML5 (#8948). Note that SelfContained does not have+ access to the writer name, so we check for HTML5 by determining+ whether the document starts with `<DOCTYPE! html>`. This means+ that inline SVG won't be used when generating document fragments.++ * Fix regression on short boolean arguments (#8956).+ In 3.1.5 boolean arguments were allowed an optional argument+ (`true|false`). This created a regression for uses of fused+ short arguments, e.g. `-somyfile.html`, which was equivalent+ to `-s -omyfile.html`, but now raised an error because+ pandoc attempted to parse `o` as a boolean `true` or `false`.+ This change allows the fused short arguments to be used again.+ Note that `-strue` will be interpreted as `-s` with an+ argument `true`, not as `-s -t -rue`. It is best to+ use long option names with the optional boolean values,+ to avoid confusion.++ * Make `--epub-title-page`'s argument optional. It takes a boolean+ argument, and now that all of our boolean flags take such an+ argument, we can make this one optional for consistency.++ * Improve errors for illegal output formats. Previously if you did+ `pandoc -s -t bbb`, it would give you an error about the missing+ `bbb` template instead of saying that `bbb` is not a+ supported output format.++ * Improve errors for incorrect command-line option values (#8879).+ Always give the name of the relevant argument.++ * Fix typo on error message for incorrect `--preserve-tabs` argument.+ Thanks @fsoedjede++ * Docx reader: use SVG version of image if present (#7244).+ Previously the backup PNG was exported even if an SVG was+ present, but the SVG should be preferred.++ * Typst reader: fix regression in recognition of display math (#8949).+ The last release caused all math to be parsed as inline math.++ * JATS writer: don't use `<code>` for inline code (#8889).+ It is intended for block-level code.++ * HTML writer: don't make line blocks sensitive to `--wrap` (#8952).++ * RST writer: fix figure handling (#8930, #8871).+ This fixes a number of regressions from pandoc 2.x.+ Properly handle caption, alt attribute in figures.+ No longer treat a paragraph with a single image in it as a figure+ (we have a dedicated Figure element now).++ * Docx writer: Copy "mirror margins" property from reference.docx (#8946).++ * Text.Pandoc.UTF8: Deprecate `decodeArg` which is now a no-op.+ This was needed for old base versions which we no longer support.++ * Use released skylighting, typst.++ * Allow latest commonmark-extensions. This allows entities in wikilinks.++ * Switch back to using ghc 9.2 for linux and Windows binary releases+ (#8947, #8955). With ghc 9.4+, we were getting AVX instructions+ in the amd64 binary, which aren't supported on older hardware.+ For maximum compatibility we switch back to ghc 9.2, which doesn't+ cause the problem. (As documented, ghc should not be emitting these+ instructions, so we aren't clear on the diagnosis, but the cure+ has been tested.)++ * Change Windows release build to use cabal instead of stack.++## pandoc 3.1.5 (2023-07-07)++ * Allow all boolean flags to take an optional `true` or `false` value+ (#8788, Sam S. Almahri). The default is true if no value is specified,+ so this is fully backwards-compatible.++ * Support `--id-prefix` for markdown output (#8878)++ * Markdown reader:++ + Add strictness annotations to fix a memory leak (#8762).++ * Typst reader:++ + Use typst-hs 0.3.0.0, which is more robust, fixes many bugs, and+ targets typst 0.6.+ + Package loading is now supported, as long as the package has been+ cached or is local.+ + Rewrite Typst reader in a way that makes it easier to extend.+ + Filter out CR in raw.+ + Handle block content for link element.+ + Handle block-level content in text element.+ + Handle style, align, place in inline contexts too.+ + Improve info message for skipped elements.++ * Add typst reader tests (#8942).++ * MediaWiki reader:++ + Revise treatment of "link trail." Previously we only included ASCII+ letters. That is correct for English but not for, e.g., Spanish (see+ comment in #8525). A safer approach is to include all letters except+ those in the CJK unified ideograph ranges.++ * AsciiDoc writer:++ + Make modern AsciiDoc the target for `asciidoc` (#8936).+ The AsciiDoc community now regards the dialect parsed by `asciidoctor`+ as the official AsciiDoc syntax, so it should be the target of our+ `asciidoc` format. The `asciidoc` output format now behaves like+ `asciidoctor` used to. `asciidoctor` is a deprecated synonym. For+ the old `asciidoc` behavior (targeting the Python script),+ use `asciidoc_legacy`. The templates have been consolidated. Instead of+ separate `default.asciidoctor` and `default.asciidoc` templates, there+ is just `default.asciidoc`.+ + Text.Pandoc.Writers.AsciiDoc API changes:+ - `writeAsciiDoc` now behaves like `writeAsciiDoctor` used to.+ - `writeAsciiDoctor` is now a deprecated synonym for `writeAsciiDoc`.+ - New exported function `writeAsciiDocLegacy` behaves like+ `writeAsciDoc` used to.+ + Update line-through for asciidoc writer to custom inline style (#8933,+ Kevin Broch).++ * Typst writer:++ + Support `unlisted` class in headings (#8941).+ + Consolidate bibliography files into one `#bibliography` command (#8937).+ + Improve handling of autolinks (#8931).++ * Docx writer:++ + Make relative widths work in tables. This didn't work before because we+ were missing an attribute that tells Word to used fixed widths rather+ than computing optimal ones.++ * DokuWiki writer: fix lists with Div elements (#8920).+ The DokuWiki writer doesn't render Divs specially, so their presence in+ a list (e.g. because of custom-styles) need not prevent a regular+ DokuWiki list from being used. (Falling back to raw HTML in this case is+ pointless because no new information is given.)++ * LaTeX writer:++ + Fix babel name for `fa` (should be `persian`).+ + Prevent babel language from being imported twice (#8925).++ * Text.Pandoc.Class:++ + Add `toTextM` [API change]. This is like `Text.Pandoc.UTF8.toText`,+ except:++ - it takes a file path as first argument, in addition to+ bytestring contents+ - it raises an informative error with source position if+ the contents are not UTF8-encoded++ This replaces `utf8ToText` whenever we have the filename and are+ in a PandocMonad instance. This will lead to more informative error+ messages for UTF8-encoding, indicating the file path and byte offset+ where the error occurs (#8884).++ * Remove invalid term "Subject" from Turkish translations (#8921).++ * stack.yaml: add pkg-config to nix packages (#8927, pacien).++ * Allow aeson 2.2.++ * MANUAL: Add clarification on --section-divs. Closes #8882.+++## pandoc 3.1.4 (2023-06-24)++ * Fix a security vulnerability in MediaBag and T.P.Class.IO.writeMedia.+ This vulnerability, discovered by Entroy C, allows users to write+ arbitrary files to any location by feeding pandoc a specially crafted+ URL in an image element. The vulnerability is serious for anyone+ using pandoc to process untrusted input. The vulnerability does+ not affect pandoc when run with the `--sandbox` flag. [CVE-2023-35936]++ * Allow `epub-title-page` to be used in defaults files (#8908).++ * Issue `Extracting` info message (in `--verbose` mode) when using+ `--extract-media` or extracting media temporarily in PDF production.++ * HTML reader: Update TableBody RowHeadColumns caculation (#8634,+ Ruqi). This change sets RowHeadColumns to the minimum value of each row,+ which gives better results in cases where rows have different numbers+ of leading th tags.++ * Dokuwiki reader: retain image query parameters as attributes (#8887, echo0).++ * Textile reader: Add support for link references (#8706, Stephen Altamirano).+ Textile supports what it calls "link alias", which are analogous to+ Markdown's reference-style links.++ * LaTeX reader: support alt text on images (#8743, Albert Krewinkel).++ * Commonmark reader: Make `implicit_figures` work again.+ Support for this (introduced in #6350) disappeared when we made an+ architectural change.++ * JATS reader:++ + Add footer and multiple body parsing to table reader (#8765, Noah Malmed).+ + Parse references title from ref-list (#8365).++ * JATS writer:++ + Make `--number-sections` work.+ + Include title in ref-list (#8364). Previously the reference title ended+ up in a separate section at the back of the body instead of in the ref-list+ in the back matter.++ * Mediawiki writer: allow highlighting to work for F# language+ (Adelar da Silva Queiróz).++ * LaTeX writer: Fix escaping of `&` in `\href` and `\url` (#8903).++ * Docx writer:++ + Fix localization of "Abstract" title (#8702).+ + Allow `abstract-title` to be specified in docx metadata (#8794).++ * ChunkedHTML writer: Make math work in top-level page (#8915).++ * Text.Pandoc.Logging: add new log message type `ScriptingWarning`+ [API change] (Albert Krewinkel).++ * Lua: report warnings from Lua scripts (Albert Krewinkel).+ Lua's warning system is plugged into pandoc's reporting architecture.+ Warnings that are raised with the Lua `warn` function are now reported+ together with other messages.++ * Use crypton-connection instead of connection (#8896, Felix Yan).+ Follows the change introduced in tls 1.7.0.++ * Bump versions for skylighting-core, skylighting.++ * Include lua/module/sample.svg in cabal extra-source-files (Felix Yan).++ * Add Nynorsk (New Norwegian) translations (Per Christian Gaustad).++ * Add tests for `fillMediaBag`/`extractMedia`.++ * INSTALL.md:++ + Mention alternatives to LaTeX to generate PDF (Norwid Behrnd).+ + Update Linux install links (harabat).++ * pandoc-extras.md: add to "Academic publishing workflows" (#8696,+ Vladimir Alexiev).++## pandoc 3.1.3 (2023-06-07)++ * New output format: `typst`.++ * New module: Text.Pandoc.Readers.Typst [API change].++ * DocBook reader:++ + Support more emphasis roles (Albert Krewinkel).+ The role "bf" is taken to indicate "bold face", i.e.,+ "strongly emphasized" text, while "underline" leads to+ underlined text.++ * JATS reader:++ + Improve title and label parsing in the JATS reader (#8718,+ Noah Malmed.)+ + Add rowspan, colspan and alignment to cells in jats table+ reader (#8408, Noah Malmed)++ * Org reader (Albert Krewinkel):++ + Require abstract environment to use lowercase.+ + Treat `#+NAME` as synonym for `#+LABEL` (#8578).++ * ODT reader:++ + Allow lists in table cells (#8892).+ + Allow frames inside spans (#8886).++ * RST reader:++ + Fix sorting on anonymous keys (#8877). This fixes a link+ resolution bug bug affecting RST documents with anonymous links.++ * HTML reader:++ + Fix iframe with data URI of an image (#8856).+ In this case we don't want to try to parse the data at the URL.+ Instead, create an image inside a div.++ * RTF reader:++ + Fix bug in table parsing (#8767). In certain cases, text before a+ table was being incorporated into the table itself.++ * Docx reader:++ + Introduce support for Intense Quote (Stephan Meijer).++ * Markdown reader:++ + Disallow escaping of `~` and `"` in `markdown_strict` (#8777,+ Albert Krewinkel). This matches the behavior of the legacy+ `Markdown.pl` as well as what is described in the manual.++ * LaTeX reader: ignore args to column type in `\multicolumn` (#8789).++ * HTML writer:++ + Use first paragraph in task item as checkbox label (#8729, Albert+ Krewinkel).++ * Ms writer:++ + Coerce titles to inlines (#8835). Block-level formatting is not+ allowed inside `.TL`.++ * LaTeX writer:++ + Fix width for multicolumn simple table (#8831).++ * Jira writer:++ + Use first code block class as highlighting language (#8814, Albert+ Krewinkel). The writer no longer searches the list of+ classes for a known programming language but always uses+ the first class in that list as the language identifier.++ * OpenDocument writer:++ + Handle row header column cells as header cells (#8764, Michael Stahl).+ + Fix invalid `text:p` inside `text:p` from meta (#8256).++ * ODT writer:++ + Don't add settings.xml (Michael Stahl). This will cause defaults+ to be used, which is what we want.+ + Don't add unnecessary Configurations2 directory (Michael Stahl).+ + Don't add thumbnail (Michael Stahl).+ + Put `manifest.version` on directory file-entry (Michael Stahl).+ See ODF 1.3 part 2, 4.16.14.1.+ + Stop validator complaints by producing ODF 1.3 (Michael Stahl).++ * MediaWiki writer:++ + Remove links from inside links in mediawiki writer (#8739,+ Wout Gevaert).++ * Typst writer:++ + Omit bibliography if `citations` not enabled (#8763).+ With this change, the typst writer will omit the `#bibliography`+ command when `citations` is not enabled. (If you want to use+ pandoc's own `--citeproc`, you should combine it with+ `-t typst-citations` to disable native typst citations.+ + Use `<..>` for labels, create internal links.+ + Use `#footnote` for notes (#8893).+ + Fix alignment issue in lists. It's an aesthetic issue+ only; the first line had an extra space indent after the+ list marker.++ * Commonmark writer:++ + Use shortcut reference links: commonmark supports these.++ * EPUB template: add `lang` attribute to `<html>` (Gabriel Lewertoski).++ * Template styles.html: fix task-list styling in reveal.js+ (#8731, Albert Krewinkel).++ * LaTeX template: Fix `\babelfont` (#8728).++ * Text.Pandoc.Parsing:++ + Remove unnecessary 'spaces' in `parseFromString`.++ * Text.Pandoc.ImageSize: Drop BOM at start of SVG if present.+ Otherwise our code can fail to determine image size.++ * Lua subsystem:++ + Fix value of PANDOC_SCRIPT_FILE for custom readers & writers+ (#8781, Albert Krewinkel). The value did not hold the actual+ file path for scripts in the *custom* folder of the datadir.++ * Fix YAML in translation files for `cs` and `pl` (#8787).++ * Fix pdf output via typst (#8754). One must now use `typst+ compile` rather than `typst`.++ * MANUAL.txt:++ + Added note that the user will need to create the user data+ dir (#8727).+ + Add `wikilinks` to non-default extensions (Ilona).+ + Update link to custom djot writer (Albert Krewinkel).+ + Better link to citation syntax.+ + Fix typo (sdhoward).+ + Note that `#` fancy list markers don't work with commonmark (#8772,+ William Lupton).+ + Add commonmark `fenced_div` note (#8773, William Lupton).+ + Move highlighting documentation, with minor adjustments+ (William Lupton).+ + Fix inaccurate statement about spaces and tabs in template+ syntax+ (Frank Seifferth).++ * Update documentation for org-mode (Christian Christiansen, #8716).++ * doc/lua-filter.md:++ + Fix typos (#8734, perro tuerto).+ + Fix anchor (Toni Dietze).+ + Use full field name in example (#8857, Matt Dodson).+ + Fix copy-paste error (#8798, thron7).++ * CONTRIBUTING.md: update info on ghc versions.++ * INSTALL.md:++ + Fix cabal install instructions (Albert Krewinkel).+ + Use more relevant link to NetBSD/pkgsrc entry (Charlotte Koch).+ + Fix Windows install instructions for winget (#8799).++ * Tests: Rename test/docx/block_quotes_parse_indent.native for+ consistency (Stephan Meijer).++ * Add `tls` constraint on cabal.project. This is needed to+ avoid problems caused by the transition to `crypton`.++ * Require texmath 0.12.8.+++## pandoc 3.1.2 (2023-03-26)++ * Add a Lua REPL (Albert Krewinkel). This can be started+ with `pandoc lua -i`. It is also possible to instruct a filter to+ open the REPL at a certain point, for debugging (see `pandoc.cli.repl`).++ * Support `typst` as a `--pdf-engine`.++ * Add typst writer (#8713). New module Text.Pandoc.Writers.Typst,+ exporting `writeTypst` [API change].++ * Org reader:++ + Allow zero width space as an escape character (#8716,+ Christian Christiansen). Allow the character U+200B to be used as+ an escape character as described in the Org-mode documentation+ (<https://orgmode.org/manual/Escape-Character.html>).++ * DocBook reader:++ + Handle "book" for xref references (#8712, Andres Freund)+ This also adds a test xref to book and part.+ + Handle `<part>` (#8712).++ * HTML reader:++ + Fix behavior with `-native_spans-raw_html` (#8711). Previously with+ this configuration, `<span>`s were not treated as inline elements at all.++ * HTML writer:++ + Avoid duplicate classes (#8705).+ + Use img element instead of embed for `.svg.gz` and `.png.gz` etc. (#8699).+ + HTML writer footnotes changes (#8695): when `--reference-location=section`+ or `=block`, use an `aside` element for the notes rather than a `section`.+ When `--reference-location=section`, include the `aside` element inside+ the section element, rather than outside. (In slide shows, this option+ causes footnotes on a slide to be displayed at the bottom of the slide.)++ * EPUB writer:++ + Use different structure for epub footnotes (#8676, see #8672, #5583).+ Many EPUB readers are thrown off by pandoc's current footnote+ output. Both the ol and the fact that the footnote backlink is+ at the end of the note seem to pose problems.+ With this commit, we now create a list of aside (or div) elements,+ instead of an ordered list. Each element begins with a note number+ that is linked back to the note reference. (So, the backlink occurs+ at the beginning rather than the end.) Thanks to @Porges and @lewer.++ * Docx writer:++ + Include abstract title (#8702). Uses localized term for abstract.++ * Markdown writer:++ + Use implicit figures if there's a caption but no alt (#8689,+ Albert Krewinkel).++ * Jira reader (Albert Krewinkel):++ + Add panel title as nested div (#8681).+ + Require jira-wiki-markup 1.5.1 (#8680). This fixes a bug in the parser+ that caused text between two exclamation marks to be parsed as an+ image. The first `!` of image markup must now be followed by a+ non-space character; otherwise, the enclosed text is parsed as+ normal content.++ * Ms writer:++ + Fix handling of Figure (#8660).++ * ICML writer:++ + Fix images with data (#8675). The Contents element+ should be inside Properties.++ * LaTeX writer:++ + Add Chinese to Babel languages.+ + Fix background image in Beamer when there are figure environments (#8671,+ Martín Pozo).++ * LaTeX template:++ + Add `babelfonts` variable to default LaTeX template.+ This allows specifying certain fonts to be used with+ certain babel languages. Thanks to Frederik Elwert.+ + Fix highlight/underline with lualatex (#8707). We need the lua-ul package+ instead of soul, which doesn't work with lualatex.++ * Lua (Albert Krewinkel):++ + Add `pandoc.cli.repl` function+ + Fix `json.encode` for nested AST elements. Ensures that objects with+ nested AST elements can be encoded as JSON.+ + Auto-generate docs for pandoc modules.+ + Load text module as `pandoc.text`. This only affects the name in the+ Lua-internal documentation. It is still possible to load the modules+ via `require 'text'`, although this is deprecated.+ + Move docs from module `text` to `pandoc.text`+ The latter is easier to use and more consistent with the other modules.+ + Keep the Lua stack clean A metatable used during initialization was+ not properly removed from the stack. Likewise, accessing the+ CommonState from Lua previously led to the pollution of the+ Lua stack with a left-over value.+ * Add function `pandoc.format.from_path`.+ + Allow to get the JSON encoding of log messages.++ * Text.Pandoc.Format: Add new function `formatFromFilePaths` [API change]+ (#8710, Albert Krewinkel).++ * The old Text.Pandoc.App.FormatHeuristics module has been removed.++ * In `--version`, use Windows `%APPDATA%` variable to describe+ user data dir (#8686, Pablo Rodríguez).++ * Text.Pandoc.App.CommandLineOptions: don't lowercase arg to `--from`/`--read`+ (Albert Krewinkel). This prevented users to use custom writers with+ uppercase characters in their filenames. Format-normalization,+ including lower-casing of format identifiers, happens during+ format parsing.++ * Documentation:++ + Add `doc/nix.md`.+ + Add `doc/extras.md`. This was formally in the website repo.+ + `doc/lua-filters.md`: improve docs for `pandoc.zip`.++ * Factor out `make_macos_release.sh` from the release candidate workflow.+ Use cabal instead of stack to build the macos binary.++ * Modify linux/make_artifacts.sh so it will work on cirrus.++ * Switch to hslua-2.3++ * Depend on latest releases of texmath, doclayout.++## pandoc 3.1.1 (2023-03-05)++ * EPUB reader: Give additional information in error if the epub+ zip container can't be unpacked.++ * TSV reader: don't gobble tabs as whitespace (#8661).++ * Org reader: accept empty tables (#8659).++ * LaTeX reader: fix multiplication syntax for tabular (#8658).+ We recognized `*{6}{...}` but not `*6{...}` or `*6c`.++ * Docx reader: parse image alt texts in LibreOffice generated files.+ LibreOffice tags images slightly differently than Word; this change lets+ the parses take that difference into account when looking for an image+ description (alt text).++ * DocBook reader:++ + Fix `<xref>` references to tables in DocBook files+ (#8626, Pavol Otto).+ + Parse `figure` as a Figure element in the AST (#8668).++ * JATS reader: avoid generating duplicate figure captions (#8669).++ * RST reader: align with spec in syntax for role names (#8653).+ In particular, we now allow colons in row names.++ * Add note on converting from .doc format to FAQs (#8654).++ * Trap error in getAppUserDataDirectory (#8648).+ This can raise an error if pandoc is run in a non-user environment.++ * LaTeX writer: do not use longtable foot with Beamer (#8638, Albert+ Krewinkel). The table foot is made part of the table body, as+ otherwise it won't show up in the output. The root cause for+ this is that longtable cannot detect page breaks in Beamer.++ * LaTeX template: Add CJKsansfont and CJKmonofont for XeLaTeX+ (#8656, Yudong Jin). `CJKsansfont` and `CJKmonofont` will be+ set for xelatex only if `CJKmainfont` is also provided.++ * URL style in ConTeXt (#8612, Thomas Hodgson). Previously, a+ URL like this would be in monospace text:+ `\useURL[url1][https://example.com]`. Now, it will match the+ main text unless the `linkstyle` variable is set, which+ controls the styling of all links. Closes #8602.++ * Asciidoc writer: Properly escape `|` in table cells (#8665).++ * asciidoc{,tor} template: fix revision date when author is unset+ (#8637, arcnmx). Revision line syntax is only valid in+ combination with an author line, so the date attribute must be+ set explicitly when the author is missing++ * HTML writer: allow "track" element to be treated as block-level HTML+ (#8629).++ * Include needed polyfill when MathJaX is used (#8625).++ * JATS writer: include alt-text in `<graphic>`,+ `<inline-graphic>` elements (#8631, Albert Krewinkel).++ * Chunked HTML writer: Retain metadata in processing sections+ for chunked HTML (#8620). Previously we suppressed metadata+ in all but the top page, in order to prevent the title block+ from being printed on every page. This prevented use of+ custom variables set by metadata fields. This commit moves+ to a better solution: a conditional in the default template+ restricts the title block to the top page.++ * Lua API:++ + Add new function `pandoc.system.cputime` (Albert+ Krewinkel). The function returns the CPU time consumed by+ pandoc and can be used to benchmark Lua computations.+ + Add module `pandoc.json` to handle JSON encoding (#8605,+ Albert Krewinkel).++ * Use pandoc-lua-marshal 0.2.1 (Albert Krewinkel).+ All major AST elements now have `__tojson` metamethods that return the+ JSON representation of an element. This allows to JSON-encode these+ elements with libraries that respect the `__tojson` metamethod,+ including dkjson.++ * Use latest zip-archive. This allows pandoc to open certain+ epubs that it could not open before.++ * Use commonmark-extensions 0.2.3.4. This fixes some bugs involving+ definition lists and inline formatting.++ * Use latest skylighting-format-context++ * MANUAL.txt:++ + Document chunk-template in defaults file.+ + Remove obsolete "raw content in a style" section.+ + Revise documentation for `--mathml` to reflect support in all major+ browsers (#8667).++ * docs/custom-readers.md: Update JSON parsing example. The example now+ uses the built-in `pandoc.json` library to parse the API output.++ * doc/press.md: Add article on CiTO in J Cheminform by @egonw.++ * doc/lua-filters.md: fix typo in `run_json_filter` (Morgan Willcock).+++## pandoc 3.1 (2023-02-09)++ * Fix regression with `--print-highlight-style` option (#8586).++ * Add new `--chunk-template` option (#8581), allowing more control+ over the filenames in chunked HTML output.++ * Text.Pandoc.App: Add `optChunkTemplate` constructor to Opt [API change].++ * Text.Pandoc.Options: add `writerChunkTemplate` constructor to+ `WriterOptions` [API change].++ * Text.Pandoc.Chunks: add Data, Typeable, Generic, ToJSON, FromJSON+ instances for `PathTemplate` [API change].++ * Text.Pandoc.Citeproc: Fix bug in `metaValueToReference` (#8611).+ This bug caused us to get some repeated content when converting+ MetaBlock to Inlines.++ * Textile reader:++ + Support footnote backlinks (#8585, Stephen Altamirano).+ + Don't allow brackets in URLs (#8582).++ * ODT reader: fix blockquote indent detection (#3437, Daniel Kessler).++ * LaTeX writer: include short figure/table caption if one is given+ (Albert Krewinkel). Short captions are used by LaTeX when generating+ the list of figures or list of tables. Adding a short caption will+ now overwrite the full caption in these lists.++ * Powerpoint writer: fix handling of simple figures (#8565,+ Albert Krewinkel). This ensures that simple figures are displayed+ in the same way as before the introduction of a dedicated `Figure`+ constructor in the AST.++ * Improve handling of `%` in bib(la)tex parsing (#8597, #8595).++ * Use released skylighting 0.13.2.1++ * INSTALL.md: direct people to cabal install pandoc-cli.++ * doc/lua-filters.md: document 'Figure' type and constructor (Albert+ Krewinkel). Fix typos (Martin Joerg).++ * Fix link in manual (#8583, Salim B).++## pandoc 3.0.1 (2023-01-25)++ * Fix use of extensions with custom readers (#8571).++ * Text.Pandoc.Writers.Shared: export `setupTranslations` [API change].+ Use this in HTML and OpenDocument writers, to ensure that+ translations are set up properly even when we don't go through+ `convertWithOpts`.++ * LaTeX reader: fix regression in macro resolution for environments (#8573).++ * Chunked HTML writer: Fix handling of images with absolute URLs (#8567).++ * HTML writer:++ + Don't omit newlines in task lists.+ + Don't disable checkboxes in task lists (#8562).++ * Ensure that automatically set variables `pandoc-version`, `outputfile`,+ `title-prefix`, `epub-cover-image`, `curdir`, `dzslides-core` can be+ overridden by `--variable` on the command line. Previously they would+ create lists in the template Context, which is not desirable.++ * Fix man page copying in `linux/make_artifacts.sh` (#8566).+ Previously we were copying the pandoc-server.1 pandoc page to pandoc-lua.1.++ * pandoc.cabal: remove pandoc.cabal, stack.cabal from extra-source-files+ (#8560). The problem is that if these are in extra-source-files, then they+ get put in the tarball, and then anyone trying to build the source+ from an unpacked tarball will run into the problem that cabal.project+ and stack.yaml refer to pandoc-server, pandoc-lua-engine, and+ pandoc-cli, which aren't in the tarball.++ * Require texmath 0.12.6 for better MathML output.++ * Fix typo in Lua filter documentation (Carlos Scheidegger).++ * Fix formatting of link in pandoc-server.md (James Scott-Brown).++ * Minor changelog fixups.++## pandoc 3.0 (2023-01-18)++ * Split pandoc-server, pandoc-cli, and pandoc-lua-engine+ into separate packages (#8309). Note that installing+ the `pandoc` package from Hackage will no longer give you the+ `pandoc` executable; for that you need to install `pandoc-cli`.++ * Pandoc now behaves like a Lua interpreter when called as+ `pandoc-lua` or when `pandoc lua` is used (#8311, Albert Krewinkel).+ The Lua API that is available in filters is automatically+ available to the interpreter. (See the `pandoc-lua` man page.)++ * Pandoc behaves like a server when called as `pandoc-server`+ or when `pandoc server` is used. (See the `pandoc-server` man page.)++ * A new command-line option `--list-tables`, causes tables to be+ formatted as list tables in RST (#4564, with Francesco Occhipinti).++ * New command line option: `--epub-title-page=true|false` allows+ the EPUB title page to be omitted (#6097).++ * `--reference-doc` can now accept a URL argument (#8535) and+ load a remote reference doc.++ * `--version` output no longer contains version info for dependent+ packages. Instead, it contains a "Features" line that indicates+ whether the binary was compiled with support for acting as a server,+ and for using Lua filters and Custom writers.++ * A new option `--split-level` replaces `--epub-chapter-level`+ and affects both EPUB and chunked HTML output. `--epub-chapter-level`+ will still work but is deprecated.++ * Multiple input files with `--file-scope`: fix case where the links+ are URL-encoded, e.g. with `%20` (#8467).++ * Produce error if `--csl` is used more than once (#8195, Prat).++ * Remove deprecated `--atx-headers` option.++ * Remove deprecated option `--strip-empty-paragraphs`.++ * In `--verbose` mode add message when running citeproc (as with+ other filters).++ * Add new `mark` extension for highlighted text in Markdown,+ using `==` delimiters (#7743).++ * Add new extensions `wikilinks_title_after_pipe` and+ `wikilinks_title_before_pipe` for `commonmark` and `markdown`.+ (#2923, Albert Krewinkel). The former enables links of style+ `[[Name of page|Title]]` and the latter `[[Title|Name of+ page]]`. Titles are optional in both variants, so this works+ for both: `[[https://example.org]]`, `[[Name of page]]`. The+ writer is modified to render links with title `wikilink` as+ a wikilink if a respective extension is enabled. Pandoc will+ use `wikilinks_title_after_pipe` if both extensions are+ enabled.++ * Add prefixes to identifiers with `--file-scope` (#6384).+ This change only affects the case where `--file-scope` is used+ and more than one file is specified on the command line.+ In this case, identifiers will be prefixed with a string+ derived from the file path, to disambiguate them. For example,+ an identifier `foo` in `contents/file1.txt` will become+ `contents__file1.txt__foo`. Links will be adjusted accordingly:+ if `file2.txt` links to `file1.txt#foo`, then the link will+ be changed to point to `#file1.txt__foo`. Similarly, a link+ to `file1.txt` will point to `#file1.txt`. A Div with an+ identifier derived from the file path will be added around+ each file's content, so that links to files will still work.++ * New output format: `chunkedhtml`. This creates a zip file+ containing multiple HTML files, one for each section,+ linked with "next," "previous," "up," and "top" links.+ (If `-o` is used with an argument without an extension,+ it is treated as a directory and the zip file is automatically+ extracted there, unless it already exists.) The top page will+ contain a table of contents if `--toc` is used. A+ `sitemap.json` file is also included. The option+ `--split-level` determines the level at which sections are+ to be split.++ * Support complex figures (Albert Krewinkel, Aner Lucero).+ There is now a dedicate Figure block constructor for+ figures. The old hack of representing a figure as+ `Para [Image attr [..alt..] (source, "fig:title")]`+ has been dropped. Here is a summary of figure support+ in different formats:++ + Markdown reader: paragraphs containing just an image are treated as+ figures if the `implicit_figures` extension is enabled. The identifier+ is used as the figure's identifier and the image description is also+ used as figure caption; all other attributes are treated as belonging+ to the image.+ + Markdown writer: figures are output as implicit figures if possible,+ via HTML if the `raw_html` extension is enabled, and as Div elements+ otherwise.+ + HTML reader: `<figure>` elements are parsed as figures, with the+ caption taken from the respective `<figcaption>` elements.+ + HTML writer: the alt text is no longer constructed from the caption,+ as was the case with implicit figures. This reduces duplication, but+ comes at the risk of images that are missing alt texts. Authors should+ take care to provide alt texts for all images. Some readers, most+ notably the Markdown reader with the `implicit_figures` extension,+ add a caption that's identical to the image description. The writer+ checks for this and adds an `aria-hidden` attribute to the+ `<figcaption>` element in that case.+ + JATS reader: The `<fig>` and `<caption>` elements are parsed into+ figure elements, even if the contents is more complex.+ + JATS writer: The `<fig>` and `<caption>` elements are used write+ figures.+ + LaTeX reader: support for figures with non-image contents and for+ subfigures.+ + LaTeX writer: complex figures, e.g. with non-image contents and+ subfigures, are supported. The `subfigure` template variable is set if+ the document contains subfigures, triggering the conditional loading+ of the *subcaption* package. Contants of figures that contain tables+ are become unwrapped, as longtable environments are not allowed within+ figures.+ + DokuWiki, Haddock, Jira, Man, MediaWiki, Ms, Muse, PPTX, RTF, TEI,+ ZimWiki writers: Figures are rendered like Div elements.+ + Asciidoc writer: The figure contents is unwrapped; each image in the+ the figure becomes a separate figure.+ + Classic custom writers: Figures are passed to the global function+ `Figure(caption, contents, attr)`, where `caption` and `contents` are+ strings and `attr` is a table of key-value pairs.+ + ConTeXt writer: Figures are wrapped in a "placefigure" environment+ with `\startplacefigure`/`\endplacefigure`, adding the features+ caption and listing title as properties. Subfigures are place in a+ single row with the `\startfloatcombination` environment.+ + DocBook writer: Uses `mediaobject` elements, unless the figure contains+ subfigures or tables, in which case the figure content is unwrapped.+ - Docx writer: figures with multiple content blocks are rendered as+ tables with style `FigureTable`; like before, single-image figures are+ still output as paragraphs with style `Figure` or `Captioned Figure`,+ depending on whether a caption is attached.+ + DokuWiki writer: Caption and "alt-text" are no longer combined. The+ alt text of a figure will now be lost in the conversion.+ + FB2 writer: The figure caption is added as alt text to the images in+ the figure; pre-existing alt texts are kept.+ + ICML writer: Only single-image figures are supported. The contents of+ figures with additional elements gets unwrapped.+ + OpenDocument writer: A separate paragraph is generated for each block+ element in a figure, each with style `FigureWithCaption`. Behavior for+ single-image figures therefore remains unchanged.+ + Org writer: Only the first element in a figure is given a caption;+ additional block elements in the figure are appended without any+ caption being added.+ + RST writer: Single-image figures are supported as before; the contents+ of more complex images become nested in a container of type `float`.+ + Texinfo writer: Figures are rendered as float with type `figure`.+ + Textile writer: Figures are rendered with the help of HTML elements.+ + XWiki: Figures are placed in a group.++ * Changes in custom readers/writers:++ + It is now possible to have a custom reader and a custom writer for+ a format together in the same file. The file may also define+ a custom template for the writer.+ + Pandoc now checks the folder `custom` in the user's data directory+ for a matching script if it can't find one in the local directory.+ Previously, the `readers` and `writers` data directories were+ searched for custom readers and writers, respectively. Scripts in+ those directories must be moved to the `custom` folder.+ + Custom readers used to implement a fallback behavior that allowed to+ consume just a string value as input to the `Reader` function. This+ has been removed, the first argument is now always a list of+ sources. Use `tostring` on that argument to get a string.++ * New module Text.Pandoc.Writers.ChunkedHTML,+ exporting `writeChunkedHtml` [API change].++ * We now set the `pandoc-version` variable centrally rather+ than in the writers. One effect is the man writer now emits+ a comment with the pandoc version.++ * pandoc-server:++ + Add simple CORS support to pandoc-server (#8427).+ + Print message to stderr when starting the server.++ * Docx reader:++ + Mark unnumbered headings with class `unnumbered` (#8148,+ Albert Krewinkel). This change ensures good conversion+ results when converting with `--number-sections`.+ + Support parsing of highlighted text.+ + Fix handling of `oMathPara` in `w:p` with other content (#8483).++ * ODT reader:++ + Fix relative links. ODT adds a `../` to relative links+ (see #3524); this needs to be removed when converting from ODT.+ + Handle "section" elements (#8409).+ + Rename Text.Pandoc.Readers.Odt -> Text.Pandoc.Readers.ODT,+ for consistency with Writers.ODT. Rename `readOdt` -> `readODT`.+ [API change]++ * DocBook reader:++ + Support href on link even in a fragment (#8437).+ (We now just look for an `href` attribute without+ worrying about the namespace.)+ + Parse title from imageobject/objectinfo (#8437).++ * JATS reader:++ + Handle uri element in references (#8270).++ * Ipynb reader:++ + Add cell id to attachment filename when storing in MediaBag (#8415).+ Otherwise attachments with the same name can overwrite each other.++ * LaTeX reader:++ + Skip parenthenized args of toprule, midrule, etc (#8242).+ + Handle `##` macro arguments properly (#8243).+ + Remove unused function `toksToString` in Parsing module.+ + Support more `soul` commands, including `\hl`.+ + Add `unnumbered` class for `\part*` (#8447)+ + Fix `TEXINPUTS` handling (#8392). If `TEXINPUTS` ends with `:`,+ then the system default `TEXINPUTS` is added. We handle this by+ just adding the working directory in this case.+ + Parse short table caption (see jgm/pandoc-types#103).+ This is not too useful yet, because writers don't do anything with+ the short caption.++ * MediaWiki reader:++ + Parse table cell with attributess, to support rowspan, colspan (#8231,+ Ruqi).+ + Refine "blending" rules for MediaWiki links (#8525, Ruqi).+ The rules for "blending" characters outside a link into the link are+ described here: https://en.wikipedia.org/wiki/Help:Wikitext#Blend_link+ These pose a problem for CJK languages, which generally don't have+ spaces after links. However, it turns out that the blending behavior, as+ implemented on Wikipedia, is (contrary to the documentation) only for+ ASCII letters. This commit implements that restriction, which fixes+ the problem for CJK.++ * HTML reader:++ + Fix regression for `<tt>` (#8330). It was no longer being parsed as+ Code (Justin Wood).++ * RST reader:++ + Support `mark` role for round-trip.++ * Textile reader:++ + Support linked images (#8541).+ + Fix strong emph ending with link (#8540).+ + Adding a Parser to look for ordered list start attribute numbers+ if any (#2465, vkraven).+ + Handle empty paragraphs (#8487). Also, if attributes are added+ explicitly to a paragraph, put it in a Div with the attributes.++ * Markdown reader:++ + Allow fenced code block "bare" language to be combined+ with attributes (#8174, Siphalor), e.g.+ ````+ ```haskell {.class #id}+ ```+ ````+ + Allow table caption labels to start with lowercase `t` (#8259).+ + Grid tables: allow specifying a table foot by enclosing it with+ part separator lines, i.e., row separator lines consisting only+ of `+` and `=` characters (#8257, Albert Krewinkel). E.g.:+ ```+ +------+-------++ | Item | Price |+ +======+=======++ | Eggs | 5£ |+ +------+-------++ | Spam | 3£ |+ +======+=======++ | Sum | 8£ |+ +======+=======++ ```+ + Fix `implicit_header_references` with duplicate headings (#8300).+ Documentation says that when more than one heading has the same text,+ an implicit reference `[Heading text][]` refers to the first one.+ Previously pandoc linked to the last one instead. This patch+ makes pandoc conform to the documented behavior.+ + Parse highlighted text inside `==..==` if `mark` extension enabled.++ * Org reader:++ + Allow org-ref v2 citations with `&` prefix (#8302).+ + Make `#+pandoc-emphasis-pre` work as expected (#8360, Amir Dekel).++ * BibTeX reader:++ + Fix handling of `%` in `url` field (#7678).+ `%` does not function as a comment character inside `url`+ (where URL-encoding is common).+ + Allow `url` field in `bibtex` as well as `biblatex` (#8287).+ This field is not officially supported for BibTeX, but many styles+ can handle it (<https://www.bibtex.com/f/url-field/>),+ and others will ignore it.+ + Support `software` type in biblatex <-> CSL conversions (#8504).+ + Make sure `version` field comes through in biblatex (#8504).++ * BibTeX writer:++ + Pass through `url` even for `bibtex` (#8287).++ * Org writer:++ + Pass through unknown languages in code blocks (#8278), instead+ of producing `begin_example`.+ + Use span attributes `tag-name` in headers as tags (#8513, Albert+ Krewinkel). This enables round-tripping of tags in Org headings.++ * EndNote reader:++ + Better error when parsing EndNote references fails.++ * DocBook writer:++ + Rename Text.Pandoc.Writers.Docbook -> Text.Pandoc.Writers.DocBook.+ Rename `writeDocbook` -> `writeDocBook`, for consistency with+ the DocBook reader's naming. [API change]+ + Fix position of textobject (#8437). It is a child of+ `inlinemediaobject`, not `imageobject`.+ + Add regression tests for #8437.+ + Render image alt text using textobject element (#8437).+ + Don't indent contents of title element.+ + Store "unnumbered" class in DocBook role attribute (#1402, lifeunleaded).++ * ConTeXt writer (Albert Krewinkel):++ + Support syntax highlighting for code.+ + Always use `\type` for inline code.+ Inline codes that contained curly braces where previously rendered+ with `\mono`; this led to unexpected results when the presentation+ of `\type` was customized, as those changes would not have+ been applied to code rendered with `\mono`.+ + Add support for unlisted, unnumbered headings (#8486).+ + Support `tagging` extension (Albert Krewinkel). Paragraphs+ are enclosed by `\bpar` and `\epar` commands, and `highlight` commands+ are used for emphasis. This results in much better tagging in PDF output.++ * LaTeX writer:++ + Do not repeat caption on headless tables (Albert Krewinkel).+ The caption of headless tables was repeated on each page that+ contained part of the table. It is now made part of the+ "first head", i.e. the table head that is printed only once.+ + Add separator line between table's body and its foot+ (Albert Krewinkel).+ + Ignore languages with no babel equivalent, instead of generating an+ invalid command in the preamble (#8325).+ + Use `\includesvg` for SVGs and include the `svg` package (#8334).+ + Use `soul` instead of `ulem` for strikeout, underline (#8411).+ This handles things like hyphenation, line breaks, and nonbreaking+ spaces better.+ + Use `\toprule\noalign{}` instead of `\toprule()` in tables,+ and similarly for `\midrule` and `\bottomrule` (#8223).+ This facilitates redefining `\toprule`, `\midrule`, and `\bottomrule`+ without needing to gobble the ()s. (Those who redefine these macros+ on the assumption that they will be followed by `()` may need to+ change their definitions.)+ + Support highlighted text for Span with class `mark`.++ * JATS writer:++ + Use `<break/>` for LineBreak in the limited contexts that accept it+ (#8344).+ + Officially deprecate `writeJATS` in favor of `writeJatsArchiving`.++ * RTF writer:++ + Add space after unicode escape commands (#8264). This fixes+ a bug that caused characters to disappear after unicode escapes.++ * RST writer:++ + Render tables as list tables when the `--list-tables` option is+ specified (`writerListTables`) (#4564, Francesco Occhipinti).+ + Improve inline escaping rules (#8380).+ + Use special `mark` role for Span with class `mark`.++ * Commonmark writer:++ + Ensure that we don't have blank lines in raw HTML (#8307).++ * HTML writer:++ + Only add role attribute in HTML5 (#8241). It is not valid in HTML4.+ + Avoid aria-hidden in code blocks for HTML4 (#8241).+ + Only treat `. . .` as a slide pause in slides, and not in regular+ HTML output (#8281).+ + Properly merge classes for headings of level > 6 (#8363).+ + Prevent `<a>` inside `<a>` (#7585). If a link text contains a link,+ we replace it with a span.+ + Replace deprecated aria roles for bibliography entries (#8354).+ `doc-biblioentry` -> `listitem`, `doc-bibliography` -> `list`.+ + Remove obsolete stuff about mathml-script.+ This was a shim we used to include for mathml support.+ We don't do anything with this any more, so this is dead code.+ + Include math links if there are raw commands or environments that+ can be interpreted as math e.g. by MathJax (#8469).+ + Add prooftree to list of math environments (#8462). This will cause+ raw LaTeX prooftree environments to be rendered appropriately when+ `--mathjax` is used.++ * HTML, Markdown writers: filter out empty class attributes (#8251).+ These should not be generated by any pandoc readers, but they+ might be produced programmatically.++ * Markdown writer:++ + Avoid HTML fallbacks in the generated TOC (Albert Krewinkel, #8131).+ The generated table of contents usually has IDs for each TOC link,+ allowing to link back to specific parts of the TOC. However, this+ leads to unidiomatic markup in formats like gfm, which do not support+ attributes on links and hence fall back to HTML. The IDs on TOC items+ are now removed in that case, leading to more aesthetic TOCs.+ + Escape `!` before `[` (#8254).+ + Support `mark` extension.++ * AsciiDoc writer:++ + In link text, only replace commas with entities when they're in+ Str elements. If a link contains an image, it may have attributes,+ and the commas there should not be converted (see #8437, #8070).++ * ODT writer:++ + Fix relative links (#3524).++ * Docx writer:++ + Better handling of tables in lists (#5947). Previously the content+ of each list cell was indented when the table belonged to a list+ item.+ + Indent tables in list items (#5947).+ + Adjust correct attribute on `lang` element (#7022). For East Asian+ languages, we need to adjust `w:eastAsia` rather than `w:val`.+ This allows normal fonts to be used for any Latin-font text.+ Similarly, for bidi languages, we need to adjust `w:bidi`+ rather than `w:val`. We treat `he` and `ar` as bidi languages,+ `zh`, `ja`, `ko` as East Asian languages.+ + Support relative image widths (Albert Krewinkel).+ Image widths given in percent are interpreted to be relative to+ the text width. Previously, percent widths were taken relative to+ the image's native size, inconsistently with other writers.+ + Avoid using 'error' for unassigned table cells (#8468). Instead,+ throw a regular pandoc error.+ + Render a Span with class `mark` as highlighted. Currently+ yellow is hardcoded.++ * MediaWiki writer:++ + Use the 'new' table structure, so that colspan and rowspan are+ supported (Wout Gevaert).++ * Man writer:++ + Use UTF-8 by default for non-ascii characters (#8507).+ Only use groff escapes if `--ascii` has been specified on the+ command line (`writerPreferAscii`).++ * ICML writer:++ + Use Contents element for images with raw data instead of a link+ with a data: uri (#8398).++ * EPUB writer:++ + Refactor to use Text.Pandoc.Chunks.+ + Refactored and simplified code.+ + Make title page optional (#6097).++ * Ms writer:++ + Properly format display equations (#8308).+ + Remove -C option on PSPIC. Some old versions don't support this+ option, and since it's the default it shouldn't be necessary.++ * XWiki writer:++ + Use template if it is specified (#8296). Previously+ templates were ignored.++ * LaTeX template:++ + Set fonts after Beamer theme (Jeremie Knuesel). Beamer themes+ such as metropolis and saintpetersburg change the default+ fonts. This change gives precedence to the user font settings+ by moving them after the loading of the Beamer theme.+ + Set `\babelfont` when `mainlang` and `lang` are specified and+ `pdflatex` is not being used (#8538). This is needed for good+ results in Arabic.+ + Add variable `urlstyle` (#8429, Amar Al-Zubaidi). This is set to+ `same` by default, so users should not experience any change.++ * HTML template:++ + Remove default font size, line height and font family in+ default inline css (#8423). `mainfont`, `fontsize`,+ and `linestretch` can still be used as before; the only difference+ is that we no longer provide opinionated defaults.+ This commit also adds a `maxwidth` variable that sets `max-width`;+ if not set, 36em is used as a default.+ + Add `code { hyphens: manual; }`.+ + Use `styles.citations.html` partial in `styles.html`.+ + Fix class name `hanging` -> `hanging-indent` in+ `styles.citations.html`.+ + Put Consolas before Lucida Console for code font (#8543).+ This is to prevent Lucida Console from being used on Windows, where+ it causes spacing issues in some applications, with boldface+ glyphs wider than regular ones.++ * EPUB CSS changes: Reduce the amount of inline CSS used for EPUBs+ (#8379). Almost everything is now in the default EPUB CSS+ (`data/epub.css`), which can be overridden either by+ putting `epub.css` in the user data directory or by using+ `--css` on the command line. Inline styles are only used+ for syntax highlighting (which depends on the style+ specified, and is only included on pages with highlighted+ code) and for bibliography formatting (which can depend on+ the CSL style, and is only used in the page containing the+ bibliography).++ Note that, for compatibility with older readers, we don't+ use flexbox to style `column/columns` divs by default, as+ we do in HTML. Instead, we use an older method which only+ works when there are two `column` divs inside a `columns`+ div. If you need more than two columns and aren't worried+ about support for older EPUB readers, you can modify the+ default CSS (there is a comment in the CSS telling you what+ to do).++ * Reveal.js template: prevent line-wrapping of parallax options+ (#8503, Albert Krewinkel).++ * reference.pptx: Remove unsupported element (#8342, #6338, Link Swanson).+ The default template contained text above the header, which can mislead+ users into thinking there is a way to put text there using pandoc.++ * Text.Pandoc.Readers.Metadata:++ + Fix metadata parsing corner case (#8465).+ + Don't fail on inline metadata beginning with newline (#8358).++ * Text.Pandoc.App:++ + Move initial input-to-Pandoc code to internal submodule (Albert+ Krewinkel).+ + Change `parseOptionsFromArgs` and `parseOptions` (#8406)+ They now return `Either OptInfo Opt`. [API change]+ + Add `OptInfo` type [API change].+ + Add `handleOptInfo` function. This performs the IO actions for+ things like `--version` that were previously done in+ `parseOptionsFromArgs` [API change].+ + `convertWithOpts`: add argument for a `ScriptingEngine` [API change].+ + Unify check for standalone output (Albert Krewinkel).+ + New `optEpubTitlePage` field on `Opt` [API change] (#6097).+ + Remove `optEpubChapterLevel`, add `optSplitLevel` [API change].+ + Export `IpynbOutput(..)` [API change].++ * Text.Pandoc.App.OutputSettings:++ + Remove unused field `outputWriterName` in `OutputSettings`.++ * Text.Pandoc.Citeproc:++ + Check both extension and mime type to determine bibliography type+ when the bibliography is fetched remotely (#7151).+ + CslJson: allow an object with `items` property in addition to+ an array of references. This is what is returned by e.g.+ `https://api.zotero.org/groups/904125/items?v=...&format=csljson`+ + Require a digit for an implicit "page" locator inside explicit+ locator syntax `{...}` (#8288). Previously a locator specified as+ `{}` would be rendered as `p.` with nothing after it.+ + Update `sub verbo` to `sub-verbo` (#8315). This is a change in+ the term's canonical name in citeproc. As a result of this change,+ `sub verbo` locators have not worked in pandoc since citeproc 0.7.+ + Text.Pandoc.Citeproc.MetaValue: remove unused function+ `metaValueToPath`.+ + Add internal module Text.Pandoc.Citeproc.Name (#8345). This exports+ `toName`, which previously had been part of T.P.Citeproc.BibTeX,+ and allows for cleaner module dependencies.++ * Export module `Text.Pandoc.Slides` [API Change] (Albert Krewinkel).++ * Add new module Text.Pandoc.Format [API change] (Albert Krewinkel).+ The module provides functions and types for format spec parsing and+ processing. The function `parseFormatSpec` was moved from+ Text.Pandoc.Extensions to the new module and renamed to+ `parseFlavoredFormat`. It now operates in+ a PandocMonad and is based on the updated types.++ * Text.Pandoc.Sources:++ + Add UpdateSourcePos instances for String and+ strict and lazy ByteString [API change].++ * Text.Pandoc.Extensions:++ + Fix JSON decoding of Extensions (#8352, Albert Krewinkel).+ + Add new exported function `readExtension` [API change].+ + Remove `parseFormatSpec` [API change]. This has been moved+ to Text.Pandoc.Format and renamed as `parseFlavoredFormat`+ (Albert Krewinkel).+ + Simpler implementation of Extensions based on Set+ (benchmarks show no performance penalty).+ + Add `CustomExtension` constructor to `Extension` [API change].+ + Remove `Bounded`, `Enum` instances for `Extension`.+ + Add `extensionsToList` function.+ + Revise `readExtension` so it can handle `CustomExtension`, and so+ that it returns a Text rather than `Maybe Text`.+ + Add `showExtension` [API change].+ + Add `Ext_mark` extension [API change].+ + Add `Ext_tagging` constructor [API change] (Albert Krewinkel).+ + Add `Ext_wikilinks_title_after_pipe`, `Ext_wikilinks_title_before_pipe`+ [API change] (Albert Krewinkel).++ * Text.Pandoc.PDF:++ + Fix `papersize` on PDF generation via ms (#8403).+ We need to set an option in pdfroff in addition to including+ a macro in the ms file. With this fix, `-Vpapersize=a4` should be+ sufficient to produce A4 PDF via ms.+ + Change default background color of PDFs generated via HTML (#8422,+ Marcin Serwin).++ * Text.Pandoc.MIME:++ + Base module on package `mime-types`, which+ is already a transitive dependency (#8277, Albert Krewinkel).+ + Remove deprecated overrides (#8292).++ * Text.Pandoc.XML:++ + Re-export `lookupEntity` from commonmark-hs [API change].++ * Text.Pandoc.Parsing:++ + Remove gratuitious renaming of Parsec types. We were exporting+ Parser, ParserT as synonyms of Parsec, ParsecT.+ There is no good reason for this and it can cause confusion.+ Also, when possible, we replace imports of Text.Parsec with+ Text.Pandoc.Parsing. The idea is to make it easier, at some point,+ to switch to megaparsec or another parsing engine if we want to.+ New (re-)exports: `Stream(..)`, `updatePosString`, `SourceName`,+ `Parsec`, `ParsecT`. Removed exports: `Parser`, `ParserT`+ [API change].+ + Export `errorMessages`, `messageString` [API change].+ + Export `fromParsecError`, which can be used to turn a parsec+ ParseError into a regular PandocParseError (#8382) [API change].+ + Remove `nested` [API change]. It was not being used, and in fact it+ was a bad idea from the beginning, as it had no hope of solving+ the problem it was introduced to solve.+ + Change `characterReference`, `charsInBalanced`. `characterReference`+ so they now return a Text (some named references don't correspond+ to a single Char). Use the the `lookupEntity` function from+ commonmark-hs instead of the slow one from tagsoup [API change].+ + `charsInBalanced` now takes a Text parser rather than a Char parser+ as argument [API change].++ * Text.Pandoc.Shared:++ + Export `textToIdentifier` [API change].+ + Remove deprecated `crFilter`. [API change]+ + Remove deprecated `deLink`. [API change]+ + Deprecate `notElemText`.+ + Deprecate `makeMeta`.+ + Remove `pandocVersion` (now available in Text.Pandoc.Version+ as `pandocVersionText`).+ + Remove `findM` [API change]. This was only used in one place, and+ can be replaced with simpler code.+ + Remove deprecated `makeMeta` [API change].+ + Remove `ordNub` [API change]. This is just `nubOrd` from+ Data.Containers.ListUtils.+ + Remove `mapLeft` [API change]. This is just a synonym for+ Bifunctor.first.+ + Remove `elemText`, `notElemText` [API change].+ + Drop export of `pandocVersion` and `pandocVersionText`,+ which are now exported by Text.Pandoc.Version.+ + Remove `escapeURI`, `isURI`. These are now exported by+ Text.Pandoc.URI, and removing them from Shared helps make+ the module structure more straightforward.+ + Use LineBreak as default block sep in `blocksToInlines`.+ (#8499, Albert Krewinkel). This change also affects the+ `pandoc.utils.blocks_to_inlines` Lua function.+ + `defaultUserDataDir` is no longer exported (it has been+ moved to T.P.Data) [API change].+ + New function `figureDiv`, offering offers a standardized way+ to convert a figure into a Div element (Albert Krewinkel) [API change].++ * Text.Pandoc.Writers.Shared:++ + Export `htmlAddStyle`, `htmlAlignmentToString` and `htmlAttrs`+ [API change] (Wout Gevaert).+ + Use 'literal tag' instead of 'text (T.unpack tag)' in `tagWithAttrs`+ (Wout Gevaert).+ + `toTableOfContents`: handle nested Divs better (#8402).++ * Rename Text.Pandoc.Network.HTTP -> Text.Pandoc.URI.+ This is still an unexported internal module.+ Export `urlEncode`, `escapeURI`, `isURI`, `schemes`, `uriPathToPath`.+ Drop exports of `schemes` and `uriPathToPath`.++ * Text.Pandoc.URI `isURI`: don't require non-ASCII characters to be+ escaped (#8508).++ * Rename Text.Pandoc.Readers.LaTeX.Types -> Text.Pandoc.TeX (internal+ module).++ * Text.Pandoc.Options:++ + WriterOptions now has a field `writerListTables`,+ specifying that list tables be used in RST output [API change].+ + New `writerEpubTitlePage` field on `WriterOptions` (#6097)+ [API change].+ + Remove `writerEpubChapterLevel`, add `writerSplitLevel` [API change].++ * Text.Pandoc.Filter:++ + Export `applyFilters` [API change].+ + Export `applyJSONFilter` [API Change] (Albert Krewinkel).+ + Parameterize `applyFilters` over scripting engine [API change] (Albert+ Krewinkel).++ * New exported module Text.Pandoc.Chunks [API change]. This+ module provides functions to split Pandoc documents into+ chunks to be rendered in separate files, e.g. one per+ section. Internal identifiers are rewritten appropriately to+ point to the new locations (#6122).++ * Text.Pandoc.Readers:++ + Change argument type of `getReader`, so it takes a `FlavoredFormat`+ instead of a `Text` [API change] (Albert Krewinkel).++ * Text.Pandoc.Writers:++ + Change argument type of `getWriter`, so it takes a `FlavoredFormat`+ instead of a `Text` [API change] (Albert Krewinkel).++ * Text.Pandoc.Templates:++ + Do not try to normalize input to `getDefaultTemplate` (Albert+ Krewinkel). The function `getDefaultTemplate` no longer splits off+ extension modifers from the given format, as that conflicts with+ using custom writers as formats. Haskell library users should use+ `getDefaultTemplate <=< (fmap formatName . parseFlavoredFormat)`+ if the input format can still contain extensions. The same is true+ for `compileDefaultTemplate`, which calls `getDefaultTemplate`+ internally+ + Add Wrapper type documentation (#8490, William Rusnack).++ * New exported module Text.Pandoc.Scripting (Albert Krewinkel).+ The module contains the central data structure for scripting engines+ (e.g., Lua) [API change].++ * Text.Pandoc.Error:++ + Add new PandocError constructor `PandocNoScriptingEngine` [API change]+ (Albert Krewinkel).+ + Add new PandocError constructor `PandocFormatError` [API change]+ (Albert Krewinkel). The new error is used to report problems with+ input or output format specifications.+ + Add new PandocError constructor `PandocNoTemplateError`+ (Albert Krewinkel).+ + Remove `PandocParsecError` constructor from `PandocError` (#8385).+ Henceforth we just use `PandocParseError`.++ * New module Text.Pandoc.Version, exporting `pandocVersionText`+ and `pandocVersion` [API change]. `pandocVersion` returns a `Version`+ instead of a `Text`, which is consistent with `pandocTypesVersion`.++ * Text.Pandoc.Class:++ + Make `getPOSIXTime`, `getZonedTime` sensitive to `SOURCE_DATE_EPOCH`+ environment variable if set (#7093). (`getTimestamp` was+ already sensitive.) This ensures that EPUB builds are reproducible.+ + Text.Pandoc.Class no longer exports `readDataFile`,+ `readDefaultDataFile`, `setTranslations`, and `translateTerm`+ [API change].+ + Text.Pandoc.Class now exports `checkUserDataDir` [API change].++ * T.P.Class.IO: export function `writeMedia` [API change] (Albert Krewinkel).+ This is useful for the `pandoc.mediabag` module.++ * Separate out Text.Pandoc.Data and Text.Pandoc.Translations from+ Text.Pandoc.Class (#8348). This makes Text.Pandoc.Class+ more self-contained.++ + Text.Pandoc.Data is now an exported module, providing `readDataFile`+ and `readDefaultDataFile` (both formerly provided by+ Text.Pandoc.Class), and also `getDataFileNames` (formerly+ unexported in Text.Pandoc.App.CommandLineOptions)+ and `defaultUSerDataDir` (formerly provided by+ Text.Pandoc.Shared). [API change]+ + Text.Pandoc.Translations is now an exported module (along with+ Text.Pandoc.Translations.Types), providing `readTranslations`,+ `getTranslations`, `setTranslations`, `translateTerm`,+ `lookupTerm`, `readTranslations`, `Term(..)`, and `Translations` [API+ change].++ * Text.Pandoc now exports Text.Pandoc.Data and `setTranslations`+ and `translateTerm` {API change].++ * Export module Text.Pandoc.Class.IO [API change].+ The module is useful when defining instances of class PandocMonad for+ types that are also instances of MonadIO.++ * Remove modules Text.Pandoc.Writers.Custom and Text.Pandoc.Readers.Custom+ [API Change] (Albert Krewinkel). The functions `writeCustom` and+ `readCustom` are available from module Text.Pandoc.Lua.++ * Text.Pandoc.Server:++ + Split this module into a separate package, `pandoc-server`,+ allowing the `pandoc` library to be compiled without server support.+ + Return object if JSON is accepted. Previously we just returned+ a JSON-encoded string. Now we return something like:+ ```+ {+ "output": "<p>hello</p>"+ "base64": false,+ "messages": [+ {+ "message": "Not rendering RawInline (Format \"tex\") \"\\\\noe\"",+ "verbosity": "INFO"+ }+ ],+ }+ ```+ This is a change in the pandoc-server JSON API.+ + Set translations in the writer based on `lang` metadata.+ + Return error in JSON object if response is JSON.+ + Remove `parseServerOpts`. [API change]++ * Text.Pandoc.Lua:++ + This module has been moved to a separate package,+ `pandoc-lua-engine`.+ + Export `applyFilter`, `readCustom`, and `writeCustom`.+ No longer export the lower-level function `runFilterFile` [API+ change].+ + Change type of `applyFilter` [API Change] (Albert Krewinkel).+ The module Text.Pandoc.Filter.Lua has been merged into+ Text.Pandoc.Lua. The function `applyFilter` now has type+ ``` haskell+ applyFilter :: (PandocMonad m, MonadIO m)+ => Environment-> [String]-> FilePath-> Pandoc-> m Pandoc+ ```+ where `Environment` is defined in Text.Pandoc.Filter.Environment.+ + Export new function `getEngine` [API Change].+ The function returns the Lua scripting engine.+ + Add unexported modules T.P.Lua.Reader, T.P.Lua.Writer.+ These contain the definitions of `readCustom` and `writeCustom`+ that were previously in T.P.Readers.Custom and T.P.Writers.Custom.+ + Cleanup module dependencies, for a cleaner module dependency graph.+ + The `writeCustom` function has changed to return a Writer and+ an ExtensionsConfig [API change]. This allows ByteString writers+ to be defined.+ + The `readCustom` function has changed to return a Reader and an+ ExtensionsConfig [API change].++ * Lua subsystem (Albert Krewinkel):++ + The whole Lua subsystem has been moved to a separate package,+ `pandoc-lua-engine`. `pandoc` does not depend on it.+ `convertWithOpts` has a new parameter that can be used to+ pass in the scripting engine defined in `pandoc-lua-engine`+ (or a different one, in theory).+ + Fix the behavior of Lua "Version" objects under equality+ comparisons (#8267).+ + Support running Lua with a GC-collected Lua state.+ + Ensure that extensions marshaling is consistent.+ + Produce more informative error messages for pandoc errors.+ Errors are reported in Lua in the same words in which they would be+ reported in the terminal.+ + Add new module `pandoc.format`. The module provides functions to+ query the set of extensions supported by formats and the set+ of extension enabled per default.+ + Add function `pandoc.template.apply`.+ + Add function `pandoc.template.meta_to_context`.+ The functions converts Meta values to template contexts; the intended+ use is in combination with `pandoc.template.apply`.+ + Allow Doc values in `WriterOptions.variables`.+ The specialized peeker and pusher function for `Context Text` values+ does not go via JSON, and thus keeps Doc values unchanged during+ round-tripping.+ + Fix rendering of Lua errors in Lua, so that the+ `Error running Lua` message is not prepended multiple times.+ + Add new module `pandoc.zip`.+ + Allow strings in place of compiled templates (#8321).+ This allows to use a string as parameter to `pandoc.template.apply`+ and in the WriterOptions `template` field.+ + Rename `reader_extensions`/`writer_extensions` globals as `Extensions`+ (#8390).+ + Add `pandoc.scaffolding.Writer` (#8377). This can be used to reduce+ boilerplate in custom writers.+ + Fix peeker for PandocError (Albert Krewinkel). String error messages+ were incorrectly popped of the stack when retrieving a PandocError.+ + Add functions `pandoc.text.toencoding`, `pandoc.text.fromencoding`+ (#8512, Albert Krewinkel).+ + Add `pandoc.cli` module. Allow processing of CLI options in Lua.+ + Support `-D` CLI option for custom writers.+ A new error `PandocNoTemplateError` (code 87) is thrown if a template+ is required but cannot be found.+ + Allow table structure as format spec. This allows to pass structured+ values as format specifiers to `pandoc.write` and `pandoc.read`.+ + Add function `pandoc.mediabag.write` (Albert Krewinkel).+ + Add module `pandoc.structure` (Albert Krewinkel). The function+ `make_sections` has been given a friendlier interface and moved to the+ new module; the old `pandoc.utils.make_sections` has been deprecated.++ * Custom writers:++ + The global variables `PANDOC_DOCUMENT` and `PANDOC_WRITER_OPTIONS`+ are no longer set when the writer script is loaded. Both variables+ are still set in classic writers before the conversion is started,+ so they can be used when they are wrapped in functions.+ + Deprecate classic custom writers.+ + Add function `pandoc.write_classic`. The function can be used to+ convert a classic writer into a new-style writer by setting it as+ the value of `Writer`:+ ``` lua+ Writer = pandoc.write_classic+ ```+ or to fully restore the old behavior:+ ``` lua+ function Writer (doc, opts)+ PANDOC_DOCUMENT = doc+ PANDOC_WRITER_OPTIONS = opts+ load(PANDOC_SCRIPT_FILE)()+ return pandoc.write_classic(doc, opts)+ end+ ```+ + Support extensions in custom writers. Custom writers can define the+ extensions that they support via the global `writer_extensions`.+ The variable's value must be a table with all supported extensions+ as keys, and their default status as values. For example,+ the below specifies that the writer supports the extensions `smart`+ and `sourcepos`, but only the `smart` extension is enabled by default:+ ``` lua+ writer_extensions = {+ smart = true,+ sourcepos = false,+ }+ ```+ + Custom writers can define a default template via a global `Template`+ function; the data directory is no longer searched for a default+ template. Writer authors can restore the old lookup behavior with+ ``` lua+ Template = function ()+ local template+ return template.compile(template.default(PANDOC_SCRIPT_FILE))+ end+ ```++ * Custom readers:++ + Support extensions in custom readers.+ Custom readers, like writers, can define the set of supported+ extensions by setting a global. E.g.:+ ``` lua+ reader_extensions = {+ smart = true,+ citations = false,+ }+ ```++ * Use latest versions of `commonmark-extensions`, `texmath`,+ `citeproc`, `gridtables`, and `skylighting`.++ * Use pandoc-types 1.23. This adds the `Figure` Block+ constructor and removes the `Null` Block constructor.++ * Require aeson >= 2.0.++ * Use jira-wiki-markup 1.5.0 (#8511, Albert Krewinkel). Fixes issues with+ icon-like sequences at the beginning of words.++ * Use doctemplates 0.11, avoiding a transitive dependency on HsYAML.++ * Use skylighting 0.13.1.2.++ * Allow mtl 2.3.1 (Alexander Batischev).++ * Use latest skylighting-format-context.++ * Allow building with mtl 2.3.++ * Remove `lua53` flag. We now only support Lua 5.4.++ * Add hie.yaml for haskell language server.++ * Add tools/latex-package-dependencies.lua.++ * Update default CSL with latest `chicago-author-date.csl`.++ * make_artifacts.sh: various small improvements.++ * Remove sample.lua from data files (#8356).++ * Documentation:++ + Deprecate `PANDOC_WRITER_OPTIONS` in custom writers (Albert Krewinkel).+ + Document `pandoc.write_classic` (Albert Krewinkel).+ + Document new table features (Albert Krewinkel).+ + Clarify what background-image does in reveal.js (#6450).+ + Documentation improvements for `blank_before_blockquote`+ (#8324, Pranesh Prakash).+ + Update grid table documentation (#8346).+ + Add note about MathJax fonts to `--embed-resources`.+ + Use cabal's --package-env more (#8317, Artem Pelenitsyn).+ + Modify Zerobrane instructions to use Lua 5.4 (#8353, Ian Max Andolina).+ + Fix documentation for highlight-style in `pandoc-server.md`.+ + Fix link to fedora package site (#8246, Akos Marton).+ + Rephrase paragraph on format extensions (#8375, Ilona Silverwood).+ + Update README.template (#8496, Sven Wick).+ + Fix a tiny typo in lua-filters.md (TomBen).+ + Clarify that `--css` should be used with `-s`.+ + Clarify font selection for pdf -t ms (#8421, nbehrnd).+ + Clarify docs for `--metadata-file` (#8459).+ + Fix typo in epub.md (Vladimir Alexiev).+ + Add missing backtick in filters.md (R. N. West).+ + `doc/lua-filters.md`: add documentation for `pandoc.format`+ (Albert Krewinkel).+ + Fix epub-embed-font documentation (#8455, Terence Eden).+ + Removed obsolete Templates section in CONTRIBUTING.md.+ + Add manual section on accessible PDFs, archiving standards (#8312,+ Albert Krewinkel).++ * Tests.Command: remove unused `runTest`.++ * Add pandoc-lua.1 man page.++ * Improve `shell.nix`.++ * Add `tools/moduledeps.lua` for inspecting the internal module+ dependency tree.++ * Fix macOS zip so pandoc-server is a symlink. This cuts its size by 2x.++ * CI: Improve CI speed by caching more, eliminating macos builds,+ and splitting benchmarks into a separate action, run by+ manual dispatch. (We still test that benchmarks build in+ the regular CI.) The cache can be expired manually by+ modifying the secret `CACHE_VERSION`.++ * Remove the unnecessary Setup.hs from pandoc.+ Cabal does not need this with build-type 'simple'.++ * Add pandoc-lua and pandoc-server (symlinks) and their man pages+ to releases.++ * Use hslua-cli package for pandoc-lua interface (Albert Krewinkel).++ * Add `server` flag to pandoc-cli, allowing it to be compiled without+ server support.++ * pandoc-cli: Allow building a binary without Lua support (Albert+ Krewinkel). Disabling the `lua` cabal flag will result in a+ binary without Lua.++ * Move `--version` handling to pandoc-cli. We need it here in order+ to print information about whether server and Lua support have been+ compiled in.++ * Move `nightly` flag from pandoc to pandoc-cli (#8339).++ * Makefile changes:++ - `make help` will now print all the targets and what they do.+ - Add targets: `coverage`, `weeder`, `moduledeps`, `prerelease`,+ `ghcid`, `repl`, `linecounts`, `hie.yaml`, `binpath`.+ - Note that you can `` alias pandoc=`make binpath` `` for+ convenient local testing of a build.+ - Rename `quick-cabal` -> `build`, `quick-test` -> `test`.+ - Exclude tests from `SOURCEFILES`.++ * Factor out xml-light into an internal library.++ * Add CITATION.cff (#8434).++ * Move trypandoc to a separate repository, jgm/trypandoc.++## pandoc 2.19.2 (2022-08-22)++ * Fix regression with data uris in 2.19.1 (#8239).+ In 2.19.1 we used the base64URL encoding rather than base64.++ * pandoc-server: handle `citeproc` parameter as documented (#8235).++ * Org reader: treat *emacs-jupyter* src blocks as code cells (#8236,+ Albert Krewinkel). This improves support for notebook-like org files+ that are intended to be used with emacs-jupyter package.++ * HTML writer and templates: revert to using `width` property for column+ widths (Albert Krewinkel). The default `flex` and `overflow-x` properties+ of a column are set to `auto`. In combination, these changes allow to+ get good results when using columns with or without explicit widths.++ * Org writer (Albert Krewinkel):++ + Add support for jupyter nodebook cells (#6367).+ + Prefix code language of ipynb code blocks with `jupyter-`.+ This is the convention used by the *emacs-jupyter* package.+ + Keep code block attributes as header args. This allows to keep more+ information in the resulting `src` blocks, making it easier to+ roundtrip from or through Org. Org babel ignores unknown header+ arguments.+ + Add code block identifier as `#+name` to src blocks.++ * Fix some typos in the codebase (luz paz).++ * Require hslua-module-path 1.0.3 (#8228, Albert Krewinkel).++## pandoc 2.19.1 (2022-08-18)++ * Add server capabilities.++ + New exported module Text.Pandoc.Server [API change].+ + The pandoc executable now starts up a web server when renamed or+ symlinked as `pandoc-server`, and functions as a CGI program when+ renamed or symlinked as `pandoc-server.cgi`. See the man page for+ `pandoc-server` for full documentation.++ * Text.Pandoc.App.Opts: Redo `FromJSON` for `Opt` so that optional+ values can be omitted (in which case the values from+ `defaultOptions` are used).++ * Org reader: treat "abstract" block as metadata (Albert Krewinkel, #8204).+ A block of type "abstract" is assumed to define the document's abstract.+ It is transferred from the main text to the metadata.++ * Org template: add abstract from metadata as block of type "abstract"+ (#8204).++ * HTML writer: use `flex` property for column widths+ (Albert Krewinkel, #8232).++ * LaTeX writer:++ + Add label to tables that have an identifier (Albert Krewinkel, #8219).+ Tables with an identifier are marked with a `\label`. A caption is+ always included in this case, even if the caption is empty.+ + Use `\textquotesingle` for straight quotes in text.+ + Fix widths of multicolumn cells (#8218).++ * LaTeX template: fix behavior of `colorlinks` variable (Albert+ Krewinkel, #8226). Fixes a regression in 2.19 that required the+ `boxlinks` variable to be set in addition to the usual link coloring+ variables. Otherwise links were never colored in LaTeX PDF output.++ * Text.Pandoc.Highlighting: Export `lookupHighlightingStyle`+ [API change]. Previously this lived in an unexported module+ Text.Pandoc.App.CommandLineOptions, under the name+ `lookupHighlightStyle`.++ * Text.Pandoc.App:++ + Remove unneeded MonadIO constraints in readSources.+ + Factor out `convertWithOpts'` from `convertWithOpts`.+ This runs in any PandocMonad, MonadIO, MonadMask instance.+ So far it is not exported, but it might find a use later.++ * Support `--strip-comments` in commonmark/gfm (#8222).+ This change makes the commonmark reader sensitive to+ `readerStripComments`.++ * Lua: add function `pandoc.utils.citeproc` (Albert Krewinkel).+ The function runs the *citeproc* processor on a Pandoc document.+ Exposing this functionality to Lua allows to make citation processing+ part of a filter or writer, simplifies the creation of multiple+ bibliographies, and enables the use of varying citation styles in+ different parts of a document.++ * Refactor `linux/make_artifacts.sh`.++ * Update INSTALL.md installation from source instructions.++ * Use base64 package instead of base64-bytestring. It is supposed to be+ faster and more standards-compliant.++ * trypandoc improvements:++ + Add dropdown with canned examples.+ + Add citeproc support.+ + Support csv, bibliographic and binary formats.+ + Add load from file.+ + Add permalink. Don't always reload page.+ + Use vanilla JS and CSS + the new `pandoc-server.cgi`.++ * Allow haddock-library-1.11.0.++ * Convert `tool/extract-changes.hs` to a Lua filter.+++## pandoc 2.19 (2022-08-03)++ * Add `--embed-resources` flag (Elliot Bobrow, #7331). This can be+ used to embed resources without implying `--standalone`.+ Deprecate `--self-contained` in favor of `--embed-resources --standalone`.++ * Allow environment variable interpolation in `highlight-style`+ and `pdf-engine` fields in defaults files+ (#8061; Jaehwang Jung, #8073).++ * Allow placing custom readers and writers in user data directory+ (Albert Krewinkel, #8112) (`readers` and `writers` subdirectories).++ * Add `tsv` (tab separated values) as an input format (#7974).+ [API change]: Text.Pandoc.Readers.CSV now exports `readTSV`.+ Internal change: In Text.Pandoc.CSV, `CSVOptions` has changed+ so that `csvQuote` takes a Maybe value.++ * Add `tex_math_dollars` to `gfm` default extensions (reflecting+ gfm's new support for math).++ * RST, Org, Markdown readers: support rowspans and colspans in grid tables+ (#8202, Albert Krewinkel). Note: the writers does not yet support these+ more complex grid table features, so these complex grid tables will+ not round-trip.++ * HTML, LaTeX, and MediaWiki readers: use `formatCode`+ (#8162, #8129, Elliot Bobrow). This moves formatting from inside inline+ code elements to the outside, since pandoc's Code element only takes string+ content.++ * Markdown reader:++ + Don't parse inline notes with blank lines inside (#8028).+ + Allow attributes in special spans (e.g. `smallcaps`, `underline`)+ (Albert krewinkel, #4102). These spans are parsed as+ SmallCaps or Underline elements, but any attributes are included+ in a wrapping Span.++ * HTML reader:++ + Allow sublists that are not marked as items (Albert+ Krewinkel, #8150). This is technically invalid HTML, but it can+ be found in the wild and browsers handle it.++ * Org reader (Albert Krewinkel):++ + Recognize absolute paths on Windows (Albert Krewinkel, #8201).+ + Recognize {webp,jxl} files as images (YI).+ + Allow attrs for Org tables (Albert Krewinkel, #8049). Tables with+ attributes are no longer wrapped in Div elements; attributes are added+ directly to the table element.+ + Support line selection in INCLUDE directives (Brian Leung, #8060).+ + Fix Post / Pre mixup when setting emphasis chars (Amir Dekel, #8134).++ * LaTeX reader:++ + Support `\includesvg` (#8027).+ + Unescape characters in `\lstinline` inside `\passthrough` (#8179).+ + Improve `mathEnvWith` (#8122). When converting e.g. an align+ environment to an aligned environment inside a Math element, we need+ to include a newline before the `\end{aligned}`, since the previous+ line might end in a comment.+ + Fix treatment of extensions for `\input` in LaTeX reader (#8092).+ Previously we required a `.tex` extension, but TeX+ allows any extension for `\input` (as opposed to `\include`).++ * RTF reader:++ + support `\nosupersub` (#8170).++ * TikiWiki reader:++ + Support underlined text++ * DocBook reader:++ + Improved reading `<xref>` elements (Frerich Raabe, #8065).++ * JATS reader:++ + Strip `ref-` prefix from ref id in xref (#8007).+ + Support edition in references (#8087).++ * RIS reader:++ + Make parser more forgiving (#8034). Allow blank lines after entries.+ Allow entries with no space after the `-`, provided they+ just have a newline, e.g. `DB -\n`.+ + Get right order of names (#8055).++ * MediaWiki reader:++ + Allow HTML comment after row start (#8110).++ * DokuWiki reader:++ + The `tex_math_dollars` extension is now supported for `dokuwiki`+ (but off by default) (#8178).+ + Content inside `<latex>...</latex>` is parsed as raw LaTeX inline,+ and inside `<LATEX>..</LATEX>` as raw LaTeX block (#8178).+ + The behavior of `<php>...</php>` is changed, so that instead of+ producing a code block, it produces raw HTML with `<?php ... ?>`.++ * LaTeX writer:++ + Improve grouping with autocites (#8088).+ + Extend list of book documentclasses (Wentau Han, #8053).+ + Fix width of multicolumn cells (Albert Krewinkel, #8090).+ Cells spanning multiple columns must be given an explicit width,+ calculated from the table properties.+ + Beamer: allow containsverbatim as alternative to fragile (#8080).++ * HTML writer:++ + Add 'footnotes' identifier to footnotes section (#8043).+ + Fix bug with `--number-offset`. This formerly caused section divs+ to be produced, even when `--section-divs` was not specified (#8097).+ + Use CSS flexboxes for columns (Albert Krewinkel). This allows+ an arbitrary number of columns, while the previous approach assumed+ exactly two columns.+ + Allow "spanlike" classes to be combined (see #8194). Previously+ classes like "underline" and "marked" had to be the first class+ in a span in order for the span to be interpreted as a "ul" or+ "mark" element. This commit allows these special classes to be+ "stacked," e.g. `[test]{.mark .underline}`; in addition, the+ special classes are no longer required to come first in the list+ of classes.+ + Avoid doubled style attribute when height and width are added to+ style because of an image, but the image already has a style attribute+ (#8047).+ + Do not include the deprecated doc-endnote role (#8030).+ doc-endnote was deprecated in DPUB-ARIA 1.1.+ + Remove extra soft break for tasklist (black-desk, #8142).+ Browser will display the extra newline character between checkbox and+ text as a space, which make tasklist items cannot be aligned.++ * EPUB writer:++ + Allow choice of math method for v3 (#8164). Previously we always+ used MathML for math in EPUB3, because the spec includes MathML.+ But this is not widely supported by readers, so it seems better+ to allow users to choose their math method as they can with+ EPUB2 or HTML. **NOTE:** Existing workflows that produce EPUBv3+ documents including math will be affected by this change. You+ must add `--mathml` to your command line if you want to continue+ producing MathML.++ * RST writer:++ + Fix missing spaces with nested inlines (#8182).+ + Always escape literal backslash (#8178).++ * Ms writer:++ + Add comment in preamble stating generator.+ + Fix roff ms syntax highlighting definitions (#8175, thanks to+ Branden Robinson).++ * ConTeXt writer:++ + Support complex table structures (Albert Krewinkel, #8116).+ The following table feature are now supported in ConTeXt:++ - colspans,+ - rowspans,+ - multiple bodies,+ - row headers, and+ - multi-row table head and foot.++ The wrapping `placetable` environment is also given a `reference` option+ with the table identifier, enabling referencing of the table from within+ the document.+ + Unify link handling (Albert Krewinkel, #8096).+ Autolinks, i.e. links with content that's the same as the linked URL,+ are now marked with the `\url` command. All other links, both internal+ and external, are created with the `\goto` command, leading to shorter,+ slightly more idiomatic code. As before, autolinks can still be styled+ via `\setupurl`, other links via `\setupinteraction`.+ + Use "sectionlevel" environment for headings (Albert Krewinkel, #5539).+ The document hierarchy is now conveyed using the+ `\startsectionlevel`/`\stopsectionlevel` by default. This makes it easy+ to include pandoc-generated snippets in documents at arbitrary levels.+ The more semantic environments "chapter", "section", "subsection", etc.+ are used if the `--top-level-division` command line parameter is set to+ a non-default value.++ * Docx writer:++ + Add `w:lang` to `rPr` for Span and Div with lang attribute, so+ that Word can know that "Apfel" is not a spelling error (#8026).+ + Prevent crashing when handling invalid tables (Albert Krewinkel, #8102).+ Tables with different numbers of cells per row would sometimes crash+ pandoc. This fix prevents this by cutting off overlong rows.++ * ICML writer:++ + Support custom-style attribute on Table (#8079).++ * AsciiDoc writer:++ + Fix commas in link text (#8070). Commas in link text trigger+ interpretation of attributes. To block this, we replace them with+ numeric entities.+ + Fix underline. We were rendering it as `+++text+++`; this is now+ changed to `[.underline]#text#`. See comment at+ <https://github.com/jgm/pandoc/issues/8070#issuecomment-1126883824>.++ * FB2 writer:++ + Fix handling of non-section Divs (#8123).++ * Markdown writer:++ + Disable soft wrapping when `hard_line_breaks` enabled (#8035).+ We were already doing this for `markdown`; this commit does+ the same thing for `markua` and `commonmark` and `gfm`.+ + Avoid excessive indentation on bullet lists for `commonmark`,+ `markua`, `gfm`. They are now nested by 2 spaces instead of 4 (#8011).++ * Text.Pandoc.Class:++ + Add new function `findFileWithDataFallback` [API Change]+ (Albert Krewinkel).+ + `fillMediaBag`: Keep attributes of original image on Span (Albert+ Krewinkel, #8099). Images that cannot be fetched are replaced with a+ Span that contains the image's description. The span now also retains+ all original image attributes and inherits all attributes of the image.+ Furthermore, the classes `image` and `placeholder` are added, and path+ and title are store in attributes `original-image-src` and+ `original-image-title`, respectively.++ * Text.Pandoc.Shared:++ + `makeSections`: don't make a section for a div with class "fragments"+ (#8098).+ + Ensure that Nulls are ignored by `makeSection` and in segmenting+ slides (#8155).+ + Add `formatCode` function to Text.Pandoc.Shared [API change]+ (Elliot Bobrow, #8129).+ + `taskListItemToAscii`: handle asciidoctor's characters (#8011).+ Asciidoctor uses different unicode characters for task+ lists; we should recognize them too and be able to convert+ them to ascii task lists in formats like gfm.+ + Deprecate `deLink` and mark for later removal.++ * Text.Pandoc.Writers.Shared:++ + `toTableOfContents`: Don't replace links with empty spans in TOC (#8020).++ * Text.Pandoc.Readers.Metadata:++ + Ensure that metadata values w/o trailing newlines are+ parsed as inlines, as the manual states.+ Previously, they were parsed as inlines if they would+ otherwise have been a single Plain or Para, but otherwise+ left unchanged. This led to some quirky results (e.g. #8143).+ We now use the general function `blocksToInlines` from T.P.Shared.++ * Text.Pandoc.Parsing:++ + Simplify `gridTableWith'`, `gridTableWith` [API Change] (Albert+ Krewinkel). The functions `gridTableWith` and `gridTableWith'` no+ longer takes a boolean argument that toggles whether a table head+ should be parsed: both, tables with heads and without heads, are+ always accepted now.++ * Lua subsystem (Albert Krewinkel):++ + Extend `pandoc.system` module (Albert Krewinkel, #8184).+ The module now has the additional functions `list_directory`,+ `make_directory`, and `remove_directory`. This makes it easier to write+ cross-platform scripts that need to inspect or modify the file system.+ + Require pandoc-lua-marshal 0.1.7. Adds a `clone` methods to+ Pandoc objects and allows to pass Blocks in instead of full+ Caption elements.+ + Add fields `pandoc.readers` and `pandoc.writers` (#8177).+ The set of supported input and output formats is made available to Lua+ users.+ + Ensure that tables marshaled via JSON arrays behave like Lists.+ This allows to invoke methods like `map` and `includes` on lists like+ `PANDOC_WRITER_OPTIONS.extensions`.+ + Require hslua-2.2.1, unless lua53 flag is set, and do not reset+ foreign encoding before running Lua. This fixes a problem where+ the encoding used for Lua filenames would sometimes mismatch the+ encoding used by the OS.+ + Simplify module loading code. Modules are now loaded directly;+ the special pandoc Lua package searcher is no longer necessary and+ has been removed.+ + Add function pandoc.mediabag.fill (#8104). The function allows to+ fill the mediabag with all images in a given document. Images that+ cannot be fetched are replaced with a Span containing the+ image description.++ * Populate mediabag after filters have run (Albert Krewinkel, #8099).+ The mediabag is filled with document resources after the filters have+ run. This allows, for example, filter authors to modify image paths+ before pandoc tries to fetch the images.+ Lua filters that rely on a filled mediabag can use the new+ `pandoc.mediabag.fill` function to perform that action in the filter.++ * Ms template: redefine rather than removing .CH macro (#8175).++ * JATS template (Albert Krewinkel, except as noted):++ + Include particles, prefix, suffix in names.+ + Mark authors with cor-id as corresponding authors.+ Corresponding authors are marked by setting the attribute+ `corresp="yes"` in their respective `<contrib>` element.+ + Unconditionally include permissions element (#8040).+ Fixes a bug that caused license information to be omitted when no+ copyright information was provided.+ + Follow JATS4R recommendation and PudMed Central for license URI+ (Castedo Ellerman, #8041).++ * LaTeX template:++ + Rename `\textormath` to `\TextOrMath` (Hos Es, #8036).+ + Fix links-as-notes (Albert Krewinkel, #8077).++ * HTML template styles:++ + Remove `span.underline` rule. This is superfluous now that we+ render Underline as `<u>`.+ + Improve CSS for task lists (#8151).++ * LaTeX template: Add `boxlinks` variable for LaTeX/PDF output (#8198).+ If `boxlinks` is set but `colorlinks` is not, then boxes will+ be printed around links (`hidelinks` will not be set in `hypersetup`).++ * `--self-contained`: Handle `url()` in `<style>` elements (#8193).++ * Text.Pandoc.PDF: use SHA1 hash of filename when converting SVG.+ The previous code threw away the directory component of+ the filename in constructing a new one. This led to+ surprising results if you had e.g. `foo/pic.svg` and `bar/pic.svg`;+ in the final PDF they'd be the same image, because the latter+ would overwrite the former in the temp directory.++ * Remove Muse reader round-trip tests. These are nondeterministic and have+ repeatedly failed on strange edge cases.++ * Update fonts MIME following IANA recommendation (Gabriel Lewertowski,+ #8127).++ * Future compat change for `liftA2` export from Prelude (Georgi Lyubenov,+ #8132).++ * Update `default.csl` from the latest chicago-author-date.csl.++ * Update manfilter.hs for greater portability (#8045).+ The tables in our man pages were not rendering correctly+ with mandoc, now used by default with macOS. mandoc doesn't+ allow man formatting inside table cells. For maximum portability,+ we now render the tables in plain format and include them as code+ blocks in the man page.++ * CI: update macos container version (#8197, Sukka).++ * Add `nightly` flag. This causes a `-nightly-COMPILEDATE`+ suffix to be added the the output of `--version` (#8016).+ This is used in the nightly CI builds.++ * Update dependencies (aeson, skylighting, pandoc-lua-marshall,+ citeproc, texmath).++ * Documentation improvements (thanks to Jiří Wolker,+ Castedo Ellerman, Albert Krewinkel, Bastien Dumont, Cezar Drożak, Benjamin+ Wuethrich, Ivan Panchenko, Sukil Etxenike, Masataka Ogawa).++## pandoc 2.18 (2022-04-04)++ * New input formats: `endnotexml` (EndNote XML bibliography),+ `ris` (RIS bibliography).++ * A RIS bibliography file may now be used with `--citeproc`.++ * Citeproc: Allow a formatted bibliography to be placed in metadata fields+ via a Div with class `refs` (#7969, #526). Thus, one can include a+ metadata field, say `refs`, whose content is an+ empty div with id `refs`, and the formatted bibliography will be put into+ this metadata field. It may then be interpolated into a template using the+ variable `refs`.++ * Ensure that you don't get PDF output to terminal. `-t pdf` now behaves+ like `-t docx` and gives an error unless the output is redirected.++ * `--version` now prints hslua version (#7929) and+ Lua version (#7997, Albert Krewinkel).++ * Change `--metadata-file` parsing so that, when the input format is not+ markdown or a markdown variant, pandoc's markdown is used (#6832, #7926).+ When the input format is a markdown variant, the same format is used.+ Reason for the change: it doesn't make sense to run the markdown parser+ with a set of extensions designed for a non-markdown format, and+ this dramatically limits what people can do in metadata files.++ * Trim whitespace from math in `--webtex` (#7892).+ This fixes problems with --webtex and markdown output,+ when display math starts or ends with a newline.++ * `--self-contained`: issue warning rather than failing with an error+ if a resource can't be found (#7904).++ * New exported module Text.Pandoc.Readers.EndNote, exporting+ `readEndNoteXML` and `readEndNoteXMLCitation` [API change].++ * New exported module, Text.Pandoc.Readers.RIS, exporting `readRIS` (#7894)+ [API change].++ * LaTeX reader:++ + Handle subequations as inline math environment (#7883).+ + Rudimentary support for `vbox` (#7939).+ + Support `\today` (#7905).+ + Handle `\label` and `\ref` for footnotes (#7930).+ + Allow inline groups starting with `\bgroup` (#7953).+ + Use custom TokStream that keeps track of whether macros are expanded.+ This allows us to improve performance a bit by avoiding unnecessary+ runs of the macro expansion code (e.g. from 24 ms to 20 ms on+ our standard benchmark).+ + Further optimizations for inline parsing.+ + Better handling of `\usepackage`. If the package is local but+ causes parse errors, parse everything up to the error and skip the+ rest. Issue a `CouldNotParseIncludeFile` warning indicating that+ parsing failed at that point.+ + Text.Pandoc.Readers.LaTeX.Parsing: Monoid and Semigroup instances for+ TokStream.++ * HTML reader:++ + Give warnings and emit empty note when parsing+ `<a epub:type="noteref">` and the identifier+ doesn't correspond to anything in the note table (#7884).+ Previously we just silently skipped these cases.+ + Fix parsing of epub footnotes (#7884).++ * DocBook reader:++ + Handle complete set of entities as specified at+ <https://www.w3.org/2003/entities/2007doc/byalpha.html> (#7938).+ + Handle abstract in info section (#7747).+ + Improve info parsing.+ + Simplify metadata parsing code (#7747).+ Handle abstract as block-level content.+ Report skipped info elements with `--verbose`.+ + Handle address and coyright in metadata (#7747).++ * DokuWiki reader:++ + Add DokuWiki table alignment (#5202, damon-sava-stanley).++ * RST reader:++ + Fix treatment of headerless simple tables (#7902).+ + Wrap math in Span to preserve attributes (#7998, Albert Krewinkel).+ Math elements with a name, classes, or other fields are wrapped in a+ `Span` with these attributes.++ * JATS reader:++ + Improve handling of fn-group elements (#6348, Albert Krewinkel).+ Footnotes in `<fn-group>` elements are collected and re-inserted into+ the document as proper footnotes in the place where they are referenced.+ + Handle `pub-date` (#8000).+ + Support PMID, DOI, issue in citations (#7995).+ + Improve refs parsing. Handle `issn` and `isbn`; use simpler form+ for issued date.+ + Strip 'ref-' from ref id in constructing CSL id. This allows better+ round-tripping, because the JATS writer adds the `ref-` prefix to+ the citation id to get the ref element's id.++ * Org reader:++ + Allow ":" in property drawer keys (Lucas V. R).+ Any non-space character is allowed as property drawer key, including ":"+ itself (so it is not really a delimiter). The real delimiter is a space+ character, so in a drawer like+ ```+ :PROPERTIES:+ ::k:ey:: value+ :END:+ ```+ ":k:ey:" is a key with value "value".++ + Allow comments above property drawer.+ + More flexible LaTeX environments (Lucas V. R).+ + Handle `#+bibliography:` as metadata so that it can work with+ `--citeproc`.+ + Parse `#+print_bibliography:` as Div with id `refs`.+ + Allow multiple `#+bibliography:`.++ * Markdown reader:++ + Allow one-column pipe tables with pipe on right (#7919).+ + Remove restriction on identifiers, so they no longer need to+ begin with a letter (#7920).++ * Docx reader:++ + Enable `citations` extension for docx reader (#7840).+ When enabled, Zotero, Mendeley, and EndNote citations embedded in+ a docx are parsed as native pandoc citations.+ (When disabled, the generated citation+ text and bibliography are passed through as regular text.)+ The bibliography generated by the plugin is suppressed.+ Instead, bibliographic data embedded in citation items is added+ to the `references` metadata field so that it can be used+ with `--citeproc`.++ * Docbook writer:++ + Interpret links without contents as cross-references (#7360, Jan Tojnar).+ Links without text contents are converted to `<xref>` elements. DocBook+ processors will generate appropriate cross-reference text when presented+ with an xref element.++ * Docx writer:++ + Single numbering ID for examples (#7895, mjfs).+ This change ensures that example list items all belong to a single+ number sequence, so that if items are added or deleted in a word+ processor, the other items will renumber automatically.+ + Add bookmark with table id to table (#7989, Nikolai+ Korobeinikov, #7285). This allows tables with ids to be linked to.++ * Ipynb writer:++ + Handle metadata better (#7928). Previously we used the markdown+ writer to render metadata. This had some undesirable consequences+ (e.g. en dash expanded to `--` when `smart` enabled), so now we use+ the plain writer.++ * LaTeX writer:++ + Avoid extra space before `\CSLRightInline` (#7932).+ + Add `scrreport` to `chaptersClasses` (#6168, ivardb).+ + Support `page`,`trim`,`clip` attributes on images (#7181).+ + Add `()` after booktabs rules (#8001). These commands take optional+ arguments with () and [], which can lead to problems if the content+ of the table cell begins with these characters.++ * RST writer:++ + Support all standard metadata ("bibliographic") fields.++ * HTML writer: performance improvements.++ * Org writer:++ + Stop indenting property drawers, quote blocks+ (#3245, Albert Krewinkel). This follows the current default org-mode+ behavior.++ * Markdown writer:++ + Move table-related code into submodule (Albert Krewinkel).+ + Don't produce redundant header identifier when the+ `gfm_auto_identifiers` extension is set (#7941).+ + Update escaping rules for `\`. We now escape `\` only if `raw_tex`+ is enabled or it is followed by a non-alphanumeric.++ * JATS writer:++ + Encode author "others" as `<etal/>` (Albert Krewinkel).+ Citeproc adopted the BibTeX convention to use the author name "others"+ when there are additional authors that are not named. JATS uses the+ `<etal>` element for this.+ + Avoid doubled ref-list element (#7990). Previously when generating JATS+ with the `element_citations` extension enabled, the references were+ put in a doubly-nested ref-list element (`<ref-list><ref-list>...`).+ + Keep edition info in element citations (#7993, Albert Krewinkel).+ + Fix handling of CSL variable 'page' (not 'pages' as we had before).+ It should go to 'lpage' and 'rpage', not 'page-range'.++ * EPUB writer: refactor for clarity (#7991, Jonathan Dönszelmann,+ Ola Wolska, Ivar de Bruin, Jaap de Jong).++ * Custom writer (Albert Krewinkel):++ + Support new-style Writer function (Albert Krewinkel).+ See the documentation for custom writers for details.+ + Produce stacktrace if Writer function fails++ * Text.Pandoc.Logging: add `CouldNotParseIncludeFile` constructor+ for `LogMessage` [API change].++ * Text.Pandoc.Shared:++ + Put id attributes on TOC entries (#7907, damon-sava-stanley).+ Naming scheme of id is "toc-" + id of linked to header/section.+ Effects HTML, Markdown, Powerpoint, and RTF.+ + Define `ordNub` as alias for `nubOrd` from containers package (#7963,+ Albert Krewinkel).+ + Export `ensureValidXmlIdentifiers`. This function changes identifiers+ that don't start with letters, and internal links to these identifiers,+ making them compatible with XML standards. The change+ is simple: we add `id_` to the front. There is potential+ for duplication if there are already `id_...` identifiers+ defined, but this seems rare enough not to worry too much+ about.++ * Ensure that valid XML identifiers are used in Docbook, EPUB, FB2,+ HTML4, S5, Slidy, Slideous, ICML, ODT, TEI writers.+ Thus, if you convert `[anchor]{#1} and [link to](#1)`,+ `id_1` will be used instead of `1` for the identifier.++ * Lua (Albert Krewinkel).++ + Add module `pandoc.layout` to format and layout text.+ + Move custom writer code into Lua hierarchy.+ + Use pandoc-lua-marshal 0.1.5.+ + Allow any type of callable object as argument to List+ functions `filter`, `map`, and `find_if`. These previously+ required the argument to be of type `function`, which was too+ restrictive.+ + Inline: the type of Image captions is now `Inlines` instead of `List`.+ + Allow passing `Sources` to `pandoc.read` (#8002).++ * Text.Pandoc.PDF:++ + Restore `wkhtmltopdf` as default pdf engine for HTML (Albert Krewinkel).+ + Allow custom writer as format if engine is explicitly specified (#7898,+ Albert Krewinkel). Note that it may be necessary to explicitly+ specify a template on the command line.++ * Text.Pandoc.MediaBag: improve detection of absolute paths (#7881).++ * Text.Pandoc.Extensions:++ + Remove `raw_tex` extension from list of commonmark extensions, and+ from the `commonmark_x` defaults. commonmark doesn't parse raw TeX,+ and it doesn't make sense to write it if we don't parse it.+ + Remove `native_divs` from allowed gfm extensions (#7965). This allows+ `<div>` to be suppressed using `-raw_html`. Previously `native_divs`+ was enabled but could not be suppressed, because it was not in the+ list of available extensions for commonmark-based formats.++ * Text.Pandoc.Parsing:++ + Partition module into (internal) submodules (#7962, Albert Krewinkel).+ + Unify grid table parsing (#7971, Albert Krewinkel).+ Grid table parsing in Markdown and RST are updated use the same+ functions. Functions are generalized to meet requirements for both+ formats. This change also lays the ground for further generalizations+ in table parsers, including support for advanced table features.+ [API change] in Text.Pandoc.Parsing:++ - Parse results of functions `tableWith'` and `gridTableWith'` are now a+ `mf TableComponents` instead of a quadruple of alignments, column+ widths, header rows and body rows.+ - Additional exports from Text.Pandoc.Parsing:+ `tableWith'`, `TableComponents`, `TableNormalization`,+ `toTableComponents`, `toTableComponents'`.++ * Text.Pandoc.XML.Light: add versions of the parsers that allow+ specifying a custom entity map. Exports new functions:+ `parseXMLElementWithEntities`, `parseXMLContentsWithEntities` [API change].++ * Text.Pandoc.Writers.GridTable: improve module documentation (Albert+ Krewinkel).++ * Text.Pandoc.Parsing.GridTable: simplify column handling code (Albert+ Krewinkel).++ * Text.Pandoc.MIME: Add mime type for mkv extension (#7181).++ * Text.Pandoc.Asciify: Fix regression with `ascii_identifiers` and Turkish+ undotted i (#8003).++ * Relax upper bound for hslua, allow hslua-2.2. (#7929)+ Lua 5.4 is used by default after this is merged. Packagers may still+ include Lua 5.3 instead by building pandoc with `--constraint='hslua <2.2'`.+ Differences between 5.3 and 5.4 should not generally affect pandoc Lua+ filters. See list of incompatible changes here:+ <https://www.lua.org/manual/5.4/manual.html#8.1>++ * JATS template: allow multiple licenses (Albert Krewinkel).++ * LaTeX template:++ + Skip `\babelprovide` if `babel-lang` is empty (#7945) to avoid an error.+ + Move hyperref near end of preamble (#5811). It now comes after+ header-includes and right before title, author, date, abstract.+ Note: Users who presuppose hyperref in their header-includes+ will now have to add `\usepackage{hyperref}` to their header-includes+ to make it available there. (The redundant `\usepackage` will+ do no harm in this case.)+ + Remove special redefinition of `\sout`. This used to be necessary to+ avoid problems with hyperref, when headings contain strikeout text,+ but it does not seem to be necessary any more (tested).++ * Tests: improve location reporting of failing tests (Albert Krewinkel).++ * Add tests for idempotency of `makeSections` (#7950).++ * Add armhf support in linux build script (#7944, Tony).++ * Use latest pandoc-types, so that toJSONFilter will work with+ Meta and MetaValue.++ * Use latest doclayout, texmath, commonmark, citeproc.++ * INSTALL.md: add reference to install via winget (#7951, Guriy Samarin).++ * MANUAL.txt:++ - Document way to get list in block quote in slide shows (#7916).+ - Minor changes to security section.+ - Note that `smart` works for html input.+ - Fix typos (#7934, Dimitris Apostolou).+ - Fix documentation for citations and org mode.+ - Remove claim that `--self-contained` does not work with `--mathjax`+ (#682).++ * doc/org.md: remove obsolete citations section.+ This mostly described citation formats we no longer support.++ * doc/lua-filters.md: Fix typo (#7981, Mario Lang).++ * Makefile: Use cabal for default build++ * Add `lua53` cabal flag. It is false by default. If set to true, compile+ with hslua 2.1 and Lua 5.3, otherwise hslua 2.2 and Lua 5.4.+++## pandoc 2.17.1.1 (2022-01-31)++ * Fix regression in 2.17.1 which caused problems finding+ default files in the default user data directory. (Reverts+ the item "logic bug in `fullDefaultsPath`", which was+ misguided.)++ * Sample custom writer: use single quotes for strings (#7487,+ Albert Krewinkel).++## pandoc 2.17.1 (2022-01-30)++ * Support `pagedjs-cli` as pdf engine (#7838, Albert Krewinkel).+ PagedJS is a polyfill and supports the Paged Media standards by the W3C.+ <https://www.pagedjs.org/>++ * CommonMark reader: fix source position after YAML metadata (#7863).++ * LaTeX reader:++ + Remove retokenizing in `rawLaTeXParser`.+ + Ensure that `\raggedright` doesn't gobble an argument (#7757).+ + Improve `descItem`. For some reason we were skipping+ arbitrary blocks before `\item`. This is now changed to "skip+ whitespace and comments."+ + Improve handling of `\newif`. Adding a pair of braces around the+ second argument of `\def` prevents LaTeX from an emergency stop+ on input like the following (#6096).+ ```+ \newif\ifepub+ \epubtrue+ \ifepub+ hi+ \fi+ ```++ * Docx reader: Parse both Zotero citation and bibliography as+ `FieldInfo` (#7840).++ * LaTeX writer:++ + Allow arbitrary frameoptions to be passed to a beamer+ frame, using the frameoptions attribute (#7869).+ + Add s and squeeze to recognized beamer frameoptions (#7869).++ * Markdown writer: handle explicit column widths with pipe tables (#7847).+ If a table has explicit column width information *and* the content+ extends beyond the `--columns` width, we need to adjust the+ widths of the pipe separators to encode this width information.++ * Docx writer: Separate tables even with RawBlocks between (#7724,+ Michael Hoffmann). Adjacent docx tables need to be separated by an+ empty paragraph. If there's a RawBlock between tables which renders+ to nothing, be sure to still insert the empty paragraph so that+ they will not collapse together.++ * Man writer: use custom font V for inline code (#7506).+ The V font is defined conditionally, so that it renders+ like CB in output formats that support that, and like B+ in those that don't (e.g. the terminal).+ Aliases also defined for VI, VB, VBI.++ * Asciidoc writer: Support checklists in asciidoctor writer (#7832,+ Nikolai Korobeinikov, ricnorr). The checklist syntax (similar to+ `task_list` in markdown) seems to be an asciidoctor-only addition.++ * HTML writer:++ + Avoid duplicate "style" attributes on table cells (#7871).+ + Don't break lines inside code elements. With the new (default)+ line wrapping of HTML, in conjunction with the default CSS which+ includes `code { whitespace: pre-wrap; }`, spurious line+ breaks could be introduced into inline code (#7858).++ * Custom writer: preserve order of element attributes (#7489, Albert+ Krewinkel). Attribute key-value pairs are marshaled as AttributeList,+ i.e., as a userdata type that behaves both like a list and a map. This+ allows to preserve the order of key-value pairs.++ * Switch to hslua-2.1 (Albert Krewinkel). This allows for some code+ simplification and improves stability.++ * Don't read files outside of user data directory (Even Brenden).+ If a file path does not exist relative to the working directory, and+ it does exist relative to the user data directory, but outside of+ of the user data directory, do not read it. This applies to+ `readDataFile` and `readMetadataFile` in PandocMonad and, by+ extension, any module that uses these by passing them relative paths.++ * Text.Pandoc.Class.`makeCanonical`: Correctly handle consecutive ".."s+ at the beginning of a path (Even Brenden). Prior to this commit,+ `../../file` would evaluate to `file`, when it should be unchanged.++ * Search for metadata files in `$DATADIR/metadata` (#7851, Even Brenden).+ If files specified with `--metadata-file` are not found in the working+ directory, look in `$DATADIR/metadata` (#5876).++ * Text.Pandoc.Class: export `readMetadataFile` [API change] (#5876).++ * Text.Pandoc.Error: export new `PandocCouldNotFindMetadataFileError`+ constructor for `PandocError` [API change] (#5876).++ * Avoid putting a frame around speaker notes in beamer (#7857).+ If speaker notes (a Div with class 'notes') occur right+ after a section heading, but above slide level, the+ resulting `\note{..}` caommand should not be wrapped in+ a frame, as that will cause a spurious blank slide.++ * CSS in HTML template: adjust #TOC and h1 on mobile (#7835, Mauro Bieg).++ * Text.Pandoc.Readers.LaTeX.Parsing: don't export `totoks`.+ Make the first param of `tokenize` a SourcePos instead of+ SourceName, and use it instead of `totoks`.++ * Text.Pandoc.Shared: Modify `stringify` so it ignores `[Citation]`+ inside `Cite` (#7855). Otherwise we'll sometimes get two copies of+ things, one from the `citationPrefix` or `citationSuffix` and another+ from the embedded fallback text. When there is no fallback text,+ we'll get no content. However, it really isn't an alternative to just+ rely on the result of running `query` on the embedded `Citation`s;+ this will result in a jumble of text rather than anything structured.++ * Omit `--enable-doc` in the cabal haddock invocation in+ `tools/build-and-upload-api-docs.sh`.++ * Text.Pandoc.App.Opt: fix logic bug in `fullDefaultsPath`.+ Previously we would (also) search the default user data directory+ for a defaults file, even if a different user data directory+ was specified using `--data-dir`. This was a mistake; if+ `--data-dir` is used, the default user data directory should+ not be searched.++ * Text.Pandoc.Shared: `defaultUserDataDir` behavior change (#7842).+ If the XDG data directory is not defined (e.g. because+ it's not supported in the OS or HOME isn't defined), we+ return the empty string instead of raising an exception.++ * Update command tests to distinguish stderr and test exit status.++ * MANUAL: add that speaker notes can be used with beamer (#7856).++ * Update `build-and-upload-api-docs.sh`.++ * Document `--trace` option.+ Document `no-check-certificate` in defaults files.+ Document 'sandbox' option for defaults files. (#7873).++ * Fix pattern syntax in sample readability custom reader.++ * doc/custom-readers.lua: add example for "readable HTML."++ * Fix message in man page about where code can be found.++ * `manfilter.lua`: remove extra indent in table cells with code blocks.++ * Fix lua-filters documentation for table column widths (#7864).++ * epub.doc: Update links to KindleGen (#7846, Benson Muite, Mauro Bieg).+ KindleGen has been deprecated and we need to link to archived versions.++ * Use tables in defaults files documentation, so each+ default option is paired with the corresponding command-line+ option (Carsten Allefeld).++ * Use skylighting 0.12.2.++ * Add pandoc-lua-marshal to Nix shell (#7849, Even Brenden).+++## pandoc 2.17.0.1 (2022-01-14)++ * Require pandoc-lua-marshal 0.1.3.1 (#7831, Albert Krewinkel).+ Fixes a problem with `List.includes` and `List.find` that caused a+ Lua stackoverflow and subsequent program crash.++ * HTML template: load header-includes before math (#7833, Kolen Cheung).+ MathJax expect the config comes before loading the MathJax script.+ This change of order allows one to config MathJax via+ header-includes, which loads before the MathJax script. Cf. #2750.++ * When reading defaults file, stop at a line `...`. This line signals+ the end of a YAML document. This restores the behavior we got with+ HsYaml. yaml complains about content past this line. See+ https://github.com/jgm/pandoc/issues/4627#issuecomment-1012438765++ * Text.Pandoc.Citeproc: allow `notes-after-punctuation` to work with+ numerical styles that use superscripts (e.g.+ american-medical-association.csl), as well as with note styles. The+ default setting of `notes-after-punctuation` is true for note styles+ and false otherwise. This restores a behavior of pandoc-citeproc+ that wasn't properly carried over to Citeproc (#7826, cf.+ jgm/pandoc-citeproc#384).++ * Use commonmark-pandoc 0.2.1.2 (#7769).++ * Add FAQ on images in ipynb containers (#7749, Kolen Cheung).++## pandoc 2.17 (2022-01-12)++ * Support `markua` as an output format (#1871, Tim Wisotzki and+ Saumel Lemmenmeier). Markua is a markdown variant used by Leanpub.++ * Add text wrapping for HTML output (#7764). Previously the HTML writer+ was exceptional in not being sensitive to the `--wrap` option. With+ this change `--wrap` now works for HTML. The default (as with other+ formats) is automatic wrapping. Note that the contents of `script`,+ `textarea`, and `pre` tags are always laid out with the `flush`+ combinator, so that unwanted spaces won't be introduced if these occur+ in an indented context in a template.++ * Don't read sources until in/out format are verified (#7797).++ * Issue error with `--list-extensions` for invalid formats (#7797).++ * Make `--citeproc` recognize `.yml` as well as `.yaml` extensions+ as YAML bibliography files (#7707, Jörn Krenzer).++ * Use latest version of KaTeX with `--katex`.++ * Fix parsing of footnotes in `--metadata-file` (#7813). Previously+ non-inline footnotes were not being parsed.++ * ODT reader:++ + Parse list-header as a list item (Tuong Nguyen Manh).++ * Commonmark reader:++ + Put sourcepos attribute on header, not enclosing div+ with `-f commonmark+sourcepos` (#7769).++ * Markdown reader:++ + Don't allow `^` at beginning of link or image label (#7723).+ This is reserved for footnotes. Fixes regression from 0a93acf.+ + Fix parsing of "bare locators" after author-in-text citations.+ Previously `@item [p. 12; @item2]` was incorrectly parsed as+ three citations rather than two. This is now fixed by ensuring+ that `prefix` doesn't gobble any semicolons.+ + Revert changes to `inlinesInBalancedBrackets` (commit fa83246),+ which caused regressions.+ + Improve detection of pipe table line widths (#7713). Fixed+ calculation of maximum column widths in pipe tables. It is+ now based on the length of the markdown line, rather than a+ "stringified" version of the parsed line. This should be+ more predictable for users. In addition, we take into account+ double-wide characters such as emojis.++ * Custom (Lua) readers:++ + First argument is now a list of sources instead of the+ concatenated text (Albert Krewinkel). The list+ structure can easily be converted to a string by applying+ `tostring`, but it is also possible to access the elements+ (each with a `text` and `name`). A small example is added+ to the custom reader documentation, showcasing its use in a+ reader that creates a syntax-highlighted code block for+ each source code file passed as input. Existing readers+ will still work through a fallback mechanism, issuing a+ deprecation notice.++ * Org reader:++ + Parse official org-cite citations (#7329). We also support the older+ org-ref style as a fallback. We no longer support the+ "markdown style" or "Berkeley style" citations.+ + Support alphabetical (fancy) lists (Lucas Viana). When the+ `fancy_lists` extension is enabled, alphabetical list markers are+ allowed, mimicking the behaviour of Org Mode when+ `org-list-allow-alphabetical` is enabled.+ + Support counter cookies in lists (Lucas Viana). Such cookies are+ used to override the item counter in ordered lists. In org it is+ possible to set the counter at any list item, but since Pandoc AST+ does not support this, we restrict the usage to setting an offset for+ the entire ordered list, by using the cookie in the first list item.+ + Allow trailing spaces after key/value pairs in directives (Albert+ Krewinkel). Ensures that spaces at the end of attribute directives like+ `#+ATTR_HTML: :width 100%` (note the trailing spaces) are accepted.++ * LaTeX reader:++ + Omit visible content for `\label{...}`. Previously we+ included the text of the label in square brackets, but this is+ undesirable in many cases. See discussion in+ <https://github.com/jgm/pandoc/issues/813#issuecomment-978232426>.+ + Improve references (#813). Resolve references to theorem environments.+ Remove the Span caused by "label" in figure, table, and theorem+ environments; this had an id that duplicated the environments' id.+ + Fix semantics of `\ref`. We were including the ams+ environment type in addition to the number. This is proper+ behavior for `\cref` but not for `\ref`. To support `\cref`+ we need to store the environment label separately.+ + Add babel mappings for Guajati (gu) and Oriya (or) (#7815).+ + Fix typo `panjabi` -> `punjabi` in babel mappings (#7814).++ * HTML reader:++ + Parse attributes on links and images (#6970).++ * Docx reader:++ + Handle multiple pic elements inside a drawing (#7786).+ + Change `elemToParPart` to return `[ParPart]` instead of `ParPart`.+ Also remove `NullParPart `constructor, as it is no longer+ needed. This will allow us to handle elements that contain+ multiple ParParts, e.g. `w:drawing` elements with multiple `pic:pic`.++ * DocBook reader:++ + Collapse internal spaces in literal and other similar tags (#7821),+ as the standard docbook toolchain does.+ + Be sensitive to spacing="compact" in lists (#7799). When+ `spacing="compact"` is set, Para elements are turned into Plain,+ so we get a "tight" list.++ * Markdown writer:++ + Add new exported function `writeMarkua` from Text.Pandoc.Writers.Markdown+ [API change] (#1871, Tim Wisotzki and Saumel Lemmenmeier).+ + Fix indentation issue in footnotes (#7801).+ + Avoid extra space before citation suffix if it already starts+ with a space.+ + Ensure semicolon between the locator and the next citation when an+ author-in-text citation has a locator and following citations.+ + Improve escaping for `#` (#7726).++ * Custom (Lua) writers:++ + Allow variables to be set via second return value of `Doc`+ (#6731, Albert Krewinkel). New templates variables can be added by+ giving variable-value pairs as a second return value of the+ global function `Doc`. Example:+ ```+ function Doc (body, meta, vars)+ vars.date = vars.date or os.date '%B %e, %Y'+ return body, vars+ end+ ```+ + Provide global `PANDOC_WRITER_OPTIONS` (#6731, Albert Krewinkel).+ + Assign default Pandoc object to global `PANDOC_DOCUMENT` (Albert+ Krewinkel). The default Pandoc object is now non-strict, i.e., only+ the parts of the document that are accessed will be marshaled to Lua.+ A special type is no longer necessary. This change also makes it+ possible to use the global variable with library functions such as+ `pandoc.utils.references`, or to inspect the document contents with+ `walk()`.++ * LaTeX writer:++ + Fix typo `panjabi` -> `punjabi` in babel mappings (#7814).++ * MediaWiki writer:++ + Remove redundant display text for wiki links (Jesse Hathaway).++ * Docx writer:++ + Handle bullets correctly in lists by not reusing numIds+ (#7689, Michael Hoffmann). This fixes a bug in which a Div in+ a list item would receive bullets on its contained paragraphs.++ * Org writer:++ + Fix list items starting with a code block or other non-paragraph+ content (#7810).+ + Avoid blank lines after tight sublists (#7810).+ + Fix extra blank line inserted after empty list item (#7810).+ + Don't add blank line before lists (#7810).+ + Support starting number cookies (Lucas Viana). This is necessary+ for lists that start at a number other than 1.+ + Support the new org-cite syntax (#7329).++ * Haddock writer:++ + Avoid blank lines after tight sublists (#7810).++ * Ipynb writer:++ + Ensure deterministic order of keys.+ + Handle cell output with raw block of markdown (#7563, Kolen Cheung).+ Write RawBlock of markdown in code-cell output. This is designed+ to fit the behavior of #7561, which makes the ipynb reader parse+ code-cell output with mime "text/markdown" to a RawBlock of markdown.+ This commit makes the ipynb writer writes this RawBlock of markdown+ back inside a code-cell output with the same mime, preserving this+ information in round-trip.+ + In choosing between multiple output options, always favor+ those marked with the output format over images (Kolen Cheung).+ Previously, both `fmt == f` case and Image have a rank of 1.++ * Ipynb reader & writer: properly handle cell "id" (#7728).+ This is passed through if it exists (in Nb4); otherwise+ the writer will add a random one so that all cells have an "id".++ * Ms writer:++ + Properly encode strings for PDF contents (#7731).++ * JATS writer:++ + Keep quotes in element-citations (Albert Krewinkel).+ Fixed a bug that lead to quote characters being lost in+ element-citations.++ * RTF writer:++ + Properly handle images in data URIs (#7771).++ * Commonmark writer:++ + Allow ')' delimiters on ordered lists.++ * RST writer:++ + Avoid extra blank line after empty list item (#7810).++ * HTML writer:++ + Make line breaks more consistent. With `--wrap=none`, we now+ output line breaks between block-level elements. Previously they+ were omitted entirely, so the whole document was on one line, unless+ there were literal line breaks in pre sections. This makes+ the HTML writer's behavior more consistent with that of+ other writers. Also, regardless of wrap settings,+ put newline after `<dd>` and after block-level elements in+ the footnotes section. And add a line break between an `img` tag+ and the associated `figcaption`.+ + reveal.js: Make sure images with `r-stretch` are not in p tags.+ They must be direct children of the section. There was previously+ code to make this work with the older class name `stretch`, but+ the name has changed in reveal.js.+ + reveal.js: don't add `r-fit-text` class to section. It must go on+ the header only.++ * AsciiDoc writer:++ + Improve detection of intraword emphasis (#7803).++ * OpenDocument writer:++ + Fix vertical alignment bug with display math (#7777). Previously some+ displayed formulas would be floated above a preceding text line.+ This is fixed by setting `vertical-rel` to `text` rather than+ `paragraph-content`.++ * JATS template (Albert Krewinkel):++ + Fix position of contrib affiliations in authoring set. Any+ `<aff>` element must come before any `<email>` element.+ + Fix affiliation tagging in `articleauthoring` output.+ Affiliations were `xlink`ed even in the articleauthoring tag set, but+ `<aff>` are not allowed as children of `contrib-group` elements in that+ tag set. Each affiliation must be listed directly in the contrib+ element.+ + Add support for article subtitles.++ * EPUB template:++ + Include abstract in default template.+ + Ensure that the essential styles needed by pandoc (`styles.html`+ partial) are included in the templates. This is important for correct+ formatting of CSL bibliographies. Note that much of the styling in+ `styles.html` will be ignored for EPUB, because of the conditional on+ `document-css`. Setting the `document-css` variable will cause it+ not to be ignored.++ * HTML template: Add abstract (#7588, Jannik Buhr, John MacFarlane).+ By default, a localized title (the word "Abstract") will be+ used, unless the variable `abstract-title` is set.++ * ConTeXt template: Make title appear in PDF title bar. This is+ recommended for accessibility reasons. Note: doesn't work with macOS+ Preview.app.++ * `reference.pptx`: change to use 16:9 aspect ratio, Powerpoint's default.++ * Text.Pandoc.Writers:++ + Do not export `writeCustom` [API change]. This ensures that all+ writers exported in T.P.Writers are parameterized and work with any+ `PandocMonad` type. This is consistent with T.P.Readers, as+ `readCustom` is not exported from that module either.++ * Text.Pandoc.Writers.Shared:++ + `endsWithPlain` now returns True if the list ends with a list+ that ends with a Plain, and so on recursively (#7810).++ * Text.Pandoc.Class.IO:++ + `writeMedia`: unescape percent-encoding in creating file path.+ This addresses a problem with spaces in image filenames+ when creating PDFs (#7819); it also affects `--extract-media`.++ * New internal module Text.Pandoc.Writers.Blaze, exporting `layoutMarkup`.+ This converts a blaze Html structure into a doclayout Doc Text.++ * Text.Pandoc.Extensions:++ + `parseFormatSpec`: cleaner error message for invalid extensions.++ * Text.Pandoc.MediaBag:++ + Fix bug in `extractMedia`, which caused the test for `..`+ in paths to fail, with the result that images with `..`+ in the path name could be extracted outside of the+ directory specified by `extractMedia`. It also led a check for+ `media` in resource paths to fail in the docx reader.++ * Text.Pandoc.Citeproc:++ + Avoid adding comma before an author-in-text citation in a note+ if it begins with a title (no author) (#7761).+ + Text.Pandoc.Citeproc.Locator now exports `toLocatorMap`,+ `LocatorInfo`, and `LocatorMap`. The type of `parseLocator`+ has changed, so it now takes a `LocatorMap` rather than a `Locale`+ as parameter, and returns a `LocatorInfo` instead of a tuple.+ + Fix citation locator detection for German. `toLocatorMap` now+ stores keys case-folded. We want to do a case-insensitive+ comparison when parsing locators, so that e.g. both+ `Chap.` and `chap.` work. Previously we case-folded terms+ when doing the lookup, but they weren't case-folded in the+ map itself, which led to locator-detection breaking for+ German (where the terms have uppercase letters).++ * Lua (Albert Krewinkel):++ + Allow single elements as singleton MetaBlocks/MetaInlines. Single+ elements should always be treated as singleton lists in the Lua+ subsystem.+ + Add `pandoc.template` module. The module provides a `compile`+ function to use strings as templates.+ + Add `pandoc.WriterOptions` constructor.+ + Add function `pandoc.write`.+ + Provide global `PANDOC_WRITER_OPTIONS` (#5221).+ + The function Text.Pandoc.Filter.applyFilters now takes a filter+ environment of type `Environment`, instead of a ReaderOptions value+ [API change].+ + The `Environment` type is exported from Text.Pandoc.Filter+ and allows to combine ReaderOptions and WriterOptions in a single+ value [API change].+ + Global, exported from Text.Pandoc.Lua, has a new type constructor+ `PANDOC_WRITER_OPTIONS` [API change].+ + Add constructors `pandoc.Blocks` and `pandoc.Inlines`.+ The functions convert their argument into a list of Block and Inline+ values, respectively. When applied to a string, they split the+ string into `Str` elements separated by `Space` or `SoftBreak`+ (#7712).+ + Support topdown traversals The traversal order of filters can now+ be selected by setting the key `traverse` of the filter to either+ `'topdown'` or `'typewise'`; the default remains `'typewise'`.+ Topdown traversals can be cut short by returning `false` as a+ second value from the filter function. No child-element of the+ returned element is processed in that case.+ + Marshal ReaderOptions field `extensions`, `track_changes` via JSON.+ Extensions are now available as a list of strings; the track-changes+ settings are given as the kebab-case representation used in JSON.+ + Allow binary (byte string) readers to be used with `pandoc.read`.+ + Use global state when parsing documents in `pandoc.read`.+ The function `pandoc.read` is updated to use the same state that was+ used while parsing the main input files. This ensures that log+ messages are preserved and that images embedded in the input are+ added to the mediabag.+ + Cleanup stack in `peekReadOptionsTable`. A ReaderOptions element was+ left on top of the stack when the `peekReadOptionsTable` function+ was invoked.+ + `walk` methods are added to `Pandoc`, `Block`, `Inline`,+ `Blocks`, `Inlines` values; the methods are similar to+ `pandoc.utils.walk_block` and `pandoc.utils.walk_inline`, but+ apply to filter to the element's contents.+ + Functions of name `Doc` are no longer accepted as alternatives for+ `Pandoc` filter functions. This functionality was undocumented.+ + Improve handling of empty caption, body by `from_simple_table`+ #7776). Create truly empty table caption and body when these are+ empty in the simple table.+ + Change representation of `TableHead`, `TableFoot`, and `Row` values+ (#7718). The objects now also follow the principle that element+ attributes are accessible through the `.attr` field. Rows in `TableHead`+ and `TableFoot` are available via the `.rows` field. Row objects have a+ `.cells` field, containing the list of table cells.+ + [Simplify](Simplify) code of `pandoc.utils.stringify`. Minor behavior change:+ plain strings nested in tables are now included in the result string.+ + Simplify and deprecate function `pandoc.utils.equals`. The function+ is no longer required for element comparisons; it is now an alias+ for the `==` operator.+ + Add function `pandoc.utils.references` (#7752).+ + Add new library function `pandoc.utils.type`. The function behaves+ like the default `type` function from Lua's standard library,+ but is aware of pandoc userdata types. A typical use-case would be+ to determine the type of a metadata value.+ + Fix return types of `blocks_to_inlines`, `make_sections`.+ Ensures the returned lists have the correct type (`Inlines` and+ `Blocks`, respectively).+ + Use more natural representation for Reference values+ Omit `false` boolean values, push integers as numbers.++ * Lua: use package pandoc-lua-marshal (#7719, Albert Krewinkel).+ The marshaling functions for pandoc's AST are extracted into a separate+ package. The package comes with a number of changes:++ + Pandoc's List module was rewritten in C, and error messages were+ improved.+ + Lists of `Block` and `Inline` elements are marshaled using the new+ list types `Blocks` and `Inlines`, respectively. These types+ currently behave identical to the generic List type, but give better+ error messages. This also opens up the possibility of adding+ element-specific methods to these lists in the future.+ + Elements of type `MetaValue` are no longer pushed as values which+ have `.t` and `.tag` properties. This was already true for+ `MetaString` and `MetaBool` values, which are still marshaled as Lua+ strings and booleans, respectively. Affected values:+ - `MetaBlocks` values are marshaled as a `Blocks` list;+ - `MetaInlines` values are marshaled as a `Inlines` list;+ - `MetaList` values are marshaled as a generic pandoc `List`s.+ - `MetaMap` values are marshaled as plain tables and no longer+ given any metatable.+ + `Cell` values are now marshaled as userdata objects; a constructor+ function for table cells is provided as `pandoc.Cell`.+ + The test suite for marshaled objects and their constructors has+ been extended and improved.+ + A bug in `Citation` objects, where setting a citation's suffix+ modified it's prefix, has been fixed.+ + Inlines, Blocks, and List objects now have an `__eq` metamethod,+ testing equality by comparing two lists element-wise.++ * Powerpoint tests: shorten lines by grouping tests (Albert+ Krewinkel). This makes the test output more pleasant to read+ in narrow terminal windows.++ * make check: check for unreleased dependencies.++ * Add `tools/build-and-upload-api-docs.sh`.++ * Update cabal description.++ * `MANUAL.txt`: Add section on EPUB styling.++ * `MANUAL.txt`: clarify "standard Markdown" as "original Markdown"+ (#7802, Martin Fischer).++ * `doc/custom-writers.md`: use filter to include source of example.++ * Add an example to `doc/custom-readers.md`.++ * Fix typo in `custom-readers.md` (#7722, Mauro Bieg).++ * `doc/jats.md`: add link to JATS documentation (Martin Fischer).++ * `doc/lua-filters.md`: many improvements (Albert Krewinkel,+ John MacFarlane).++ * Use commonmark-extensions 0.2.3. This allows a bare-word class attribute+ on fenced divs.++ * Use ipynb 0.2.++ * Use citeproc 0.6.0.1.++ * Use texmath 0.12.4.++ * Use doctemplates 0.10.0.1.++## pandoc 2.16.2 (2021-11-21)++ * Add interface for custom readers written in Lua (#7669).+ Users can now do `-f myreader.lua` and pandoc will treat the+ script `myreader.lua` as a custom reader, which parses an input+ string to a pandoc AST, using the pandoc module defined for+ Lua filters. A sample custom reader can be found in `data/creole.lua`.+ Also see documentation in `doc/custom-readers.md`.++ * New module Text.Pandoc.Readers.Custom, exporting `readCustom` [API change].++ * Allow `plain` to be used in raw attribute syntax.++ * Accept empty `--metadata-file` (#7675).+ This was a regression from 2.15 behavior.++ * Markdown reader: Improve `inlinesInBalancedBrackets`.+ This is just a small improvement in terms of performance, but it's simpler+ and more direct code. Also, we avoid parsing interparagraph spaces in+ balanced brackets, as the original did.++ * BibTeX reader: Properly handle commented lines in BibTeX/BibLaTeX (#7668).++ * RST reader: handle class attribute for for custom roles (#7699,+ willj-dev). Previously the class attribute was ignored, and the name+ of the role used as the class.++ * DocBook reader:++ + Add `<titleabbr>` support (Rowan Rodrik van der Molen).+ + Support for `<indexterm>` (#7607, Rowan Rodrik van der Molen).++ * LaTeX reader:++ + Add rudimentary support for `\autoref` (#7693).+ + Add 'uri' class when parsing `\url`, for consistency+ with treatment of autolinks in other formats (#7672).++ * JATS reader: Capture `alt-text` in figures (#7703, Aner Lucero).++ * MediaWiki writer: use HTML spans for anchors when header has id (#7697).+ We need to generate a span when the header's ID doesn't match+ the one MediaWiki would generate automatically. Note that MediaWiki's+ generation scheme is different from pandoc's (it uses uppercase letters,+ and `_` instead of `-`, for example). This means that in going from+ markdown to mediawiki, we'll now get spans before almost every heading,+ unless explicit identifiers are used that correspond to the ones MediaWiki+ auto-generates. This is uglier output but it's necessary for internal+ links to work properly.++ * Markdown writer: don't create autolinks when this loses information+ (#7692). Previously we sometimes lost attributes when rendering links+ as autolinks.++ * Text.Pandoc.Readers.Metadata: allow multiple YAML documents when parsing+ YAML for `yamlBsToRefs`. Some people use `---` as the end delimiter in+ YAML bibliography files, which causes the `yaml` library to emit an+ error unless we explicitly allow multiple YAML documents (and just+ consider the first).++ * JATS writer:++ + Ensure figures are wrapped with `<p>` in list items+ (Albert Krewinkel). This prevents the generation of invalid output.+ + Add URL to element citation entries (Albert Krewinkel).+ The URL of a reference, if present, is added in tag `<uri>` to+ element-citation entries.++ * HTML writer: Don't create invalid `data-` attribute for empty+ attribute key (#7546).++ * LaTeX writer:++ + Babel mappings: use `ancientgreek` for `grc`.+ + With `-t latex-smart`, don't generate `\ldots` from ellipsis (#7674).+ Instead just use unicode ellipsis.++ * JATS template: fix `equal-contrib` attribute (Albert Krewinkel).+ The standard requires the value to be either `yes` or `no`, but is was+ set to `true` for authors who contributed equally.++ * reveal.js template: Add `disableLayout` variable (Christophe Dervieux).++ * Text.Pandoc.Error: sort errors in `handleError` by exit code+ (Albert Krewinkel).++ * Text.Pandoc.Writers.Shared: Improve toLegacyTable (#7683,+ Christian Despres).++ * Lua subsystem:++ + Include lpeg module (#7649, Albert Krewinkel). Compiles the `lpeg`+ library (Parsing Expression Grammars For Lua) into+ the program. Package maintainers may choose to rely on package+ dependencies to make lpeg available, in which case they can compile+ the with the constraint `lpeg +rely-on-shared-lpeg-library`.+ `lpeg` and `re` are always made available in global variables,+ without the need for a `require`.++ + Set `lpeg` and `re` as globals; allow shared lib access via `require`.+ The `lpeg` and `re` modules are loaded into globals of the respective+ name, but they are not necessarily registered as loaded packages. This+ ensures that++ - the built-in library versions are preferred when setting the globals,+ - a shared library is used if pandoc has been compiled without `lpeg`,+ and+ - the `require` mechanism can be used to load the shared library if+ available, falling back to the internal version if possible and+ necessary.++ + Fix argument order in constructor `pandoc.Cite` (Albert Krewinkel).+ This restores the old behavior; argument order had been switched+ accidentally in pandoc 2.15.++ + Add Pushable instance for `ReaderOptions` (Albert Krewinkel).++ + Allow to pass custom reader options to `pandoc.read` as an+ optional third argument (#7656, Albert Krewinkel).+ The object can either be a table or a ReaderOptions value+ like `PANDOC_READER_OPTIONS`. Creating new ReaderOptions objects is+ possible through the new constructor `pandoc.ReaderOptions`.++ + Display Pandoc values using their native Haskell representation+ (Albert Krewinkel).++ + Require latest hslua (2.0.1) (#7661, #7657, Albert Krewinkel).+ This fixes issues with++ - misleading error messages when a required function parameter is+ omitted;+ - absent properties still being listed in the output of `pairs`; and+ - alias accessing leading to errors instead of returning `nil`, e.g.+ with `(pandoc.Str '').identifier`.++ + Add missing space in "package not found" message (#7658, Albert+ Krewinkel).++ * Update build files (#7696, Fabián Heredia Montiel).+ Drop old windows 32-bit constraints.+ Update cabal `tested-with` field to correspond to `ci.yml` matrix++ * Remove unneeded package dependencies from benchmark target.++ * Require ghc >= 8.6, base >= 4.12.+ This allows us to get rid of the old custom prelude and+ some crufty cpp. But the primary reason for this is that+ conduit has bumped its base lower bound to 4.12, making it+ impossible for us to support lower base versions.++ * Require Cabal 2.4. Use wildcards to ensure that all pptx tests are+ included (#7677).++ * Update `bash_completion.tpl` (S.P.H.).++ * Add `data/creole.lua` as sample custom reader.++ * Add `doc/custom-readers.md` and `doc/custom-writers.md`.++ * `doc/lua-filters.md`: add section on global modules, including lpeg+ (Albert Krewinkel).++ * `MANUAL.txt`: update table of exit codes and corresponding errors+ (Albert Krewinkel).++ * Use latest texmath.++## pandoc 2.16.1 (2021-11-02)+++ * Docx reader: don't let first line indents trigger block quotes (#7655).+ This fixes a regression introduced in pandoc 2.15.++ * Docx writer: use `getTimestamp` for modification times in+ reference.docx (#7654). This ensures that when `SOURCE_DATE_EPOCH` is+ set, the modification times of files taken from the reference.docx will+ be set deterministically, allowing for reproducible builds.++ * Lua subsystem (Albert Krewinkel):++ + Load module `pandoc.path` on startup (#7524). Previously the module+ always had to be loaded via `require 'pandoc.path'`.+ + Fix typo in SoftBreak constructor.+ + Re-add `content` property to Strikeout elements.+ Fixes a regression introduced in 2.15.+ + Be more forgiving when retrieving the Image `caption` property.+ Fixes a regression introduced in 2.15.+ + Display Attr values using their native Haskell representation.+ + Allow omitting the 2nd parameter in pandoc.Code constructor.+ Fixes a regression introduced in 2.15 which required users to always+ specify an Attr value when constructing a Code element.+ + Allow to compare, show Citation values. Comparisons of Citation+ values are performed in Haskell; values are equal if they represent+ the same Haskell value. Converting a Citation value to a string+ now yields its native Haskell string representation.+ + Restore List behavior of MetaList (#7650). Fixes a regression+ introduced in 2.16 which had MetaList elements lose+ the `pandoc.List` properties.+ + Restore `content` property on Header elements.+ + Ensure Block elements have all expected properties.+ + Ensure Inline elements have all expected properties.++ * Allow tasty-bench 0.3.x.++## pandoc 2.16 (2021-10-31)++ * Switch back from HsYAML to yaml for parsing YAML metadata (#6084).+ HsYAML is around 20 times slower in parsing large YAML bibliographies.+ In addition, HsYAML is not being actively maintained. This sets us back+ in our attempts to free ourselves from C dependencies (#4535). But I+ don't see a good alternative until a faster pure Haskell parser is available.+ Notes:++ + We've removed the FromYAML instances for all types that had them, since+ this is a HsYAML-specific typeclass [API change]. (The yaml package just+ uses From/ToJSON instead of having a dedicated From/ToYAML class.)+ + Unlike HsYAML (in the configuration we were using), yaml parses 'Y', 'N',+ 'Yes', 'No', 'On', 'Off' as boolean values. Users may need to quote these+ when they are meant to be interpreted as strings. Similarly, 'null' is+ parsed as a YAML null value (and will be treated as an empty string by+ pandoc rather than the string 'null'). Quoting it will force it to be+ interpreted as a string.+ + Some tests had to be adjusted accordingly.+ + Pandoc now behaves in a more useful way when the YAML metadata contains+ escaping errors: instead of just failng silently and falling back to+ some other interpretation of the section, it raises a YAML parsing error.++ * Markdown writer: Ensure that special values are quoted in YAML metadata.+ These include "Y", "yes", "on", and "off", which are now (with yaml library)+ considered boolean values, as well as "null".++ * Change JSON encodings of some types.++ + For LineEnding use lowercase constructors, e.g. `crlf`, `native`.+ + For HTMLSlideVariant use lowercase constructors.+ + For ReaderOptions use e.g. `default-image-extension`+ instead of `readerDefaultImageExtension` for field names.+ + For Extension, use e.g. `tex_math_dollars` instead of+ `Ext_tex_math_dollars` as constructor.+ + For Extensions, use an array of Extensions, instead of+ an object wrapping the tag `Extensions` and an integer.+ (The integer representation is not supposed to be part of the+ public API.)+ + For Opt, use field names like `tab-stop` instead of `optTabStop`.++ * Docx writer:++ + Add IDs to native_numbering test (Tristan Stenner).+ + Move ": " out of the caption bookmark (Tristan Stenner).+ This is needed so that native references to the figure are included as+ "As seen in Figure X, it is..." instead of "As seen in [Figure: X, it is..."++ * Lua (Albert Krewinkel, except as noted):++ + Use hslua module abstraction where possible.+ + Fix placement of tests for Block elements in pandoc module tests+ + Increase strictness when getting attribute keys+ + Re-add `t` and `tag` property to Attr values.+ Removal of these properties from Attr values was a regression.+ + Fix `pandoc.utils.stringify` regression. The `pandoc.utils.stringify`+ function returned empty strings when called with a string argument.+ + Fix a copy/paste bug in Lua marshalling code (John MacFarlane, #7639).+ This caused links to be changed to figures when Lua filters changed+ link properties.+ + Re-add `content` property to Link elements (#7647).+ This was a regression introduced in version 2.15.+ + Generate constants in module pandoc programmatically.+ + Marshal SimpleTable, ListAttributes, Citation, and Block values as+ userdata objects. Properties of Block values are marshalled lazily,+ which generally improves performance considerably. Script users may also+ notice the following differences:++ - Block element properties can no longer be accessed by numerical+ indexing of the `.c` field. The `.c` property now serves as an alias+ for `.content`, so some filter that used this undocumented method+ for property access may continue to work, while others will need to+ be updated and use proper property names.+ - The marshalled Block elements now have a `show` method, and a+ `__tostring` metamethod. Both return the Haskell string+ representation of the element.+ - Block values now have the Lua type `userdata` instead of `table`.++ * Add a short guide to pandoc's sources (Albert Krewinkel).++ * Fix epub files in epub reader tests, so that they are valid+ according to epubcheck (#7586).++ * Allow time 1.13.++ * Require latest skylighting (0.12.1).++ * Fix build on GHC 9.2 (Joseph C. Sible).++ * Fix trypandoc so it builds with aeson > 2.+++## pandoc 2.15 (2021-10-23)++ * Add `--sandbox` option (#5045).++ + Add sandbox feature. When this option is used, readers and writers+ only have access to input files (and other files specified directly on+ command line). This restriction is enforced in the type system.+ + Filters, PDF production, custom writers are unaffected. This+ feature only insulates the actual readers and writers, not+ the pipeline around them in Text.Pandoc.App.+ + Note that when `--sandboxed` is specified, readers won't have+ access to the resource path, nor will anything have access to+ the user data directory.++ * `--self-contained`: Fix bug that caused everything to be made a data+ URI (#7635, #7367). We only need to use data URIs in certain cases, but+ due to a bug they were being used always.++ * Pandoc will now fall back to latin1 encoding for inputs that can't be+ read as UTF-8. This is what it did previously for content fetched+ from the web and not marked as to content type. It makes sense to do+ the same for local files. In this case a `NotUTF8Encoded` warning+ will be issued, indicating that pandoc is interpreting the input as latin1.++ * Markdown reader:++ + Don't parse links or bracketed spans as citations (#7632).+ Previously pandoc would parse `[link to (@a)](url)` as a+ citation; similarly `[(@a)]{#ident}`. This is undesirable. One should+ be able to use example references in citations, and even if `@a` is+ not defined as an example reference, `[@a](url)` should be a link+ containing an author-in-text citation rather than a normal citation+ followed by literal `(url)`.+ + Fix interaction of `--strip-comments` and list parsing (#7521).+ Use of `--strip-comments` was causing tight lists to be rendered as+ loose (as if the comment were a blank line).+ + Fix parsing bug for math in bracketed spans and links (#7623).+ This affects math with unbalanced brackets (e.g. `$(0,1]$`)+ inside links, images, bracketed spans.+ + Fix code blocks using `--preserve-tabs` (#7573). Previously they+ did not behave as the equivalent input with spaces would.++ * DocBook reader:++ + Honor linenumbering attribute (Samuel Tardieu).+ The attribute DocBook `linenumbering="numbered"` on code blocks+ maps to the `numberLines` class internally.++ * LaTeX reader:++ + Implement siunitx v3 commands (#7614).+ We support `\unit`, `\qty`, `\qtyrange`, and `\qtylist`+ as synonyms of `\si`, `\SI`, `\SIrange`, and `\SIlist`.+ + Properly handle `\^` followed by group closing (#7615).+ + Recognize that `\vadjust` sometimes takes "pre" (#7531).+ + Ignore (and gobble parameters of) CSLReferences environment (#7531).+ Otherwise we get the parameters as numbers in the output.+ + Restrict `\endinput` to current file (Simun Schuster).++ * RST reader: handle escaped colons in reference definitions (#7568).++ * HTML reader:++ + Handle empty tbody element in table (#7589).++ * Ipynb reader (Kolen Cheung):++ + Get cell output mime from `raw_mimetype` in addition to `format`.+ (`format` is what the spec calls for, but `raw_mimetype` is+ often used in practice; see jupyter/nbformat#229).+ + Add more formats that can be handled as "raw" cells.+ + Fix mime type for `rst`.+ + Support `text/markdown`, which is now a supported mime type for raw+ output (#7561).++ * RTF reader:++ + Support `\binN` for binary image data.+ + If doc begins with {\rtf1 ... } only parse its contents.+ Some documents seem to have non-RTF (e.g. XML) material after the+ `{\rtf1 ... }` group.+ + Ignore `\pgdsc` group. Otherwise we get style names treated as test.+ + Better handling of `\*` and bookmarks. We now ensure that groups+ starting with `\*` never cause text to be added to the document.+ In addition, bookmarks now create a span between the start+ and end of the bookmark, rather than an empty span.++ * Docx reader:++ + Avoid blockquote when parent style has more indent (Milan Bracke).+ When a paragraph has an indentation different from the parent (named)+ style, it used to be considered a blockquote. But this only makes sense+ when the paragraph has more indentation. So this commit adds a check+ for the indentation of the parent style.+ + Fix handling of empty fields (Milan Bracke). Some fields only+ have an `instrText` and no content, Pandoc didn't understand these,+ causing other fields to be misunderstood because it seemed like+ a field was still open when it wasn't.+ + Implement PAGEREF fields (Milan Bracke). These fields, often used+ in tables of contents, can be a hyperlink.+ + Fix handling of nested fields (Milan Bracke). Fields delimited by+ `fldChar` elements can contain other fields. Before, the nested+ fields would be ignored, except for the end, which would be+ considered the end of the parent field.+ + Add placeholder for word diagram instead of just omitting it (Ezwal).++ * Org reader:++ + Don't parse a list as first item in a list item (#7557).+ + Allow an initial `:PROPERTIES:` drawer to add to metadata (#7520).++ * Docx writer:++ + Make id used in `native_numbering` predictable (#7551).+ If the image has the id IMAGEID, then we use the id ref_IMAGEID+ for the figure number. This allows one to create a filter that+ adds a figure number with figure name, e.g.+ `<w:fldSimple w:instr=" REF ref_superfig "><w:r><w:t>Figure X</w:t>+ </w:r></w:fldSimple>`.+ If an image lack an id, an id of the form `ref_fig1` is used.+ + Ensure we have unique ids for `wp:docPr` and `pic:cNvPr` elements+ (#7527, #7503).+ + Handle SVG images (#4058). This change has several parts:+ - In Text.Pandoc.App, if the writer is docx, we fill the media+ bag and attempt to convert any SVG images to PNG, adding these+ to the media bag. The PNG backups have the same filenames as+ the SVG images, but with an added .png extension. If the conversion+ cannot be done (e.g. because rsvg-convert is not present),+ a warning is omitted.+ - In Text.Pandoc.Writers.Docx, we now use Word 2016's syntax for+ including SVG images. If a PNG fallback is present in the media bag,+ we include a link to that too.++ * Powerpoint writer (Emily Bourke):++ + Add support for more layouts (#5097). Up til now, four layouts+ were supported: "Title Slide" (used for the automatically generated+ metadata slide), "Section Header" (used for headings above slide+ level), "Two Column" (used when there's a columns div), "Title and+ Content" (used for all other slides). We now support three+ additional layouts: "Comparison", "Content with Caption", and+ "Blank". The manual describes the logic that determines which+ layout is used for a slide. Layouts may be customized in the+ reference doc.+ + Support specifying slide background images using a `background-image`+ attribute on the slide's heading. Only the "stretch" mode is supported,+ and the background image is centred around the slide in the image's+ larger axis, matching the observed default behaviour of PowerPoint.+ + Add support for incremental lists (through same methods as in+ other slide writers) (#5689).+ + Copy embedded fonts from reference doc.+ + Include all themes in output archive.+ + Fix list level numbering (#4828, #4663). In PowerPoint,+ the content of a top-level list is at the same level as the content+ of a top-level paragraph: the only difference is that a list style+ has been applied. Previously, the writer incremented the paragrap+ h level on each list, turning what should be top-level lists into+ second-level lists.+ + Line up list continuation paragraphs. This commit+ changes the `marL` and `indent` values used for plain paragraphs+ and numbered lists, and changes the spacing defined in the+ reference doc master for bulleted lists. For paragraphs, there is+ now a left-indent taken from the `otherStyle` in the master.+ For numbered lists, the number is positioned where the text would be+ if this were a plain paragraph, and the text is indented to the next+ level. This means that continuation paragraphs line up nicely with+ numbered lists. Existing reference docs may need to be modified so+ that `otherStyle` and `bodyStyle` indent levels match, for this+ feature to work with them.+ + Consolidate text runs when possible (jgm). This slims down the output+ files by avoiding unnecessary text run elements.+ + Support footers in the reference doc.+ There is one behaviour which may not be immediately obvious: if the+ reference doc specifies a fixed date (i.e. not automatically updating),+ and there’s a date specified in the metadata for the document, the+ footer date is replaced by the metadata date.+ + Fix presentation rel numbering. Before now, the numbering of `rId`s+ was inconsistent when making the presentation XML and when making+ the presentation relationships XML.+ + Don’t add relationships unnecessarily. Before now, for any layouts+ added to the output from the default reference doc, the relationships+ were unconditionally added to the output. However, if there was already+ a layout in slideMaster1 at the same index then that results in+ duplicate relationships.+ + If slide level is 0, don't insert a slide break between a heading+ and a following table, "columns" div, or paragraph starting+ with an image.+ + Fix capitalisation of `notesMasterId`.+ + Restructure tests.++ * Asciidoc writer:++ + Translate numberLines attribute to `linesnum` switch (Samuel Tardieu).+ + Improve escaping for `--` in URLs (#7529).++ * LaTeX writer:++ + Make babel use more idiomatic (#7604, hseg). Use babel's+ bidi implementation. Import babel languages individually instead+ of as package options. Move `header-includes` to after+ `babel` setup so it can be modified.+ + Use babel, not polyglossia, with xelatex. Previously polyglossia+ worked better with xelatex, but that is no longer the case, so+ we simplify the code so that babel is used with all latex+ engines. This involves a change to the default LaTeX template.++ * Markdown writer:++ + Avoid bad wraps at the Doc Text level. Previously we tried to+ do this at the Inline list level, but it makes more sense to+ intervene on breaking spaces at the Doc Text level.+ + Use `underline` class rather than `ul` for underline.+ This only affects output with `bracketed_spans` enabled.+ The markdown reader parses spans with either `.ul` or `.underline` as+ Underline elements, but we're moving towards preferring the latter.++ * RST writer:++ + Properly handle anchors to ids with spaces or leading underscore+ (#7593). In this cases we need the quoted form, e.g.+ ```+ .. _`foo bar`:++ .. _`_foo`:+ ```+ Side note: rST will "normalize" these identifiers anyway,+ ignoring the underscore.++ * HTML writer:++ + Render `\ref` and `\eqref` as inline math, not display (see #7589).+ + Pass through `\ref` and `\eqref` if MathJax is used (#7587).+ + Pass through inline math environments with KaTeX.+ + Support `--reference-location` for HTML output (#7461,+ Francesco Mazzoli).+ + Set "hash" to True by default (for reveal.js) (#7574). See #6968+ where the motivation for setting "hash" to True is explained.++ * Native writer: Use pretty-show to format native output (#7580).+ Previously we used our own homespun formatting. But this produces+ over-long lines that aren't ideal for diffs in tests.+ Performance is slower by about a factor of 10, but this isn't+ really a problem because native isn't suitable as a serialization+ format. (For serialization you should use json, because the reader+ is so much faster than native.)++ * Org writer:++ + Don't indent contents of code blocks. We previously indented them+ by two spaces, following a common convention. Since the convention+ is fading, and the indentation is inconvenient for copy/paste, we are+ discontinuing this practice.+ + Update list of supported source languages in org writer (#5440).++ * Ipynb writer (Kolen Cheung):++ + Improve round trip identity for raw cell output.+ See jupyter/nbformat#229. The Jupyter ecosystem, including nbconvert,+ lab and notebook, deviated from their own spec in nbformat, where+ they used the key `raw_mimetype` instead of `format`. Moreover,+ the mime-type of rst used in Jupyter deviated from that suggested by+ https://docutils.sourceforge.io/FAQ.html and is defined as+ `text/restructuredtext` when chosen from "Raw NBConvert Format" in+ Jupyter. The new behavior should matche the real world usage better,+ hence improving the round-trip "identity" in raw-cell.+ + Add more formats that can be handled as "raw" cells.++ * EPUB writer:++ + Add EPUB3 subject metadata (authority/term) (nuew).+ This adds the ability to specify EPUB 3 `authority` and `term` specific+ refinements to the `subject` tag. Specifying a plain `subject` tag in+ metadata will function as before.+ + Treat epub:type "frontispiece" as front matter (#7600).++ * reveal.js template: Fix line numbers in source code (#7634).+ We need `overflow: visible` for these to work, and reveal's+ default css disables this. So we re-enable it in the default template.++ * Text.Pandoc.Writers.Shared:++ + Export `splitSentences` as a Doc Text transform [API change].+ Use this in man/ms. We used to attempt automatic sentence+ splitting in man and ms output, since sentence-ending+ periods need to be followed by two spaces or a newline in+ these formats. But it's difficult to do this reliably at+ the level of `[Inline]`.++ * Text.Pandoc.Translations: small revisions for compatibility+ with aeson 2.++ * Don't prepend `file://` to `--syntax-definition` on Windows (#6374).+ This was a fix for a problem in skylighting, but this+ problem doesn't exist now that we've moved from HXT to xml-conduit.++ * Text.Pandoc.Extensions:++ + Add `Ext_footnotes` to default `gfm` etxensions. Now `gfm`+ supports footnotes.+ + Alphabetize Extension constructors (also affects `--list-extensions`).++ * Text.Pandoc.Citeproc.Util: Better implementation of `splitStrWhen`.+ Previously the citeproc code had two less efficient+ implementations.++ * Update documentation for definition_list extension (#7594).+ In 2015, we relaxed indentation requirements for the first+ line of a definition (see commit d3544dc and issue #2087), but+ the documnentation wasn't updated to reflect the change.++ * Text.Pandoc.Citeproc.BibTeX: Fix expansion of special strings in series+ e.g. `newseries` or `library` (#7591). Expansion should not happen+ when these strings are protected in braces, or when they're+ capitalized.++ * Text.Pandoc.Logging: add `NotUTF8Encoded` constructor to `LogMessage`+ [API change].++ * Text.Pandoc.App.FormatHeuristics: remove `.tei.xml` extension for TEI+ (#7630). This never worked, because `takeExtension`+ only returns `.xml`. So it won't be missed if we remove it.++ * Text.Pandoc.Image:++ + Generalize `svgToPng` to MonadIO.+ + `svgToPng`, change first parameter from WriterOptions to Int.++ * Text.Pandoc.Class:++ + Add `readStdinStrict` method to PandocMonad [API change].+ + Generalize type of `extractMedia` [API change].+ It was uselessly restricted to PandocIO, instead of any+ instance of PandocMonad and MonadIO.++ * Text.Pandoc.Class.PandocIO: derive MonadCatch, MonadThrow, MonadMask.+ This allows us to use `withTempDir` [API change].++ * Add module Text.Pandoc.Class.Sandbox, defining+ `sandbox`. Exported via Text.Pandoc.Class. [API change]++ * Text.Pandoc.Filter: Generalize type of `applyFilters`+ from PandocIO to any instance of MonadIO and PandocMonad [API change].++ * Text.Pandoc.PDF: generalize type of `makePDF`:+ instead of PandocIO, it can be used in any instance of+ PandocMonad, MonadIO, and MonadMask [API change].++ * Lua subsystem and custom writers: generalize types from PandocIO+ to any instance of PandocMonad and MonadIO [API change].+ The type of `runLua` is now++ (PandocMonad m, MonadIO m) =>+ LuaE PandocError a -> m (Either PandocError a)++ The change from `Lua` to `LuaE PandocError` is due to the switch to+ hslua-2.0; see next item.++ * Lua modules (Albert Krewinkel):++ + Switch to hslua-2.0. The new HsLua version takes a somewhat different+ approach to marshalling and unmarshalling, relying less on typeclasses+ and more on specialized types. This allows for better performance and+ improved error messages. Furthermore, new abstractions allow to+ document the code and exposed functions.+ + Marshal Version values, Inline elements, Attr elements,+ and Pandoc elements as userdata.+ + Remove deprecated inline constructors `DoubleQuoted`,+ `SingleQuoted`, `DisplayMath`, and `InlineMath`.+ + Attr values are no longer normalized when assigned to an Inline+ element property.+ + It's no longer possible to access parts of Inline elements via+ numerical indexes. E.g., `pandoc.Span('test')[2]` used to give+ `pandoc.Str 'test'`, but yields `nil` now. This was undocumented+ behavior not intended to be used in user scripts. Use named properties+ instead.+ + Accessing `.c` to get a JSON-like tuple of all components no longer+ works. This was undocumented behavior.+ + Only known properties can be set on an element value. Trying to set a+ different property will now raise an error.+ + Adds a new `pandoc.AttributeList()` constructor, which creates the+ associative attribute list that is used as the third component of+ `Attr` values. Values of this type can often be passed to constructors+ instead of `Attr` values.+ + Convert IOErrors to PandocErrors in `pandoc.pipe` function (#7523).++ * Text.Pandoc.PDF: Previously we had to run `runIOorExplode` inside+ `withTempDir`. Now that PandocIO is an instance of MonadMask, this is+ no longer necessary.++ * Text.Pandoc.App:++ + Reorganize to make it easier to limit IO in main loop.+ Previously we used liftIO fairly liberally. The code has+ been restructured to avoid this.+ + Move output-file writing out of PandocMonad action.++ * Text.Pandoc.App.OutputSettings: Generalize some types+ so we can run this with any instance of PandocMonad and MonadIO,+ not just PandocIO.++ * Use `simpleFigure` builder in readers and `SimpleFigure`+ pattern synonym in writers (Aner Lucero).++ * Allow time 1.12.++ * Use skylighting-0.12, skylighting-core-0.12.+ This fixes highlighting issues with typescript, scala, and other+ syntaxes that include keyword lists from different syntaxes.++ * Use citeproc 0.6, commonmark 0.2.2.1, commonmark-extensions 0.2.2,+ texmath 0.12.3.2, ipynb 0.1.0.2. (These changes also allow+ building with aeson >= 2.)++ * Require doclayout >= 0.3.1.1. This fixes recognition of "real widths"+ of emoji characters, which is important for tabular layout.++ * Cut out over 100K of fat in epub test golden files.++ * Make `test/epub/wasteland.epub` valid.++ * Add missing `%` on some command tests.+ This prevented `--accept` from working properly.++ * Command tests: raise error if command doesn't begin with `%`.++ * OOXML tests: use pretty-printed form to display diffs.+ Otherwise everything is on one line and the diff is uninformative.++ * Fix compareXML helper in Tests.Writers.OOXML.+ Given how it is used, we were getting "mine" and "good"+ flipped in the test results.++ * MANUAL.txt:++ + Clarify `attributes` extension support (William Lupton).+ + Document formats affected by `--reference-location`.+ + Document error code 25+ + Add some more info regarding `--slide-level=0` (Salim B).+ + Add more to security section of manual.+ + Mention support of `title-toc` (#7171, Christophe Dervieux).++ * doc/lua-filters.md:++ + Add missing type for Image title (Quinn).+ + Improve order of Image fields (Quinn).+ + Rephrase pandoc.path docs (#7548, Quinn).+ + Do not leak working directory in TikZ filter (Jeroen de Haas).++## pandoc 2.14.2 (2021-08-21)++ * Allow `--slide-level=0` (#7476). When the slide level is set+ to 0, headings won't be used at all in splitting the document+ into slides. Horizontal rules must be used to separate slides.++ * Add RTF reader (#3982). `rtf` is now supported as an input+ format as well as an output format. New module+ Text.Pandoc.Readers.RTF (exporting `readRTF`). [API change]++ * HTML reader: treat comments as blank when parsing (#7482).++ * Markdown reader:++ + Fix raw LaTeX injection issue (#7497). Using a code block+ containing `\end{verbatim}`, one could inject raw TeX into a+ LaTeX document even when `raw_tex` is disabled. Thanks to+ Augustin Laville for noticing the bug.+ + Multimarkdown sub- and superscripts (#5512, OCzarnecki).+ Added an extension `short_subsuperscripts` which modifies+ the behavior of `subscript` and `superscript`, allowing+ subscripts or superscripts containing only alphanumerics+ to end with a space character (eg. `x^2 = 4` or `H~2 is+ combustible`). This improves support for multimarkdown.++ * RST reader: Fix `:literal:` includes (#7513). These should create+ code blocks, not insert raw RST.++ * LaTeX reader:++ + Proper implicit grouping around environment macros.+ + Support `\global` before `\def`, `\let`, etc. (#7494).+ + Fix scope for LaTeX macros (#7494). They should by default+ scope over the group in which they are defined (except `\gdef`+ and `\xdef`, which are global). In addition, environments must+ be treated as groups.+ + Improve handling of plain TeX macro primitives (#7474).+ Fixed semantics for `\let`.+ + Implement `\edef`, `\gdef`, and `\xdef`.++ * Docx reader: Improve docx reader's robustness in extracting+ images (#7511). The docx reader made some assumptions about+ how docx containers were laid out that were not always true, with+ the result that some images in documents did not get+ extracted.++ * LaTeX writer: Increase table column width precision (#7466,+ Peter Fabinski). In some cases, the rounding performed by the+ LaTeX table writer would introduce visible overrun outside+ the text area. This adds two more decimal places to the width+ values.++ * Powerpoint writer:++ + Include image title in description (#7352, Emily Bourke). The+ image title (i.e. ``) was previously+ ignored when writing to pptx. This commit includes it in+ PowerPoint's description of the image, along with the link.+ + Select layouts from reference doc by name (Emily Bourke). Until+ now, users had to make sure that their reference doc contains+ layouts in a specific order: the first four layouts in the file+ had to have a specific structure. Now the layout selection uses+ the layout names rather than order: users must make sure their+ reference doc contains four layouts with specific names, and if+ a layout with the right name isn’t found pandoc will emit+ a warning and use the corresponding layout from the default+ reference doc as a fallback.++ * Docx writer: be sensitive to the `native_numbering` extension+ (#7499). Figure and table numbers are now only included if+ `native_numbering` is enabled. (By default it is disabled.)+ This is a behavior change with respect to 2.14.1, but the+ default behavior is now that of previous versions. The+ change was necessary to avoid incompatibilities between+ pandoc's native numbering and third-party cross reference+ filters like pandoc-crossref.++ * RTF writer:++ + Omit `\bin` in `\pict`. According to the spec, this is not+ needed or wanted when the data is in hexadecimal format, as+ here.+ + Emit `\outlinelevel`` for section headings.++ * RTF template: specify font family for fixed-width font f1.+ According to the spec, this is mandatory.++ * LaTeX writer: Use ulem for underline (#7351). ulem is+ conditionally included already when the `strikeout` variable+ is set, so we set this when there is underlined text, and use+ `\uline` instead of `\underline`. This fixes wrapping for+ underlined text.++ * Text.Pandoc.Citeproc:++ + Revise citeproc code to fit new citeproc 0.5 API (thanks to+ Benjamin Bray). Linkification of URLs in the bibliography+ is now done in the citeproc library, depending on the+ setting of an option. We set that option depending on the+ value of the metadata field `link-bibliography` (defaulting+ to true, for consistency with earlier behavior). If a DOI,+ PMID, PMCID, or URL field is present but not explicitly+ rendered, the title (or if no title, the whole entry) is+ hyperlinked. These changes implement the recommendations+ from the draft CSL v1.0.2 spec (Appendix VI):+ <https://github.com/citation-style-language/documentation/blob/master/specification.rst#appendix-vi-links>+ + Avoid odd handling of quotes. Recent citeproc changes+ allow us to ignore Quoted elements; citeproc now uses its own+ method for represented quoted things, and only localizes and+ flipflops quotes it adds itself. Convert Quoted in bib+ entries to special Spans before passing them off to+ citeproc. This ensures that we get proper localization and+ flipflopping if, e.g., quotes are used in titles+ (jgm/citeproc#87).+ + Removed quote localization from citeproc processing.+ This is now done in citeproc itself.++ * Text.Pandoc.Logging: Add PowerpointTemplateWarning log message+ type [API change] (Emily Bourke).++ * Text.Pandoc.Extension: Add `Ext_short_subsuperscripts`+ constructor to `Extension` [API change] (OCzarnecki).++ * Various sample.lua editorial fixes (#7493, #7487, William+ Lupton).++ * Bump base-compat version so we get compatibility with base 4.12.++ * Use Prelude from base-compat for ghc 8.4 too.++ * Add haskell-language-server to shell.nix (#7496, Emily Bourke).++ * Tests.Helpers: export testGolden and use it in RTF reader.+ This gives a diff output on failure.++ * Remove obsolete and incorrect sentence in `--slide-level` docs.++ * Add internal module Text.Pandoc.Network.HTTP, exporting+ `urlEncode`.++ * Text.Pandoc.Parsing: `parseFromString`: preserve at least+ the source directory (#7464). Previously we just set the+ source name to "chunk" when parsing from strings, to avoid+ misleading source positions. This had the side effect that+ `rebase_relative_paths` would break inside sections that+ were parsed as strings. So, now we use+ "ORIGINAL_SOURCE_PATH_chunk" instead of just "chunk".++ * Text.Pandoc.MIME: use image/x-xcf instead of application/x-xcf+ (#7454).++ * Don’t compare `cdLine` in OOXML golden tests (Emily Bourke).+ The `cdLine` field gives the line of the file some CData was+ found on, which reflects irrelevant formatting differences.++ * Provide more detailed XML diff in tests (Emily Bourke).++ * OOXML tests: silence warnings. These can make the test output+ confusing, making people think tests are failing when they're+ passing.++ * INSTALL.md: Add GitLab CI/CD example (#7448, Veratyr).++ * MANUAL.txt++ - Clarifications (William Lupton).+ - Add a note on security risks of include directives.++ * Document use of the 'underline' class (#7492, #7484, William+ Lupton).++ * Add a FAQ about the "Cannot allocate memory" error on M1 macs.++ * Use texmath 0.12.3.1.++ * Use released citeproc 0.5.++ * Remove dependency on HTTP package (#7456, mt_caret).++## pandoc 2.14.1 (2021-07-18)++ * Text.Pandoc.ImageSize: Add Tiff constructor for ImageType (#7405)+ [Minor API change]. This allows pandoc to get size information from+ tiff images.++ * Markdown reader: don't try to read contents in self-closing HTML tag.+ Previously we had problems parsing raw HTML with self-closing+ tags like `<col/>`. The problem was that pandoc would look+ for a closing tag to close the markdown contents, but the+ closing tag had, in effect, already been parsed by `htmlTag`.++ * LaTeX reader:++ + Avoid trailing hyphen in translating languages (#7447).+ Previously `\foreignlanguage{english}` turned into `<span lang="en-">`.+ The same issue affected Arabic.+ + Support `\cline` in LaTeX tables (#7442).+ + Improved parsing of raw LaTeX from Text streams (`rawLaTeXParser`,+ used to read LaTeX in Markdown files, #7434). We now use source+ positions from the token stream to tell us how much of the text stream+ to consume. Getting this to work required a few other changes to+ make token source positions accurate.++ * DocBook reader:++ + Handle images with imageobjectco elements (#7440).+ + Add support for citerefentry (#7437, Jan Tojnar).++ * RST reader: fix regression with code includes (#7436).+ With the recent changes to include infrastructure,+ included code blocks were getting an extra newline.++ * HTML reader:++ + Recognize data-external when reading HTML img tags (#7429,+ Michael Hoffmann). Preserve all attributes in img tags. If attributes+ have a `data-` prefix, it will be stripped. In particular, this+ preserves a `data-external` attribute as an `external` attribute in+ the pandoc AST.+ + Add col, colgroup to 'closes' definitions++ * HTML writer:++ + Remove duplicated alt text in HTML output (Aner Lucero).+ + Remove `aria-hidden` when explicit alt text is provided (Aner Lucero).+ + Set boolean values for reveal.js variables.++ * Docx writer:++ + Add table numbering for captioned tables.+ The numbers are added using fields, so that Word can+ create a list of tables that will update automatically.+ + Support figure numbers. These are set up in such a way that they+ will work with Word's automatic table of figures (#7392).++ * Markdown writer: put space between Plain and following fenced Div+ (#4465).++ * EPUB writer: Don't incorporate externally linked images in EPUB documents+ (#7430, Michael Hoffmann). Just as it is possible to avoid incorporating+ an image in EPUB by passing `data-external="1"` to a raw HTML snippet,+ this makes the same possible for native Images, by looking for an+ associated `external` attribute.++ * Text.Pandoc.PDF:++ + Fix `svgIn` path error (#7431). We were duplicating+ the temp directory; this didn't cause problems on macOS or linux+ because there we use absolute paths for the temp directory.+ But on Windows it caused errors converting SVG files.+ + `convertImage`: normalize paths (#7431). This will avoid paths+ on Windows with mixed path separators.++ * Text.Pandoc.Class: Always use / when adding directory to image destination+ with `extractMedia`, even on Windows.++ * Text.Pandoc.Citeproc:++ + Allow `$` characters in bibtex keys (#7409).+ + Set proper initial source name in parsing BibTeX (for better error+ messages.)+ + Revamp note citation handling (#7394). Use latest+ citeproc, which uses a Span with a class rather than a Note for notes.+ This helps us distinguish between user notes and citation notes. Don't+ put citations at the beginning of a note in parentheses. Fix small bug+ in handling of citations in notes, which led to commas at the end of+ sentences in some cases.+ + Cleanup and efficiency improvement in `deNote`.+ + Improve punctuation moving with `--citeproc`. Previously, using+ `--citeproc` could cause punctuation to move in quotes even when+ there aer no citations. This has been changed; punctuation moving+ is now limited to citations. In addition, we only move footnotes+ around punctuation if the style is a note style, even if+ `notes-after-punctuation` is `true`.++ * Use citeproc 0.10. This helps improve note citations (see above)+ and eliminates double hyperlinks in author-in-text citations.+ Author-only citations are no longer hyperlinked. See jgm/citeproc#77.+ It also fixes moving of punctuation inside quotes to conform to+ the CSL spec: only comma and period are moved, not question+ mark or exclamation point.++ * Text.Pandoc.Error: fix line calculations in reporting parsec errors.+ Also remove a spurious initial newline in the error report.++ * Use doctemplates 0.4.1, which gives us better support for boolean+ variable values. Previously `$if(foo)$` would evaluate to true+ for variables with boolean `false` values, because it cared only+ about the string rendering (#7402).++ * Require commonmark-pandoc >= 0.2.2.1.+ This fixes task lists with multiple paragraphs.++ * Use skylighting 0.11.++ * CSS in HTML template: reset overflow-wrap on code blocks+ (Mauro Bieg, #7423).++ * LaTeX template: Revert change in PR #7295: "move title, author, date up+ to top of preamble." The change caused problem for people who used+ LaTeX commands defined defined later in the preamble in the title+ or author fields (#7422).++ * Add `doc/faqs.md`. This is imported from the website; in the future the+ website version will be drawn from here.+ Added a FAQ on the use of `\AtEndPreamble` for cases when the contents of+ `header-includes` need to refer to definitions that come later in the+ preamble. See #7422.++ * Upgrade Debian 10 AMI for build-arm.sh.++ * CircleCI: change to using xcode 11.1.0 (macOS 10.14.4).+ We previously built on 10.13, but 10.13 no longer gets+ security updates and CirclCI is deprecating.++## pandoc 2.14.0.3 (2021-06-22)++ * Text.Pandoc.MediaBag `insertMediaBag`: ensure we get a sane mediaPath+ for URLs (#7391). In earlier 2.14.x versions, we'd get+ incorrect paths for resources downloaded from URLs when the+ media are extracted (including in PDF production).+ * Text.Pandoc.Parsing: improve `emailAddress` (#7398).+ Previously the parser would accept characters in domains+ that are illegal in domains, and this sometimes caused it+ to gobble bits of the following text.+ * txt2tags reader: modify the email address parser so+ it still includes form parameters, even after the change to+ `emailAddress` in Text.Pandoc.Parsing.+ * Text.Pandoc.Readers.Metadata: Fix regression with comment-only YAML+ metadata blocks (#7400).+ * reveal.js writer and template: better handling of options. Previously+ it was impossible to specify false values for options that default to+ true (e.g. `center`); setting the option to false just caused the portion+ of the template setting the option to be omitted. Now we prepopulate+ all the variables with their default values, including them all+ unconditionally and allowing them to be overridden.+ * Markdown writer: Fix regression in code blocks with attributes (#7397).+ Code blocks with a single class but nonempty attributes+ were having attributes drop as a result of #7242.+ * LaTeX writer:+ + Add strut at end of minipage if it contains line breaks.+ Without them, the last line is not as tall as it should be in+ some cases.+ + Always use a minipage for cells with line breaks, when+ width information is available (#7393). Otherwise the way we treat them+ can lead to content that overflows a cell.+ + Use `\strut` instead of `~` before `\\` in empty line.+ * Use lts-18.0 stack resolver.+ * Require skylighting 0.10.5.2 (adding support for Swift).+ * Require commonmark 0.2.1.+ * Rephrase section on unsafe HTML in manual.+ * Create SECURITY.md++## pandoc 2.14.0.2 (2021-06-13)++ * Fix MediaBag regressions (#7345). iIn the 2.14 release `--extract-media`+ stopped working as before; there could be mismatches between the+ paths in the rendered document and the extracted media.+ This patch makes several changes that restore the earlier behavior+ (while keeping the same API). The `mediaPath` in 2.14 was always+ constructed from the SHA1 hash of the media contents. Now, we+ preserve the original path unless it's an absolute path or contains+ `..` segments (in that case we use a path based on the SHA1 hash of+ the contents).++ In Text.Pandoc.MediaBag, `mediaDirectory` and `mediaItems` now use the+ `mediaPath`, rather than the mediabag key, for the first component of the+ tuple. This makes more sense, I think, and fits with the documentation of+ these functions; eventually, though, we should rework the API so that+ `mediaItems` returns both the keys and the MediaItems.++ In Text.Pandoc.Class.IO, rewriting of source paths in `extractMedia` has+ been fixed.++ In Text.Pandoc.Class.PandocMonad, `fillMediaBag` has been modified so that+ it doesn't modify image paths (that was part of the problem in #7345).++ We now do path normalization (e.g. `\` separators on Windows) in+ writing the media.++ * Text.Pandoc.PDF:++ + Text.Pandoc.PDF: Fix regression in 2.14 for generation of PDFs with+ SVGs (#7344).+ + Only print relevant part of environment on `--verbose`. Since+ `--verbose` output might be put in an issue, we want to avoid+ spilling out secrets in environment variables.++ * Markdown reader: fix pipe table regression in 2.11.4 (#7343).+ Previously pipe tables with empty headers (that is, a header+ line with all empty cells) would be rendered as headerless+ tables. This broke in 2.11.4. The fix here is to produce an+ AST with an empty table head when a pipe table has all empty+ header cells.++ * LaTeX reader: don't allow optional `*` on symbol control sequences+ (#7340). Generally we allow optional starred variants of LaTeX commands+ (since many allow them, and if we don't accept these explicitly,+ ignoring the star usually gives acceptable results). But we+ don't want to do this for `\(*\)` and similar cases.++ * Docx reader: handle absolute URIs in Relationship Target (#7374).++ * Docx writer: fix handling of empty table headers (Albert Krewinkel,+ #7369). A table header which does not contain any cells is now treated as+ an empty header.++ * LaTeX writer: Fix regression in table header position (#7347).+ In recent versions the table headers were no longer bottom-aligned+ (if more than one line). This patch fixes that by using minipages+ for table headers in non-simple tables.++ * CommonMark writer:++ + Do not use simple class for fenced-divs (Jan Tojnar, amends #7242.)+ + Do not throw away attributes when `Ext_attributes` is enabled.+ `Ext_attributes` covers at least the following:+ `Ext_fenced_code_attributes`, `Ext_header_attributes`,+ `Ext_inline_code_attributes`, `Ext_link_attributes`.++ * Markdown writer:++ + Allow `pipe_tables` to be disabled for commonmark formats+ (`commonmark_x`, `gfm`) (#7375).+ + Re-use functions from Text.Pandoc.Markdown.Inline (Jan Tojnar).++ * DocBook writer: Remove non-existent admonitions (Jan Tojnar).+ `attention`, `error` and `hint` are reStructuredText specific.++ * HTML writer: Don't omit width attribute on div (#7342).++ * Text.Pandoc.MIME, `extensionFromMimeType`: add a few special cases.+ When we do a reverse lookup in the MIME table, we just get the+ last match, so when the same mime type is associated with several+ different extensions, we sometimes got weird results, e.g. `.vs`+ for `text/plain`. These special cases help us get the most standard+ extensions for mime types like `text/plain`.++ * Lua utils: fix handling of table headers in `from_simple_table` (Albert+ Krewinkel, #7369). Passing an empty list of header cells now results+ in an empty table header.++ * Text.Pandoc.Citeproc:++ + Avoid duplicate classes and attributes on references div.+ + Fix regression in citeproc processing (#7376). If inline+ references are used (in the metadata `references` field), we+ should still only include in the bibliography items that are+ actually cited (unless `nocite` is used).++ * Require citeproc 0.4.0.1. This fixes a bug which led to doubled+ "et al." in some (rare) circumstances.++ * MANUAL.txt:++ + Mention GladTeX for EPUB export (Sebastian Humenda).+ This updates the manual and the web site about the GladTeX usage.+ + More details and a useful link for YAML syntax.++ * CONTRIBUTING.md: update modules overview (Albert Krewinkel).++ * using-the-pandoc-api.md: switch from String to Text (Albert Krewinkel).+++## pandoc 2.14.0.1 (2021-06-01)++ * Commonmark reader: Fix regression in 2.14 with YAML metdata block parsing,+ which could cause the document body to be omitted after metadata (#7339).++ * HTML reader: fix column width regression in 2.14 (#7334).+ Column widths specified with a style attribute were off by a factor of 100.++ * Markdown reader: in `rebasePaths`, check for both Windows and Posix+ absolute paths. Previously Windows pandoc was treating+ `/foo/bar.jpg` as non-absolute.++ * Text.Pandoc.Logging: In rendering `LoadedResource`, use relative paths.++ * Docx writer: fix regression on captions (#7328). The "Table Caption"+ style was no longer getting applied. (It was overwritten by "Compact.")++ * Use commonmark-extensions 0.2.1.2++## pandoc 2.14 (2021-05-28)++ * Change reader types, allowing better tracking of source positions+ [API change]. Previously, when multiple file arguments were provided,+ pandoc simply concatenated them and passed the contents to the readers,+ which took a Text argument. As a result, the readers had no way of knowing+ which file was the source of any particular bit of text. This meant that+ we couldn't report accurate source positions on errors or include accurate+ source positions as attributes in the AST. More seriously, it meant that+ we couldn't resolve resource paths relative to the files containing them+ (see e.g. #5501, #6632, #6384, #3752).++ * Add `rebase_relative_paths` extension (#3752). When enabled, this+ extension rewrites relative image and link paths by prepending+ the (relative) directory of the containing file. This+ behavior is useful when your input sources are split+ into multiple files, across several directories, with files+ referring to images stored in the same directory. The+ extension can be enabled for all markdown and commonmark-based formats.++ * Add Text.Pandoc.Sources (exported module), with a `Sources` type and a+ `ToSources` class. A `Sources` wraps a list of `(SourcePos, Text)` pairs+ [API change]. A parsec `Stream` instance is provided for `Sources`. The+ module also exports versions of parsec's `satisfy` and other Char parsers+ that track source positions accurately from a `Sources` stream (or any+ instance of the new `UpdateSourcePos` class).++ * Text.Pandoc.Parsing++ + Export the modified Char parsers defined in Text.Pandoc.Sources+ instead of the ones parsec provides. Modified parsers to use a+ `Sources` as stream [API change].+ + Improve include file functions [API change]. Remove old+ `insertIncludedFileF`. Give `insertIncludedFile` a more general type,+ allowing it to be used where `insertIncludedFileF` was.+ + Add parameter to the `citeKey` parser from+ Text.Pandoc.Parsing, which controls whether the `@{..}`+ syntax is allowed [API change].++ * Text.Pandoc.Error: Modified the constructor `PandocParsecError` to take a+ `Sources` rather than a `Text` as first argument, so parse error locations+ can be accurately reported.++ * Fix source position reporting for YAML bibliographies (#7273).++ * Issue error message when reader or writer format is malformed+ (#7231). Previously we exited with an error status but (due to a bug)+ no message.++ * Smarter smart quotes (#7216, #2103). Treat a leading `"` with no+ closing `"` as a left curly quote. This supports the practice, in+ fiction, of continuing paragraphs quoting the same speaker without an+ end quote. It also helps with quotes that break over lines in line blocks.++ * Markdown reader:++ + Use MetaInlines not MetaBlocks for multimarkdown metadata fields.+ This gives better results in converting to e.g. pandoc markdown.+ + Implement curly-brace syntax for Markdown citation keys (#6026).+ The change provides a way to use citation keys that contain+ special characters not usable with the standard citation key syntax.+ Example: `@{foo_bar{x}'}` for the key `foo_bar{x}`. It also allows+ separating citation keys from immediately following text, e.g. `@{foo}A`.++ * RST reader:++ + Seek include files in the directory of the file+ containing the include directive, as RST requires (#6632).+ + Use `insertIncludedFile` from Text.Pandoc.Parsing+ instead of reproducing much of its code.++ * Org reader: Resolve org includes relative to the directory containing the+ file containing the INCLUDE directive (#5501).++ * ODT reader: Treat tabs as spaces (#7185, niszet).++ * Docx reader:++ + Add handling of vml image objects (#7257, mbrackeantidot).+ + Support new table features (Emily Bourke, #6316): column+ spans, row spans, multiple header rows, table description+ (parsed as a simple caption), captions, column widths.++ * LaTeX reader:++ + Improved siunitx support (#6658, #6620).+ + Better support for `\xspace` (#7299).+ + Improve parsing of `\def` macros. We previously set "verbatim mode"+ even for parsing the initial `\def`; this caused problems+ for `\def` nested inside another `\def`.+ + Implement `\newif`.++ * ConTeXt writer: improve ordered lists (#5016, Denis Maier).+ Change ordered list from itemize to enumerate. Add new+ itemgroup for ordered lists. Remove manual insertion of+ width attributes. Use tabular figures in ordered list+ enumerators.++ * HTML reader:++ + Don't fail on unmatched closing "script" tag (Albert Krenkel, #7282).+ + Keep h1 tags as normal headers (#2293, Albert Krewinkel).+ The tags `<title>` and `<h1 class="title">` often contain the same+ information, so the latter was dropped from the document. However, as+ this can lead to loss of information, the heading is now always+ retained. Use `--shift-heading-level-by=-1` to turn the `<h1>`+ into the document title, or a filter to restore the previous behavior.+ + Handle relative lengths (e.g. `2*`) in HTML column widths (#4063).+ See <https://www.w3.org/TR/html4/types.html#h-6.6>.++ * DocBook/JATS readers:++ + Fix mathml regression caused by the switch in XML libraries (#7173).+ + Fix "phrase" in DocBook: take classes from "role" not "class" (#7195).++ * DocBook reader: ensure that first and last names are separated (#6541).++ * Jira reader (Albert Krewinkel, #7218):++ + Support "smart" links: `[alias|https://example.com|smart-card]` syntax.+ + Allow spaces and most unicode characters in attachment links.+ + No longer require a newline character after `{noformat}`.+ + Only allow URI path segment characters in bare links.+ + The `file:` schema is no longer allowed in bare links; these+ rarely make sense.++ * Plain writer: handle superscript unicode minus (#7276).++ * LaTeX writer:++ + Better handling of line breaks in simple tables (#7272).+ Now we also handle the case where they're embedded in other elements,+ e.g. spans.+ + For beamer output, support `exampleblock` and `alertblock` (#7278).+ A block will be rendered as an `exampleblock` if the heading+ has class `example` and an `alertblock` if it has class `alert`.+ + Separate successive quote chars with thin space (#6958,+ Albert Krewinkel). Successive quote characters are separated with+ a thin space to improve readability and to prevent unwanted ligatures.+ Detection of these quotes sometimes had failed if the second quote+ was nested in a span element.+ + Separate successive quote chars with thin space (#6958, Albert+ Krewinkel).++ * EPUB Writer: Fix belongs-to-collection XML id choice (#7267, nuew).+ The epub writer previously used the same XML id for both the book+ identifier and the epub collection. This causes an error on epubcheck.++ * BibTeX/BibLaTeX writer: Handle `annote` field (#7266).++ * ZimWiki writer: allow links and emphasis in headers (#6605,+ Albert Krewinkel).++ * ConTeXt writer:++ + Support blank lines in line blocks (#6564, Albert Krewinkel,+ thanks to @denismaier).+ + Use span identifiers as reference anchors (#7246, Albert Krewinkel).++ * HTML writer:++ + Keep attributes from code nested below `pre` tag (#7221,+ Albert Krewinkel). If a code block is defined with `<pre><code+ class="language-x">…</code></pre>`, where the `<pre>` element has no+ attributes, then the attributes from the `<code>` element are used+ instead. Any leading `language-` prefix is dropped in the code's+ `class` attribute are dropped to improve syntax highlighting.+ + Ensure headings only have valid attribs in HTML4 (#5944, Albert+ Krewinkel).+ + Parse `<header>` as a Div (Albert Krewinkel).++ * Org writer:++ + Inline latex envs need newlines (#7252, tecosaur).+ As specified in https://orgmode.org/manual/LaTeX-fragments.html, an+ inline \begin{}...\end{} LaTeX block must start on a new line.+ + Use LaTeX style maths deliminators (#7196, tecosaur).++ * JATS writer (Albert Krewinkel):++ + Use either styled-content or named-content for spans (#7211).+ If the element has a content-type attribute, or at least one class,+ then that value is used as `content-type` and the span is put inside+ a `<named-content>` element. Otherwise a `<styled-content>` element+ is used instead.+ + Reduce unnecessary use of `<p>` elements for wrapping (#7227).+ The `<p>` element is used for wrapping in cases were the contents+ would otherwise not be allowed in a certain context. Unnecessary+ wrapping is avoided, especially around quotes (`<disp-quote>` elements).+ + Convert spans to `<named-content>` elements (#7211). Spans with+ attributes are converted to `<named-content>` elements instead of+ being wrapped with `<milestone-start/>` and `<milestone-end>`+ elements. Milestone elements are not allowed in documents using the+ articleauthoring tag set, so this change ensures the creation of valid+ documents.+ + Add footnote number as label in backmatter (#7210). Footnotes in the+ backmatter are given the footnote's number as a label. The+ articleauthoring output is unaffected from this change, as footnotes+ are placed inline there.+ + Escape disallows chars in identifiers. XML identifiers must start+ with an underscore or letter, and can contain only a limited set+ of punctuation characters. Any IDs not adhering to these rules are+ rewritten by writing the offending characters as `Uxxxx`,+ where `xxxx` is the character's hex code.++ * Jira writer: use `{color}` when span has a color attribute+ (Albert Krewinkel, tarleb/jira-wiki-markup#10).++ * Docx writer:++ + Autoset table width if no column has an explicit width (Albert+ Krewinkel).+ + Extract Table handling into separate module (Albert Krewinkel).+ + Support colspans and rowspans in tables (Albert Krewinkel, #6315).+ + Support multirow table headers (Albert Krewinkel).+ + Improve integration of settings from reference.docx (#1209).+ This change allows users to create a reference.docx that+ sets `w:proofState` for spelling or grammar to `dirty`,+ so that spell/grammar checking will be triggered on the+ generated docx.+ + Copy over more settings from reference.docx (#7240). From settings.xml+ in the reference-doc, we now include: `zoom`, `embedSystemFonts`,+ `doNotTrackMoves`, `defaultTabStop`, `drawingGridHorizontalSpacing`,+ `drawingGridVerticalSpacing`, `displayHorizontalDrawingGridEvery`,+ `displayVerticalDrawingGridEvery`, `characterSpacingControl`,+ `savePreviewPicture`, `mathPr`, `themeFontLang`, `decimalSymbol`,+ `listSeparator`, `autoHyphenation`, `compat`.+ + Set zoom to 100% by default in settings.xml.+ + Align math options more with current Word defaults (e.g. Cambria Math+ font).+ + Remove `rsid`s from default settings.xml. Word will add these+ when revisions are made.++ * Ms writer: Handle tables with multiple paragraphs (#7288).+ Previously they overflowed the table cell width. We now set line lengths+ per-cell and restore them after the table has been written.++ * Markdown writer:++ + Use cleaner braceless syntax for code blocks with a+ single class (#7242, Jan Tojnar).+ + Add quotes properly in markdown YAML metadata fields (#7245).+ This fixes a bug, which caused the writer to look at the *last*+ rather than the *first* character in determining whether quotes+ were needed. So we got spurious quotes in some cases and+ didn't get necessary quotes in others.+ + Use `@{..}` syntax for citations when needed.+ + Use fewer unneeded escapes for `#` (see #6259).+ + Improve escaping of `@`. We need to escape literal `@` before+ `{` because of the new citation syntax.++ * Commonmark writer: Use backslash escapes for `<` and `|`...+ instead of entities (#7208).++ * Powerpoint writer: allow `monofont` to be specified in metadata+ (#7187).++ * LaTeX template:++ + Use non-starred names for xcolor color names (#6109).+ This should make svgnames and x11names work properly.+ + Fix bad vertical spacing after bibliography (#7234, badumont).+ + List of figures before list of tables (#7235, Julien Dutant).+ + Move CSL macro definitions before header-includes so they can be+ overridden (#7286).+ + Improve treatment of CSL `entry-spacing` (#7296).+ Previously with the default template settings (`indent` variable+ not set), we would get interparagraph spaces separating bib+ entries even with `entry-spacing="0"`. On the other hand,+ setting `entry-spacing="2"` gave ridiculously large spacing.+ This change makes the spacing caused by `entry-spacing` a multiple+ of `\parskip` by default, which gives aesthetically reasonable+ output. Those who want a larger or smaller unit (e.g. because+ they use `indent` which sets `\parskip` to 0) may+ `\setlength{\cslentryspacingunit}{10pt}` in header-includes+ to override the defaults.+ + Move title, author, date up to top of preamble (#7295).+ This allows header-includes to use them, and puts them+ in a position where you can see them immediately.+ + Define commands for zero width non-joiner character+ (#6639, Albert Krewinkel). The zero-width non-joiner character+ is used to avoid ligatures (e.g. in German).++ * ConTeXt template:++ + Define `enumerate` itemgroup (#5016, Denis Maier).+ + List of figures before list of tables (#7235, Julien Dutant).++ * reveal.js template:++ + Support `toc-title` (#7171, Florian Kohrt).+ + Use `hash: true` by default rather than `history: true` (#6968).++ * HTML-based slide shows: add support for `institute` (#7289, Thomas+ Hodgson).++ * Text.Pandoc.Extensions: Add constructor `Ext_rebase_relative_paths` to+ `Extensions` [API change].++ * Text.Pandoc.XML.Light: add Eq, Ord instances for Content,+ Element, Attr, CDataKind [API change].++ * Text.Pandoc.MediaBag:++ + Change type to use a `Text` key instead of `[FilePath]`.+ We normalize the path and use `/` separators for consistency.+ + Export `MediaItem` type [API change].+ + Change `MediaBag` type to a map from Text to MediaItem [API change].+ + `lookupMedia` now returns a `MediaItem` [API change].+ + Change `insertMedia` so it sets the `mediaPath` to a filename based on+ the SHA1 hash of the contents. This will be used when contents+ are extracted.++ * Text.Pandoc.Class.PandocMonad:++ + Remove `fetchMediaResource` [API change]. Use `fetchItem` to get+ resources in `fillMediaBag`.+ + Add informational message in `downloadOrRead` indicating what path+ local resources have been loaded from.++ * Text.Pandoc.Logging:++ + Remove single quotes around paths in messages.+ + Add LoadedResource constructor to LogMessage [API change].+ This is for INFO-level messages telling where image data has been+ loaded from. (This can vary because of the resource path.)++ * Text.Pandoc.Asciify: simplify code and export `toAsciiText` [API change].+ Instead of encoding a giant (and incomplete) map, we now+ just use unicode-transforms to normalize the text to+ a canonical decomposition, and manipulate the result.++ * App: allow tabs expansion even if file-scope is used (Albert Krewinkel,+ #6709). Tabs in plain-text inputs are now handled correctly, even if+ the `--file-scope` flag is used.++ * Add new internal module Text.Pandoc.Writers.GridTable (Albert Krewinkel).++ * Text.Pandoc.Highlighting: Change type of `languagesByExtension`, adding+ a parameter for a `SyntaxMap` [API change] (Jan Tojnar, #7241).+ Languages defined using `--syntax-definition` were not recognized by+ `languagesByExtension`. This patch corrects that, allowing the writers+ to see all custom definitions. The LaTeX writer still uses the default+ syntax map, but that's okay in that context, since+ `--syntax-definition` won't create new listings styles.++ * Text.Pandoc.Citeproc:++ + Ensure that CSL-related attributes are passed on to a Div with id+ 'refs'. Otherwise things like `entry-spacing` won't work when+ such Divs are used.+ + Use metadata's `lang` for the lang parameter of citeproc, overriding+ `localeLanguage`.+ + Recognize locators spelled with a capital letter (#7323).+ + Add a comma and a space in front of the suffix if it doesn't start+ with space or punctuation (#7324).+ + Don't detect math elements as locators (#7321).++ * Remove Text.Pandoc.BCP47 module [API change]. Use types and functions+ from UnicodeCollation.Lang instead. This is a richer implementation+ of BCP 47.++ * Text.Pandoc.Shared:++ + Fix regression in grid tables for wide characters (#7214).+ In the translation from String to Text, a char-width-sensitive+ `splitAt'` was dropped. This commit reinstates it and uses it to make+ `splitTextByInstances` char-width sensitive.+ + Add `getLang` (formerly in the now-removed BCP47) [API change].++ * Text.Pandoc.SelfContained: use `application/octet-stream`+ for unknown mime types instead of halting with an error (#7202).++ * Lua filters: respect Inlines/Blocks filter functions in `pandoc.walk_*`+ (Albert Krewinkel).++ * Add text as build-depend for trypandoc (#7193, Roman Beránek).++ * Bump upper-bounds for network-uri, time, attoparsec.++ * Use citeproc 0.4.++ * Use texmath 0.12.3.++ * Use jira-wiki-markup 1.3.5 (Albert Krewinkel).++ * Require latest skylighting (fixes a bug in XML syntax highlighting).++ * Use latest xml-conduit.++ * Use latest commonmark, commonmark-extensions, commonmark-pandoc.++ * Use haddock-library-1.10.0 (Albert Krewinkel).++ * Allow compilation with base 4.15 (Albert Krewinkel).++ * MANUAL:++ + Add information about `lang` and bibliography sorting.+ + Add info about YAML escape sequences, link to spec (#7152,+ Albert Krewinkel).+ + Note that `institute` variable works for HTML-based slides.+ + Update documentation on citation syntax.+ + Add citation example for locators and suffixes (Tristan Stenner)++ * Updated and fixed typos in documentation (Charanjit Singh,+ Anti-Distinctlyminty, Tatiana Porras, obcat).++ * Add instructions for installing pandoc-types before compiling filter.++ * INSTALL: add note that parallel installations should be avoided+ (#6865).++ * Remove `biblatex-nussbaum.md` test. It is basically the same+ as `biblaetx-quotes.md`.++ * Command tests: fail if a file contains no tests---and fix a+ test that failed in that way!++ * Use smaller images in tests, reducing the size of the source tarball by 8 MB.+++## pandoc 2.13 (2021-03-21)++ * Support `yaml_metadata_block` extension for `commonmark`, `gfm` (#6537).+ This supported is a bit more limited than with pandoc's+ `markdown`. The YAML block must be the first thing in the input,+ and the leaf notes are parsed in isolation from the rest of+ the document. So, for example, you can't use reference+ links if the references are defined later in the document.++ * Fix fallback to default partials when custom templates are used.+ If the directory containing a template does not contain the partial,+ it should be sought in the default templates, but this was not+ working properly (#7164).++ * Handle `nocite` better with `--biblatex` and `--natbib` (#4585).+ Previously the nocite metadata field was ignored with these formats.+ Now it populates a `nocite-ids` template variable and causes a+ `\nocite` command to be issued.++ * Text.Pandoc.Citeproc: apply `fixLinks` correctly (#7130). This is code+ that incorporates a prefix like `https://doi.org/` into a following link+ when appropriate.++ * Text.Pandoc.Shared:++ + Remove `backslashEscapes`, `escapeStringUsing` [API change]. Replace+ these inefficient association list lookups with more efficient escaping+ functions in the writers that used them (for a 10-25% performance boost+ in org, haddock, rtf, texinfo writers).+ + Remove `ToString`, `ToText` typeclasses [API change]. These were needed+ for the transition from String to Text, but they are no longer used and+ may clash with other things.+ + Simplify `compactDL`.++ * Text.Pandoc.Parsing:++ + Change type of `readWithM` so that it is no longer polymorphic+ [API change]. The `ToText` class has been removed, and now that we've+ completed the transition to Text we no longer need this to operate+ on Strings.+ + Remove `F` type synonym [API change]. Muse and Org were defining their+ own `F` anyway.++ * Text.Pandoc.Readers.Metadata:++ + Export `yamlMetaBlock` [API change].+ + Make `yamlBsToMeta`, `yamlBsToRefs` polymorphic on the parser state+ [API change].++ * Markdown reader: Fix regression with `tex_math_backslash` (#7155).++ * MediaWiki reader: Allow block-level content in notes (ref) (#7145).++ * Jira reader (Albert Krewinkel):++ + Fixed parsing of autolinks (i.e., of bare URLs in the text).+ Previously an autolink would take up the rest of a line, as spaces+ were allowed characters in these items.+ + Emoji character sequences no longer cause parsing failures. This was+ due to missing backtracking when emoji parsing fails.+ + Mark divs created from panels with class "panel".++ * RST reader: fix logic for ending comments (#7134). Previously comments+ sometimes got extended too far.++ * DocBook writer: include Header attributes as XML attributes on+ section (Erik Rask). Attributes with key names that are not allowed+ as XML attributes are dropped, as are attributes with invalid values+ and `xml:id` (DocBook 5) and `id` (DocBook 4).++ * Docx writer:++ + Make `nsid` in `abstractNum` deterministic. Previously we assigned+ a random number, but we don't need random values, so now we just+ assign a value based on the list marker.+ + Use integral values for `w:tblW` (#7141).++ * Jira writer (Albert Krewinkel):++ + Block quotes are only rendered as `bq.` if they do not contain a+ linebreak.+ + Jira writer: improve div/panel handling. Include div attributes in+ panels, always render divs with class `panel` as panels, and+ avoid nesting of panels.++ * HTML writer: Add warnings on duplicate attribute values.+ This prevents emitting invalid HTML. Ultimately it would be good to+ prevent this in the types themselves, but this is better for now.++ * Org writer: Prevent unintended creation of ordered list items (#7132,+ Albert Krewinkel). Adjust line wrapping if default wrapping would cause+ a line to be read as an ordered list item.++ * JATS templates: support 'equal-contrib' attrib for authors (Albert+ Krewinkel). Authors who contributed equally to a paper may be marked+ with `equal-contrib`.++ * reveal.js template: replace JS comment with HTML (#7154, Florian Kohrt).++ * Text.Pandoc.Logging: Add `DuplicateAttribute` constructor to `LogMessage`.+ [API change]++ * Use `-j4` for linux release build. This speeds up the build dramatically+ on arm.++ * cabal.project: remove ghcoptions. Move flags to top level, so they can+ be set differently on the command line.++ * Require latest texmath, skylighting, citeproc, jira-wiki-markup.+ (The latest skylighting fixes a bad bug with Haskell syntax highlighting.)+ Narrow version bounds for texmath, skylighting, and citeproc, since+ the test output depend on them.++ * Use doclayout 0.3.0.2. This significantly reduces the time and memory+ needed to compile pandoc.++ * Use `foldl'` instead of `foldl` everywhere.++ * Update bounds for random (#7156, Alexey Kuleshevich).++ * Remove uses of some partial functions.++ * Don't bake in a larger stack size for the executable.++ * Test improvements:++ + Use `getExecutablePath` from base, avoiding the dependency on+ `executable-path`.+ + Factor out `setupEnvironment` in Helpers, to avoid code duplication.+ + Fix finding of data files by setting teh `pandoc_datadir` environment+ variable when we shell out to pandoc. This avoids the need to use+ `--data-dir` for the tests, which caused problems finding `pandoc.lua`+ when compiling without the `embed_data_files` flag (#7163).++ * Benchmark improvements:++ + Build `+RTS -A8m -RTS` into default ghc-options for benchmark.+ This is necessary to get accurate benchmark results; otherwise we+ are largely measuring garbage collecting, some not related to the+ current benchmark.+ + Allow specifying BASELINE file in 'make bench' for comparison+ (otherwise the latest benchmark is chosen by default).+ + Force `readFile` in benchmarks early (Bodigrim).++ * CONTRIBUTING: suggest using a `cabal.project.local` file (#7153,+ Albert Krewinkel).++ * Add ghcid-test to Makefile. This loads the test suite in ghcid.+++## pandoc 2.12 (2021-03-08)++ * `--resource-path` now accumulates if specified multiple+ times (#6152). Resource paths specified later on the command line are+ prepended to those specified earlier. Thus,+ `--resource-path foo --resource-path bar:baz` is equivalent to+ `--resource-path bar:bas:foo`. (The previous behavior was+ for the last `--resource-path` to replace all the rest.)+ `resource-path` in defaults files behaves the same way: it+ will be prepended to the resource path set by earlier+ command line options or defaults files. This change+ facilitates the use of multiple defaults files: each can+ specify a directory containing resources it refers to+ without clobbering the resource paths set by the others.++ * Allow defaults files to refer to the home directory, the+ user data directory, and the directory containing the defaults file+ itself (#5871, #5982, #5977). In fields that expect file paths+ (and only in these fields),++ + `${VARIABLE}` will expand to the value of the environment variable+ `VARIABLE` (and in particular `${HOME}` will expand to the path+ of the home directory). A warning will be raised for undefined+ variables.+ + `${USERDATA}` will expand to the path of the user data+ directory in force when the defaults file is being processed.+ + `${.}` will expand to the directory containing the defaults file.+ (This allows default files to be placed in a directory containing+ resources they make use of.)++ * When downloading content from URL arguments, be sensitive to+ the character encoding (#5600). We can properly handle UTF-8 and latin1+ (ISO-8859-1); for others we raise an error. Fall back to latin1 if+ no charset is given in the mime type and UTF-8 decoding fails.++ * Allow abbreviations that don't end in a period to be+ specified using `--abbreviations` (#7124).++ * Add new unexported module Text.Pandoc.XML.Light, as well+ as Text.Pandoc.XML.Light.Types, Text.Pantoc.XML.Light.Proc,+ Text.Pandoc.XML.Light.Output. (Closes #6001, #6565, #7091).++ This module exports definitions of `Element` and `Content`+ that are isomorphic to xml-light's, but with Text+ instead of String. This allows us to keep most of the code in existing+ readers that use xml-light, but avoid lots of unnecessary allocation.++ We also add versions of the functions from xml-light's+ Text.XML.Light.Output and Text.XML.Light.Proc that operate on our+ modified XML types, and functions that convert xml-light types to our+ types (since some of our dependencies, like texmath, use xml-light).++ We export functions that use xml-conduit's parser to produce an+ `Element` or `[Content]`. This allows existing pandoc code to use+ a better parser without much modification.++ The new parser is used in all places where xml-light's parser was+ previously used. Benchmarks show a significant performance improvement+ in parsing XML-based formats (with docbook, opml, jats, and docx+ almost twice as fast, odt and fb2 more than twice as fast).++ In addition, the new parser gives us better error reporting than+ xml-light. We report XML errors, when possible, using the new+ `PandocXMLError` constructor in `PandocError`.++ These changes revealed the need for some changes in the tests. The+ docbook-reader.docbook test lacked definitions for the entities it used;+ these have been added. And the docx golden tests have been updated,+ because the new parser does not preserve the order of attributes.++ * DocBook reader:++ + Avoid expensive tree normalization step, as it is not necessary+ with the new XML parser.+ + Support `informalfigure` (#7079) (Nils Carlson).++ * Docx reader:++ + Use Map instead of list for Namespaces. This gives a speedup of+ about 5-10%. With this and the XML parsing changes, the docx reader+ is now about twice as fast as in the previous release.++ * HTML reader:++ + Small performance tweaks.+ + Also, remove exported class `NamedTag(..)` [API change]. This was just+ intended to smooth over the transition from String to Text and is no+ longer needed.+ + As a result, the functions `isInlineTag` and `isBlockTag`+ are no longer polymorphic; they apply to a `Tag Text` [API change].+ + Do a lookahead to find the right parser to use. This takes+ benchmarks from 34ms to 23ms, with less allocation.+ + Fix bad handling of empty `src` attribute in `iframe` (#7099).+ If `src` is empty, we simply skip the `iframe`.+ If `src` is invalid or cannot be fetched, we issue a warning+ nd skip instead of failing with an error.++ * JATS reader:++ + Avoid tree normalization, which is no longer necessary given the+ new XML parser.++ * LaTeX reader:++ + Don't export `tokenize`, `untokenize` [API change]. These are internal+ implementation details, which were only exported for testing.+ They don't belong in the public API.+ + Improved efficiency of the parser. With these changes the reader+ is almost twice as fast as in the last release in our benchmarks.+ + Code cleanup, removing some unnecessary things.+ + Rewrite `withRaw` so it doesn't rely on fragile assumptions+ about token positions (which break when macros are expanded)+ (#7092). This requires the addition of `sEnableWithRaw` and+ `sRawTokens` in `LaTeXState`, and a new combinator `disablingWithRaw`+ to disable collecting of raw tokens in certain contexts.+ Add `parseFromToks` to Text.Pandoc.Readers.LaTeX.Parsing.+ Fix parsing of single character tokens so it doesn't mess+ up the new raw token collecting. These changes slightly increase+ allocations and have a small performance impact.+ + Handle some bibtex/biblatex-specific commands that used to be+ dealt with in pandoc-citeproc (#7049).+ + Optimize `satisfyTok`, avoiding unnecessary macro expansion steps.+ Benchmarks after this change show 2/3 of the run time and 2/3 of the+ allocation of the Feb. 10 benchmarks.+ + Removed `sExpanded` in state. This isn't actually needed and checking+ it doesn't change anything.+ + Improve `braced'`. Remove the parameter, have it parse the+ opening brace, and make it more efficient.+ + Factor out pieces of the LaTeX reader to make the module smaller.+ This reduces memory demands when compiling. Created+ Text.Pandoc.Readers.{LaTeX,Math,Citation,Table,Macro,Inline}.+ Changed Text.Pandoc.Readers.LaTeX.SIunitx to export a command map+ instead of individual commands.+ + Handle table cells containing `&` in `\verb` (#7129).++ * Make Text.Pandoc.Readers.LaTeX.Types an unexported module [API change].++ * Markdown reader:++ + Improved handling of mmd link attributes in references (#7080).+ Previously they only worked for links that had titles.+ + Improved efficiency of the parser (benchmarks show a 15% speedup).++ * OPML reader:++ + Avoid tree normalization, which is no longer necessary with the+ new XML parser.++ * ODT reader:++ + Finer-grained errors on parse failure (#7091).+ + Give more information if the zip container can't be unpacked.++ * Org reader:++ + Support `task_lists` extension (Albert Krewinkel, #6336).+ + Fix bug in org-ref citation parsing (Albert Krewinkel, #7101).+ The org-ref syntax allows to list multiple citations separated by+ comma. Previously commas were accepted as part of the citation id,+ so all citation lists were parsed as one single citation.++ * RST reader:++ + Use `getTimestamp` instead of `getCurrentTime` to fetch timestamp.+ Setting `SOURCE_DATE_EPOCH` will allow reproducible builds.+ + RST reader: fix handling of header in CSV tables (#7064).+ The interpretation of this line is not affected by the delim option.++ * Jira reader:++ + Modified the Doc parser to skip leading blank lines. This fixes+ parsing of documents which start with multiple blank lines (Albert+ Krewinkel, #7095).+ + Prevent URLs within link aliases to be treated as autolinks (Albert+ Krewinkel, #6944).++ * Text.Pandoc.Shared++ + Remove formerly exported functions that are no longer used in the+ code base: `splitByIndices`, `splitStringByIndicies`, `substitute`,+ and `underlineSpan` (which had been deprecated in April 2020)+ [API change].+ + Export `handleTaskListItem` (Albert Krewinkel) [API change].+ + Change `defaultUserDataDirs` to `defaultUserDataDir` [API+ change]. We determine what is the default user data directory+ by seeing whether the XDG directory and/or legacy+ directory exist.++ * BibTeX writer:++ + BibTeX writer: use doclayout and doctemplate. This change allows+ bibtex/biblatex output to wrap as other formats do,+ depending on the settings of `--wrap` and `--columns` (#7068).++ * CSL JSON writer:++ + Output `[]` if no references in input, instead of raising a+ PandocAppError as before.++ * Docx writer:++ + Use `getTimestamp` instead of `getCurrentTime` for timestamp.+ Setting `SOURCE_DATE_EPOCH` will allow reproducible builds.++ * EPUB writer:++ + Use `getTimestamp` instead of `getCurrentTime` for timestamp.+ Setting `SOURCE_DATE_EPOCH` will allow reproducible builds (#7093).+ This does not suffice to fully enable reproducible in EPUB, since+ a unique id is still being generated for each build.+ + Support `belongs-to-collection` metadata (#7063) (Nick Berendsen).++ * JATS writer:++ + Escape special chars in reference elements (Albert Krewinkel).+ Prevents the generation of invalid markup if a citation element+ contains an ampersand or another character with a special meaning+ in XML.++ * Jira writer:++ + Use Span identifiers as anchors (Albert Krewinkel).+ + Use `{noformat}` instead of `{code}` for unknown languages (Albert+ Krewinkel). Code blocks which are not marked as a language supported+ by Jira are rendered as preformatted text via `{noformat}` blocks.++ * LaTeX writer:++ + Adjust hypertargets to beginnings of paragraphs (#7078).+ Use `\vadjust pre` so that the hypertarget takes you to the beginning+ of the paragraph rather than one line down.+ This makes a particular difference for links to citations using+ `--citeproc` and `link-citations: true`.+ + Change BCP47 lang tag from `jp` to `ja` (Mauro Bieg, #7047).+ + Use function instead of map for accent lookup (should be+ more efficient).+ + Split the module to make it easier to compile on low-memory+ systems: added Text.Pandoc.Writers.LaTeX.{Util,Citation,Lang}.++ * Markdown writer:++ + Handle math right before digit. We insert an HTML comment to+ avoid a `$` right before a digit, which pandoc will not recognize+ as a math delimiter.+ + Split the module to make it easier to compile on low-memory+ systems: added Text.Pandoc.Writers.Markdown.{Types,Inline}.++ * ODT writer:++ + Use `getTimestamp` instead of `getCurrentTime` for timestamp.+ Setting `SOURCE_DATE_EPOCH` will allow reproducible builds.+ + Update default ODT style (Lorenzo). Previously, the "First paragraph"+ style inherited from "Standard" but not from "Text body." Now+ it is adjusted to inherit from "Text body", to avoid some ugly+ spacing issues. It may be necessary to update a custom `reference.odt`+ in light of this change.++ * Org writer:++ + Support `task_lists` extension (Albert Krewinkel, #6336).++ * Pptx writer:++ + Use `getTimestamp` instead of `getCurrentTime` for timestamp.+ Setting `SOURCE_DATE_EPOCH` will allow reproducible builds.++ * JATS templates: tag `author.name` as `string-name` (Albert Krewinkel).+ The partitioning the components of a name into surname, given names,+ etc. is not always possible or not available. Using `author.name`+ allows to give the full name as a fallback to be used when+ `author.surname` is not available.++ * Add default templates for bibtex and biblatex, so that+ the variables `header-include`, `include-before`, `include-after`+ (or alternatively the command line options+ `--include-in-header`, `--include-before-body`, `--include-after-body`)+ may be used.++ * LaTeX template:++ + Update to iftex package (#7073) (Andrew Dunning)+ + Wrap url colours in braces (#7121) (Loïc Grobol).++ * revealjs template: Add 'center' option for vertical slide centering.+ (maurerle, #7104).++ * Text.Pandoc.XML: Improve efficiency of `fromEntities`.++ * Text.Pandoc.MIME++ + Add exported function `getCharset` [API change].++ * Text.Pandoc.UTF8: change IO functions to return Text, not String+ [API change]. This affects `readFile`, `getContents`, `writeFileWith`,+ `writeFile`, `putStrWith`, `putStr`, `putStrLnWith`, `putStrLn`.+ `hPutStrWith`, `hPutStr`, `hPutStrLnWith`, `hPutStrLn`, `hGetContents`.+ This avoids the need to uselessly create a linked list of characters+ when emiting output.++ * Text.Pandoc.App++ + Add `parseOptionsFromArgs` [API change, new exported function].+ + Add fields for CSL options to `Opt` [API change]:+ `optCSL`, `optbibliography`, `optCitationAbbreviations`.++ * Text.Pandoc.Citeproc.BibTeX++ + `Text.Pandoc.Citeproc.writeBibTeXString` now returns+ `Doc Text` instead of `Text` (#7068).+ + Correctly handle `pages` (= `page` in CSL) (#7067).+ + Correctly handle BibLaTeX `langid` (= `language` in CSL, #7067).+ + In BibTeX output, protect foreign titles since there's no language+ field (#7067).+ + Clean up BibTeX parsing (#7049). Previously there was a messy code+ path that gave strange results in some cases, not passing through raw+ tex but trying to extract a string content. This was an artefact of+ trying to handle some special bibtex-specific commands in the BibTeX+ reader. Now we just handle these in the LaTeX reader and simplify+ parsing in the BibTeX reader. This does mean that more raw tex will+ be passed through (and currently this is not sensitive to the+ `raw_tex` extension; this should be fixed).++ * Text.Pandoc.Citeproc.MetaValue++ + Correctly parse "raw" date value in markdown references metadata.+ (See jgm/citeproc#53.)++ * Text.Pandoc.Citeproc++ + Use https URLs for links (Salim B, #7122).++ * Text.Pandoc.Class++ + Add `getTimestamp` [API change]. This attempts to read the+ `SOURCE_DATE_EPOCH` environment variable and parse a UTC time+ from it (treating it as a unix date stamp, see+ https://reproducible-builds.org/specs/source-date-epoch/). If the+ variable is not set or can't be parsed as a unix date stamp, then the+ function returns the current date.++ * Text.Pandoc.Error++ + Add `PandocUnsupportedCharsetError` constructor for+ `PandocError` [API change].+ + Export `renderError` [API change].+ + Refactor `handleError` to use `renderError`. This allows us render+ error messages without exiting.++ * Text.Pandoc.Extensions++ + `Ext_task_lists` is now supported by org (and turned+ on by default) (Albert Krewinkel, #6336).+ + Remove `Ext_fenced_code_attributes` from allowed commonmark attributes+ (#7097). This attribute was listed as allowed, but it didn't actually+ do anything. Use `attributes` for code attributes and more.++ * Lua subsystem:++ + Always load built-in Lua scripts from default data-dir (Albert+ Krewinkel). The Lua modules `pandoc` and `pandoc.List` are now always+ loaded from the system's default data directory. Loading from a+ different directory by overriding the default path, e.g. via+ `--data-dir`, is no longer supported to avoid unexpected behavior+ and to address security concerns.+ + Add module "pandoc.path" (Albert Krewinkel, #6001, #6565).+ The module allows to work with file paths in a convenient and+ platform-independent manner.+ + Use strict evaluation when retrieving AST value from the stack+ (Albert Krewinkel, #6674).++ * Text.Pandoc.PDF++ + Disable `smart` extension when building PDF via LaTeX.+ This is to prevent accidental creation of ligatures like+ `` ?` `` and `` !` `` (especially in languages with quotations like+ German), and similar ligature issues. (See jgm/citeproc#54.)++ * Text.Pandoc.CSV:++ + Fix parsing of unquoted values (#7112). Previously we didn't allow+ unescaped quotes in unquoted values, but they are allowed+ in CSV.++ * Test suite:++ + Use a more robust method for testing the executable. Many+ of our tests require running the pandoc executable. This+ is problematic for a few different reasons. First,+ cabal-install will sometimes run the test suite after+ building the library but before building the executable,+ which means the executable isn't in place for the tests.+ One can work around that by first building, then building+ and running the tests, but that's fragile. Second, we+ have to find the executable. So far, we've done that using+ a function `findPandoc` that attempts to locate it+ relative to the test executable (which can be located+ using findExecutablePath). But the logic here is delicate+ and work with every combination of options. To solve both+ problems, we add an `--emulate` option to the+ `test-pandoc` executable. When `--emulate` occurs as the+ first argument passed to `test-pandoc`, the program simply+ emulates the regular pandoc executable, using the rest of+ the arguments (after `--emulate`). Thus, `test-pandoc+ --emulate -f markdown -t latex` is just like `pandoc -f+ markdown -t latex`. Since all the work is done by library+ functions, implementing this emulation just takes a couple+ lines of code and should be entirely reliable. With this+ change, we can test the pandoc executable by running the+ test program itself (locatable using `findExecutablePath`)+ with the `--emulate` option. This removes the need for the+ fragile `findPandoc` step, and it means we can run our+ integration tests even when we're just building the+ library, not the executable. [Note: part of this change+ involved simplifying some complex handling to set+ environment variables for dynamic library paths. I have+ tested a build with `--enable-dynamic-executable`, and it+ works, but further testing may be needed.]+ + Print accurate location if a test fails (Albert+ Krewinkel). Ensures that tasty-hunit reports the location+ of the failing test instead of the location of the helper+ `test` function.++ * Documentation: Update URLs and use `https` where possible (#7122,+ Salim B).++ * Add `doc/libraries.md`, a description of libraries that support pandoc.++ * MANUAL.txt++ + MANUAL: block-level formatting is not allowed in line blocks (#7107).+ + Clarify `tex_math_dollars` extension. Note that no blank lines+ are allowed between the delimiters in display math.+ + Add MANUAL section on reproducible builds.+ + Document no template fallback for absolute path (#7077, Nixon+ Enraght-Moony.)+ + Improve docs for cite-method.+ + Update README and man page.++ * Makefile: in `make bench`, create CSV files for comparison and compare+ against previous benchmark run. Add timestamp to CSV filenames.++ * cabal.project: don't explicitly set -trypandoc.+ If we do, this can't be overridden on the cabal command line.++ * doc/lua-filters.md: improve documentation for+ `pandoc.mediabag.insert`, `pandoc.mediabag.fetch`,+ `directory`, `normalize` (Albert Krewinkel).++ * Allow base64-bytestring-1.2.* (Dmitrii Kovanikov)++ * Require jira-wiki-markup 1.3.3 (Albert Krewinkel)++ * Require citeproc 0.3.0.8, which correctly titlecases when titles+ contain non-ASCII characters.++ * Use skylighting 0.10.4. This version of skylighting uses xml-conduit+ rather than hxt. This speeds up parsing of XML syntax definitions+ fourfold, and removes four packages from pandoc's dependency graph:+ hxt-charproperties, hxt-unicode, hxt-regex-xmlschema, hxt.++ * Add script `tools/parseTimings.pl` to help pin down which+ modules take the most time and memory to compile.++ * Avoid unnecessary use of NoImplicitPrelude pragma (#7089) (Albert+ Krewinkel)++ * Benchmarks++ + Use the lighter-weight tasty-bench instead of criterion.+ + Run writer benchmarks for binary formats too.+ + Alphabetize benchmarks.+ + Don't run benchmarks for bibliography formats+ (yet; we need a special input for them).+ + Show allocation data+ + Clean up benchmark code.+ + Allow specifying patterns using `-p blah'.++ * trypandoc: add 2 second timeout.++ * Use `-split-sections` in creating linux release binary.+ This reduces executable size significantly (by about 30%).++ * Remove `weigh-pandoc`. It's not really useful any more, now that our+ regular benchmarks include data on allocation.++ * Improve linux package build process and add script to+ automate building an arm64 binary package.+++## pandoc 2.11.4 (2021-01-22)++ * Add `biblatex`, `bibtex` as output formats (closes #7040).++ * Recognize more extensions as markdown by default (#7034):+ `mkdn`, `mkd`, `mdwn`, `mdown`, `Rmd`.++ * Implement defaults file inheritance (#6924, David Martschenko).+ Allow defaults files to inherit options from other defaults files by+ specifying them with the following syntax:+ `defaults: [list of defaults files or single defaults file]`.++ * Fix infinite HTTP requests when writing epubs from URL source (#7013).+ Due to a bug in code added to avoid overwriting the cover image+ if it had the form `fileX.YYY`, pandoc made an endless sequence+ of HTTP requests when writing epub with input from a URL.++ * Org reader:++ + Allow multiple pipe chars in todo sequences (Albert Krewinkel, #7014).+ Additional pipe chars, used to separate "action" state from "no further+ action" states, are ignored. E.g., for the following sequence, both+ `DONE` and `FINISHED` are states with no further action required:+ `#+TODO: UNFINISHED | DONE | FINISHED`.+ + Restructure output of captioned code blocks (Albert Krewinkel, #6977).+ The Div wrapper of code blocks with captions now has the class+ "captioned-content". The caption itself is added as a Plain block+ inside a Div of class "caption". This makes it easier to write filters+ which match on captioned code blocks. Existing filters will need to be+ updated.+ + Mark verbatim code with class `verbatim` (Dimitri Sabadie, #6998).++ * LaTeX reader:++ + Handle `filecontents` environment (#7003).+ + Put contents of unknown environments in a Div when `raw_tex` is not+ enabled (#6997). (When `raw_tex` is enabled, the whole environment is+ parsed as a raw block.) The class name is the name of the environment.+ Previously, we just included the contents without the surrounding Div,+ but having a record of the environment's boundaries and name can be+ useful.++ * Mediawiki reader:++ + Allow space around storng/emph delimiters (#6993).++ * New module Text.Pandoc.Writers.BibTeX, exporting+ writeBibTeX and writeBibLaTeX. [API change]++ * LaTeX writer:++ + Revert table line height increase in 2.11.3 (#6996).+ In 2.11.3 we started adding `\addlinespace`, which produced less dense+ tables. This wasn't an intentional change; I misunderstood a comment in+ the discussion leading up to the change. This commit restores the earlier+ default table appearance. Note that if you want a less dense table, you+ can use something like `\def\arraystretch{1.5}` in your header.++ * EPUB writer:++ + Adjust internal links to identifiers defined in raw HTML sections+ after splitting into chapters (#7000).+ + Recognize `Format "html4"`, `Format "html5"` as raw HTML.+ + Adjust internal links to images, links, and tables after splitting into+ chapters. Previously we only did this for Div and Span and Header+ elements (see #7000).++ * Ms writer:++ + Don't justify text inside table cells.++ * JATS writer:++ + Use `<element-citation>` if `element_citations`+ extension is enabled (Albert Krewinkel).+ + Fix citations (Albert Krewinkel, #7018). By default+ we use formatted citations.+ + Ensure that `<disp-quote>` is always wrapped in `<p>` (#7041).++ * Markdown writer:++ + Cleaned up raw formats. We now react appropriately+ to `gfm`, `commonmark`, and `commonmark_x` as raw formats.++ * RST writer:++ + Fix bug with dropped content from inside spans with a class in+ some cases (#7039).++ * Docx writer:++ + Handle table header using styles (#7008). Instead of hard-coding+ the border and header cell vertical alignment, we now let this+ be determined by the Table style, making use of Word's+ "conditional formatting" for the table's first row. For+ headerless tables, we use the tblLook element to tell Word+ not to apply conditional first-row formatting.++ * Commonmark writer:++ + Implement start number on ordered lists (#7009). Previously they always+ started at 1, but according to the spec the start number is respected.++ * HTML writer:++ + Fix implicit_figure at end of footnotes (#7006).++ * ConTeXt template: Remove `\setupthinrules` from default template.+ The width parameter this used is not actually supported,+ and the command didn't do anything.++ * Text.Pandoc.Extensions:++ + Add `Ext_element_citations` constructor (Albert Krewinkel).++ * Text.Pandoc.Citeproc.BibTeX: New unexported function+ `writeBibtexString`.++ * Text.Pandoc.Citeproc:++ + Use finer grained imports (Albert Krewinkel).+ + Factor out and export `getStyle` [API change].+ + Export `getReferences` [API change, #7106].+ + Factor out getLang.++ * Text.Pandoc.Parsing: modify `gridTableWith'` for headerless tables.+ If the table lacks a header, the header row should be an empty+ list. Previously we got a list of empty cells, which caused+ an empty header to be emitted instead of no header. In LaTeX/PDF+ output that meant we got a double top line with space between.++ * ImageSize: use `viewBox` for SVG if no length, width attributes (#7045).+ This change allows pandoc to extract size information from more SVGs.++ * Add simple default.nix.++ * Use commonmark 0.1.1.3.++ * Use citeproc 0.3.0.5.++ * Update default CSL to use latest chicago-author-date.csl.++ * CONTRIBUTING.md: add note on GNU xargs.++ * MANUAL.txt:++ + Update description of `-L`/`--lua-filter`.+ + Document use of citations in note styles (#6828).++## pandoc 2.11.3.2 (2020-12-29)++ * HTML reader: use renderTags' from Text.Pandoc.Shared (Albert Krewinkel).+ A side effect of this change is that empty `<col>` elements are written+ as self-closing tags in raw HTML blocks.++ * Asciidoc writer: Add support for writing nested tables (#6972, timo-a).+ Asciidoc supports one level of nesting. If deeper tables are to be+ written, they are omitted and a warning is issued.++ * Docx writer: fix nested tables with captions (#6983).+ Previously we got unreadable content, because docx seems+ to want a `<w:p>` element (even an empty one) at the end of+ every table cell.++ * Powerpoint writer: allow arbitrary OOXML in raw inline elements+ (Albert Krewinkel). The raw text is now included verbatim in the+ output. Previously is was parsed into XML elements, which prevented+ the inclusion of partial XML snippets.++ * LaTeX writer: support colspans and rowspans in tables (#6950,+ Albert Krewinkel). Note that the multirow package is needed for+ rowspans. It is included in the latex template under a variable,+ so that it won't be used unless needed for a table.++ * HTML writer: don't include p tags in CSL bibliography entries+ (#6966). Fixes a regression in 2.11.3.++ * Add `meta-description` variable to HTML templates (#6982). This+ is populated by the writer by stringifying the `description`+ field of metadata (Jerry Sky). The `description` meta tag will+ make the generated HTML documents more complete and SEO-friendly.++ * Citeproc: fix handling of empty URL variables (`DOI`, etc.).+ The `linkifyVariables` function was changing these to links+ which then got treated as non-empty by citeproc, leading+ to wrong results (e.g. ignoring nonempty URL when empty DOI is present).+ See jgm/citeproc#41.++ * Use citeproc 0.3.0.3. Fixes an issue in author-only citations when+ both an author and translator are present, and an issue with+ citation group delimiters.++ * Require texmath 0.12.1. This improves siunitx support in math,+ fixes bugs with `\*mod` family operators and arrays, and avoids+ italicizing symbols and operator names in docx output.++ * Ensure that the perl interpreter used for filters with `.pl`+ extension (wuffi).++ * MANUAL: note that textarea content is never parsed as Markdown+ (Albert Krewinkel).+++## pandoc 2.11.3.1 (2020-12-18)++ * Added some missing files to extra-source-files and data+ files, so they are included in the sdist tarball. Closes #6961.+ Cleaned up some extraneous data and test files, and added+ a CI check to ensure that the test and data files included+ in the sdist match what is in the git repository.++ * Use citeproc 0.3.0.1, which avoids removing nonbreaking+ space at the end of the `initialize-with` attribute. (Some+ journals require nonbreaking space after initials, and this+ makes that possible.)++## pandoc 2.11.3 (2020-12-17)++ * With `--bibliography` (or `bibliography` in metadata), a+ URL may now be provided, and pandoc will fetch the resource.+ In addition, if a file path is provided and it is not+ found relative to the working directory, the resource+ path will be searched (#6940).++ * Add `sourcepos` extension for `commonmark`, `gfm`, `commonmark_x`+ (#4565). With the `sourcepos` extension set set, `data-pos`+ attributes are added to the AST by the commonmark reader. No other+ readers are affected. The `data-pos` attributes are put on elements+ that accept attributes; for other elements, an enlosing Div or Span+ is added to hold the attributes.++ * Change extensions for `commonmark_x`: replace `auto_identifiers`+ with `gfm_auto_identifiers` (#6863). `commonmark_x` never actually+ supported `auto_identifiers` (it didn't do anything), because the+ underlying library implements gfm-style identifiers only. Attempts+ to add the `auto_identifiers` extension to `commonmark` will now+ fail with an error.++ * HTML reader:++ + Split module into several submodules (Albert Krewinkel). Reducing+ module size should reduce memory use during compilation.+ + Support advanced table features (Albert Krewinkel):+ block level content in captions, row and colspans,+ body headers, row head columns, footers, attributes.+ + Disable round-trip testing for tables. Information for cell+ alignment in a column is not preserved during round-trips (Albert+ Krewinkel).+ + Allow finer grained options for tag omission (Albert Krewinkel).+ + Simplify list attribute handling (Albert Krewinkel).+ + Pay attention to `lang` attributes on body element (#6938).+ These (as well as `lang` attributes on the html element) should update+ lang in metadata.+ + Retain attribute prefixes and avoid duplicates (#6938).+ Previously we stripped attribute prefixes, reading `xml:lang` as+ `lang` for example. This resulted in two duplicate `lang`+ attributes when `xml:lang` and `lang` were both used. This commit+ causes the prefixes to be retained, and also avoids invald+ duplicate attributes.++ * Commonmark reader:++ + Refactor `specFor`.+ + Set input name to `""` to avoid clutter in sourcepos output.++ * Org reader:++ + Parse `#+LANGUAGE` into `lang` metadata field (#6845, Albert+ Krewinkel).+ + Preserve targets of spurious links (#6916, Albert+ Krewinkel). Links with (internal) targets that the reader doesn't+ know about are converted into emphasized text. Information on the+ link target is now preserved by wrapping the text in a Span of class+ `spurious-link`, with an attribute `target` set to the link's+ original target. This allows to recover and fix broken or unknown+ links with filters.++ * DocBook reader:++ + Table text width support (#6791, Nils Carlson).+ Table width in relation to text width is not natively supported+ by docbook but is by the docbook `fo` stylesheets through an XML+ processing instruction, `<?dbfo table-width="50%"?>`.++ * LaTeX reader:++ + Improve parsing of command options (#6869, #6873).+ In cases where we run into trouble parsing inlines til the+ closing `]`, e.g. quotes, we return a plain string with the+ option contents. Previously we mistakenly included the brackets+ in this string.+ + Preserve center environment (#6852, Igor Pashev).+ The contents of the `center` environment are put in a `Div`+ with class `center`.+ + Don't parse `\rule` with width 0 as horizontal rule. These are+ sometimes used as spacers in LaTeX.+ + Don't apply theorem default styling to a figure inside (#6925).+ If we put an image in italics, then when rendering to Markdown+ we no longer get an implicit figure.++ * Dokuwiki reader:++ + Handle unknown interwiki links better (#6932).+ DokuWiki lets the user define his own Interwiki links. Previously+ pandoc reacted to these by emitting a google search link, which is+ not helpful. Instead, we now just emit the full URL including the+ wikilink prefix, e.g. `faquk>FAQ-mathml`. This at least gives users+ the ability to modify the links using filters.++ * Markdown writer:++ + Properly handle boolean values in writing YAML metadata (#6388).+ + Ensure that a new csl-block begins on a new line (#6921).+ This just looks better and doesn't affect the semantics.++ * RST writer:++ + Better image handling (#6948). An image alone in its paragraph+ (but not a figure) is now rendered as an independent image, with an+ `alt` attribute if a description is supplied. An inline image that+ is not alone in its paragraph will be rendered, as before, using a+ substitution. Such an image cannot have a "center", "left", or+ "right" alignment, so the classes `align-center`, `align-left`, or+ `align-right` are ignored. However, `align-top`, `align-middle`,+ `align-bottom` will generate a corresponding `align` attribute.++ * Docx writer:++ + Keep raw openxml strings verbatim (#6933, Albert Krewinkel).+ + Use Content instead of Element. This allows us to inject+ raw OpenXML into the document without reparsing it into an+ Element, which is necessary if you want to inject an open+ tag or close tag.+ + Fix bullets/lists indentation, so that the first level is slightly+ indented to the right instead of right on the margin (cholonam).+ + Support bold and italic in "complex script" (#6911).+ Previously bold and italics didn't work properly in LTR+ text. This commit causes the w:bCs and w:iCs attributes+ to be used, in addition to w:b and w:i, for bold and+ italics respectively.++ * ICML writer:++ + Fix image bounding box for custom widths/heighta (Mauro Bieg, #6936).++ * LaTeX writer:++ + Improve table spacing (#6842, #6860).+ Remove the `\strut` that was added at the end of minipage+ environments in cells. Replace `\tabularnewline` with+ `\\ \addlinespace`.+ + Improve calculation of column spacing (#6883).+ + Extract table handling into separate module (Albert Krewinkel).+ + Fix bug with nested `csl-` display Spans (#6921).+ + Improve longtable output (#6883). Don't create minipages for+ regular paragraphs. Put width and alignment information in the+ longtable column descriptors.++ * OpenDocument writer:++ + Support for table width as a percentage of text width+ (#6792, Nils Carson).+ + Implement Div and Span ident support (#6755, Nils Carson).+ Spans and Divs containing an ident in the Attr will become bookmarks+ or sections with idents in OpenDocument format.+ + Add two extensions, `xrefs_name` and `xrefs_number` (#6774, Nils+ Carlson). Links to headings, figures and tables inside the+ document are substituted with cross-references that will use the+ name or caption of the referenced item for `xrefs_name` or the+ number for `xrefs_number`. For the `xrefs_number` to be useful+ heading numbers must be enabled in the generated document and+ table and figure captions must be enabled using for example the+ `native_numbering` extension. In order for numbers and reference+ text to be updated the generated document must be refreshed.++ * JATS writer:++ + Support advanced table features (Albert Krewinkel).+ + Support author affiliations (#6687, Albert Krewinkel).++ * Docbook writer:++ + Use correct id attribute consistently (Jan Tojnar).+ DocBook5 should always use `xml:id` instead of `id`.+ + Handle admonition titles better (Jan Tojnar).+ Docbook reader produces a `Div` with `title` class for `<title>`+ element within an “admonition” element. Markdown writer then turns+ this into a fenced div with `title` class attribute. Since fenced+ divs are block elements, their content is recognized as a+ paragraph by the Markdown reader. This is an issue for Docbook+ writer because it would produce an invalid DocBook document from+ such AST – the `<title>` element can only contain “inline”+ elements. Handle this special case separately by unwrapping+ the paragraph before creating the `<title>` element.+ + Add XML namespaces to top-level elements (#6923, Jan Tojnar).+ Previously, we only added `xmlns` attributes to chapter+ elements, even when running with `--top-level-division=section`.+ These namespaces are now added to part and section elements too,+ when they are the selected top-level divisions.+ We do not need to add namespaces to documents produced with+ `--standalone` flag, since those will already have xmlns attribute on+ the root element in the template.++ * HTML writer:++ + Fix handling of nested `csl-` display spans (#6921).+ Previously inner Spans used to represent CSL display attributes were+ not rendered as div tags as intended.++ * EPUB writer:++ + Include title page in landmarks (#6919).+ Note that the toc is also included if `--toc` is specified.+ + Add frontmatter type on body element for nav.xhtml (#6918).++ * EPUB templates: use preserveAspectRatio="xMidYMid" for cover image (#6895,+ Shin Sang-jae). This change affects both the epub2 and the epub3+ templates. It avoids distortion of the cover image by requiring that the+ aspect ratio be preserved.++ * LaTeX template:++ + Include `csquotes` package if `csquotes` variable set.+ + Put back `amssymb`. We need it for checkboxes in todo lists,+ and maybe for other things. In this location it seems compatible+ with the cases that prompted #6469 and PR #6762.+ + Disable language-specific shorthands in babel (#6817, #6887).+ Babel defines "shorthands" for some languages, and these can+ produce unexpected results. For example, in Spanish, `1.22`+ gets rendered as `122`, and `et~al.` as `etal`.+ One would think that babel's `shorthands=off` option (which+ we were using) would disable these, but it doesn't. So we+ remove `shorthands=off` and add some code that redefines+ the shorthands macro. Eventually this will be fixed in babel,+ I hope, and we can revert to something simpler.++ * JATS template: allow array of persistent institute ids in `pid`+ (Albert Krewinkel).++ * Text.Pandoc.Parsing: minor code and efficiency improvements.++ * Text.Pandoc.Extension:++ + Add `Ext_sourcepos` constructor for `Extension` [API change].+ + Add `Ext_xrefs_name` and `Ext_xrefs_number` constructors for+ `Extension` (Nils Carson) [API change].++ * Text.Pandoc.Citeproc:++ + Fix truncation of `[Citation]` list in `Cite` inside footnotes (#6890).+ This affected author-in-text citations in footnotes. It didn't cause+ problems for the printed output, but for filters that expected the+ citation id and other information.+ + Allow the use of both inline and external references (#6951),+ as with pandoc-citeproc. References defined in the document's+ metadata take priority over references with the same id defined in+ an external bibliography.+ + Use `fetchItem` to get external bibliography (#6940).+ + Ensure that BCP47 lang codes can be used. We ignore the variants+ and just use the base lang code and country code when passing off+ to citeproc.+ + Citeproc BibTeX parser: revert change in `getRawField`+ which was made (for reasons forgotten) when transferring+ this code from pandoc-citeproc. The change led to `--` in+ URLs being interpreted as en-dashes, which is unwanted (#6874).++ * Text.Pandoc.ImageSize:++ + Default to DPI 72 if the format specifies DPI of 0 (#6880).+ This shouldn't happen, in general, but it can happen with+ JPEGs that don't conform to the spec. Having a DPI of 0+ will blow up size calculations (division by 0).+ + ImageSize: use JuicyPixels to determine size for png, jpeg, and+ gif, instead of doing our own binary parsing (#6936). This+ gives more reliable results.++ * Text.Pandoc.CSS:++ + Remove `foldOrElse` (internal module) (Albert Krewinkel).++ * Use skylighting 0.10.2 (#6625).++ * Use citeproc 0.3. This fixes issues with references with+ duplicate ids (jgm/citeproc#36).++ * Use doctemplates 0.9. This fixes issues with boolean+ metadata values in the Markdown writer (#6388)+ and in `meta-json` (#6650). It also fixes+ issues with nested for loops in templates.++ * Add translations zh-Hans.yaml and zh-Hant.yaml (#6904, #6909,+ Kolen Cheung, taotieren).++ * Add tests: True to cabal.project.+ This fixes some CI failures for cabal.++ * Normalize test/tables/*.native (#6888, Kolen Cheung).++ * Move executable to `app` directory to avoid problems with cabal repl.++ * CONTRIBUTING: add section "How can I help?" (#6892, Albert Krewinkel).+ Also adds a paragraph aimed at highlighting the importance of feature+ maintenance.++ * MANUAL: Document that --number-sections works in `ms` (#6935).+++## pandoc 2.11.2 (2020-11-19)++ * Default to using ATX (`##`-style) headings for Markdown output+ (#6662, Aner Lucero). Previously we used Setext (underlined) headings+ by default for levels 1--2.++ * Add option `--markdown-headings=atx|setext`, and deprecate+ `--atx-headers` (#6662, Aner Lucero).++ * Support `markdown-headings` in defaults files.++ * Fix corner case in YAML metadata parsing (#6823). Previously YAML+ metadata would sometimes not get recognized if a field ended with a+ newline followed by spaces.++ * `--self-contained`: increase coverage (#6854).+ Previously we only self-contained attributes for certain tag names+ (`img`, `embed`, `video`, `input`, `audio`, `source`, `track`,+ `section`). Now we self-contain any occurrence of `src`,+ `data-src`, `poster`, or `data-background-image`, on any tag; and+ also `href` on `link` tags.++ * Markdown reader:++ + Fix detection of locators following in-text citations.+ Prevously, if we had `@foo [p. 33; @bar]`, the `p. 33` would be+ incorrectly parsed as a prefix of `@bar` rather than a suffix of+ `@foo`.+ + Improve period suppression algorithm for citations in notes+ in note citation styles (#6835).+ + Don't increment `stateNoteNumber` for example list references.+ This helps with #6836 (a bug in which example list references+ disturb calculation of citation note number and affect when+ `ibid` is triggered).++ * LaTeX reader:++ + Move `getNextNumber` from Readers.LaTeX to Readers.LaTeX.Parsing.+ + Fix negative numbers in siunitx commands. A change in pandoc 2.11+ broke negative numbers, e.g. `\SI{-33}{\celcius}` or `\num{-3}`.+ This fixes the regression.++ * DocBook reader: drop period in formalpara title+ and put it in a div with class `formalpara-title`, so that+ people can reformat with filters (#6562).++ * Man reader: improve handling of `.IP` (#6858). We now better handle+ `.IP` when it is used with non-bullet, non-numbered lists, creating a+ definition list. We also skip blank lines like groff itself.++ * Bibtex reader: fall back on `en-US` if locale for LANG not found.+ This reproduces earlier pandoc-citeproc behavior (jgm/citeproc#26).++ * JATS writer:++ + Wrap all tables (Albert Krewinkel).+ All `<table>` elements are put inside `<table-wrap>` elements, as the+ former are not valid as immediate child elements of `<body>`.+ + Move Table handling to separate module (Albert Krewinkel).+ Adds two new unexported modules:+ Text.Pandoc.Writers.JATS.Types, Text.Pandoc.Writers.JATS.Table.++ * Org writer:++ + Replace org #+KEYWORDS with #+keywords (TEC).+ As of ~2 years ago, lower case keywords became the standard (though+ they are handled case insensitive, as always).+ + Update org supported languages and identifiers according to the+ current list contained in+ <https://orgmode.org/worg/org-contrib/babel/languages/index.html>+ (TEC).++ * Only use `filterIpynbOutput` if input format is ipynb (#6841).+ Before this change content could go missing from divs with class+ `output`, even when non-ipynb was being converted.++ * When checking reader/writer name, check base name now that we permit+ extensions on formats other than markdown.++ * Text.Pandoc.PDF: Fix `changePathSeparators` for Windows (#6173).+ Previously a path beginning with a drive, like `C:\foo\bar`, was+ translated to `C:\/foo/bar`, which caused problems.+ With this fix, the backslashes are removed.++ * Text.Pandoc.Logging:++ + Add constructor `ATXHeadingInLHS` to `LogMessage` [API change].+ + Add constructor `EnvironmentVariableUndefined` to+ `LogMessage` [API change].++ * Fix error that is given when people specify `doc` output (#6834,+ gison93).++ * LaTeX template: add a `\break` after parbox in `CSLRightInline`.+ This should fix spacing problems between entries with numeric styles.+ Also fix number of params on `CSLReferences`.++ * reveal.js template: Put quotes around `controlsLayout`,+ `controlsBackArrows`, and `display`, since these require strings.+ Add `showSlideNumber`, `hashOneBasedIndex`, `pause`.++ * Use citeproc 0.2. This fixes a bug with title case around parentheses.++ * pandoc.cabal: remove 'static' flag.+ This isn't really necessary and can be misleading (e.g. on macOS,+ where a fully static build isn't possible). cabal's new option+ `--enable-executable-static` does the same. On stack you can add+ something like this to the options for your executable in package.yaml:++ ld-options: -static -pthread++ * Remove obsolete bibutils flag setting in `linux/make_artifacts.sh`.++ * Manual:++ + Correct `link-citation` -> `link-citations`.+ + Add a sentence about `pagetitle` for HTML (#6843, Alex Toldaiev).++ * INSTALL.md: Remove references to `pandoc-citeproc` (#6857).++ * CONTRIBUTING: describe hlint and how it's used (#6840, Albert+ Krewinkel).++## pandoc 2.11.1.1 (2020-11-07)++ * Citeproc: improve punctuation in in-text note citations (#6813).+ Previously in-text note citations inside a footnote would sometimes have+ the final period stripped, even if it was needed (e.g. on the end of+ 'ibid').++ * Use citeproc 0.1.1.1. This improves the decision about when+ to use `ibid` in cases where citations are used inside+ a footnote (#6813).++ * Support `nocase` spans for `csljson` output.++ * Require latest commonmark, commonmark-extensions.+ This fixes a bug with `autolink_bare_uris` and commonmark.++ * LaTeX reader: better handling of `\\` inside math in table cells (#6811).++ * DokuWiki writer: translate language names for code elements+ and improve whitespace (#6807).++ * MediaWiki writer: use `syntaxhighlight` tag instead of deprecated+ `source` for highlighted code (#6810). Also support `startFrom`+ attribute and `numberLines`.++ * Lint code in PRs and when committing to master (#6790,+ Albert Krewinkel).++ * doc/filters.md: describe technical details of filter invocations (#6815,+ Albert Krewinkel).+++## pandoc 2.11.1 (2020-11-03)++ * DocBook Reader: fix duplicate bibliography bug (#6773, Nils Carlson).++ * HTML reader:++ + Parse contents of iframes (#6770).+ + Parse inline svg as image unless `raw_html` is set in the reader (in+ which case the svg is passed through as raw HTML) (#6770).++ * LaTeX reader:++ + Fix bug parsing macro arguments (#6796). If `\cL` is+ defined as `\mathcal{L}`, and `\til` as `\tilde{#1}`, then+ `\til\cL` should expand to `\tilde{\mathcal{L}}`, but+ pandoc was expanding it to `\tilde\mathcal{L}`. This is+ fixed by parsing the arguments in "verbatim mode" when the+ macro expands arguments at the point of use.+ + Properly support optional (cite) argument for+ `\blockquote` from `csquotes` (#6802).++ * LaTeX writer: Improved calculation of table column widths.+ We now have LaTeX do the calculation, using `\tabcolsep`.+ So we should now have accurate relative column widths no+ matter what the text width. The default template has been modified to load+ the calc package if tables are used.++ * HTML writer: Fix duplicate "class" attribute for table+ rows (Andy Morris).++ * Text.Pandoc.Filter: allow shorter YAML representation of Citeproc+ (Albert Krewinkel). The map-based YAML representation of filters expects+ `type` and `path` fields. The path field had to be present for all filter+ types, but is not used for citeproc filters. The field can now be omitted+ when type is "citeproc", as described in the MANUAL.++ * Text.Pandoc.Error: Add `PandocBibliographyError` constructor+ for `PandocError` [API change]. This ensures that bibliography parsing+ errors generate messages that include the bibliography file name --+ otherwise it can be quite mysterious where it is coming from.++ * Citeproc: properly handle `csl` field with `data:` URI (#6783).+ This is used with the JATS writer, so this fixes a regression+ in pandoc 2.11 with JATS output and citeproc.++ * Allow `citation-abbreviations` in defaults file.++ * JATS templates: ensure `jats_publishing` output is valid+ (Albert Krewinkel).++ * LaTeX template: Fix `CSLRightInline`, so that it does not+ run over the right margin.++ * HTML template: default CSS tweaks (Mauro Bieg and John+ MacFarlane).++ - Fix margin before codeblock+ - Add `monobackgroundcolor` variable, making the background color+ and padding of code optional.+ - Ensure that backgrounds from highlighting styles take precedence over+ monobackgroundcolor+ - Remove list markers from TOC+ - Add margin-bottom where needed+ - Remove italics from blockquote styling+ - Change borders and spacing in tables to be more consistent with other+ output formats+ - Style h5, h6+ - Set font-size for print media to 12pt.+ - Reduce interline space.+ - Reduce interparagraph space.+ - Reduce line width.+ - Remove the special `line-height: 1` for table cells.+ - Remove the special line-height for pre.+ - Ensure that there is a bit more space before a heading+ than after.+ - Slightly reduced space after title header.+ - Add CSS example to MANUAL++ * man template: Change comment that triggers `tbl` from+ `.\"t` to `'\" t`, as specified in groff_man(7) (#6803).++ * Use latest commonmark, commonmark-extensions.+ This fixes a bug with nested blocks in footnotes with the+ `footnote` extension to `commonmark`. See jgm/commonmark-hs#63.++ * Citeproc: use comma for in-text citations inside footnotes.+ When an author-in-text citation like `@foo` occurs in a footnote,+ we now render it with: `AUTHOR NAME + COMMA + SPACE + REST`.+ Previously we rendered: `AUTHOR NAME + SPACE + "(" + REST + ")"`.+ This gives better results. Note that normal citations are still+ rendered in parentheses.++ * Use latest citeproc:++ + citeproc no longer capitalizes notes, so we do it+ in pandoc when appropriate.+ + Closes #6783.++ * Clarify manual on `--track-changes` (#6801).++ * Add `doc/jats.md` to document pandoc's handling of JATS+ (#6794, Albert Krewinkel).++ * Fix code example in lua-filters.md (#6795).++## pandoc 2.11.0.4 (2020-10-21)++ * Commonmark writer: fix regression with fenced divs (#6768).+ Starting with 2.10.1, fenced divs no longer render with+ HTML div tags in commonmark output. This is a regression+ due to our transition from cmark-gfm. This commit fixes it.++ * Use released version of citeproc. (This fixes a mis-step+ in the 2.11.0.3 release, which is now deprecated.)++ * Use latest sylighting, with support for `groovy`.++ * Document that --html-q-tags requires the smart extension on the reader+ (#6766).++## pandoc 2.11.0.3 (2020-10-20)++ * Use latest citeproc (closes #6765). This fixes a problem with+ author-in-text citations for references including both an author+ and an editor. Previously, both were included in the text, but only+ the author should be.++ * With `--citeproc`, ensure that the final period is removed when+ citations that occur in notes in note-based styles get put in+ parentheses. See jgm/citeproc#20.++ * Normalize rewritten image paths with `--extract-media` (#6761).+ This change will avoid mixed paths like this one when+ `--extract-media` is used with a Word file:+ ``. Instead we'll get+ ``.++ * Modify `--version` output. Use space more efficiently and report the+ citeproc and ipynb versions, along with skylighting, texmath, and+ pandoc-types. Drop the word "default" before "user data directory."++ * DocBook reader: bibliomisc and anchor support (#6754, Nils Carlson).+ Also ensure that bibliodiv without a title no longer results in+ an empty Header.++ * ConTeXt template: adds `\setupinterlinespace` to fonts larger+ than normal (#6763, Denis Maier).++ * LaTeX template: Do not load amssymb if not needed (#6469, Angelo Peronio).+ See <https://tex.stackexchange.com/a/549938>.++ * Relax upper bound on hslua, allow hslua-1.3.* (Albert Krewinkel).++ * MANUAL:++ + Improve explanation of "indent" variable (#6767, Cyrus Yip).+ + Remove org from list of input formats supporting raw_tex (#6753,+ Nick Fleisher).+++## pandoc 2.11.0.2 (2020-10-15)++ * Fix handling of `xdata` in bibtex/biblatex bibliographies (#6752).++ * Fix some small typos in the API documentation (#6751, Michael Hoffmann).++ * Require citeproc 0.1.0.2. This fixes a regression from pandoc-citeproc+ involving spacing between components of a reference in certain styles+ (e.g. `cell.csl`).++ * Fix typos in comments, doc strings, error messages, and tests+ (Albert Krewinkel, #6738).++## pandoc 2.11.0.1 (2020-10-13)++ * LaTeX reader: support more acronym commands (#6746):+ `\acl`, `\aclp`, and capitalized versions of already+ supported commands.++ * Commonmark reader: add `pipe_table` extension *after* defaults (#6739).+ Otherwise we get bad results for non-table, non-paragraph+ lines containing pipe characters.++ * Markdown writer: Fix autolinks rendering for gfm (#6740).+ Previously, autolinks rendered as raw HTML, due to the+ `class="uri"` added by pandoc's markdown reader.++ * LaTeX writer:++ + Escape option values in lstlistings environment (#6742).+ + Fix handling of `lang` `pt-BR` (#2953). For polyglossia we now+ use `\setmainlanguage[variant=brazilian]{portuguese}` and for babel+ `\usepackage[shorthands=off,main=brazilian]{babel}`.++ * Depend on latest citeproc (0.1.0.1).++ + This fixes the citation number issue with ieee.csl and other+ styles that do not explicitly sort bibliographies (#6741). (Pandoc+ was numbering them by their order in the bibliography file,+ rather than the order cited, as required by the CSL spec.)+ + Fixes groupin/collapsing with citation items with prefixes.++ * default.latex: fix `CSLReference` macro definition.++ * Fix MANUAL.txt CSL JSON conversion examples.++ * Fix spelling errors in changelog, MANUAL.txt, `doc/org.md` (#6738).+++## pandoc 2.11 (2020-10-11)++ * Add `--citeproc` (`-C`) option to trigger built-in citation processing.+ It is no longer necessary to use the external `pandoc-citeproc`+ filter. `--citeproc` behaves like a filter and can be positioned+ relative to other filters as they appear on the command line.++ The new built-in citation processing uses the citeproc library,+ a reimplementation of CSL citation processing that fixes many+ of the shortcomings of pandoc-citeproc. In general, citation+ processing should work much the same as it did with pandoc-citeproc,+ but with greater fidelity to CSL styles and better performance.+ (The tests from the pandoc-citeproc package have been carried+ over to pandoc.) The following differences should be noted:++ - At this point, only some of the writers (HTML, ms, LaTeX) properly+ interpret CSL display styles. You should get decent output in+ all formats (at least as good as with pandoc-citeproc), but+ indentation and block-alignment may not be right.++ - pandoc-citeproc searches the `~/.csl` directory for `.csl`+ styles. Pandoc instead searches the `csl` subdirectory of+ the pandoc user data directory (e.g., `~/.pandoc/csl` or+ `~/.local/share/pandoc/csl`). Users who already keep+ CSL styles in `~/.csl` may find it convenient to add a+ symlink.++ - Some of the bibliography formats supported by pandoc-citeproc (via+ hs-bibutils) are no longer supported: Copac, EndNote,+ ISI, MEDLINE, MODS, and RIS. If you use one of these formats,+ you may use the `bibutils` utility to convert to BibLaTeX.+ We now support only BibTeX, BibLaTeX, CSL JSON,+ and pandoc's YAML/Markdown analogue of CSL JSON.++ - pandoc-citeproc would always retrieve the independent parent+ of a dependent style by doing an HTTP request. pandoc will+ now first seek the independent parent locally (in the resource+ path or in the `csl` subdirectory of the pandoc user data+ directory) before resorting to HTTP. In addition, you may+ omit the `.csl` extension, e.g. `--csl zoology`.++ - Using the `--bibliography` option (or including+ `bibliography` in YAML metadata) no longer triggers+ citation processing implicitly: one must always use the+ `--citeproc` option if citation processing is wanted.++ * Add `csljson` as and input and output format. This allows pandoc+ to convert between `csljson` and other bibliography formats+ (e.g. `-f csljson -t markdown -s` or `-f bibtex -t csljson`),+ and to generate formatted versions of CSL JSON bibliographies+ (e.g., `pandoc -f csljson --citeproc pl.json -o pl.pdf`).++ * Added `bibtex`, `biblatex` as input formats. This allows pandoc+ to convert between BibLaTeX and BibTeX and other bibliography formats,+ and to generated formatted versions of BibTeX/BibLaTeX bibliographies+ (e.g., `pandoc -f biblatex --citeproc pl.bib -o pl.pdf`).++ * Raise informative errors when YAML metadata parsing fails (#6730).+ Previously the command would succeed, returning empty metadata,+ with no errors or warnings.++ * Sort languages in `--list-highlight-languages` output (#6718,+ Albert Krewinkel). Languages were previously sorted by their+ long name, which leads to unexpected results).++ * Add CSS to default HTML template (#6601, Mauro Bieg). This+ greatly improves the default typography in pandoc's HTML+ output. The CSS is sensitive to a number of variables+ (e.g. `mainfont`, `fontsize`, `linestretch`): see the manual for+ details. To restore the earlier, more spartan output, you can+ disable this with `-M document-css=false`.++ * Support `--toc-depth` option for ODT writer (#6696, niszet).++ * Fix issues with Windows UNC paths with some options (#5127).++ * Remove `fenced_code_blocks` and `backtick_code_blocks` from allowed+ `commonmark` and `gfm` extensions. These shouldn't really be counted+ as extensions, because they can't be disabled in commonmark.+ Adjust markdown writer to check for the commonmark variant in addition+ to extensions.++ * Add these extensions to `gfm` and `commonmark`:+ `fenced_code_blocks`, `backtick_code_blocks`, `fenced_code_attributes`.+ These can't really be disabled in the reader, but they need to be enabled+ in the writer or we just get indented code.++ * Make sure proper set of extensions is recognized for `commonmark_x`.++ * Allow `gfm_auto_identifiers`, `ascii_identifiers` extensions for `docx`.++ * Markdown reader:++ + Add `Maybe FilePath` parameter to `yamlToMeta` [API change].+ + Export `yamlToRefs` [API change], a version of `yamlToMeta`+ specialized to references.+ + Set `citationNoteNum` accurately in citations.+ + Revise abbreviation support. Don't insert a nonbreaking space after a+ potential abbreviation if it comes right before a note or citation.+ This causes problems for citeproc's moving of note citations.++ * LaTeX reader:++ + Support missing siunitx commands (#6658).+ + Support `squared`, `cubed`, `tothe` in siunitx (#6657).+ + Improved uncertainty handling in slunitx.+ + Factored out siunitx stuff into separate unexposed module.+ + Fix improper empty cell filtering (#6689, Christian Despres).+ + Fix parsing of "show name" in `\newtheorem` (#6734).+ Previously we were just treating it as a string and+ ignoring accents and formatting.+ + Prevent wrong nesting of `\multirow` and `\multicolumn` table+ cells (#6603, Laurent P. René de Cotret).+ + Table cell parser not consuming spaces correctly (#6596,+ Laurent P. René de Cotret).+ + Change `SIRange` to `SIrange` (#6617, Emerson Harkin).+ + Allow blank lines inside `\author` (#6324).++ * DocBook reader:++ + Don't squelch space at end of emphasis and other inline elements;+ instead, move it outside the element (#6719).+ + Implement table cell alignment (#6698, Nils Carlson).+ + Implement column span support for tables (#6492, Nils Carlson).+ + Update list of block level tags (#6610).+++ * JATS reader:++ + Don't squelch space at end of emphasis and other inline elements;+ instead, move it outside the element (#6719).++ * RST reader:++ + Apply `.. class::` directly to following Header rather than creating+ a surrounding Div (#6699).++ * Docx reader:++ + Allow empty dates in comments and tracked changes (#6726, Diego+ Balseiro).++ * Markdown writer:++ + Be less aggressive about using quotes for YAML values,+ allowing e.g. a quotation mark or bracket as long as it's not at the+ beginning of the line.+ + Use double quotes for YAML metadata (#6727).+ + Sort YAML metadata keys in Markdown output case-insensitive.+++ * Asciidoc writer:++ + Support asciidoctor's block figures (#6538, argent0).++ * LaTeX writer:++ + Fix spacing issue with list in definition list.+ When a list occurs at the beginning of a definition list definition,+ it can start on the same line as the label, which looks bad.+ Fix that by starting such lists with an `\item[]`.++ * HTML writer:++ + Support intermediate table headers (#5314, Albert Krewinkel).+ + Support attributes on all table elements (Albert Krewinkel).+ + Render table footers if present (#6314, Albert Krewinkel).+ + Fix addition of `doc-biblioentry` role.+ + Support colspans and rowspans in HTML tables (#6312, Albert Krewinkel).++ * ICML writer:++ + Support internal document links (#5541, Leonard Rosenthol).+ + Changed default link state to invisible (#6676, Leonard Rosenthol).++ * Docx writer:++ + Better handle list items whose contents are lists (#5948, Michael+ Hoffmann). If the first element of a bulleted or ordered list is+ another list, then that first item would previously disappear if the+ target format is docx.+ + Separate adjacent tables (#4315). Word combines adjacent tables,+ so to prevent this we insert an empty paragraph between two+ adjacent tables.++ * Org writer:++ + Don't force blank line after headings (#6554).++ * OpenDocument writer:++ + Implement table cell alignment (#6700 Nils Carson, Mauro Bieg).+ + New table cell support with row and column spans (#6682, Nils Carson).+ + Syntax highlighting for inline code (#6711, niszet).++ * Add Text.Pandoc.Citeproc module, exporting `processCitations`+ [API change]. This depends on several other, unexported+ modules under Text.Pandoc.Citeproc.++ * Add module Text.Pandoc.Writers.CslJson, exporting `writeCslJson`.+ [API change]++ * Add module Text.Pandoc.Readers.CslJson, exporting `readCslJson`.+ [API change]++ * Add module Text.Pandoc.Readers.BibTeX, exporting `readBibTeX` and+ `readBibLaTeX`. [API change]++ * Text.Pandoc.Filter: Add `CiteprocFilter` constructor to Filter.+ [API change] This runs the processCitations transformation.+ We need to treat it like a filter so it can be placed+ in the sequence of filter runs (after some, before others).+ In FromYAML, this is parsed from `citeproc` or `{type: citeproc}`,+ so this special filter may be specified either way in a defaults file+ (or by `citeproc: true`, though this gives no control of positioning+ relative to other filters).++ * Add new exported module Text.Pandoc.Writers.AnnotatedTable [API change]+ (#6655, Christian Despres). This module (which should generally+ be imported qualified to avoid name conflicts) provides a+ `Table` type that mirrors the structure of a pandoc `Table`,+ but with added inferred information so that the writers do not have to+ lay out tables themselves. The `toTable` and `fromTable` functions convert+ between an annotated `Table` and a regular pandoc `Table`. In addition to+ producing a `Table` with coherent and well-formed annotations, the+ `toTable` function also normalizes its input table like the table+ builder does. Tests ensure that `toTable` normalizes tables exactly+ like the table builder, and that its annotations are coherent.++ * Text.Pandoc.Logging:++ + Remove unused `CouldNotParseYamlMetadata` constructor for `LogMessage`+ [API change].+ + Add `CiteprocWarning` constructor to `LogMessage` [API change].++ * Text.Pandoc.Readers.Metadata: export `yamlBsToRefs` [API change].+ These allow specifying an id filter so we parse only references+ that are used in the document.++ * Text.Pandoc.Parsing:++ + Export ParseError [API change].+ + Add `stateInNote` and `stateNoteNumber` to `ParserState`+ [API change]. These are used to populate note numbers for citation+ processing.++ * Fix apparent typos in sample.lua (#6729, William Lupton).+ Also make the writer less aggressive in escaping quotes.++ * Text.Pandoc.Options:++ + `defaultMathJaxURL`: use `tex-chtml-full` instead of `tex-mml-chtml`+ (#6599, Kolen Cheung). This drops the MathML support (which we+ don't need for HTML math rendering) and includes the full JavaScript,+ which makes it possible to use `--self-contained` (though there may+ still be issues if the required math fonts aren't available). This+ change should also reduce latency in pages with lots of formulas.+ + Add `/tex-chtml-full.js` to `defaultMathJaxURL` (#6593) Previously we+ added this in processing command line options, but not in processing+ defaults files, which was inconsistent.++ * epub.css: Fix cover page selectors and add note explaining their use+ (#6649, a-vrma).++ * Add data files needed for Text.Pandoc.Citeproc: these include+ `default.csl` in the data directory and a `citeproc` directory that+ is only used at compile-time for biblatex localizations. Note that we've+ added `file-embed` as a mandatory rather than a conditional+ dependency, because of the biblatex localization files.++ * Lua filters:++ + Add SimpleTable for backwards compatibility (#6575, Albert Krewinkel).+ A new type `SimpleTable` is made available to Lua filters. It is+ similar to the `Table` type in pandoc versions before 2.10;+ conversion functions from and to the new Table type are provided.+ Old filters using tables now require minimal changes and can use, e.g.,++ if PANDOC_VERSION > {2,10,1} then+ pandoc.Table = pandoc.SimpleTable+ end++ and++ function Table (tbl)+ tbl = pandoc.utils.to_simple_table(tbl)+ …+ return pandoc.utils.from_simple_table(tbl)+ end++ to work with the current pandoc version.++ + Make `attr` argument optional in `Table` constructor (Albert Krewinkel).+ This changes the Lua API. It is highly unlikely for this change to affect+ existing filters, since the documentation for the new Table constructor+ (and type) was incomplete and partly wrong before. The Lua API is now+ more consistent, as all constructors for elements with attributes now+ take attributes as the last parameter.++ * MANUAL.txt:++ * Add a dedicated Citations section which consolidates the information+ the manual used to contain about citation processing, and incorporates+ some information formerly found in the pandoc-citeproc man page.+ + Add note about lualatex using `selnolig`.+ + Remove duplicate `seriespage` (#6568, Blake Eryx).+ + Remove lists of support extensions for markdown variants (#6604).+ Instead, offer the advice to use `--list-extensions=FORMAT`.+ + Fix position of attributes in header (Albert Krewinkel).+ + Delete obsolete section on compact and loose lists (#6684).+++ * doc/lua-filters.md:++ + Add info on how to debug Lua filters (#6732, Ian Max Andolina).+ + Document Underline type and constructor (Albert Krewinkel).+ + Document `body` field (Albert Krewinkel).+ + Add missing header attribute+ + Add missing Link.title field (Albert Krewinkel).+ + Make the setting-the-date example conditional (the-solipsist).+ This makes the example a bit more realistic.+ + Remove outdated link table example.++ * doc/org.md:++ + Add section on tables (Albert Krewinkel).+ + Add section on handling of unknown directives (Albert Krewinkel).++ * CONTRIBUTING.md: fix typo (#6584, Dmitry Volodin).++ * Use golden test framework for command tests. This means that+ `--accept` can be used to update expected output.++ * Use the `smart` extension when generating pandoc's man page (#6613).++ * Release-candidate: don't build windows i386.+ So far we haven't been able to figure out how to get+ stack to use a 32-bit ghc.++ * Use `null` instead of deprecated `Builder.isNull`.++ * Makefile:++ + Fix macospkg target to fetch target from S3 artifacts.+ + Fix pandoc-templates target to include all partials.++ * Remove duplicated dependency in pandoc.cabal (#6591, Felix Yan).++ * Sort build depends in pandoc.cabal alphabetically (#6691,+ Albert Krewinkel).++ * Add .travis.yml for macos release candidate build (#6622).+ We need to build the release candidate on Travis rather+ than GitHub actions, because GH has macos 10.15, and+ binaries compiled on that OS will not work with 10.13.+ This build is only triggered on `rc/*` branches.++ * Remove instructions for building pandoc-citeproc from CI and+ release binary build instructions. We will no longer distribute+ pandoc-citeproc.++ * Fix math rendering in trypandoc (this broke after+ commit d8ad766d17603784b86fc5c2e1b22864125d04d1).++ * Use latest versions of skylighting, commonmark (#6589),+ comonmark-extensions, commonmark-pandoc, texmath.++ * Relax version bounds for hslua, hslua-module-text, bytestring.++ * Use released pandoc-types 1.22. This changes the JSON+ encoding slightly for the new table types introduced+ in 1.21, so they're more consistent with the rest.+ Developers of libraries for pandoc filters will want+ to take note.++ * Fix hlint suggestions, update hlint.yaml (#6680, Christian Despres).++ * Code cleanup (#6678, Joseph C. Sible).++ * Add haddocks to functions in Text.Pandoc.Writers.Shared (Albert+ Krewinkel).++ * Remove duplicate `tshow` definition.++ * Linux release candidate build: use ghc-musl container. This simplifies+ our build process (over using a customized alpine container).+++## pandoc 2.10.1 (2020-07-23)++ * Add `commonmark_x` output format. This is `commonmark` with a number+ of useful pandoc extensions enabled.++ * Many more extensions now work with `commonmark` and `gfm`.++ * Add generic `attributes` extension. This allows attributes to+ be added to any block or inline element in a uniform way. Since+ the Pandoc AST doesn't include attributes on each element type,+ the attributes will sometimes be added by creating a surrounding+ Div or Span container. Currently this extension is only+ compatible with the `commonmark` and `gfm` readers.++ To add an attribute to a block-level element, e.g. a paragraph,+ put it before the block:+ ```+ {#mypara}+ This is a paragraph.+ ```+ Multiple attributes may be used and will be combined:+ ```+ {#mypara}+ {.blue .warning key="val"}+ This is a paragraph.+ ```+ To add an attribute to an inline-level element, put it+ immediately after the element:+ ```+ *emphasized text*{.special}+ ```++ * Support `--number-sections` for docx output (#1413).++ * LaTeX reader:++ + Support `\SIRange` reader (#6418, Emerson Harkin).+ + Support table col-span and row-span (#6311, Laurent P. René de Cotret).+ Supports `\multirow` and `\multicolumn`.+ + Support amsthm: `\newtheorem`, `\theoremstyle`, and theorem and+ proof environments, including labels and references. The only thing+ that is unsupported is the second optional argument, which causes+ numbering to be reset after the specified series is incremented.+ + Moved some code to T.P.LaTeX.Parsing. We need to reduce the size+ of the LaTeX reader to ease compilation on resource-limited systems.++ * RST reader:++ + Fix csv tables with multiline cells (#6549).+ + Fix spurious newlines in some attributes from directives.+ + Avoid extra newline in included code blocks.++ * Commonmark reader:++ + Switch from cmark-gfm to commonmark-hs for commonmark and gfm+ parsing. This avoids depending on a C library+ and allows us to support more pandoc extensions for+ `commonmark` and `gfm`.++ * DocBook reader:++ + Parse releaseinfo as metadata (#6542).++ * Docx reader:++ + Only use `bCs/iCs` on runs with `rtl` or `cs` property (#6514, Nikolay+ Yakimov).+ + Code cleanup/refactoring (Nikolay Yakimov).++ * Org reader (Albert Krewinkel):++ + Respect export setting which disables entities+ MathML-like entities, e.g., `\alpha`, can be disabled with the+ `#+OPTION: e:nil` export setting (Albert Krewinkel).+ + Respect export setting disabling footnotes. Footnotes can be removed+ from the final document with the `#+OPTION: f:nil` export setting.+ + Respect tables-excluding export setting. Tables can be removed from+ the final document with the `#+OPTION: |:nil` export setting.++ * Markdown writer:++ + Move `asciify` out of `escapeString`. Otherwise `unsmartify`+ doesn't catch quotes that have already been turned to entities.+ + Add `writeCommonmark` (new exported function, API change).+ + Use unicode super/subscript characters when possible if the+ `superscript` or `subscript` extension or `raw_html` aren't available.+ + Render caption as following paragraph when `table_caption` extension+ is not enabled.+ + Use numerical labels for reference links that are longer+ than 999 characters or contain square brackets, for conformity+ with commonmark (#6560).++ * Commonmark writer:++ + Instead of using cmark-gfm, use `writeCommonmark` from the+ Markdown writer. This function calls the markdown writer+ with appropriate extensions and a few small modifications+ (e.g. not requiring backslashes before spaces inside+ super/subscripts). With this change `comonmark` and+ `gfm` output can be used with a wider selection of+ extensions.++ * Jira writer: keep image caption as alt attribute (#6529, Albert+ Krewinkel).++ * HTML writer:++ + Improve alt-text/caption handling for HTML5 (#6491, Albert Krewinkel).+ Screen readers read an image's `alt` attribute and the figure caption,+ both of which come from the same source in pandoc. The figure caption is+ hidden from screen readers with the `aria-hidden` attribute. This+ improves accessibility. For HTML4, where `aria-hidden` is not allowed,+ pandoc still uses an empty `alt` attribute to avoid duplicate contents.++ * Ms writer:++ + Fix code highlighting with blank lines. Previously blank lines+ were simply omitted from highlighted code.+ + Escape starting periods in ms writer code blocks (#6505, Michael+ Hoffmann). If a line of ms code block output starts with a period (.),+ it should be prepended by `\&` so that it is not interpreted as a roff+ command.++ * Text.Pandoc.Extensions:++ + Add `raw_markdown` extension (which only affects `ipynb`+ input).+ + Trim down `githubMarkdownExtensions`.+ Previously it included all of the following, which make+ sense for the legacy `markdown_github` but not for `gfm`,+ since they are part of base commonmark and thus+ can't be turned off in `gfm`:++ - `Ext_all_symbols_escapable`+ - `Ext_backtick_code_blocks`+ - `Ext_fenced_code_blocks`+ - `Ext_space_in_atx_header`+ - `Ext_intraword_underscores`+ - `Ext_lists_without_preceding_blankline`+ - `Ext_shortcut_reference_links`++ These have been removed from `githubMarkdownExtensions`, though+ they're still turned on for legacy `markdown_github`.+ + Add `Ext_attributes` constructor for `Extension` [API change].++ * LaTeX template: use selnolig to selectively suppress ligatures with+ lualatex (#6534).++ * Benchmark bytestring readers (Nikolay Yakimov).++ * Documentation:++ + Update using-the-pandoc-api.md (favonia).+ + Fix Typos in lua-filters.md (tajmone).+ + Rewrite Raw HTML/TeX section in MANUAL.txt to avoid duplicate+ headings for the extensions.+ + Fix typo in MANUAL.txt (Benjamin Wuethrich).+ + Remove duplicate 'titlepage' in MANUAL.txt (Blake Eryx).+ + CONTRIBUTING.md: Advertise the official nightlies in GitHub actions.+ Replaces #6500, thanks to @ickc.++++## pandoc 2.10 (2020-06-29)++ * Use pandoc-types 1.21. This adds two things:++ + A native Underline constructor for Inline (#6277, Vaibhav Sagar).+ + More expressive types for tables (#1024, Christian Despres).+ Tables can now take attributes; and rowspans and colspans,+ column headers, multiple row headers, table head and foot+ can all be represented. (Note, however, that reader and+ writer support for these features is still lacking, so+ most users won't see any differences in table conversion+ yet. These changes just lay the foundation for further+ improvements.)++ * Support new Underline element in readers and writers (#6277,+ Vaibhav Sagar).++ * Support new Table type (Christian Despres).+ The Builder.simpleTable now only adds a row to the TableHead+ when the given header row is not null. This uncovered an+ inconsistency in the readers: some would unconditionally+ emit a header filled with empty cells, even if the header+ was not present. Now every reader has the conditional+ behaviour. Only the XWiki writer depended on the header row+ being always present; it now pads its head as necessary.++ * Add an option to disable certificate validation (#6156, Cédric Couralet,+ Cécile Chemin, Juliette Fourcot). This commit adds the option+ `--no-check-certificate`, which disables certificate checking when+ resources are fetched by HTTP.++ * Unify defaults and markdown metadata parsers (#6328, Nikolay+ Yakimov). Clean up code in Text.Pandoc.Readers.Metadata and+ properly handle errors in `yamlToMeta`. This fixes parsing+ of Boolean fields in metadata withinin defaults files and reduces+ code duplication.++ * Docbook reader:++ + Implement `<procedure>` (#6442, Mathieu Boespflug).+ + Implement `<phrase>` (#6438, Mathieu Boespflug).+ + Treat envar and systemitem like code (#6435, Mathieu Boespflug).+ + Implement `<replaceable>` (#6437, Mathieu Boespflug)+ + Map `<simplesect>` to unnumbered section (#6436, Mathieu Boespflug).++ * JATS reader:++ + Handle "label" element in section title (#6288).+ + Parse abstract element into metadata field of same name+ (#6480, Albert Krewinkel).++ * Jira reader (Albert Krewinkel):++ + Resolve multiple parsing problems, including issues with empty+ table cells, faulty recognition of closing emphasis characters, and+ parsing of image attributes (#6212, #6219, #6220).+ + Two consecutive markup chars are now parsed verbatim (#6343);+ styled text must not be empty.+ + Newlines are no longer allowed within styled text (#6325).+ + Links to anchors are now parsed as links (#6407).+ + Retain image attributes (#6234). Jira images attributes as in+ `!image.jpg|align=right!` are retained as key-value pairs. Thumbnail+ images, such as `!example.gif|thumbnail!`, are marked by a+ `thumbnail` class in their attributes.+ + Use Underline for inserted text (#6237). Previously, the span was+ marked with the non-standard class `inserted`.+ + Improve icon conversion for `(/)`, `(x)`, `(!)`, `(?)`+ `(+)`, `(-)`, `(off)`, `(*)`. (#6236, #6264).+ + Support citations, attachment links, and user links (#6231, #6238,+ #6239).+ + Resolve parsing issues of blockquote, color (#6233, #6235).++ * HTML reader:++ + Parse attributes into table attributes.+ + Support `<bdo>` (#5794, Tristan de Cacqueray).+ + Add `summary` to list of block-level HTML tags (#6385).+ This improves support for summary/details inside Markdown.+ NOTE: you need to include a blank line before the closing+ `</details>`, if you want the last part of the content to+ be parsed as a paragraph.+ + Fix parsing unclosed th elements in a table (#6247).++ * Commonmark reader: Implement `implicit_figures` extension (#6350).++ * Markdown Reader:++ + Fix inline code in lists (#6284, Nikolay Yakimov).+ Previously inline code containing list markers was sometimes+ parsed incorrectly.+ + Don't require blank line after grid table (#6481).+ This allows grid tables to be enclosed in fenced divs with no+ intervening blank lines.++ * LaTeX reader:++ + Don't parse beyond `\end{document}` (#6380).+ This required some internal changes to `\subfile` handling.+ + Better handling of `\lettrine`. SmallCaps instead of Span+ for the part after the initial capital. Ensure that both+ arguments are parsed, so that in Markdown both+ are treated as raw LateX. (Closes #6258.)++ * Org reader (Albert Krewinkel):++ + Recognize images with uppercase extensions (#6472).+ + Keep unknown keyword lines as raw org. The lines of unknown+ keywords, like `#+SOMEWORD: value` are no longer read as metadata,+ but kept as raw `org` blocks. This ensures that more information+ is retained when round-tripping org-mode files; additionally,+ this change makes it possible to support non-standard org+ extensions via filters.+ + Unify keyword handling. Handling of export settings and other+ keywords (like `#+LINK`) has been combined and unified.+ + Support `LATEX_HEADER_EXTRA` and `HTML_HEAD_EXTRA`+ settings. These export settings are treated like their non-extra+ counterparts, i.e., the values are added to the `header-includes`+ metadata list.+ + Allow multiple `#+SUBTITLE` export settings. The values of all+ lines are read as inlines and collected in the `subtitle`+ metadata field.+ + Read `#+INSTITUTE` values as text with markup. The value is+ stored in the `institute` metadata field and used in the+ default beamer presentation template.+ + The behavior of the `#+AUTHOR` and `#+KEYWORD` export+ settings has changed: Org now allows multiple such lines+ and adds a space between the contents of each line. Pandoc+ now always parses these settings as meta inlines; setting+ values are no longer treated as comma-separated lists.+ Note that a Lua filter can be used to restore the previous+ behavior.+ + Read description lines as inlines (#6485). `#+DESCRIPTION` lines+ are now treated as text with markup. If multiple such+ lines are given, then all lines are read and separated by soft+ linebreaks.+ + Honor tex export option (#4070). The `tex` export option can be set+ with `#+OPTION: tex:nil` and allows three settings:+ `t` (the default) causes LaTeX fragments to be parsed as TeX or added+ as raw TeX. `nil` removes all LaTeX fragments from the document.+ `verbatim` treats LaTeX as text.+++ * RST reader:++ + Pass arbitrary attributes through in code blocks (#6465).+ Exceptions: name (which becomes the id), class (which becomes the+ classes), and number-lines (which is treated specially to fit+ with pandoc highlighting).+ + Handle `date::` directive (#6276).++ * Textile reader: support `pre.` for code blocks (#6454).++ * Ipynb reader:++ + Implement `raw_markdown` extension (#5408). Specifying+ `-f ipynb+raw_markdown` will cause Markdown cells+ to be represented as raw Markdown blocks, instead of being+ parsed. This is not what you want when going from `ipynb`+ to other formats, but it may be useful when going from `ipynb`+ to Markdown or to `ipynb`, to avoid semantically insignificant+ changes in the contents of the Markdown cells that might+ otherwise be introduced.+ + Handle application/pdf output as image (#6430).+ + Properly handle image/svg+xml as an image (#6430).++ * Docx reader:++ + Distinguish between docx parsing and docx container unpacking errors.++ * MediaWiki reader:++ + Fix `gfm_auto_identifiers` so that `-` is not replaced by `_` (#6335).++ * Vimwiki reader:++ + Add nested syntax highlighting (#6256, Vlad Hanciuta).+ Nested syntaxes are specified like this:+ ```+ {{{sql+ SELECT * FROM table+ }}}+ ```+ The preformatted code block parser has been extended to check if the+ first attribute of the block is not a `key=value` pair, and in that+ case it will be considered as a class.+++ * Jira writer (Albert Krewinkel):++ + Always escape braces (#6478). Braces are now always escaped, even+ within words or when surrounded by whitespace. Jira and+ Confluence treat braces specially.+ + Convert Underline to inserted text (`+inserted+`).+ + Add image attributes (#6234). Image attributes are added+ to the output as image parameters. If the image has a+ class "thumbnail", then a thumbnail image is generated;+ all other attributes are discarded in this case.++ * LaTeX writer:++ + Ensure that `-M csquotes` works even in fragment mode (#6265).+ + Escape `^` specially for listings (#6460).+ + Create hypertarget for links with identifier (#6360).+ + Distinguish between single and double quotes when using enquote+ package (#6457, dbecher-ito).+ + Add support for customizable alignment of columns in beamer (#6331,+ andrebauer).+ + Add support for customizable alignment of columns in beamer+ (#4805, #4150, andrebauer).++ * HTML writer:++ + Use CSS in favor of `<br>` for display math (#6372)+ Some CSS to ensure that display math is+ displayed centered and on a new line is now included+ in the default HTML-based templates; this may be+ overridden if the user wants a different behavior.++ * Org writer:++ + Clean-up Div handling (Albert Krewinkel).++ * Docx writer:++ + Enable column and row bands for tables (#6371).+ This change will not have any effect with the default style.+ However, it enables users to use a style (via a reference.docx)+ that turns on row and/or column bands.++ * OpenDocument (and ODT) writer:++ + Add custom-style "Abstract" in metadata abstract.+ This ensures that the abstract is rendered with style Abstract.+ + Enable custom-style attribute on a Div.+ This allows you to apply a custom style to contained paragraphs.++ * DocBook writer:++ + Add id of figure to enclosed image.+ + Add personname element to docbook author (#6244).++ * FB2 writer:++ + Properly handle cover-image containing spaces (#6391).++ * Markdown writer:++ + Ensure consistent padding for pipe tables (#6240).+ + Avoid unnecessary escapes before intraword `_` when+ `intraword_underscores` extension is enabled (#6296).++ * RST writer:++ + Properly handle images with same alt text (#6194).+ Previously we created duplicate references for these in rendering RST.++ * AsciiDoc writer:++ + Add blank line after Div (#6308).++ * Haddock Writer:++ + Support Haddock tables (Joe Hermaszewski).+ See this PR on Haddock for details on the table format:+ <https://github.com/haskell/haddock/pull/718>.++ * PowerPoint writer (Jesse Rosenthal):++ + Write math input verbatim in speaker notes (#6301).+ OMML in speaker notes would lead to corrupt PowerPoint output. We now+ output the OMML verbatim as LaTeX in the speaker notes.++ * LaTeX template: Make polyglossia package options list-aware+ (#6444, Frederik Elwert).++ * Reveal.js template:++ + Update template for reveal.js 4.0.0 (#6390, Salim B).+ + Update template with newly available options (#6347, Jake Zimmerman).+ + Use CDN version of revealjs v4 by default (#6408).++ * opendocument template: Add abstract and subtitle to opendocument+ template (#6369).++ * reference.odt: clean up styles. Add Abstract.+ Change Author, Date to centered paragraphs with no character+ styling.++ * epub.css: wrap overlong lines in highlighted code blocks (#6242).+ This fixes a problem in iBooks v2.4 with our earlier+ horizontally scrolling code blocks. The problem seems to+ be a bug in iBooks, not pandoc, but since iBooks is a major+ target we're changing pandoc's default behavior so that+ pandoc-produced epubs work on that platform.++ * Text.Pandoc.PDF:++ + Use `--enable-local-file-access` in invoking `wkhtmltopdf` (#6474).+ `wkhtmltopdf` changed in recent versions to require this for+ access to local files. This fixes PDF via HTML5 with `--css`.+ + Send verbose output to stderr, not stdout (#6483).++ * Text.Pandoc.MIME: Fix MIME type for TrueType fonts in EPUBs+ (#6464, Michael Reed).++ * Text.Pandoc.Shared:++ + `makeSections`: omit number attribute when unnumbered class+ is present (#6339). Previously the attribute was included but given+ an empty value, and this caused the table of contents creation+ functions in Text.Pandoc.Writers.Shared to think these items had+ numbers, which meant that they were included in the TOC even if the+ `unlisted` class was used.+ + Deprecate `underlineSpan` in Shared in favor of+ `Text.Pandoc.Builder.underline` (Vaibhav Sagar).+ + `renderTags'`: use self-closing tag for col element (#6295).++ * Text.Pandoc.UUID: Fix `getRandomUUID`, which previously would+ return the same value twice in a row. Make `getRandomUUID`+ polymorphic in PandocMonad. Remove `getUUID` (#6228, Joseph C. Sible).++ * Text.Pandoc.Class: Generalize `PandocIO` functions to `MonadIO`.++ * Fixed Katex standalone script (#6399, Lucas Escot).+ Global macros are now persistent when using the HTML Writer with the+ `--katex` option.++ * Lua subsystem (Albert Krewinkel):++ + Use new type PandocLua for all pandoc Lua operations (API change).+ The new type `PandocLua` is an instance of the `PandocMonad` typeclass+ and can thus be used in a way similar to `PandocIO`.+ + Use PandocError for exceptions in Lua subsystem (API change).+ The PandocError type is used throughout the Lua subsystem. All Lua+ functions throw an exception of this type if an error occurs. The+ `LuaException` type is removed and no longer exported from+ `Text.Pandoc.Lua`. In its place, a new constructor `PandocLuaError`+ is added to PandocError.++ * Lua filters: improve error messages for failing filters (#6332,+ Albert Krewinkel). Print the Lua error properly instead of+ displaying their `show` string.++ * Use latest skylighting. This fixes a bug with lua multiline+ comments (and may improve handling of other syntaxes as well).+ IT also adds `aria-hidden="true"` to the empty a elements, which+ helps people who use screen readers.++ * Use latest texmath.++ * Require latest doctemplates 0.8.2.+ This adds support for template pipes `first`, `rest`,+ `last`, `allbutlast`.++ * Revert 0e48a02 and dependency on base-noprelude, which hasn't+ been updated for ghc 8.10 (see #6187).++ * Dependency adjustments:++ + Allow haddock-library 1.9.x.+ + Allow hslua 1.1 (#6243, Felix Yan).+ + Allow base64-bytestring 1.1.+ + Use latest jira-wiki-markup.+ + Allow http-client 0.7.+ + Allow tasty 1.3.x.+ + Allow aeson 1.5 (#6400, Felix Yan).+ + Remove unused dependency `vector` (#6462, Laurent P. René de Cotret).+ + Bump QuickCheck upper bound.++ * Significant code cleanup and simplification (Joseph C. Sible, #6223,+ #6209, #6225, #6229, #6226, #6340).++ * Remove unnecessary hlint ignores (#6341, Joseph C. Sible).++ * Remove obsolete RelaxedPolyRec extension (#6487, Nikolay Yakimov).++ * trypandoc improvements (Mike Tzou):++ + Add standalone option to the command text (#6210).+ + Update third party libraries.++ * MANUAL.txt:++ + Clarify template partial naming (#6476, Mauro Bieg).+ + Describe `jira` as "Jira/Confluence wiki markup" (#6351, Albert+ Krewinkel). In the past, Jira's wiki markup was also used by -- and+ could be imported into -- Atlassian Confluence.+ + Add link to print-css.rocks (#6272, Mauro Bieg).+ + Clarify pipe table column width adjustment (#6254).+ + Fix ATX header syntax.+ + Fix misleading note about image size conversions (#6353).+ + Update links to reveal.js documentation (#6386, Salim B).+ + Separate adjacent verbatim code blocks (#6307, tom-audm).++ * org.md:++ + Document behavior of `smart` extension (#4387, Albert Krewinkel).+ + Describe all supported export options in detail.++ * lua-filters.md:++ + Fix description of BulletList Lua type (Levi Gruspe).+ + Use pandoc.system module in TikZ example (Albert+ Krewinkel). Showcase temporary directory handling with+ `with_temporary_directory` and `with_working_directory`.++ * INSTALL.md: fix FreeBSD port link (#6422, Mo).+ The FreeBSD port was renamed from pandoc to hs-pandoc in 2010.+ The old pandoc port is still at version 1.5.1.1++ * Propagate `(DY)LD_LIBRARY_PATH` in tests (#6376, Lila).++ * Bump `cabal-version` to 2.2 (#6377).++ * Make it possible to compile using Stack on NixOS (#6439, Mathieu+ Boespflug).++ * CI action to check for commit message length (Nikolay Yakimov, #6398).+++## pandoc 2.9.2.1 (2020-03-23)++ * Markdown reader: Fix table alignment when heading begins with t (#6153).+ Due to a typo (`t` instead of `\t`) we were center aligning column+ headings that begin with a lowercase `t`!++ * Text.Pandoc.Readers.Roff:++ + Fix parsing of `\.` in man/ms readers (#6175).+ Previously due to a typo it was being parsed as `` ` ``.+ + Fix parsing of `\'` in man/ms readers (#6175). It was being parsed+ as a backtick.++ * Jira reader (Albert Krewinkel):++ + Fix parsing of tables without preceding blankline (#6198).+ A bug was fixed which caused faulty parsing if a table was not+ preceded by a newline and the first table cell had no space+ after the initial `|` characters.+ + Fix parsing of strikeout, emphasis (#6196). A bug was fixed which+ caused non-emphasized text containing digits and/or non-special+ symbols (like dots) to sometimes be parsed incorrectly.+ + Support colored inline text, indented lists (#6183, #6184).++ * Ms writer:++ + Fix definition lists so indent even when paragraph indent is+ set to 0 (as is the default). Also ensure indent for display math+ that falls back to TeX.+ + Use `.QS/.QE` instead of `.RS/.RE` for block quotes.++ * EPUB writer: fix regression on detection of front/back/bodymatter+ (#6170). This bug caused sections with epub:type `dedication` to be+ misplaced in bodymatter instead of frontmatter as specified+ in the manual. The same problem would affect other epub:types.+ The pattern matching needed to be changed with the use of+ `makeSection`.++ * AsciiDoc writer: remove redundant `otherwise` guard in+ `inlineToAsciiDoc` (#6146, Ryan Scott).++ * Text.Pandoc.Class:++ + Fix missing import when data files are not embedded (Albert Krewinkel).+ + Subdivide Text.Pandoc.Class into small unexported modules+ and ensure that all functions have Haddock documentation (#6106,+ Albert Krewinkel).+ + Finer grained imports of Text.Pandoc.Class submodules (#6203, Albert+ Krewinkel).++ * Text.Pandoc.XML: Add to list of HTML5 attributes:+ `allow`, `autocapitalize`, `decoding`, `enterkeyhint`,+ `imagesizes`, `imagesrcset`, `loading`.++ * Use implicit Prelude (#6187, Albert Krewinkel).+ The previous behavior was introduced as a fix for #4464. It seems that+ this change alone did not fix the issue, and `stack ghci` and `cabal+ repl` only work with GHC 8.4.1 or newer, as no custom Prelude is loaded+ for these versions. Given this, it seems cleaner to revert to the+ implicit Prelude.++ * Always use custom prelude (#6187, Albert Krewinkel).+ Previously, the custom prelude was used only with older GHC versions, as+ a workaround for problems with ghci. The ghci problems are resolved by+ replacing package `base` with `base-noprelude`, allowing for consistent+ use of the custom prelude across all GHC versions.++ * Remove outdated checks for no longer supported base versions+ (Albert Krewinkel).++ * PDF via wkhtmltopdf: put user-specified options last (#6171).+ Certain options (e.g. `cover`) need to come after flags on+ the command line.++ * Text.Pandoc.App: set resource path at the beginning so it can affect+ things like include-in-header (#5982).++ * Change macOS release candidate CI process so that notarized+ packages can be produced (#6169).++ * Make MANUAL more explicit about nonbreaking space handling by+ `all_symbols_escapable` (#6154, Fabien Schurter).++ * trypandoc (Mike Tzou):++ + Add checkbox for standalone option (#6189).+ + Use strict mode for JavaScript code (#6188).+ + Fetch resources over https (#6188).+ + Remove unnecessary attributes on style, script elements (#6188).++ * Use details tag to make GitHub releases changelog collapsible.++ * Update filter code in doc/filters.md so it works with latest pandoc+ (#6185).++ * linux/Dockerfile: upgrade to alpine 3.11 (#6180, Albert Krewinkel).+ This is used to build the static linux binaries.+++## pandoc 2.9.2 (2020-02-15)++ * Add `csv` as an input format (#6100). The CSV table is converted into a+ pandoc simple table. A new module Text.Pandoc.Readers.CSV+ exports `readCSV` [API change].++ * Introduce new format variants for JATS writer (#6014, Albert Krewinkel):++ - `jats_archiving` for the "Archiving and Interchange Tag Set",+ - `jats_publishing` for the "Journal Publishing Tag Set", and+ - `jats_articleauthoring` for the "Article Authoring Tag Set."++ The `jats` output format is now an alias for `jats_archiving`.+ The module Text.Pandoc.Writers.JATS now exports+ `writeJatsArchiving`, `writeJatsPublishing`, and+ `writeJatsArticleAuthoring`, as well as the legacy+ `writeJATS` [API change].++ * `--defaults`: Support `bibliography` and `csl` fields.+ Move `addMeta` from Text.Pandoc.App.CommandLineOptions to+ Text.Pandoc.App.Opt (internal change).++ * Add timing info for filters in `--verbose` mode (#6112).+ When verbose mode is specified (verbosity == INFO), print a+ notice when running a filter and when a filter completes (including+ timing).++ * LaTeX reader:++ + Allow `&` in LaTeX citation keys (#6110).+ + Improve caption and label parsing.+ + Don't emit empty Span elements for labels.+ + Put tables with labels in a surrounding Div.+ + Resolve `\ref` to table numbers (#6137).+ + Skip comments in more places where this is needed (#6114).+ + Allow beamer overlays for all commands in all raw tex (#6043).+ This affects parsing of raw tex in LaTeX and in Markdown and+ other formats.+ + Improve parsing of raw environments (#6034). If parsing fails+ in a raw environment (e.g. due to special characters like unescaped+ `_`), try again as a verbatim environment, which is less sensitive to+ special characters. This allows us to capture special environments+ that change catcodes as raw tex when `-f latex+raw_tex` is used.++ * RST reader:++ + Add highlight directive (#6140, Lucas Escot).++ * MediaWiki writer:++ + Prevent triple `[[[` which confuses MediaWiki (#6119).++ * HTML reader:++ + Don't parse `data-id` as `id` attribute. And similarly don't+ parse any `data-X` as `X` when `X` is a valid HTML attribute.++ * Org reader:++ + Simplify parsing of sub- and superscripts (#6127, Albert Krewinkel).+ Speeds up parsing of single-word, markup-less sub- and superscripts.++ * LaTeX writer:++ + Group biblatex citations even with prefix and suffix (#5849, Ethan+ Riley). Previously biblatex citations were only grouped if there+ was no prefix. This patch allows them to be grouped in subgroups split+ by prefixes and suffixes, which allows better citation sorting.+ + Fix regression in handling of columns in beamer slides (#6033).+ Columns in title slides were causing problems with+ slide division.+ + Fix duplicate frame classes in LaTeX/Beamer output (#6107).++ * HTML writer:++ + Fix duplicate attributes on headings (#6062), regression from 2.7.x.+ + Fix `--number-offset` with HTML TOC. Eventually it would be worth+ adding a parameter to `makeSections` so this could be done at that+ level; then it would also affect other writers that construct+ TOC manually.+ + reveal.js: restore old behavior for 2D nesting (#6032).+ The fix to #6030 actually changed behavior, so that the+ 2D nesting occurred at slide level N-1 and N, instead of+ at the top-level section. This commit restores the v2.7.3 behavior.+ If there are more than 2 levels, the top level is horizontal+ and the rest are collapsed to vertical.+ + reveal.js: ensure that pauses work even in title slides (#5819).++ * Markdown writer:++ + Fix regression: spurious dots in markdown_mmd metadata output (#6133).++ * Docx writer:++ + Fix regression with Compact style on tight lists (#6072).+ Starting in 2.8, the docx writer no longer distinguishes between tight+ and loose lists, since the Compact style is omitted. This is a+ side-effect of the fix to #5670, as explained in the changelog. This+ patch fixes the problem by extending the exception currently offered to+ Plain blocks inside tables to Plain blocks inside list items.++ * Jira writer:++ + Fix output of table headers (Albert Krewinkel, #6035).++ * Add Text.Pandoc.Image with unexported svgToPng.++ * Text.Pandoc.XML: Export `html5Attributes`, `html4Attributes`,+ `rdfaAttributes` (formerly unexported in Text.Pandoc.Writers.HTML).+ [API change]++ * Text.Pandoc.Shared: Export a new function `findM` (#6125,+ Joseph C. Sible).++ * Text.Pandoc.Logging: Add `RunningFilter`, `FilterCompleted`+ constructors to LogMessage [API change].++ * Text.Pandoc.CSV: fix bug in CSV parser; previously an extra blank record+ would sometimes be inserted at the end.++ * LaTeX template: add space option to xeCJK with PassOptionsToPackage+ (#6002). Otherwise we can get a clash with documentclasses that+ already load the package.++ * Lua filters:++ + Allow filtering of element lists (#6038, Albert Krewinkel). Lists of+ Inline and Block elements can now be filtered via `Inlines` and+ `Blocks` functions, respectively. This is helpful if a filter+ conversion depends on the order of elements rather than a single+ element. For example, the following filter can be used to remove all+ spaces before a citation:++ function isSpaceBeforeCite (spc, cite)+ return spc and spc.t == 'Space'+ and cite and cite.t == 'Cite'+ end++ function Inlines (inlines)+ for i = #inlines-1,1,-1 do+ if isSpaceBeforeCite(inlines[i], inlines[i+1]) then+ inlines:remove(i)+ end+ end+ return inlines+ end++ + Add methods `insert`, `remove`, and `sort` to pandoc.List+ (Albert Krewinkel). Example of use:++ local numbers = pandoc.List {2, 3, 1}+ numbers:sort() -- numbers is now {1, 2, 3}+ + Make `pandoc.List` a callable constructor (Albert Krewinkel).+ It is now possible to construct a new List via+ `pandoc.List()` instead of `pandoc.List:new()`.+ + Add tests for pandoc.List module (Albert Krewinkel).++ * Text.Pandoc.App.CommandLineOptions: Change `setVariable` to use `Text`+ instead of `String`. This avoids some unnecessary unpacking.++ * Use versioned directory for windows release zipfile.+ Also remove old `make-windows-installer.bat`, superseded by GitHub+ actions workflow, and modify `pandoc.wxs` for new paths.++ * Extensive code cleanup (#6141, #6128, #6129, #6130, #6123,+ #6105, 6102, #6117, #6124, #6115, #6116, #6111, Joseph C. Sible).++ * Fix hlint warnings (Albert Krewinkel).++ * Use latest doclayout, doctemplates (#6031). The new version of+ doclayout fixes a memory leak that affected `--include-in-header` with+ large files (and possibly other cases involving extremely long lines).++ * Use latest texmath.++ * Use latest skylighting and fix test suite (#6086).++ * sample.lua: Fix typo in descriptive comments (#6136, Caleb Maclennan).+ Fix typo in error message (#6135).++ * Add Docker and GH Actions instructions/links to INSTALL.md.++ * Update filter documentation (#6065). Improve cabal v2 instructions.+ Remove example using pandoc API directly (we have other+ docs for that and it was outdated).++ * Lua filter docs:++ + Cross-link constructors and types (Albert Krewinkel).+ Thanks to @bpj for the idea.+ + Sort pandoc.List methods alphabetically (Albert Krewinkel).+ + Unify, fix anchors and internal links (#6061, Albert Krewinkel).+ Links and anchors now follow consistent conventions, like+ lowercase-only anchor names. This breaks some links to specific+ sections in the document, but will make it much easier to link+ documentation in the future.+ + Clarify filter function execution order (#6059, Albert Krewinkel).++ * In docs, update URLs and use `https:` wherever possible (#6090,+ Salim B).++## pandoc 2.9.1.1 (2020-01-05)++ * Markdown reader:++ + Fix parsing bug affected indented code after raw HTML (#6009, #5360).++ * LaTeX writer:++ + Fix regression in beamer slide structure with certain slide levels+ (#6030).+ + Allow framebreaks for beamer's TOC (Heiko Schlittermann, #6012)+ + Properly handle unnumbered headings level 4+ (#6018).+ Previously the `\paragraph` command was used instead of+ `\paragraph*` for unnumbered level 4 headings.++ * HTML writer:++ + Fix revealjs slide structure regression with certain slide levels+ (#6030).+ + Add newlines to make slide show output more readable.++ * Org writer:++ + Remove extra spaces from table cells (Albert Krewinkel, #6024).++ * JATS template: Update JATS dtd (Arfon Smith, #6020). Use the archiving+ and interchange DTD rather than the more restrictive journal publishing+ DTD (which doesn't permit ext-link as a valid child).++ * Text.Pandoc.PDF: Fix `runTeXProgram` so that the input source is always+ overwritten (#6027). Previously it wasn't overridden if the file already+ existed, which led to bad results on subsequent runs when+ `pdf-engine-opt=-output-directory=` was used to specify an explicit temp+ dir.++ * Text.Pandoc.BCP47: Change `getLang` to handle block-level contents+ (#6008). Some readers (e.g. RST) will populate the `lang` metadata field+ with block-level content. `getLang` has been modified to handle this.+ Previously in these cases the LaTeX writer would not properly set the+ "main language" of the document.++ * Fix `test/tables.org` (Albert Krewinkel).++ * Use HTTPS in copyright message (Felix Yan, #6010)+++## pandoc 2.9.1 (2019-12-23)++ * Add Jira reader (Albert Krewinkel, #5556).++ * Jira writer: use jira-wiki-markup renderer (Albert Krewinkel,+ #5926). The following improvements are included in this change:++ + non-jira raw blocks are fully discarded instead of showing+ as blank lines;+ + table cells can contain multiple blocks;+ + unnecessary blank lines are removed from the output;+ + markup chars within words are properly surrounded by+ braces;+ + preserving soft linebreaks via `--wrap=preserve` is+ supported.++ Note that backslashes are rendered as HTML entities, as there+ appears no alternative to produce a plain backslash if it is+ followed by markup. This may cause problems when used with+ confluence, where rendering seems to fail in this case.++ * Fix regression with `--number-sections`. Starting with 2.8,+ `--number-sections` also had the effect of `--section-divs`,+ even if `--section-divs` was not specified.++ * Improved table of contents generation in markdown, RTF,+ commonmark, better handling cases where section headings are+ enclosed in divs.++ * Ensure that later default file values for `variable` replace+ earlier ones (5988).++ * HTML reader: Add `nav` to list of block-level tags.++ * Org reader (Albert Krewinkel):++ + Wrap named table in Div, using name as id (#5984).+ Tables which are given a name via `#+NAME:` or `#+LABEL:`+ are wrapped in an additional Div, with the name set as the+ Div's ID.+ + Report parsing errors properly.+ + Fix parsing problem for colons in headline (#5993).++ * Text.Pandoc.PDF: Ensure UTF8 when printing source in+ `--verbose` mode, avoiding an error on platforms that+ default to something other than UTF-8 (#5997).++ * Text.Pandoc.Templates: Strip directory before trying to find+ partial in data files (#5987).++ * Text.Pandoc.Shared: Improve `makeSections` so we don't get+ doubled "number" attributes in EPUB output (or anywhere+ else) (#5986).++ * Added tests for `--toc` and `--section-divs`.++ * Text.Pandoc.MIME: Added glsl MIME type for WebGL maps (#6000,+ Jared Lander).++ * MANUAL: A bit clearer explanation for `--base-header-level`.+ We now say exactly how to translate between the deprecated+ `--base-header-level` and `--shift-heading-level-by`.++ * lua-filters.md:++ + Remove spurious dot in title (#5996, Mauro Bieg).+ + Replace metadata example with image centering (#6004,+ Albert Krewinkel). Thanks to @efx for proposing this filter.+++## pandoc 2.9 (2019-12-11)++ * Text.Pandoc.Templates [API change]++ + Add Monad wrappers `WithDefaultPartials` and `WithPartials`.+ Wrapping these around an instance of `PandocMonad` gives+ us different instances of `TemplateMonad`, with different+ search behavior in retrieving partials.+ To compile a template and limit partial search to pandoc's+ data files, use `runWithDefaultPartials (compileTemplate ...)`.+ To compile a template and allow partials to be found locally+ (either on the file system or via HTTP, in the event that+ the main template has an absolute URL), ue+ `runWithPartials (compileTemplate ...)`.+ + Export `getTemplate`, which seeks a template locally,+ or via HTTP if the template has an absolute URL, falling+ back to the data files if not found.+ + Export `compileDefaultTemplate` -- does `getDefaultTemplate`+ and compiles the result, raising an error on failure.++ * Text.Pandoc.Class [API change]++ + Remove `TemplateMonad` instances for `PandocIO` and `PandocPure`.+ These were too limiting and caused a bug whereby a local+ partial could be used even when the default template was requested.+ We now rely on instances provided in the Templates module.++ * Text.Pandoc.App.OutputSettings: Simplify template retrieval code.++ * ConTeXt template: Adjust to title formatting (#5949, Denis Maier).+ Add `\setupinterlinespace` to `title`, `subtitle`, `date` and `author`+ elements: otherwise longer titles that run over multiple lines will look+ squashed as `\tfd` etc. won't adapt the line spacing to the font size.++ * reveal.js template: Add title-slide-attributes variable (#5981,+ Frederik Elwert).++ * More informative JSON parse error (#5973).++ * Use external emojis package (forked from pandoc). Removed emoji data+ in Text.Pandoc.Emoji.++ * Fix regression in `makeSections` (#5965).+ Previously `hierarchicalize` (the ancestor of `makeSections`) would put+ header attributes on the containing Div. In 2.8 this behavior changed,+ which broke some tools depending on pandoc. Here we roll back this change,+ so that attributes again migrate from the header to the containing Div when+ `makeSections` is run. Note that attributes are retained on the header as+ well (unlike before) -- with the exception of the `id` attribute, which of+ course cannot be duplicated.++ * Fix `--toc-depth` regression in 2.8 (#5967).++ * Use doctemplates 0.8. Rename template 'filters' as 'pipes'+ to avoid confusion with the other notion of filter used by pandoc.++ * Fix README.md so that relative links from manual become absolute.+ Previously they'd be broken links when viewed on GitHub or Hackage.+ So we add the base URL for the pandoc manual.++ * Document display math syntax in manual.++## pandoc 2.8.1 (2019-12-05)++ * Add `ascii_identifiers` as a supported extension for `markdown`.+ This fixes a regression in 2.8.++ * Fix regression with behavior of `--variable` (#5962).+ Previously `-Vfoo=1 -Vfoo=2` would produce a list value for foo;+ with 2.8 it produced just `2`. This commit restores the earlier+ behavior.++ * Roll back part of of `--shift-heading-level-by` change (#5957).+ With positive heading shifts, starting in 2.8 this option+ caused metadata titles to be removed and changed to regular+ headings. This behavior is incompatible with the old+ behavior of `--base-header-level` and breaks old workflows,+ so we have rolled back the change. Note that there is now an+ asymmetry in positive and negative heading level shifts:+ With positive shifts, the metadata title stays the same and+ does not get changed to a heading in the body, while with+ negative shifts, a heading can be converted into the+ metadata title.++ * Text.Pandoc.Shared: Fix `makeSections` so it doesn't turn+ column Divs into sections.++ * HTML writer: add task-list class to ul if all elements are+ task list items. This will allow styling unordered task+ lists in a way that omits the bullet.++ * HTML-based templates: Add CSS to suppress bullet on unordered task lists.++ * ConTeXt template: Fix `\startcslreferences` and use ConTeXt syntax+ conventions (#5945, Denis Maier). The old version had a too large+ a skip at the beginning of the reference list.++ * LaTeX template: keep the `\author{}` command even if author is not+ specified (#5961, Yihui Xie). Avoids a LaTeX warning.++ * Generate Emoji module with TH.++ + Add Text.Pandoc.Emoji.TH.+ + Replace long literal list in Text.Pandoc.Emoji with one-liner+ generating it from `emoji.json` using TH.+ + Add Makefile target to download `emoji.json`.+ + Remove `tools/emoji.hs`.++ * Increase GC allocation space for compilation in cabal.project.++ * Clean up manual on PDF generation backend options (#5940).++ * Update release checklist to include code signing step and update+ Windows release-candidate builds (#5950).+++## pandoc 2.8.0.1 (2019-11-26)++ * List `pdf` in `--list-output-formats`.+ * EPUB writer: Fix regression with `--css` (#5937). In 2.8 `--css`+ would not have an effect on EPUB output.+ * RST writer: Use grid tables for one-column tables, since+ simple tables clash with heading syntax in this case (#5936).+ * Add unexported module Text.Pandoc.Readers.Metadata (see #5914).+ * Use doctemplates 0.7.2, which adds the `nowrap` filter to+ templates.+ * Update default man template using `nowrap` for .TH heading (#5929).+ * HTML templates: Add support for `toc-title` variable (#5930,+ Alexandre Franke).+ * Remove `grffile` (LaTeX package) requirement in MANUAL.txt+ (#5927, Ian Max Andolina).+ * Use skylighting 0.8.3.++## pandoc 2.8 (2019-11-22)++ * Improvements in templates system (from doctemplates):++ + Pandoc templates now support a number of new features that+ have been added in doctemplates: notably, `elseif`, `it`,+ partials, filters, and syntax to control nesting and reflowing of+ text. These changes make pandoc more suitable out of the+ box for generating plain-text documents from data in YAML+ metadata. It can create enumerated lists and even tabular+ structures.+ + We now used templates parameterized on doclayout Doc types.+ The main impact of this change is better reflowing of+ content interpolated into templates. Previously,+ interpolated variables were rendered independently and+ interpolated as strings, which could lead to overly long+ lines. Now the templates interpolated as Doc values which+ may include breaking spaces, and reflowing occurs after+ template interpolation rather than before.+ + Remove code from the LaTeX, Docbook, and JATS writers that+ looked in the template for strings to determine whether it+ is a book or an article, or whether csquotes is used. This+ was always kludgy and unreliable.+ + Change template code to use new API for doctemplates.++ * Add `--defaults`/`-d` option. This adds the ability to specify+ a collection of default values for options in a YAML file. For+ example, one might define a set of defaults for letters,+ and then do `pandoc -d letter myletter.md -o myletter.pdf`.+ See the documentation of this feature in MANUAL.txt.++ * Raise error on unsupported extensions (#4338).++ * The `--list-extensions[=FORMAT]` option now lists only+ extensions that affect the given FORMAT.++ * Add `-L` option as shortcut for `--lua-filter`.++ * Add `--shift-heading-level-by` option and deprecate+ `--base-heading-level` (#5615). The new option does+ everything the old one does, but also allows negative shifts.+ It also promotes the document metadata (if not null) to a+ level-1 heading with a +1 shift, and demotes an initial+ level-1 heading to document metadata with a -1 shift. This+ supports converting documents that use an initial level-1+ heading for the document title.++ * Allow `--metadata-file` to be used repeatedly to include+ multiple metadata files (Owen McGrath, #5702). Values in+ files specified first will be overridden by those in later+ files.++ * `--ascii` now uses numerical hex character references (#5718).++ * Allow PDF output to stdout (#5751). PDF output now behaves like other+ binary formats: it will not be output to the terminal, but can be+ sent to stdout using either `-o -` or a pipe. The intermediate format+ will be determined based on the setting of `--pdf-engine`.++ * Make some writers sensitive to 'unlisted' class on headings (#1762).+ If this is present on a heading with the 'unnumbered' class,+ the heading won't appear in the TOC. This class has no+ effect if 'unnumbered' is not also specified. This affects HTML-based+ writers (including slide shows and EPUB), LateX (including beamer), RTF,+ and PowerPoint. Other writers do not yet support `unlisted`.++ * Fix `gfm_auto_identifiers` behavior with emojis (#5813). Note that+ we also now use emoji names for emojis when `ascii_identifiers`+ is enabled.++ * When `--ipynb-output` is used with the default "best" format, strip+ ANSI escape codes for non-ipynb output (#5633). These cause problems+ in many formats, including LaTeX.++ * Don't look for template files remotely for remote input (#5579).+ Previously pandoc would look for the template at a remote URL when a+ URL was used for the input file, instead of taking it from the+ data directory.++ * Allow combining `-Vheader-includes` and `--include-in-header` (#5904).+ Previously `header-includes` set as a variable would be+ clobbered by material included using `--include-in-header`.++ * Change merge behavior for metadata. Previously, if a document+ contained two YAML metadata blocks that set the same field, the+ conflict would be resolved in favor of the first. Now it is resolved+ in favor of the second (due to a change in pandoc-types).+ This makes the behavior more uniform with other things in pandoc+ (such as reference links and `--metadata-file`).++ * Don't add a newline to fragment output if there's already one.++ * Change exit codes and document in MANUAL.txt:++ + `PandocAppError` was 1, is now 4+ + `PandocOptionError` was 2, is now 6+ + `PandocMakePDFError` was 65, is now 66++ * Switch to new pandoc-types and use Text instead of String [API change].+ (Christian Despres, #5884).++ * HTML reader:++ + Better handling of `<q>` with cite attribute (#5798, Ole Martin Ruud).+ If a `<q>` tag has a `cite` attribute, we interpret it as a Quoted+ element with an inner Span.+ + Add support for HTML `<samp>` element (#5792, Amogh Rathore).+ The `<samp>` element is parsed as Code with class `sample`.+ + Add support for HTML `<var>` element (#5799, Amogh Rathore).+ The `<var>` element is parsed as Code with class `variable`.+ + Add support for `<mark>` elements (Florian B, #5797). Parse+ `<mark>` elements from HTML as Spans with class `mark`.+ + Add support for `<kbd>` elements, parsing them as Span with class+ `kbd` (Daniele D'Orazio, #5796).+ + Add support for `<dfn>`, parsing this as a Span with class `dfn`+ (#5882, Florian Beeres).++ * Markdown reader:++ + Headers: don't parse content over newline boundary (#5714).+ + Handle inline code more eagerly within lists (Brian Leung, #5627).+ + Removed some needless lookaheads.+ + Don't parse footnote body unless extension enabled.+ + Fix small super/subscript issue (#5878). Superscripts and subscripts+ cannot contain spaces, but newlines were previously allowed+ (unintentionally). This led to bad interactions in some cases+ with footnotes. With this change newlines are also not allowed inside+ super/subscripts.+ + Use `take1WhileP` for `str`, table row. This yields a small but+ measurable performance improvement.+++ * LaTeX reader:++ + Fix parsing of optional arguments that contain braced text (#5740).+ + Don't try to parse includes if `raw_tex` is set (#5673).+ When the `raw_tex` extension is set, we just carry through+ `\usepackage`, `\input`, etc. verbatim as raw LaTeX.+ + Properly handle optional arguments for macros (#5682).+ + Fix `\\` in `\parbox` inside a table cell (#5711).+ + Improve `withRaw` so it can handle cases where the token string is+ modified by a parser (e.g. accent when it only takes part of a Word+ token) (#5686). This fixes a bug that caused the ends of+ certain documents to be dropped.+ + Handle `\passthrough` macro used by latex writer (#5659).+ + Support tex `\tt` command (#5654).+ + Search for image with list of extensions like latex does, if an+ extension is not provided (#4933).+ + Handle `\looseness` command values better (#4439).+ + Add `mbox` and `hbox` handling (Vasily Alferov, #5586).+ When `+raw_tex` is enabled, these are passed through literally.+ Otherwise, they are handled in a way that emulates LaTeX's behavior.+ + Properly handle `\providecommand` and `\provideenvironment` (#5635).+ They are now ignored if the corresponding command or environment+ is already defined.+ + Support epigraph command in LaTeX Reader (oquechy, #3523).+ + Ensure that expanded macros in raw LaTeX end with a space+ if the original did (#4442).+ + Treat `ly` environment from lilypond as verbatim (Urs Liska, #5671).+ + Add `tikzcd` to list of special environments (Eigil Rischel).+ This allows it to be processed by filters, in the same way that+ one can do for `tikzpicture`.++ * Roff reader:++ + Better support for `while`.+ + More improvements in parsing conditionals.+ + Fix problem parsing comments before macro.+ + Improve handling of groups.+ + Better parsing of groups (#5410). We now allow groups+ where the closing `\\}` isn't at the beginning of a line.++ * RST reader:++ + Keep `name` property in `imgAttr` (Brian Leung, #5619).+ + Fixed parsing of indented blocks (#5753). We were requiring+ consistent indentation, but this isn't required by RST.+ + Use title, not admonition-title, for admonition title.+ This puts RST reader into alignment with docbook reader.+ + Don't strip final underscore from absolute URI (#5763).+ + Avoid spurious warning when resolving links to internal anchors+ ending with `_` (#5763).++ * Org reader:++ + Accept `ATTR_LATEX` in block attributes (Albert Krewinkel, #5648).+ Attributes for LaTeX output are accepted as valid block attributes;+ however, their values are ignored.+ + Modify handling of example blocks (Brian Leung, #5717).+ + Allow the `-i` switch to ignore leading spaces (Brian Leung).+ + Handle awkwardly-aligned code blocks within lists (Brian Leung).+ Code blocks in Org lists must have their `#+BEGIN_` aligned in a+ reasonable way, but their other components can be+ positioned otherwise.+ + Fix parsing of empty comment lines (#5856, Albert Krewinkel).+ Comment lines in Org-mode can be completely empty.++ * Muse reader (Alexander Krotov):++ + Add RTL support (#5551).+ + Do not allow closing asterisks to be followed by `*`.+ + Do not split series of asterisks into symbols and emphasis (#5821).+ + Do not terminate emphasis on `*` not followed by space.++ * DokuWiki reader:++ + Parse markup inside monospace ('') (#5916, Alexander Krotov).++ * Docx reader:++ + Move style-parsing-specific code to a new unexported module,+ Text.Pandoc.Readers.Docx.Parse.Styles (Nikolay Yakimov).+ + Move StyleMap to docx writer (Nikolay Yakimov).+ + Only use LTR when it is overriding BiDi setting (#5723, Jesse+ Rosenthal). The left-to-right direction setting in docx is used+ in the spec only for overriding an explicit right-to-left setting.+ We only process it when it happens in a paragraph set with BiDi.+ This is especially important for docs exported from Google Docs,+ which explicitly (and unnecessarily) set `rtl=0` for every paragraph.+ + Fix list number resumption for sublists (#4324).+ The first list item of a sublist should not resume numbering+ from the number of the last sublist item of the same level,+ if that sublist was a sublist of a different list item.++ * Docbook reader:++ + Richer parse for admonitions (Michael Peyton Jones, #1234).+ Instead of parsing admonitions as blockquotes, we now parse+ them as Divs with an appropriate class. We also handle titles+ for admonitions as a nested Div with the "title" class.+ + Fix nesting of chapters and sections (#5864, Florian Klink,+ Félix Baylac-Jacqué).+ + Fix bug with entities in mathphrase element (#5885).++ * MediaWiki reader:++ + Skip optional `{{table}}` template (#5757).++ * LaTeX reader:++ + Fix dollar-math parsing to ensure that space is left between a+ control sequence and a following letter (#5836).+ + In `untokenize`, ensure space between control sequence+ and following letter (#5836).+ + Don't omit macro definitions defined in the preamble.+ These were formerly omitted (though they still affected macro+ resolution if `latex_macros` was set). Now they are included in+ the document body.+ + Parse macro definitions as raw LaTeX when `latex_macros` is+ disabled. (When `latex_macros` is enabled, we omit them, since+ pandoc is applying the macros itself.)+ + Fix a hang/memory leak in certain circumstances (#5845).+ + Text.Pandoc.Readers.LaTeX.Parsing: add `[Tok]` parameter to+ `rawLaTeXParser`. This allows us to repeat retokenizing+ unnecessarily in e.g. `rawLaTeXBlock`.+ + Add KOMA-Script metadata commands (#5910, Andrew Dunning).+ Add all titling commands to existing definition for `\dedication`.+ + Parse `\micro` siunitx unit command (#5921, Jose Luis Duran).++ * Markdown writer:++ + Ensure proper nesting when we have long ordered list markers (#5705).+ + Make `plain` output plainer (#5741). Previously we used the following+ Project Gutenberg conventions for plain output: extra space before and+ after level 1 and 2 headings, all-caps for strong emphasis,+ underscores surrounding regular emphasis. Now these+ conventions are used only when the `gutenberg` extension is+ enabled. By default, Strong and Emph are rendered without+ special formatting, and headings are rendered without+ special formatting, and with only one blank line following.+ To restore the former behavior, use `-t plain+gutenberg`.+ + Prefer using raw_attribute when enabled (#4311).+ The `raw_attribute` will be used to mark raw bits, even HTML+ and LaTeX, and even when `raw_html` and `raw_tex` are+ enabled, as they are by default. To get the old behavior,+ disable `raw_attribute` in the writer.+ + Prefer `pipe_tables` to raw HTML even when we must+ lose width information (#2608, #4497).+ + Improve escaping in list items (#5918).++ * AsciiDoc writer:++ + Don't include `+` in code blocks for regular asciidoc.+ This is asciidoctor-specific.+ + Handle admonitions (#5690).++ * LaTeX writer:++ + Add thin space when needed in LaTeX quote ligatures (#5684).+ + Use `\hspace{0pt}` for 0-width space U+200B (#5756).+ + Use `cslreferences` environment for csl bibliographies.+ This allows bibliographies to receive special formatting.+ The template now contains definition of this environment (enabled+ only when CSL is used). It also defines a `\cslhangindent` length.+ This is set to 2em by default when the bibliography style specifies+ a hanging indent. To override the length, you can use e.g.+ `\setlength{\cslhangindent}{7em}` in header-includes.+ See jgm/pandoc-citeproc#410.+ + Strip off `{}` around locator for biblatex/natbib output (#5722).+ + Fix line breaks at start of paragraph (#3324).+ Previously we just omitted these. Now we render them+ using `\hfill\break` instead of `\\`. This is a revision+ of a PR by @sabine (#5591) who should be credited with the idea.+ + We no longer look in the template or header-includes to see if a+ book or article documentclass is used, or to see whether the+ `csquotes` package is used. To use `csquotes` for LaTeX, set+ `csquotes` in your variables or metadata. To specify a book+ style, use the `documentclass` variable or+ `--top-level-division`.+ + Fix horizontal rule (#5801). We change to use 0.5pt rather than+ `\linethickness`, which apparently only ever worked "by accident"+ and no longer works with recent updates to texlive.++ * ConTeXt writer:++ + Add option to include source files in ConTeXt PDFs (Tristan+ Stenner, #5578). The metadata field or variable+ (`includesource`) can be set to attach the source documents+ to the resulting PDF.+ + Customizable type of PDF/A for the ConTeXt writer (Karl+ Pettersson, #5608). The `pdfa` variable may now be set in metadata.+ Also updated color profile settings in accordance with ConTeXt wiki,+ and made ICC profile and output intent for PDF/A customizable+ using `pdfaiccprofile` and `pdfaintent`.+ + Unit tests: adjust code property to avoid an irrelevant+ failure involving inline code with two consecutive newlines.+ + Set `csl-hanging-indent` variable if needed.+ + Use special environment for CSL references.+ + Use braces, not start/stop, for inline language tags.+ This prevents unwanted gobbling of spaces.++ * HTML writer:++ + Use numeric character references with `--ascii` (#5718).+ Previously we used named character references with html5 output.+ But these aren't valid XML, and we aim to produce html5 that is+ also valid XHTML (polyglot markup). (This is also needed for epub3.)+ + Ensure that line numbers in code blocks get id-prefix (#5650).+ + Ensure TeX formulas are rendered correctly (Philip Pesca,+ #5658). The web service passed in to `--webtex` may render+ formulas using inline or display style by default.+ Prefixing formulas with the appropriate command ensures+ they are rendered correctly.+ + Render inline formulas correctly with `--webtex` (Philip+ Pesca, #5655). We add `\textstyle` to the beginning of the+ formula to ensure it will be rendered in inline style.+ + Pass through `aria-` attributes to HTML5 (#5642).+ + Render a Quoted element with an inner Span with+ `cite` attribute using a `<q>` tag (#5798, Ole Martin Ruud).+ + Render a Span with class `mark` using the `<mark>` element+ (Florian Beeres, #5797).+ + Render Span with class `dfn` using `<dfn>` element+ (Florian Beeres, #5882).+ + Render Span with class `kbd` using `<kbd>` element (Daniele+ D'Orazio, #5796).+ + Render Code with class `variable` using `<var>` element+ (Amogh Rathore, #5799).+ + Render Code with class `sample` using `<samp>` element+ (Amogh Rathore, #5799).++ * EPUB writer:++ + Improve splitting into chapters (#5761), using `makeSection`.+ + Avoid issuing warning multiple times when title not set (see #5760).+ + Use svg tag wrapper for cover image (#5638). In addition, the+ code generating the image has been moved to the template, to make it+ more customizable. NOTE: Those who use custom EPUB+ templates will need to adjust their templates, adding the+ code to generate the cover image. (Previously this was just+ inserted into 'body'.)+ + Improve toChapters, making it work better if there are Divs+ around sections.+ + Add support for EPUB2 covers (blmage, #3992).+ + Do not override existing "fileN" medias when writing to EPUB format+ (blmage, #4206).+ + Ensure that `lang` variable is set on all chapters (so that it+ will add an `xml:lang` attribute on the `html` element).++ * RST writer:++ + Removed remnants of `admonition-title`.+ + Fix handling of `:align:` on figures and images (#4420).+ When the image has the `align-right` (etc.) class, we now use+ an `:align:` attribute.+ + Improve spacing for tables with no width information (#5899).+ If a simple table would be too wide, we use a grid table.+ + Fix backslash escaping after strings (Albert Krewinkel, #5906).+ The check whether a complex inline element following a string must+ be escaped, now depends on the last character of the string instead+ of the first.+ + Ensure there's a blank line before tables (#5898).++ * Dokuwiki writer:++ + Handle mixed lists without HTML fallback (#5107).++ * XWiki writer:++ + Fix multiline table (Zihang Chen, #5683).++ * Muse writer:++ + Add RTL support (Alexander Krotov, #5551).++ * Man writer:++ + Suppress non-absolute link URLs (#5770). Absolute URLs are+ still printed in parentheses following the link text, but relative+ URLs are suppressed (just as internal links starting with '#'+ always have been).+ + Improved definition list term output. Now we boldface code but+ not other things. This matches the most common style in man pages+ (particularly option lists).++ * Ms writer:++ + Use `.LP` instead of `.PP` for line block (#5588).+ + Use boldface for definition terms in DefinitionLists.++ * JATS writer:++ + Do not emit empty `<fn-group>` (Mauro Bieg, #5595).+ + Update template to v1.1dtd (#5632, Arfon Smith).+ + Update `data/jats.csl` to avoid commas between editor+ name-part elements. (#5629)+ + Add `abstract` to template (Mauro Bieg).++ * TEI writer:++ + Don't strip hash from internal links (#5922).++ * Jira writer:++ + Remove escapeStringForJira for code blocks (Jan-Otto Kröpke).+ + Remove extraneous newline after single-line block quotes+ (#5858, Albert Krewinkel).+ + Improve escaping of special characters, using backslash escapes+ instead of HTML entities (#5858, Albert Krewinkel).++ * OpenDocument writer:++ + Avoid duplicate attributes (#4634). We use the innermost+ attribute in nested cases.+ + If `native_numbering` extension is set, use native OpenDocument+ enumeration for figures and tables (Nils Carlson).+ + Place caption before table (#5681, Dmitry Pogodin).++ * ODT writer:++ + Add a test for MathML formulas in ODT documents (blmage).+ + Improve the parsing of frames in ODT documents (blmage).++ * Docx writer:++ + Make handling of styles more robust in localized versions+ of Word (Nikolay Yakimov, #5523, #5052, #5074). We now use+ style names, not ids, for assigning semantic meaning, since+ the ids can change depending on the locale. Style name+ comparisons are case-insensitive, since those are+ case-insensitive in Word. Since docx style names can have+ spaces in them, and pandoc-markdown classes can't, anywhere+ when style name is used as a class name, spaces are+ replaced with ASCII dashes `-`. Code styles, i.e. "Source+ Code" and "Verbatim Char" now honor style inheritance. Docx+ Reader now honours "Compact" style (used in+ Pandoc-generated docx). The side-effect is that "Compact"+ style no longer shows up in docx+styles output. Styles+ inherited from "Compact" will still show up.+ + Re-use Readers.Docx.Parse for StyleMap (#5766, Nikolay Yakimov).+ + Internal improvements and code simplification (Nikolay Yakimov).+ + Preserve built-in styles in DOCX with custom style (Ben Steinberg,+ #5670). This change prevents custom styles on divs and spans+ from overriding styles on certain elements inside them, like+ headings, blockquotes, and links. On those elements, the+ "native" style is required for the element to display correctly.+ This change also allows nesting of custom styles; in order to do so,+ it removes the default "Compact" style applied to Plain blocks,+ except when inside a table.+ + Add `proofState` to list of elements carried over from+ settings.xml in the reference.docx (Krystof Beuermann, #5703).+ + Change order of `ilvl` and `numId` in `document.xml` (Agustín+ Martín Barbero, #5645). Also, make list para properties go first.+ This reordering of properties shouldn't be necessary but+ it seems Word Online does not understand the docx correctly otherwise.++ * PowerPoint writer:++ + Code formatting is now context dependent (Jeroen de Haas, #5573).+ This commit alters the way in which the Powerpoint writer treats+ inline code and code blocks. Inline code is now formatted at+ the same size as the surrounding text. Code blocks are now given+ a margin and font size according to their level.+ Furthermore this commit allows changing the font with which code is+ formatted via the `monofont` option.+ + Start numbering at appropriate numbers (Jesse Rosenthal, #5709).+ Starting numbers for ordered lists were previously ignored. Now+ we specify the number if it is something other than 1.++ * Text.Pandoc.Parsing:++ + Add `manyChar`, `many1Char`, `manyTillChar`, `many1TillChar`,+ `many1Till`, `manyUntil`, `mantyUntilChar`: these are like their+ unsuffixed counterparts but pack some or all of their output+ (Christian Despres, #5884).+ + Add `stateAllowLineBreaks` to `ParserState` [API change].+ + Fix inline parsing in grid table cells (#5708).+ + Change type of `setLastStrPos` so it takes a `Maybe SourcePos`+ rather than a `SourcePos` [API change].+ + Make `parseFromString'` and `gridTableWith` and+ `gridTableWith'` polymorphic in the parser state,+ constraining it with `HasLastStrPosition` [API change].+ + `parseFromString'`: reset `stateLastStrPos` to `Nothing` before parse.+ + Rename takeWhileP -> take1WhileP and clean it up.+ (It doesn't match the empty sequence.)++ * Text.Pandoc.PDF:++ + For PDFs via HTML, ensure temp file is deleted even if the pdf+ program is not found (#5720).+ + Better detection of a Cygwin environment (#5451).+ + Don't assume tex log file is UTF8-encoded (#5872).+ Fall back to latin1 if it can't be read as UTF-8.++ * Text.Pandoc.Extensions:++ + Export new function `getAllExtensions`, which returns the+ extensions that affect a given format (whether enabled by default+ or not) [API change].+ + Change type of `parseFormatSpec` from+ `Either ParseError (String, Extensions -> Extensions)`+ to `Either ParseError (String, [Extension], [Extension])`+ [API change].+ + Add `Ext_gutenberg` constructor to `Extension` [API change].+ + Add `Ext_native_numbering` constructor to `Extension` [API change]+ (Nils Carlson).++ * Text.Pandoc.Readers, Text.Pandoc.Writers:++ + Change type of `getReader` and `getWriter` so they return+ a value in the PandocMonad instance rather than an Either+ [API change]. Exceptions for unknown formats and unsupported+ extensions are now raised by these functions.++ * Text.Pandoc.App++ + Change `optMetadataFile` type from `Maybe FilePath` to `[FilePath]`+ (Owen McGrath, #5702) [API change].++ * Text.Pandoc.Logging:++ + Add `CouldNotDeduceFormat` constructor to `LogMessage` [API change].+ Issue this warning when we're falling back to markdown or+ html because we don't recognize the extension of the input or+ output files.+ + Clarify warning for missing title (#5760).+ + Add `UnusualConversion` constructor to `LogMessage` [API change]+ (Mauro Bieg, #5736). Emit warning on `-f latex -o out.pdf`.++ * Lua filters:++ + Improve function documentation (Albert Krewkinkel).+ + Traverse nested blocks and inlines in correct order (Albert+ Krewinkel, #5667). Traversal methods are updated to use the new+ Walk module so that sequences with nested Inline (or Block) elements+ are traversed in the order in which they appear in the linearized+ document.+ + New unexported module `Text.Pandoc.Lua.Walk` (Albert Krewinkel).+ Lua filters must be able to traverse sequences of AST+ elements and to replace elements by splicing sequences back+ in their place. Special `Walkable` instances can be used for+ this; those are provided in a new module+ `Text.Pandoc.Lua.Walk`.+ + `Attr` values can now be given as normal Lua tables (Albert+ Krewinkel, #5744). This can be used as a convenient alternative+ to constructing `Attr` values with `pandoc.Attr`. Identifiers+ are taken from the `id` field, classes must be given as+ space separated words in the `class` field. All remaining fields+ are included as attributes. With this change, the following lines+ now create equal elements:+ ```+ pandoc.Span('test', {id = 'test', class = 'a b', check = 1})+ pandoc.Span('test', pandoc.Attr('test', {'a','b'}, {check = 1}))+ ```+ This also works when using the *attr* setter:+ ```+ local span = pandoc.Span 'text'+ span.attr = {id = 'test', class = 'a b', check = 1}+ ```+ Furthermore, the *attributes* field of AST elements can now be a+ plain key-value table even when using the `attributes` accessor:+ ```+ local span = pandoc.Span 'test'+ span.attributes = {check = 1} -- works as expected now+ ```+ + Export `make_sections`, remove `hierarchicalize`. Lua filters that+ use `hierarchicalize` will need to be rewritten to use+ `make_sections`.+ + Add a `clone()` method to all AST elements (Albert Krewinkel, #5568).+ + Fix Lua function names in pandoc.system (niszet). Change+ `get_current_directory` to `get_working_directory` and+ `with_temp_directory` to `with_temporary_directory`, to+ conform to the manual.++ * Text.Pandoc.Error:++ + Add constructors `PandocUnknownReaderError`,+ `PandocUnknownWriterError`, `PandocUnsupportedExtensionError`.+ [API change].+ + Better message for `PandocShouldNeverHappenError`.+ + Better message for `PandocTemplateError`.++ * Text.Pandoc.Emoji:++ + Update emoji list (#5666). Done using new `tools/emojis.hs`,+ which uses the list from the gem GitHub uses. Future updates+ can be done with this tool.++ * Text.Pandoc.PDF:++ + Pass value of `--dpi` to `rsvg-convert` when converting SVG to PDF+ in the process of creating a PDF (#5721).++ * Text.Pandoc.Shared:++ + Replace `Element` and `makeHierarchical` with `makeSections`.+ Now that we have Divs, we can use them to represent the+ structure of sections, and we don't need a special Element type.+ `makeSections` reorganizes a block list, adding Divs with class+ `section` around sections, and adding numbering if needed.+ This change also fixes some longstanding issues recognizing section+ structure when the document contains Divs (#3057, see also #997).+ + Remove `Element` type [API change]+ + Remove `makeHierarchicalize` [API change]+ + Add `makeSections` [API change]+ + Export `deLink` [API change]+ + Make `filterIpynbOutput` strip ANSI escapes from code in output+ for non-ipynb formats, when the default "best" option is used with+ `--ipynb-output` (#5633).+ + Fix `camelCaseToHyphenated` so it handles `ABCDef` better.+ + Improve `isTight` (#5857). If a list has an empty item,+ this should not count against its being a tight list.+ + Export `htmlSpanLikeElements` [API change] (Daniele D'Orazio, #5796).+ This is a mapping of HTML span-like elements that are internally+ represented as a Span with a single class.+ + Change the implementation of `htmlSpanLikeElements` to retain+ classes and attributes (#5882, Florian Beeres).++ * Text.Pandoc.Slides: recognize content in Divs when determining+ slide level.++ * Text.Pandoc.SelfContained:++ + Omit content-type on type attribute for `<style>` (#5725).+ It doesn't seem to be valid for HTML5, and as a result Chrome+ ignores the style element.++ * Text.Pandoc.Pretty has been removed [API change].+ We now use the new external doclayout module instead.++ * Text.Pandoc.Writers.Shared:++ + Remove `metaToJSON`, `metaToJSON'` [API change].+ + Modify `addVariablesToContext`, `defField`, `setField`, `getField`,+ `resetField` to work with Context rather than JSON values. [API change]+ + Export new function `endsWithPlain` [API change].+ + Change `gridTables` so it does better at keeping the widths of+ columns (#4320) and does better at figuring out column widths+ when no widths are given (#5899).++ * Text.Pandoc.Options++ + Change type of `writerTemplate` to `Maybe Template` instead+ of `Maybe String`.+ + Change To/FromJSON instances for `HTMLMathMethod`, `CiteMethod`,+ `ObfuscationMethod`, `TrackChanges`, `WrapOption`,+ `TopLevelDivision`, `ReferenceLocation`, `HTMLSlideVariant` (#5790).+ In each case we use lowercase (or hyphenated lowercase) for+ constructors to line up more closely with command-line option+ values. This is a breaking change for those who manually decode or+ encode JSON for these data types (e.g. for `ReaderOptions` or+ `WriterOptions`).++ * Text.Pandoc.Filters:++ + Add `FromYAML` instance for `Filter`.+ + `applyFilters`: Add and apply filters in order (not reversed)+ This changes `applyFilters` from Text.Pandoc.Filter so+ that it does a left fold rather than a right fold, applying+ the filters in the order listed.++ * Text.Pandoc.XML:++ + Change `toEntities` to emit numerical hex character references+ (#5718).++ * Text.Pandoc.Highlighting:++ + Add additional listings languages (Wandmalfarbe).++ * Text.Pandoc.MediaBag:++ + Some of the types using Strings were switched to use FilePath instead+ (Christian Despres, #5884).++ * Text.Pandoc.Templates:++ + Don't import/export `varListToJSON` [API change]. It is removed in+ doctemplates >= 0.3.+ + Change type of `renderTemplate'` [API change]. Return value is+ now Text rather than being polymorphic. This makes room for+ upcoming removal of the `TemplateTarget` class from doctemplates.++ * Text.Pandoc.App.Opt [API changes]:++ + More convenient To/FromJSON instances. Make the field names+ like `strip-empty-paragraphs` rather than `optStripEmptyParagraphs`.+ Anyone who is using JSON serialization of Opt will need to adjust+ things accordingly.+ + Change `optHighlightStyle` to a `Maybe String` instead of+ `Maybe Style`. Do the parsing/loading of themes later, after+ option parsing.+ + Remove `optBaseHeaderLevel` from `Opt`. We now just use+ `optShiftHeadingLevelBy`, to avoid redundancy.+ + Change `optShiftHeadingLevel` to `optShiftHeadingLevelBy` to+ match the option.+ + Custom FromJSON instance for `LineEnding`, so either `CRLF`+ or `crlf` will work.+ + Change `optVariables` from `[(String, String)]` to `Context Text`.+ + Change `optMetadata` to `Meta`, to allow structured values.+ The current behavior of the `--metadata` option stays the same.+ + Rename `optReader`, `optWriter` as `optFrom`, `optTo`.+ + Add `FromYAML` instances to `Opt` and to all subsidiary types.+ + Rename `optMetadataFile` to `optMetadataFiles`.+ + Rename `optPDFEngineArgs` to `optPDFEngineOpts`.+ + Rename `optWrapText` to `optWrap`.+ + Add `IpynbOutput` enumerated type: use this instead of+ a string for `optIpynbOutput`.+ + Change optInputFiles to a `Maybe [FilePath]` (#5888) [API change].+ `Nothing` means: nothing specified.+ `Just []` means: an empty list specified (e.g. in defaults).+ + List fields in Opt so they aren't reversed (#5881) [API change].+ Previously `optIncludeInHeader`, etc. were in reverse order.+ + The `sourcefile` variable is now always a list. It used to be+ sometimes a string, sometimes a list (when there was more than one).++ * Template changes:++ + default.latex: added code for `cslreferences` environment,+ to be used for pandoc-citeproc references. A `csl-hanging-indent`+ variable (set automatically if there is a `hanging-ident`+ class on the references Div) controls whether contents of this+ environment receive a hanging indent.+ + default.latex: Add `space` as default option for xeCJK, so that+ spaces between words are preserved (#5855, jeongminkim-islab).+ This is necessary for Korean.+ + default.latex: Remove include of `grffile` (#5848).+ This package used to be needed for proper handling of image filenames+ containing periods (in addition to the period before the extension).+ It no longer works with the latest LaTeX kernel and graphicx,+ so we have removed it. Future versions of graphicx will handle+ these filenames without the need for `grffile`.+ + default.context: add a saner default for page numbers.+ Previously they appeared centered at the top of the page;+ now we put them centered at the bottom, unless the `pagenumbering`+ variable is set.+ + default.context: define a start-stop-pair `cslreferences` to+ allow for hanging indents in the bibliography (#5875, Denis Maier).+ + default.ms: update defaults. Use Palatino font, use slightly+ wider interparagraph space, don't indent paragraphs,+ and put page numbers on the bottom. This brings ms output+ closer to default LaTeX output.+ + default.revealjs: add navigationMode (Mauro Bieg, #5657).+ + default.muse: handle multiple authors better.+ + docbook4, docbook5 templates: add indentation to body.+ + HTML-based templates: use `styles.html` partial to avoid+ code duplication.+ + HTML-based templates: change indentation of styles in template.++ * reference.docx (#5820):++ + Change Block Text (block quote) style so that the same font+ is used as in the body text, and the block text is indented+ left and right.+ + All headings now have a uniform color.+ + Level-1 headings no longer set `w:themeShade="B5"`.+ + Level-2 headings are now 14 point rather than 16 point.+ + Level-3 headings are now 12 point rather than 14 point.+ + Level-4 headings are italic rather than bold.++ * epub.css: Add CSS for hanging-indent div to support pandoc-citeproc's+ new hanging indents.++ * pandoc.cabal:++ + Repeat ghc-options in all stanzas.+ + Remove conditionals for ghc < 8 (Albert Krewinkel, #5693).+ + Compile with `-Wcpp-undef` and `-fhide-source-paths` when possible+ (Albert Krewinkel).+ + Add cabal.project to extra-source-files (Albert Krewinkel).+ + Add dependency on skylighting-core (#5729). Even though it shouldn't+ be needed, some tools require it.+ + Require latest pandoc-types, texmath, skylighting, haddock-library.+ + Ensure TemplateHaskell is added to other-extensions when it is+ used (Vanessa McHale, #5728).+ + Remove `derive_json_via_th` flag; always use TH. This cuts down+ on code duplication and reduces the chance for errors. See #4083.++ * Makefile:++ + Add ghci target.+ + Add ghcid target.+ + Remove references to obsolete flag (#5694).++ * Benchmarks: fix failure on ipynb.++ * Use MathJax 3 (zorkow).++ * KaTeX math: respect `classoption=fleqn` variable,+ bump KaTeX version to 0.11.1 (#5815, Mauro Bieg).++ * Fix redundant constraint compiler warnings (Pete Ryland, #5625).++ * Use throwError instead of fail when appropriate.++ * Use Prelude.fail to avoid ambiguity with fail from GHC.Base.++ * Add `diff-zip.sh` to tools (John MacFarlane, Agustín Martín Barbero).+ This is intended to make it easier to test differences in zip+ containers, like epub, docx, or odt.++ * Add `.gitattributes` (#5747). This ensures that the golden files+ in `test/fb2/reader/` don't have newlines converted. This should fix+ a test failure on GitHub CI with Windows.++ * Reorder options in `--help`.++ * Revise code for HsYAML-0.2.0.0 (@vijayphoenix, #5704).++ * Remove blank line in code example in Haddocks (Leif Metcalf, #5679).++ * Fix trypandoc with `getReader`/`getWriter` changes.++ * Allow building pandoc with GHC 8.8.++ * linux tarball: add architecture `-amd64` to filename.+ Now it will be: `pandoc-VERSION-linux-ARCH.tar.gz`.++ * MANUAL.txt:++ + Add section for exit codes.+ + Document some pptx limitations in slide show section:+ No incremental display (#5689). No pause with `. . .` (#5701).+ + reveal.js flags (Mauro Bieg, #5653).+ + Document addition of `data-` prefix to unknown attributes in HTML5.+ + Link to YAML spec (Mauro Bieg, #5687).+ + Fix capitalization of "Linux" (#5859, Marcus Stollsteimer).+ + Use a table for exit codes.+ + Put all template variable docs into one section.+ + Use ATX headers consistently.+ + Add fuller documentation of templates (#5779), including+ new template syntax, partials, etc.+ + Add documentation for the variable `hyperrefoptions` (Wandmalfarbe).+ + Clarify when macro definitions are passed as raw latex.+ In Markdown input, they are always passed through. In LaTeX, only if+ `latex_macros` is disabled.+ + Clarify that `--dpi` provides a default and doesn't override+ dpi values specified in the images themselves (#5721).+ + Document how to use custom writers with `--standalone` (#5866).+ + Clarify `--preserve-tabs` default.++ * INSTALL.md:++ + Fix instructions for libicu.+ + Add Void Linux instructions (Volodymyr Kozachnyskyi).++ * CONTRIBUTING.md:++ + Add information on tests (Agustín Martín Barbero, #5652).+ + Add information about command test naming to CONTRIBUTING (Florian B).++ * Fix typos in changelog and comments (#5896, Brian Wignall).++ * doc/lua-filters.md:++ + Fix mistakes in mediabag module docs (#5851, Albert Krewinkel).+ + Improve metadata replacement example in lua-filters doc (#5851).+ + Mention which Lua version is shipped with pandoc (Albert Krewinkel,+ #5892).++## pandoc 2.7.3 (2019-06-11)++ * Add `jira` (Atlassian's Jira wiki markup) as output format (#2497,+ Albert Krewinkel).++ * Add `tex_math_dollars` to `multimarkdownExtensions` (#5512).+ This form is now supported in multimarkdown,+ in addition to `tex_math_double_backslash`.++ * Fix `--self-contained` so it works when output format has extensions.+ Previously if you used `--self-contained` with `html-smart` or+ `html+smart`, it wouldn't work.++ * Add template variable `curdir` with working directory+ from which pandoc is run (#5464).++ * Markdown reader: don't create implicit reference for empty header+ (#5549).++ * Muse reader: allow images inside link descriptions (Alexander Krotov).++ * HTML reader: epub related fixes.++ + With epub extensions, check for `epub:type` in addition to `type`.+ + Fix problem with noteref parsing which caused block-level+ content to be eaten with the noteref.+ + Rename `pAnyTag` to `pAny`.+ + Refactor note resolution.+ + Trim definition list terms (Alexander Krotov).++ * LaTeX reader:++ + Add braces when resolving `\DeclareMathOperator`+ (#5441). These seem to be needed for xelatex but not pdflatex.+ + Allow newlines in `\mintinline`.+ + Pass through unknown listings language as class (#5540).+ Previously if the language was not in the list of languages supported+ by listings, it would not be added as a class, so highlighting+ would not be triggered.+ + `rawLaTeXInline`: Include trailing `{}`s in raw latex commands (#5439).+ This change affects the markdown reader and other readers that allow raw+ LaTeX. Previously, trailing `{}` would be included for unknown+ commands, but not for known commands. However, they are sometimes used+ to avoid a trailing space after the command. The chances that a `{}`+ after a LaTeX command is not part of the command are very small.++ * MediaWiki reader: handle multiple attributes in table row (#5471,+ chinapedia).++ * Docx reader: Add support for `w:rtl` (#5545). Elements with this+ property are put into Span inlines with `dir="rtl"`.++ * DocBook reader: Issue `IgnoredElement` warnings.++ * Org reader (Albert Krewinkel):++ + Fix planning elements in headers level 3 and higher+ (#5494). Planning info is now always placed before+ the subtree contents. Previously, the planning info was placed after+ the content if the header's subtree was converted to a list, which+ happens with headers of level 3 and higher per default.+ + Omit, but warn about unknown export options. Unknown export+ options are properly ignored and omitted from the output.+ + Prefer plain symbols over math symbols (#5483).+ Symbols like `\alpha` are output plain and unemphasized, not as math.+ + Recognize emphasis after TODO/DONE keyword (#5484).++ * FB2 reader:++ + Skip unknown elements rather than throwing errors (#5560).+ Sometimes custom elements are used (e.g. `id` element+ inside `author`); previously the reader would halt with an error.+ Now it skips the element and issues an `IgnoredElement` warning.+ + Parse notes (#5493, Alexander Krotov).+ + Internal improvements (Alexander Krotov).++ * OpenDocument writer: Roll back automatic figure/table numbering+ (#5474). This was added in pandoc 2.7.2, but it makes it impossible+ to use pandoc-crossref. So this has been rolled back for now,+ until we find a good solution to make this behavior optional+ (or a creative way to let pandoc-crossref and this feature+ to coexist).++ * New module Text.Pandoc.Writers.Jira, exporting `writeJira` [API+ change] (Albert Krewinkel).++ * EPUB writer:++ + Don't include 'landmarks' if there aren't any.+ Previously we could get an empty ol element, which caused+ validation errors with epubcheck.+ + Ensure unique ids for styleesheets in content.opf (#5463).+ + Make stylesheet link compatible with kindlegen (#5466,+ Eric Schrijver). Pandoc omitted `type="text/css"` from both+ `<style>` and `<rel="stylesheet">` elements in all templates, which+ is valid according to the spec. However, Amazon’s kindlegen software+ relies on this attribute on `<link>` elements when detecting+ stylesheets to include.++ * HTML writer:++ + Output video and audio elements depending on file+ extension of the image path (Mauro Bieg).+ + Emit empty alt tag in figures (#5518, Mauro Bieg).+ The same text is already in the <figcaption> and+ screen-readers would read it twice, see #4737.+ + Don't add variation selector if it's already there.+ This fixes round-trip failures.+ + Prevent gratuitous emojification on iOS (#5469).+ iOS chooses to render a number of Unicode entities, including '↩', as+ big colorful emoji. This can be defeated by appending Unicode+ VARIATION SELECTOR-15'/'VARIATION SELECTOR-16'. So we now append this+ character when escaping strings, for both '↩' and '↔'. If other+ characters prove problematic, they can simply be added to+ `needsVariationSelector`. + Add `class="heading"` to level 7+ Headers+ rendered as `<p>` elements (#5457).++ * RST writer: treat Span with no attributes as transparent (#5446).+ Previously an Emph inside a Span was being treated as+ nested markup and ignored. With this patch, the Span+ is just ignored.++ * LaTeX writer:++ + Include inline code attributes with `--listings` (#5420).+ + Don't produce columns environment unless beamer (#5485).+ + Fix footnote in image caption. Regression: the fix for #4683 broke+ this case.+ + Don't highlight code in headings (#5574). This causes+ compilation errors.+ + Use `\mbox` to get proper behavior inside `\sout` (#5529).++ * EPUB writer: Fix document section assignments (#5546).+ For example, introduction should go in bodymatter, not frontmatter, and+ epigraph, conclusion, and afterward should go in bodymatter, not+ backmatter. For the full list of assignments, see the manual.++ * Markdown writer:++ + Add backslashes to avoid unwanted interpretation of+ definition list terms as other kinds of block (#554).+ + Ensure the code fence is long enough (#5519).+ Previously too few backticks were used when the code block+ contained an indented line of backticks. (Ditto tildes.)+ + Handle labels with integer names (Jesse Rosenthal, #5495).+ Previously if labels had integer names, it could produce a conflict+ with auto-labeled reference links. Now we test for a conflict and+ find the next available integer. This involves adding a new state+ variable `stPrevRefs` to keep track of refs used in other document+ parts when using `--reference-location=block|section`++ * Textile writer: fix closing tag for math output (Albert Krewinkel).+ Opening and closing tag for math output match now.++ * Org writer: always indent src blocks content by 2 spaces (#5440, Albert+ Krewinkel). Emacs always uses two spaces when indenting the content of+ src blocks, e.g., when exiting a `C-c '` edit-buffer. Pandoc used to+ indent contents by the space-equivalent of one tab, but now always uses+ two spaces, too.++ * Asciidoc writer:++ + Use `` `+...+` `` form for inline code.+ The old `` `a__b__c` `` yields emphasis inside code in asciidoc.+ To get a pure literal code span, use `` `+a__b__c+` ``.+ + Use proper smart quotes with asciidoctor (#5487).+ Asciidoctor has a different format for smart quotes.+ + Use doubled ## when necessary for spans (#5566).+ + Ensure correct nesting of strong/emph (#5565): strong+ must be the outer element.++ * JATS writer:++ + Wrap elements with p when needed (#5570). The JATS spec restricts+ what elements can go inside `fn` and `list-item`. So we wrap other+ elements inside `<p specific-use="wrapper">` when needed.+ + Properly handle footnotes (#5511) according to "best practice."+ (Group them at the end in `<fn-group>` and use `<xref>` elements+ to link them.)+ + Fix citations with PMID so they validate (#5481). This includes+ an update to data/jats.csl.+ + Ensure validity of `<pub-date>` by parsing the date and+ extracting year, month, and day, as expected. Also add an+ iso-8601-date attribute automatically.+ + Don't use `<break>` element for LineBreak. It is only+ allowed in a few special contexts, and not in `<p>` elements.+ + Don't make `<string-name>` a child of `<string>`, which is illegal.++ * FB2 writer:++ + Do not wrap note references into `<sup>` and brackets+ (Alexander Krotov). Existing FB2 readers, such as FBReader, already+ display links with type="note" as a superscript.+ + Use genre metadata field (#5478).++ * Muse writer: do not escape empty line after `<br>` (Alexander Krotov).++ * Add unicode code point in "Missing character" warning (#5538).+ If the character isn't in the console font, the message is pretty useless,+ so we show the code point for anything non-ASCII.++ * Lua: add Version type to simplify comparisons (Albert Krewinkel).+ Version specifiers like `PANDOC_VERSION` and `PANDOC_API_VERSION` are+ turned into `Version` objects. The objects simplify version-appropriate+ comparisons while maintaining backward-compatibility.+ A function `pandoc.types.Version` is added as part of the newly+ introduced module `pandoc.types`, allowing users to create version+ objects in scripts.++ * pandoc lua module (Albert Krewinkel):++ - Fix deletion of nonexistent attributes (#5569).+ - Better tests for Attr and AttributeList.++ * pandoc.mediabag lua module (Albert Krewinkel):++ + Add function `delete` for deleting a single item.+ + Add function `empty` for removing all entries.+ + Add function `items` for iterating over mediabag.++ * Text.Pandoc.Class: Fix handling of `file:` URL scheme in+ `downloadOrRead` (#5517, Mauro Bieg). Previously `file:/`+ URLs were handled wrongly and pandoc attempted to make HTTP+ requests, which failed.++ * Text.Pandoc.MIME: add `mediaCategory` [API change] (Mauro Bieg).++ * Text.Pandoc.Shared:++ + Add `onlySimpleTableCells` [API change]+ (Mauro Bieg) and use this to consolidate simple-table detection+ (#5524). This fixes an inconsistency in the HTML reader, which did not+ treat tables with `<p>` inside cells as simple.+ + `metaToJSON`: treat digits starting with 0 as a string, not a number+ (#5479). This fixes a regression in YAML metadata in pandoc 2.7.2.++ * Text.Pandoc.Logging: Add `IgnoredElement` constructor for+ `LogMessage`. `SkippedConetnt` doesn't work for some XML-based+ readers which don't have access to parsec source positions.++ * Text.Pandoc.Asciify: Add Turkish undotted-i (#5433, Mauro Bieg).++ * Improve output of Lua tests (#5499, Albert Krewinkel).+ This makes use of tasty-lua, a package to write tests in Lua+ and integrate the results into Tasty output. Test output becomes+ more informative: individual tests and test groups become visible+ in test output. Failures are reported with helpful error messages.++ * Lua: add `pandoc.system` module (#5468, Albert Krewinkel).+ The `system` Lua module provides utility functions to interact with the+ operating- and file system. E.g.+ `print(pandoc.system.get_current_directory())`+ or+ ```lua+ pandoc.system.with_temporary_directory('tikz', function (dir)+ -- write and compile a TikZ file with pdflatex+ end)+ ```++ * LaTeX template: Add pdflang to hypersetup if lang is set (#5443).++ * beamer template: Fix using Beamer with geometry (#5505, Daniel Maslowski).+ Beamer already loads geometry, so we need to use the `\geometry`+ command to set geometry options.++ * EPUB2/3 templates: Move inline styles to default epub.css (#5466).+ NOTE: Those who use a custom CSS stylesheet with EPUB should+ add these lines:++ code{ white-space: pre-wrap; }+ span.smallcaps{ font-variant: small-caps; }+ span.underline{ text-decoration: underline; }+ q { quotes: "“" "”" "‘" "’"; }+ div.column{ display: inline-block; vertical-align: top; width: 50%; }++ * reveal.js template:++ + Updates for revealjs 3.8.0 (#5435, ebiim).+ + Remove reference to head.min.js (#5448, Winnie Hellmann).+ NOTE: users will need to update reveal.js to at least 3.8.0+ for their presentations generated with this version of pandoc+ to work correctly.++ * Text.Pandoc.PDF:++ + Replace `</>` with literal `/` (#5451).+ We use forward-slash for a directory separator in tmpDir,+ even on Windows (because that's what tex likes). So we+ should not put a backslash between the tmpDir and the+ filename on Windows. This is harmless enough in normal+ Windows setups, but it breaks on Cygwin.+ Thanks to @cc2x for noticing and diagnosing the problem.+ + Allow use of `-output-directory` in `--pdf-engine-opt` (#5462).+ This is currently possible with `mklatex` and `-outdir`, but+ was not yet possible with xelatex and `-output-directory`.+ + For PDF via ms/pdfroff, make TOC appear at beginning and in+ PDF bookmarks (#5553). Previously the TOC appeared at the end+ of the document, and was not bookmarked. To keep it at the end,+ add `--pdf-engine-opt=--no-toc-relocation` to your command line.++ * Fix broken links in documents (#5473, Shim Myeongseob).+ Also, use absolute links to pandoc.org when possible, so that+ the links can be followed by people viewing these documents+ on GitHub.++ * Improved sample lua tikz filter in lua-filters docs (#5445,+ Matthew Doty). There are three changes:++ + It only processes elements which begin with `\begin{tikzpicture}`+ + It uses pdf2svg instead of imagemagick to preserve fidelity+ + The images produced have transparent backgrounds++ * MANUAL.txt:++ + Add note about `title-meta`, `author-meta`, `date-meta` (#5486).+ + Fix typo (#5489, Christian Krause).++ * add test/tables.xwiki to git and pandoc.cabal (#5498, Mauro Bieg).++ * Disable missing-home-modules warning in `stack.yaml`.+ Otherwise `stack ghci` fails.+++## pandoc 2.7.2 (2019-04-05)++ * Add XWiki writer (#1800, Derek Chen-Becker).+ Add `Text.Pandoc.Writers.XWiki`, exporting `writeXWiki` [API change].++ * Dokuwiki Reader: parse single curly brace (#5416, Mauro Bieg).++ * Vimwiki reader: improve handling of internal links (#5414).+ We no longer append `.html` to link targets, and we add a title+ `wikilink`. This mirrors behavior of other wiki readers. Generally+ the `.html` extension is not wanted. It may be important for output+ to HTML in certain circumstances, but it can always be added using a+ filter that matches on links with title `wikilink`.++ If your workflow requires the current behavior, here is a lua filter+ that will add the `.html` extension:++ ```lua+ function Link(el)+ if el.title == 'wikilink' then+ el.target = el.target .. ".html"+ end+ return el+ end+ ```+ * ipynb reader:++ + Use format `ipynb` for raw cell where no format given.+ + Avoid introducing spurious `.0` on integers in metadata.++ * Markdown reader: fenced div takes priority over setext header.++ * HTML reader: read `data-foo` attribute into `foo` (#5392).+ The HTML writer adds the `data-` prefix for HTML5 for nonstandard+ attributes. But the attributes are represented in the AST without+ the `data-` prefix, so we should strip this when reading HTML.++ * LaTeX reader: Improve autolink detection (#5340).++ * PowerPoint writer (Jesse Rosenthal):++ + Expand builtin reference doc to model all layouts.+ The previous built-in reference doc had only title and content+ layouts. Add in a section-header slide and a two-content slide, so+ users can more easily modify it to build their own templates.+ + Always open up in slide view. When editing a+ template/reference-doc, the user might be in Master view, but when+ producing a slide show, it is assumed that slide view will be+ desired.+ + Remove `handoutsMasterList` from template presentation.xml+ + Fix numerous errors in templating (#5402). Previously, some templates+ produced by Office 365 (MacOS) would not render with `--reference-doc`+ correctly. We now apply correct shapes for content, and build+ shape trees correctly.+ + Make default placeholder type for template lookup.+ + Apply speaker notes to metadata slide if applicable.+ + Test for speaker notes after breaking header.+ + Correctly handle notes after section-title header.+ Previously, if notes came after a section-title header (ie, a level-1+ header in a slide-level=2 presentation), they would go on the next+ slide. This keeps them on the slide with the header.+ + Internal improvements.++ * ipynb writer:++ + Use format `ipynb` for raw cell where no format given.+ According to nbformat docs, this is supposed to render in every+ format. We don't do that, but we at least preserve it as a raw+ block in markdown, so you can round-trip.+ + Consolidate adjacent raw blocks. Sometimes pandoc creates two+ HTML blocks, e.g. one for the open tag and one for a close tag.+ If these aren't consolidated, only one will show up in output cell.+ + Fixed carry-over of nbformat from metadata.+ + Preserve `nbformat_minor` if it's given. This helps with round-tripping.++ * LaTeX writer:++ + Avoid inadvertently creating ?` or !` ligatures (#5407).+ These are upside down ? and !, resp.+ + Fix footnotes in table caption and cells (#5367). This fixes a+ bug wherein footnotes appeared in the wrong order, and with+ duplicate numbers, when in table captions and cells.+ We now use regular `\footnote` commands, even in the table+ caption and the minipages containing cells. Apparently+ longtable knows how to handle this.++ * HTML writer: Don't add data- prefix to RDFa attributes (#5403).++ * JATS writer: Ensure that plain strings go inside `<pub-id>` tag (#5397).++ * Markdown writer:++ + Better rendering of numbers (#5398). If the number is integral,+ we render it as an integral not a float.+ + Proper rendering of empty map in YAML metadata (#5398). Should+ be `{}`, not empty string.+ + Properly escape attributes in Markdown writer (#5369).+ + Be sure implicit figures work in list contexts (#5368).+ Previously they would sometimes not work: e.g., when they+ occurred in final paragraphs in lists that were originally+ parsed as Plain and converted later using PlainToPara.++ * Docx writer: Use `w:br` without attributes for line breaks (#5377).+ We previously added the attribute `type="textWrapping"`, but+ this causes problems on Word Online.++ * LaTeX template (Andrew Dunning):++ + Ensure correct heading/table order (#5365). Improve workaround+ (#1658) for tables following headings. The new solution works whether+ or not the `indent` variable is enabled.+ + Remove `subparagraph` variable. The default is now to use run-in+ style for level 4 and 5 headings (`\paragraph` and `\subparagraph`).+ To get the previous default behavior (where these were formatted as+ blocks, like `\subsubsection`), set the `block-headings` variable.+ + Add pandoc to PDF metadata (#5388).+ + Group graphics-related code (#5389).+ + Move `\setstretch` after front matter (#5179). Ensures that+ `\maketitle`, `\tableofcontents`, and so forth are not affected by+ changes to line spacing.++ * Update data/jats.csl to avoid commas between name-part elements+ (#5397).++ * Add support for golang (`go`) with `--listings` (#5427).++ * Text.Pandoc.Shared - improve `metaToJSON` behavior with numbers.+ We now do a better job marshalling numbers from MetaString+ or MetaInlines into JSON Number.++ * Text.Pandoc.Writers.Shared: `metaValueToJSON`: use Number Values for+ integers. Pandoc's MetaValue doesn't have a distinguished number type,+ so numbers are put in MetaStrings. If the MetaString consists+ entirely of digits, we convert it to a Number. We should probably+ consider adding a MetaNumber constructor to MetaValue, for better+ round-tripping with JSON etc. This change aids round-tripping in+ ipynb metadata fields, like `toc_depth`.++ * Text.Pandoc.Class: `fetchItem`: don't treat UNC paths as+ protocol-relative URLs (#5127). These are paths beginning `//?/UNC/...`.++ * Text.Pandoc.ImageSize: Improve `pdfSize` so it handles+ a wider range of PDFs (#4322, with help from Richard Davis).++ * Text.Pandoc.Pretty: avoid stack overflow by using strict sum (#5401).++ * Fix harmless error in file-scope code (#5422).++ * MANUAL.txt:++ + Improve 'header' and 'heading' usage (#5423, Andrew+ Dunning). The term 'header' was being used where 'heading'+ is more appropriate.+ + Add paragraph on options affecting markdown in ipynb.++ * stack.yaml - remove -Wmissing-home-modules+ This seems to cause problems with stack ghci. Remove RTS options.++ * Add ghc-options to cabal.project.++ * appveyor.yml - use ghc 8.6.4. Fixes segfault issues on Windows (#5037).++ * linux build process: Remove clone of pandoc-citeproc (#5366).+ It wasn't being used; cabal.project specifies the version to use.++## pandoc 2.7.1 (2019-03-14)++ * Add tectonic as an option for --pdf-engine (#5345, Cormac Relf).+ Runs tectonic on STDIN instead of a temporary .tex file, so that it+ looks in the working directory for `\include` and `\input` like the rest+ of the engines. Allows overriding the output directory+ args with `--pdf-engine-opt=--outdir --pdf-engine-opt="$DIR"`.++ * Allow `-o/--output` to be used with `--print-default-data-file`,+ `--print-highlighting-style`, `--print-default-template`.+ Note that `-o` must occur BEFORE the `--print*` command on the command+ line (this is documented, #5357).++ * LaTeX reader:++ + Support `\underline`, `\ul`, `\uline` (#5359, Paul+ Tilley). These are parsed as a Span with class `underline`, as+ with other readers.+ + Ensure that `\Footcite` and `\Footcites` get put in a note.++ * ipynb reader:++ + Remove sensitivity to `raw_html`, `raw_tex` extensions.+ We now include every output format. Pruning is handled by+ `--ipynb-output`.+ + Better handling of cell metadata. We now include even complex cell+ metadata in the Div's attributes (as JSON, in complex cases, or+ as plain strings in simple cases).++ * ipynb writer:++ + Recurse into native divs for output cell data (#5354).+ + Render cell metadata fields from div attributes.++ * Docx writer: avoid extra copy of abstractNum and num elements+ in numbering.xml. This caused pandoc-produced docx files to+ be uneditable using Word Online (#5358).++ * Markdown writer: improve handling of raw blocks/inline.+ We now emit raw content using `raw_attribute` when no more+ direct method is available. Use of `raw_attribute` can be+ forced by disabling `raw_html` and `raw_tex`.++ * LaTeX writer: Add classes for frontmatter support (#5353, Andrew Dunning)+ and remove frontmatter from `scrreprt`.++ * LaTeX template:++ + Improve readability (#5363, Andrew Dunning).+ + Robust section numbering removal (#5351, Andrew Dunning).+ Ensures that section numbering does not reappear with custom+ section levels. See <https://tex.stackexchange.com/questions/473653/>.+ + Better handling of front/main/backmatter (#5348).+ In pandoc 2.7 we assumed that every class with chapters would accept+ `\frontmatter`, `\mainmatter`, and `\backmatter`. This is not so (e.g.+ report does not). So pandoc 2.7 breaks on report class by including an+ unsupported command. Instead of the `book-class` variable, we use two+ variables, `has-chapters` and `has-frontmatter`, and set these+ intelligently in the writer.++ * Text.Pandoc.Shared: Improve `filterIpynbOutput`. Ensure that+ images are prioritized over text. `best` should include everything+ for ipynb.++ * Tests.Old: specify `--data-dir=../data` to ensure tests can find+ data files even if they haven't been installed. Remove old+ `pandoc_datadir` environment variable, which hasn't done anything for a+ long time.++ * MANUAL.txt: Add recommendation to use `raw_attribute` with ipynb (#5354).++ * Use cmark-gfm-hs 0.1.8 (note that 0.1.7 is buggy).++ * Use latest pandoc-citeproc, texmath.+++## pandoc 2.7 (2019-03-03)++ * Use XDG data directory for user data directory (#3582). Instead of+ `$HOME/.pandoc`, the default user data directory is now+ `$XDG_DATA_HOME/pandoc`, where `XDG_DATA_HOME` defaults to+ `$HOME/.local/share` but can be overridden by setting the+ environment variable. If this directory is missing, then+ `$HOME/.pandoc` is searched instead, for backwards compatibility.+ However, we recommend moving local pandoc data files from+ `$HOME/.pandoc` to `$HOME/.local/share/pandoc`. On Windows the+ default user data directory remains the same.++ * Slide show formats behavior change: content under headers+ less than slide level is no longer ignored, but included in+ the title slide (for HTML slide shows) or in a slide after+ the title slide (for beamer). This change makes possible+ 2D reveal.js slideshows with content in the top slide on+ each stack (#4317, #5237).++ * Add command line option `--ipynb-output=all|none|best` (#5339).+ Output cells in ipynb notebooks often contain several different+ versions of an output, with different MIME types, e.g. an HTML+ table and a plain-text fallback. Specifying `--ipynb-output=best`+ (the default) ensures that the best version for the output format+ is used. `all` includes all versions, and `none` suppresses them+ all, leaving output cells empty.++ * `asciidoctor` is now an output format separate from `asciidoc`,+ to accommodate some minor implementation-specific differences+ (currently just in the treatment of display math).++ * Add `latexmk` as an option for `--pdf-engine` (#3195).+ Note that you can use `--pdf-engine-opt=-outdir=bar` to specify+ a persistent temp directory.++ * Markdown reader:++ + Improve tight/loose list handling (#5285). Previously the+ algorithm allowed list items with a mix of Para and Plain, which+ is never wanted.+ + Add newline when parsing blocks in YAML (#5271). Otherwise last+ block gets parsed as a Plain rather than a Para. This is a+ regression in pandoc 2.x. This patch restores pandoc 1.19+ behavior.+ + Make `yamlToMeta` respect extensions (#5272, Mauro Bieg).+ This adds a `ReaderOptions` parameter to `yamlToMeta` [API change].+ + Fix bug parsing fenced code blocks (#5304). Previously parsing+ would break if the code block contained a string of backticks of+ sufficient length followed by something other than end of line.++ * LaTeX reader: don't let `\egroup` match `{`. `braced` now actually+ requires nested braces. Otherwise some legitimate command and+ environment definitions can break.++ * Docx reader (Jesse Rosenthal):++ + Rename `getDocumentPath` as `getDocumentXmlPath`.+ + Use field notation for setting `ReaderEnv`.+ + Figure out `document.xml` path once at the beginning of parsing, and+ add it to the environment, so we can avoid repeated lookups.+ + Dynamically determine main document xml path (#5277).+ The desktop Word program places the main document file in+ `word/document.xml`, but the online word places it in+ `word/document2.xml`. This file path is actually stated in the root+ `_rels/.rels` file, in the `Relationship` element with an+ `http://../officedocument` type.+ + Fix paths in archive to prevent Windows failure (#5277).+ Some paths in archives are absolute (have an opening slash) which, for+ reasons unknown, produces a failure in the test suite on MS+ Windows. This fixes that by removing the leading slash if it exists.+ + Add comments to aid code readability.+ + Trim space inside the last inline (#5273).+ + Unwrap sdt elements in footnotes and comments (#5302).++ * Muse reader (Alexander Krotov):++ + Test that block level markup does not break `<verbatim>`.+ + Add secondary note support.++ * ipynb reader: handle images referring to attachments. Previously+ we didn't strip off the attachment: prefix, so even though the+ attachment was available in the mediabag, pandoc couldn't find it.++ * JATS reader:++ + Fix parsing of figures (#5321). This ensures that a figure+ containing a single image is parsed as a pandoc "implicit+ figure" (i.e., a Para with a single Image whose title attribute+ begins with `fig:`). More complex figures will still be parsed+ as divs.+ + Support `fig-group` block element (#5317).+ + Handle citations with multiple references (#5310). The `rid`+ attribute can have a space-separated list of ids.++ * AsciiDoc Writer: Add `writeAsciiDoctor` [API change, Tarik Graba].+ Handle display math appropriately for Asciidoctor.++ * JATS writer: wrap figure caption in `<p>` to fix validation (#5290,+ Mauro Bieg).++ * HTML writer:++ + Implement WAI-ARIA roles for (end)notes, citations, and+ bibliography (#4213). Note that doc-biblioref is only used when+ link-citations produces links, since it belongs on links.+ + Include content (including speaker notes) in title slides+ (#4317, #5237).++ * ipynb writer:++ + Ensure final newline.+ + Only include metadata under `jupyter` field.+ + Don't create attachments for images with absolute URIs,+ including data: URIs (#5303).+ + Keep plain text fallbacks in output even if a richer format is+ included (#5293). We don't know what output format will be needed.+ See the `--ipynb-output` command line option for a way to control+ what formats are included in the output.++ * Markdown writer: use `markdown="1"` when appropriate for Divs:+ when `native_divs` and `markdown_in_html_blocks` are disabled+ but `raw_html` and `markdown_attribute` are enabled.++ * LaTeX writer:++ + Use right fold for `escapeString`. This is more elegant than+ the explicit recursive code we were using.+ + Avoid `{}` after control sequences when escaping.+ `\ldots{}.` doesn't behave as well as `\ldots.` with the latex+ ellipsis package. This patch causes pandoc to avoid emitting+ the `{}` when it is not necessary. Now `\ldots` and other+ control sequences used in escaping will be followed by either+ a `{}`, a space, or nothing, depending on context.+ + For beamer, include contents under headers superordinate to+ slidelevel (#4317). Currently we keep the fancy title slide, and+ add a new slide with the same title and whatever content was+ under the header.++ * Powerpoint writer (Jesse Rosenthal): support underlines.+ Use span with single class "underline" as in docx writer.++ * Muse writer: escape secondary notes (Alexander Krotov).++ * FB2 writer: add section identifiers support (#5229, John KetzerX).++ * Make `--fail-if-warnings` work for PDF output (#5343).++ * Lua filters (Albert Krewinkel):++ + Load module `pandoc` before calling `init.lua` (#5287). The file+ `init.lua` in pandoc's data directory is run as part of pandoc's+ Lua initialization process. Previously, the `pandoc` module was+ loaded in `init.lua`, and the structure for marshaling was+ set up after. This allowed simple patching of element+ marshaling, but made using `init.lua` more difficult. Now, all+ required modules are now loaded before calling `init.lua`. The+ file can be used entirely for user customization. Patching+ marshaling functions, while discouraged, is still possible via+ the `debug` module.+ + All Lua modules bundled with pandoc, i.e., `pandoc.List`,+ `pandoc.mediabag`, `pandoc.utils`, and `text` are re-exported from the+ `pandoc` module. They are assigned to the fields `List`, `mediabag`,+ `utils`, and `text`, respectively.++ * Text.Pandoc.Lua (Albert Krewinkel):++ + Split `StackInstances` into smaller Marshaling modules.+ + Get `CommonState` from Lua global. This allows more control over+ the common state from within Lua scripts.++ * LaTeX template:++ + Support the `subject` metadata variable (#5289, Pascal Wagler).+ + Add `\frontmatter`, `\mainmatter`, `\backmatter`+ for book classes (#5306).++ * epub3 template: Add titlepage class to section (#5269).++ * HTML5 template: Add ARIA role `doc-toc` for table of contents (#4213).++ * Make `--metadata-file` use selected extensions (#5279, #5272, Mauro Bieg).++ * Text.Pandoc.Shared:++ + Remove `withTempDir` [API change].+ + Add new exported function `defaultUserDataDirs` [API change].+ + Add `filterIpynbOutput` [API change].+ + `compactify`: Avoid lists with a mix of Plain and Para elements+ (#5285).++ * Text.Pandoc.Translations: reorder alphabetically and remove `Author`+ (#5334, Mauro Bieg).++ * Text.Pandoc.Extensions:++ + More carefully groom ipynb default extensions.+ + Add `all_symbols_escapable` to `githubMarkdownExtensions`.++ * Text.Pandoc.PDF:++ + Use system temp directory when possible (#1192). Previously we+ created temp dirs in the working directory, partly (a) because+ there were problems using the system temp directory on Windows,+ when their pathnames included tildes, and partly (b) because+ programs like `epstopdf.pl` would not be allowed to write to+ directories outside the working directory in restricted mode. We+ now (a) use the system temp dir except when the path includes+ tildes, and (b) set `TEXMFOUTPUT` when creating the PDF, so that+ subsidiary programs can use the system temp directory. This+ addresses problems that occurred when pandoc was used in a+ synced directory (such as Dropbox).+ + Change types of subsidiary functions to PandocIO, to allow+ warnings to be threaded through (#5343).++ * Text.Pandoc.MIME: add WebP (#5267, Mauro Bieg).++ * Tests: avoid calling `findPandoc` multiple times.++ * Old tests: remove need for temp files by using `pipeProcess`.++ * Added simple ipynb reader/writer tests (#5274).++ * Rearrange `--help` output in a more rational way, with common+ options at the beginning and options grouped by function (#5336).++ * trypandoc: Add JATS and other missing formats (Arfon Smith, #5291).++ * Add missing copyright notices and remove license boilerplate (#4592,+ Albert Krewinkel).++ * Use latest basement/foundation on 32bit windows.++ * Use latest skylighting (#5328). Custom syntax definitions no+ longer try to load `language.dtd`.++ * Require texmath 0.11.2.1++ * Use latest pandoc-citeproc (0.16.1.1).++ * MANUAL.txt:++ + Clarify variable substitution indentation in templates (#5338,+ Agustín Martín Barbero).+ + Reorder custom-styles section (#5324, Mauro Bieg).++## pandoc 2.6 (2019-01-30)++ * Support ipynb (Jupyter notebook) as input and output format.++ + Add `ipynb` as input and output format (extension `.ipynb`).+ + Added Text.Pandoc.Readers.Ipynb [API change].+ + Added Text.Pandoc.Writers.Ipynb [API change].+ + Add `PandocIpynbDecodingError` constructor to Text.Pandoc.Error.Error+ [API change].+ + Depend on ipynb library.+ + Note: there is no template for ipynb.++ * Add DokuWiki reader (#1792, Alexander Krotov). This adds+ Text.Pandoc.Readers.DokuWiki [API change], and adds `dokuwiki`+ as an input format.++ * Implement task lists (#3051, Mauro Bieg). Added `task_lists`+ extension. Task lists are supported from markdown and gfm input.+ They should work, to some degree, in all output formats, though in+ most formats you'll get a bullet list with a unicode character for+ the box. In HTML, you get checkboxes and in LaTeX/PDF output, a+ box is used as the list marker. API changes:++ + Added constructor `Ext_task_lists` to `Extension`.+ + Added `taskListItemFromAscii` and `taskListItemToAscii` to+ Text.Pandoc.Shared.++ * Allow some command line options to take URL in addition to FILE.+ `--include-in-header`, `--include-before-body`, `--include-after-body`.++ * HTML reader:++ + Handle empty `start` attribute (see #5162).+ + Treat `textarea` as a verbatim environment (#5241) and preserve+ spacing.++ * RST reader:++ + Change treatment of `number-lines` directive (Brian Leung,+ #5207). Directives of this type without numeric inputs should+ not have a `startFrom` attribute; with a blank value, the+ writers can produce extra whitespace.+ + Removed superfluous `sourceCode` class on code blocks (#5047).+ + Handle `sourcecode` directive as synonym for `code` (#5204).++ * Markdown reader:++ + Remove `sourceCode` class for literate Haskell code blocks+ (#5047). Reverse order of `literate` and `haskell` classes on+ code blocks when parsing literate Haskell, so `haskell` is+ first.+ + Treat `<textarea>` as a verbatim environment (#5241).++ * Org reader:++ + Handle `minlevel` option differently (#5190, Brian Leung).+ When `minlevel` exceeds the original minimum level observed in+ the file to be included, every heading should be shifted+ rightward.+ + Allow for case of `:minlevel == 0` (#5190).+ + Fix treatment of links to images (#5191, Albert Krewinkel).+ Links with descriptions which are pointing to images are no+ longer parsed as inline images, but as links.+ + Add support for #+SELECT_TAGS (Brian Leung).+ + Separate filtering logic from conversion function (Brian Leung).++ * TWiki reader: Fix performance issue with underscores (#3921).++ * MediaWiki reader: use `_` instead of `-` in auto-identifiers (#4731).+ We may not still be exactly matching mediawiki's algorithm.++ * LaTeX reader:++ + Remove `sourceCode` class for literate Haskell code blocks+ (#5047). Reverse order of `literate` and `haskell` classes on+ code blocks when parsing literate Haskell, so `haskell` is+ first.+ + Support `\DeclareMathOperator` (#5149).+ + Support `\inputminted` (#5103).+ + Support `\endinput` (#5233).+ + Allow includes with dots like `cc_by_4.0`. Previously the `.0`+ was interpreted as a file extension, leading pandoc not to add+ `.tex` (and thus not to find the file). The new behavior matches+ tex more closely.++ * Man reader:++ + Use `mapLeft` from Shared instead of defining own.++ * Docx reader (Jesse Rosenthal):++ + Handle level overrides (#5134).++ * Docx writer:++ + Support custom properties (#3024, #5252, Agustín Martín Barbero).+ Also supports additional core properties: `subject`, `lang`,+ `category`, `description`.+ + Make Level into a real type, instead of an alias for a tuple+ (Jesse Rosenthal).++ * ICML writer (Mauro Bieg):++ + Support custom-styles (#5137, see #2106).+ + Support unnumbered headers (#5140).++ * Texinfo writer: Use header identifier for anchor if present (#4731).+ Previously we were overwriting an existing identifier with a new one.++ * Org writer: Preserve line-numbering for example and code blocks+ (Brian Leung).++ * Man/Ms writers: Don't escape `-` as `\-`. The `\-` gets rendered+ in HTML and PDF as a unicode minus sign.++ * Ms writer: Ensure we have a newline after .EN in display math (#5251).++ * RST writer: Don't wrap simple table header lines (#5128).++ * Asciidoc writer: Shorter delimiters for tables, blockquotes+ (#4364). This matches asciidoctor reference docs.++ * Dokuwiki writer: Remove automatic `:` prefix before internal image+ links (#5183, Damien Clochard). This prevented users from making+ relative image links.++ * Zimwiki writer: remove automatic colon prefix before internal+ images (#5183, Damien Clochard).++ * MediaWiki writer: fix caption, use 'thumb' instead of 'frame'+ (#5105). Captions used to have the word 'caption' prepended; this+ has been removed. Also, 'thumb' is used instead of 'frame' to+ allow images to be resized.++ * reveal.js writer:++ + Ensure that we don't get > 2 levels of section nesting,+ even with slide level > 2 (#5168).+ + If slide level == N but there is no N-level header, make+ sure the next header with level > N gets treated as a slide+ and put in a section, rather than remaining loose (#5168).++ * Markdown writer:++ + Make `plain` RawBlocks pass through in `plain` output.+ + Include needed whitespace after HTML figure (#5121).+ We use HTML for a figure in markdown dialects that can't+ represent it natively.++ * Commonmark writer:++ + Fix handling of SoftBreak with `hard_line_breaks` (#5195).+ + Implement `--toc` (`writerTableOfContents`)+ in commonmark/gfm writers (#5172).++ * EPUB writer:++ + Ensure that picture transforms are done on metadata too.+ + Small fixes to `nav.xhtml`:+ Add 'landmarks' id attribute to the landmarks nav.+ Replace old default CSS removing numbers from ol.toc li+ with new rules that match `nav#toc ol, nav#landmarks ol`.+ We keep the `toc` class on `ol` for backwards compatibility.++ * LaTeX writer:++ + Make raw content marked `beamer` pass through in `beamer`+ output (pandoc/lua-filters#40).+ + Beamer: avoid duplicated `fragile` property in some cases+ (#5208).+ + Add `#` special characters for listings (#4939).+ This character needs special handling in `\lstinline`.++ * RTF writer: use `toTableOfContents` from Shared to replace+ old duplicated code.++ * Pptx writer:++ + Support custom properties. Also supports additional core+ properties: `subject`, `category`, `description` (#5252,+ Agustín Martín Barbero).+ + Use `toTableOfContents` from Shared to replace old duplicated code.++ * ODT writer (Augustín Martín Barbero):++ + Fix typo in custom properties (#2839).+ + Improve standard properties, including the following core+ properties: `generator` (Pandoc/VERSION), `description`, `subject`,+ `keywords`, `initial-creator` (from authors), `creation-date`+ (actual creation date) (#5252).++ * Custom writers:++ + Allow '-' in filenames for custom lua writers (#5187).+ + sample.lua: add `SingleQuoted`, `DoubleQuoted` (#5104).+ + sample.lua: Add a missing `>` (MichaWiedenmann).++ * reveal.js template: Add `zoomKey` config (#4249).++ * HTML5 template: Remove unnecessary type="text/css" on style and+ link for HTML5 (#5146).++ * LaTeX template (Andrew Dunning, except where noted):++ + Prevent fontspec from scaling `mainfont` to match the default+ font, Latin Modern. A main font set to 12pt could+ previously appear between 11pt to 13pt depending on its design.+ To return to the earlier rendering, use `-V+ mainfontoptions="Scale=MatchLowercase"` (#5212, #5218).+ + Display monospaced fonts without TeX ligatures when using+ `--pdf-engine=lualatex`. It now matches the behaviour of other+ engines (#5212, #5218).+ + Remove the deprecated `romanfont` variable. The functionality of+ `mainfont` is identical (#5218).+ + Render `\subtitle` with the standard document classes.+ Previously, `subtitle` only appeared when using the KOMA-Script+ classes or Beamer (#5213, #5244).+ + Use Babel instead of Polyglossia for LuaLaTeX. This avoids+ several language selection problems, notably with retaining+ French spacing conventions when switching to a verbatim+ environment or another language; and in printing Greek text+ without hyphenation (#5193).+ + Use the [`xurl`](https://ctan.org/pkg/xurl) package if+ available, improving the appearance of URLs by allowing them to+ break at additional points (#5193).+ + Use [`bookmark`](https://ctan.org/pkg/bookmark) if available+ to correct heading levels in PDF bookmarks: see the [KOMA-Script+ 3.26 release notes](https://komascript.de/release3.26) (#5193).+ + Require the [`xcolor`](https://ctan.org/pkg/xcolor) package to+ avoid a possible error when using additional packages alongside+ footnotes in tables (#5193, closes #4861).+ + Remove obsolete `fixltx2e` package, which has no functionality+ with TeX Live 2015 or later (#5193).+ + Allow multiple `fontfamilies.options` (#5193, closes #5194).+ + Restrict `institute` variable to Beamer (#5219).+ + Use [`footnotehyper`](https://ctan.org/pkg/footnotehyper)+ package if available to make footnotes in tables compatible+ with `hyperref` (#5234).+ + Number parts and chapters in book classes only if the+ `numbersections` variable is set, for consistency with other+ output formats. To return to the previous behaviour, use+ `-V numbersections -V secnumdepth=0` (#5235).+ + Reindent file (#5193).+ + Use built-in parskip handling with KOMA-Script classes (#5143, Enno).+ + Set default listings language for lua, assembler (#5227, John+ MacFarlane). Otherwise we get an error when trying to compile code+ with lua or assembler code. To change the default dialect+ (currently 5.3 for lua and x86masm for assembler), you can use+ `--include-in-header` to inject something like+ `\lstset{defaultdialect=[5.2]Lua}`.++ * Text.Pandoc.Readers: Changed types of `readJSON`; it now runs+ in an instance of PandocMonad, like the other readers and+ writers. [API change]++ * Text.Pandoc.Writers: Changed types of `writeJSON`; it now runs+ in an instance of PandocMonad, like the other readers and+ writers. [API change]++ * Text.Pandoc.Error: Added `PandocUTF8DecodingError` constructor+ for `PandocError`. [API change]++ * Text.Pandoc.Writers.Shared - add `toTableOfContents`. [API change]+ This is refactored out from the Markdown writer.+ It can be used in other writers to create a table of contents.++ * Improve error messages for UTF-8 decoding errors. Now we give+ the filename and byte offset (#4765).++ * Text.Pandoc.XML: Strip out illegal XML characters in+ `escapeXMLString` (#5119).++ * Text.Pandoc.Process: update `pipeProcess` (Albert Krewinkel).+ The implementation of `pipeProcess` was rewritten to fix sporadic+ failures caused by prematurely closed pipes.++ * Use `safeRead` instead of `read` everywhere in the code+ (John MacFarlane, Mauro Bieg, #5162, #5180).++ * Text.Pandoc.SelfContained: Decompress `.svgz` when+ converting to `data:` URI (#5163, Alexander Krotov).++ * Text.Pandoc.Parsing: Remove unused `HasHeaderMap`+ (#5175, Alexander Krotov). [API change]++ * Normalize Windows paths to account for change in ghc 8.6 (#5127).+ When pandoc is compiled with ghc 8.6, Windows paths are treated+ differently, and paths beginning `\\server` no longer work.+ This commit rewrites such patsh to `\\?\UNC\server` which works.+ The change operates at the level of argument parsing, so it+ only affects the command line program.++ * Simplify/fix reading of `--metadata` values on command line+ to avoid problems relating to hvr/HsYAML#7 (#5177).++ * data/pandoc.lua: auto-fix nested constructor arguments (Albert+ Krewinkel). Incorrect types to pandoc element constructors are+ automatically converted to the correct types when possible. This was+ already done for most constructors, but conversions are now also done+ for nested types (like lists of lists).++ * Removed custom Setup.hs, use build-type: simple. The only thing we+ gained from the custom build was automatic installation of the man+ page when using 'cabal install'. But custom builds cause problems,+ e.g., with cross-compilation. Installation of the man page is+ better handled by packagers. Note to packagers (e.g. Debian): it+ may be necessary to add a step installing the man page with the+ next release.++ * Allow latest http-client, tasty, zip-archive, Glob.++ * Require skylighting >= 0.7.5, adding support for sml, J,+ typescript.++ * Tests: Cleaned up `findPandoc` in `Tests.Helpers`, so it+ works well with cabal v2.++ * INSTALL.md:++ + Use button for installer links (John MacFarlane, Mauro Bieg,+ #5167).+ + Fix links and bump required stack version (max).+ + Improve installation notes on associated software (Andrew+ Dunning). Includes explanation of how to install related tools+ with package managers (since the method of installing+ `rsvg-convert` is not obvious).++ * doc/org.md: improve documentation of org features (Albert+ Krewinkel).++ * doc/lua-filters.md: use 3rd level headers for module fields.++ * MANUAL:++ + Clarify automatic identifiers (#5201). We remove+ non-alphanumerics. This includes, e.g., emojis.+ + Fix example for Div with id (Geoffrey Ely).+ + Update list of LaTeX packages used.+ + Make it clear that `hard_line_breaks` works in `gfm` (see #5195).+ + Mention `raw_attribute` in documentation for `raw_html` and+ `raw_tex` (#5240, thanks to @eiro).+ + Clarify that `$sep$` must come right before `$endfor$` in templates+ (#5243, Lev Givon).+ + Document metadata support for docx, odt, pptx writers (Agustín+ Martín Barbero).+ + Reorganize template variables (#5249, Andrew Dunning).+ Add additional headings to categorize variables, and+ alphabetize when there is large number; add more examples.+ + Document `date-meta` template variable (#5260, Tristan Stenner).++ * trypandoc: Fix CSS and viewport.++## pandoc 2.5 (2018-11-27)++ * Text.Pandoc.App: split into several unexported submodules (Albert+ Krewinkel): Text.Pandoc.App.FormatHeuristics,+ Text.Pandoc.App.Opt, Text.Pandoc.App.CommandLineOptions,+ Text.Pandoc.App.OutputSettings. This is motivated partly by the+ desire to reduce recompilations when something is modified,+ since App previously depended on virtually every other module.++ * Text.Pandoc.Extensions++ + Semantically, `gfm_auto_identifiers` is now a modifier of+ `auto_identifiers`; for identifiers to be set, `auto_identifiers` must+ be turned on, and then the type of identifier produced depends on+ `gfm_auto_identifiers` and `ascii_identifiers` are set. Accordingly,+ `auto_identifiers` is now added to `githubMarkdownExtensions` (#5057).+ + Remove `ascii_identifiers` from `githubMarkdownExtensions`.+ GitHub doesn't seem to strip non-ascii characters any more.++ * Text.Pandoc.Lua.Module.Utils (Albert Krewinkel)++ + Test AST object equality via Haskell (#5092). Equality of Lua+ objects representing pandoc AST elements is tested by unmarshalling+ the objects and comparing the result in Haskell.+ A new function `equals` which performs this test has been added to the+ `pandoc.utils` module.+ + Improve stringify. Meta value strings (MetaString)+ and booleans (MetaBool) are now converted to the literal string and the+ lowercase boolean name, respectively. Previously, all values of these+ types were converted to the empty string.++ * Text.Pandoc.Parsing: Remove Functor and Applicative constraints where Monad+ already exists (Alexander Krotov).++ * Text.Pandoc.Pretty: Don't render BreakingSpace at end of line+ or beginning of line (#5050).++ * Text.Pandoc.Readers.Markdown++ + Fix parsing of citations, quotes, and underline emphasis+ after symbols. Starting with pandoc 2.4, citations, quoted inlines,+ and underline emphasis were no longer recognized after certain+ symbols, like parentheses (#5099, #5053).+ + In pandoc 2.4, a soft break after an abbreviation would be+ relocated before it to allow for insertion of a nonbreaking+ space after the abbreviation. This behavior is here reverted.+ A soft break after an abbreviation will remain, and no nonbreaking+ space will be added. Those who care about this issue should take care not+ to end lines with an abbreviation, or to insert nonbreaking spaces+ manually.++ * Text.Pandoc.Readers.FB2: Do not throw error for unknown elements in+ `<body>` (Alexander Krotov). Some libraries include custom elements+ in their FB2 files.++ * Text.Pandoc.Readers.HTML++ + Allow `tfoot` before body rows (#5079).+ + Parse `<small>` as a Span with class "small" (#5080).+ + Allow thead containing a row with `td` rather than `th` (#5014).++ * Text.Pandoc.Readers.LaTeX++ + Cleaned up handling of dimension arguments. Allow decimal points,+ preceding space.+ + Don't allow arguments for verbatim, etc.+ + Allow space before bracketed options.+ + Allow optional arguments after `\\` in tables.+ + Improve parsing of `\tiny`, `\scriptsize`, etc. Parse as raw,+ but know that these font changing commands take no arguments.++ * Text.Pandoc.Readers.Muse++ + Trim whitespace before parsing grid table cells (Alexander Krotov).+ + Add grid tables support (Alexander Krotov).++ * Text.Pandoc.Shared++ + For bibliography match Div with id `refs`, not class `references`.+ This was a mismatch between pandoc's docx, epub, latex, and markdown+ writers and the behavior of pandoc-citeproc, which actually looks for a+ div with id `refs` rather than one with class `references`.+ + Exactly match GitHub's identifier generating algorithm (#5057).+ + Add parameter for `Extensions` to `uniqueIdent` and+ `inlineListToIdentifier` (#5057). [API change]+ This allows these functions to be sensitive to the settings of+ `Ext_gfm_auto_identifiers` and `Ext_ascii_identifiers`, and allows us to+ use `uniqueIdent` in the CommonMark reader, replacing custom code. It+ also means that `gfm_auto_identifiers` can now be used in all formats.++ * Text.Pandoc.Writers.AsciiDoc++ + Use `.`+ as list markers to support nested ordered lists (#5087).+ + Support list number styles (#5089).+ + Render Spans using `[#id .class]#contents#` (#5080).++ * Text.Pandoc.Writers.CommonMark++ + Respect `--ascii` (#5043, quasicomputational).+ + Make sure `--ascii` affects quotes, super/subscript.++ * Text.Pandoc.Writers.Docx++ + Fix bookmarks to headers with long titles (#5091).+ Word has a 40 character limit for bookmark names. In addition, bookmarks+ must begin with a letter. Since pandoc's auto-generated identifiers may+ not respect these constraints, some internal links did not work. With+ this change, pandoc uses a bookmark name based on the SHA1 hash of the+ identifier when the identifier isn't a legal bookmark name.+ + Add bookmarks to code blocks (Nikolay Yakimov).+ + Add bookmarks to images (Nikolay Yakimov).+ + Refactor common bookmark creation code into a function (Nikolay Yakimov).++ * Text.Pandoc.Writers.EPUB: Handle calibre metadata (#5098).+ Nodes of the form++ <meta name="calibre:series" content="Classics on War and Politics"/>++ are now included from an epub XML metadata file. You can also include+ this information in your YAML metadata, like so:++ calibre:+ series: Classics on War and Policitics++ In addition, ibooks-specific metadata can now be included via an XML+ file. (Previously, it could only be included via YAML metadata, see+ #2693.)++ * Text.Pandoc.Writers.HTML: Use plain `"` instead of `"` outside of+ attributes.++ * Text.Pandoc.Writers.ICML: Consolidate adjacent strings, inc. spaces.+ This avoids splitting up the output unnecessarily into separate elements.++ * Text.Pandoc.Writers.LaTeX: Don't emit `[<+->]` unless beamer output, even+ if `writerIncremental` is True (#5072).++ * Text.Pandoc.Writers.Muse (Alexander Krotov).++ + Output tables as grid tables if they have multi-line cells.+ + Indent simple tables only on the top level.+ + Output tables with one column as grid tables.+ + Add support for `--reference-location`.+ + Internal improvements.++ * Text.Pandoc.Writers.OpenDocument: Fix list indentation (Nils Carlson,+ #5095). This was a regression in pandoc 2.4.++ * Text.Pandoc.Writers.RTF: Fix warnings for skipped raw inlines.++ * Text.Pandoc.Writers.Texinfo: Add blank line before `@menu` section (#5055).++ * Text.Pandoc.XML: in `toHtml5Entities`, prefer shorter entities+ when there are several choices for a particular character.++ * data/abbreviations++ + Add additional abbreviations (Andrew Dunning)+ Many of these borrowed from the Chicago Manual of Style 10.42,+ 'Scholarly abbreviations'.++ * Templates++ + Asciidoc template: add :lang: to title header is lang is set in+ metadata (#5088).++ * pandoc.cabal: Add cabal flag `derive_json_via_th` (Albert Krewinkel)+ Disabling the flag will cause derivation of ToJSON and FromJSON+ instances via GHC Generics instead of Template Haskell. The flag is+ enabled by default, as deriving via Generics can be slow (see #4083).++ * trypandoc:++ + Tweaked drop-down lists.+ + Put link to site in footer.+ + Preselect output format.+ + Update on change of in or out format.+ + Add man input format.++ * MANUAL.txt:++ + Fix outdated description of latex_macros extension.+ + Clarified placement of bibliography.+ + Added "A note on security."+ + Fix note on curly brace syntx for locators.+ + Document new explicit syntax for citeproc locators.+ + Remove confusing cross-links for some extensions.+ + Don't put pandoc in code ticks in heading.+ + Document that `--ascii` works for gfm and commonmark too.+ + Add `man` to `--from` options.++ * doc/customizing-pandoc.md: various improvements (Mauro Bieg).+++## pandoc 2.4 (2018-11-03)++### New features++ * New input format `man` (Yan Pashkovsky, John MacFarlane).++### Behavior changes++ * `--ascii` is now implemented in the writers, not in Text.Pandoc.App,+ via the new `writerPreferAscii` field in `WriterOptions`.+ Now the `write*` functions for Docbook, HTML, ICML, JATS, LaTeX,+ Ms, Markdown, and OPML are sensitive to `writerPreferAscii`.+ Previously the to-ascii translation was done in Text.Pandoc.App,+ and thus not available to those using the writer functions+ directly.++ * `--ascii` now works with Markdown output. HTML5 character reference+ entities are used.++ * `--ascii` now works with LaTeX output. 100% ASCII output can't be+ guaranteed, but the writer will use commands like `\"{a}` and `\l`+ whenever possible, to avoid emitting a non-ASCII character.++ * For HTML5 output, `--ascii` now uses HTML5 character reference+ entities rather than numerical entities.++ * Improved detection of format based on extension (in Text.Pandoc.App).+ We now ensure that if someone tries to convert a file for a+ format that has a pandoc writer but not a reader, it won't just+ default to markdown.++ * Add viz. to abbreviations file (#5007, Nick Fleisher).++ * AsciiDoc writer: always use single-line section headers,+ instead of the old underline style (#5038). Previously the single-line+ style would be used if `--atx-headers` was specified, but+ now it is always used.++ * RST writer: Use simple tables when possible (#4750).++ * CommonMark (and gfm) writer: Add plain text fallbacks. (#4528,+ quasicomputational). Previously, the writer would unconditionally+ emit HTML output for subscripts, superscripts, strikeouts (if the+ strikeout extension is disabled) and small caps, even with+ `raw_html` disabled. Now there are plain-text (and, where+ possible, fancy Unicode) fallbacks for all of these corresponding+ (mostly) to the Markdown fallbacks, and the HTML output is only+ used when `raw_html` is enabled.++ * Powerpoint writer: support raw openxml (Jesse Rosenthal, #4976).+ This allows raw openxml blocks and inlines to be used in the pptx+ writer. Caveats: (1) It's up to the user to write+ well-formed openxml. The chances for corruption, especially with+ such a brittle format as pptx, is high. (2) Because of+ the tricky way that blocks map onto shapes, if you are using+ a raw block, it should be the only block on a slide+ (otherwise other text might end up overlapping it). (3) The+ pptx ooxml namespace abbreviations are different from the+ docx ooxml namespaces. Again, it's up to the user to get it+ right. Unzipped document and ooxml specification should be+ consulted.++ * With `--katex` in HTML formats, do not use the autorenderer (#4946).+ We no longer surround formulas with `\(..\)` or `\[..\]`. Instead,+ we tell katex to convert the contents of span elements with+ class "math". Since math has already been identified, this+ avoids wasted time parsing for LaTeX delimiters. Note, however,+ that this may yield unexpected results if you have span elements+ with class "math" that don't contain LaTeX math.+ Also, use latest version of KaTeX by default (0.9.0).++ * The man writer now produces ASCII-only output, using groff escapes,+ for portability.++ * ODT writer:++ + Add title, author and date to metadata; any remaining+ metadata fields are added as `meta:user-defined` tags.+ + Implement table caption numbering (#4949, Nils Carlson).+ Captioned tables are numbered and labeled with format "Table 1:+ caption", where "Table" is replaced by a translation, depending+ on the value of `lang` in metadata. Uncaptioned tables are not+ enumerated.+ + OpenDocument writer: Implement figure numbering in captions (#4944,+ Nils Carlson). Figure captions are now numbered 1, 2, 3, ...+ The format in the caption is "Figure 1: caption" and so on+ (where "Figure" is replaced by a translation, depending on the+ value of `lang` in the metadata). Captioned figures are numbered+ consecutively and uncaptioned figures are not enumerated. This+ is necessary in order for LibreOffice to generate an+ Illustration Index (Table of Figures) for included figures.++ * RST reader: Pass through fields in unknown directives as div attributes+ (#4715). Support `class` and `name` attributes for all directives.++ * Org reader: Add partial support for `#+EXCLUDE_TAGS` option. (#4284,+ Brian Leung). Headers with the corresponding tags should not+ appear in the output.++ * Log warnings about missing title attributes now include a+ suggestion about how to fix the problem (#4909).++ * Lua filter changes (Albert Krewinkel):++ + Report traceback when an error occurs. A proper Lua traceback is+ added if either loading of a file or execution of a filter+ function fails. This should be of help to authors of Lua filters+ who need to debug their code.++ + Allow access to pandoc state (#5015). Lua filters and custom+ writers now have read-only access to most fields of pandoc's+ internal state via the global variable `PANDOC_STATE`.++ + Push ListAttributes via constructor (Albert Krewinkel).+ This ensures that ListAttributes, as present in OrderedList elements,+ have additional accessors (viz. `start`, `style`, and `delimiter`).++ + Rename ReaderOptions fields, use snake_case. Snake case is used+ in most variable names, using camelCase for these fields was an+ oversight. A metatable is added to ensure that the old field+ names remain functional.++ + Iterate over AST element fields when using `pairs`. This makes+ it possible to iterate over all ield names of an AST element by+ using a generic `for` loop with pairs`:++ for field_name, field_content in pairs(element) do+ ...+ end++ Raw table fields of AST elements should be considered an+ implementation detail and might change in the future. Accessing+ element properties should always happen through the fields+ listed in the Lua filter docs.++ Note that the iterator currently excludes the `t`/`tag` field.++ + Ensure that MetaList elements behave like Lists. Methods usable+ on Lists can also be used on MetaList objects.++ + Fix MetaList constructor (Albert Krewinkel). Passing a MetaList+ object to the constructor `pandoc.MetaList` now returns the+ passed list as a MetaList. This is consistent with the+ constructor behavior when passed an (untagged) list.++ * Custom writers: Custom writers have access to the global variable+ `PANDOC_DOCUMENT`(Albert Krewinkel, #4957). The variable contains+ a userdata wrapper around the full pandoc AST and exposes two+ fields, `meta` and `blocks`. The field content is only+ marshaled on-demand, performance of scripts not accessing the+ fields remains unaffected.++### API changes++ * Text.Pandoc.Options: add `writerPreferAscii` to `WriterOptions`.++ * Text.Pandoc.Shared:++ + Export `splitSentences`. This was previously duplicated in the Man and+ Ms writers.+ + Add `ToString` typeclass (Alexander Krotov).++ * New exported module Text.Pandoc.Filter (Albert Krewinkel).++ * Text.Pandoc.Parsing++ + Generalize `gridTableWith` to any `Char` Stream (Alexander Krotov).+ + Generalize `readWithM` from `[Char]` to any `Char` Stream+ that is a `ToString` instance (Alexander Krotov).++ * New exposed module Text.Pandoc.Filter (Albert Krewinkel).++ * Text.Pandoc.XML: add `toHtml5Entities`.++ * New exported module Text.Pandoc.Readers.Man (Yan Pashkovsky, John+ MacFarlane).++ * Text.Pandoc.Writers.Shared++ + Add exported functions `toSuperscript` and+ `toSubscript` (quasicomputational, #4528).+ + Remove exported functions `metaValueToInlines`,+ `metaValueToString`. Add new exported functions+ `lookupMetaBool`, `lookupMetaBlocks`, `lookupMetaInlines`,+ `lookupMetaString`. Use these whenever possible for uniformity+ in writers (Mauro Bieg, #4907). (Note that+ removed function `metaValueToInlines` was in previous+ released versions.)+ + Add `metaValueToString`.++ * Text.Pandoc.Lua++ + Expose more useful internals (Albert Krewinkel):++ - `runFilterFile` to run a Lua filter from file;+ - data type `Global` and its constructors; and+ - `setGlobals` to add globals to a Lua environment.++ This module also contains `Pushable` and `Peekable` instances+ required to get pandoc's data types to and from Lua. Low-level+ Lua operation remain hidden in Text.Pandoc.Lua.++ + Rename `runPandocLua` to `runLua` (Albert Krewinkel).++ + Remove `runLuaFilter`, merging this into Text.Pandoc.Filter.Lua's+ `apply` (Albert Krewinkel).++### Bug fixes and under-the-hood improvements++ * Text.Pandoc.Parsing++ + Make `uri` accept any stream with Char tokens (Alexander Krotov).+ + Rewrite `uri` without `withRaw` (Alexander Krotov).+ + Generalize `parseFromString` and `parseFromString'` to any+ streams with Char token (Alexander Krotov)+ + Rewrite `nonspaceChar` using `noneOf` (Alexander Krotov)++ * Text.Pandoc.Shared: Reimplement `mapLeft` using `Bifunctor.first`+ (Alexander Krotov).++ * Text.Pandoc.Pretty: Simplify `Text.Pandoc.Pretty.offset`+ (Alexander Krotov).++ * Text.Pandoc.App++ + Work around HXT limitation for --syntax-definition with windows+ drive (#4836).+ + Always preserve tabs for man format. We need it for tables.+ + Split command line parsing code into a separate unexported+ module, Text.Pandoc.App.CommandLineOptions (Albert Krewinkel).++ * Text.Pandoc.Readers.Roff: new unexported module for tokenizing+ roff documents.++ * New unexported module Text.Pandoc.RoffChar, provided character+ escape tables for roff formats.++ * Text.Pandoc.Readers.HTML: Fix `htmlTag` and `isInlineTag` to+ accept processing instructions (#3123, regression since 2.0).++ * Text.Pandoc.Readers.JATS: Use `foldl'` instead of `maximum` to+ account for empty lists (Alexander Krotov).++ * Text.Pandoc.Readers.RST: Don't allow single-dash separator in+ headerless table (#4382).++ * Text.Pandoc.Readers.Org: Parse empty argument array in inline src+ blocks (Brian Leung).++ * Text.Pandoc.Readers.Vimwiki:++ + Get rid of `F`, `runF` and `stateMeta'` in favor of `stateMeta`+ (Alexander Krotov).+ + Parse `Text` without converting to `[Char]` (Alexander Krotov).++ * Text.Pandoc.Readers.Creole: Parse `Text` without converting to+ `[Char]` (Alexander Krotov).++ * Text.Pandoc.Readers.LaTeX++ + Allow space at end of math after `\` (#5010).+ + Add support for `nolinkurl` command (#4992, Brian Leung).+ + Simplified type on `doMacros'`.+ + Tokenize before pulling tokens, rather than after (#4408). This+ has some performance penalty but is more reliable.+ + Make macroDef polymorphic and allow in inline context.+ Otherwise we can't parse something like `\lowercase{\def\x{Foo}}`.+ I have actually seen tex like this in the wild.+ + Improved parsing of `\def`, `\let`. We now correctly parse:+ ```+ \def\bar{hello}+ \let\fooi\bar+ \def\fooii{\bar}+ \fooi +\fooii++ \def\bar{goodbye}+ \fooi +\fooii+ ```+ + Improve parsing of `\def` argspec.+ + Skip `\PackageError` commands (see #4408).+ + Fix bugs omitting raw tex (#4527). The default is `-raw_tex`,+ so no raw tex should result unless we explicitly say `+raw_tex`.+ Previously some raw commands did make it through.+ + Moved `isArgTok` to Text.Pandoc.Readers.LaTeX.Parsing.+ + Moved `babelLangToBCP`, `polyglossiaLangToBCP` to new module,+ Text.Pandoc.Readers.LaTeX.Lang (unexported).+ + Simplified accent code using unicode-transforms.+ New dependency on unicode-transforms package for normalization.+ + Allow verbatim blocks ending with blank lines (#4624).+ + Support `breq` math environments: `dmath`, `dgroup`, `darray`.+ This collects some of the general-purpose code from the LaTeX reader,+ with the aim of making the module smaller.++ * Text.Pandoc.Readers.Markdown++ + Fix awkward soft break movements before abbreviations (#4635).+ + Add updateStrPos in a couple places where needed.++ * Text.Pandoc.Readers.Docx: Trigger bold/italic with bCs, iCs+ (#4947). These are variants for "complex scripts" like Arabic+ and are now treated just like b, i (bold, italic).++ * Text.Pandoc.Readers.Muse (Alexander Krotov)++ + Try to parse lists before trying to parse table.+ This ensures that tables inside lists are parsed correctly.+ + Forbid whitespace after opening and before closing markup+ elements.+ + Parse page breaks.+ + Simplify `museToPandocTable` to get rid of partial functions.+ + Allow footnotes to start with empty line.+ + Make sure that the whole text is parsed.+ + Allow empty headers. Previously empty headers caused parser to+ terminate without parsing the rest of the document.+ + Allow examples to be indented with tabs.+ + Remove indentation from examples indicated by `{{{` and `}}}`.+ + Fix parsing of empty cells.+ + Various changes to internals.+ + Rewrite some parsers in applicative style.+ + Avoid tagsoup dependency.+ + Allow table caption to contain `+`.++ * Text.Pandoc.Writers.LaTeX++ + Add newline if math ends in a comment (#4880). This prevents the+ closing delimiter from being swalled up in the comment.+ + With `--listings`, don't pass through org-babel attributes (#4889).+ + With `--biblatex`, use `\autocite` when possible (#4960).+ `\autocites{a1}{a2}{a3}` will not collapse the entries. So, if+ we don't have prefixes and suffixes, we use instead+ `\autocite{a1,a2,a3}`.+ + Fix description lists contining highlighted code (#4662).++ * Text.Pandoc.Writers.Man++ + Don't wrap `.SH` and `.SS` lines (#5019).+ + Avoid unnecessary `.RS`/`.RE` pair in definition lists with+ one paragraph definitions.+ + Moved common groff functions to Text.Pandoc.Writers.Groff.+ * Fix strong/code combination on man (should be `\f[CB]` not+ `\f[BC]`, see #4973).+ + Man writer: use `\f[R]` instead of `\f[]` to reset font+ (Alexander Krotov, #4973).+ + Move `splitSentences` to Text.Pandoc.Shared.++ * Text.Pandoc.Writers.Docx++ + Add framework for custom properties (#3034). So far, we don't+ actually write any custom properties, but we have the+ infrastructure to add this.++ + Handle tables in table cells (#4953). Although this is not+ documented in the spec, some versions of Word require a `w:p`+ element inside every table cell. Thus, we add one when the+ contents of a cell do not already include one (e.g. when a table+ cell contains a table).++ * Text.Pandoc.Writers.AsciiDoc: Prevent illegal nestings.+ Adjust header levels so that n+1 level headers are only+ found under n level headers, and the top level is 1.++ * Text.Pandoc.Writers.OpenDocument: Improve bullet/numbering+ alignment (#4385). This change eliminates the large gap we used+ to have between bullet and text, and also ensures that numbers+ in numbered lists will be right-aligned.++ * Text.Pandoc.Writers.ZimWiki++ + Number ordered list items sequentially, rather than always+ with 1 (#4962).+ + Remove extra indentation on lists (#4963).++ * Text.Pandoc.Writers.EPUB: Use metadata field `css` instead of+ `stylesheet` (Mauro Bieg, #4990).++ * Text.Pandoc.Writers.Markdown: Ensure blank between raw block and+ normal content (#4629). Otherwise a raw block can prevent a+ paragraph from being recognized as such.++ * Text.Pandoc.Writers.Ms++ + Removed old `escapeBar`. We don't need this now that we use+ `@` for math delim.+ + Moved common code to Text.Pandoc.Writers.Roff and to+ Text.Pandoc.RoffChar.+ + Move `splitSentences` to Text.Pandoc.Shared (to avoid duplication+ with the man writer).++ * Text.Pandoc.Writers.Muse (Alexander Krotov).++ + Add support for grid tables.+ + Fix Muse writer style.+ + Use `length` instead of `realLength` to calculate definition+ indentation. Muse parsers don't take character width into+ account when calculating indentation.+ + Do not insert newline before lists.+ + Use lightweight markup after `</em>` tag.++ * New unexported module Text.Pandoc.Writers.Roff, providing functions+ useful for all roff format writers (man, ms).++ * Text.Pandoc.Lua++ + Move globals handling to separate module Text.Pandoc.Lua.Global+ (Albert Krewinkel).++ + Lua filter internals: push Shared.Element as userdata (Albert+ Krewinkel). Hierarchical Elements were pushed to Lua as plain+ tables. This is simple, but has the disadvantage that marshaling+ is eager: all child elements will be marshaled as part of the+ object. Using a Lua userdata object instead allows lazy access+ to fields, causing content marshaling just (but also each time)+ when a field is accessed. Filters which do not traverse the full+ element contents tree become faster as a result.++### Default template changes++ * LaTeX template:++ + Add variable `hyperrefoptions` (#4925, Mathias Walter).+ + Add variable `romanfont`, `romanfontoptions` (#4665, OvidiusCicero).++ * AsciiDoc template: use single-line style for title.++ * revealjs template: Fix typo in the socket.io javascript plugin (#5006,+ Yoan Blanc).++ * Text.Pandoc.Lua.Util: add missing docstring to `defineHowTo`+ (Albert Krewinkel).++ * data/pandoc.lua: add datatype ListAttributes (Albert Krewinkel)++ * data/sample.lua: replace custom pipe function with pandoc.utils.pipe+ (Albert Krewinkel).++### Documentation improvements++ * INSTALL.md++ + Add chromeos install instructions (#4958) (Evan Pratten).+ + Add note about TinyTeX.++ * MANUAL.txt++ + Change `groff` -> `roff`.+ + Implement `--ascii` for Markdown writer.+ + Clarify LaTeX image dimensions output (Mauro Bieg).++ * doc/customizing-pandoc.md: added skeleton (Mauro Bieg, #3288).++ * doc/getting-started.md: Added title to test1.md to avoid warning.++ * doc/lua-filters.md: merge type references into main document,+ fix description of Code.text (Albert Krewinkel).++### Build infrastructure improvements++ * Makefile++ + Makefile: added quick-cabal, full-cabal targets.+ + Make .msi download targets insensitive to order of appveyor builds.++ * Update benchmarks for ghc 8.6.1.++ * pandoc.cabal:++ + Enable more compiler warnings (Albert Krewinkel).+ + Make base lower bound 4.8.+ + Bump upper bound for QuickCheck.+ + Bump upper bound for binary.+ + Updated version bounds for containers and haddock-library (#4974).+ + Added docx/docPropos/custom.xml to cabal data-files.+ + Require skylighting 0.7.4 (#4920).+ + New dependency on unicode-transforms package for normalization.++ * Improved .travis.yml testing and test with GHC 8.6.1 (Albert Krewinkel).++ * Added `tools/changelog-helper.sh`.++ * Added test/grofftest.sh for testing the man reader on real man pages.++## pandoc 2.3.1 (2018-09-28)++ * RST reader:++ + Parse RST inlines containing newlines (#4912, Francesco Occhipinti).+ This eliminates a regression introduced after pandoc 2.1.1, which+ caused inline constructions containing newlines not to be recognized.+ + Fix bug with internal link targets (#4919). They were gobbling up+ indented content underneath.++ * Markdown reader: distinguish autolinks in the AST. With this change,+ autolinks are parsed as Links with the `uri` class. (The same is true+ for bare links, if the `autolink_bare_uris` extension is enabled.)+ Email autolinks are parsed as Links with the `email` class. This+ allows the distinction to be represented in the AST.++ * Org reader:++ + Force inline code blocks to honor export options (Brian Leung).+ + Parse empty argument array in inline src blocks (Brian Leung).++ * Muse reader (Alexander Krotov):++ + Added additional tests.+ + Do not allow code markup to be followed by digit.+ + Remove heading level limit.+ + Simplify `<literal>` tag parsers+ + Parse Text instead of String. Benchmark shows 7% improvement.+ + Get rid of HTML parser dependency.+ + Various code improvements.++ * ConTeXt writer: change `\` to `/` in Windows image paths (#4918).+ We do this in the LaTeX writer, and it avoids problems.+ Note that `/` works as a LaTeX path separator on Windows.++ * LaTeX writer:++ + Add support for multiprenote and multipostnote arguments+ with `--biblatex` (Brian Leung, #4930). The multiprenotes occur before+ the first prefix of a multicite, and the multipostnotes follow the+ last suffix.+ + Fix a use of `last` that might take empty list. If you ran with+ `--biblatex` and have an empty document (metadata but no blocks),+ pandoc would previously raise an error because of the use of+ `last` on an empty list.++ * RTF writer: Fix build failure with ghc-8.6.1 caused by missing+ MonadFail instance (Jonas Scholl).++ * ODT Writer: Improve table header row style handling (Nils Carlson).+ This changes the way styles for cells in the header row+ and normal rows are handled in ODT tables.+ Previously a new (but identical) style was generated for+ every table, specifying the style of the cells within the table.+ After this change there are two style definitions for table cells,+ one for the cells in the header row, one for all other cells.+ This doesn't change the actual styles, but makes post-processing+ changes to the table styles much simpler as it is no longer+ necessary to introduce new styles for header rows and there are+ now only two styles where there was previously one per table.++ * HTML writer:++ + Don't add `uri` class to presumed autolinks. Formerly the `uri`+ class was added to autolinks by the HTML writer, but it had to+ guess what was an autolink and could not distinguish+ `[http://example.com](http://example.com)` from+ `<http://example.com>`. It also incorrectly recognized+ `[pandoc](pandoc)` as an autolink. Now the HTML writer+ simply passes through the `uri` attribute if it is present,+ but does not add anything.+ + Avoid adding extra section nestings for revealjs.+ Previously revealjs title slides at level (slidelevel - 1)+ were nested under an extra section element, even when+ the section contained no additional (vertical) content.+ That caused problems for some transition effects.+ + Omit unknown attributes in EPUB2 output. For example,+ `epub:type` attributes should not be passed through,+ or the epub produced will not validate.++ * JATS writer: remove 'role' attribute on 'bold' and 'sc' elements (#4937).+ The JATS spec does not allow these.++ * Textile writer: don't represent `uri` class explicitly+ for autolinks (#4913).++ * Lua filters (Albert Krewinkel):++ + Cleanup filter execution code.+ + Better error on test failure.++ * HTML, Muse reader tests: reduce time taken by round-trip test.++ * Added cabal.project.++ * MANUAL: `epub:type` is only useful for epub3 (Maura Bieg).++ * Use hslua v1.0.0 (Albert Krewinkel).++ * Fix `translations/ru` to use modern Russian orthography+ (Ivan Trubach).++ * Build Windows binary using ghc 8.6.1 and cabal new-build. This+ fixes issues with segfaults in the 32-bit Windows binaries (#4283).++## pandoc 2.3 (2018-09-16)++ * Add `--metadata-file` option (Mauro Bieg, #1960), which allows+ users to specify metadata in a YAML file, regardless of the+ input format (#1960).++ * Text.Pandoc.Writers.Shared: export `isDisplayMath` (API change).++ * Text.Pandoc.Readers.Markdown: export `yamlToMeta` (API change,+ Mauro Bieg).++ * Text.Pandoc.Readers.LaTeX.Types:++ + New type `ArgSpec` (API change).+ + Second parameter of `Macro` constructor is now `[ArgSpec]` instead of+ `Int` (API change).++ * Markdown reader:++ + Use `tex` instead of `latex` for raw tex-ish content. We can't+ always tell if it's LaTeX, ConTeXt, or plain TeX. Better just to+ use `tex` always. Note that if `context` or `latex` specifically+ is desired, you can still force that in a markdown document by+ using the raw attribute. Note that this change may affect some+ filters, if they assume that raw tex parsed by the Markdown reader+ will be RawBlock (Format `latex`). In most cases it should be+ trivial to modify the filters to accept `tex` as well.+ + Refactor and reorganize YAML code (Mauro Bieg).+ + Make `example_lists` work for interrupted lists+ without `startnum` (#4908).++ * HTML reader:++ + Parse `<script type="math/tex` tags as math (#4877).+ These are used by MathJax in some configurations.+ + Extract spaces inside links instead of trimming them+ (Alexander Krotov, #4845).+ + Added round-trip tests (Alexander Krotov).+ + Make parsing sensitive to the `raw_tex` extension (#1126). This now+ allows raw LaTeX environments, `\ref`, and `\eqref` to be parsed+ (which is helpful for translation HTML documents using MathJaX).++ * Org reader (Albert Krewinkel):++ + Respect export option `p` for planning info. Inclusion of planning info+ (`*DEADLINE*`, `*SCHEDULED*`, and `*CLOSED*`) can be controlled via the+ `p` export option: setting the option to `t` will add all planning+ information in a *Plain* block below the respective headline.+ + Org reader internals: don't rely on RecordWildCards and ViewPatterns+ ghc extensions.+ + Strip planning info from output. Planning info is parsed, but not+ included in the output (as is the default with Emacs Org-mode, #4867).++ * LaTeX reader:++ + Handle parameter patterns for `\def` (#4768, #4771).+ For example: `\def\foo#1[#2]{#1 and #2}`.+ + Allow `%` characters in URLs. This affects `\href` and `\url` (#4832).+ + Fixed parsing of `\texorpdfstring`. We were returning the wrong+ argument as the content.+ + Support `blockcquote`, `foreignblockquote`, `foreigncblockquote`,+ `hyphenblockquote`, `hyphencblockquote`, `enquote*`, `foreignquote`,+ `hyphenquote` from `csquotes` (#4848). Note that `foreignquote`+ will be parsed as a regular Quoted inline (not using the quotes+ appropriate to the foreign language).+ + Support more text-mode accents (#4652). Add support for `\|`, `\b`, `\G`,+ `\h`, `\d`, `\f`, `\r`, `\t`, `\U`, `\i`, `\j`, `\newtie`,+ `\textcircled`. Also fall back to combining characters when composed+ characters are not available.+ + Resolve `\ref` for figure numbers.+ + Support `mintinline` (#4365, Marc Schreiber).+ + Fix siunitx unit commands so they are only recognized in+ siunitx contexts (#4842). For example, `\l` outside of an+ siunitx context should be l-slash, not l (for liter).+ + Fix double `unnumbered` class (#4838). The `unnumbered` class+ was being included twice for starred sections.++ * RST reader: Don't skip link definitions after comments (#4860).++ * Muse reader (Alexander Krotov):++ + Close the `</quote>` in indented tag test.+ There is already a separate test for unclosed `</quote>`.+ + Autonumber sections in the correct order. Parsing now stops+ at each section header to ensure the header is registered before+ parsing of the next section starts.+ + Move duplicate code into `headingStart` function.+ + Allow newline after opening `*` or `**`.+ + Don't allow digits after closing marker in lightweight markup+ This change makes reader more compatible with Emacs Muse.+ + Parse `<verse>` tag in one pass instead of using+ `parseFromString`. This change makes it possible to have+ verbatim `</verse>` tag inside verse.++ * ODT reader: deal gracefully with missing `<office:font-face-decls/>`+ (#4336). This allows pandoc to parse ODT document produced by KDE's+ Calligra.++ * Muse writer (Alexander Krotov):++ + Output headers without asterisks if not on the top level.+ + Never wrap definition list terms.+ + Set `envInsideBlock = True` when rendering notes.+ + Use `""` instead of `[]` for empty String.+ + Check for whitespace in the beginning and end of Str's.+ + Escape `-`, `;` and `>` in the beginning of strings.+ + Escape list markers in the beginning of notes.+ + Normalize inline list before testing if tags should be used.+ + Use tags instead of lightweight markup for empty strings.+ + Use lightweight markup when possible.+ + Escape empty strings. This guarantees that `conditionalEscapeString`+ never returns empty string.+ + Wrap conditionalEscapeString result into `Muse` type.+ This removes the need to pass `envInsideLinkDescription` to it.+ + Separate `shouldEscapeString` function.+ + Simplify inline list rendering.+ + Replace newlines in strings with spaces.++ * Docx writer:++ + Add MetaString case for abstract, subtitle (#4900, Mauro Bieg).+ + Properly handle display math in spans (#4826). This isn't a+ complete solution, since other nestings of display math may still+ cause problems, but it should work for what is by far the most+ common case.++ * HTML writer:++ + Always output `<dt>` element, even if it is empty (#4883,+ Alexander Krotov).+ + Don't prefix `epub:` attributes with `data-`.++ * Org writer: Don't escape literal `_`, `^` (#4882). Org doesn't+ recognize these escapes.++ * ODT writer: Fix percentage image scaling (#4881, Nils Carlson).+ Image scaling was broken when a width was set to a percentage.++ * EPUB writer: set `epub:type` on body element in each chapter,+ depending on the `epub:type` of the first section (#4823). This+ only affects epub3. See+ http://www.idpf.org/epub/profiles/edu/structure/#h.l0bzsloklt10++ * FB2 writer: put `coverpage` element between title and date rather than in+ `document-info` element (#4854).++ * Markdown writer: Escape `~` if strikeout extension enabled (#4840).++ * Haddock writer: Use proper format for latex math in haddock (#4571, Joe+ Hermaszewski). Inline math in `\(..\)`, display math in `\[..\]`,+ tex is now used. Previously we'd "fake it with unicode" and fall+ back to tex when that didn't work. But newer haddock versions+ support latex math.++ * TEI writer:++ + Ensure that title element is always present, even if empty (#4839).+ + Put author tags in the template, rather than adding them in+ the writer (#4839).++ * LaTeX writer/template: be sensitive to `filecolor` variable (#4822).+ `linkcolor` only affects internal links, and `urlcolor` only+ affects linked URLs. For external links, the option to use is+ `filecolor`.++ * ConTeXt writer: output raw `tex` blocks as well as `context` (#969).++ * RST writer:++ + Use `.. raw:: latex` for `tex` content.+ + Use `.. container` for generic Divs, instead of raw HTML.+ + Render Divs with admonition classes as admonitions (#4833).+ Also omit Div with class `admonition-title`. These are generated+ by the RST reader and should be omitted on round-trip.++ * Text.Pandoc.PDF: fix message printed when rsvg-convert is not available+ (#4855, Antonio Terceiro).++ * HTML5 template: add the `title-block-header` identifier to the+ `header` element, to make it easier to style precisely (#4767,+ J. B. Rainsberger).++ * OpenDocument template: Remove unnecessary indenting of TOC title (#4798,+ José de Mattos Neto).++ * latex template: Add support for $toc-title$ to LaTeX (and PDF)+ (#4853, Wandmalfarbe).++ * TEI template: improve `publicationStmt`. Add support for+ `publisher`, `address`, `pubPlace`, and `date` variables.++ * beamer template: Support "toc-title" (#4835, Cyril Roelandt).++ * Text.Pandoc.Extensions: Fix haddock on `Ext_footnotes` (Chris Martin).++ * Lua: cleanup Lua utils, remove unused functions (Albert Krewinkel).++ * MANUAL.txt:++ + Clarify that `--biblatex/--natbib` don't work directly for PDF+ (#4904).+ + Document `epub:type` attribute (Mauro Bieg, #4901)+ + Clarify when `--resource-path` has an effect.+ + More detail on customization in syntax highlighting section.+ + Document encoding issue with `--listings` (#4871, Damien Clochard).+ + Remove docs on removed `--katex-stylesheet` (Mauro Bieg, #4862).+ + Use https for context wiki links (#4910).++ * CONTRIBUTING.md:++ + Link to lua-filters repository (#4874).+ + Fix mistake in REPL instructions for stack. (#4849, Brian Leung).++ * lua-filters.md: add links to filters, and to lua-filters repository+ (#4874).++ * INSTALL.md:++ + Indicate that cabal >= 2.0 is needed.+ + Added chocolatey installation method (#4844, Miodrag Milić).++ * Travis: exclude round-trip tests, except for nightly test which can fail.++ * Use latest texmath, pandoc-citeproc.++ * Use a patched version of foundation until+ https://github.com/haskell-foundation/foundation/pull/503+ is fixed.++ * Clean up appveyor build and Windows package creation.+ We now use 64-bit stack and ghc 8.4.3, lts-12 for the 64-bit build. The+ WiX-based msi is now 64-bit for 64-bit builds (fixing #4795).++ * Remove obsolete RELEASE-CHECKLIST.md.++ * Added additional compiler warnings in Makefile and CI builds.++## pandoc 2.2.3.2 (2018-08-07)++ * Markdown reader: Properly handle boolean values in YAML metadata (#4819).+ This fixes a regression in 2.2.3, which cause boolean values to+ be parsed as MetaInlines instead of MetaBool.++ We here record another undocumented (but desirable) change in 2.2.3:+ numerical metadata fields are now parsed as MetaInlines rather than+ MetaString.++## pandoc 2.2.3.1 (2018-08-06)++ * Markdown reader: Fix parsing of embedded mappings in YAML metadata+ (#4817). This fixes a regression in 2.2.3 which caused embedded+ mappings (e.g. mappings in sequences) not to work in YAML metadata.++## pandoc 2.2.3 (2018-08-05)++ * RST reader: improve parsing of inline interpreted text roles (#4811).++ + Use a Span with class "title-reference" for the default+ title-reference role.+ + Use `B.text` to split up contents into `Space`s, `SoftBreak`s,+ and `Str`s for `title-reference`.+ + Use Code with class "interpreted-text" instead of Span and Str for+ unknown roles. (The RST writer has also been modified to round-trip+ this properly.)+ + Disallow blank lines in interpreted text.+ + Backslash-escape now works in interpreted text.+ + Backticks followed by alphanumerics no longer end interpreted text.+ + Remove support for nested inlines (Francesco Occhipinti).+ RST does not allow nested emphasis, links, or other inline+ constructs. This fixes several bugs (#4581, #4561, #4792).++ * Org reader: fix parsers relying on `parseFromString` (#4784, Albert+ Krewinkel). Emphasis was not parsed when it followed directly after+ some block types (e.g., lists).++ * Markdown reader: Allow unquoted numbers and booleans as YAML mapping+ keys. Previously in 2.2.2 you could not do+ ```+ ---+ 0: bar+ ...+ ```+ but only+ ```+ ---+ '0': bar+ ...+ ```+ With this change, both forms work.++ * DocBook reader: metadata handling improvements.+ Now we properly parse title and subtitle elements that are direct+ children of book and article (as well as children of bookinfo,+ articleinfo, or info). We also now use the `subtitle` metadata+ field for subtitles, rather than tacking the subtitle on to the+ title.++ * RST writer:++ + Allow images to be directly nested within links (#4810, Francesco+ Occhipinti).+ + Use `titleblock` instead of `title` variable for title block (#4803,+ Francesco Occhipinti). `titleblock` contains a properly formatted+ title and subtitle (using top-level headers). `title` and+ `subtitle` variables are still available and just contain the+ title and subtitle text. Note that this change will require an+ update to custom rst templates.+ + Render Code with class "interpreted-text" as interpreted text role.++ * MediaWiki writer: Avoid extra blank line in tables with empty cells+ (#4794). Note that the old output is semantically identical, but the+ new output looks better.++ * Lua Utils module: add function `blocks_to_inlines` (#4799, Albert+ Krewinkel). Exposes a function converting which flattenes a list of+ blocks into a list of inlines. An example use case would be the+ conversion of Note elements into other inlines.++ * RST template: use `titleblock` instead of `title`. Users of+ custom RST templates will want to update this.++ * LaTeX template: Moved some beamer code in default.latex template.+ This change allows beamer themes to change the template and font (as+ Metropolis does) (#4450).++ * Better error message on `-t pdf -o out.pdf` (#1155, Mauro Bieg).++ * Added test case for #4669 to repository.++ * INSTALL.md: Fix broken link for cabal-install (#4806, ChanHoHo).++ * MANUAL.txt:++ + Add beamer info for slide backgrounds (#4802, John Muccigrosso).+ + Clarify when `csquotes` is used in LaTeX writer (#4514).+ + Add `commonmark` to list of output formats where `raw_tex` has an+ effect (see #4527).+++## pandoc 2.2.2.1 (2018-07-19)++ * Fix regression finding templates in user data directory (#4777).+ Under version 2.2.1 and prior pandoc found latex templates in the+ templates directory under the data directory, but this broke in 2.2.2.++ * Fix for bug in parsing `\input` in `rawLaTeXBlock` and+ `rawLaTeXInline` (#4781). (This primarily affects the markdown+ reader, and other readers that accept raw tex.)+ Starting in 2.2.2, everything after an `\input` (or `\include`)+ in a markdown file would be parsed as raw LaTeX.++ * MANUAL:++ + Clarify `gfm` vs `markdown_github` (#4783, Mauro Bieg).+ * Use `keywords` instead of `tags` in YAML metadata example (#4779).+ Unlike `tags`, `keywords` is used in some of the writers+ and default templates.++ * Add missing `rollingLinks` option to revealjs template (#4778,+ Igor Khorlo).++## pandoc 2.2.2 (2018-07-16)++ * Use HsYAML instead of yaml for translations and YAML metadata (#4747).+ yaml wraps a C library; HsYAML is pure Haskell. Advances #4535.++ Note: HsYAML implements YAML 1.2, in which the valid true+ values are `true`, `True`, `TRUE`. This means a change in+ the semantics of YAML metadata that could affect users:+ `y`, `yes`, and `on` no longer count as true values.++ * Fix regression: make `--pdf-engine` work with full paths (#4681, Mauro+ Bieg).++ * CommonMark reader: Handle `ascii_identifiers` extension (#4742,+ Anders Waldenborg). Non-ascii characters were not stripped from+ identifiers even if the `ascii_identifiers` extension was+ enabled (which is is by default for gfm).++ * TikiWiki reader: Improve list parsing (#4722, Mauro Bieg).+ Remove trailing Space from list items. Parse lists that have no space+ after marker.++ * LaTeX reader:++ + Treat `lilypond` as a verbatim environment (#4725).+ + Parse figure label into Image id (#4700, Mauro Bieg).+ + Beamer: Allow "noframenumbering" option (#4696, Raymond Ehlers).+ + Allow spaces around `\graphicspath` arguments (#4698).+ + Handle includes without surrounding blanklines (#4553).+ In addition, `\input` can now be used in an inline context,+ e.g. to provide part of a paragraph, as it can in LaTeX.+ + In `rawLaTeXBlock`, handle macros that resolve to a+ `\begin` or `\end` (#4667).+ + In `rawLaTeXBlock`, don't expand macros in macro definitions (#4653).+ Note that this only affected LaTeX in markdown.+ + Tighten up reading of beamer overlay specifications (#4669).+ Ideally we'd turn these on only when reading beamer, but currently+ beamer is not distinguished from latex as an input format.+ This commit also activates parsing of overlay specifications+ after commands in general (e.g. `\item`), since they can occur+ in many contexts in beamer.+ + Parse more siunitx unit commands (#4296, #4773).+ + Be more forgiving in key/value option parsing (#4761).++ * Markdown reader:++ + Allow empty code spans, e.g. `` ` ` ``.+ + Emojis are now wrapped in Spans with class `emoji` and+ attribute `data-emoji` (Anders Waldenborg, #4743).+ This allows the writer to handle them in a special way+ (e.g. using a special font, or just rendering the+ emoji name).++ * Muse reader (Alexander Krotov, except where indicated):++ + Get rid of non-exhaustive pattern match warning (Mauro Bieg).+ + Add support for floating images.+ + Add support for images with specified width.+ + Parse image URLs without "guard" and "takeExtension".+ + Split link and image parsing into separate functions.+ + Parse links starting with "URL:" explicitly instead of trying to strip+ "URL:" prefix after parsing.++ * Texinfo writer: Use `@sup` and `@sub` instead of custom macros (#4728,+ Alexander Krotov).++ * Markdown writer: Preserve `implicit_figures` with attributes, even if+ `implicit_attributes` is not set, by rendering in raw HTML (#4677).++ * Markdown and commonmark/github writers now respect the `emoji`+ extension. So, `-f markdown+emoji -t markdown+emoji` now leaves+ `:smile:` as `:smile:` rather than converting it to a smile+ character.++ * Docx writer: Be sensitive to `toc` in YAML metadata (#4645).++ * ODT/OpenDocument writer: Make internal links work (#4358).+ This adds proper bookmarks to the headers with non-null IDs.++ * EPUB writer: Properly escape pagetitle. Previously we weren't+ escaping `&` and other XML characters in the pagetitle, so a title+ containing a `&` would be invalid.++ * AsciiDoc Writer: Eescape square brackets at start of line (#4545,+ Mauro Bieg).++ * RST writer:++ + Don't treat 'example' as a syntax name (#4748).+ This fixes conversions from org with example blocks.+ + Support `--number-sections` via the `section-numbering`+ directive in standalone output.++ * reveal.js writer and template: reuse mathjax URL+ provided by the argument to `--mathjax` or the normal pandoc default,+ rather than a hard-coded one in the template (#4701).++ * LaTeX writer:++ + Properly handle footnotes in table captions (#4683).+ Refactored code from figure captions to use in both places.+ + In beamer output, fix single digit column percentage (#4690, Mauro+ Bieg).++ * FB2 writer (Alexander Krotov):++ + Convert Plain to Para in annotation (#2424).+ + Fix order of items in title-info (#2424).++ * Custom writer: fix error message on script failure (Albert Krewinkel).+ Error messages produced by Lua were not displayed by Pandoc.++ * Text.Pandoc.Emoji now exports `emojiToInline`, which returns a Span+ inline containing the emoji character and some attributes with metadata+ (class `emoji`, attribute `data-emoji` with emoji name). (API change,+ Anders Waldenborg, #4743).++ * Text.Pandoc.PDF:++ + Revert fix for #4484 (only compress images on last run, #4755).+ This will mean some increase in the time it takes to+ produce an image-heavy PDF with xelatex, but it will+ make tables of contents correct, which is more important.+ + Fix logic error in `runTeXProgram`. We were running the tex program+ one more time than requested. This should speed up PDF production.++ * Allow `--template` to take a URL as argument.++ * Text.Pandoc.Highlighting: Add missing re-export of `breezeDark`+ highlighting style (#4687, Adrian Sieber, API change).++ * Clarify macOS install in INSTALL.md (#4661). Make the binary package+ installer the recommended method, and note that on some older versions of+ macOS, homebrew installs from source and takes a lot of disk space+ (#4664, Ian).++ * MANUAL:++ + Clarify EPUB linked media (#4756, Mauro Bieg)+ + Update manual for "true" YAML values. Now that we're using HsYAML and+ YAML 1.2, the valid true values are `true`, `True`, `TRUE`. NOTE!+ `y`, `yes`, `on` no longer count as true values.+ + Document `-F` as alias for `--filter` (thanks to Gandalf Saxe).+ + Update manual on how math is rendered in LaTeX.+ + Add proxy description (#4131, Mauro Bieg).+ + Clarify that `--toc` requires `--standalone` (#4703).+ + Update citation styles link (#4699, wiefling).++ * In API docs, clarify how `Ext_east_asian_line_breaks` extension works+ (kaizshang91). Note that it will not take effect when readers/writers+ are called as libraries (#4674).++ * Improved translations/fr (#4766, lux-lth).++ * Removed inadvertently added `.orig` files from repository (#4648).++ * Remove `network-uri` flag and use 'Network.Socket'.+ This removes a compiler warning. There is no need for the old+ `network-uri` flag, since network 2.6 was released in 2014.++ * Add stack.lts10.yaml, stack.lts11.yaml. use lts-12 in stack.yaml.++ * Bump upper bounds for dependent packages.++ * Exclude foundation 0.0.21 for ghc 7.10. Otherwise cabal gets+ confused because of the way ghc 7.10 is excluded in foundation's+ cabal file. This can be removed when haskell-foundation/foundation#500+ is fixed.++ * Require cabal-version >= 2.0. This is needed for haddock-library.+++++## pandoc 2.2.1 (2018-05-10)++ * Restored and undeprecated gladtex for HTML math (#4607).++ + Added `GladTeX` constructor to `Text.Pandoc.Options.HTMLMathMethod`+ [API change, reverts removal in v2.2]+ + Restored and undeprecated `--gladtex` option, removed in v2.2.++ * LaTeX reader: Handle `$` in `/text{..}` inside math (#4576).++ * Org reader: Fix image filename recognition (Albert Krewinkel).+ Use a function from the filepath library to check whether a string is a+ valid file name. The custom validity checker that was used before gave+ wrong results (e.g. for absolute file paths on Windows,+ kawabata/ox-pandoc#52).++ * FB2 reader: Replace some errors with warnings (Alexander Krotov).++ * HTML writer:++ + Strip links from headers when creating TOC (#4340).+ Otherwise the TOC entries will not link to the sections.+ + Fix regression with tex math environments in HTML + MathJax (#4639).++ * Muse writer (Alexander Krotov): Add support for left-align and+ right-align classes (#4542).++ * Docx writer: Support underline (#4633).++ * Text.Pandoc.Parsing: Lookahead for non-whitespace after+ `singleQuoteStart` and `doubleQuoteStart` (#4637).++ * `test-pandoc-utils.lua`: more robust testing on both windows+ and \*nix. Previously the pipe tests were only run if+ `\bin/false` and `/bin/sed` were present, which they aren't+ in default MacOS and Windows systems. Fixed by using `tr`+ and `false`, which should always be in the path on a \*nix+ system, and `find` and `echo` for Windows.++ * Text.Pandoc.Shared: add `uriPathToPath`.+ This adjusts the path from a file: URI in a way that is sensitive+ to Windows/Linux differences. Thus, on Windows,+ `/c:/foo` gets interpreted as `c:/foo`, but on Linux,+ `/c:/foo` gets interpreted as `/c:/foo`. See #4613.++ * Use `uriPathToPath` with file: URIs (#4613).++ * Revert piping HTML to pdf-engine (Mauro Bieg, #4413). Use a temp+ file as before.++ * Text.Pandoc.Class: Catch IO errors when writing media files+ and issue a warning, rather than an error (Francesco Occhipinti, #4559).++ * Don't lowercase custom writer filename (Alexander Krotov, #4610).++ * MANUAL (Mauro Bieg):++ + Clarify truthiness in template variables (#2281).+ + Clarify pipe table width calculation (#4520).++ * ConTeXt template: New Greek fallback typeface (Pablo Rodríguez, #4405).+ CMU Serif gives better typographic results than the previous+ Greek fallback DejaVu Serif.++ * Make HTML template polyglot (#4606, OvidiusCicero), by making+ `<link rel="stylesheet" href="$css$">` self-closing.++ * Use texmath 0.11, allowing better translation of non-ASCII+ characters in math (#4642).+++## pandoc 2.2 (2018-04-27)++ * New input format: `fb2` (FictionBook2) (Alexander Krotov).++ * Make `--ascii` work for all XML formats (ICML, OPML, JATS,...),+ and for `ms` and `man`.++ * Remove deprecated `--latexmathml`, `--gladtex`, `--mimetex`, `--jsmath`, `-m`,+ `--asciimathml` options.++ * New module Text.Pandoc.Readers.FB2, exporting readFB2 (Alexander+ Krotov, API change).++ * Markdown reader:++ + Allow empty key-value attributes, like `title=""` (#2944).+ + Handle table w/o following blank line in fenced div (#4560).+ + Remove "fallback" for `doubleQuote` parser. Previously the+ parser tried to be efficient -- if no end double quote was found,+ it would just return the contents. But this could backfire in a+ case `**this should "be bold**`, since the fallback would return+ the content `"be bold**` and the closing boldface delimiter+ would never be encountered.+ + Improve computation of the relative width of the last column in a+ multiline table, so we can round-trip tables without constantly+ shrinking the last column.++ * EPUB reader:++ + Fix images with space in file path (#4344).++ * LaTeX reader:++ + Properly resolve section numbers with `\ref` and chapters (#4529).+ + Parse sloppypar environment (#4517, Marc Schreiber).+ + Improve handling of raw LaTeX (for markdown etc.) (#4589, #4594).+ Previously there were some bugs in how macros were handled.+ + Support `\MakeUppercase`, `\MakeLowercase`, `\uppercase`,+ `\lowercase`, and also `\MakeTextUppercase` and+ `\MakeTextLowercase` from textcase (#4959).++ * Textile reader:++ + Fixed tables with no body rows (#4513).+ Previously these raised an exception.++ * Mediawiki reader:++ + Improve table parsing (#4508). This fixes detection of table+ attributes and also handles `!` characters in cells.++ * DocBook reader:++ + Properly handle title in `section` element (#4526).+ Previously we just got `section_title` for `section` (though `sect1`,+ `sect2`, etc. were handled properly).+ + Read tex math as output by asciidoctor (#4569, Joe Hermaszewski).++ * Docx reader:++ + Combine adjacent CodeBlocks with the same attributes into+ a single CodeBlock. This prevents a multiline codeblock in+ Word from being read as different paragraphs.++ * RST reader:++ + Allow < 3 spaces indent under directives (#4579).+ + Fix anonymous redirects with backticks (#4598).++ * Muse reader (Alexander Krotov):++ + Add support for Text::Amuse multiline headings.+ + Add `<math>` tag support.+ + Add support for `<biblio>` and `<play>` tags.+ + Allow links to have empty descriptions.+ + Require block `<literal>` tags to be on separate lines.+ + Allow `-` in anchors.+ + Allow verse to be indented.+ + Allow nested footnotes.+ + Internal improvements.++ * Muse writer (Alexander Krotov):++ + Escape `>` only at the beginning of a line.+ + Escape `]` in image title.+ + Escape `]` brackets in URLs as `%5D`.+ + Only escape brackets when necessary.+ + Escape ordered list markers.+ + Do not escape list markers unless preceded by space.+ + Escape strings starting with space.+ + Escape semicolons and markers after line break.+ + Escape `;` to avoid accidental comments.+ + Don't break headers, line blocks and tables with line breaks.+ + Correctly output empty headings.+ + Escape horizontal rule only if at the beginning of the line.+ + Escape definition list terms starting with list markers.+ + Place header IDs before header.+ + Improve span writing.+ + Do not join Spans in normalization.+ + Don't align ordered list items.+ + Remove key-value pairs from attributes before normalization.+ + Enable `--wrap=preserve` for all tests by default.+ + Reduced `<verbatim>` tags in output.+ + Internal changes.++ * RST writer:++ + Use more consistent indentation (#4563). Previously we+ used an odd mix of 3- and 4-space indentation. Now we use 3-space+ indentation, except for ordered lists, where indentation must+ depend on the width of the list marker.+ + Flatten nested inlines (#4368, Francesco Occhipinti).+ Nested inlines are not valid RST syntax, so we flatten them following+ some readability criteria discussed in #4368.++ * EPUB writer:++ + Ensure that `pagetitle` is always set, even when structured titles+ are used. This prevents spurious warnings about empty title+ elements (#4486).++ * FB2 writer (Alexander Krotov):++ + Output links inline instead of producing notes. Previously all links+ were turned into footnotes with unclickable URLs inside.+ + Allow emphasis and notes in titles.+ + Don't intersperse paragraph with empty lines.+ + Convert metadata value `abstract` to book annotation.+ + Use `<empty-line />` for `HorizontalRule` rather than `LineBreak`.+ FB2 does not have a way to represent line breaks inside paragraphs;+ previously we used `<empty-line />` elements, but these are not allowed+ inside paragraphs.++ * Powerpoint writer (Jesse Rosenthal):++ + Handle Quoted Inlines (#4532).+ + Simplify code with `ParseXml`.+ + Allow fallback options when looking for placeholder type.+ + Check reference-doc for all layouts.+ + Simplify speaker notes logic.+ + Change notes state to a simpler per-slide value.+ + Remove `Maybe` from `SpeakerNotes` in `Slide`. `mempty`+ means no speaker notes.+ + Add tests for improved speaker notes.+ + Handle speaker notes earlier in the conversion process.+ + Keep notes with related blocks (#4477). Some blocks automatically+ split slides (imgs, tables, `column` divs). We assume that any+ speaker notes immediately following these are connected to these+ elements, and keep them with the related blocks, splitting after them.+ + Remove `docProps/thumbnail.jpeg` in data dir (Jesse Rosenthal, #4588).+ It contained a nonfree ICC color calibration profile and is not needed+ for production of a powerpoint document.++ * Markdown writer:++ + Include a blank line at the end of the row in a single-row multiline+ table, to prevent it from being interpreted as a simple table (#4578).++ * CommonMark writer:++ + Correctly ignore LaTeX raw blocks when `raw_tex` is not+ enabled (#4527, quasicomputational).++ * EPUB writer:++ + Add `epub:type="footnotes"` to notes section in EPUB3 (#4489).++ * LaTeX writer:++ + In beamer, don't use format specifier for default ordered lists+ (#4556). This gives better results for styles that put ordered list+ markers in boxes or circles.+ + Update `\lstinline` delimiters (#4369, Tim Parenti).++ * Ms writer:++ + Use `\f[R]` rather than `\f[]` to reset font (#4552).+ + Use `\f[BI]` and `\f[CB]` in headers, instead of `\f[I]` and `\f[C]`,+ since the header font is automatically bold (#4552).+ + Use `\f[CB]` rather than `\f[BC]` for monospace bold (#4552).+ + Create pdf anchor for a Div with an identifier (#4515).+ + Escape `/` character in anchor ids (#4515).+ + Improve escaping for anchor ids: we now use _uNNN_ instead of uNNN+ to avoid ambiguity.++ * Man writer:++ + Don't escape U+2019 as `'` (#4550).++ * Text.Pandoc.Options:++ + Removed `JsMath`, `LaTeXMathML`, and `GladTeX` constructors from+ `Text.Pandoc.Options.HTMLMathMethod` [API change].++ * Text.Pandoc.Class:++ + `writeMedia`: unescape URI-escaping in file path. This avoids+ writing things like `file%20one.png` to the file system.++ * Text.Pandoc.Parsing:++ + Fix `romanNumeral` parser (#4480). We previously accepted 'DDC'+ as 1100.+ + `uri`: don't treat `*` characters at end as part of URI (#4561).++ * Text.Pandoc.MIME:++ + Use the alias `application/eps` for EPS (#2067).+ This will ensure that we retain the eps extension after reading the+ image into a mediabag and writing it again.++ * Text.Pandoc.PDF:++ + Use `withTempDir` in `html2pdf`.+ + With `xelatex`, don't compress images til the last run (#4484).+ This saves time for image-heavy documents.+ + Don't try to convert EPS files (#2067). `pdflatex` converts them+ itself, and JuicyPixels can't do it.+ + For `pdflatex`, use a temp directory in the working directory.+ Otherwise we can have problems with the EPS conversion pdflatex+ tries to do, which can't operate on a file above the working+ directory without `--shell-escape`.++ * Changes to tests to accommodate changes in pandoc-types.+ In <https://github.com/jgm/pandoc-types/pull/36> we changed+ the table builder to pad cells. This commit changes tests+ (and two readers) to accord with this behavior.++ * Set default extensions for `beamer` same as `latex`.++ * LaTeX template:++ + Add `beameroption` variable (#4359, Étienne Bersac).+ + Use `pgfpages` package; this is needed for notes on second+ screen in beamer (Étienne Bersac).+ + Add `background-image` variable (#4601, John Muccigrosso).++ * reveal.js template: Add `background-image` variable (#4600,+ John Muccigrosso).++ * ms template: Fix date. Previously `.ND` was used, but this only+ works if you have a title page, which we don't. Thanks to @teoric.++ * Removed pragmas for unused extensions (#4506, Anabra).++ * Fix bash completion for `--print-default-data-file` (#4549).+ Previously this looked in the filesystem, even if pandoc+ was compiled with `embed_data_files` (and sometimes it looked+ in a nonexistent build directory). Now the bash completion+ script just includes a hard-coded list of data file names.++ * MANUAL:++ + Clarify template vs metadata variables (#4501, Mauro Bieg).+ + Fix raw content example (#4479, Mauro Bieg).+ + Specify that you use html for raw output in epub.+ + Add examples for raw docx blocks (#4472, Tristan Stenner).+ The documentation states that the target format name should match+ the output format, which isn't the case for `docx`/`openxml` and+ some others.+ + Don't say that `empty_paragraphs` affects markdown output (#4540).+ + Consolidate input/output format documentation (#4577, Mauro Bieg).++ * New README template. Take in/out formats from manual.++ * Fix example in lua-filters docs (#4459, HeirOfNorton).++ * Use the `-threaded` GHC flag when building benchmarks (#4587,+ Francesco Occhipinti).++ * Bump temporary upper bound to 1.4.++ * Use pandoc-citeproc 0.14.3.1.++ * Use texmath-0.10.1.2 (fixes escapes in math in ms, #4597).++ * Removed old lib directory. This was used for something long ago,+ but plays no role now.++ * Removed unneeded data file `LaTeXMathML.js`.++ * Create 64- and 32-bit versions of Windows binary packages.++## pandoc 2.1.3 (2018-03-18)++ * Docx reader (Jesse Rosenthal):++ + Add tests for nested smart tags.+ + Parse nested smart tags.+ + Make unwrapSDT into a general `unwrap` function that can unwrap both+ nested SDT tags and smartTags. This makes the SmartTags constructor in+ the Docx type unnecessary, so we remove it (#4446).+ + Remove unused `docxWarnings` (Alexander Krotov).++ * RST reader: Allow unicode bullet characters (#4454).++ * Haddock reader: Better table handling, using haddock-library's+ new table support, if compiled against a version that+ includes it. Note that tables with col/rowspans will not+ translate well into Pandoc.++ * Muse reader (Alexander Krotov):++ + Various internal improvements.+ + Require closing tag to have the same indentation as opening.+ + Do not reparse blocks inside unclosed block tag (#4425).+ + Parse `<class>` tag (supported by Emacs Muse).+ + Do not produce empty Str element for unindented verse lines.++ * LaTeX reader:++ + Add support to parse unit string of `\SI` command (closes #4296,+ Marc Schreiber).++ * Haddock writer: In the writer, we now render tables always as+ grid tables, since Haddock supports these.++ * DokuWiki writer: rewrite backSlashLineBreaks (#4445, Mauro Bieg).++ * Docx writer: Fixed formatting of `DefaultStyle` ordered lists in+ docx writer. We want decimal for the top level, not lower roman.++ * RST writer:++ + Strip whitespace at beginning and ending of inline containers+ (#4327, Francesco Occhipinti).+ + Filter out empty inline containers (#4434). There is nothing in+ RST that corresponds to e.g. `Emph []`, so we just ignore elements+ like this (Francesco Occhipinti).++ * Muse writer (Alexander Krotov):++ + Support spans with anchors.+ + Replace smallcaps with emphasis before normalization.+ + Output smallcaps as emphasis.+ + Expand Cite before list normalization.+ + Write empty inline lists as `<verbatim></verbatim>`.+ + Remove empty Str from the beginning of inline lists during normalization.+ + Escape "-" to avoid creating bullet lists.+ + Fix math expansion for more than one expression per paragraph.+ + Expand math before inline list normalization.++ * Dokuwiki writer: fix LineBreaks in Tables (#4313, Mauro Bieg).++ * Ms writer:++ + Asciify pdf anchors, since unicode anchors don't work (#4436).+ Internal links should be converted automatically, so this shouldn't+ affect users directly.+ + Don't escape hyphens as `\-`; that's for a minus sign (#4467).++ * Beamer writer: put hyperlink after `\begin{frame}` and not in the title+ (#4307). If it's in the title, then we get a titlebar on slides with+ the `plain` attribute, when the id is non-null. This fixes a regression+ in 2.0.++ * EPUB writer: Remove notes from TOC in nav.xhtml (#4453, Mauro Bieg).++ * JATS writer: Remove extraneous, significant whitespace (#4335,+ Nokome Bentley).++ * html2pdf: inject base tag with current working directory (#4413, Mauro+ Bieg). This helps ensure that linked resources are included.++ * Add Semigroup instances for everything for which we defined a+ Monoid instance previously (API change):++ + Text.Pandoc.Class.FileTree.+ + Text.Pandoc.Translations.Translations.+ + Text.Pandoc.Extensions.Extensions.+ + Text.Pandoc.Readers.Odt.StyleReader.Styles.+ + Text.Pandoc.Pretty.Doc.+ + Text.Pandoc.MediaBag.MediaBag.++ * Add custom Prelude to give clean code for Monoid and Semigroup+ that works with ghc 7.10-8.4. The custom Prelude (`prelude/Prelude`)+ is used for ghc versions < 8.4. `NoImplicitPrelude` is used+ in all source files, and Prelude is explicitly imported+ (this is necessary for ghci to work properly with the custom prelude).++ * Text.Pandoc.Writers.Shared (Francesco Occhipinti):++ + Export `stripLeadingTrailingSpace`.+ + Don't wrap lines in grid tables when `--wrap=none` (#4320).+ + `gridTable`: Don't wrap lines in tables when `--wrap=none`. Instead,+ expand cells, even if it results in cells that don't respect relative+ widths or surpass page column width. This change affects RST,+ Markdown, and Haddock writers.++ * Raise error if someone tries to print docx, odt, etc. template (#4441).++ * LaTeX template: Provide `bidi` package's option using+ `\PassOptionsToPackage` (#4357, Václav Haisman). This avoid a+ clash when `polyglossia` loads it first and then it is loaded again+ for XeLaTeX.++ * ConTeXt template: Added `pdfa` variable to generate PDF/A (#4294, Henri+ Menke). Instructions on how to install the ICC profiles on ConTeXt+ standalone can be found in the wiki:+ <http://wiki.contextgarden.net/PDFX#ICC_profiles>.+ If the ICC profiles are not available the log will contain error+ messages.++ * Use latest pandoc-types, skylighting++ * Use latest pandoc-citeproc in binary package.++ * Bump upper bound for time, criterion, haddock-library, exceptions,+ http-types, aeson, haddock-library.++ * Bump upper bound tasty-quickcheck 0.10 (#4429, Felix Yan).++ * pandoc.cabal: fix up other-extensions and language fields.+ Language is now consistently `Haskell2010`, and other-extensions+ is consistently `NoImplicitPrelude`. Everything else to be specified+ in the module header as needed.++ * Removed `old-locale` flag and Text.Pandoc.Compat.Time.+ This is no longer necessary since we no longer support ghc 7.8.++ * Make `weigh-pandoc` into a benchmark program.+ Remove `weigh-pandoc` flag. `weigh-pandoc` is now built (and run)+ automatically when you build (and run) benchmarks.++ * MANUAL: add instructions for background images reveal.js (#4325, John+ Muccigrosso).++ * appveyor: use VS 2013 environment instead of VS 2015 for Windows builds.++## pandoc 2.1.2 (2018-03-02)++ * Markdown reader:++ + Fix parsing bug with nested fenced divs (#4281). Previously we allowed+ "nonindent spaces" before the opening and closing `:::`, but this+ interfered with list parsing, so now we require the fences to be flush with+ the margin of the containing block.++ * Commonmark reader:++ + `raw_html` is now on by default. It can be disabled explicitly+ using `-f commonmark-raw_html`.++ * Org reader (Albert Krewinkel):++ + Move citation tests to separate module.+ + Allow changing emphasis syntax (#4378). The characters allowed before+ and after emphasis can be configured via `#+pandoc-emphasis-pre` and+ `#+pandoc-emphasis-post`, respectively. This allows to change which+ strings are recognized as emphasized text on a per-document or even+ per-paragraph basis. Example:++ #+pandoc-emphasis-pre: "-\t ('\"{"+ #+pandoc-emphasis-post: "-\t\n .,:!?;'\")}["++ * LaTeX reader:++ + Fixed comments inside citations (#4374).+ + Fix regression in package options including underscore (#4424).+ + Make `--trace` work.+ + Fixed parsing of `tabular*` environment (#4279).++ * RST reader:++ + Fix regression in parsing of headers with trailing space (#4280).++ * Muse reader (Alexander Krotov):++ + Enable `<literal>` tags even if amuse extension is enabled.+ Amusewiki disables <literal> tags for security reasons.+ If user wants similar behavior in pandoc, RawBlocks and RawInlines+ can be removed or replaced with filters.+ + Remove space prefix from `<literal>` tag contents.+ + Do not consume whitespace while looking for closing end tag.+ + Convert alphabetical list markers to decimal in round-trip test.+ Alphabetical lists are an addition of Text::Amuse.+ They are not present in Emacs Muse and can be ambiguous+ when list starts with "i.", "c." etc.+ + Allow `<quote>` and other tags to be indented.+ + Allow single colon in definition list term.+ + Fix parsing of verse in lists.+ + Improved parsing efficiency. Avoid `parseFromString`.+ Lists are parsed in linear instead of exponential time now.+ + Replace ParserState with MuseState.+ + Prioritize lists with roman numerals over alphabetical lists.+ This is to make sure "i." starts a roman numbered list,+ instead of a list with letter "i" (followed by "j", "k", ...").+ + Fix directive parsing.+ + Parse definition lists with multiple descriptions.+ + Parse next list item before parsing more item contents.+ + Fixed a bug: headers did not terminate lists.+ + Move indentation parsing from `definitionListItem` to `definitionList`.+ + Paragraph indentation does not indicate nested quote.+ Muse allows indentation to indicate quotation or alignment,+ but only on the top level, not within a <quote> or list.+ + Require that block tags are on separate lines.+ Text::Amuse already explicitly requires it anyway.+ + Fix matching of closing inline tags.+ + Various internal changes.+ + Fix parsing of nested definition lists.+ + Require only one space for nested definition list indentation.+ + Do not remove trailing whitespace from `<code>`.+ + Fix parsing of trailing whitespace. Newline after whitespace now+ results in softbreak instead of space.++ * Docx reader (Jesse Rosenthal, except where noted):++ + Handle nested sdt tags (#4415).+ + Don't look up dependant run styles if `+styles` is enabled.+ + Move pandoc inline styling inside custom-style span.+ + Read custom styles (#1843). This will read all paragraph and+ character classes as divs and spans, respectively. Dependent styles+ will still be resolved, but will be wrapped with appropriate style+ tags. It is controlled by the `+styles` extension (`-f docx+styles`).+ This can be used in conjunction with the `custom-style` feature in the+ docx writer for a pandoc-docx editing workflow. Users can convert from+ an input docx, reading the custom-styles, and then use that same input+ docx file as a reference-doc for producing an output docx file. Styles+ will be maintained across the conversion, even if pandoc doesn't+ understand them.+ + Small change to Fields hyperlink parser. Previously, unquoted string+ required a space at the end of the line (and consumed it). Now we+ either take a space (and don't consume it), or end of input.+ + Pick table width from the longest row or header (Francesco Occhipinti,+ #4360).++ * Muse writer (Alexander Krotov):++ + Change verse markup: `> ` instead of `<verse>` tag.+ + Remove empty strings during inline normalization.+ + Don't indent nested definition lists.+ + Use unicode quotes for quoted text.+ + Write image width specified in percent in Text::Amuse mode.+ + Don't wrap displayMath into `<verse>`.+ + Escape nonbreaking space (`~~`).+ + Join code with different attributes during normalization.+ + Indent lists inside Div.+ + Support definitions with multiple descriptions.++ * Powerpoint writer (Jesse Rosenthal):++ + Use table styles This will use the default table style in the+ reference-doc file. As a result they will be easier when using+ in a template, and match the color scheme.+ + Remove empty slides. Because of the way that slides were split, these+ could be accidentally produced by comments after images. When animations+ are added, there will be a way to add an empty slide with either+ incremental lists or pauses.+ + Implement syntax highlighting. Note that background colors can't+ be implemented in PowerPoint, so highlighting styles that require+ these will be incomplete.+ + New test framework for pptx. We now compare the output of the+ Powerpoint writer with files that we know to (a) not be corrupt,+ and (b) to show the desired output behavior (details below).+ + Add `notesMaster` to `presentation.xml` if necessary.+ + Ignore links and (end)notes in speaker notes.+ + Output speaker notes.+ + Read speaker note templates conditionally. If there are speaker+ notes in the presentation, we read in the notesMasters templates+ from the reference pptx file.+ + Fix deletion track changes (#4303, Jesse Rosenthal).++ * Markdown writer: properly escape @ to avoid capture as citation+ (#4366).++ * LaTeX writer:++ + Put hypertarget inside figure environment (#4388).+ This works around a problem with the endfloat package and+ makes pandoc's output compatible with it.+ + Fix image height with percentage (#4389). This previously caused+ the image to be resized to a percentage of textwidth, rather than+ textheight.++ * ConTeXt writer (Henri Menke):++ + New section syntax and support `--section-divs` (#2609).+ `\section[my-header]{My Header}` ->+ `\section[title={My Header},reference={my-header}]`.+ The ConTeXt writer now supports the `--section-divs` option to+ write sections in the fenced style, with `\startsection` and+ `\stopsection`.+ + xtables: correct wrong usage of caption (Henri Menke).++ * Docx writer:++ + Fix image resizing with multiple images (#3930, Andrew Pritchard).+ + Use new golden framework (Jesse Rosenthal).+ + Make more deterministic to facilitate testing (Jesse Rosenthal).+ - `getUniqueId` now calls to the state to get an incremented digit,+ instead of calling to P.uniqueHash.+ - we always start the PRNG in mkNumbering/mkAbstractNum with the same+ seed (1848), so our randoms should be the same each time.+ + Fix ids in comment writing (Jesse Rosenthal). Comments from+ `--track-changes=all` were producing corrupt docx, because the+ writer was trying to get id from the `(ID,_,_)` field of+ the attributes, and ignoring the "id" entry in the key-value pairs. We+ now check both.++ * Ms writer: Added papersize variable.++ * TEI writer:++ + Use `height` instead of `depth` for images (#4331).+ + Ensure that id prefix is always used.+ + Don't emit `role` attribute; that was a leftover from the+ Docbook writer.+ + Use 'xml:id', not 'id' attribute (#4371).++ * AsciiDoc writer:++ + Do not output implicit heading IDs (#4363, Alexander+ Krotov). Convert to `asciidoc-auto_identifiers` for old behaviour.++ * RST writer:++ + Remove `blockToRST'` moving its logic into `fixBlocks`+ (Francesco Occhipinti).+ + Insert comment between lists and quotes (#4248, Francesco Occchipinti).++ * RST template: remove definition of 'math' role as raw.+ This used to be needed prior to v 0.8 of docutils, but+ now math support is built-in.++ * Slides: Use divs to set incremental/non-incremental (#4381,+ Jesse Rosenthal). The old method (list inside blockquote) still+ works, but we are encouraging the use of divs with class+ `incremental` or `nonincremental`.++ * Text.Pandoc.ImageSize:++ + Make image size detection for PDFs more robust (#4322).+ + Determine image size for PDFs (#4322).+ + EMF Image size support (#4375, Andrew Pritchard).++ * Text.Pandoc.Extensions:++ + Add `Ext_styles` (Jesse Rosenthal, API change). This will be used in+ the docx reader (defaulting to off) to read pargraph and character+ styles not understood by pandoc (as divs and spans, respectively).+ + Made `Ext_raw_html` default for `commonmark` format.++ * Text.Pandoc.Parsing:++ + Export `manyUntil` (Alexander Krotov, API change).+ + Export improved `sepBy1` (Alexander Krotov).+ + Export list marker parsers: `upperRoman`, `lowerRoman`,+ `decimal`, `lowerAlpha`, `upperAlpha` (Alexander Krotov, API change).++ * Tests/Lua: fix tests on windows (Albert Krewinkel).++ * Lua: register script name in global variable (#4393). The name of the Lua+ script which is executed is made available in the global Lua variable+ `PANDOC_SCRIPT_FILE`, both for Lua filters and custom writers.++ * Tests: Abstract powerpoint tests out to OOXML tests (Jesse Rosenthal).+ There is very little pptx-specific in these tests, so we abstract out+ the basic testing function so it can be used for docx as well. This+ should allow us to catch some errors in the docx writer that slipped+ by the roundtrip testing.++ * Lua filters: store constructors in registry (Albert Krewinkel). Lua+ functions used to construct AST element values are stored in the Lua+ registry for quicker access. Getting a value from the registry is much+ faster than getting a global value (partly to idiosyncrasies of hslua);+ this change results in a considerable performance boost.++ * Documentation:++ + `doc/org.md` Add draft of Org-mode documentation (Albert Krewinkel).+ + `doc/lua-filters.md`: document global vars set for filters+ (Albert Krewinkel).+ + INSTALL.md: mention Stack version. (#4343, Adam Brandizzi).+ + MANUAL: add documentation on custom styles (Jesse Rosenthal).+ + MANUAL.txt: Document incremental and nonincremental divs (Jesse+ Rosenthal). Blockquoted lists are still described, but fenced divs are+ presented in preference.+ + MANUAL.txt: document header and footer variables (newmana).+ + MANUAL.txt: self-contained implies standalone (#4304, Daniel Lublin).+ + CONTRIBUTING.md: label was renamed. (#4310, Alexander Brandizzi).++ * Require tagsoup 0.14.3 (#4282), fixing HTML tokenization bug.++ * Use latest texmath.++ * Use latest pandoc-citeproc.++ * Allow exceptions 0.9.++ * Require aeson-pretty 0.8.5 (#4394).++ * Bump blaze-markup, blaze-html lower bounds to 0.8, 0.9 (#4334).++ * Update tagsoup to 0.14.6 (Alexander Krotov, #4282).++ * Removed ghc-prof-options. As of cabal 1.24, sensible defaults are used.++ * Update default.nix to current nixpkgs-unstable for hslua-0.9.5 (#4348,+ jarlg).++## pandoc 2.1.1 (2018-01-18)++ * Markdown reader:++ + Don't coalesce adjacent raw LaTeX blocks if they are separated by a+ blank line. See lierdakil/pandoc-crossref#160.+ + Improved `inlinesInBalancedBrackets` (#4272, jgm/pandoc-citeproc#315).+ The change both improves performance and fixes a regression whereby+ normal citations inside inline notes and figure captions were not+ parsed correctly.++ * RST reader:++ + Better handling for headers with an anchor (#4240). Instead of creating a+ Div containing the header, we put the id directly on the header.+ This way header promotion will work properly.+ + Add aligned environment when needed in math (#4254). `rst2latex.py`+ uses an `align*` environment for math in `.. math::` blocks, so this+ math may contain line breaks. If it does, we put the math in an+ `aligned` environment to simulate `rst2latex.py`'s behavior.++ * HTML reader:++ + Fix col width parsing for percentages < 10% (#4262, n3fariox).++ * LaTeX reader:++ + Advance source position at end of stream.+ + Pass through macro defs in `rawLaTeXBlock` even if the `latex_macros`+ extension is set (#4246). This reverts to earlier behavior and is+ probably safer on the whole, since some macros only modify things in+ included packages, which pandoc's macro expansion can't modify.+ + Fixed pos calculation in tokenizing escaped space.+ + Allow macro definitions inside macros (#4253). Previously we went into+ an infinite loop with+ ```+ \newcommand{\noop}[1]{#1}+ \noop{\newcommand{\foo}[1]{#1}}+ \foo{hi}+ ```+ + Fix inconsistent column widths (#4238). This fixes a bug whereby column+ widths for the body were different from widths for the header in some+ tables.++ * Docx reader (Jesse Rosenthal):++ + Parse hyperlinks in `instrText` tags (#3389, #4266). This was a form of+ hyperlink found in older versions of word. The changes introduced for+ this, though, create a framework for parsing further fields in MS Word+ (see the spec, ECMA-376-1:2016, §17.16.5, for more on these fields).+ We introduce a new module, `Text.Pandoc.Readers.Docx.Fields` which+ contains a simple parsec parser. At the moment, only simple hyperlink+ fields are accepted, but that can be extended in the future.++ * Muse reader (Alexander Krotov):++ + Parse `~~` as non-breaking space in Text::Amuse mode.+ + Refactor list parsing.++ * Powerpoint writer (Jesse Rosenthal):++ + Change reference to `notesSlide` to `endNotesSlide`.+ + Move image sizing into `picProps`.+ + Improve table placement.+ + Make our own `_rels/.rels` file.+ + Import reference-doc images properly.+ + Move `Presentation.hs` out of `PandocMonad`.+ + Refactor into separate modules. T.P.W.Powerpoint.Presentation+ defines the Presentation datatype and goes Pandoc->Presentation;+ T.P.W.Pandoc.Output goes Presentation->Archive.+ Text.Pandoc.Writers.Powerpoint a thin wrapper around the two modules.+ + Avoid overlapping blocks in column output.+ + Position images correctly in two-column layout.+ + Make content shape retrieval environment-aware.+ + Improve image handling. We now determine image and caption placement+ by getting the dimensions of the content box in a given layout.+ This allows for images to be correctly sized and positioned in a+ different template. Note that images without captions and headers are+ no longer full-screened. We can't do this dependably in different+ layouts, because we don't know where the header is (it could be to+ the side of the content, for example).+ + Read presentation size from reference file. Our presentation size is+ now dependent on the reference/template file we use.+ + Handle (sub)headers above slidelevel correctly. Above the slidelevel,+ subheaders will be printed in bold and given a bit of extra space+ before them. Note that at the moment, no distinction is made between+ levels of headers above the slide header, though that can be changed.+ + Check for required files. Since we now import from reference/dist+ file by glob, we need to make sure that we're getting the files we+ need to make a non-corrupt Powerpoint. This performs that check.+ + Improve templating using `--reference-doc`. Templating should work+ much more reliably now.+ + Include Notes slide in TOC.+ + Set notes slide header to slide-level.+ + Add table of contents. This is triggered by the `--toc` flag. Note+ that in a long slide deck this risks overrunning the text box. The user+ can address this by setting `--toc-depth=1`.+ + Set notes slide number correctly.+ + Clean up adding metadata slide. We want to count the slide numbers+ correctly if it's in there.+ + Add anchor links. For anchor-type links (`[foo](#bar)`) we produce+ an anchor link. In powerpoint these are links to slides, so we keep+ track of a map relating anchors to the slides they occur on.+ + Make the slide number available to the blocks. For anchors,+ block-processing functions need to know what slide number+ they're in. We make the `envCurSlideId` available to blocks.+ + Move `curSlideId` to environment.+ + Allow setting `toc-title` in metadata.+ + Link notes to endnotes slide.++ * Markdown writer:++ + Fix cell width calculation (#4265). Previously we could get+ ever-lengthening cell widths when a table was run repeatedly through+ `pandoc -f markdown -t markdown`.++ * LaTeX writer:++ + Escape `&` in lstinline (Robert Schütz).++ * ConTeXt writer:++ + Use xtables instead of Tables (#4223, Henri Menke).+ Default to xtables for context output. Natural Tables are used+ if the new `ntb` extension is set.++ * HTML writer:++ + Fixed footnote backlinks with `--id-prefix` (#4235).++ * `Text.Pandoc.Extensions`: Added `Ext_ntb` constructor (API change,+ Henri Menke).++ * `Text.Pandoc.ImageSize`: add derived `Eq` instance to `Dimension`+ (Jesse Rosenthal, API change).++ * Lua filters (Albert Krewinkel):++ + Make `PANDOC_READER_OPTIONS` available.+ The options which were used to read the document are made available to+ Lua filters via the `PANDOC_READER_OPTIONS` global.+ + Add lua module `pandoc.utils.run_json_filter`, which runs a JSON filter+ on a Pandoc document.+ + Refactor filter-handling code into `Text.Pandoc.Filter.JSON`,+ `Text.Pandoc.Filter.Lua`, and `Text.Pandoc.Filter.Path`.+ + Improve error messages. Provide more context about the task+ which caused an error.++ * data/pandoc.lua (Albert Krewinkel):++ + Accept singleton inline as a list. Every constructor which accepts a+ list of inlines now also accepts a single inline element for+ convenience.+ + Accept single block as singleton list. Every constructor which accepts+ a list of blocks now also accepts a single block element for+ convenience. Furthermore, strings are accepted as shorthand for+ `{pandoc.Str "text"}` in constructors.+ + Add attr, listAttributes accessors. Elements with+ attributes got an additional `attr` accessor. Attributes were+ accessible only via the `identifier`, `classes`, and `attributes`,+ which was in conflict with the documentation, which indirectly states+ that such elements have the an `attr` property.+ + Drop `_VERSION`. Having a `_VERSION` became superfluous, as this+ module is closely tied to the pandoc version, which is available via+ `PANDOC_VERSION`.+ + Fix access to Attr components. Accessing an Attr value (e.g.,+ ` Attr().classes`) was broken; the more common case of accessing it via+ an Inline or Block element was unaffected by this.++ * Move `metaValueToInlines` to from Docx writer to+ `Text.Pandoc.Writers.Shared`, so it can be used by other writers+ (Jesse Rosenthal).++ * MANUAL.txt:++ + Clarify otherlangs in LaTeX (#4072).+ + Clarify `latex_macros` extension.+ + Recommend use of `raw_attribute` extension in header includes (#4253).++ * Allow latest QuickCheck, tasty, criterion.++ * Remove custom prelude and ghc 7.8 support.++ * Reduce compiler noise (exact paths for compiled modules).++## pandoc 2.1 (2018-01-07)++ * Allow filters and lua filters to be interspersed (#4196). Previously+ we ran all lua filters before JSON filters. Now we run filters in+ the order they are presented on the command line, whether lua or JSON.+ There are two incompatible API changes: The type of `applyFilters`+ has changed, and `applyLuaFilters` has been removed. `Filter` is+ also now exported.++ * Use latest skylighting and omit the `missingIncludes` check, fixing+ a major performance regression in earlier releases of the 2.x series+ (#4226). Behavior change: If you use a custom syntax definition that+ refers to a syntax you haven't loaded, pandoc will now complain when+ it is highlighting the text, rather than doing a check at the start.+ This change dramatically speeds up invocations of pandoc on short+ inputs.++ * Text.Pandoc.Class: make `FileTree` opaque (don't export+ `FileTree` constructor). This forces users to interact with it using+ `insertInFileTree` and `getFileInfo`, which normalize file names.++ * Markdown reader:++ + Rewrite `inlinesInBalancedBrackets`. The rewrite is much more+ direct, avoiding `parseFromString`. And it performs significantly+ better; unfortunately, parsing time still increases exponentially+ (see #1735).+ + Avoid parsing raw tex unless `\` + letter seen. This seems to+ help with the performance problem, #4216.++ * LaTeX reader: Simplified a check for raw tex command.++ * Muse reader (Alexander Krotov):++ + Enable round trip test (#4107).+ + Automatically translate `#cover` into `#cover-image`.+ Amusewiki uses #cover directive to specify cover image.++ * Docx reader (Jesse Rosenthal):++ + Allow for insertion/deletion of paragraphs (#3927).+ If the paragraph has a deleted or inserted paragraph break (depending+ on the track-changes setting) we hold onto it until the next+ paragraph. This takes care of accept and reject. For this we introduce+ a new state which holds the ils from the previous para if necessary.+ For `--track-changes=all`, we add an empty span with class+ `paragraph-insertion`/`paragraph-deletion` at the end of the paragraph+ prior to the break to be inserted or deleted.+ + Remove unused anchors (#3679). Docx produces a lot of anchors with+ nothing pointing to them---we now remove these to produce cleaner+ output. Note that this has to occur at the end of the process+ because it has to follow link/anchor rewriting.+ + Read multiple children of `w:sdtContents`.+ + Combine adjacent anchors. There isn't any reason to have numerous+ anchors in the same place, since we can't maintain docx's+ non-nesting overlapping. So we reduce to a single anchor.+ + Improved tests.++ * Muse writer (Alexander Krotov): don't escape URIs from AST++ * Docx writer:++ + Removed redundant subtitle in title (Sebastian Talmon).+ + `firstRow` table definition compatibility for Word 2016 (Sebastian+ Talmon). Word 2016 seems to use a default value of "1" for table+ headers, if there is no firstRow definition (although a default+ value of 0 is documented), so all tables get the first Row formatted+ as header. Setting the parameter to 0 if the table has no header+ row fixes this for Word 2016+ + Fix custom styles with spaces in the name (#3290).++ * Powerpoint writer (Jesse Rosenthal):++ + Ignore Notes div for parity with other slide outputs.+ + Set default slidelevel correctly. We had previously defaulted to+ slideLevel 2. Now we use the correct behavior of defaulting to the+ highest level header followed by content. We change an expected test+ result to match this behavior.+ + Split blocks correctly for linked images.+ + Combine adjacent runs.+ + Make inline code inherit code size. Previously (a) the code size+ wasn't set when we force size, and (b) the properties was set from+ the default, instead of inheriting.+ + Simplify `replaceNamedChildren` function.+ + Allow linked images. The following markdown:+ `[](http://www.example.com)`+ will now produce a linked image in the resulting PowerPoint file.+ + Fix error with empty table cell. We require an empty `<a:p>` tag,+ even if the cell contains no paragraphs---otherwise PowerPoint+ complains of corruption.+ + Implement two-column slides. This uses the columns/column div+ format described in the pandoc manual. At the moment, only two+ columns (half the screen each) are allowed. Custom widths are not+ supported.+ + Added more tests.++ * OpenDocument/ODT writers: improved rendering of formulas (#4170, oltolm).++ * Lua filters (Albert Krewinkel):++ + `data/pandoc.lua`: drop 'pandoc-api-version' from Pandoc objects+ + The current pandoc-types version is made available to Lua programs in+ the global `PANDOC_API_VERSION`. It contains the version as a list of+ numbers.+ + The pandoc version available as a global `PANDOC_VERSION` (a list+ of numbers).+ + `data/pandoc.lua`: make `Attr` an `AstElement`.+ + `data/pandoc.lua`: make all types subtypes of `AstElement`.+ `Pandoc`, `Meta`, and `Citation` were just plain functions and did+ not set a metatable on the returned value, which made it difficult+ to amend objects of these types with new behavior. They are now+ subtypes of AstElement, meaning that all their objects can gain+ new features when a method is added to the behavior object+ (e.g., `pandoc.Pandoc.behavior`).+ + `data/pandoc.lua`: split type and behavior tables. Clearly distinguish+ between a type and the behavioral properties of an instance of that+ type. The behavior of a type (and all its subtypes) can now be+ amended by adding methods to that types `behavior` object, without+ exposing the type objects internals. E.g.:+ ```lua+ pandoc.Inline.behavior.frob = function () print'42' end+ local str = pandoc.Str'hello'+ str.frob() -- outputs '42'+ ```+ + `data/pandoc.lua`: fix Element inheritance. Extending all elements+ of a given type (e.g., all inline elements) was difficult, as the+ table used to lookup unknown methods would be reset every time a+ new element of that type was created, preventing recursive property+ lookup. This is was changed in that all methods and attributes of+ supertypes are now available to their subtypes.+ + `data/pandoc.lua`: fix attribute names of Citation (#4222). The+ fields were named like the Haskell fields, not like the documented,+ shorter version. The names are changed to match the documentation+ and Citations are given a shared metatable to enable simple+ extensibility.+ + `data/pandoc.lua`: drop function `pandoc.global_filter`.+ + Bump `hslua` version to 0.9.5. This version fixes a bug that made it+ difficult to handle failures while getting lists or a Map from Lua.+ A bug in pandoc, which made it necessary to always pass a tag when+ using MetaList or MetaBlock, is fixed as a result. Using the pandoc+ module's constructor functions for these values is now optional+ (if still recommended).+ + Stop exporting `pushPandocModule` (API change). The introduction+ of `runPandocLua` renders direct use of this function obsolete.+ + Update generation of module docs for lua filters.+ + `Lua.Module.Utils`: make stringify work on `MetaValues` (John+ MacFarlane). I'm sure this was intended in the first place,+ but currently only `Meta` is supported.++ * Improve benchmarks.++ + Set the default extensions properly.+ + Improve benchmark argument parsing. You can now say+ `make bench BENCHARGS="markdown latex reader"` and both the+ markdown and latex readers will be benchmarked.++ * MANUAL.txt simplify and add more structure (Mauro Bieg).++ * Generate README.md from template and MANUAL.txt.+ `make README.md` will generate the README.md after changes+ to MANUAL.txt have been made.++ * Update copyright notices to include 2018 (Albert Krewinkel).++## pandoc 2.0.6 (2017-12-28)++ * Added `jats` as an input format.++ + Add Text.Pandoc.Readers.JATS, exporting `readJATS` (API+ change) (Hamish Mackenzie).+ + Improved citation handling in JATS reader. JATS citations+ are now converted to pandoc citations, and JATS ref-lists+ are converted into a `references` field in metadata, suitable+ for use with pandoc-citeproc. Thus a JATS article with embedded+ bibliographic information can be processed with pandoc and+ pandoc-citeproc to produce a formatted bibliography.++ * Allow `--list-extensions` to take an optional FORMAT argument.+ This lists the extensions set by default for the selected FORMAT.+ The extensions are now alphabetized, and the `+` or `-`+ indicating the default setting comes before, rather than after,+ the extension.++ * Markdown reader:++ + Preserve original whitespace between blocks.+ + Recognize `\placeformula` as context.+ + Be pickier about table captions. A caption starts with a `:` which+ can't be followed by punctuation. Otherwise we can falsely interpret+ the start of a fenced div, or even a table header line like+ `:--:|:--:`, as a caption.+ + Always use four space rule for example lists. It would be awkward+ to indent example list contents to the first non-space character after+ the label, since example list labels are often long. Thanks to+ Bernhard Fisseni for the suggestion.+ + Improve raw tex parsing. Note that the Markdown reader is also+ affected by the `latex_macros` extension changes described below+ under the LaTeX reader.++ * LaTeX reader:++ + `latex_macros` extension changes (#4179). Don't pass through macro+ definitions themselves when `latex_macros` is set. The macros+ have already been applied. If `latex_macros` is enabled, then+ `rawLaTeXBlock` in Text.Pandoc.Readers.LaTeX will succeed in parsing+ a macro definition, and will update pandoc's internal macro map+ accordingly, but the empty string will be returned.+ + Export `tokenize`, `untokenize` (API change).+ + Use `applyMacros` in `rawLaTeXBlock`, `rawLaTeXInline`.+ + Refactored `inlineCommand`.+ + Fix bug in tokenizer. Material following `^^` was+ dropped if it wasn't a character escape. This only affected+ invalid LaTeX, so we didn't see it in the wild, but it appeared+ in a QuickCheck test failure.+ + Fix regression in LateX tokenization (#4159). This mainly affects the+ Markdown reader when parsing raw LaTeX with escaped spaces.+ + Add tests of LaTeX tokenizer.+ + Support `\foreignlanguage` from babel.+ + Be more tolerant of `&` character (#4208). This allows us to parse+ unknown tabular environments as raw LaTeX.++ * Muse reader (Alexander Krotov):++ + Parse anchors immediately after headings as IDs.+ + Require that note references does not start with 0.+ + Parse empty comments correctly.++ * Org reader (Albert Krewinkel):++ + Fix asterisks-related parsing error (#4180).+ + Support minlevel option for includes (#4154). The level of headers+ in included files can be shifted to a higher level by specifying a+ minimum header level via the `:minlevel` parameter. E.g.+ `#+include: "tour.org" :minlevel 1` will shift the headers in+ tour.org such that the topmost headers become level 1 headers.+ + Break-up org reader test file into multiple modules.++ * OPML reader:++ + Enable raw HTML and other extensions by default for notes+ (#4164). This fixes a regression in 2.0. Note that extensions can+ now be individually disabled, e.g. `-f opml-smart-raw_html`.++ * RST reader:++ + Allow empty list items (#4193).+ + More accurate parsing of references (#4156). Previously we erroneously+ included the enclosing backticks in a reference ID (#4156). This+ change also disables interpretation of syntax inside references, as+ in docutils. So, there is no emphasis in `` `my *link*`_ ``.++ * Docx reader:++ + Continue lists after interruption (#4025, Jesse Rosenthal).+ Docx expects that lists will continue where they left off after an+ interruption and introduces a new id if a list is starting again. So+ we keep track of the state of lists and use them to define a "start"+ attribute, if necessary.+ + Add tests for structured document tags unwrapping (Jesse Rosenthal).+ + Preprocess Document body to unwrap `w:sdt` elements (Jesse Rosenthal,+ #4190).++ * Plain writer:++ + Don't linkify table of contents.++ * RST writer:++ + Fix anchors for headers (#4188). We were missing an `_`.++ * PowerPoint writer (Jesse Rosenthal):++ + Treat lists inside BlockQuotes as lists. We don't yet produce+ incremental lists in PowerPoint, but we should at least treat lists+ inside BlockQuotes as lists, for compatibility with other slide formats.+ + Add ability to force size. This replaces the more specific+ `blockQuote runProp`, which only affected the size of blockquotes. We+ can use this for notes, etc.+ + Implement notes. This currently prints all notes on a final slide.+ Note that at the moment, there is a danger of text overflowing the+ note slide, since there is no logic for adding further slides.+ + Implement basic definition list functionality to PowerPoint writer.+ + Don't look for default template file for Powerpoint (#4181).+ + Add pptx to isTextFormat list. This is used to check standalone+ and not writing to the terminal.+ + Obey slide level option (Jesse Rosenthal).+ + Introduce tests.++ * Docx writer:++ + Ensure that `distArchive` is the one that comes with pandoc+ (#4182). Previously a `reference.docx` in `~/.pandoc` (or the user data+ dir) would be used instead, and this could cause problems because a+ user-modified docx sometimes lacks vital sections that we count+ on the `distArchive` to supply.++ * Org writer:++ + Do not wrap "-" to avoid accidental bullet lists (Alexander Krotov).+ + Don't allow fn refs to wrap to beginning of line (#4171, with help from+ Alexander Krotov). Otherwise they can be interpreted as footnote+ definitions.++ * Muse writer (Alexander Krotov):++ + Don't wrap note references to the next line (#4172).++ * HTML writer:++ + Use br elements in line blocks instead of relying on CSS+ (#4162). HTML-based templates have had the custom CSS for+ `div.line-block` removed. Those maintaining custom templates will want+ to remove this too. We still enclose line blocks in a div with class+ `line-block`.++ * LaTeX writer:++ + Use `\renewcommand` for `\textlatin` with babel (#4161).+ This avoids a clash with a deprecated `\textlatin` command defined+ in Babel.+ + Allow fragile=singleslide attribute in beamer slides (#4169).+ + Use `\endhead` after `\toprule` in headerless tables (#4207).++ * FB2 writer:++ + Add cover image specified by `cover-image` meta (Alexander Krotov,+ #4195).++ * JATS writer (Hamish Mackenzie):++ + Support writing `<fig>` and `<table-wrap>` elements+ with `<title>` and `<caption>` inside them by using Divs with class set+ to one of `fig`, `table-wrap` or `caption` (Hamish Mackenzie). The+ title is included as a Heading so the constraint on where Heading can+ occur is also relaxed.+ + Leave out empty alt attributes on links.+ + Deduplicate image mime type code.+ + Make `<p>` optional in `<td>` and `<th>` (#4178).+ + Self closing tags for empty xref (#4187).+ + Improve support for code language.++ * Custom writer:++ + Use init file to setup Lua interpreter (Albert Krewinkel).+ The same init file (`data/init`) that is used to setup the Lua+ interpreter for Lua filters is also used to setup the interpreter of+ custom writers.lua.+ + Define instances for newtype wrapper (Albert Krewinkel). The custom+ writer used its own `ToLuaStack` instance definitions, which made+ it difficult to share code with Lua filters, as this could result+ in conflicting instances. A `Stringify` wrapper is introduced to+ avoid this problem.+ + Added tests for custom writer.+ + Fixed definition lists and tables in `data/sample.lua`.++ * Fixed regression: when target is PDF, writer extensions were being+ ignored. So, for example, `pandoc -t latex-smart -o file.pdf`+ did not work properly.++ * Lua modules (Albert Krewinkel):++ + Add `pandoc.utils` module, to hold utility functions.+ + Create a Haskell module Text.Pandoc.Lua.Module.Pandoc to+ define the `pandoc` lua module.+ + Make a Haskell module for each Lua module. Move definitions for the+ `pandoc.mediabag` modules to a separate Haskell module.+ + Move `sha1` from the main `pandoc` module to `pandoc.utils`.+ + Add function `pandoc.utils.hierarchicalize` (convert list of+ Pandoc blocks into (hierarchical) list of Elements).+ + Add function `pandoc.utils.normalize_date` (parses a date and+ converts it (if possible) to "YYYY-MM-DD" format).+ + Add function `pandoc.utils.to_roman_numeral` (allows conversion+ of numbers below 4000 into roman numerals).+ + Add function `pandoc.utils.stringify` (converts any AST element+ to a string with formatting removed).+ + `data/init.lua`: load `pandoc.utils` by default+ + Turn pipe, read into full Haskell functions. The `pipe` and `read`+ utility functions are converted from hybrid lua/haskell functions+ into full Haskell functions. This avoids the need for intermediate+ `_pipe`/`_read` helper functions, which have dropped.+ + pandoc.lua: re-add missing MetaMap function. This was a bug+ introduced in version 2.0.4.++ * Text.Pandoc.Class: Add `insertInFileTree` [API change]. This gives+ a pure way to insert an ersatz file into a `FileTree`. In addition, we+ normalize paths both on insertion and on lookup.++ * Text.Pandoc.Shared: export `blocksToInlines'` (API change, Maura Bieg).++ * Text.Pandoc.MIME: Add opus to MIME type table as audio/ogg (#4198).++ * Text.Pandoc.Extensions: Alphabetical order constructors for+ `Extension`. This makes them appear in order in `--list-extensions`.++ * Allow lenient decoding of latex error logs, which are not always+ properly UTF8-encoded (#4200).++ * Update latex template to work with recent versions of beamer.+ The old template produced numbered sections with some recent+ versions of beamer. Thanks to Thomas Hodgson.++ * Updated reference.docx (#4175). Instead of just "Hello, world", the+ document now contains exemplars of most of the styles that have an+ effect on pandoc documents. This makes it easier to see the effect+ of style changes.++ * Removed `default.theme` data file (#4096). It is no longer needed now+ that we have `--print-highlight-style`.++ * Added `stack.lts9.yaml` for building with lts 9 and ghc 8.0.2.+ We still need this for the alpine static linux build, since+ we don't have ghc 8.2.2 for that yet.++ * Removed `stack.pkg.yaml`. We only really need `stack.yaml`; we+ can put flag settings for pandoc-citeproc there.++ * Makefile: Add 'trypandoc' and 'pandoc-templates' targets to+ make releases easier.++ * MANUAL.txt:++ + Add note on what formats have `+smart` by default.+ + Use native syntax for custom-style (#4174, Mauro Bieg).+ + Introduce dedicated Extensions section, since some extensions+ affect formats other than markdown (Mauro Bieg, #4204).+ + Clarify default html output for `--section-divs` (Richard Edwards).++ * filters.md: say that Text.Pandoc.JSON comes form pandoc-types.+ Closes jgm/pandoc-website#16.++ * epub.md: Delete removed `-S` option from command (#4151, Georger Araújo).++## pandoc 2.0.5 (2017-12-12)++ * Fix a bug in 2.0.4, whereby pandoc could not read the theme files+ generated with `--print-highlight-style` (#4133). Improve JSON+ serialization of styles.++ * Fix CSS issues involving line numbers (#4128).+ Highlighted code blocks are now enclosed in a div with class `sourceCode`.+ Highlighting CSS no longer sets a generic color for pre and code; we only+ set these for class `sourceCode`.++ * `--pdf-engine-opt`: fix bug where option order was reversed (#4137).++ * Add PowerPoint (pptx) writer (Jesse Rosenthal).+ It works following the standard Pandoc conventions for making other+ sorts of slides. Caveats:++ + Syntax highlighting is not yet implemented. (This is difficult+ because there are no character classes in Powerpoint.)+ + Footnotes and Definition lists are not yet implemented. (Notes will+ usually take the form of a final slide.+ + Image placement and auto-resizing has a few glitches.+ + Reference powerpoint files don't work dependably from the command+ line. This will be implemented, but at the moment users are advised+ to change themes from within Powerpoint.++ * Create shared Text.Pandoc.Writers.OOXML module (Jesse Rosenthal).+ This is for functions used by both Powerpoint and Docx writers.++ * Add default pptx data for Powerpoint writer (Jesse Rosenthal).++ * Add `empty_paragraphs` extension.++ + Deprecate `--strip-empty-paragraphs` option. Instead we now+ use an `empty_paragraphs` extension that can be enabled on+ the reader or writer. By default, disabled.+ + Add `Ext_empty_paragraphs` constructor to `Extension`.+ + Revert "Docx reader: don't strip out empty paragraphs."+ This reverts commit d6c58eb836f033a48955796de4d9ffb3b30e297b.+ + Implement `empty_paragraphs` extension in docx reader and writer,+ opendocument writer, html reader and writer.+ + Add tests for `empty_paragraphs` extension.++ * Markdown reader:++ + Don't parse native div as table caption (#4119).+ + Improved computation of column widths in pipe tables.+ Pipe tables with lines longer than the text width (as set+ by `--columns`) are now scaled to text width, with the relative+ widths of columns determined by the ratios between the+ header lines. Previously we computed column widths using+ the ratio of header line lengths to column width, so that+ tables with narrow header lines were extremely thin, which+ was very rarely the desired result.++ * LaTeX reader: fix `\` before newline (#4134). This should be a space,+ as long as it's not followed by a blank line. This has been fixed at the+ tokenizer level.++ * Muse reader (Alexander Krotov):++ + Add test for `#disable-tables` directive in Emacs mode.+ + Don't allow emphasis to be preceded by letter.+ + Add underline support in Emacs Muse mode..+ + Support multiline directives in Amusewiki mode++ * Man writer: omit internal links (#4136). That is, just print the link+ text without the URL.++ * Markdown reader: accept processing instructions as raw HTML (#4125).++ * Lua filters (Albert Krewinkel):++ + Use script to initialize the interpreter. The file `init.lua` is+ used to initialize the Lua interpreter which is used in Lua filters.+ This gives users the option to require libraries which they want to+ use in all of their filters, and to extend default modules.+ + Fix package loading for Lua 5.1. The list of package searchers is+ named `package.loaders` in Lua 5.1 and LuaJIT, and `package.searchers`+ in Lua 5.2 and later.+ + Refactor lua module handling. The integration with Lua's package/module+ system is improved: A pandoc-specific package searcher is prepended to+ the searchers in `package.searchers`. The modules `pandoc` and+ `pandoc.mediabag` can now be loaded via `require`.+ + Bump lower bound of hslua. The release hslua 0.9.3 contains a new+ function which makes using Haskell functions as package loaders much+ easier.++ * reveal.js template: add title-slide identifier to title slide (#4120).+ This allows it to be styled more easily.++ * LaTeX template: Added support for `pagestyle` variable (#4135,+ Thomas Hodgson)++ * Add `-threaded` to ghc-options for executable (#4130, fixes a build+ error on linux).+++## pandoc 2.0.4 (2017-12-03)++ * Add `--print-highlight-style` option. This generates a JSON version+ of a highlighting style, which can be saved as a `.theme` file, modified,+ and used with `--highlight-style` (#4106, #4096).++ * Add `--strip-empty-paragraphs` option. This works for any input format.+ It is primarily intended for use with docx and odt documents where+ empty paragraphs have been used for inter-paragraph spaces.++ * Support `--webtex` for `gfm` output.++ * Recognize `.muse` file extension.++ * Support beamer `\alert` in LaTeX reader. Closes #4091.++ * Docx reader: don't strip out empty paragraphs (#2252).+ Users who have a conversion pipeline from docx may want to consider adding+ `--strip-empty-paragraphs` to the command line.++ * Org reader (Albert Krewinkel): Allow empty list items (#4090).++ * Muse reader (Alexander Krotov):++ + Parse markup in definition list terms.+ + Allow definition to end with EOF.+ + Make code blocks round trip.+ + Drop common space prefix from list items.+ + Add partial round trip test.+ + Don't interpret XML entities.+ + Remove `nested`.+ + Parse `~~` as non-breaking space in Emacs mode.+ + Correctly remove indentation from notes. Exactly one space is+ required and considered to be part of the marker.+ + Allow list items to be empty.+ + Add ordered list test.+ + Add more multiline definition tests.+ + Don't allow blockquotes within lists.+ + Fix reading of multiline definitions.+ + Add inline `<literal>` support.+ + Concatenate inlines of the same type++ * Docx writer: allow empty paragraphs (#2252).++ * CommonMark/gfm writer:++ + Use raw html for native divs/spans (#4113). This allows a pandoc+ markdown native div or span to be rendered in gfm using raw html tags.+ + Implement `raw_html` and `raw_tex` extensions. Note that `raw_html`+ is enabled by default for `gfm`, while `raw_tex` is disabled by default.++ * Muse writer (Alexander Krotov):++ + Test that inline math conversion result is normalized.+ Without normalization this test produced+ `<em>a</em><em>b</em><em>c</em>`.+ + Improve inline list normalization and move to writer.+ + Escape hash symbol.+ + Escape `----` to avoid accidental horizontal rules.+ + Escape only `</code>` inside code tag.+ + Additional `<verbatim>` is not needed as `<code>` is verbatim already.++ * LaTeX writer:++ + Allow specifying just width or height for image size.+ Previously both needed to be specified (unless the image was+ being resized to be smaller than its original size).+ If height but not width is specified, we now set width to+ textwidth. If width but not height is specified, we now set+ height to textheight. Since we have `keepaspectratio`, this+ yields the desired result.+ + Escape `~` and `_` in code with `--listings` (#4111).++ * HTML writer: export `tagWithAttributes`. This is a helper allowing+ other writers to create single HTML tags.++ * Let papersizes `a0`, `a1`, `a2`, ... be case-insensitive by+ converting the case as needed in LaTeX and ConTeXt writers.++ * Change `fixDisplayMath` from `Text.Pandoc.Writers.Shared`+ so that it no longer produces empty `Para`'s as an artifact.++ * `Text.Pandoc.Shared.blocksToInlines`: rewrote using builder.+ This gives us automatic normalization, so we don't get+ for example two consecutive Spaces.++ * Include default CSS for 'underline' class in HTML-based templates.++ * revealjs template: add `tex2jax` configuration for the+ math plugin. With the next release of reveal.js, this will+ fix the problem of `$`s outside of math contexts being+ interpreted as math delimiters (#4027).++ * `pandoc.lua` module for use in lua filters (Albert Krewinkel):++ + Add basic lua List module (#4099, #4081). The List module is+ automatically loaded, but not assigned to a global variable. It can be+ included in filters by calling `List = require 'List'`. Lists of blocks,+ lists of inlines, and lists of classes are now given `List` as a metatable,+ making working with them more convenient. E.g., it is now possible to+ concatenate lists of inlines using Lua's concatenation operator `..`+ (requires at least one of the operants to have `List` as a metatable):++ function Emph (emph)+ local s = {pandoc.Space(), pandoc.Str 'emphasized'}+ return pandoc.Span(emph.content .. s)+ end++ The `List` metatable is assigned to the tables which get passed to+ the constructors `MetaBlocks`, `MetaInline`, and `MetaList`. This+ enables the use of the resulting objects as lists.+ + `Lua/StackInstances`: push Pandoc and Meta via constructor.+ Pandoc and Meta elements are now pushed by calling the respective+ constructor functions of the pandoc Lua module. This makes serialization+ consistent with the way blocks and inlines are pushed to lua and allows+ to use List methods with the `blocks` value.+ + Add documentation for pandoc.List in `lua-filters.md`.++ * Use latest tagsoup. This fixes a bug in parsing HTML tags with+ `&` (but not a valid entity) following them (#4094, #4088).++ * Use skylighting 0.4.4.1, fixing the color of unmarked code text+ when `numberLines` is used (#4103).++ * Make `normalizeDate` more forgiving (Mauro Bieg, #4101), not+ requiring a leading 0 on single-digit days.++ * Fix `--help` output for `--highlight-style` to include `FILE` (Mauro+ Bieg, #4095).++ * Clearer deprecation warning for `--latexmathml, --asciimathml, -m`.+ Previously we only mentioned `--latexmathml`, even if `-m` was+ used.++ * Changelog: fix description of lua filters in 2.0 release+ (Albert Krewinkel). Lua filters were initially run *after* conventional+ (JSON) filters. However, this was changed later to make it easier to deal+ with files in the mediabag. The changelog is updated to describe that+ feature of the 2.0 release correctly.++ * Change Generic JSON instances to TemplateHaskell (Jasper Van der Jeugt,+ #4085). This reduces compile time and memory usage significantly.++ * `lua-filters.md`: Added tikz filter example.++ * Create alternative zip file for macOS binaries.++ * Create alternative zip file for Windows binaries.++ * Update INSTALL.md since we now provide zips for binaries.++ * Relax `http-types` dependency (Justus Sagemüller, #4084).++ * Add `epub.md`, `getting-started.md` to docs. These used to live in+ the website repo.++ * Add `packages` target to Makefile.++ * Bump bounds for binary, http-types, tasty-hunit++## pandoc 2.0.3 (2017-11-20)++ * Lua filters: preload text module (Albert Krewinkel, #4077).+ The `text` module is preloaded in lua. The module contains some UTF-8+ aware string functions, implemented in Haskell. The module is loaded on+ request only, e.g.:++ text = require 'text'+ function Str (s)+ s.text = text.upper(s.text)+ return s+ end++ * Allow table-like access to attributes in lua filters (Albert Krewinkel,+ #4071). Attribute lists are represented as associative lists in Lua. Pure+ associative lists are awkward to work with. A metatable is attached to+ attribute lists, allowing to access and use the associative list as if+ the attributes were stored in as normal key-value pair in table.+ Note that this changes the way `pairs` works on attribute lists. Instead+ of producing integer keys and two-element tables, the resulting iterator+ function now returns the key and value of those pairs. Use `ipairs` to+ get the old behavior. Warning: the new iteration mechanism only works if+ pandoc has been compiled with Lua 5.2 or later (current default: 5.3).++ * Text.Pandoc.Parsing.uri: allow `&` and `=` as word characters (#4068).+ This fixes a bug where pandoc would stop parsing a URI with an+ empty attribute: for example, `&a=&b=` wolud stop at `a`.+ (The uri parser tries to guess which punctuation characters+ are part of the URI and which might be punctuation after it.)++ * Introduce `HasSyntaxExtensions` typeclass (Alexander Krotov, #4074).++ + Added new `HasSyntaxExtensions` typeclass for `ReaderOptions` and+ `WriterOptions`.+ + Reimplemented `isEnabled` function from `Options.hs` to accept both+ `ReaderOptions` and `WriterOptions`.+ + Replaced `enabled` from `CommonMark.hs` with new `isEnabled`.++ * Add `amuse` extension (Alexander Krotov) to enable Amuse wiki+ behavior for `muse`. New `Ext_amuse` constructor for+ `Extension`. Note: this is switched on by default; for+ Emacs behavior, use `muse-amuse`.++ * Muse reader (Alexander Krotov):++ + Count only one space as part of list item marker.+ + Produce SoftBreaks on newlines. Now wrapping can be preserved+ with `--wrap=preserve`.+ + Add Text::Amuse footnote extensions. Footnote end is indicated by+ indentation, so footnotes can be placed anywhere in the text,+ not just at the end of it.+ + Accept Emacs Muse definition lists when `-amuse`.+ Emacs Muse does not require indentation.++ * HTML reader:++ + Ensure we don't produce level 0 headers (#4076), even for chapter+ sections in epubs. This causes problems because writers aren't set+ up to expect these.+ + Allow spaces after `\(` and before `\)` with `tex_math_single_backslash`.+ Previously `\( \frac{1}{a} < \frac{1}{b} \)` was not parsed as math in+ `markdown` or `html` `+tex_math_single_backslash`.++ * MANUAL: clarify that math extensions work with HTML.+ Clarify that `tex_math_dollars` and `tex_math_single_backslash`+ will work with HTML as well as Markdown.++ * Creole reader: Fix performance issue for longer lists (Sascha Wilde,+ #4067).++ * RST reader: better support for 'container' directive (#4066).+ Create a div, incorporate name attribute and classes.++ * LaTeX reader:++ + Support column specs like `*{2}{r}` (#4056). This is equivalent to+ `rr`. We now expand it like a macro.+ + Allow optional args for parbox (#4056).+ + Allow optional arguments on `\footnote` (#4062).++ * EPUB writer: Fixed path for cover image (#4069). It was previously+ `media/media/imagename`, and should have been `media/imagename`.++ * Markdown writer: fix bug with doubled footnotes in grid tables+ (#4061).++ * LaTeX template: include natbib/biblatex after polyglossia (#4073).+ Otherwise we seem to get an error; biblatex wants polyglossia+ language to be defined.++ * Added examples to lua filters documentation.+++## pandoc 2.0.2 (2017-11-12)++ * Deprecated ancient HTML math methods: `--latexmathml`, `--gladtex`,+ `--mimetex`, `--jsmath`.++ * Fixed URIs in `data/jats.csl`. They were being rendered twice,+ leading to invalid XML in default JATS output with pandoc-citeproc.++ * `lua-filters.md`: use real-world man page filter as example.++ * Add lua filter functions `walk_inline` and `walk_block`+ in the pandoc module, to apply filters inside particular+ inline and block elements.++ * Refactored some code from `Text.Pandoc.Lua.PandocModule`+ into new internal module `Text.Pandoc.Lua.Filter`.++ * Markdown reader:++ + Allow fenced code blocks to be indented 1-3 spaces (#4011).+ This brings our handling of them into alignment with CommonMark's.+ + Fix YAML metadata with "chomp" (`|-`). Previously if a+ YAML block under `|-` contained a blank line, pandoc would+ not parse it as metadata.++ * Removed `etc.` from abbreviations file. Often `etc.` ends a+ sentence, and we want the period to be treated as a+ sentence-ending period.++ * Fix regression with `--metadata` (#4054). Values specified with+ `--metadata` should replace a metadata value set in the document+ itself, rather than creating a list including a new value.++ * EPUB writer:++ + Fix EPUB OCF structure. #3720 had been improperly implemented.+ + Fix modified paths for raw HTML tags (src, poster, etc.)+ (#4050, #4055). This had not been updated for the new EPUB+ container layout, with a separate text/ subdirectory.+ + Fix image paths with empty `--epub-subdirectory`.++ * Miscellaneous code cleanup (Alexander Krotov).++ * Use pandoc-types 1.17.3, which adds `Walkable` instances+ for `[Block] Block` and `[Inline] Inline`.++ * Remove obsolete `stack.full.yaml` (#4052).++ * Change to using pandoc-citeproc 0.12.1 in binary packages.++ * Consolidate math output method documentation (#4049, Mauro Bieg).++ * `MANUAL.txt`: fix header level of "Extension: emoji" (Albert Krewinkel).++ * Use lua filter to generate man page from `MANUAL.txt`, replacing old+ Haskell filters. This is easier and faster.++ * Improved `INSTALL.md`.++ * Update commands to extract deb archive on Linux (#4043, Salim B).+++## pandoc 2.0.1.1 (2017-11-04)++ * Improved fix to #3989 (parsing of HTML tags containing+ `>` in an attribute or comment). The previous fix (in 2.0.1) only+ worked in certain cases.++ * FB2 writer (Alexander Krotov):++ + Add `unrecognised` genre to `<title-info>`+ (Alexander Krotov). XML schema requires at least one genre.+ + Remove `<annotation>` from `<body>`.++ * CommonMark writer: fix strikethrough for `gfm` (#4038).++ * Use texmath 0.10, which adds support for a wider range of+ symbols and fixes default column alignments in MathML+ and OMML.++ * Highlighting fixes, using skylighting 0.4.3.2:++ + Fix invalid CSS.+ + Support `lineAnchors` (or `line-anchors`) in HTML code blocks.+ + Ensure that code lines don't get duplicate identifiers (#4031).+ The line identifiers are built using the code block's identifier+ as a prefix. If the code block has null identifier, we use+ `cb1`, `cb2`, etc.++ * Added a few abbreviations to `data/abbreviations`,+ and sorted the list (#3984, Wandmalfarbe).++ * Improved support for columns in HTML writer (#4028).++ + Remove `width` attribute from the `div`.+ + Remove space between `<div class="column">` elements,+ since this prevents columns whose widths sum to 100%+ (the space takes up space).+ + Move as much as possible of the CSS to the template.+ + Ensure that all the HTML-based templates (including epub)+ contain the CSS for columns.+ + Columns default to 50% width unless they are given a width+ attribute. So if you want two equal-width columns, you+ can use a div with class `column` and no `width` attribute.++ * SelfContained: use `base64` for css links with media attribute (#4026).+ This fixes `--self-contained` with S5.++ * Improve `pandoc-template-mode.el` (Vaclav Haisman).++ * INSTALL.md: MacOS instructions needed xar -f (adam234).++ * MANUAL.txt:++ + Clarify that --setext-headers doesn't affect gfm output (#4035).+ + Clarify what is needed to open and close a div in `fenced_divs`+ (#4039, Tristano Ajmone).+ + Removed reference to `default.beamer` in docs (#4024).+ Also added mention of other templates affecting PDF output+ with different settings.+++## pandoc 2.0.1 (2017-10-31)++ * Fixed regression in parsing of HTML comments in markdown and other+ non-HTML formats (`Text.Pandoc.Readers.HTML.htmlTag`) (#4019).+ The parser stopped at the first `>` character, even if it wasn't+ the end of the comment.++ * Creole reader (Sascha Wilde):++ + Fix some minor typos and formatting.+ + Add additional test on nowiki-block after para.+ + Fix lists with trailing white space.++ * LaTeX reader: handle `%` comment right after command.+ For example, `\emph%`.++ * Markdown reader: make sure fenced div closers work in lists.+ Previously the following failed:++ ::: {.class}+ 1. one+ 2. two+ :::++ and you needed a blank line before the closing `:::`.++ * Make `fenced_divs` affect the Markdown writer. If `fenced_divs` is+ enabled, Divs will be rendered as fenced divs.++ * LaTeX/Beamer writer: support "blocks" inside columns and other Divs+ (#4016).++ * HTML Writer: consistently use dashed class-names (Mauro Bieg, #3556).+ Note: this change may require some changes in CSS rules.+ `footnoteRef` has become `footnote-ref`, `titleslide` has+ become `title-slide`, and `footnoteBack` has become `footnote-back`.++ * JATS writer: Properly pass through author metadata (#4020).++ * FB2 writer (Alexander Krotov):++ + Write blocks outside of `<p>` in definitions.+ + Make bullet lists consistent with ordered lists, repeating+ the marker for the outer list rather than indenting sublists,+ since indentation does not work in readers.+ + Add new style FB2 tests.++ * `Text.Pandoc.ImageSize`: Add `Millimeter` constructor to `Dimension`+ (#4012) [API change]. Now sizes given in 'mm' are no longer converted+ to 'cm'.++ * Revise documentation of small caps syntax (Andrew Dunning, #4013).++ * Fix broken reference links in manual (Andrew Dunning, #4014)++ * Fixed example of slide columns structure in changelog (#4015).+ Also documented this feature in MANUAL.txt.+++## pandoc 2.0.0.1 (2017-10-30)++ * EPUB writer:++ + Fixed filepaths for nonstandard epub-subdirectory values.+ + Ensure that epub2 is recognized as a non-text format,+ so that a template is used.+ + Don't include "prefix" attribute for ibooks for epub2.+ It doesn't validate.+ + Fix stylesheet paths; previously we had an incorrect+ stylesheet path for the cover page and nav page.++ * LaTeX reader:++ + Insert space when needed in macro expansion (#4007).+ Sometimes we need to insert a space after a control sequence+ to prevent it merging with a following letter.+ + Allow unbraced arguments for macros (#4007).+ + Allow body of macro definition to be unbraced (#4007).++ * Linux package build: ensure that pandoc-citeproc is statically linked.++ * trypandoc: add native, ms.+++## pandoc 2.0 (2017-10-29)++### New features++ * New output format `ms` (groff ms). Complete support, including+ tables, math, syntax highlighting, and PDF bookmarks. The writer uses+ texmath's new eqn writer to convert math to eqn format, so a ms file+ produced with this writer should be processed with `groff -ms -e` if+ it contains math.++ * New output format `jats` (Journal Article Tag Suite). This is an XML+ format used in archiving and publishing articles. Note that a+ URI-encoded CSL stylesheet (`data/jats.csl`) is added automatically+ unless a stylesheet is specified using `--css`.++ * New output format `gfm` (GitHub-flavored CommonMark) (#3841).+ This uses bindings to GitHub's fork of cmark, so it should parse+ gfm exactly as GitHub does (excepting certain postprocessing+ steps, involving notifications, emojis, etc.). `markdown_github`+ has been deprecated in favor of `gfm`.++ * New output format `muse` (Emacs Muse) (Alexander Krotov, #3489).++ * New input format `gfm` (GitHub-flavored CommonMark) (#3841).+ This uses bindings to GitHub's fork of cmark. `markdown_github`+ has been deprecated in favor of `gfm`.++ * New input format `muse` (Emacs Muse) reader (Alexander Krotov, #3620).++ * New input format `tikiwiki` (TikiWiki markup) (rlpowell, #3800).++ * New input format `vimwiki` (Vimwiki markup) (Yuchen Pei, #3705).+ Note that there is a new data file, `data/vimwiki.css`, which can+ be used to display the HTML produced by this reader and+ pandoc's HTML writer in the style of vimwiki's own HTML+ export.++ * New input format `creole` (Creole 1.0) (#3994, Sascha Wilde).++ * New syntax for Divs, with `fenced_divs` extension enabled by+ default (#168). This gives an attractive, plain-text way to create+ containers for block-level content.++ * Added new syntax for including raw content in any output format,+ enabled by the `raw_attribute` extension (which is on by default+ for `markdown` and `multimarkdown`). The syntax is the same as+ for fenced code blocks or code inlines, only with `{=FORMAT}` for+ attributes, where `FORMAT` is the name of the output format+ (e.g., `ms`, `html`).++ * Implement multicolumn support for slide formats (#1710).+ The structure expected is:++ :::::::::::::: {.columns}+ ::: {.column width="40%"}+ contents...+ :::+ ::: {.column width="60%"}+ contents...+ :::+ ::::::::::::::++ Support has been added for beamer and all HTML slide formats.++ * Allows line comments in templates, beginning with `$--` (#3806).+ (Requires doctemplates 0.2.1.)++ * Add `--eol=crlf|lf|native` flag and writer option to control line endings+ (Stefan Dresselhaus, #3663, #2097).++ * Add `--log` option to save log messages in JSON format to a file (#3392).++ * Add `--request-header` option, to set request headers when pandoc+ makes HTTP requests to fetch external resources. For example:+ `--request-header User-Agent:blah`.++ * Added lua filters (Albert Krewinkel, #3514). The new `--lua-filter`+ option works like `--filter` but takes pathnames of special lua filters+ and uses the lua interpreter baked into pandoc, so that no external+ interpreter is needed. Note that lua filters are all applied after+ regular filters, regardless of their position on the command line.+ For documentation of lua filters, see `doc/lua-filters.md`.++ * Set `PANDOC_READER_OPTIONS` in environment where filters are run.+ This contains a JSON representation of `ReaderOptions`, so filters+ can access it.++ * Support creation of pdf via groff `ms` and pdfroff.+ `pandoc -t ms -o output.pdf input.txt`.++ * Support for PDF generation via HTML and `weasyprint` or `prince`+ (Mauro Bieg, #3909). `pandoc -t html5 -o output.pdf --pdf-engine=prince`.++ * Added `--epub-subdirectory` option (#3720). This specifies the+ subdirectory in the OCF container that holds the EPUB specific content.+ We now put all EPUB related content in an `EPUB/` subdirectory by default+ (later this will be configurable).++ ```+ mimetype+ META-INF/+ com.apple.ibooks.display-options.xml+ container.xml+ EPUB/ <<--configurable-->>+ fonts/ <<--static-->>+ font.otf+ media/ <<--static-->>+ cover.jpg+ fig1.jpg+ styles/ <<--static-->>+ stylesheet.css+ content.opf+ toc.ncx+ text/ <<--static-->>+ ch001.xhtml+ ```++ * Added `--resource-path=SEARCHPATH` command line option (#852).+ SEARCHPATH is separated by the usual character, depending on OS+ (: on unix, ; on windows). Default resource path is just working+ directory. However, the working directory must be explicitly+ specified if the `--resource-path` option is used.++ * Added --abbreviations=FILE option for custom abbreviations file+ (#256). Dfault abbreviations file (`data/abbreviations`) contains+ a list of strings that will be recognized by pandoc's+ Markdown parser as abbreviations. (A nonbreaking space will+ be inserted after the period, preventing a sentence space in+ formats like LaTeX.) Users can override the default by putting a file+ abbreviations in their user data directory (`~/.pandoc` on *nix).++ * Allow a theme file as argument to `--highlight-style`.+ Also include a sample, `default.theme`, in `data/`.++ * Allow `--syntax-definition` option for dynamic loading of syntax+ highlighting definitions (#3334).++ * Lists in `markdown` by default now use the CommonMark variable+ nesting rules (#3511). The indentation required for a block-level+ item to be included in a list item is no longer fixed, but is+ determined by the first line of the list item. To be included in+ the list item, a block must be indented to the level of the first+ non-space content after the list marker. Exception: if are 5 or more+ spaces after the list marker, then the content is interpreted as an+ indented code block, and continuation paragraphs must be indented+ two spaces beyond the end of the list marker. See the CommonMark+ spec for more details and examples.++ Documents that adhere to the four-space rule should, in most cases,+ be parsed the same way by the new rules. Here are some examples+ of texts that will be parsed differently:++ - a+ - b++ will be parsed as a list item with a sublist; under the four-space+ rule, it would be a list with two items.++ - a++ code++ Here we have an indented code block under the list item, even though it+ is only indented six spaces from the margin, because it is four spaces+ past the point where a continuation paragraph could begin. With the+ four-space rule, this would be a regular paragraph rather than a code+ block.++ - a++ code++ Here the code block will start with two spaces, whereas under+ the four-space rule, it would start with `code`. With the four-space+ rule, indented code under a list item always must be indented eight+ spaces from the margin, while the new rules require only that it+ be indented four spaces from the beginning of the first non-space+ text after the list marker (here, `a`).++ This change was motivated by a slew of bug reports from people+ who expected lists to work differently (#3125, #2367, #2575, #2210,+ #1990, #1137, #744, #172, #137, #128) and by the growing prevalance+ of CommonMark (now used by GitHub, for example). Those who+ prefer the old behavior can use `-f markdown+four_space_rule`.++ * Added `four_space_rule` extension. This triggers the old pandoc+ parsing rule for content nested under list items (the "four space+ rule").++ * Added `spaced_reference_links` extension (#2602). It allows whitespace+ between the two parts of a reference link: e.g.++ [a] [b]++ [b]: url++ This was previously enabled by default; now it is forbidden by default.++ * Add `space_in_atx_header` extension (#3512). This is enabled by default+ in pandoc and GitHub markdown but not the other flavors.+ This requirse a space between the opening #'s and the header+ text in ATX headers (as CommonMark does but many other implementations+ do not). This is desirable to avoid falsely capturing things ilke++ #hashtag++ or++ #5++ * Add `sourcefile` and `outputfile` template variables (Roland Hieber,+ #3431).++ * Allow ibooks-specific metadata in epubs (#2693). You can now have+ the following fields in your YAML metadata, and it will be treated+ appropriately in the generated EPUB:++ ```+ ibooks:+ version: 1.3.4+ specified-fonts: false+ ipad-orientation-lock: portrait-only+ iphone-orientation-lock: landscape-only+ binding: true+ scroll-axis: vertical+ ```+++### Behavior changes++ * Reader functions no longer presuppose that CRs have been+ stripped from the input. (They strip CRs themselves, before+ parsing, to simplify the parsers.)++ * Added support for translations (localization) (#3559).+ Currently this only affects the LaTeX reader, for things+ like `\figurename`. Translation data files for 46 languages+ can be found in `data/translations`.++ * Make `--ascii` work with DocBook output too.++ * Rename `--latex-engine` to `--pdf-engine`,+ and `--latex-engine-opt` to `--pdf-engine-opt`.++ * Removed `--parse-raw` and `readerParseRaw`. These were confusing.+ Now we rely on the `+raw_tex` or `+raw_html` extension with latex or html+ input. Thus, instead of `--parse-raw -f latex` we use `-f latex+raw_tex`,+ and instead of `--parse-raw -f html` we use `-f html+raw_html`.++ * With `--filter` R filters are now recognized, even if they are+ not executable (#3940, #3941, Andrie de Vries).++ * Support SVG in PDF output, converting with `rsvg2pdf` (#1793).++ * Make epub an alias for epub3, not epub2.++ * Removed `--epub-stylesheet`; use `--css` instead (#3472, #847).+ Multiple stylesheets may be used. Stylesheets will be taken both from+ `--css` and from the `stylesheet` metadata field (which can contain+ either a file path or a list of them).++ * `--mathml` and MathML in HTMLMathMethod no longer take an argument.+ The argument was for a bridge JavaScript that used to be necessary+ in 2004. We have removed the script already.++ * `--katex` improvements. The latest version is used, and the+ autoload script is loaded by default.++ * Change MathJax CDN default since old one is shutting down (#3544).+ Note: The new URL requires a version number, which we'll have+ to update manually in subsequent pandoc releases in order to+ take advantage of mathjax improvements.++ * `--self-contained`: don't incorporate elements with `data-external="1"`+ (#2656). You can leave an external link as it is by adding the attribute+ data-external="1" to the element. Pandoc will then not try to+ incorporate its content when `--self-contained` is used. This is+ similar to a feature already supported by the EPUB writer.++ * Allow `--extract-media` to work with non-binary input formats+ (#1583, #2289). If `--extract-media` is supplied with a non-binary+ input format, pandoc will attempt to extract the contents of all+ linked images, whether in local files, data: uris, or external uris.+ They will be named based on the sha1 hash of the contents.++ * Make `papersize: a4` work regardless of the case of `a4`.+ It is converted to `a4` in LaTeX and `A4` in ConTeXt.++ * Make `east_asian_line_breaks` affect all readers/writers (#3703).++ * Underlined elements are now treated consistently by readers+ (#2270, hftf); they are always put in a Span with class `underline`.+ This allows the user to treat them differently from other emphasis,+ using a filter. Docx, Org, Textile, Txt2Tags, and HTML readers+ have been changed.++ * Improved behavior of `auto_identifiers` when there are explicit ids+ (#1745). Previously only autogenerated ids were added to the list+ of header identifiers in state, so explicit ids weren't taken+ into account when generating unique identifiers. Duplicated+ identifiers could result. This simple fix ensures that explicitly given+ identifiers are also taken into account.++ * Use `table-of-contents` for contents of toc, make `toc` a boolean+ (#2872). Changed markdown, rtf, and HTML-based templates accordingly.+ This allows you to set `toc: true` in the metadata; this+ previously produced strange results in some output formats.+ For backwards compatibility, `toc` is still set to the+ toc contents. But it is recommended that you update templates+ to use `table-of-contents` for the toc contents and `toc`+ for a boolean flag.++ * Change behavior with binary format output to stdout.+ Previously, for binary formats, output to stdout was disabled+ unless we could detect that the output was being piped (and not+ sent to the terminal). Unfortunately, such detection is not+ possible on Windows, leaving windows users no way to pipe binary+ output. So we have changed the behavior in the following way:++ + Output to stdout is allowed when it can be determined that+ the output is being piped (on non-Windows platforms).+ + If the `-o` option is not used, binary output is never sent+ to stdout by default; instead, an error is raised.+ + If `-o -` is used, binary output is sent to stdout, regardless+ of whether it is being piped. This works on Windows too.++ * Better error behavior: uses of `error` have been replaced by+ raising of `PandocError`, which can be trapped and handled by the+ calling program.++ * Removed `hard_line_breaks` extension from `markdown_github` (#3594).+ GitHub has two Markdown modes, one for long-form documents like READMEs+ and one for short things like issue comments. In issue comments, a line+ break is treated as a hard line break. In README, wikis, etc., it is+ treated as a space as in regular Markdown. Since pandoc is more likely to+ be used to convert long-form documents from GitHub Markdown,+ `-hard_line_breaks` is a better default.++ * Include `backtick_code_blocks` extension in `mardkown_mmd` (#3637).++ * Escape `MetaString` values (as added with `-M/--metadata` flag) (#3792).+ Previously they would be transmitted to the template without any+ escaping. Note that `--M title='*foo*'` yields a different result from++ ---+ title: *foo*+ ---++ In the latter case, we have emphasis; in the former case, just+ a string with literal asterisks (which will be escaped+ in formats, like Markdown, that require it).++ * Allow `em`, `cm`, `in` for image height/width in HTML, LaTeX (#3450).++ * HTML writer: Insert `data-` in front of unsupported attributes. Thus,+ a span with attribute `foo` gets written to HTML5 with `data-foo`, so+ it is valid HTML5. HTML4 is not affected. This will allow us to use+ custom attributes in pandoc without producing invalid HTML. (With help+ from Wandmalfarbe, #3817.)++ * Plain writer: improved super/subscript rendering. We now+ handle more non-digit characters for which there are+ sub/superscripted unicode characters. When unicode+ sub/superscripted characters are not available, we use+ `_(..)` or `^(..)` (#3518).++ * Docbook, JATS, TEI writers: print INFO message when omitting interior+ header (#3750). This only applies to section headers inside list items,+ e.g., which were otherwise silently omitted.++ * Change to `--reference-links` in Markdown writer (#3701). With+ `--reference-location` of `section` or `block`, pandoc will now repeat+ references that have been used in earlier sections. The Markdown+ reader has also been modified, so that *exactly* repeated references+ do not generate a warning, only references with the same label but+ different targets. The idea is that, with references after every block,+ one might want to repeat references sometimes.++ * ODT/OpenDocument writer:++ + Support `lang` attribute (#1667).+ + Added support for `--toc` (#2836). Thanks to @anayrat.++ * Docx writer:++ + `lang` meta, see #1667 (Mauro Bieg, #3515).+ + Change `FigureWithCaption` to `CaptionedFigure` (iandol, #3658).+ + Use `Table` rather than `Table Normal` for table style (#3275).+ `Table Normal` is the default table style and can't be modified.+ + Pass through comments (#2994). We assume that comments are defined as+ parsed by the docx reader:++ I want <span class="comment-start" id="0" author="Jesse Rosenthal"+ date="2016-05-09T16:13:00Z">I left a comment.</span>some text to+ have a comment <span class="comment-end" id="0"></span>on it.++ We assume also that the id attributes are unique and properly+ matched between comment-start and comment-end.+ + Bookmark improvements. Bookmark start/end now surrounds content rather+ than preceding it. Bookmarks generated for Div with id+ (jgm/pandoc-citeproc#205).+ + Add `keywords` metadata to docx document properties (Ian).++ * RST writer: support unknown interpreted text roles by+ parsing them as `Span` with `role` attributes (#3407). This+ way they can be manipulated in the AST.++ * HTML writer:++ + Line block: Use class instead of style attribute (#1623). We now+ issue `<div class="line-block">` and include a default definition+ for `line-block` in the default templates, instead of hard-coding a+ `style` on the div.+ + Add class `footnoteBack` to footnote back references (Timm Albers).+ This allows for easier CSS styling.+ + Render SmallCaps as span with smallcaps class (#1592), rather than+ using a style attribute directly. This gives the user more flexibility+ in styling small caps in CSS.+ + With reveal.js we use `data-src` instead of `src` for images for+ lazy loading.+ + Special-case `.stretch` class for images in reveal.js (#1291).+ Now in reveal.js, an image with class `stretch` in a paragraph+ by itself will stretch to fill the whole screen, with no+ caption or figure environment.++ * Added warnings for non-rendered blocks to writers.++ * Writers now raise an error on template failure.++ * When creating a PDF via LaTeX, warn if the font is missing some+ characters (#3742).++ * Remove initial check for PDF-creating program (#3819).+ Instead, just try running it and raise the exception if it+ isn't found at that point. This improves things for users of Cygwin+ on Windows, where the executable won't be found by `findExecutable`+ unless `.exe` is added. The same exception is raised as before, but+ at a later point.++ * Readers issue warning for duplicate header identifiers (#1745).+ Autogenerated header identifiers are given suffixes so as not to clash+ with previously used header identifiers. But they may still coincide with+ an explicit identifier that is given for a header later in the document,+ or with an identifier on a div, span, link, or image. We now issue+ a warning in this case, so users can supply an explicit identifier.++ * CommonMark reader now supports `emoji`, `hard_line_breaks`, `smart`,+ and `raw_html` extensions.++ * Markdown reader:++ + Don't allow backslash + newline to affect block structure (#3730).+ Note that as a result of this change, the following, which formerly+ produced a header with two lines separated by a line break, will+ now produce a header followed by a paragraph:++ # Hi\+ there++ This may affect some existing documents that relied on+ this undocumented and unintended behavior. This change makes pandoc+ more consistent with other Markdown implementations, and with itself+ (since the two-space version of a line break doesn't work inside ATX+ headers, and neither version works inside Setext headers).+++ * Org reader (Albert Krewinkel, unless noted):++ + Support `table.el` tables (#3314).+ + Support macros (#3401).+ + Support the `#+INCLUDE:` file inclusion mechanism (#3510).+ Recognized include types are `example`, `export`, `src`, and+ normal org file inclusion. Advanced features like line numbers+ and level selection are not implemented yet.+ + Interpret more meta value as inlines. The values of the following+ meta variables are now interpreted using org-markup instead of+ treating them as pure strings: `keywords` (comma-separated list of+ inlines), `subtitle` (inline values), `nocite` (inline values, can+ be repeated).+ + Support `\n` export option (#3940). This turns all newlines in the+ text into hard linebreaks.++ * RST reader:++ + Improved admonition support (#223). We no longer add an+ `admonition` class, we just use the class for the type of admonition,+ `note` for example. We put the word corresponding to the label in+ a paragraph inside a `Div` at the beginning of the admonition with+ class `admonition-title`. This is about as close as we can get to+ RST's own output.+ + Initial support of `.. table` directive. This allows adding captions+ to tables.+ + Support `.. line-block` directive. This is deprecated but may still+ be in older documents.+ + Support scale and align attributes of images (#2662).+ + Implemented implicit internal header links (#3475).+ + Support RST-style citations (#853). The citations appear at the end+ of the document as a definition list in a special div with id+ `citations`. Citations link to the definitions.+ + Recurse into bodies of unknown directives (#3432).+ In most cases it's better to preserve the content than+ to emit it. This isn't guaranteed to have good results;+ it will fail spectacularly for unknown raw or verbatim directives.+ + Handle chained link definitions (#262). For example,++ .. _hello:+ .. _goodbye: example.com++ Here both `hello` and `goodbye` should link to `example.com`.+ + Support anchors (#262). E.g.++ `hello`++ .. _hello:++ paragraph++ This is supported by putting "paragraph" in a `Div` with id `hello`.+ + Support `:widths:` attribute for table directive.+ + Implement csv-table directive (#3533). Most attributes are supported,+ including `:file:` and `:url:`.+ + Support unknown interpreted text roles by parsing them as Span+ with "role" attributes (#3407). This way they can be manipulated in+ the AST.++ * HTML reader: parse a span with class `smallcaps` as `SmallCaps`.++ * LaTeX reader:++ + Implemented `\graphicspath` (#736).+ + Properly handle column prefixes/suffixes. For example, in+ `\begin{tabular}{>{$}l<{$}>{$}l<{$} >{$}l<{$}}`+ each cell will be interpreted as if it has a `$`+ before its content and a `$` after (math mode).+ + Handle komascript `\dedication` (#1845). It now adds a+ `dedication` field to metadata. It is up to the user to supply+ a template that uses this variable.+ + Support all `\textXX` commands, where XX = `rm`, `tt`, `up`, `md`,+ `sf`, `bf` (#3488). Spans with a class are used when there is+ nothing better.+ + Expand `\newenvironment` macros (#987).+ + Add support for LaTeX subfiles package (Marc Schreiber, #3530).+ + Better support for subfigure package (#3577).+ A figure with two subfigures turns into two pandoc+ figures; the subcaptions are used and the main caption+ ignored, unless there are no subcaptions.+ + Add support for `\vdots` (Marc Schreiber, #3607).+ + Add basic support for hyphenat package (Marc Schreiber, #3603).+ + Add basic `\textcolor` support (Marc Schreiber).+ + Add support for `tabularx` environment (Marc Schreiber, #3632).+ + Better handling of comments inside math environments (#3113).+ This solves a problem with commented out `\end{eqnarray}` inside+ an eqnarray (among other things).+ + Parse tikzpicture as raw verbatim environment if `raw_tex` extension+ is selected (#3692). Otherwise skip with a warning. This is better+ than trying to parse it as text!+ + Add `\colorbox` support (Marc Schreiber).+ + Set identifiers on Spans used for `\label`.+ + Have `\setmainlanguage` set `lang` in metadata.+ + Support etoolbox's `\ifstrequal`.+ + Support `plainbreak`, `fancybreak` et al from the memoir class+ (bucklereed, #3833).+ + Support `\let`. Also, fix regular macros so they're expanded at the+ point of use, and NOT also the point of definition. `\let` macros,+ by contrast, are expanded at the point of definition. Added an+ `ExpansionPoint` field to `Macro` to track this difference.+ + Support simple `\def` macros. Note that we still don't support+ macros with fancy parameter delimiters, like `\def\foo#1..#2{...}`.+ + Support `\chaptername`, `\partname`, `\abstractname`, etc. (#3559,+ obsoletes #3560).+ + Put content of `\ref`, `\label`, `\eqref` commands into `Span` with+ attributes, so they can be handled in filters (Marc Schreiber, #3639)+ + Add Support for `glossaries` and `acronym` package (Marc Schreiber,+ #3589). Acronyms are not resolved by the reader, but acronym and+ glossary information is put into attributes on Spans so that they+ can be processed in filters.+ + Use `Link` instead of `Span` for `\ref`. This makes more sense+ semantically and avoids unnecessary `Span [Link]` nestings when+ references are resolved.+ + Rudimentary support for `\hyperlink`.+ + Support `\textquoteleft|right`, `\textquotedblleft|right` (#3849).+ + Support `\lq`, `\rq`.+ + Implement `\newtoggle`, `\iftoggle`, `\toggletrue|false` from etoolbox+ (#3853).+ + Support `\RN` and `\Rn`, from biblatex (bucklereed, #3854).+ + Improved support for `\hyperlink`, `\hypertarget` (#2549).+ + Support `\k` ogonek accent.+ + Improve handling of accents. Handle ogonek, and fall back correctly+ with forms like `\"{}`.+ + Better support for ogonek accents.+ + Support for `\faCheck` and `\faClose` (Marc Schreiber, #3727).+ + Support for `xspace` (Marc Schreiber, #3797).+ + Support `\setmainlanguage` or `\setdefaultlanguage` (polyglossia)+ and `\figurename`.+ + Better handling of `\part` in LaTeX (#1905). Now we parse chapters as+ level 0 headers, and parts as level -1 headers. After parsing, we+ check for the lowest header level, and if it's less than 1 we bump+ everything up so that 1 is the lowest header level. So `\part` will+ always produce a header; no command-line options are needed.+ + Add block version of `\textcolor` (Marc Schreiber).+ + `\textcolor` works as inline and block command (Marc Schreiber).+ + `\textcolor` will be parse as span at the beginning of a paragraph+ (Marc Schreiber).+ + Read polyglossia/babel `\text(LANG){...}` (bucklereed)+ + Improved handling of include files in LaTeX reader (#3971).+ Previously `\include` wouldn't work if the included file+ contained, e.g., a begin without a matching end.+ + Support `\expandafter` (#3983).+ + Handle `\DeclareRobustCommand` (#3983). Currently it's just treated+ as a synonym for `\newcommand`.+ + Handle `\lettrine` (Mauro Bieg).++ * Math improvements due to updates in texmath:++ + Improved handling of accents and upper/lower delimiters.+ + Support for output in GNU eqn format (used with *roff).+ + Allow `\boldsymbol` + a token without braces, and similarly+ with other styling commands.+ + Improve parsing of `\mathop` to allow multi-character operator names.+ + Add thin space after math operators when "faking it with+ unicode."++ * `walk` is now used instead of `bottomUp` in the `ToJSONFilter`+ instance for `a -> [a]` (pandoc-types). Note that behavior+ will be slightly different, since `bottomUp`'s treatment of+ a function `[a] -> [a]` is to apply it to each sublist of a+ list, while walk applies it only to maximal sublists.+ Usually the latter behavior is what is wanted, and the+ former can be simulated when needed. But there may be+ existing filters that need to be rewritten in light of the+ new behavior. Performance should be improved.++ * There are some changes to syntax highlighting due to revisions+ in the `skylighting` library:++ + Support for `powershell` has been added, and many syntax+ definitions have been updated.+ + Background colors have been added to the `kate` style.+ + The way highlighted code blocks are formatted in HTML has+ been changed (David Baynard), in ways that may require+ changes in hard-coded CSS affecting highlighting.+ (If you haven't included hard-coded highlighting CSS in+ your template, you needn't change anything.)+++### API changes++ * New module `Text.Pandoc.Class` (Jesse Rosenthal, John MacFarlane).+ This contains definitions of the `PandocMonad` typeclass, the+ `PandocIO` and `PandocPure` monads, and associated functions.++ * Changed types of all writers and readers.++ + We now use `Text` instead of `String` in the interface (#3731).+ (We have not yet changed the internals of most readers to work+ with `Text`, but making this change in the API now opens up a+ path to doing that.)+ + The result is now of form `m a` with constraint `PandocMonad m`.+ Readers and writers can be combined to form monadic values which+ can be run using either `runIO` or `runPure`. If `runIO` is used,+ then both readers and writers will be able to do IO when needed+ (for include files, for example); if `runPure` is used,+ then the functions are pure and will not touch IO.+ + Where previously you used+ `writeRST def (readMarkdown def "[foo](url)")`, now you+ would use+ `runPure $ readMarkdown def (pack "[foo](url)") >>= writeRST def`.++ * New module `Text.Pandoc.Readers` (Albert Krewinkel). This+ contains reader helper functions formerly defined in the+ top-level `Text.Pandoc` module.++ + Changed `StringReader` -> `TextReader`.+ + `getReader` now returns a pair of a reader and+ `Extensions`, instead of building the extensions into the+ reader (#3659). The calling code must explicitly set+ `readerExtensions` using the `Extensions` returned. The+ point of the change is to make it possible for the calling+ code to determine what extensions are being used.++ * New module `Text.Pandoc.Writers` (Albert Krewinkel).+ This contains writer helper functions formerly defined in the+ top-level `Text.Pandoc` module.++ + Changed `StringWriter` -> `TextWriter`.+ + `getWriter` now returns a pair of a reader and+ `Extensions`, instead of building the extensions into the+ reader (#3659). The calling code must explicitly set+ `readerExtensions` using the `Extensions` returned. The+ point of the change is to make it possible for the calling+ code to determine what extensions are being used.++ * New module `Text.Pandoc.Lua`, exporting `runLuaFilter` (Albert Krewinkel,+ #3514).++ * New module `Text.Pandoc.App`. This abstracts out the functionality+ of the command line program (`convertWithOpts`), so it can be reproduced+ e.g. in a desktop or web application. Instead of exiting, we throw errors+ (#3548), which are caught (leading to exit) in pandoc.hs, but allow other+ users of `Text.Pandoc.App` to recover. `pandoc.hs` is now a 2-liner.+ The module also exports some utility functions for parsing options+ and running filters.++ * New module `Text.Pandoc.Logging` (exported module) (#3392).+ This now contains the `Verbosity` definition previously in+ `Text.Pandoc.Options`, as well as a new `LogMessage` datatype that will+ eventually be used instead of raw strings for warnings. This will enable+ us, among other things, to provide machine-readable warnings if desired.+ Include ToJSON instance and showLogMessage. This gives us the possibility+ of both machine-readable and human-readable output for log messages.++ * New module `Text.Pandoc.BCP47`, with `getLang`, `Lang(..)`, `parseBCP47`.++ * New module `Text.Pandoc.Translations`, exporting `Term`,+ `Translations`, `readTranslations`.++ * New module `Text.Pandoc.Readers.LaTeX.Types', exporting `Macro`, `Tok`,+ `TokType`, `Line`, `Column`.++ * `Text.Pandoc.Error`: added many new constructors for `PandocError`.++ * Expose some previously private modules (#3260). These are often+ helpful to people writing their own reader or writer modules:++ + `Text.Pandoc.Writers.Shared`+ + `Text.Pandoc.Parsing`+ + `Text.Pandoc.Asciify`+ + `Text.Pandoc.Emoji`+ + `Text.Pandoc.ImageSize`+ + `Text.Pandoc.Highlighting`+`+ * New module `Text.Pandoc.Extensions` (Albert Krewinkel):+ Extension parsing and processing functions were defined in the top-level+ `Text.Pandoc` module. These functions are moved to the Extensions+ submodule as to enable reuse in other submodules.++ * Add `Ext_raw_attribute` constructor for `Extension`.++ * Add `Ext_fenced_divs` constructor for `Extension'.++ * Add `Ext_four_space_rule` constructor in `Extension`.++ * Add `Ext_gfm_auto_identifiers` constructor for `Extension`.++ * Add `Monoid` instance for `Extensions`.++ * Add `Text.Pandoc.Writers.Ms`, exporting `writeMs`.++ * Add `Text.Pandoc.Writers.JATS`, exporting `writeJATS`.++ * Add `Text.Pandoc.Writers.Muse`, exporting `writeMuse`.++ * Add `Text.Pandoc.Readers.Muse`, exporting `readMuse`.++ * Add `Text.Pandoc.Readers.TikiWiki`, exporting `readTikiWiki`.++ * Add `Text.Pandoc.Readers.Vimwiki`, exporting `readVimwiki`.++ * Add `Text.Pandoc.Readers.Creole`, exporting `readCreole`.++ * Export `setVerbosity` from `Text.Pandoc`.++ * `Text.Pandoc.Pretty`: Add `Eq` instance for `Doc`.++ * `Text.Pandoc.XML`: `toEntities`: changed type to `Text -> Text`.++ * `Text.Pandoc.UTF8`:++ + Export `fromText`, `fromTextLazy`, `toText`, `toTextLazy`.+ Define `toString`, `toStringLazy` in terms of them.+ + Add new functions parameterized on `Newline`: `writeFileWith`,+ `putStrWith`, `putStrLnWith`, `hPutStrWith`, `hPutStrLnWith`.++ * `Text.Pandoc.MediaBag`: removed `extractMediaBag`.++ * `Text.Pandoc.Highlighting`:++ + `highlighting` now returns an Either rather than Maybe.+ This allows us to display error information returned by the skylighting+ library. Display a warning if the highlighting library throws an error.+ + Add parameter for `SyntaxMap` to `highlight`.++ * `Text.Pandoc.Writers.Math`:++ + Export `defaultMathJaxURL`, `defaultKaTeXURL`. This will ensure that+ we only need to update these in one place.++ * `Text.Pandoc.SelfContained`:++ + Removed `WriterOptions` parameter from `makeSelfContained`.+ + Put `makeSelfContained` in PandocMonad instead of IO. This removes+ the need to pass MediaBag around and improves exceptions. It also+ opens up the possibility of using makeSelfContained purely.+ + Export `makeDataURI`.++ * `Text.Pandoc.ImageSize`:++ + Export `lengthToDim`, new function `scaleDimension`.+ + Export `inEm` from ImageSize (#3450).+ + Change `showFl` and `show` instance for `Dimension` so+ extra decimal places are omitted.+ + Added `Em` as a constructor of `Dimension`.+ + Add `WriterOptions` parameter to `imageSize` signature (Mauro Bieg).++ * `Text.Pandoc.Templates`:++ + Change type of `renderTemplate'`. Now it runs in `PandocMonad`+ and raises a proper `PandocTemplateError` if there are problems, rather+ than failing with uncatchable `error`.+ + Change signature of `getDefaultTemplate`. Now it runs in any instance+ of `PandocMonad`, and returns a `String` rather than an `Either` value.+ And it no longer takes a `datadir` parameter, since this can be+ retrieved from `CommonState`.++ * `Text.Pandoc.Options`:++ + Added `writerEpubSubdirectory` to `WriterOptions` (#3720).+ The EPUB writer now takes its EPUB subdirectory from this option.+ + In `WriterOptions`, rename `writerLaTeXEngine` to `writerPdfEngine`+ and `writerLaTeXArgs` to `writerPdfArgs` (Mauro Bieg, #3909).+ + Add `writerSyntaxMap` to `WriterOptions`.+ + Removed `writerEpubStylesheet` from `WriterOptions`.+ + Remove `writerUserDataDir` from `WriterOptions`. It is now carried+ in `CommonState` in `PandocMonad` instances. (And thus it can be used+ by readers too.)+ + Changed `writerEpubMetadata` to a `Maybe String`.+ + Removed `readerApplyMacros` from `ReaderOptions`. Now we just check+ the `latex_macros` reader extension.+ + FromJSON/ToJSON instances for `ReaderOptions`.+ + In `HTMLMathMethod`, the `KaTeX` contsructor now takes only+ one string (for the KaTeX base URL), rather than two.+ + Removed `writerSourceURL` from `WriterOptions`. We now use+ `stSourceURL` in `CommonState`, which is set by `setInputFiles`.++ * `Text.Pandoc.Shared`:++ + `tabFilter` now takes a `Text`, not `String`.+ + `openURL`: Changed type from an Either. Now it will just raise+ an exception to be trapped later.+ + Remove `normalizeSpaces` (#1530).+ + Remove `warn`. (Use `report` from `Text.Pandoc.Class` instead.)+ + Export a new function `crFilter`.+ + Add `eastAsianLineBreakFilter` (previously in Markdown reader).+ + Provide custom `isURI` that rejects unknown schemes.+ (Albert Krewinkel, #2713). We also export the set of known+ `schemes`. The new function replaces the function of the same name+ from `Network.URI`, as the latter did not check whether a scheme is+ well-known. All official IANA schemes (as of 2017-05-22) are+ included in the set of known schemes. The four non-official schemes+ `doi`, `isbn`, `javascript`, and `pmid` are kept.+ + Remove `err`.+ + Remove `readDataFile`, `readDefaultDataFile`, `getReferenceDocx`,+ `getReferenceODT`. These now live in `Text.Pandoc.Class`,+ where they are defined in terms of `PandocMonad`+ primitives and have different signatures.+ + Remove `openURL`. Use `openURL` from `Text.Pandoc.Class` instead.+ + Add `underlineSpan`.++ * `Text.Pandoc.Readers.HTML`: export new `NamedTag` class.++ * `Text.Pandoc.Readers.Markdown`: remove `readDocxWithWarnings`.+ With the new API one can simply use `getLog` after running+ the reader.++ * `Text.Pandoc.Readers.LaTeX`: Changed types for `rawLaTeXInline`+ and `rawLaTeXBlock`. (Both now return a `String`, and they are+ polymorphic in state.)+++### Bug fixes and under-the-hood improvements++ * TEI writer: Added identifiers on `<div>` elements.++ * DokuWiki reader: Better handling for code block in list item (#3824).++ * Custom writer: Remove old preprocesesor conditionals (Albert Krewinkel).++ * ZimWiki writer: Removed internal formatting from note and table cells,+ because ZimWiki does not support it (Alex Ivkin, #3446).++ * MediaWiki writer:++ + Updated list of syntax highlighting languages (#3461).+ Now `r` gets you `<source>` rather than `<code>` (among others).+ + Add display attribute on `<math>` tags (#3452). This allows display+ math to be rendered properly.+ + Remove newline before `</ref>` (#2652).+ + Don't softbreak lines inside list items (#3531).++ * Org writer:++ + Reduce to two spaces after bullets (#3417, Albert Krewinkel).+ + Add unit tests (Alexander Krotov).+ + Stop using raw HTML to wrap divs (Albert Krewinkel, #3771).+ + Do not strip `#` from Org anchor links (Alexander Krotov).++ * CommonMark writer:++ + Avoid excess blank lines at end of output.+ + Prefer pipe tables to HTML tables even if it means losing relative+ column width information (#3734).+ + Support table, strikethrough extensions, when enabled (as with gfm).+ Note that we bypass the commonmark writer from cmark and construct our+ own pipe tables, with better results.+ + Properly support `--wrap=none`.+ + Use smallcaps class for `SmallCaps` (#1592).+ + Omit "fig:" prefix in image titles. This is used internally to+ indicate internal figures.++ * RST writer:++ + Properly handle table captions.+ + Don't wrap lines in in definition list terms. Wrapping is not allowed.+ + Implemented `+/-smart` and improved escaping with `+smart`.+ + Add empty comments when needed to avoid including a blockquote+ in the indented content of a preceding block (#3675).+ + Improve grid table output, fix bug with empty rows (#3516).+ Uses the new `gridTable` in Writers.Shared, which is here+ improved to better handle 0-width cells.+ + Remove space at beginning/end of RST code span (#3496). Otherwise+ we get invalid RST. There seems to be no way to escape the space.+ + Add header anchors when header has non-standard id (#3937).+ + Correctly handle inline code containing backticks, using a `:literal:`+ role (#3974).+ + Don't backslash-escape word-internal punctuation (#3978).++ * Markdown writer:++ + Don't include variables in metadata blocks. Previously variables set+ on the command line were included in e.g. YAML metadata, contrary to+ documentation and intentions.+ + Improved escaping with `+smart`.+ + Fixed grid tables embedded in grid tables (#2834).+ + Use span with class 'smallcaps' for SmallCaps, instead of a style+ attribute as before (#1592).+ + Escape initial `%` in a paragraph if the `pandoc_title_blocks`+ extension is enabled (#3454). Otherwise in a document starting with+ a literal `%` the first line is wrongly interpreted as a title.+ + Fixed false ordered lists in YAML metadata (#3492, #1685). Now we+ properly escape things that would otherwise start ordered lists,+ such as++ ---+ title: 1. inline+ ...+ + Better handling of tables with empty columns (#3337). We now+ calculate the number of columns based on the longest row (or the+ length of aligns or widths).+ + Escape unordered list markers at beginning of paragraph (#3497), to+ avoid false interpretation as a list.+ + Escape `|` appropriately.+ + Ensure space before list at top level (#3487).+ + Avoid spurious blanklines at end of document after tables and list,+ for example.+ + Fixed bugs in simple/multiline list output (#3384).+ Previously we got overlong lists with `--wrap=none`. This is fixed.+ Previously a multiline list could become a simple list (and would+ always become one with `--wrap=none`).+ + Don't emit a simple table if `simple_tables` disabled (#3529).+ + Case-insensitive reference links (David A Roberts, #3616).+ Ensure that we do not generate reference links whose labels differ only+ by case. Also allow implicit reference links when the link+ text and label are identical up to case.+ + Put space before reference link definitions (Mauro Bieg, #3630).+ + Better escaping for links (David A. Roberts, #3619). Previously the+ Markdown writer would sometimes create links where there were none+ in the source. This is now avoided by selectively escaping bracket+ characters when they occur in a place where a link might be created.+ + Added missing `\n` (David A. Roberts, #3647).+ + Fixed duplicated reference links with `--reference-links`+ and `--reference-location=section` (#3674). Also ensure that there+ are no empty link references `[]`.+ + Avoid inline surround-marking with empty content (#3715).+ E.g. we don't want `<strong></strong>` to become `****`.+ Similarly for emphasis, super/subscript, strikeout.+ + Don't allow soft break in header (#3736).+ + Make sure `plain`, `markdown_github`, etc. work for raw.+ Previously only `markdown` worked. Note: currently a raw block labeled+ `markdown_github` will be printed for any `markdown` format.+ + Ensure that `+` and `-` are escaped properly so they don't cause+ spurious lists (#3773). Previously they were only+ if succeeded by a space, not if they were at end of line.+ + Use pipe tables if `raw_html` disabled and `pipe_tables` enabled,+ even if the table has relative width information (#3734).+ + Markdown writer: don't crash on `Str ""`.+ + Make `Span` with null attribute transparent. That is, we don't use+ brackets or `<span>` tags to mark spans when there are no attributes;+ we simply output the contents.+ + Escape pipe characters when `pipe_tables` enabled (#3887).+ + Better escaping of `<` and `>`. If `all_symbols_escapable` is set,+ we backslash escape these. Otherwise we use entities as before.+ + When writing plain, don't use ` ` to separate list and indented+ code. There's no need for it in this context, since this isn't to be+ interpreted using Markdown rules.+ + Preserve classes in JS obfuscated links (Timm Albers, #2989).+ HTML links containing classes originally now preserve them when using+ javascript email obfuscation.+ + Render `SmallCaps` as a native span when `native_spans` are enabled.+ + Always write attributes with `bracketed_spans` (d-dorazio).++ * Man writer:++ + Fix handling of nested font commands (#3568). Previously pandoc emitted+ incorrect markup for bold + italic, for example, or bold + code.+ + Avoid error for definition lists with no definitions (#3832).++ * DocBook writer:++ + Fix internal links with `writerIdentifierPrefix opt`+ (#3397, Mauro Bieg).++ * Docx writer:++ + Don't include bookmarks on headers unless non-null id (#3476).+ + Support 9 levels of headers (#1642).+ + Allow 9 list levels (#3519).+ + Don't take `distArchive` from datadir (#3322). The docx writer takes+ components from the distribution's version of `reference.docx` when it+ can't find them in a user's custom `reference.docx`. Previously, we+ allowed a `reference.docx` in the data directory (e.g. `~/.pandoc`)+ to be used as the distribution's reference.docx. This led to a+ bizarre situation where pandoc would produce a good docx using+ `--template ~/.pandoc/ref.docx`, but if `ref.docx` were moved to+ `~/.pandoc/reference.docx`, it would then produce a corrupted docx.+ + Fixed handling of soft hyphen (0173) (#3691).+ + Better handling of keywords (#3719).+ + Cleaner code for handling dir and style attributes for `Div`.+ + Use `Set` for dynamic styles to avoid duplicates.+ + Removed redundant element from data/docx/word/numbering.xml.+ The elements we need are generated when the document is+ compiled; this didn't do anything.+ + Activate `evenAndOddHeaders` from reference docx (#3901,+ Augustín Martín Barbero).++ * ODT/OpenDocument writer:++ + Calculate aspect ratio for percentage-sized images (Mauro Bieg, #3239).+ + Use more widely available bullet characters (#1400). The old+ characters weren't available in some font sets. These seem to work+ well on Windows and Linux versions of LibreOffice.+ + Wider labels for lists (#2421). This avoids overly narrow labels for+ ordered lists with `()` delimiters. However, arguably it creates+ overly wide labels for bullets. Also, lists now start flush with+ the margin, rather than indented.+ + Fixed dropped elements in some ordered lists (#2434).++ * FB2 writer:++ + Don't render `RawBlock` as code.+ + Don't fail with an error on interior headers (e.g. in list) (#3750).+ Instead, omit them with an INFO message.+ + Add support for "lang" metadata (Alexander Krotov, #3625).+ + Format `LineBlock` as poem (Alexander Krotov). Previously writer+ produced one paragraph with `<empty-line/>` elements, which are not+ allowed inside `<p>` according to FB2 schema.+ + Replace `concatMap` with `cMap` (Alexander Krotov).+ + Write FB2 lists without nesting blocks inside `<p>` (Alexander+ Krotov, #4004)++ * HTML writer:++ + Make sure `html4`, `html5` formats work for raw blocks/inlines.+ + Render raw inline environments when `--mathjax` used (#3816).+ We previously did this only with raw blocks, on the assumption+ that math environments would always be raw blocks. This has changed+ since we now parse them as inline environments.+ + Ensure we don't get two style attributes for width and height.+ + Report when not rendering raw inline/block.+ + Issue warning if no title specified and template used (#3473).+ + Info message if `lang` is unspecified (#3486).+ + Removed unused parameter in `dimensionsToAttributeList`.+ + Avoid two class attributes when adding `uri` class (#3716).+ + Fix internal links with `writerIdentifierPrefix opt` (#3397, Mauro+ Bieg).+ + Use revealjs's math plugin for mathjax (#3743). This is a thin+ wrapper around mathjax that makes math look better on revealjs.+ + Slidy: use h1 for all slides, even if they were originally+ level 2 headers (#3566). Otherwise the built-in table of contents+ in Slidy breaks.++ * LaTeX writer:++ + Don't render LaTeX images with data: URIs (#3636). Note that+ `--extract-media` can be used when the input contains data: URIs.+ + Make highlighted code blocks work in footnotes (Timm Albers).+ + Don't use figure inside table cell (#3836).+ + Use proper code for list enumerators (#3891). This should fix problems+ with lists that don't use arabic numerals.+ + Always add hypertarget when there's a non-empty identifier (#2719).+ Previously the hypertargets were only added when there was actually+ a link to that identifier.+ + Use `%` after hypertarget before code block.+ + Add `\leavevmode` before hypertarget at start of paragraph (#2704,+ fixes formatting problems in beamer citations).+ + Don't use `lstinline` in `\item[..]` (#645). If you do, the contents+ of item disappear or are misplaced. Use `\texttt` instead.+ + Fix problem with escaping in `lstinline` (#1629). Previously the+ LaTeX writer created invalid LaTeX when `--listings` was specified and+ a code span occurred inside emphasis or another construction.+ + Fix error with line breaks after empty content (#2874). LaTeX+ requires something before a line break, so we insert a `~` if no+ printable content has yet been emitted.+ + Use BCP47 parser.+ + Fixed detection of otherlangs (#3770). We weren't recursing into+ inline contexts.+ + Handle language in inline code with `--listings` (#3422).+ + Write euro symbol directly in LaTeX (Andrew Dunning, #3801).+ The textcomp package allows pdfLaTeX to parse `€` directly, making the+ `\euro` command unneeded.+ + Fixed footnotes in table captions (#2378). Note that if the table has+ a first page header and a continuation page header, the notes will+ appear only on the first occurrence of the header.+ + In `writeBeamer` output, allow hyperlinks to frames (#3220).+ Previously you could link to a header above or below slide level but+ not *to* slide level. This commit changes that. Hypertargets are+ inserted inside frame titles; technically the reference is to just+ after the title, but in normal use (where slides are viewed full+ screen in a slide show), this does not matter.+ + Remove `\strut` at beginning of table cells (#3436). This fixes a+ problem with alignment of lists in table cells. The `\strut` at the+ end seems to be enough to avoid the too-close spacing that motivated+ addition of the strut in #1573.+ + Add partial siunitx Support (Marc Schreiber, #3588).++ * ConTeXt writer:++ + Refactored to use BCP47 module.+ + Remove unnecessary `$` (Alexander Krotov, #3482).+ + Use header identifiers for chapters (#3968).++ * EPUB writer:++ + `title_page.xhtml` is now put in `text/`.+ + Don't strip formatting in TOC (#1611).++ * Textile reader:++ + Fix bug for certain links in table cells (#3667).+ + Allow 'pre' code in list item (#3916).++ * HTML reader:++ + Added warnings for ignored material (#3392).+ + Better sanity checks to avoid parsing unintended things as+ raw HTML in the Markdown reader (#3257).+ + Revise treatment of `li` with `id` attribute (#3596). Previously we+ always added an empty div before the list item, but this created+ problems with spacing in tight lists. Now we do this: If the list+ item contents begin with a `Plain` block, we modify the `Plain`+ block by adding a `Span` around its contents. Otherwise, we add a+ `Div` around the contents of the list item (instead of adding an+ empty `Div` to the beginning, as before).+ + Add `details` tag to list of block tags (#3694).+ + Removed `button` from block tag list (#3717). It is already in the+ `eitherBlockOrInlineTag` list, and should be both places.+ + Use `Set`s instead of lists for block tag lookup.+ + Rewrote to use `Text` throughout. Effect on memory usage is modest+ (< 10%).+ + Use the lang value of `<html>` to set the lang meta value (bucklereed,+ #3765).+ + Ensure that paragraphs are closed properly when the parent block+ element closes, even without `</p>` (#3794).+ + Parse `<figure>` and `<figcaption>` (Mauro Bieg, #3813).+ + Parse `<main>` like `<div role=main>` (bucklereed, #3791).+ `<main>` closes `<p>` and behaves like a block element generally+ + Support column alignments (#1881). These can be set either+ with a `width` attribute or with `text-width` in a `style` attribute.+ + Modified state type to be an instance of `HasLogMessages`, so+ `registerHeader` can issue warnings.+ + `</td>` or `</th>` should close any open block tag (#3991).+ + `<td>` should close an open `<th>` or `<td>`.+ + `htmlTag` improvements (#3989). We previously failed on cases+ where an attribute contained a `>` character. This patch fixes the+ bug, which especially affects raw HTML in Markdown.++ * Txt2Tags reader:++ + Newline is not indentation (Alexander Krotov).++ * MediaWiki reader:++ + Allow extra hyphens after `|-` in tables (#2649).+ + Allow blank line after table start (#2649).+ + Fixed more table issues (#2649).+ + Ensure that list starts begin at left margin (#2606). Including when+ they're in tables or other list items.+ + Make smart double quotes depend on `smart` extension (#3585).+ + Don't do curly quotes inside `<tt>` contexts (#3585). Even if `+smart`.+ + Modified state type to be an instance of `HasLogMessages`, so+ `registerHeader` can issue warnings.++ * TWiki reader (Alexander Krotov):++ + Remove unnecessary `$` (#3597).+ + Simplify `linkText` (#3605).++ * EPUB reader:++ + Minor refactoring, avoiding explicit MediaBag handling.+ This all works behind the scenes in CommonState plumbing.++ * Docx reader:++ + Don't drop smartTag contents (#2242).+ + Handle local namespace declarations (#3365). Previously we didn't+ recognize math, for example, when the xmlns declaration occurred on+ the element and not the root.+ + More efficient trimSps (#1530). Replacing `trimLineBreaks`. This+ does the work of `normalizeSpaces` as well, so we avoid the need for+ that function here.+ + Avoid 0-level headers (Jesse Rosenthal, #3830). We used to parse+ paragraphs styled with "HeadingN" as "nth-level header." But if a+ document has a custom style named "Heading0", this will produce a+ 0-level header, which shouldn't exist. We only parse this style+ if N>0. Otherwise we treat it as a normal style name, and+ follow its dependencies, if any.+ + Add tests for avoiding zero-level header (Jesse Rosenthal).++ * ODT reader:++ + Replaced `collectRights` with Rights from `Data.Either`.+ + Remove dead code (Albert Krewinkel).++ * Org reader (Albert Krewinkel, unless noted).++ + Don't allow tables inside list items (John MacFarlane, #3499).+ + Disallow tables on list marker lines (#3499).+ + Convert markup at beginning of footnotes (John MacFarlane, #3576).+ + Allow emphasized text to be followed by `[` (#3577).+ + Handle line numbering switch for src blocks.+ The line-numbering switch that can be given to source blocks (`-n` with+ an start number as an optional parameter) is parsed and translated to a+ class/key-value combination used by highlighting and other readers and+ writers.+ + Stop adding rundoc prefix to src params. Source block parameter names+ are no longer prefixed with `rundoc`. This was intended to simplify+ working with the rundoc project, a babel runner. However, the rundoc+ project is unmaintained, and adding those markers is not the reader's+ job anyway. The original language that is specified for a source+ element is now retained as the `data-org-language` attribute and only+ added if it differs from the translated language.+ + Allow multi-word arguments to src block params (#3477). The reader now+ correctly parses src block parameter list even if parameter arguments+ contain multiple words.+ + Avoid creating `nullMeta` by applying `setMeta` directly+ (Alexander Krotov).+ + Replace `sequence . map` with `mapM`.+ + Fix smart parsing behavior. Parsing of smart quotes and special+ characters can either be enabled via the `smart` language extension or+ the `'` and `-` export options. Smart parsing is active if either the+ extension or export option is enabled. Only smart parsing of special+ characters (like ellipses and en and em dashes) is enabled by default,+ while smart quotes are disabled. Previously, all smart parsing was+ disabled unless the language extension was enabled.+ + Subject full doc tree to headline transformations (Albert Krewinkel,+ #3695). Emacs parses org documents into a tree structure, which is+ then post-processed during exporting. The reader is changed to do the+ same, turning the document into a single tree of headlines starting+ at level 0.+ + Fix cite parsing behaviour (Herwig Stuetz). Until now, `org-ref`+ cite keys included special characters also at the end. This caused+ problems when citations occur right before colons or at the end of+ a sentence. With this change, all non alphanumeric characters at+ the end of a cite key are ignored. This also adds `,` to the list+ of special characters that are legal in cite keys to better mirror+ the behaviour of org-export.+ + Fix module names in haddock comments. Copy-pasting had lead to+ haddock module descriptions containing the wrong module names.+ + Recognize babel result blocks with attributes (#3706). Babel+ result blocks can have block attributes like captions and names.+ Result blocks with attributes were not recognized and were parsed+ as normal blocks without attributes.+ + Include tags in headlines. The Emacs default is to include tags in the+ headline when exporting. Instead of just empty spans, which contain the+ tag name as attribute, tags are rendered as small caps and wrapped in+ those spans. Non-breaking spaces serve as separators for multiple tags.+ + Respect export option for tags (#3713). Tags are appended to+ headlines by default, but will be omitted when the `tags` export option+ is set to nil.+ + Use `tag-name` attribute instead of `data-tag-name`.+ + Use `org-language` attribute rather than `data-org-language`.+ + Modified state type to be an instance of `HasLogMessages`, so+ `registerHeader` can issue warnings.+ + End footnotes after two blank lines. Footnotes can not only be+ terminated by the start of a new footnote or a header, but also by two+ consecutive blank lines.+ + Update emphasis border chars (#3933). The org reader was updated to+ match current org-mode behavior: the set of characters which are+ acceptable to occur as the first or last character in an org emphasis+ have been changed and now allows all non-whitespace chars at the+ inner border of emphasized text (see `org-emphasis-regexp-components`).++ * RST reader:++ + Fixed small bug in list parsing (#3432). Previously the parser didn't+ handle properly this case:++ * - a+ - b+ * - c+ - d+ + Handle multiline cells in simple tables (#1166).+ + Parse list table directive (Keiichiro Shikano, #3432).+ + Make use of `anyLineNewline` (Alexander Krotov, #3686).+ + Use `anyLineNewline` in `rawListItem` (Alexander Krotov, #3702).+ + Reorganize block parsers for ~20% faster parsing.+ + Fixed `..include::` directive (#3880).+ + Handle blank lines correctly in line blocks (Alexander Krotov, #3881).+ Previously pandoc would sometimes combine two line blocks separated+ by blanks, and ignore trailing blank lines within the line block.+ + Fix indirect hyperlink targets (#512).++ * Markdown reader:++ + Allow attributes in reference links to start on next line (#3674).+ + Parse YAML metadata in a context that sees footnotes defined in+ the body of the document (#1279).+ + When splitting pipe table cells, skip tex math (#3481).+ You might have a `|` character inside math. (Or for that matter+ something that the parser might mistake for raw HTML.)+ + Treat span with class `smallcaps` as SmallCaps.+ This allows users to specify small caps in Markdown this way:+ `[my text]{.smallcaps}` (#1592).+ + Fixed internal header links (#2397).+ This patch also adds `shortcut_reference_links` to the list+ of mmd extensions.+ + Treat certain environments as inline+ when they occur without space surrounding them (#3309, #2171).+ E.g. equation, math. This avoids incorrect vertical space+ around equations.+ + Optimized `nonindentSpaces`. Makes the benchmark go from 40 to 36 ms.+ + Allow latex macro definitions indented 1-3 spaces.+ Previously they only worked if nonindented.+ + Improved parsing of indented raw HTML blocks (#1841).+ Previously we inadvertently interpreted indented HTML as+ code blocks. This was a regression. We now seek to determine the+ indentation level of the contents of an HTML block, and (optionally)+ skip that much indentation. As a side effect, indentation may be+ stripped off of raw HTML blocks, if `markdown_in_html_blocks` is+ used. This is better than having things interpreted as indented+ code blocks.+ + Fixed smart quotes after emphasis (#2228). E.g. in `*foo*'s 'foo'`.+ + Warn for notes defined but not used (#1718).+ + Use `anyLineNewline` (Alexander Krotov).+ + Interpret YAML metadata as Inlines when possible (#3755). If+ the metadata field is all on one line, we try to interpret it as+ Inlines, and only try parsing as Blocks if that fails. If it+ extends over one line (including possibly the `|` or `>` character+ signaling an indented block), then we parse as Blocks. This was+ motivated by some German users finding that `date: '22. Juin 2017'`+ got parsed as an ordered list.+ + Fixed spurious parsing as citation as reference def (#3840).+ We now disallow reference keys starting with `@` if the+ `citations` extension is enabled.+ + Parse `-@roe` as suppress-author citation (pandoc-citeproc#237).+ Previously only `[-@roe]` (with brackets) was recognized as+ suppress-author, and `-@roe` was treated the same as `@roe`.+ + Fixed parsing of fenced code after list when there is no intervening+ blank line (#3733).+ + Allow raw latex commands starting with `\start` (#3558). Previously+ these weren't allowed because they were interpreted as starting+ ConTeXt environments, even without a corresponding `\stop`...+ + Added `inlines`, `inlines1`.+ + Require nonempty alt text for `implicit_figures` (#2844).+ A figure with an empty caption doesn't make sense.+ + Removed texmath macro material; now all this is handled+ in the LaTeX reader functions.+ + Fixed bug with indented code following raw LaTeX (#3947).++ * LaTeX reader:++ + Rewrote LaTeX reader with proper tokenization (#1390,+ #2118, #3236, #3779, #934, #982). This rewrite is primarily+ motivated by the need to get macros working properly. A side benefit+ is that the reader is significantly faster. We now tokenize the+ input text, then parse the token stream. Macros modify the token+ stream, so they should now be effective in any context, including+ math. Thus, we no longer need the clunky macro processing+ capacities of texmath.+ + Parse `\,` to `\8198` (six-per-em space) (Henri Werth).+ + Allow `\newcommand\foo{blah}` without braces.+ + Support `\lstinputlisting` (#2116).+ + Issue warnings when skipping unknown latex commands (#3392).+ + Include contents of `\parbox`.+ + Allow `\hspace` and `\vspace` to count as raw block or inline.+ Previously we would refuse to parse anything as raw inline if+ it was in the `blockCommands` list. Now we allow exceptions+ if they're listed under ignoreInlines in inlineCommands.+ This should make it easier e.g. to include an `\hspace`+ between two side-by-side raw LaTeX tables.+ + Don't drop contents of `\hypertarget`.+ + Handle spaces before `\cite` arguments.+ + Allow newpage, clearpage, pagebreak in inline contexts as well as+ block contexts (#3494).+ + Treat `{{xxx}}` the same as `{xxx}` (#2115).+ + Use `pMacroDefinition` in macro (for more direct parsing).+ Note that this means that `macro` will now parse one+ macro at a time, rather than parsing a whole group together.+ + Fixed failures on `\ref{}`, `\label{}` with `+raw_tex`. Now these+ commands are parsed as raw if `+raw_tex`; otherwise, their argument+ is parsed as a bracketed string.+ + Don't crash on empty `enumerate` environment (#3707).+ + Handle escaped `&` inside table cell (#3708).+ + Handle block structure inside table cells (#3709). `minipage` is no+ longer required.+ + Handle some width specifiers on table columns (#3709). Currently+ we only handle the form `0.9\linewidth`. Anything else would have+ to be converted to a percentage, using some kind arbitrary assumptions+ about line widths.+ + Make sure `\write18` is parsed as raw LaTeX. The change is in the+ LaTeX reader's treatment of raw commands, but it also affects the+ Markdown reader.+ + Fixed regression with starred environment names (#3803).+ + Handle optional args in raw `\titleformat` (#3804).+ + Improved heuristic for raw block/inline. An unknown command at the+ beginning of the line that could be either block or inline is+ treated as block if we have a sequence of block commands followed by+ a newline or a `\startXXX` command (which might start a raw ConTeXt+ environment).+ + Don't remove macro definitions from the output, even if+ `Ext_latex_macros` is set, so that macros will be applied.+ Since they're only applied to math in Markdown, removing the macros+ can have bad effects. Even for math macros, keeping them should be+ harmless.+ + Removed `macro`. It is no longer necessary, since the+ `rawLaTeXBlock` parser will parse macro definitions. This also avoids+ the need for a separate `latexMacro` parser in the Markdown reader.+ + Use `label` instead of `data-label` for label in caption (#3639).+ + Fixed space after `\figurename` etc.+ + Resolve references to section numbers.+ + Fix `\let\a=0` case, with single character token.+ + Allow `@` as a letter in control sequences. `@` is commonly used+ in macros using `\makeatletter`. Ideally we'd make the tokenizer+ sensitive to `\makeatletter` and `\makeatother`, but until then this+ seems a good change.+ + Track header numbers and correlate with labels.+ + Allow `]` inside group in option brackets (#3857).+ + lstinline with braces can be used (verb cannot be used with braces)+ (Marc Schreiber, #3535).+ + Fix keyval function: pandoc did not parse options in braces correctly+ (Marc Schreiber, #3642).+ + When parsing raw LaTeX commands, include trailing space (#1773).+ Otherwise things like `\noindent foo` break and turn into+ `\noindentfoo`. Affects `-f latex+raw_tex` and `-f markdown` (and other+ formats that allow `raw_tex`).+ + Don't treat "..." as Quoted (#3958). This caused quotes to be omitted in+ `\texttt` contexts.+ + Add tests for existing `\includegraphics` behaviour (Ben Firshman).+ + Allow space before `=` in bracketd options (Ben Firshman).+ + Be more forgiving in parsing command options. This was needed, for+ example, to make some minted options work.+ + Strip off quotes in `\include` filenames.++ * Added `Text.Pandoc.CSV`, simple (unexported) CSV parser.++ * `Text.Pandoc.PDF`:++ + Got `--resource-path` working with PDF output (#852).+ + Fetch images when generating PDF via context (#3380).+ To do this, we create the temp directory as a subdirectory+ of the working directory. Since context mk IV by default looks+ for images in the parent directory, this works.+ + Use `report` instead of `warn`, make it sensitive to verbosity settings.+ + Use `fillMediaBag` and `extractMedia` to extract media to temp dir.+ This reduces code duplication.+ + `html2pdf`: use stdin instead of intermediate HTML file+ + Removed useless `TEXINPUTS` stuff for `context2pdf`. mkiv context+ doesn't use `TEXINPUTS`.++ * `Text.Pandoc.Pretty`:++ + Simplified definition of `realLength`.+ + Don't error for blocks of size < 1. Instead, resize to 1 (see #1785).++ * `Text.Pandoc.MIME`:++ + Use `application/javascript` (not `application/x-javascript`).+ + Added `emf` to mimeTypes with type `application/x-msmetafile` (#1713).++ * `Text.Pandoc.ImageSize`:++ + Improve SVG image size code (Marc Schreiber, #3580).+ + Make `imageSize` recognize basic SVG dimensions (Mauro Bieg, #3462).++ * Use `Control.Monad.State.Strict` throughout. This gives 20-30% speedup+ and reduction of memory usage in most of the writers.++ * Use `foldrWithKey` instead of deprecated `foldWithKey`.++ * `Text.Pandoc.SelfContained`:++ + Fixed problem with embedded fonts (#3629).+ + Refactored getData from `getDataURI` in `SelfContained`.+ + Don't use data URIs for script or style (#3423). Instead, just use+ script or style tags with the content inside. The old method with+ data URIs prevents certain optimizations outside pandoc. Exception:+ data URIs are still used when a script contains `</script>` or a+ style contains `</`.+ + SelfContained: Handle URL inside material retrieved from a URL+ (#3629). This can happen e.g. with an @import of a google web font.+ (What is imported is some CSS which contains an url reference+ to the font itself.) Also, allow unescaped pipe (|) in URL.+ + Load resources from `data-src` (needed for lazy loading in+ reveal.js slide shows).+ + Handle `data-background-image` attribute on section (#3979).++ * `Text.Pandoc.Parsing`:++ + Added `indentWith` (Alexander Krotov, #3687).+ + Added `stateCitations` to `ParserState`.+ + Removed `stateChapters` from `ParserState`.+ + In `ParserState`, make `stateNotes'` a Map, add `stateNoteRefs`.+ + Added `gobbleSpaces` and `gobbleAtMostSpaces`.+ + Adjusted type of `insertIncludedFile` so it can be used with token+ parser.+ + Replace old texmath macro stuff from Parsing. Use Macro from+ Text.Pandoc.Readers.LaTeX.Types instead.+ + Export `insertIncludedFile`.+ + Added `HasLogMessages`, `logMessage`, `reportLogMessages` (#3447).+ + Replace partial with total function (Albert Krewinkel).+ + Introduce `HasIncludeFiles` type class (Albert Krewinkel). The+ `insertIncludeFile` function is generalized to work with all parser+ states which are instances of that class.+ + Add `insertIncludedFilesF` which returns F blocks (Albert Krewinkel).+ The `insertIncludeFiles` function was generalized and renamed+ to `insertIncludedFiles'`; the specialized versions are based on that.+ + `many1Till`: Check for the end condition before parsing (Herwig+ Stuetz). By not checking for the end condition before the first+ parse, the parser was applied too often, consuming too much of the+ input. This only affects `many1Till p end` where `p` matches on a+ prefix of `end`.+ + Provide `parseFromString` (#3690). This is a version of+ `parseFromString` specialied to ParserState, which resets+ `stateLastStrPos` at the end. This is almost always what we want.+ This fixes a bug where `_hi_` wasn't treated as emphasis in the+ following, because pandoc got confused about the position of the+ last word: `- [o] _hi_`.+ + Added `takeP`, `takeWhileP` for efficient parsing of `[Char]`.+ + Fix `blanklines` documentation (Alexander Krotov, #3843).+ + Give less misleading line information with `parseWithString`.+ Previously positions would be reported past the end of the chunk.+ We now reset the source position within the chunk and report+ positions "in chunk."+ + Add `anyLineNewline` (Alexander Krotov).+ + Provide shared F monad functions for Markdown and Org readers+ (Albert Krewinkel). The `F` monads used for delayed evaluation+ of certain values in the Markdown and Org readers are based on a+ shared data type capturing the common pattern of both `F` types.+ + Add `returnF` (Alexander Krotov).+ + Avoid parsing `Notes:**` as a bare URI (#3570). This avoids parsing+ bare URIs that start with a scheme + colon + `*`, `_`, or `]`.+ + Added `readerAbbreviations` to `ParserState`. Markdown reader+ now consults this to determine what is an abbreviation.+ + Combine grid table parsers (Albert Krewinkel, #3638). The grid table+ parsers for markdown and rst was combined into one single+ parser `gridTable`, slightly changing parsing behavior of both+ parsers: (1) The markdown parser now compactifies block content+ cell-wise: pure text blocks in cells are now treated as paragraphs+ only if the cell contains multiple paragraphs, and as plain blocks+ otherwise. Before, this was true only for single-column tables. (2)+ The rst parser now accepts newlines and multiple blocks in header+ cells.+ + Generalize tableWith, gridTableWith (Albert Krewinkel).+ The parsing functions `tableWith` and `gridTableWith` are generalized+ to work with more parsers. The parser state only has to be an+ instance of the `HasOptions` class instead of requiring a concrete+ type. Block parsers are required to return blocks wrapped into a+ monad, as this makes it possible to use parsers returning results+ wrapped in `Future`s.++ * `Text.Pandoc.Shared`:++ + Simplify `toRomanNumeral` using guards (Alexander Krotov, #3445)+ + `stringify`: handle Quoted better (#3958). Previously we were losing+ the quotation marks in Quoted elements.++ * `Text.Pandoc.Writers.Shared`:++ + Export `metaToJSON'`, `addVariablesToJSON` (#3439).+ This allows us to add the variables AFTER using the metadata+ to generate a YAML header (in the Markdown writer).+ + Added `unsmartify` (previously in RST writer).+ Undo literal double curly quotes. Previously we left these.+ + Generalize type of `metaToJSON` so it can take a Text. Previously a+ String was needed as argument; now any ToJSON instance will do.+ + Added `gridTable` (previously in Markdown writer).+ + `gridTable`: Refactored to use widths in chars.+ + `gridTable`: remove unnecessary extra space in cells.+ + Fixed `addVariablesToJSON`. It was previously not allowing multiple+ values to become lists.+ + Pipe tables: impose minimum cell size (see #3526).+++### Default template changes++ * HTML templates (including EPUB and HTML slide show templates):++ + Make default.html5 polyglot markup conformant (John Luke Bentley,+ #3473). Polyglot markup is HTML5 that is also valid XHTML. See+ <https://www.w3.org/TR/html-polyglot>. With this change, pandoc's+ html5 writer creates HTML that is both valid HTML5 and valid XHTML.+ + Regularized CSS in html/epub/html slide templates (#3485).+ All templates now include `code{white-space: pre-wrap}`+ and CSS for `q` if `--html-q-tags` is used. Previously some templates+ had `pre` and others `pre-wrap`; the `q` styles were only sometimes+ included.+ + CSS for `.smallcaps`, (Mauro Bieg, #1592)+ + `default.revealjs`: make `history` default to true.+ + `default.revealjs`: use lazy loading (#2283).+ + `default.revealjs`: add `mathjax` variable and some conditional code+ to use the MathJaX plugin.+ + `default.slidy` uses `https` instead of `http` (ickc, #3848).+ + `default.dzslides`: Load Google Font using HTTPS by default+ (Yoan Blanc).++ * DocBook5 template: Use `lang` and `subtitle` variables (Jens Getreu,+ #3855).++ * LaTeX/Beamer template:++ + Combine LaTeX/Beamer templates (Andrew Dunning, #3878).+ `default.beamer` has been removed; beamer now uses the+ `default.latex` template. Beamer-specific parts are conditional+ on the `beamer` variable set by the writer. Note that+ `pandoc -D beamer` will return this (combined) template.+ + Use `xcolor` for `colorlinks` option (Andrew Dunning, #3877).+ Beamer loads `xcolor` rather than `color`, and thus the+ `dvipsnames` option doesn't take effect. This also provides a wider+ range of colour selections with the `svgnames` option.+ + Use starred versions of `xcolor` names (Andrew Dunning).+ Prevents changes to documents defined using the `dvipsnames` list (e.g.+ `Blue` gives a different result with svgnames enabled).+ + Load `polyglossia` after header-includes (#3898). It needs to be+ loaded as late as possible.+ + Use `unicode-math` (Vaclav Haisman). Use `mathspec` with only+ XeLaTeX on request.+ + Don't load `fontspec` before `unicode-math` (over there).+ The `unicode-math` package loads `fontspec` so explicit loading of+ `fontspec` before `unicode-math` is not necessary.+ + Use `unicode-math` by default in default.latex template. mathspec will+ be used in xelatex if the `mathspec` variable is set; otherwise+ unicode-math will be used (Václav Haisman).+ + Use `dvipsnames` options when `colorlinks` specified (otherwise+ we get an error for `maroon`) (Thomas Hodgson).+ + Added beamer `titlegraphic` and `logo` variables (Thomas Hodgson).+ + Fix typo in fix for notes in tables (#2378, zeeMonkeez).+ + Fix `hyperref` options clash (Andrew Dunning, #3847) Avoids an options+ clash when loading a package (e.g. `tufte-latex`) that uses+ `hyperref` settings different from those in the template.+ + Add `natbiboptions` variable (#3768).+ + Fix links inside captions in LaTeX output with links-as-notes+ (Václav Haisman, #3651). Declare our redefined `\href` robust.+ + Load `parskip` before `hyperref` (Václav Haisman, #3654).+ + Allow setting Japanese fonts when using LuaLaTeX (Václav Haisman,+ #3873). by using the `luatexja-fontspec` and `luatexja-preset`+ packages. Use existing `CJKmainfont` and `CJKoptions` template+ variables. Add `luatexjafontspecoptions` for `luatexja-fontspec`+ and `luatexjapresetoptions` for `luatexja-preset`.+ + Added `aspectratio` variable to beamer template (Václav Haisman,+ #3723).+ + Modified template.latex to fix XeLaTex being used with tables+ (lwolfsonkin, #3661). Reordered `lang` variable handling to+ immediately before `bidi`.++ * ConTeXt template: Improved font handling: `simplefonts` is now+ obsolete in ConTeXt (Pablo Rodríguez).+++### Documentation improvements++ * MANUAL.txt:++ + Add URL for Prince HTML > PDF engine (Ian, #3919).+ + Document that content above slide-level will be omitted in+ slide shows. See #3460, #2265.+ + Explain `--webtex` SVG url (Mauro Bieg, #3471)+ + Small clarification in YAML metadata section.+ + Document that html4 is technically XHTML 1.0 transitional.+ + Remove refs to highlighting-kate (#3672).+ + Document ibooks specific epub metadata.+ + Clarify that mathml is used for ODT math.+ + Mention limitations of Literate Haskell Support (#3410,+ Joachim Breitner).+ + Add documentation of limitations of grid tables (Stephen+ McDowell, #3864).+ + Clarify that meta-json contains transformed values (Jakob Voß,+ #3491) Make clear that template variable `meta-json` does not+ contain plain text values or JSON output format but field values+ transformed to the selected output format.++ * COPYRIGHT:++ + Clarify that templates are dual-licensed.+ + Clarify that pandoc-types is BSD3 licensed.+ + List new files not written by jgm (Albert Krewinkel).+ + Update dates in copyright notices (Albert Krewinkel). This follows+ the suggestions given by the FSF for GPL licensed software.+ <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>++ * INSTALL.md:++ + Improved instructions for tests with patterns.+ + Put RPM-based distros on separate point (Mauro Bieg, #3449)++ * CONTRIBUTING.md:++ + Fixed typos (Wandmalfarbe, #3479).+ + Add "ask on pandoc-discuss" (Mauro Bieg).++ * Add lua filter documentation in `doc/lua-filters.md`. Note that the+ end of this document is autogenerated from `data/pandoc.lua`+ using `make doc/lua-filters.md`, which uses `tools/ldoc.ltp`+ (Albert Krewinkel).++ * Add `doc/filters.md`. This is the old scripting tutorial from+ the website.++ * Add `doc/using-the-pandoc-api.md` (#3289). This gives an introduction+ to using pandoc as a Haskell library.+++### Build infrastructure improvements++ * Removed `data/templates` submodule. Templates are now a subtree+ in `data/templates`. This removes the need to do `git submodule+ update`.++ * Renamed `tests` -> `test`.++ * Remove `https` flag. Always build with HTTPS support.++ * Use `file-embed` instead of `hsb2hs` to embed data files when+ `embed_data_files` flag is set. `file-embed` gives us better dependency+ tracking: if a data file changes, ghc/stack/cabal know to recompile+ the Data module. This also removes `hsb2hs` as a build dependency.++ * Add `custom-setup` stanza to pandoc, lowercase field names.++ * Add `static` Cabal flag.++ * Name change OSX -> MacOS. Add a -MacOS suffix to mac package rather+ than -OSX. Changed local names from osx to macos.++ * make_macos_package.sh - Use strip to reduce executable size.++ * Revised binary linux package. Now a completely static executable+ is created, using Docker and alpine. We create both a deb and a+ tarball. The old `deb` directory has been replaced with a `linux`+ directory. Running `make` in the `linux` directory should+ perform the build, putting the binary packages in `artifacts/`.++ * `linux/control.in`: add `Replaces:`, so existing pandoc-citeproc and+ pandoc-data packages will be uninstalled; this package provides+ both (#3822). Add latex packages as 'suggested', update+ description.++ * Remove cpphs build requirement -- it is no longer needed.++ * Replaced `{deb,macos,windows}/stack.yaml` with `stack.pkg.yaml`.++ * Name change OSX -> macOS (ickc, #3869).++ * Fix casing of Linux, UNIX, and Windows (ickc).++ * `.travis.yml`: create a source dist and do cabal build and test there.+ That way we catch errors due to files missing from the data+ section of pandoc.cabal.++ * Makefile:++ + Split `make haddock` from `make full`.+ + Add BRANCH variable for winpkg.+ + Add `lint` target.+ + Improve `make full`. Disable optimizations.+ Build everything, inc. trypandoc and benchmarks. Use parallel build.+ + Allow `make test` to take `TESTARGS`.++ * Added new command tests (`Tests.Command`), using small text files+ in `test/command/`. Any files added in this directory will be treated+ as shell tests (see smart.md for an example). This makes it very easy+ to add regression tests etc.++ * Test fixes so we can find data files. In old tests & command tests,+ we now set the environment variable `pandoc_datadir`. In lua tests,+ we set the datadir explicitly.++ * Refactored `compareOutput` in docx writer test.++ * Consolidated some common functions in `Tests.Helper`.++ * Small change to unbalanced bracket test to speed up test suite.++ * Speed up Native writer quickcheck tests.++ * Use tasty for tests rather than test-framework.++ * Add simple Emacs mode to help with Pandoc templates editing.+ (Václav Haisman, #3889). `tools/pandoc-template-mode.el`+++## pandoc 1.19.2.4 (2017-09-10)++ * Add dependencies on texmath and skylighting to the executable.+ This is needed for dependency version numbers to be available,+ with Cabal > 2.++## pandoc 1.19.2.3 (2017-09-09)++ * Add CPP to Setup.hs so it works with Cabal >= 2 and < 2.++## pandoc 1.19.2.2 (2017-09-08)++ * Fix build with GHC 8.2.1 (#3876, Peter Simons). Setup.hs does not+ compile with Cabal 2.x, so we require an earlier version via+ setup-depends. The following packages need newer versions with+ GHC 8.2.1 and had their constraints relaxed accordingly:+ executable-path, process, syb, and time.++## pandoc 1.19.2.1 (2017-01-31)++ * Require skylighting >= 0.1.1.4.+ * Adjust test output for skylighting version.+ * Relax upper bounds on blaze-html and blaze-markup.++## pandoc 1.19.2 (2017-01-29)++ * Use skylighting library instead of highlighting-kate for syntax+ highlighting. Skylighting is faster and more accurate (#3363).+ Later we'll be able to add features like warning messages, dynamic+ loading of xml syntax definitions, and dynamic loading of themes.++ * Added a new highlight style, `breezeDark`.++ * Text.Pandoc.Highlighting: Update list of `listings` languages (#3374).+ This allows more languages to be used when using the `--listings`+ option.++ * OpenDocument writer:++ + Small refactoring. Removed separate 'parent' parameter in paraStyle.+ + Don't profilerate text styles unnecessarily (#3371).+ This change makes the writer create only as many temporary+ text styles as are absolutely necessary. It also consolidates+ adjacent nodes with the same style.++ * Org reader (Albert Krewinkel):++ + Allow short hand for single-line raw blocks (Albert Krewinkel,+ #3366). Single-line raw blocks can be given via `#+FORMAT: raw line`,+ where `FORMAT` must be one of `latex`, `beamer`, `html`, or `texinfo`.+ + Accept org-ref citations followed by commas (Albert Krewinkel).+ Bugfix for an issue which, whenever the citation was immediately+ followed by a comma, prevented correct parsing of org-ref citations.+ + Ensure emphasis markup can be nested. Nested emphasis markup (e.g.+ `/*strong and emphasized*/`) was interpreted incorrectly in that the+ inner markup was not recognized.+ + Remove pipe char irking the haddock coverage tool (Albert Krewinkel).++ * Docx reader: Empty header should be list of lists (Jesse Rosenthal).+ In the past, the docx reader wrote an empty header as an empty list. It+ should have the same width as a row (and be filled with empty cells).++ * MediaWiki reader:++ + Improved handling of display math (#3362). Sometimes display math is+ indented with more than one colon. Previously we handled these cases+ badly, generating definition lists and missing the math.+ + Fix quotation mark parsing (#3336, tgkokk). Change MediaWiki reader's+ behavior when the smart option is parsed to match other readers'+ behavior.++ * Markdown reader:++ + Fixed `-f markdown_github-hard_line_breaks+escaped_line_breaks`+ (#3341). Previously this did not properly enable escaped line breaks.+ + Disallow space between inline code and attributes (#3326, #3323,+ Mauro Bieg).++ * DocBook5 writer: make id attribute xml:id, fixes #3329 (#3330, Mauro Bieg).++ * Added some test cases for ODT reader (#3306, #3308, Hubert Plociniczak).++ * LaTeX writer: allow tables with empty cells to count as "plain."+ This addresses a problem of too-wide tables when empty cells+ are used. Thanks to Joost Kremers for reporting the issue.++ * Org writer: prefix footnote numbers with `fn:` (Albert Krewinkel).+ Unprefixed numbers where used by older org-mode versions, but are no+ longer supported.++ * HTML writer: don't process pars with empty RawInline, (#1040, #3327,+ Mauro Bieg).++ * Markdown writer: Fix display math with `--webtex` (#3298).++ * Fix sample.lua so it properly handles raw blocks/inlines (#3358,+ bumper314).++ * Templates:++ + default.latex: Moved geometry after hyperref (Václav Haisman).+ Otherwise PDF sizes can be wrong in some circumstances.+ + Copied a few changes from default.latex to default.beamer+ (Wandmalfarbe).+ + default.latex, default.beamer: Changed position of `\VerbatimNotes`+ and `fancyvrb`. This fixes hyperlinks on footnotes in documents+ that contain verbatim in notes (#3361). (Note: the beamer template+ was updated to match the LaTeX template, but at this point verbatim+ in notes seems not to work in beamer.)+ + default.latex: Allow passing `microtypeoptions` to microtype+ (Václav Haisman).+ + default.latex: Add hyphen option to url package.+ + default.docbook5: Fix namespace declarations (Mauro Bieg).++ * Moved `make_osx_package.sh` to `osx/` directory.++ * Travis continuous integration:++ + Fix false positives with dist build.+ + Speed improvements (Kolen Cheung, #3304, #3357).++ * MANUAL.txt:++ + Clarify that blank space is needed around footnotes (#3352).+ + Fixed typo (#3351, Alexey Rogechev).+ + Note that `--wrap=auto` does not work in HTML output.+ + Default `--columns` width is 72, not 80.+ + Fixed broken links (#3316, Kolen Cheung).+ + Document usage of `@*` in nocite section (#3333, John Muccigrosso).++ * INSTALL.md:++ + Indent code so it's properly formatted (#3335, Bheesham Persaud).+ + Added instructions for extracting binary from OSX, Windows packages.++ * CONTRIBUTING.md: Describe labels currently used in issue tracker+ (Albert Krewinkel). The labels have changed over time, the list of+ labels is updated to reflect the current set of labels used in the+ issue tracker.++ * Rearrange and extend badges in README (Albert Krewinkel, #3354)++ * Bumped version bounds for dependencies.+++## pandoc 1.19.1 (2016-12-10)++ * Set `PANDOC_VERSION` environment variable for filters (#2640).+ This allows filters to check the pandoc version that produced+ the JSON they are receiving.++ * Docx reader: Ensure one-row tables don't have header (#3285,+ Jesse Rosenthal). Tables in MS Word are set by default to have+ special first-row formatting, which pandoc uses to determine whether+ or not they have a header. This means that one-row tables will, by+ default, have only a header -- which we imagine is not what people+ want. This change ensures that a one-row table is not understood to+ be a header only. Note that this means that it is impossible to+ produce a header-only table from docx, even though it is legal+ pandoc. But we believe that in nearly all cases, it will be an+ accidental (and unwelcome) result++ * HTML reader:++ + Fixed some bad regressions in HTML table parser (#3280).+ This regression leads to the introduction of empty rows+ in some circumstances.+ + Understand `style=width:` as well as `width` in `col` (#3286).++ * RST reader:++ + Print warnings when keys, substitition, notes not found.+ Previously the parsers failed and we got raw text. Now we get a+ link with an empty URL, or empty inlines in the case of a note or+ substitution.++ + Fix hyperlink aliases (#3283).++ * Man writer: Ensure that periods are escaped at beginning of line+ (#3270).++ * LaTeX writer: Fix unnumbered headers when used with `--top-level`+ (#3272, Albert Krewinkel). Fix interaction of top-level+ divisions `part` or `chapter` with unnumbered headers when+ emitting LaTeX. Headers are ensured to be written using+ stared commands (like `\subsection*{}`).++ * LaTeX template: use comma not semicolon to separate keywords for+ `pdfkeywords`. Thanks to Wandmalfarbe.++ * Markdown writer: Fixed incorrect word wrapping (#3277).+ Previously pandoc would sometimes wrap lines too early due to+ this bug.++ * Text.Pandoc.Pretty: Added `afterBreak` [API change]. This makes it+ possible to insert escape codes for content that needs escaping at the+ beginning of a line.++ * Removed old MathMLInHTML.js from 2004, which should no longer+ be needed for MathML with modern browsers.++ * Fixed tests with dynamic linking (#2709).++ * Makefile: Use stack instead of cabal for targets. This is just+ a convenience for developers.++ * Fixed bash completion of filenames with space (#2749).++ * MANUAL: improved documentation on how to create a custom+ `reference.docx`.++ * Fix minor spelling typos in the manual (#3273, Anthony Geoghegan)++## pandoc 1.19 (2016-12-01)++ * Changed resolution of filter paths.++ + We now first treat the argument of `--filter` as a full (absolute+ or relative) path, looking for a program there. If it's found, we+ run it.+ + If not, and if it is a simple program name or a relative path, we+ try resolving it relative to `$DATADIR/filters`.+ + If this fails, then we treat it as a program name and look in the+ user's PATH.+ + Removed a hardcoded '/' that may have caused problems with+ Windows paths.++ Previously if you did `--filter foo` and you had `foo` in your path and+ also an executable `foo` in your working directory, the one in the path+ would be used. Now the one in the working directory is used.++ In addition, when you do `--filter foo/bar.hs`, pandoc will now find a+ filter `$DATADIR/filters/foo/bar.hs` -- assuming there isn't a+ `foo/bar.hs` relative to the working directory.++ * Allow `file://` URIs as arguments (#3196). Also improved default reader+ format detection. Previously with a URI ending in .md or .markdown,+ pandoc would assume HTML input. Now it treats these as markdown.++ * Allow to overwrite top-level division type heuristics (#3258,+ Albert Krewinkel). Pandoc uses heuristics to determine the most+ reasonable top-level division type when emitting LaTeX or+ Docbook markup. It is now possible to overwrite this implicitly set+ top-level division via the `top-level-division` command line parameter.++ * Text.Pandoc.Options \[API changes\]:++ + Removed `writerStandalone` field in `WriterOptions`, made+ `writerTemplate` a `Maybe` value. Previously setting+ `writerStandalone = True` did nothing unless a template was provided+ in writerTemplate. Now a fragment will be generated if+ `writerTemplate` is `Nothing`; otherwise, the specified template+ will be used and standalone output generated.+ + `Division` has been renamed `TopLevelDivision` (#3197). The+ `Section`, `Chapter`, and `Part` constructors were renamed to+ `TopLevelSection`, `TopLevelChapter`, and+ `TopLevelPart`, respectively. An additional `TopLevelDefault`+ constructor was added, which is now also the new default value of+ the `writerTopLevelDivision` field in `WriterOptions`.++ * Improved error if they give wrong arg to `--top-level-division`.++ * Use new module from texmath to lookup MS font codepoints in Docx reader.+ Removed unexported module Text.Pandoc.Readers.Docx.Fonts. Its code now+ lives in texmath (0.9).++ * DocBook reader: Fixed xref lookup (#3243). It previously only worked+ when the qnames lacked the docbook namespace URI.++ * HTML reader:++ + Improved table parsing (#3027). We now check explicitly for non-1+ rowspan or colspan attributes, and fail when we encounter them.+ Previously we checked that each row had the same number of cells,+ but that could be true even with rowspans/colspans. And there are+ cases where it isn't true in tables that we can handle fine -- e.g.+ when a tr element is empty. So now we just pad rows with empty cells+ when needed.+ + Treat `<math>` as MathML by default unless something else is+ explicitly specified in xmlns. Provided it parses as MathML,+ of course. Also fixed default which should be to inline math if no+ display attribute is used.+ + Only treat "a" element as link if it has href (#3226). Otherwise+ treat as span.++ * Docx reader (Jesse Rosenthal):++ + Add a placeholder value for CHART. We wrap `[CHART]` in a+ `<span class="chart">`. Note that it maps to inlines because, in+ docx, anything in a drawing tag can be part of a larger paragraph.+ + Be more specific in parsing images We not only want `w:drawing`,+ because that could also include charts. Now we specify+ `w:drawing/pic:pic`. This shouldn't change behavior at all, but it's+ a first step toward allowing other sorts of drawing data as well.+ + Abstract out function to avoid code repetition.+ + Update tests for img title and alt (#3204).+ + Handle Alt text and titles in images. We use the "description" field+ as alt text and the "title" field as title. These can be accessed+ through the "Format Picture" dialog in Word.+ + Docx reader utils: handle empty namespace in `elemName`. Previously,+ if given an empty namespace `(elemName ns "" "foo")` `elemName`+ would output a QName with a `Just ""` namespace. This is never what+ we want. Now we output a `Nothing`. If someone *does* want a+ `Just ""` in the namespace, they can enter the QName+ value explicitly.++ * ODT reader/writer:++ + Inline code when text has a special style (Hubert Plociniczak). When+ a piece of text has a text `Source_Text` then we assume that this is+ a piece of the document that represents a code that needs to+ be inlined. Adapted the writer to also reflect that change.+ Previously it was just writing a 'preformatted' text using a+ non-distinguishable font style. Code blocks are still not recognized+ by the ODT reader. That's a separate issue.+ + Infer table's caption from the paragraph (#3224,+ Hubert Plociniczak). ODT's reader always put empty captions for the+ parsed tables. This commit++ 1. checks paragraphs that follow the table definition+ 2. treats specially a paragraph with a style named 'Table'+ 3. does some postprocessing of the paragraphs that combines tables+ followed immediately by captions++ The ODT writer used the `TableCaption` style for the caption+ paragraph. This commit follows the OpenOffice approach which allows+ for appending captions to table but uses a built-in style named+ `Table` instead of `TableCaption`. Users of a custom `reference.odt`+ should change the style's name from `TableCaption` to `Table`.++ * ODT reader: Infer tables' header props from rows (#3199,+ Hubert Plociniczak). ODT reader simply provided an empty header list+ which meant that the contents of the whole table, even if not empty, was+ simply ignored. While we still do not infer headers we at least have to+ provide default properties of columns.++ * Markdown reader:++ + Allow reference link labels starting with `@...` if `citations`+ extension disabled (#3209). Example: in++ \[link text\]\[@a\]++ `link text` isn't hyperlinked because `[@a]` is parsed as+ a citation. Previously this happened whether or not the `citations`+ extension was enabled. Now it happens only if the `citations`+ extension is enabled.+ + Allow alignments to be specified in Markdown grid tables. For+ example,++ +-------+---------------+--------------------++ | Right | Left | Centered |+ +=========:+:=================+:=============:++ | Bananas | $1.34 | built-in wrapper |+ +-------+---------------+--------------------+++ + Allow Small Caps elements to be created using bracketed spans (as+ they already can be using HTML-syntax spans) (#3191, Kolen Cheung).++ * LaTeX reader:++ + Don't treat `\vspace` and `\hspace` as block commands (#3256).+ Fixed an error which came up, for example, with `\vspace` inside+ a caption. (Captions expect inlines.)+ + Improved table handling. We can now parse all of the tables emitted+ by pandoc in our tests. The only thing we don't get yet are+ alignments and column widths in more complex tables. See #2669.+ + Limited support for minipage.+ + Allow for `[]`s inside LaTeX optional args. Fixes cases like:+ + Handle BVerbatim from fancyvrb (#3203).+ + Handle hungarumlaut (#3201).+ + Allow beamer-style `<...>` options in raw LaTeX (also in Markdown)+ (#3184). This allows use of things like `\only<2,3>{my content}` in+ Markdown that is going to be converted to beamer.++ * Use pre-wrap for code in dzslides template (Nicolas Porcel). Otherwise+ overly long code will appear on every slide.++ * Org reader (Albert Krewinkel):++ + Respect column width settings (#3246). Table column properties can+ optionally specify a column's width with which it is displayed in+ the buffer. Some exporters, notably the ODT exporter in org-mode+ v9.0, use these values to calculate relative column widths. The org+ reader now implements the same behavior. Note that the org-mode+ LaTeX and HTML exporters in Emacs don't support this feature yet,+ which should be kept in mind by users who use the column+ widths parameters.+ + Allow HTML attribs on non-figure images (#3222). Images which are+ the only element in a paragraph can still be given HTML attributes,+ even if the image does not have a caption and is hence not a figure.+ The following will add set the `width` attribute of the image to+ `50%`:++ +ATTR\_HTML: :width 50%+ =======================++ \[\[file:image.jpg\]\]++ + Support `ATTR_HTML` for special blocks (#3182). Special+ blocks (i.e. blocks with unrecognized names) can be prefixed with an+ `ATTR_HTML` block attribute. The attributes defined in that+ meta-directive are added to the `Div` which is used to represent the+ special block.+ + Support the `todo` export option. The `todo` export option allows to+ toggle the inclusion of TODO keywords in the output. Setting this to+ `nil` causes TODO keywords to be dropped from headlines. The default+ is to include the keywords.+ + Add support for todo-markers. Headlines can have optional+ todo-markers which can be controlled via the `#+TODO`, `#+SEQ_TODO`,+ or `#+TYP_TODO` meta directive. Multiple such directives can be+ given, each adding a new set of recognized todo-markers. If no+ custom todo-markers are defined, the default `TODO` and `DONE`+ markers are used. Todo-markers are conceptually separate from+ headline text and are hence excluded when autogenerating+ headline IDs. The markers are rendered as spans and labelled with+ two classes: One class is the markers name, the other signals the+ todo-state of the marker (either `todo` or `done`).++ * LaTeX writer:++ + Use `\autocites*` when "suppress-author" citation used.+ + Ensure that simple tables have simple cells (#2666). If cells+ contain more than a single Plain or Para, then we need to set+ nonzero widths and put contents into minipages.+ + Remove invalid inlines in sections (#3218, Hubert Plociniczak).++ * Markdown writer:++ + Fix calculation of column widths for aligned multiline tables+ (#1911, Björn Peemöller). This also fixes excessive CPU and memory+ usage for tables when `--columns` is set in such a way that cells+ must be very tiny. Now cells are guaranteed to be big enough so that+ single words don't need to line break, even if this pushes the line+ length above the column width.+ + Use bracketed form for native spans when `bracketed_spans`+ enabled (#3229).+ + Fixed inconsistent spacing issue (#3232). Previously a tight bullet+ sublist got rendered with a blank line after, while a tight ordered+ sublist did not. Now we don't get the blank line in either case.+ + Fix escaping of spaces in super/subscript (#3225). Previously two+ backslashes were inserted, which gave a literal backslash.+ + Adjust widths in Markdown grid tables so that they match+ on round-trip.++ * Docx writer:++ + Give full detail when there are errors converting tex math.+ + Handle title text in images (Jesse Rosenthal). We already handled+ alt text. This just puts the image "title" into the docx+ "title" attr.+ + Fixed XML markup for empty cells (#3238). Previously the Compact+ style wasn't being applied properly to empty cells.++ * HTML writer:++ + Updated `renderHtml` import from blaze-html.++ * Text.Pandoc.Pretty:++ + Fixed some bugs that caused blank lines in tables (#3251). The bugs+ caused spurious blank lines in grid tables when we had things like+ `blankline $$ blankline`.+ + Add exported function `minOffet` \[API change\] (Björn Peemöller).+ + Added error message for illegal call to `block` (Björn Peemöller).++ * Text.Pandoc.Shared:++ + Put `warn` in MonadIO.+ + `fetchItem`: Better handling of protocol-relative URL (#2635). If+ URL starts with `//` and there is no "base URL" (as there would be+ if a URL were used on the command line), then default to http:.++ * Export Text.Pandoc.getDefaultExtensions \[API change\] (#3178).++ * In --version, trap error in `getAppUserDataDirectory` (#3241). This+ fixes a crash with `pandoc --version` on unusual systems with no real+ user (e.g. SQL Server 2016).++ * Added weigh-pandoc for memory usage diagnostics (#3169).++ * Use correct mime types for woff and woff2 (#3228).++ * Remove make\_travis\_yml.hs (#3235, Kolen Cheung).++ * changelog: Moved an item that was misplaced in the 1.17.2 section to the+ 1.18 section where it belongs.++ * CONTRIBUTING.md: minor change in wording and punctuation (#3252,+ Kolen Cheung).++ * Further revisions to manual for `--version` changes (#3244).++++## pandoc 1.18 (2016-10-26)++ * Added `--list-input-formats`, `--list-output-formats`,+ `--list-extensions`, `--list-highlight-languages`, and+ `--list-highlight-styles` (#3173). Removed list of highlighting+ languages from `--version` output. Removed list of input and output+ formats from default `--help` output.++ * Added `--reference-location=block|section|document` option+ (Jesse Rosenthal). This determines whether Markdown link references+ and footnotes are placed at the end of the document, the end of the+ section, or the end of the top-level block.++ * Added `--top-level-division=section|chapter|part` (Albert Krewinkel).+ This determines what a level-1 header corresponds to in LaTeX,+ ConTeXt, DocBook, and TEI output. The default is `section`.+ The `--chapters` option has been deprecated in favor of+ `--top-level-division=chapter`.++ * Added `LineBlock` constructor for `Block` (Albert Krewinkel). This+ is now used in parsing RST and Markdown line blocks, DocBook+ `linegroup`/`line` combinations, and Org-mode `VERSE` blocks.+ Previously `Para` blocks with hard linebreaks were used. `LineBlock`s+ are handled specially in the following output formats: AsciiDoc+ (as `[verse]` blocks), ConTeXt (`\startlines`/`\endlines`),+ HTML (`div` with a style), Markdown (line blocks if `line_blocks`+ is enabled), Org-mode (`VERSE` blocks), RST (line blocks). In+ other output formats, a paragraph with hard linebreaks is emitted.++ * Allow binary formats to be written to stdout (but not to tty) (#2677).+ Only works on posix, since we use the unix library to check whether+ output is to tty. On Windows, pandoc works as before and always requires+ an output file parameter for binary formats.++ * Changed JSON output format (Jesse Rosenthal). Previously we used+ generically generated JSON, but this was subject to change depending+ on the version of aeson pandoc was compiled with. To ensure stability,+ we switched to using manually written ToJSON and FromJSON+ instances, and encoding the API version. **Note:** pandoc filter+ libraries will need to be revised to handle the format change.+ Here is a summary of the essential changes:++ + The toplevel JSON format is now `{"pandoc-api-version" :+ [MAJ, MIN, REV], "meta" : META, "blocks": BLOCKS}`+ instead of `[{"unMeta": META}, [BLOCKS]]`.+ Decoding fails if the major and minor version numbers don't+ match.+ + Leaf nodes no longer have an empty array for their "c" value.+ Thus, for example, a `Space` is encoded as `{"t":"Space"}`+ rather than `{"t":"Space","c":[]}` as before.++ * Removed `tests/Tests/Arbitrary.hs` and added a `Text.Pandoc.Arbitrary`+ module to pandoc-types (Jesse Rosenthal). This makes it easier+ to use QuickCheck with pandoc types outside of pandoc itself.++ * Add `bracketed_spans` Markdown extension, enabled by default+ in pandoc `markdown`. This allows you to create a native span+ using this syntax: `[Here is my span]{#id .class key="val"}`.++ * Added `angle_brackets_escapable` Markdown extension (#2846).+ This is needed because github flavored Markdown has a slightly+ different set of escapable symbols than original Markdown;+ it includes angle brackets.++ * Export `Text.Pandoc.Error` in `Text.Pandoc` [API change].++ * Print highlighting-kate version in `--version`.++ * `Text.Pandoc.Options`:++ + `Extension` has new constructors `Ext_brackted_spans` and+ `Ext_angle_brackets_escapable` [API change].+ + Added `ReferenceLocation` type [API change] (Jesse Rosenthal).+ + Added `writerReferenceLocation` field to `WriterOptions` (Jesse+ Rosenthal).++ * `--filter`: we now check `$DATADIR/filters` for filters before+ looking in the path (#3127, Jesse Rosenthal, thanks to Jakob+ Voß for the idea). Filters placed in this directory need not+ be executable; if the extension is `.hs`, `.php`, `.pl`, `.js`,+ or `.rb`, pandoc will run the right interpreter.++ * For `--webtex`, replace deprecated Google Chart API by CodeCogs as+ default (Kolen Cheung).++ * Removed `raw_tex` extension from `markdown_mmd` defaults (Kolen Cheung).++ * Execute .js filters with node (Jakob Voß).++ * Textile reader:++ + Support `bc..` extended code blocks (#3037). Also, remove trailing+ newline in code blocks (consistently with Markdown reader).+ + Improve table parsing. We now handle cell and row attributes, mostly+ by skipping them. However, alignments are now handled properly.+ Since in pandoc alignment is per-column, not per-cell, we+ try to devine column alignments from cell alignments.+ Table captions are also now parsed, and textile indicators+ for thead and tfoot no longer cause parse failure. (However,+ a row designated as tfoot will just be a regular row in pandoc.)+ + Improve definition list parsing. We now allow multiple terms+ (which we concatenate with linebreaks). An exponential parsing+ bug (#3020) is also fixed.+ + Disallow empty URL in explicit link (#3036).++ * RST reader:++ + Use Div instead of BlockQuote for admonitions (#3031).+ The Div has class `admonition` and (if relevant) one of the+ following: `attention`, `caution`, `danger`, `error`, `hint`,+ `important`, `note`, `tip`, `warning`. **Note:** This will change+ the rendering of some RST documents! The word ("Warning", "Attention",+ etc.) is no longer added; that must be done with CSS or a filter.+ + A Div is now used for `sidebar` as well.+ + Skip whitespace before note (Jesse Rosenthal, #3163). RST requires a+ space before a footnote marker. We discard those spaces so that footnotes+ will be adjacent to the text that comes before it. This is in line with+ what rst2latex does.+ + Allow empty lines when parsing line blocks (Albert Krewinkel).++ * Markdown reader:++ + Allow empty lines when parsing line blocks (Albert Krewinkel).+ + Allow attributes on autolinks (#3183, Daniele D'Orazio).++ * LaTeX reader:++ + More robust parsing of unknown environments (#3026).+ We no longer fail on things like `^` inside options for tikz.+ + Be more forgiving of non-standard characters, e.g. `^` outside of math.+ Some custom environments give these a meaning, so we should try not to+ fall over when we encounter them.+ + Drop duplicate `*` in bibtexKeyChars (Albert Krewinkel)++ * MediaWiki reader:++ + Fix for unquoted attribute values in mediawiki tables (#3053).+ Previously an unquoted attribute value in a table row+ could cause parsing problems.+ + Improved treatment of verbatim constructions (#3055).+ Previously these yielded strings of alternating Code and Space+ elements; we now incorporate the spaces into the Code. Emphasis+ etc. is still possible inside these.+ + Properly interpret XML tags in pre environments (#3042). They are meant+ to be interpreted as literal text.++ * EPUB reader: don't add root path to data: URIs (#3150).+ Thanks to @lep for the bug report and patch.++ * Org reader (Albert Krewinkel):++ + Preserve indentation of verse lines (#3064). Leading spaces in verse+ lines are converted to non-breaking spaces, so indentation is preserved.+ + Ensure image sources are proper links. Image sources as those in plain+ images, image links, or figures, must be proper URIs or relative file+ paths to be recognized as images. This restriction is now enforced+ for all image sources. This also fixes the reader's usage of uncleaned+ image sources, leading to `file:` prefixes not being deleted from+ figure images. Thanks to @bsag for noticing this bug.+ + Trim verse lines properly (Albert Krewinkel).+ + Extract meta parsing code to module. Parsing of meta-data is well+ separable from other block parsing tasks. Moving into new module to+ get small files and clearly arranged code.+ + Read markup only for special meta keys. Most meta-keys should be read+ as normal string values, only a few are interpreted as marked-up text.+ + Allow multiple, comma-separated authors. Multiple authors can be+ specified in the `#+AUTHOR` meta line if they are given as a+ comma-separated list.+ + Give precedence to later meta lines. The last meta-line of any given+ type is the significant line. Previously the value of the first line+ was kept, even if more lines of the same type were encountered.+ + Read LaTeX_header as header-includes. LaTeX-specific header commands+ can be defined in `#+LaTeX_header` lines. They are parsed as+ format-specific inlines to ensure that they will only show up in LaTeX+ output.+ + Set documentclass meta from LaTeX_class.+ + Set classoption meta from LaTeX_class_options.+ + Read HTML_head as header-includes. HTML-specific head content can be+ defined in `#+HTML_head` lines. They are parsed as format-specific+ inlines to ensure that they will only show up in HTML output.+ + Respect `author` export option. The `author` option controls whether+ the author should be included in the final markup. Setting+ `#+OPTIONS: author:nil` will drop the author from the final meta-data+ output.+ + Respect `email` export option. The `email` option controls whether the+ email meta-field should be included in the final markup. Setting+ `#+OPTIONS: email:nil` will drop the email field from the final+ meta-data output.+ + Respect `creator` export option. The `creator` option controls whether+ the creator meta-field should be included in the final markup. Setting+ `#+OPTIONS: creator:nil` will drop the creator field from the final+ meta-data output. Org-mode recognizes the special value `comment` for+ this field, causing the creator to be included in a comment. This is+ difficult to translate to Pandoc internals and is hence interpreted the+ same as other truish values (i.e. the meta field is kept if it's+ present).+ + Respect unnumbered header property (#3095). Sections the `unnumbered`+ property should, as the name implies, be excluded from the automatic+ numbering of section provided by some output formats. The Pandoc+ convention for this is to add an "unnumbered" class to the header. The+ reader treats properties as key-value pairs per default, so a special+ case is added to translate the above property to a class instead.+ + Allow figure with empty caption (Albert Krewinkel, #3161).+ A `#+CAPTION` attribute before an image is enough to turn an image into+ a figure. This wasn't the case because the `parseFromString` function,+ which processes the caption value, would fail on empty values. Adding+ a newline character to the caption value fixes this.++ * Docx reader:++ + Use XML convenience functions (Jesse Rosenthal).+ The functions `isElem` and `elemName` (defined in Docx/Util.hs) make+ the code a lot cleaner than the original XML.Light functions, but they+ had been used inconsistently. This puts them in wherever applicable.+ + Handle anchor spans with content in headers. Previously, we would only+ be able to figure out internal links to a header in a docx if the+ anchor span was empty. We change that to read the inlines out of the+ first anchor span in a header.+ + Let headers use existing id. Previously we always generated an id for+ headers (since they wouldn't bring one from Docx). Now we let it use an+ existing one if possible. This should allow us to recurs through anchor+ spans.+ + Use all anchor spans for header ids. Previously we only used the first+ anchor span to affect header ids. This allows us to use all the anchor+ spans in a header, whether they're nested or not (#3088).+ + Test for nested anchor spans in header. This ensures that anchor spans+ in header with content (or with other anchor spans inside) will resolve+ to links to a header id properly.++ * ODT reader (Hubert Plociniczak)++ + Include list's starting value. Previously the starting value of+ the lists' items has been hardcoded to 1. In reality ODT's list+ style definition can provide a new starting value in one of its+ attributes.+ + Infer caption from the text following the image.+ Frame can contain other frames with the text boxes.+ + Add `fig:` to title for Image with a caption (as expected+ by pandoc's writers).+ + Basic support for images in ODT documents.+ + Don't duplicate text for anchors (#3143). When creating an anchor+ element we were adding its representation as well as the original+ content, leading to text duplication.++ * DocBook writer:++ + Include an anchor element when a div or span has an id (#3102).+ Note that DocBook does not have a class attribute, but at least this+ provides an anchor for internal links.++ * LaTeX writer:++ + Don't use * for unnumbered paragraph, subparagraph. The starred+ variants don't exist. This helps with part of #3058...it gets rid of+ the spurious `*`s. But we still have numbers on the 4th and 5th level+ headers.+ + Properly escape backticks in verbatim (#3121, Jesse Rosenthal).+ Otherwise they can cause unintended ligatures like `` ?` ``.+ + Handle NARRAOW NO-BREAK SPACE into LaTeX (Vaclav Zeman) as `\,`.+ + Don't include `[htbp]` placement for figures (#3103, Václav Haisman).+ This allows figure placement defaults to be changed by the user+ in the template.++ * TEI writer: remove heuristic to detect book template (Albert Krewinkel).+ TEI doesn't have `<book>` elements but only generic `<divN>` division+ elements. Checking the template for a trailing `</book>` is nonsensical.++ * MediaWiki writer: transform filename with underscores in images (#3052).+ `foo bar.jpg` becomes `foo_bar.jpg`. This was already done+ for internal links, but it also needs to happen for images.++ * ICML writer: replace partial function (!!) in table handling (#3175,+ Mauro Bieg).++ * Man writer: allow section numbers that are not a single digit (#3089).++ * AsciiDoc writer: avoid unnecessary use of "unconstrained" emphasis+ (#3068). In AsciiDoc, you must use a special form of emphasis+ (double `__`) for intraword emphasis. Pandoc was previously using+ this more than necessary.++ * EPUB writer: use stringify instead of plain writer for metadata+ (#3066). This means that underscores won't be used for emphasis,+ or CAPS for bold. The metadata fields will just have unadorned+ text.++ * Docx Writer:++ + Implement user-defined styles (Jesse Rosenthal). Divs and Spans+ with a `custom-style` key in the attributes will apply the corresponding+ key to the contained blocks or inlines.+ + Add ReaderT env to the docx writer (Jesse Rosenthal).+ + Clean up and streamline RTL behavior (Jesse Rosenthal, #3140).+ You can set `dir: rtl` in YAML metadata, or use `-M dir=rtl`+ on the command line. For finer-grained control, you can set+ the `dir` attribute in Div or Span elements.++ * Org writer (Albert Krewinkel):++ + Remove blank line after figure caption. Org-mode only treats an image+ as a figure if it is directly preceded by a caption.+ + Ensure blank line after figure. An Org-mode figure should be surrounded+ by blank lines. The figure would be recognized regardless, but images+ in the following line would unintentionally be treated as figures as+ well.+ + Ensure link targets are paths or URLs. Org-mode treats links as+ document internal searches unless the link target looks like a URL or+ file path, either relative or absolute. This change ensures that this+ is always the case.+ + Translate language identifiers. Pandoc and Org-mode use different+ programming language identifiers. An additional translation between+ those identifiers is added to avoid unexpected behavior. This fixes a+ problem where language specific source code would sometimes be output+ as example code.+ + Drop space before footnote markers (Albert Krewinkel, #3162).+ The writer no longer adds an extra space before footnote markers.++ * Markdown writer:++ + Don't emit HTML for tables unless `raw_html` extension is set (#3154).+ Emit `[TABLE]` if no suitable table formats are enabled and raw HTML+ is disabled.+ + Check for the `raw_html` extension before emitting a raw HTML block.+ + Abstract out note/ref function (Jesse Rosenthal).+ + Add ReaderT monad for environment variables (Jesse Rosenthal).++ * HTML, EPUB, slidy, revealjs templates: Use `<p>` instead of `<h1>` for+ subtitle, author, date (#3119). Note that, as a result of this change,+ authors may need to update CSS.++ * revealjs template: Added `notes-server` option+ (jgm/pandoc-templates#212, Yoan Blanc).++ * Beamer template:++ + Restore whitespace between paragraphs. This was+ a regression in the last release (jgm/pandoc-templates#207).+ + Added `themeoptions` variable (Carsten Gips).+ + Added `beamerarticle` variable. This causes the `beamerarticle`+ package to be loaded in beamer, to produce an article from beamer+ slides. (Carsten Gips)+ + Added support for `fontfamilies` structured variable+ (Artem Klevtsov).+ + Added hypersetup options (Jake Zimmerman).++ * LaTeX template:++ + Added dummy definition for `\institute`.+ This isn't a standard command, and we want to avoid a crash when+ `institute` is used with the default template.+ + Define default figure placement (Václav Haisman), since pandoc+ no longer includes `[htbp]` for figures. Users with custom templates+ will want to add this. See #3103.+ + Use footnote package to fix notes in tables (jgm/pandoc-templates#208,+ Václav Haisman).++ * Moved template compiling/rendering code to a separate library.+ `doctemplates`. This allows the pandoc templating system to be+ used independently.++ * Text.Pandoc.Error: Fix out of index error in `handleError`+ (Matthew Pickering). The fix is to not try to show the exact line when+ it would cause an out-of-bounds error as a result of included files.++ * Text.Pandoc.Shared: Add `linesToBlock` function (Albert Krewinkel).++ * Text.Pandoc.Parsing.emailAddress: tighten up parsing of email+ addresses. Technically `**@user` is a valid email address, but if we+ allow things like this, we get bad results in markdown flavors+ that autolink raw email addresses (see #2940). So we exclude a few+ valid email addresses in order to avoid these more common bad cases.++ * Text.Pandoc.PDF: Don't crash with nonexistent image (#3100). Instead,+ emit the alt text, emphasized. This accords with what the ODT writer+ currently does. The user will still get a warning about a nonexistent+ image.++ * Fix example in API documentation (#3176, Thomas Weißschuh).++ * Tell where to get tarball in INSTALL (#3062).++ * Rename README to MANUAL.txt and add GitHub-friendly README.md+ (Albert Krewinkel, Kolen Cheung).++ * Replace COPYING with Markdown version COPYING.md from GNU (Kolen Cheung).++ * MANUAL.txt:++ + Put note on structured vars in separate paragraph (#2148, Albert+ Krewinkel). Make it clearer that structured author variables require a+ custom template+ + Note that `--katex` works best with `html5` (#3077).+ + Fix the LaTeX and EPUB links in manual (Morton Fox).+ + Document `biblio-title` variable.++ * Improve spacing of footnotes in `--help` output (Waldir Pimenta).++ * Update KaTeX to v0.6.0 (Kolen Cheung).++ * Allow latest dependencies.++ * Use texmath 0.8.6.6 (#3040).++ * Allow http-client 0.4.30, which is the version in stackage lts.+ Previously we required 0.5.+ Remove CPP conditionals for earlier versions.++ * Remove support for GHC < 7.8 (Jesse Rosenthal).++ + Remove Compat.Monoid.+ + Remove an inline monad compatibility macro.+ + Remove Text.Pandoc.Compat.Except.+ + Remove directory compat.+ + Change constraint on mtl.+ + Remove unnecessary CPP condition in UTF8.+ + Bump base lower bound to 4.7.+ + Remove 7.6 build from .travis.yaml.+ + Bump supported ghc version in CONTRIBUTING.md.+ + Add note about GHC version support to INSTALL.+ + Remove GHC 7.6 from list of tested versions (Albert Krewinkel).+ + Remove TagSoup compat.+ + Add EOL note to time compat module. Because time 1.4 is a boot library+ for GHC 7.8, we will support the compatibility module as long as we+ support 7.8. But we should be clear about when we will no longer need+ it.+ + Remove blaze-html CPP conditional.+ + Remove unnecessary CPP in custom Prelude.++## pandoc 1.17.2 (2016-07-17)++ * Added Zim Wiki writer, template and tests. `zimwiki` is now+ a valid output format. (Alex Ivkin)++ * Changed email-obfuscation default to no obfuscation (#2988).+ + `writerEmailObfuscation` in `defaultWriterOptions` is now+ `NoObfuscation`.+ + the default for the command-line `--email-obfuscation` option is+ now `none`.++ * Docbook writer: Declare xlink namespace in Docbook5 output (Ivo Clarysse).++ * Org writer:++ + Support arbitrary raw inlines (Albert Krewinkel).+ Org mode allows arbitrary raw inlines ("export snippets" in Emacs+ parlance) to be included as `@@format:raw foreign format text@@`.+ + Improve Div handling (Albert Krewinkel). Div blocks handling is+ changed to make the output look more like idiomatic org mode:+ - Div-wrapped content is output as-is if the div's attribute is the+ null attribute.+ - Div containers with an id but neither classes nor key-value pairs+ are unwrapped and the id is added as an anchor.+ - Divs with classes associated with greater block elements are+ wrapped in a `#+BEGIN`...`#+END` block.+ - The old behavior for Divs with more complex attributes is kept.++ * HTML writer: Better support for raw LaTeX environments (#2758).+ Previously we just passed all raw TeX through when MathJax+ was used for HTML math. This passed through too much.+ With this patch, only raw LaTeX environments that MathJax+ can handle get passed through.+ This patch also causes raw LaTeX environments to be treated+ as math, when possible, with MathML and WebTeX output.++ * Markdown writer: use raw HTML for simple, pipe tables with linebreaks+ (#2993). Markdown line breaks involve a newline, and simple and pipe+ tables can't contain one.++ * Make --webtex work with the Markdown writer (#1177).+ This is a convenient option for people using+ websites whose Markdown flavors don't provide for math.++ * Docx writer:++ + Set paragraph to FirstPara after display math (Jesse Rosenthal).+ We treat display math like block quotes, and apply FirstParagraph style+ to paragraphs that follow them. These can be styled as the user+ wishes. (But, when the user is using indentation, this allows for+ paragraphs to continue after display math without indentation.)+ + Use actual creation time as doc prop (Jesse Rosenthal).+ Previously, we had used the user-supplied date, if available, for Word's+ document creation metadata. This could lead to weird results, as in+ cases where the user post-dates a document (so the modification might be+ prior to the creation). Here we use the actual computer time to set the+ document creation.++ * LaTeX writer:++ + Don't URI-escape image source (#2825). Usually this is a local file,+ and replacing spaces with `%20` ruins things.+ + Allow 'standout' as a beamer frame option (#3007).+ `## Slide title {.standout}`.++ * RST reader: Fixed links with no explicit link text. The link+ `` `<foo>`_ `` should have `foo` as both its link text and its URL.+ See RST spec at <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#embedded-uris-and-aliases>+ Closes Debian #828167 -- reported by Christian Heller.++ * Textile reader:++ + Fixed attributes (#2984). Attributes can't be followed by+ a space. So, `_(class)emph_` but `_(noclass) emph_`.+ + Fixed exponential parsing bug (#3020).+ + Fix overly aggressive interpretation as images (#2998).+ Spaces are not allowed in the image URL in textile.++ * LaTeX reader:++ + Fix `\cite` so it is a NormalCitation not AuthorInText.+ + Strip off double quotes around image source if present (#2825).+ Avoids interpreting these as part of the literal filename.++ * Org reader:++ + Add semicolon to list of special chars (Albert Krewinkel)+ Semicolons are used as special characters in citations syntax. This+ ensures the correct parsing of Pandoc-style citations: `[prefix; @key;+ suffix]`. Previously, parsing would have failed unless there was a space+ or other special character as the last <prefix> character.+ + Add support for "Berkeley-style" cites (Albert Krewinkel, #1978).+ A specification for an official Org-mode citation syntax was drafted by+ Richard Lawrence and enhanced with the help of others on the orgmode+ mailing list. Basic support for this citation style is added to the+ reader.+ + Support arbitrary raw inlines (Albert Krewinkel).+ Org mode allows arbitrary raw inlines ("export snippets" in Emacs+ parlance) to be included as `@@format:raw foreign format text@@`.+ + Remove partial functions (Albert Krewinkel, #2991).+ Partial functions like `head` lead to avoidable errors and should be+ avoided. They are replaced with total functions.+ + Support figure labels (Albert Krewinkel, #2496, #2999).+ Figure labels given as `#+LABEL: thelabel` are used as the ID of the+ respective image. This allows e.g. the LaTeX to add proper `\label`+ markup.+ + Improve tag and properties type safety (Albert Krewinkel).+ Specific newtype definitions are used to replace stringly typing of tags+ and properties. Type safety is increased while readability is improved.+ + Parse as headlines, convert to blocks (Albert Krewinkel).+ Emacs org-mode is based on outline-mode, which treats documents as trees+ with headlines are nodes. The reader is refactored to parse into a+ similar tree structure. This simplifies transformations acting on+ document (sub-)trees.+ * Refactor comment tree handling (Albert Krewinkel).+ Comment trees were handled after parsing, as pattern matching on lists+ is easier than matching on sequences. The new method of reading+ documents as trees allows for more elegant subtree removal.+ * Support archived trees export options (Albert Krewinkel).+ Handling of archived trees can be modified using the `arch` option.+ Archived trees are either dropped, exported completely, or collapsed to+ include just the header when the `arch` option is nil, non-nil, or+ `headline`, respectively.+ * Put export setting parser into module (Albert Krewinkel).+ Export option parsing is distinct enough from general block parsing to+ justify putting it into a separate module.+ * Support headline levels export setting (Albert Krewinkel).+ The depths of headlines can be modified using the `H` option. Deeper+ headlines will be converted to lists.+ * Replace ugly code with view pattern (Albert Krewinkel).+ Some less-than-smart code required a pragma switching of overlapping+ pattern warnings in order to compile seamlessly. Using view patterns+ makes the code easier to read and also doesn't require overlapping+ pattern checks to be disabled.+ * Fix parsing of verbatim inlines (Albert Krewinkel, #3016).+ Org rules for allowed characters before or after markup chars were not+ checked for verbatim text. This resultet in wrong parsing outcomes of+ if the verbatim text contained e.g. space enclosed markup characters as+ part of the text (`=is_substr = True=`). Forcing the parser to update+ the positions of allowed/forbidden markup border characters fixes this.++ * LaTeX template: fix for obscure hyperref/xelatex issue.+ Here's a minimal case:++ \documentclass[]{article}+ \usepackage{hyperref}+ \begin{document}+ \section{\%á}+ \end{document}++ Without this change, this fails on the second invocation of xelatex.+ This affects inputs this like `# %á` with pdf output via xelatex.++ * trypandoc: call results 'html' instead of 'result'.+ This is for better compatibility with babelmark2.++ * Document MultiMarkdown as input/output format (Albert Krewinkel, #2973).+ MultiMarkdown was only mentioned as a supported Markdown dialect but not+ as a possible input or output format. A brief mention is added+ everywhere the other supported markdown dialects are mentioned.++ * Document Org mode as a format containing raw HTML (Albert Krewinkel)+ Raw HTML is kept when the output format is Emacs Org mode.++ * Implement `RawInline` and `RawBlock` in sample lua custom writer (#2985).++ * Text.Pandoc.Shared:++ + Introduce blocksToInlines function (Jesse Rosenthal).+ This is a lossy function for converting `[Block] -> [Inline]`. Its main+ use, at the moment, is for docx comments, which can contain arbitrary+ blocks (except for footnotes), but which will be converted to spans.+ This is, at the moment, pretty useless for everything but the basic+ `Para` and `Plain` comments. It can be improved, but the docx reader+ should probably emit a warning if the comment contains more than this.+ + Add BlockQuote to blocksToInlines (Jesse Rosenthal).+ + Add further formats for `normalizeDate` (Jesse Rosenthal).+ We want to avoid illegal dates -- in particular years with greater than+ four digits. We attempt to parse series of digits first as `%Y%m%d`, then+ `%Y%m`, and finally `%Y`.+ + `normalizeDate` should reject illegal years (Jesse Rosenthal).+ We only allow years between 1601 and 9999, inclusive. The ISO 8601+ actually says that years are supposed to start with 1583, but MS Word+ only allows 1601-9999. This should stop corrupted word files if the date+ is out of that range, or is parsed incorrectly.+ + Improve year sanity check in normalizeDate (Jesse Rosenthal).+ Previously we parsed a list of dates, took the first one, and then+ tested its year range. That meant that if the first one failed, we+ returned nothing, regardless of what the others did. Now we test for+ sanity before running `msum` over the list of Maybe values. Anything+ failing the test will be Nothing, so will not be a candidate.++ * Docx reader:++ + Add simple comment functionality. (Jesse Rosenthal).+ This adds simple track-changes comment parsing to the docx reader. It is+ turned on with `--track-changes=all`. All comments are converted to+ inlines, which can list some information. In the future a warning will be+ added for comments with formatting that seems like it will be excessively+ denatured. Note that comments can extend across blocks. For that reason+ there are two spans: `comment-start` and `comment-end`. `comment-start`+ will contain the comment. `comment-end` will always be empty. The two+ will be associated by a numeric id.+ + Enable warnings in top-level reader (Jesse Rosenthal).+ Previously we had only allowed for warnings in the parser. Now we allow+ for them in the `Docx.hs` as well. The warnings are simply concatenated.+ + Add warning for advanced comment formatting. (Jesse Rosenthal).+ We can't guarantee we'll convert every comment correctly, though we'll+ do the best we can. This warns if the comment includes something other+ than Para or Plain.+ + Add tests for warnings. (Jesse Rosenthal).+ + Add tests for comments (Jesse Rosenthal).+ We test for comments, using all track-changes options. Note that we+ should only output comments if `--track-changes=all`. We also test for+ emitting warnings if there is complicated formatting.++ * README: update to include track-changes comments. (Jesse Rosenthal)++ * Improved Windows installer - don't ignore properties set on command-line.+ See #2708. Needs testing to see if this resolves the issue.+ Thanks to @nkalvi.++ * Process markdown extensions on command line in L->R order (#2995).+ Previously they were processed, very unintuitively, in R->L+ order, so that `markdown-tex_math_dollars+tex_math_dollars`+ had `tex_math_dollars` disabled.++ * Added `secnumdepth` variable to LaTeX template (#2920).++ * Include table of contents in README.html in Windows package.++ * Writers: treat SoftBreak as space for stripping (Jesse Rosenthal)+ In Writers.Shared, we strip leading and trailing spaces for display+ math. Since SoftBreak's are treated as spaces, we should strip those+ too.++ * beamer, latex templates: pass biblatexoptions directly in package load.+ This allows runtime optinos to be used. Fixes jgm/pandoc-citeproc#201++ * CPP workaround for deprecation of `parseUrl` in http-client.++ * Removed some redundant class constraints.++ * make_oxs_package.sh - use OSX env variable.++ * Added `winpkg` target to Makefile. This downloads the windows package+ from appveyor and signs it using the key.++ * Document Org mode as a format containing raw TeX (Albert Krewinkel).+ Raw TeX is kept verbatim when the output format is Emacs Org mode.++ * Support math with haddock-library >= 1.4.++ * Removed `-rtsopts` from library stanza. It has no effect, and Hackage+ wouldn't accept the package.++ * Update library dependency versions.++## pandoc 1.17.1 (2016-06-04)++ * New output format: `docbook5` (Ivo Clarysse).++ * `Text.Pandoc.Options`: Add `writerDocBook5` to `WriterOptions`+ (API change).++ * Org writer:++ + Add :PROPERTIES: drawer support (Albert Krewinkel, #1962).+ This allows header attributes to be added to org documents in the form+ of `:PROPERTIES:` drawers. All available attributes are stored as+ key/value pairs. This reflects the way the org reader handles+ `:PROPERTIES:` blocks.+ + Add drawer capability (Carlos Sosa). For the implementation of the+ Drawer element in the Org Writer, we make use of a generic Block+ container with attributes. The presence of a `drawer` class defines+ that the `Div` constructor is a drawer. The first class defines the+ drawer name to use. The key-value list in the attributes defines+ the keys to add inside the Drawer. Lastly, the list of Block elements+ contains miscellaneous blocks elements to add inside of the Drawer.+ + Use `CUSTOM_ID` in properties (Albert Krewinkel). The `ID` property is+ reserved for internal use by Org-mode and should not be used.+ The `CUSTOM_ID` property is to be used instead, it is converted to the+ `ID` property for certain export format.++ * LaTeX writer:++ + Ignore `--incremental` unless output format is beamer (#2843).+ + Fix polyglossia to babel env mapping (Mauro Bieg, #2728).+ Allow for optional argument in square brackets.+ + Recognize `la-x-classic` as Classical Latin (Andrew Dunning).+ This allows one to access the hyphenation patterns in CTAN's+ hyph-utf8.+ + Add missing languages from hyph-utf8 (Andrew Dunning).+ + Improve use of `\strut` with `\minipage` inside tables+ (Jose Luis Duran). This improves spacing in multiline+ tables.+ + Use `{}` around options containing special chars (#2892).+ + Avoid lazy `foldl`.+ + Don't escape underscore in labels (#2921). Previously they were+ escaped as `ux5f`.+ + brazilian -> brazil for polyglossia (#2953).++ * HTML writer: Ensure mathjax link is added when math appears in footnote+ (#2881). Previously if a document only had math in a footnote, the+ MathJax link would not be added.++ * EPUB writer: set `navpage` variable on nav page.+ This allows templates to treat it differently.++ * DocBook writer:++ + Use docbook5 if `writerDocbook5` is set (Ivo Clarysse).+ + Properly handle `ulink`/`link` (Ivo Clarysse).++ * EPUB reader:++ + Unescape URIs in spine (#2924).+ + EPUB reader: normalise link id (Mauro Bieg).++ * Docx Reader:++ + Parse `moveTo` and `moveFrom` (Jesse Rosenthal).+ `moveTo` and `moveFrom` are track-changes tags that are used when a+ block of text is moved in the document. We now recognize these tags and+ treat them the same as `insert` and `delete`, respectively. So,+ `--track-changes=accept` will show the moved version, while+ `--track-changes=reject` will show the original version.+ + Tests for track-changes moving (Jesse Rosenthal).++ * ODT, EPUB, Docx readers: throw `PandocError` on unzip failure+ (Jesse Rosenthal) Previously, `readDocx`, `readEPUB`, and `readOdt`+ would error out if zip-archive failed. We change the archive extraction+ step from `toArchive` to `toArchiveOrFail`, which returns an Either value.++ * Markdown, HTML readers: be more forgiving about unescaped `&` in+ HTML (#2410). We are now more forgiving about parsing invalid HTML with+ unescaped `&` as raw HTML. (Previously any unescaped `&`+ would cause pandoc not to recognize the string as raw HTML.)++ * Markdown reader:++ + Fix pandoc title blocks with lines ending in 2 spaces (#2799).+ + Added `-s` to markdown-reader-more test.++ * HTML reader: fixed bug in `pClose`. This caused exponential parsing+ behavior in documnets with unclosed tags in `dl`, `dd`, `dt`.++ * MediaWiki reader: Allow spaces before `!` in MediaWiki table header+ (roblabla).++ * RST reader: Support `:class:` option for code block in RST reader+ (Sidharth Kapur).++ * Org reader (all Albert Krewinkel, except where noted otherwise):++ + Stop padding short table rows.+ Emacs Org-mode doesn't add any padding to table rows. The first+ row (header or first body row) is used to determine the column count,+ no other magic is performed.+ + Refactor rows-to-table conversion. This refactors+ the codes conversing a list table lines to an org table ADT.+ The old code was simplified and is now slightly less ugly.+ + Fix handling of empty table cells, rows (Albert Krewinkel, #2616).+ This fixes Org mode parsing of some corner cases regarding empty cells+ and rows. Empty cells weren't parsed correctly, e.g. `|||` should be+ two empty cells, but would be parsed as a single cell containing a pipe+ character. Empty rows where parsed as alignment rows and dropped from+ the output.+ + Fix spacing after LaTeX-style symbols.+ The org-reader was dropping space after unescaped LaTeX-style symbol+ commands: `\ForAll \Auml` resulted in `∀Ä` but should give `∀ Ä`+ instead. This seems to be because the LaTeX-reader treats the+ command-terminating space as part of the command. Dropping the trailing+ space from the symbol-command fixes this issue.+ + Print empty table rows. Empty table rows should not+ be dropped from the output, so row-height is always set to be at least 1.+ + Move parser state into separate module.+ The org reader code has become large and confusing. Extracting smaller+ parts into submodules should help to clean things up.+ + Add support for sub/superscript export options.+ Org-mode allows to specify export settings via `#+OPTIONS` lines.+ Disabling simple sub- and superscripts is one of these export options,+ this options is now supported.+ + Support special strings export option Parsing of special strings+ (like `...` as ellipsis or `--` as en dash) can be toggled using the `-`+ option.+ + Support emphasized text export option. Parsing of emphasized text can+ be toggled using the `*` option. This influences parsing of text marked+ as emphasized, strong, strikeout, and underline. Parsing of inline math,+ code, and verbatim text is not affected by this option.+ + Support smart quotes export option. Reading of smart quotes can be+ toggled using the `'` option.+ + Parse but ignore export options. All known export options are parsed+ but ignored.+ + Refactor block attribute handling. A parser state attribute was used+ to keep track of block attributes defined in meta-lines. Global state+ is undesirable, so block attributes are no longer saved as part of the+ parser state. Old functions and the respective part of the parser state+ are removed.+ + Use custom `anyLine`. Additional state changes need to be made after+ a newline is parsed, otherwise markup may not be recognized correctly.+ This fixes a bug where markup after certain block-types would not be+ recognized.+ + Add support for `ATTR_HTML` attributes (#1906).+ Arbitrary key-value pairs can be added to some block types using a+ `#+ATTR_HTML` line before the block. Emacs Org-mode only includes these+ when exporting to HTML, but since we cannot make this distinction here,+ the attributes are always added. The functionality is now supported+ for figures.+ + Add `:PROPERTIES:` drawer support (#1877).+ Headers can have optional `:PROPERTIES:` drawers associated with them.+ These drawers contain key/value pairs like the header's `id`. The+ reader adds all listed pairs to the header's attributes; `id` and+ `class` attributes are handled specially to match the way `Attr` are+ defined. This also changes behavior of how drawers of unknown type+ are handled. Instead of including all unknown drawers, those are not+ read/exported, thereby matching current Emacs behavior.+ + Use `CUSTOM_ID` in properties. See above on Org writer changes.+ + Respect drawer export setting. The `d` export option can be used+ to control which drawers are exported and which are discarded.+ Basic support for this option is added here.+ + Ignore leading space in org code blocks (Emanuel Evans, #2862).+ Also fix up tab handling for leading whitespace in code blocks.+ + Support new syntax for export blocks. Org-mode version 9+ uses a new syntax for export blocks. Instead of `#+BEGIN_<FORMAT>`,+ where `<FORMAT>` is the format of the block's content, the new+ format uses `#+BEGIN_export <FORMAT>` instead. Both types are+ supported.+ + Refactor `BEGIN...END` block parsing.+ + Fix handling of whitespace in blocks, allowing content to be indented+ less then the block header.+ + Support org-ref style citations. The *org-ref* package is an+ org-mode extension commonly used to manage citations in org+ documents. Basic support for the `cite:citeKey` and+ `[[cite:citeKey][prefix text::suffix text]]` syntax is added.+ + Split code into separate modules, making for cleaner code and+ better decoupling.++ * Added `docbook5` template.++ * `--mathjax` improvements:++ + Use new CommonHTML output for MathJax (updated default MathJax URL,+ #2858).+ + Change default mathjax setup to use `TeX-AMS_CHTML` configuration.+ This is designed for cases where the input is always TeX and maximal+ conformity with TeX is desired. It seems to be smaller and load faster+ than what we used before. See #2858.+ + Load the full MathJax config to maximize loading speed (KolenCheung).++ * Bumped upper version bounds to allow use of latest packages+ and compilation with ghc 8.++ * Require texmath 0.8.6.2. Closes several texmath-related bugs (#2775,+ #2310, #2310, #2824). This fixes behavior of roots, e.g.+ `\sqrt[3]{x}`, and issues with sub/superscript positioning+ and matrix column alignment in docx.++ * README:++ + Clarified documentation of `implicit_header_references` (#2904).+ + Improved documentation of `--columns` option.++ * Added appveyor setup, with artefacts (Jan Schulz).++ * stack.yaml versions: Use proper flags used for texmath, pandoc-citeproc.++ * LaTeX template: support for custom font families (vladipus).+ Needed for correct polyglossia operation with Cyrillic fonts and perhaps+ can find some other usages. Example usage in YAML metadata:++ fontfamilies:+ - name: \cyrillicfont+ font: Liberation Serif+ - name: \cyrillicfonttt+ options: Scale=MatchLowercase+ font: Liberation++ * Create unsigned msi as build artifact in appveyor build.++ * On travis, test with ghc 8.0.1; drop testing for ghc 7.4.1.++++## pandoc 1.17.0.3 (2016-03-24)++ * LaTeX writer: Fixed position of label in figures (#2813).+ Previously the label wasn't in the right place, and `\ref`+ wouldn't work properly.+ * Added .tei test files to pandoc.cabal so they'll be included+ in tarball (#2811).+ * Updated copyright dates.++## pandoc 1.17.0.2 (2016-03-23)++ * Fixed serious regression in `htmlInBalanced`, which caused+ newlines to be omitted in some raw HTML blocks in Markdown+ (#2804).++## pandoc 1.17.0.1 (2016-03-21)++ * File scope is no longer used when there are no input files (i.e.,+ when input comes from stdin). Previously file scope was triggered+ when the `json` reader was specified and input came from `stdin`,+ and this caused no output to be produced. (Fix due to Jesse Rosenthal;+ thanks to Fedor Sheremetyev for calling the bug to our attention.)+ * Improved documentation of templates (#2797).++## pandoc 1.17 (2016-03-20)++ * Added `--file-scope` option (Jesse Rosenthal).+ By default pandoc operates on multiple files by first concatenating+ them (around extra line breaks) and then processing the joined file. So+ it only parses a multi-file document at the document scope. This has the+ benefit that footnotes and links can be in different files, but for+ some purposes it is useful to parse the individual files first+ and then combine their outputs (e.g. when the files use footnotes+ or links with the same labels). The `--file-scope` option causes+ pandoc to parse the files first, and then combine the parsed output,+ instead of combining before parsing. `--file-scope` is selected+ automatically for binary input files (which cannot be concatenated)+ and for pandoc json.++ * Add TEI Writer (Chris Forster) and `tei` output format.++ * Added a general `ByteStringReader` with warnings, used by the docx+ reader (API change, Jesse Rosenthal).++ * Add `readDocxWithWarnings` (API change, Jesse Rosenthal).++ * Changed type of `Shared.uniqueIdent` argument from+ `[String]` to `Set String`. This avoids performance problems in documents+ with many identically named headers (API change, #2671).++ * Removed `tex_math_single_backslash` from `markdown_github` options+ (#2707).++ * Make language extensions as well as full language names+ trigger syntax highlighting. For example, `py` will now work as+ well as `python` (jgm/highlighting-kate#83).++ * Added `institute` variable to latex, beamer templates (Fraser+ Tweedale, Josef Svenningsson).++ * Docx reader (Jesse Rosenthal):++ + Handle alternate content. Some word functions (especially graphics)+ give various choices for content so there can be backwards compatibility.+ + Don't turn numbered headers into lists.+ + Docx Reader: Add state to the parser, for warnings+ + Update feature checklist in source code.+ + Get rid of `Modifiable` typeclass.+ + Add tests for adjacent hyperlinks.+ + Add a "Link" modifier to `Reducible`. We want to make sure that+ links have their spaces removed, and are appropriately smushed+ together (#2689).++ * HTML reader:++ + Fixed behavior of base tag (#2777).+ If the base path does not end with slash, the last component+ will be replaced. E.g. base = `http://example.com/foo`+ combines with `bar.html` to give `http://example.com/bar.html`.+ If the href begins with a slash, the whole path of the base+ is replaced. E.g. base = `http://example.com/foo/` combines+ with `/bar.html` to give `http://example.com/bar.html`.+ + Rewrote `htmlInBalanced`. This version avoids an exponential+ performance problem with `<script>` tags, and it should be faster+ in general (#2730).+ + Properly handle an empty cell in a simple table (#2718).+ + Handle multiple `<meta>` tags with same name. Put them in a list+ in the metadata so they are all preserved, rather than (as before)+ throwing out all but one..++ * Markdown reader:++ + Improved pipe table parsing (#2765).+ + Allow `+` separators in pipe table cells. We already allowed+ them in the header, but not in the body rows, for some reason.+ This gives compatibility with org-mode tables.+ + Don't cross line boundary parsing pipe table row.+ Previously an Emph element could be parsed across the newline+ at the end of the pipe table row.+ + Use `htmlInBalanced` for `rawVerbatimBlock`, for better+ performance (#2730).+ + Fixed bug with smart quotes around tex math.++ * LaTeX reader:++ + Handle interior `$` characters in math (#2743). For example,+ `$$\hbox{$i$}$$`.+ + `inlineCommand` now gobbles an empty `{}` after any command (#2687).+ This gives better results when people write e.g. `\TeX{}` in Markdown.+ + Properly handle LaTeX "math" environment as inline math (#2171).++ * Textile reader: Support `>`, `<`, `=`, `<>` text alignment attributes.+ Closes #2674.++ * Org reader (Albert Krewinkel):++ + Prefix even empty figure names with "fig:" (#2643). The+ convention used by pandoc for figures is to mark them by prefixing+ the name with `fig:`. The org reader failed to do this if a figure+ had no name.+ + Refactor link-target processing (#2684).++ * ConTeXt writer: Fix whitespace at line beginning in line blocks (#2744).+ Thanks to @c-foster.++ * HTML writer: Don't include alignment attribute for default table columns.+ Previously these were given "left" alignment. Better to leave off+ alignment attributes altogether (#2694).++ * Markdown writer: Use hyphens for YAML metadata block bottom line, for+ better compatibility with other Markdown flavors (Henrik Tramberend).++ * LaTeX writer:++ + Use image identifier to create a label and hypertarget for+ figures (Mauro Bieg).+ + Avoid double toprule in headerless table with caption (#2742).+ + Clean up options parser (Jesse Rosenthal).+ + Treat `memoir` template with `article` option as article, instead+ of treating all `memoir` templates as books.+ + Allow more flexible table alignment (Henrik Tramberend, #2665).+ New default is not to include `[c]` option (which is the default+ anyway if no positioning is specified). Now LaTeX emplates can+ control the overall table alignment in a document by setting the+ longtable length variables `LTleft` and `LTright`. For example,+ `\setlength\LTleft\parindent\setlength\LTright\fill`+ will create left-aligned tables that respect paragraph indentation.++ * Docx writer: Handle image alt text (#2754, Mauro Bieg).++ * Org writer - pass through RawInline with format "org".++ * DokuWiki writer: use `$$` for display math.++ * Custom writer: Pass attributes parameter to CaptionedImage (#2697).++ * Make protocol-relative URIs work again (#2737).++ * make_osx_package.sh: Use env variable for developer id certs.++ * Raise `tagsoup` lower bound to 0.13.7 to fix entity-related+ problems (#2734).++ * Allow `zip-archive` 0.3.++ * Allow `aeson` 0.11.++## pandoc 1.16.0.2 (2016-01-12)++ * Depend on deepseq rather than deepseq-generics (fpco/stackage#1096).++ * Fixed regression in latex smart quote parsing (#2645).+ In cases where a match was not found for a quote, everything+ from the open quote to the end of the paragraph was being dropped.++## pandoc 1.16.0.1 (2016-01-10)++ * Fixed regression with `--latex-engine` (#2618). In 1.16+ `--latex-engine` raises an error if a full path is given.++ * Org reader: Fix function dropping subtrees tagged `:noexport`+ (Albert Krewinkel, #2628):++ * Markdown reader: renormalize table column widths if they exceed 100%+ (#2626).++ * Textile reader: don't allow block HTML tags in inline contexts.+ The reader previously did allow this, following redcloth,+ which happily parses++ Html blocks can be <div>inlined</div> as well.++ as++ <p>Html blocks can be <div>inlined</div> as well.</p>++ This is invalid HTML. The above sample now produces;++ <p>Html blocks can be</p>+ <div>+ <p>inlined</p>+ </div>+ <p>as well.</p>++ * Improved default template lookup for custom lua scripts (#2625).+ Previously, if you tried to do `pandoc -s -t /path/to/lua/script.lua`,+ pandoc would look for the template in+ `~/.pandoc/templates/default./path/to/lua/script.lua`.+ With this change it will look in the more reasonable+ `~/.pandoc/templates/default.script.lua`. This makes it possible to+ store default templates for custom writers.++ * RST, Markdown writers: Fixed rendering of grid tables with blank rows+ (#2615).++ * LaTeX writer: restore old treatment of Span (#2624). A Span is+ now rendered with surrounding `{}`, as it was before 1.16.++ * Entity handling fixes: improved handling of entities like+ `⟨` that require a trailing semicolon. Allow uppercase+ `x` in numerical hexadecimal character references, working+ around a tagsoup bug.++ * `stack.yaml` - use lts-4.0, but with older aeson to avoid excessive+ memory use on compile. With aeson 0.10 we were getting an out of+ memory error on a 2GB Ubuntu 64-bit VM.++ * Improved deb package creation script. Made `DPKGVER` work.+ Renamed `COMMIT` to `TREE`. You should now be able to do+ `TREE=1.16.0.1 DPKGVER=2 make deb`.+++## pandoc 1.16 (2016-01-02)++ * Added `Attr` field to `Link` and `Image` (Mauro Bieg, #261, API change).++ + Added syntax for link and image attributes to pandoc's Markdown.+ + Updated readers and writers to use link and image attributes+ when appropriate.+ + Support image attributes in Docx, Textile, RST readers.++ * Renamed link attribute extensions. The old `link_attributes` is+ now `mmd_link_attributes`, and `link_attributes` now enables the+ new pandoc-style link and image attributes (API change).+ Note: this change could break some existing workflows.++ * Implemented `SoftBreak` and new `--wrap` option (#1701, API change).+ Added threefold wrapping option.++ + Command line option: deprecated `--no-wrap`, added+ `--wrap=[auto|none|preserve]`+ + Added `WrapOption`, exported from `Text.Pandoc.Options`+ + Changed type of `writerWrapText` in `WriterOptions` from+ `Bool` to `WrapOption`.+ + Modified `Text.Pandoc.Shared` functions to allow `SoftBreak`.+ + Supported `SoftBreak` in readers and writers.++ * Text.Pandoc.Options: Added `writerDpi` to `WriterOptions` (API+ change, Mauro Bieg).++ * Added `--dpi` command-line option (Mauro Bieg).++ * Rationalized behavior of `--no-tex-ligatures` and `--smart` (#2541).+ This change makes `--no-tex-ligatures` affect the LaTeX reader+ as well as the LaTeX and ConTeXt writers. If it is used,+ the LaTeX reader will parse characters `` ` ``, `'`, and `-`+ literally, rather than parsing ligatures for quotation marks+ and dashes. And the LaTeX writer will print unicode quotation+ mark and dash characters literally, rather than converting+ them to the standard ASCII ligatures. Note that `--smart` has+ no effect on the LaTeX reader. `--smart` is still the default+ for all input formats when LaTeX or ConTeXt is the output format,+ *unless* `--no-tex-ligatures` is used.++ Some examples to illustrate the logic:++ ```+ % echo "'hi'" | pandoc -t latex+ `hi'+ % echo "'hi'" | pandoc -t latex --no-tex-ligatures+ 'hi'+ % echo "'hi'" | pandoc -t latex --no-tex-ligatures --smart+ ‘hi’+ % echo "'hi'" | pandoc -f latex --no-tex-ligatures+ <p>'hi'</p>+ % echo "'hi'" | pandoc -f latex+ <p>’hi’</p>+ ```++ * Removed deprecated options `--offline` and `--html5`.++ * Fixed language code for Czech (`cs` not `cz`) (#2597).++ * Implemented `east_asian_line_breaks` extension (#2586).+ In `Text.Pandoc.Options`, added `Ext_east_asian_line_breaks` constructor+ to `Extension` (API change). This extension is like+ `ignore_line_breaks`, but smarter -- it only ignores line breaks+ between two East Asian wide characters. This makes it better suited+ for writing with a mix of East Asian and non-East Asian scripts.++ * Added support for PDF creation via `wkhtmltopdf`.+ To use this: `pandoc -t html5 -o result.pdf` (and add `--mathjax`+ if you have math.) Margins can be set using the variables+ `margin-top`, `margin-bottom`, `margin-left`, `margin-right`.+ Other styling can be done through CSS.++ * Fixed cite key parsing regression (jgm/pandoc-citeproc#201).+ We were capturing final colons as in `[@foo: bar]`; the citation id+ was being parsed as `@foo:`.++ * ICML writer:++ + Fixed image syntax for local files (#2589).+ + Changed type of `writeICML` (Mauro Bieg).+ API change: It is now `WriterOptions -> Pandoc -> IO String`.+ Also handle new image attributes.+ + Intersperse line breaks instead of appending them to+ every `ParagraphStyleRange` (Mauro Bieg, #2501).+ + Add `Cite` style to citations (Mauro Bieg).+ + Added figure handling (#2590, Mauro Bieg).+ + Better handling of math. Instead of just printing the raw tex,+ we now try to fake it with unicode characters.++ * HTML writer: Include `example` class for example lists (#2524).++ * ODT/OpenDocument writer: improved image attributes (Mauro Bieg).++ + Support for percentage widths/heights+ + Use `Attr` instead of title to get dimensions from ODT walker+ to `writeOpenDocument`.++ * AsciiDoc writer:++ + Support anchors in spans and divs with id elements+ (jgm/pandoc-citeproc#143).+ + Fixed code blocks (#1861).++ * Haddock writer: omit formatting inside links, which isn't supported+ by Haddock (#2515).++ * MediaWiki writer: Fixed spacing issues in table cells.++ + Start cell on new line unless it's a single Para or Plain+ (#2606).+ + For single Para or Plain, insert a space after the `|` to+ avoid problems when the text begins with a character like+ `-` (#2604).++ * Beamer writer: mark frame as fragile when it contains verbatim (#1613).++ * LaTeX writer:++ + Add support for GAP highlighting using listings (Raniere Silva).+ + Consider `header-includes` content as well as templates+ when determining whether to use csquotes (Andreas Lööw).+ + Create defaults for geometry using `margin-left` etc.+ If `geometry` has no value, but `margin-left`, `margin-right`,+ `margin-top`, and/or `-margin-bottom` are given, a default value+ for `geometry` is created from these. Note that these variables+ already affect PDF production via HTML5 with `wkhtmltopdf`.++ * ConTeXt writer: set default layout based on `margin-left`, etc.+ This sets up `\setuplayout` based on the variables `margin-left`,+ `margin-right`, `margin-bottom`, and `margin-top`, if no layout+ is given.++ * Docx writer: better handling of PDF images. Previously we tried+ to get the image size from the image even if an explicit size was+ specified. Since we still can't get image size for PDFs, this made+ it impossible to use PDF images in docx. Now we don't try to get+ the image size when a size is already explicitly specified.++ * Markdown writer: use raw HTML for link/image attributes when+ the `link_attributes` extension is unset and `raw_html` is set (#2554).++ * MediaWiki reader: interpret markup inside `<tt>`, `<code>` (#2607).++ * LaTeX reader:++ + Improved smart quote parsing (#2555). This fixes redering of+ unmatched quotes.+ + Use curly quotes for unmatched ` (#2555).+ + Allow blank space between braced arguments of commands (#2592).++ * Markdown reader:++ + Improved pipe table relative widths. Previously pipe table+ columns got relative widths (based on the header underscore lines)+ when the source of one of the rows was greater in width than the+ column width. This gave bad results in some cases where much of+ the width of the row was due to nonprinting material (e.g. link+ URLs). Now pandoc only looks at printable width (the width of a+ plain string version of the source), which should give better results.+ Thanks to John Muccigrosso for bringing up the issue.+ + Fixed parsing bug with macros. Previously macro definitions in+ indented code blocks were being parsed as macro definitions, not code.++ * Textile reader: skip over attribute in image source (#2515).+ We don't have a place yet for styles or sizes on images, but+ we can skip the attributes rather than incorrectly taking them+ to be part of the filename.++ * Docx reader: Handle dummy list items (Jesse Rosenthal).+ These come up when people create a list item and then delete the+ bullet. It doesn't refer to any real list item, and we used to ignore+ it.++ * CommonMark reader/writer rewritten to use latest `cmark`.++ * Fixed Emoji character definitions (#2523). There were many bugs in the+ definitions.++ * `Text.Pandoc.CSS`:++ + Added `pickStylesToKVs` function to extract multiple properties at+ once (API change, Mauro Bieg).+ + Parse CSS that doesn't contain the optional semicolon (Mauro Bieg).++ * `trypandoc`: sort drop-down lists.++ * Beamer template:++ + Made `\euro` conditional on presence of character.+ for xelatex and lualatex, as it is for pdflatex (Andrew Dunning).+ + Moved `header-includes` before setting of title (Thomas Hodgson),+ to match the LaTeX template (jgm/pandoc-templates#168).+ + Added `section-titles` variable (defaults to true)+ to enable/suppress section title pages in beamer+ slide shows (Thomas Hodgson).+ + Moved beamer themes after fonts, so that themes can+ change fonts. (Previously the fonts set were being+ clobbered by lmodern.sty.) (Thomas Hodgson).++ * Beamer/LaTeX template changes (Thomas Hodgson):+ + Added `thanks` variable+ + Use `parskip.sty` when `indent` isn't set (fall back to using+ `setlength` as before if `parskip.sty` isn't available).+ + Use `biblio-style` with biblatex.+ + Added `biblatexoptions` variable.++ * LaTeX template changes:++ + Added `paper` after `$papersize$` variable in latex template.+ Thus you can say `papersize: a4` and the latex will contain+ `a4paper`. This change may break some existing workflows; if+ you currently specify `a4paper`, you'll get `a4paperpaper` which+ is meaningless. However, the change seems worth it, as it will+ make the `papersize` variable work uniformly across ConTeXt, LaTeX,+ and html->pdf via wkhtmltopdf.+ + Only pass options to color package if `colorlinks` is set+ (Andrew Dunning).+ + Make definition of `\euro` conditional in xelatex/lualatex,+ as it is already for pdflatex (Andrew Dunning).+ + Removed setting of `subject` in PDF metadata.+ This used to be set to the subtitle, but really the subtitle+ need not give the subject. Also, `subtitle` can contain formatting,+ so we'd need, at least, a plain text version for this.+ + Moved `header-includes` before setting of `\title`, `\author`,+ etc. This allows these macros to be redefined.+ + Use `\subtitle` command for `subtitle`, instead of tacking it+ on to the title as before. We give a no-op fallback definition if it+ is not defined. This change should produce much better results+ in classes that support `\subtitle`. With the default article+ class, which does not define `\subtitle`, subtitles will no+ longer be printed unless the user defines `\subtitle` and+ redefines `\maketitle`.+ + Moved redefinitions of `\paragraph` and `\subparagraph` to+ before header-includes.++ * Context template:++ + Use `simplefonts` for font loading (Paolo Rodríguez). This is+ needed for things to work on ConTeXt stable from TeXLive 2015.+ + Revert use of `\setuphead` in title block (Andrew Dunning,+ Rik Kabel).++ * Update LaTeX/ConTeXt link colour usage (Andrew Dunning).++ * Fixed man template so disabling hyphenation actually works.+ The command needs to come after .TH.++ * Added 'navigation' variable to beamer template (#2543).+ Valid values are `empty` (the default), `horizontal`, `vertical`,+ and `frame`. Note that this changes the default behavior from+ `horizontal` to `empty`. Closes #2543.++ * Added `toc` to HTML slide format templates (Andrew Dunning),+ so that `--toc` creates a contents slide.++ * Added `stack.full.yaml` to build `pandoc-citeproc` as well.++ * Allow pipe tables with no body rows (#2556).+ Previously this raised a runtime error.++ * Shared: Improved `fetchItem` so that `C:/Blah/Blah.jpg` isn't treated+ as URL. The Haskell URI parsing routines will accept "C:" as a+ scheme, so we rule that out manually. This helps with+ `--self-contained` and absolute Windows paths.++ * Define a `meta-json` variable for all writers (#2019). This contains+ a JSON version of all the metadata, in the format selected for the+ writer. So, for example, to get just the YAML metadata, you can run+ pandoc with the following custom template: `$meta-json$`. The intent+ is to make it easier for static site generators and other tools to get+ at the metadata.++ * Document limitations of --self-contained (#2553).++ * Improved Citations section of README (#2551). Added information+ about `link-citations` and a link to the pandoc-citeproc man page.++ * `ImageSize`: use `safeRead` instead of `readMaybe`, which isn't+ in base < 4.6.++ * Allow .adoc file extension for AsciiDoc (Andrew Dunning).++ * Improved implicit pandoc-citeproc inclusion.+ The filter pandoc-citeproc is automatically used when+ `--bibliography` is specified on the command line, unless+ `--natbib` or `--biblatex` is used. However, previously this+ only worked if `--bibliography` was spelled out in full, and not+ if `--biblio` was used.++ * reveal.js: Interpret pauses correctly for all headers (#2530).+ Previously, when using headers below the slide level, pauses are left+ uninterpreted into pauses. In my opinion, unexpected behavior but+ intentional looking at the code.++ * Remove redundant `center` variable for reveal.js (Andrew Dunning).++ * Parsing: Add `extractIdClass`, modified type of `KeyTable` (Mauro+ Bieg, API change).++ * ImageSize: Added functions for converting between image dimensions+ (Mauro Bieg).++ * Use lts-3.18 in stack.yaml. This avoids Windows build+ issues with the HTTP library.++ * Bump version bounds for dependencies.++## pandoc 1.15.2.1 (2015-11-16)++ * 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 (2015-11-15)++ * `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://www.sixbarsjail.it/tmp/bach_toccata.mp3"+ 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 (2015-10-15)++ * `pandocVersion` is now defined in `Text.Pandoc.Shared`+ and reexported from `Text.Pandoc` (Alex Vong). This allows+ writers to access it. (Alex Vong) (API change)++ * For `markdown_mmd`, add: `implicit_figures`, `superscripts`,+ `subscripts` (#2401).++ * Added `odt` as input format (MarLinn). Added new module+ `Text.Pandoc.Reader.ODT` (API change). Fully implemented features:+ Paragraphs, Headers, Basic styling, Unordered lists, Ordered lists,+ External Links, Internal Links, Footnotes, Endnotes, Blockquotes.+ Partly implemented features: Citations, Tables.++ * Markdown Reader:++ + Add basic tests for each header style (Ophir Lifshitz).+ + Add implicit header ref tests for headers with spaces (Ophir Lifshitz).+ + Skip spaces in headers (Ophir Lifshitz).+ + Handle 'id' and 'class' in parsing key/value attributes (#2396).+ `# Header {id="myid" class="foo bar"}`+ is now equivalent to `# Header {#myid .foo .bar}`.+ + Use '=' instead of '#' for atx-style headers in markdown+lhs.+ (Kristof Bastiaensen)+ + Pipe tables: allow indented columns. Previously the left-hand column+ could not start with 4 or more spaces indent. This was inconvenient+ for right-aligned left columns. Note that the first (header column)+ must still have 3 or fewer spaces indentation, or the table will be+ treated as an indented code block.+ + Fix regression: allow HTML comments containing `--`.+ Technically this isn't allowed in an HTML comment, but+ we've always allowed it, and so do most other implementations.+ It is handy if e.g. you want to put command line arguments+ in HTML comments.++ * LaTeX reader:++ + Don't eat excess whitespace after macros with only optional+ arguments (#2446).+ + Support longtable (#2411).+ + Implement `\Cite` (#2335).+ + Support abstract environment. The abstract populates an+ `abstract` metadata field.+ + Properly handle booktabs lines. Lines aren't part of the+ pandoc table model, so we just ignore them (#2307).++ * HTML reader:++ + Handle type attribute on ol, e.g. `<ol type="i">` (#2313).+ + Updated for new automatic header attributes.+ + Add auto identifiers if not present on headers. This makes+ TOC linking work properly.+ + Detect `font-variant` with `pickStyleAttrProps` (Ophir Lifshitz).+ + Test `<ol>` type, class, and inline list-style(-type) CSS+ (Ophir Lifshitz).+ + Better handling of "section" elements (#2438). Previously+ `<section>` tags were just parsed as raw HTML blocks. With+ this change, section elements are parsed as Div elements with+ the class "section".++ * MediaWiki reader: handle unquoted table attributes (#2355).++ * DocBook reader:++ + Added proper support for DocBook `xref` elements (Frerich Raabe).+ Added `dbContent` field to reader state, so we can lookup+ cross refs.+ + Handle `informalexample` (#2319).++ * Docx Reader:++ + Create special punctuation test (Ophir Lifshitz).+ + Parse soft, no-break hyphen elements (Ophir Lifshitz).+ + Updated headers test (Ophir Lifshitz). Replaced `styles.xml`+ in `headers.docx` with pandoc's current `styles.xml`, which+ contains styles for Heading 1 through 6. Added Heading 4+ through 7 to the test document. Note that Heading 7 is not+ parsed as a Heading because there is no Heading 7 style.++ * RST reader: better handling of indirect roles.+ Previously the parser failed on this kind of case++ .. role:: indirect(code)++ .. role:: py(indirect)+ :language: python++ :py:`hi`++ Now it correctly recognizes `:py:` as a code role.++ * Org reader:++ + Add auto identifiers if not present on headers+ (#2354, Juliusz Gonera).+ + Allow verse blocks to contain empty lines (#2402,+ Albert Krewinkel).++ * EPUB reader: stop mangling external URLs (#2284).++ * RST writer:++ + Don't insert `\ ` when complex expression in matched pairs.+ E.g. `` [:sup:`3`] `` is okay; you don't need `` [:sup:`3`\ ] ``.+ + Ensure that `\ ` is inserted when needed before Cite and Span+ elements that begin with a "complex" element (jgm/pandoc-citeproc#157).+ + Normalize headers only in "standalone" mode (#2394).++ * Haddock writer: escape `*` and `^` (G. Bataille).++ * Markdown writer:++ + In TOC, add links to headers (#829).+ + Use unicode super/subscripts for digits in plain output+ (when the `superscripts` and `subscripts` extensions are+ not enabled).++ * Docx writer:++ + Moved invalid character stripping to `formattedString`.+ This avoids an inefficient generic traversal (#2356).+ + Use user data directory for `reference.docx` archive.+ This allows the test suite to work without installing pandoc first.+ It also brings the docx writer in line with the odt writer.+ + Tests: docx writer tests now use `../data` for data directory.+ This allows tests to be run without installing first.+ + Tests: Use real jpg (not empty) for docx tests to avoid warning.++ * LaTeX writer:++ + Fixed detection of 'chapters' from template.+ If a documentclass isn't specified in metadata, but the+ template has a hardwired bookish documentclass, act as if+ `--chapters` was used. This was the default in earlier+ versions, but it has been broken for a little while.+ + Correctly recognize book documentclass in metadata (#2395).+ + Set language-related variables automatically, depending+ on the value of the `lang` field, which is now always+ assumed to be in BCP47 format (mb21, #1614, #2437).+ + Add `\protect` to `\hyperdef` in inline context. This way we+ don't get an error when this is used as a moveable argument (#2136).+ + Support all frame attributes in Beamer.+ + Percent-encode more special characters in URLs (#1640, #2377).+ The special characters are '<','>','|','"','{','}','[',']','^', '`'.++ * HTML writer:++ + Update KaTeX JS and CSS versions (Emily Eisenberg).+ + For dzslides, add `role="note"` for speaker notes (#1693).+ + Percent-encode more special characters in URLs (#1640, #2377).+ The special characters are '<','>','|','"','{','}','[',']','^', '`'.+ + Render Div with class `section` as `<section>` in HTML5.++ * EPUB writer:++ + In TOC, replace literal `<br/>` with space (#2105).+ + With `--webtex`, include image file rather than `data:` URI (#2363).++ * Native writer: format Div properly, with blocks separated.++ * Support bidirectional text output with XeLaTeX, ConTeXt and HTML+ (#2191, mb21).++ * Reference Docx:++ + Add missing Header 6 style (steel blue) (Ophir Lifshitz).+ + Correct `outlineLvl` for Header styles (Ophir Lifshitz).++ * Templates++ + Beamer: Add `innertheme`, `outertheme` variables+ (Guilhem Bonnefille, #121). Add space after colon in figure caption.+ Integrate recent font and language updates from LaTeX template;+ allow use of `mainfont` variable for changing the slide text+ in XeTeX and LuaTeX (Andrew Dunning, #131).+ + LaTeX: Add `mainfontoptions`, `sansfontoptions`,+ `monofontoptions`, `mathfontoptions`, `fontfamilyoptions`+ (Andrew Dunning, #122). Support handling of bidirectional+ text (mb21, #120). Improve reliability of superscripts/subscripts+ under XeTeX and prevent letters and numbers from appearing on a+ different baseline by removing use of the `realscripts` package+ (via `xltxtra`). To restore use of OpenType characters for these+ features under XeTeX or LuaTeX, add `\usepackage{realscripts}` to+ `header-includes` (Andrew Dunning, #130). Remove redundant+ reference to `xunicode` (Andrew Dunning, #130). Add `fontenc`,+ `indent`, `subparagraph` variables (Andrew Dunning).+ Allow use of `hidelinks` variable for `hyperref` package (Hugo Roy,+ #113). Prevent package clash with `tufte-latex` and other classes that+ include `hyperref` or `color` (Xavier Olive, #115).+ + ConTeXt: Support handling of bidirectional text (mb21, #120).+ + LaTeX and ConTeXt: Use more specific language variables.+ Instead of directly using `lang`, we now use `babel-lang` and+ `polyglossia-lang` and `context-lang`. These variables are set by+ the writers to the necessary values, based on the `lang` variable+ (which now always takes a value in BCP47 format). (mb21, #114, #129).+ + HTML: Support handling of bidirectional text (mb21, #120).+ 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+ 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).+ + man: Added comment stating that the page is autogenerated by pandoc,+ giving version. Added `adjusting` and `hyphenate` variables+ (Alex Vong, #123).++ * epub.css: added selectors for nested emphasis (Pablo Rodriguez).++ * MediaBag: ensure that `/` is always used as path separator.++ * `sample.lua`: define `CaptionedImage`, add newline at end (#2393).++ * Added `--bash-completion` option. This generates a bash completion+ script. To use: `eval "$(pandoc --bash-completion)"`.++ * Text.Pandoc.Error: Define Typeable and Exception instances+ for PandocError (#2386).++ * Text.Pandoc.Parsing: `toKey`: strip off outer brackets.+ This makes keys with extra space at the beginning and end+ work: e.g.++ [foo]: bar++ [ foo ]++ will now be a link to bar (it wasn't before).++ * Text.Pandoc: disable `auto_identifiers` for epub.+ The epub writer inserts its own auto identifiers;+ this is more complex due to splitting into "chapter" files.++ * Renamed Text.Pandoc.Compat.Locale -> Text.Pandoc.Compat.Time.+ It now reexports Data.Time.++ * Use custom Prelude to avoid compiler warnings.++ + The (non-exported) prelude is in prelude/Prelude.hs.+ + It exports Monoid and Applicative, like base 4.8 prelude,+ but works with older base versions.+ + It exports (<>) for mappend.+ + It hides 'catch' on older base versions.++ * Added a `stack.ymal` and stack install instructions to INSTALL.++ * Clarified what is "out of scope" in README and CONTRIBUTING.md.++ * Added note to CONTRIBUTING.md about ghc versions and travis.++ * Clarify docs on block quotes. The space after `>` is optional (#2346).++ * Removed obsolete reference to default.csl (#2372).++ * List all styles in manual for `--reference-docx` (Chris Black)++ * Don't capitalize header links in man page.++ * Added section on repl to CONTRIBUTING.md.++ * README: Added space after backslash in image example (#2329).++ * Document details of citation locator terms (Nick Bart).++ * Fixed some internal links in README (#2309).++ * Improve CSL documentation, variables documentations,+ links, and cross-references in README. (Andrew Dunning)++ * Fix build failure with `--flags=-https` (Sergei Trofimovich).++ * Use `newManager` instead of `withManager` in recent `http-client`.+ This avoids a deprecation warning.++ * Allow building with latest versions of http-types,+ HUnit, criterion, syb, aeson.++ * Updated benchmark program for new criterion API.++ * Setup.hs: rewrite so as not to use process, directory, filepath.+ Using anything outside base is dangerous, since older+ versions of ghc may link against two different versions.++ * Added appveyor (Windows continuous integration) builds.++ * New `.travis.yml`. Autgenerated using `make_travis_yml.hs`.+ This script has been modified in a few ways, e.g. to add `GHCOPTS`.+ `make .travis.yml` regenerates it based on the tested-with+ field of the cabal file.++## pandoc 1.15.0.6 (2015-07-15)++ * `--self-contained`: Fixed overaggressive CSS minimization+ (#2301, 2286). Previously `--self-contained` wiped out all+ spaces in CSS, including semantically significant spaces.+ This was a regression from 1.14.x.++ * Markdown reader: don't allow bare URI links or autolinks in link+ label (#2300). Added test cases.++ * `Text.Pandoc.Parsing`, `uri`: Improved bare autolink detection (#2299).+ Previously we disallowed `-` at the end of an autolink,+ and disallowed the combination `=-`. This commit liberalizes the+ rules for allowing punctuation in a bare URI, and adds test cases.+ One potential drawback is that you can no longer put a bare+ URI in em dashes like this:+ `this uri---http://example.com---is an example.`+ But in this respect we now match github's treatment of bare URIs.++ * HTML writer: support speaker notes in dzslides.+ With this change `<div class="notes">` and also `<div class="notes"+ role="note">` will be output if `-t dzslides` is used. So we can+ have speaker notes in dzslides too. Thanks to maybegeek.++ * Updated dzslides template.++ * Improved documentation of options to print system default files (#2298).+ `--print-default-data-file` and `--print-default-template`.++ * DokuWiki writer: use `$..$` for Math instead of `<math>..</math>`+ (Tiziano Müller). MathJax seems currently to be the only maintained+ math rendering extension for DokuWiki.++ * `Text.Pandoc.Shared`: Changed `hierarchicalize` so it treats references+ div as top-level header (#2294). This fixes a bug with `--section-divs`,+ where the final references section added by pandoc-citeproc, enclosed in+ its own div, got nested in the div for the section previous to it.++ * Allow vector 0.11.++ * Require cmark > 0.4.++## pandoc 1.15.0.5 (2015-07-10)++ * HTML writer: Fixed email javascript obfuscation with `mailto:`+ URLs (#2280). This fixes a potential security issue. Because+ single quotes weren't being escaped in the link portion, a+ specially crafted email address could allow javascript code injection.++ * RST reader: allow inline formatting in definition list field+ names (Lars-Dominik Braun).++ * PDF: Make sure `--latex-engine-opt` goes before the filename+ on the command line. LaTeX needs the argument to come after+ the options (#1779).++ * CommonMark writer: fixed tags used for super/subscript.++ * ConTeXt template: activate hanging indent for definition lists+ (mb21).++ * Make cabal require `hsb2hs` >= 0.3.1 if `embed_data_files` specified.+ This is done by adding `hookedPrograms` in `Setup.hs`, which allows us+ to include `hsb2hs` in Build-Tools in cabal.++ * Improved Windows installer (thanks to nkalvi).++ + When per-machine installation is chosen, the system path+ is updated instead of the user's.+ + An appropriate default is used for per-machine installation+ directory.+ + Admin privileges are no longer required for a per-user install++ * Travis: unpack sdist for build to catch packaging bugs.++ * Improved documentation on where user templates go (#2272).++## pandoc 1.15.0.4 (2015-07-03)++ * Added pandoc.1 man page to the repository. It is no longer+ built as part of the cabal build process. (This proved too+ fragile.) pandoc.1 can be regenerated (`make man/pandoc.1`)+ when `README` is changed.++ * Copying of the man page now respects `--destdir` (#2262).++ * Improved error messages for filters. User is now informed if+ the filter requires an interpreter that isn't found in the path,+ or if the filter returns an error status.++## pandoc 1.15.0.3 (2015-07-02)++ * Ensure target directory is created when installing man page.++## pandoc 1.15.0.2 (2015-07-02)++ * Added files needed for building man page to Extra-Source-Files.++## pandoc 1.15.0.1 (2015-07-01)++ * Man page is now built and installed as part of the cabal build+ process. Removed Makefile target for man page.++## pandoc 1.15 (2015-07-01)++ * Man page changes:++ + Removed `--man1`, `--man5` options (breaking change).+ + Removed `Text.Pandoc.ManPages` module (breaking API change).+ + Makefile target for `man/man1/pandoc.1`. This uses pandoc to+ create the man page from README using a custom template and filters.+ + Added `man/` directory with template and filters needed to build+ man page.+ + We no longer have two man pages: `pandoc.1` and `pandoc_markdown.5`.+ Now there is just pandoc.1, which has all the content from README.+ This change was needed because of the extensive cross-references+ between parts of the README.+ + Removed old `data/pandoc.1.template` and+ `data/pandoc_markdown.5.template`.++ * OpenDocument writer: Do not add a carriage return after a hard+ line break (Michael Chladek).++ * ConTeXt writer:++ + use `\goto` for internal links.+ + Added a `%` at end for `\reference` to avoid spurious space.++ * Ignore sandbox on 'make quick'++## pandoc 1.14.1 (2015-06-30)++ * Added `--man1` and `--man5` options to pandoc, allowing+ pandoc to generate its own man pages. Man pages are no longer+ automatically generated in the build process (the process for+ this was too complex and prone to failure, #2190). The+ `make-pandoc-man-pages` executable has been removed. The+ `man/` directory has been removed, and man page templates+ have been moved to `data/`. NOTE TO PACKAGERS: You will no+ longer find pandoc's man pages in `man/`, but you can+ generate them using `pandoc --man1 > pandoc.1` and `pandoc+ --man5 > pandoc_markdown.5`.++ * Added new unexported module: `Text.Pandoc.ManPages`.++ * `README` now acts like a data file (even though it isn't in+ `data/`). So, for example, `pandoc --print-default-data-file README`+ will produce the README.) This change was required for the `--man1`+ and `--man5` options, since the man pages are produced from the+ README, but it may be useful for other purposes as well.++ * Allow `reference.docx` and `reference.odt` to be used with+ `--print-default-data-file` and to shadow defaults if placed in+ the user data directory. Note that as of 1.14, we no longer+ include these files as data files; instead, we include their+ components. This change causes pandoc to behave as if it has+ these data files; they are constructed on demand when needed+ using `getDefaultReferenceDocx` and `getDefaultReferenceODT`.++ * Fixed regression in CSS parsing with `--self-contained` (#2224).+ Pandoc 1.14.0.x used css-text to parse the CSS, but its parser+ silently drops big sections of CSS. This commit replaces the+ use of css-text with a small but principled CSS preprocessor,+ which removes whitespace and comments and replaces `url()` with+ base 64 data when possible.++ * Use `https://` instead of `//` for MathJax and KaTeX CDN URLs (#1920).+ This will allow math to work when pages are being viewed locally.++ * `Text.Pandoc.Options`: Export `plainExtensions`.+ These are the extensions used in `plain` output.++ * LaTeX reader: Don't parse `_` and `^` as sub/superscript outside of+ math mode; treat them as regular inline text. Normally these will+ cause an error in LaTeX, but there are contexts (e.g. `alltt`+ environments) where they are allowed.++ * HTML reader: allow `<body>` to close `<head>`.++ * DocBook reader: support `mediaobject`s and `figures` (#2184, mb21).++ * RST reader: Fix reference names with special characters+ (Lars-Dominik Braun).++ * Textile writer: escape `+` and `-` as entities (#2225).++ * DokuWiki writer: Use proper `<code>` tags for code blocks (#2213).++ * Plain writer: don't use symbols for super/subscript (#2237).+ Simplified code by using `plainExtensions`.++ * InDesign writer: Properly escape URLs containing more than one+ colon character (gohai).++ * Docx writer: Make sure we use dist version of `reference.docx`+ (and not the user's version) for certain settings. Taking some+ settings values from a user-supplied reference.docx can lead to+ corruption. This fixes a regression from the last release (#2249).++ * `Text.Pandoc.Shared`: exports `getDefaultReferenceDocx` and+ `getDefaultReferenceODT` (API change). These functions have been+ removed from the Docx and ODT writers.++ * LaTeX template (Xavier Olive):+ + Added `CJKmainfont` and `CJKoptions` variables.+ + Allow dvipsnames (e.g. `MidnightBlue`) for colors (Xavier Olive).++ * Epub templates: use `author.role`, not `author.type`.++ * Bump cmark version to >= 0.3.4.++ * Improved Windows installer (#2205, thanks to nkalvi).+ Users can now select a per-user or systemwide install, and can set+ the installation path. At the end of installation, the install location+ is given. The install location is also now given in the list of+ installed programs in Control Panel. Cleaner WiX syntax is used for+ setting the path.++ * Added `download_stats` target to Makefile.++## pandoc 1.14.0.4 (2015-06-02)++ * Added missing commonmark template.++ * Improved try pandoc (moved button, show raw command).++## pandoc 1.14.0.3 (2015-06-01)++ * Allow compilation with syb 0.5.*.++ * Custom writer: fixed some compiler warnings for ghc < 7.10.++## pandoc 1.14.0.2 (2015-05-31)++ * Allow building with hslua 0.4.++## pandoc 1.14.0.1 (2015-05-28)++ * Fixed problem with building of `reference.docx` and `reference.odt`+ when the `embed_data_files` flag is used. Instead of having a phase+ of the build where `reference.docx` and `reference.odt` are created+ from their constituent data files, we now construct these archives+ from their constituents when a `docx` or `odt` is built. The+ constituent files have been moved from `extra-source-files` to+ `data-files`, and `reference.docx` and `reference.odt` have been+ removed. Users can create their own `reference.docx` or+ `reference.odt` by using pandoc to create a simple `docx` or `odt`.+ `make-reference-files.hs` has been removed, simplifying the build+ process (#2187)++ * Don't include generated man pages in extra-source-files (#2189).++ * Bumped upper bound for aeson.++ * ConTeXt writer: create internal link anchors for Div elements with+ identifiers. (This is needed for linked citations to work.)++## pandoc 1.14 (2015-05-27)++### New features++ * Added `commonmark` as input and output format.++ * Added `--verbose` flag for debugging output in PDF production (#1840,+ #1653).++ * Allow wildcards in `--epub-embed-font` arguments (#1939).++ * Added `--latex-engine-opt` option (#969, #1779, Sumit Sahrawat).++ * Added `shortcut_reference_links` extension (Konstantin Zudov, #1977).+ This is enabled by default for those markdown flavors that+ support reading shortcut reference links, namely: `markdown`,+ `markdown_strict`, `markdown_github`, `markdown_php`.+ If the extension is enabled, the reader parses shortcut reference+ links like `[foo]`, and the writer creates such links unless doing+ so would cause problems. Users of markdown flavors that support+ shortcut reference links should not notice a difference in reading+ markdown, but the markdown pandoc produces may differ.+ If shortcut links are not desired, the extension can be disabled+ in the normal way.++### Behavior changes++ * `--toc` is now supported for `docx` output (#458, Nikolay Yakimov).+ A "dirty" TOC is created at the beginning of document.+ It can be regenerated after the document has been opened.++ * An implicit `--filter pandoc-citeproc` is now triggered only when the+ `--bibliography` option is used, and not when the `bibliography`+ field in metadata is specified (#1849).++ * Markdown reader:++ + Reference links with `implicit_header_references` are no longer+ case-sensitive (#1606).+ + Definition lists no longer require indentation for first line (#2087).+ Previously the body of the definition (after the `:` or `~` marker)+ needed to be in column 4. This commit relaxes that requirement,+ to better match the behavior of PHP Markdown Extra. So, now+ this is a valid definition list:++ foo+ : bar+ + Resolve a potentially ambiguity with table captions:++ foo++ : bar++ -----+ table+ -----++ Is "bar" a definition, or the caption for the table? We'll count+ it as a caption for the table.+ + Disallow headerless pipe tables (#1996), to conform to GFM and PHP+ Markdown Extra. Note: If you have been using headerless pipe tables,+ this change may cause existing tables to break.+ + Allow pipe tables with header but no body (#2017).+ + Allow a digit as first character of a citation key (Matthias Troffaes).+ See https://github.com/jgm/pandoc-citeproc/issues/97++ * LaTeX reader:++ + Don't limit includes to `.tex` extension (#1882).+ If the extension is not `.tex`, it must be given explicitly in+ the `\input` or `\include`.++ * Docx reader:++ + Allow numbering in the style file. This allows inherited styles+ with numbering (lists) (Jesse Rosenthal).++ * Org reader:++ + Support smart punctuation (Craig Bosma).+ + Drop trees with a :noexport: tag (Albert Krewinkel). Trees having a+ `:noexport:` tag set are not exported. This mirrors org-mode.+ + Put header tags into empty spans (Albert Krewinkel, #2160).+ Org mode allows headers to be tagged: `* Headline :TAG1:TAG2`.+ Instead of being interpreted as part of the headline, the tags are now+ put into the attributes of empty spans. Spans without textual content+ won't be visible by default, but they are detectable by filters. They+ can also be styled using CSS when written as HTML.+ + Generalize code block result parsing (Albert Krewinkel).+ Previously, only code blocks were recognized as result blocks;+ now, any kind of block can be the result.++ * Append newline to the LineBreak in Dokuwiki, HTML, EPUB,+ LaTeX, MediaWiki, OpenDocument, Texinfo writers (#1924, Tim Lin).++ * HTML writer:++ + Add "inline" or "display" class to math spans (#1914).+ This allows inline and display math to be styled differently.+ + Include raw latex blocks if `--mathjax` specified (#1938).+ + Require highlighting-kate >= 0.5.14 (#1903).+ This ensures that all code blocks will be wrapped in a `div`+ with class `sourceCode`. Also, the default highlighting CSS+ now adds `div.sourceCode { x-overflow: auto; }`, which means+ that code blocks (even with line numbers) will acquire a scroll+ bar on screens too small to display them (e.g. mobile phones).+ See also jgm/highlighting-kate#65.++ * LaTeX writer:++ + Use a declaration for tight lists (Jose Luis Duran, Joseph+ Harriott). Previously, pandoc hard-coded some commands to make+ tight lists in LaTeX. Now we use a custom command instead,+ allowing the styling to be changed in a macro in the header.+ (Note: existing templates may need to be modified to include+ the definition of this macro. See the current template.)+ + Beamer output: if the header introducing a slide has the+ class `fragile`, add the `[fragile]` option to the slide (#2119).++ * MediaWiki writer:++ + Use `File:` instead of the deprecated `Image:` for images and+ other media files (Greg Rundlett).++ * DocBook writer:++ + Render a `Div (id,_,_) [Para _]` element as a `para` element+ with an `id` attribute. This makes links to citations work in+ DocBook with pandoc-citeproc.++ * RST writer:++ + Normalize headings to sequential levels (Nikolay Yakimov).+ This is pretty much required by docutils.+ + Treat headings in block quotes, etc as rubrics (Nikolay Yakimov).+ + Better handling of raw latex inline (#1961). We use+ `` :raw-latex:`...` `` and add a definition for this role to+ the template.++ * EPUB writer:++ + Remove `linear=no` from cover `itemref` (#1609).+ + Don't use `sup` element for epub footnotes (#1995).+ Instead, just use an a element with class `footnoteRef`.+ This allows more styling options, and provides better results+ in some readers (e.g. iBooks, where anything inside the a+ tag breaks popup footnotes).+ + Take TOC title from `toc-title` metadata field.++ * Docx writer:++ + Implemented `FirstParagraph` style (Jesse Rosenthal).+ Following the ODT writer, we add the `FirstParagraph` style to the+ first text paragraph following an image, blockquote, table, heading,+ or beginning of document. This allows it to be styled differently.+ The default is for it to be the same as `Normal`.+ + Added `BodyText` style (Jesse Rosenthal).+ We apply a `BodyText` style to all unstyled paragraphs. This is,+ essentially, the same as `Normal`, except that since not everything+ inherits from `BodyText` (the metadata won't, for example, or+ the headers or footnote numbers), we can change the text in the body+ without having to make exceptions for everything. If we do want to+ change *everything*, we can still do it through `Normal`.+ + Altered `Blockquote` style slightly (Jesse Rosenthal).+ Since `BlockQuote` derives from `BodyText`, we just want to specify+ by default that it won't indent, regardless of what `BodyText` does.+ Note that this will not produce any visible difference in the default+ configuration.+ + Take TOC title from `toc-title` metadata field (Nikolay Yakimov).+ + Added a style to figure images (Nikolay Yakimov).+ Figures with empty captions use style `Figure`.+ Figures with nonempty captions use style `Figure with Caption`, which+ is based on `Figure`, and additionally has `keepNext` set.++ * ODT writer:++ + Added figure captions (Nikolay Yakimov). The following styles are+ used for figures:+ `Figure` -- for figure with empty caption),+ `FigureWithCaption` (based on `Figure`) -- for figure with caption,+ `FigureCaption` (based on `Caption`) -- for figure captions.+ Also, `TableCaption` (based on `Caption`) is used for table captions.++### API changes++ * New `Text.Pandoc.Error` module with `PandocError` type+ (Matthew Pickering).++ * All readers now return `Either PandocError Pandoc` instead of `Pandoc`+ (Matthew Pickering). This allows better handling of errors.++ * Added `Text.Pandoc.Writers.CommonMark`, exporting `writeCommonMark`.++ * Added `Text.Pandoc.Readers.CommonMark`, exporting `readCommonMark`.++ * Derive `Data` and `Typeable` instances for `MediaBag`, `Extension`,+ `ReaderOptions`, `EPUBVersion`, `CiteMethod`, `ObfuscationMethod`,+ `HTMLSlideVariant`, `TrackChanges`, `WriterOptions` (Shabbaz+ Youssefi).++ * New `Ext_shortcut_reference_links` constructor for `Extension`+ (Konstantin Zudov).++### Bug fixes++ * Markdown reader:++ + Allow smart `'` after inline math (#1909, Nikolay Yakimov).+ + Check for tex macros after indented code (#1973).+ + Rewrote `charsInBalancedBrackets` for efficiency.+ + Make sure a closing `</div>` doesn't get included in a+ definition list item (#2127).+ + Don't parse bracketed text as citation if it might be a link,+ image, or footnote (Nikolay Yakimov).+ + Require space after key in mmd title block (#2026, Nikolay+ Yakimov). Require space after key-value delimiter colon in mmd title+ block.+ + Require nonempty value in mmd title block (Nikolay Yakimov).+ + Disable all metadata block extensions when parsing+ metadata field values (#2026, Nikolay Yakimov). Otherwise we+ could get a mmd title block inside YAML metadata, for example.++ * HTML reader:++ + Improve self-closing tag detection in `htmlInBalanced` (#2146).+ + Handle tables with `<th>` in body rows (#1859, mb21).+ + Fixed `htmlTag` (#1820). If the tag parses as a comment, we check+ to see if the input starts with `<!--`. If not, it's bogus comment+ mode and we fail `htmlTag`.+ + Handle `base` tag; if it has an `href` value, this is added to+ all relative URLs in links and images.++ * DocBook reader:++ + Look inside "info" elements for section titles (#1931).++ * Docx reader:++ + Parse images in deprecated vml format (Jesse Rosenthal).+ + Allow sub/superscript verbatims (Jesse Rosenthal).+ Verbatim usually shuts off all other run styles, but we don't want it+ to shut off sub/superscript.++ * LaTeX reader:++ + Handle `tabular*` environment (#1850).+ Note that the table width is not actually parsed or taken into+ account, but pandoc no longer chokes on it.+ + Ignore options in `\lstinline` rather than raising error (#1997).+ + Add some test cases for simple tables (Mathias Schenner).+ + Handle valign argument in tables (Mathias Schenner) (currently+ we just ignore this).+ + Allow non-empty colsep in tables (Mathias Schenner).+ The `tabular` environment allows non-empty column separators+ with the "@{...}" syntax. Previously, pandoc would fail to+ parse tables if a non-empty colsep was present. With this+ commit, these separators are still ignored, but the table gets+ parsed. A test case is included.+ + Recognize `\newpage` as a block command.+ + Allow block content in `\title{}` (#2001).+ + Check for block-level newcommand aliases in blockCommand (Nikolay+ Yakimov).+ + Guard against paragraph starting with inline macro (Nikolay Yakimov).+ + Properly gobble spaces after `\\` (#2007).++ * Textile reader:++ + Handle newlines in table cells, and empty cells (#1919).++ * Org reader:++ + Allow image links with non-image targets (Hans-Peter Deifel).+ This matches behavior of Org-Mode for links like+ `[[http://example.com][https://www.haskell.org/static/img/logo.png]]`.++ * Docbook writer:++ + Don't print empty id attributes (thanks to Steve Horne).++ * HTML writer:++ + Fixed list-style-type for numbered example lists.+ Should be "decimal," not "example" (#1902).+ + Do not omit missing `alt` attribute on `img` tag (#1131,+ Konstantin Zudov).+ + Allow multiple colgroups in table (#2122).+ + In revealjs, ensure that lists in speaker notes don't add "fragment"+ classes, which can cause additional keypresses to be needed to+ advance a slide (#1394).++ * LaTeX writer:++ + Don't escape `$` in URL (#1913).+ + Don't use listings in headers (Matthew Pickering, #1963).+ + Recognize book documentclass if set in metadata (#1971).+ This sets `--chapters` implicitly if the documentclass in metadata+ is a book documentclass. Previously this was done only if a book+ documentclass was set in a variable.+ + Add a `\label` in `\hyperdef` for Div, Span (or links don't work).+ + Make `mainlang` work when `lang` is in metadata (#2174).++ * Texinfo writer:++ + Fix wrapping by using breakable spaces (Tim Lin).++ * RST writer:++ + Fixed toc depth in RST writer. Previously the depth was being+ rendered as a floating point number with a decimal point.++ * Markdown writer:++ + Improved escaping (#2086). `<` should not be escaped as `\<`, for+ compatibility with original Markdown. We now escape `<` and `>`+ with entities. Also, we now backslash-escape square brackets.+ + Avoid introducing spurious list items through wrapping (#1946).+ + Don't emit span tags if plain or raw HTML disabled.++ * MediaWiki writer:++ + Convert spaces to underscores in wikilink URL (#1982), like MediaWiki.++ * AsciiDoc writer:++ + Insert some needed blank lines (#1860).+ + Avoid wrapping after list marker (#1858).++ * EPUB writer:++ + Properly handle internal links to IDs in spans, divs (#1884).+ + Use plain writer for metadata dc: fields (#2121).+ This gives better results when we have, e.g. multiple paragraphs.+ Note that tags aren't allowed in these fields.+ + Properly handle image links without an extension (#1855).+ + Improved chapter splitting and internal link rewriting (#1887,+ #2162, #2163). This will ensure that internal links work and+ that the references section produced by pandoc-citeproc is+ in its own chapter.+ + Fixed handling of svg images (#2183).++ * ICML writer:++ + Better handling of raw blocks and inlines (#1951).+ Previously these were always escaped and printed verbatim.+ Now they are ignored unless the format is `icml`, in which+ case they are passed through unescaped.+ + Fixed image URIs in ICML output (gohai).++ * Custom writer:++ + Raise error if loadstring returns an error status.+ + Raise `PandocLuaException` instead of using 'error'.+ Eventually we'll change the return type so that no exception+ is involved, but at least this can be trapped.+ + Use UTF-8 aware bytestring conversion.+ + Set foreign encoding to UTF-8 (Nikolay Yakimov, #2101, #1634).+ Also factored out ByteString, since it's only used as an intermediate+ representation.++ * Docx writer:++ + Copy hyphenation settings from reference.docx (Nikolay Yakimov).+ + Filter out illegal XML characters (#1992, Matthew Pickering).+ + Added `noProof` to docx syntax highlighting `SourceCode` style.+ + Added footnotes id -1 and 0 (Jesse Rosenthal).+ Word uses, by default, footnotes with id -1 and 0 for separators. If a+ user modifies `reference.docx`, they will end up with a `settings.xml`+ file that references these footnotes, but no such footnotes in the+ document. This will produce a corruption error. Here we add these to the+ document and `settings.xml` file, so future modifications won't break+ the file.+ + Handle lists correctly inside table cells (Jesse Rosenthal).+ Previously we didn't transform lists inside table cells.+ + Set firstRow information in tables (Nikolay Yakimov).+ + Don't replace `SourceCode` style in `reference.docx` if it is defined+ there (Nikolay Yakimov, #1872). If `--no-highlight` specified, remove+ any `SourceCode` and `*Tok` styles in `reference.docx`.+ + Attempt to match international style names (#1607, Nikolay Yakimov).+ + Set these styles as custom (Nikolay Yakimov): `Author`, `Abstract`,+ `Compact`, `Image Caption`, `Table Caption`, `Definition Term`,+ `Definition`, `First Paragraph`.+ + Rename these styles to correspond with Word `Normal.dotm` (Nikolay+ Yakimov): `Block Quote -> Block Text`, `Link -> Hyperlink`,+ `Footnote Ref -> Footnote Reference`.+ + Added `Caption` style (Nikolay Yakimov).+ + Changed these styles' inheritance (Nikolay Yakimov):+ `Image Caption <- Caption`, `Table Caption <- Caption`.+ + Remove `SourceCode` style from `reference.docx` (#1872).+ This is added automatically by the docx writer.+ + Added toc heading style to `reference.docx` (Nikolay Yakimov).++ * `Text.Pandoc.PDF`++ + Don't suggest "Try xelatex" if xelatex already in use (mb21, #1832).+ + More comprehensible errors on image conversion (#2067).+ EPS can't be supported without shelling out to something like+ ImageMagick, but at least we can avoid mysterious error messages.++ * `Text.Pandoc.Shared`:++ + Make safeRead safe (#1801, Matthew Pickering).+ + Added `mapLeft`, `hush` (Matthew Pickering).++ * `Text.Pandoc.Pretty`:++ + Remove partial function (Matthew Pickering).++ * `Text.Pandoc.SelfContained`:++ + Add `;charset=utf-8` to script mime type if missing (#1842).+ + Improved building of data URIs (#1940). Now base64 is used except+ for `text/*` mime types.+ + `cssURLs` no longer tries to fetch fragment URLs (#2121).+ + Properly handle data URIs in css urls (#2129).+ Use a proper CSS parser (adds dependency on `text-css`).++ * `Text.Pandoc.UTF8`:++ + Better handling of bare CRs in input files (#2132).+ Previously we just stripped them out; now we convert+ other line ending styles to LF line endings.++ * `Text.Pandoc.ImageSize`:++ + Fixed some exif header parsing bugs (#1834).+ + Make imageSize return an Either, not a Maybe (#1834).+ Use `runGetOrFail` (with `binary >= 0.7`) to return `Left` on+ parse failure (rather than `error`).+ + Improved warnings when image size can't be determined.+ + Removed error landmines (Matthew Pickering).++ * Added woff2 to MIME types (Alfred Wechselberger).++ * pandoc: When a binary input format is used, warn that file+ arguments past the first one are being ignored (Matthew Pickering).++### Template changes++ * LaTeX template:++ + Degrade gracefully if `\paragraph` not defined.+ + Include `grffile` together with `graphicx` (#2074).+ This properly handles filenames containing spaces and dots.+ + Redefine `\paragraph`, `\subparagraph`... to behave more+ like section headers (#1658).+ + Import hyperref before polyglossia to avoid an error with xelatex,+ "please load package hyperref before bidi package" (Nick Bart).+ + Added `toccolor` variable to control link color in toc (Kaixhin).++ * LaTeX, Beamer templates:++ + Provide `\tightlist`, which is now used by the LaTeX writer.+ + Use polyglossia in beamer (#85).+ + Use `bibliography` instead of `biblio-files`+ (#1661). Also use `\addbibresource` instead of `\bibliography` for+ biblatex.+ + Added `setotherlanguages` in polyglossia. This uses an `otherlang`+ variable that is derived from a comma-separated list in `lang`;+ the last language is `mainlang` and the others are `otherlang`.++ * EPUB templates:++ + Use `div`, not `p`, for "rights" on title page.+ + Added header-includes, include-before, include-after (#1987).++ * OpenDocument template:++ + Use `text:p` instead of `text:h` for title.+ Using `text:h` causes problems with numbering. Closes #2059.+ Thanks to @nkalvi for diagnosing this.++ * reveal.js template:++ + Link to non-minified css, js. The minified versions no longer+ ship with the library.+ + Correctly include style CSS (#1949).+ + New configurable options options: `center`, `maxScale`, `slideNuber`+ (Dmitry Smirnov, pandoc-templates#89).+ + Moved custom CSS after theme. This allows custom CSS to modify+ themes, instead of being replaced by them.+ + Allow `center` to be set to false.++### Under the hood improvements++ * Removed pre-built `reference.docx` and `reference.odt` (Nikolay+ Yakimov). Instead the repository now includes the component text files,+ and the zipped binaries are built from these using a helper+ program, `make-reference-files`. This should make maintenance of+ these components easier going forward.++ * `Text.Pandoc.Parsing`:++ + Added new `<+?>` combinator (Nikolay Yakimov).+ + Added `stateHeaderKeys` to `ParserState`.++ * `make_deb.sh` fixes:++ + Detect architecture.+ + Add Installed-Size to debian package control file (#1900).+ + Use `fakeroot` to get permissions right.+ + Use `mkdir` and `cp` instead of `install`.+ + Set permissions of directories to 755.+ + Install in `/usr` rather than `/usr/local`.+ + Compress man pages.+ + Combine copyright files for `pandoc`, `pandoc-citeproc`.++ * Added `Text.Pandoc.Compat.Locale` and `old-locale` flag+ to assist with transition to `time` 1.5.++ * Updated CONTRIBUTING.md with information about issue tags (Matthew+ Pickering).++ * Updated travis installs to the new sudo-less syntax (Tim Lin).++ * Updated dependency version bounds.++ * EPUB tests: don't use `joinPath`, which varies across platforms.+ Instead, use a forward-slash to join paths, regardless of the+ platform. This matches the way `MediaBag` now works.++ * Clarify JSON input and output in usage message (Caleb McDaniel).++ * Improved INSTALL instructions.++ * Always build man pages. Removed make-pandoc-man-pages flag.++ * Makefile: removed man target, now that we generate man pages by default.++ * README:++ + Fixed typos (J. Lewis Muir).+ + Added documentation on backtick_code_blocks (#2135, Nikolay Yakimov).+ + Added note on in-field markup in biblio databases (Nick Bart).+ + Fixed misleading example of raw HTML block.+ + Various minor formatting and consistency fixes for the program+ options (Andreas Lööw).+ + Made definition lists for options all "loose" for consistency.+ + Added YAML biblio format to table, and note on `pandoc-citeproc`'s+ `--bib2json` and `--bib2yaml` options (Nick Bart).+ + Removed obsolete reference to `mods2yaml` (Nick Bart).+ + Added section on syntax highlighting.+ + Documented `toccolor` variable.++## pandoc 1.13.2.1 (2015-04-15)++ * Updated to build with ghc 7.10.1.++ * Bumped package upper bounds for filepath, blaze-html, blaze-markup.++## pandoc 1.13.2 (2014-12-20)++ * TWiki Reader: add new new twiki reader (API chaneg, Alexander Sulfrian).++ * Markdown reader:++ + Better handling of paragraph in div (#1591).+ Previously text that ended a div would be parsed as Plain+ unless there was a blank line before the closing div tag.+ + Don't treat a citation as a reference link label (#1763).+ + Fix autolinks with following punctuation (#1811).+ The price of this is that autolinked bare URIs can no longer+ contain `>` characters, but this is not a big issue.+ + Fix `Ext_lists_without_preceding_blankline` bug (#1636, Artyom).+ + Allow `startnum` to work without `fancy_lists`. Formerly+ `pandoc -f markdown-fancy_lists+startnum` did not work properly.++ * RST reader (all Daniel Bergey):++ + Parse quoted literal blocks (#65). RST quoted literal blocks are+ the same as indented literal blocks (which pandoc already supports)+ except that the quote character is preserved in each line.+ + Parse RST class directives. The class directive accepts one or more+ class names, and creates a Div value with those classes. If the+ directive has an indented body, the body is parsed as the children of+ the Div. If not, the first block following the directive is made a+ child of the Div. This differs from the behavior of rst2xml, which+ does not create a Div element. Instead, the specified classes are+ applied to each child of the directive. However, most Pandoc Block+ constructors to not take an Attr argument, so we can't duplicate this+ behavior.+ + Warn about skipped directives.+ + Literal role now produces Code. Code role should have "code" class.+ + Improved support for custom roles++ - Added `sourceCode` to classes for `:code:` role, and anything+ inheriting from it.+ - Add the name of the custom role to classes if the Inline+ constructor supports Attr.+ - If the custom role directive does not specify a parent role,+ inherit from the `:span:` role.++ This differs somewhat from the `rst2xml.py` behavior. If a custom+ role inherits from another custom role, Pandoc will attach both+ roles' names as classes. `rst2xml.py` will only use the class of+ the directly invoked role (though in the case of inheriting from a+ `:code:` role with a `:language:` defined, it will also provide the+ inherited language as a class).+ + Warn about ignored fields in role directives.++ * LaTeX reader:++ + Parse label after caption into a span instead of+ inserting an additional paragraph of bracketed text (#1747).+ + Parse math environments as inline when possible (#1821).+ + Better handling of `\noindent` and `\greektext` (#1783).+ + Handle `\texorpdfstring` more gracefully.+ + Handle `\cref` and `\sep` (Wikiwide).+ + Support `\smartcite` and `\Smartcite` from biblatex.++ * HTML reader:++ + Retain display type of MathML output (#1719, Matthew Pickering).+ + Recognise `<br>` tags inside `<pre>` blocks (#1620, Matthew Pickering).+ + Make `embed` tag either block or inline (#1756).++ * DocBook reader:++ + Handle `keycombo`, `keycap` (#1815).+ + Get string content in inner tags for literal elements (#1816).+ + Handle `menuchoice` elements better, with a `>` between (#1817).+ + Include `id` on section headers (#1818).+ + Document/test "type" as implemented (Brian O'Sullivan).+ + Add support for calloutlist and callout (Brian O'Sullivan).+ We treat a calloutlist as a bulleted list. This works well in practice.+ + Add support for `classname` (Bryan O'Sullivan).++ * Docx reader:++ + Fix window path for image lookup (Jesse Rosenthal).+ Don't use os-sensitive "combine", since we always want the paths in our+ zip-archive to use forward-slashes.+ + Single-item headers in ordered lists are headers (Jesse Rosenthal).+ When users number their headers, Word understands that as a single item+ enumerated list. We make the assumption that such a list is, in fact,+ a header.+ + Rewrite rewriteLink to work with new headers (Jesse Rosenthal).+ There could be new top-level headers after making lists, so we have to+ rewrite links after that.+ + Use polyglot header list (Jesse Rosenthal).+ We're just keeping a list of header formats that different languages+ use as their default styles. At the moment, we have English, German,+ Danish, and French. We can continue to add to this.+ This is simpler than parsing the styles file, and perhaps less+ error-prone, since there seems to be some variations, even within a+ language, of how a style file will define headers.+ + Remove header class properly in other langs (Jesse Rosenthal).+ When we encounter one of the polyglot header styles, we want to remove+ that from the par styles after we convert to a header. To do that, we+ have to keep track of the style name, and remove it appropriately.+ + Account for external link URLs with anchors. Previously, if a URL+ had an anchor, the reader would incorrectly identify it as an+ internal link and return only the anchor as URL. (Caleb McDaniel)+ + Fix for Issue #1692 (i18n styles) (Nikolay Yakimov).++ * Org reader:++ + Added state changing blanklines (Jesse Rosenthal).+ This allows us to emphasize at the beginning of a new paragraph (or, in+ general, after blank lines).+ + Fixed bug with bulleted lists:++ - a+ - b+ * c++ was being parsed as a list, even though an unindented `*`+ should make a heading. See+ <http://orgmode.org/manual/Plain-lists.html#fn-1>.+ + Org reader: absolute, relative paths in link (#1741, Albert+ Krewinkel). The org reader was too restrictive when parsing links;+ some relative links and links to files given as absolute paths+ were not recognized correctly.+ + Org reader: allow empty links (jgm/gitit#471, Albert Krewinkel).+ This is important for use in gitit, which uses empty links+ for wikilinks.+ + Respect indent when parsing Org bullet lists (#1650, Timothy+ Humphries). Fixes issue with top-level bullet list parsing.+ + Fix indent issue for definition lists (Timothy Humphries,+ see #1650, #1698, #1680).+ + Parse multi-inline terms correctly in definition list (#1649,+ Matthew Pickering).+ + Fix rules for emphasis recognition (Albert Krewinkel).+ Things like `/hello,/` or `/hi'/` were falsy recognized as emphasised+ strings. This is wrong, as `,` and `'` are forbidden border chars and+ may not occur on the inner border of emphasized text.+ + Drop COMMENT document trees (Albert Krewinkel).+ Document trees under a header starting with the word `COMMENT` are+ comment trees and should not be exported. Those trees are dropped+ silently (#1678).+ + Properly handle links to `file:target` (Albert Krewinkel).+ Org links like `[[file:target][title]]` were not handled correctly,+ parsing the link target verbatim. The org reader is changed such that+ the leading `file:` is dropped from the link target (see #756, #1812).+ + Parse LaTeX-style MathML entities (#1657, Albert Krewinkel).+ Org supports special symbols which can be included using LaTeX syntax,+ but are actually MathML entities. Examples for this are+ `\nbsp` (non-breaking space), `\Aacute` (the letter A with accent acute)+ or `\copy` (the copyright sign ©)++ * EPUB reader:++ + URI handling improvements. Now we outsource most of the work to+ `fetchItem'`. Also, do not include queries in file extensions (#1671).++ * LaTeX writer:++ + Use `\texorpdfstring` for section captions when needed (Vaclav Zeman).+ + Handle consecutive linebreaks (#1733).+ + Protect graphics in headers (Jesse Rosenthal).+ Graphics in `\section`/`\subsection` etc titles need to be `\protect`ed.+ + Put `~` before header in list item text (Jesse Rosenthal).+ Because of the built-in line skip, LaTeX can't handle a section header+ as the first element in a list item.+ + Avoid using reserved characters as `\lstinline` delimiters (#1595).+ + Better handling of display math in simple tables (#1754).+ We convert display math to inline math in simple tables,+ since LaTeX can't deal with display math in simple tables.+ + Escape spaces in code (#1694, Bjorn Buckwalter).++ * MediaWiki writer:++ + Fixed links with URL = text. Previously these were rendered as bare+ words, even if the URL was not an absolute URL (#1825).++ * ICML writer:++ + Don't force all citations into footnotes.++ * RTF writer:++ + Add blankline at end of output (#1732, Matthew Pickering).++ * RST writer:++ + Ensure blank line after figure.+ + Avoid excess whitespace after last list item (#1777).+ + Wrap line blocks with spaces before continuations (#1656).+ + Fixed double-rendering of footnotes in RST tables (#1769).++ * DokuWiki writer:++ + Better handling of block quotes. This change ensures that+ multiple paragraph blockquotes are rendered using native `>`+ rather than as HTML (#1738).+ + Fix external images (#1739). Preface relative links with ":",+ absolute URIs without. (Timothy Humphries)++ * HTML writer:++ + Use protocol-relative URL for mathjax.+ + Put newline btw img and caption paragraph.+ + MathML now outputted with tex annotation (#1635, Matthew Pickering).+ + Add support for KaTeX HTML math (#1626, Matthew Pickering).+ This adds `KaTeX` to `HTMLMathMethod` (API change).+ + Don't double render when `email-obfuscation=none` (#1625, Matthew+ Pickering).+ + Make header attributes work outside top level (#1711).+ Previously they only appeared on top level header elements.+ Now they work e.g. in blockquotes.++ * ODT writer:++ + Correctly handle images without extensions (#1729).+ + Strip querystring in ODT write (#1682, Todd Sifleet).++ * FB2 writer:++ + Add newline to output.++ * EPUB writer:++ + Don't add `sourceURL` to absolute URIs (#1669).+ + Don't use unsupported `opf:title-type` for epub2.+ + Include "landmarks" section in nav document for epub3 (#1757).+ + Removed playOrder from navpoint elements in ncx file (#1760).+ These aren't required, and they make manual modification of epubs+ difficult.+ + Extract title even from structured title.+ + Don't include nav node in spine unless `--toc` was requested.+ Previously we included it in the spine with `linear="no"`, leading+ to odd results in some readers (#1593).+ + Fixed absolute URI detection (#1672).+ + Correctly resolve relative URIs (#1671).+ + Use regular page template for `nav.xhtml`, including doctype (#1759).++ * Docx writer:++ + Put docx table captions above tables (#1641, Nikolay Yakimov).+ + Get the page width from the reference docx file, and use+ it to scale images that are too large to fit (Grégory Bataille).+ + Partial fix for #1607 (Nikolay Yakimov). International heading styles+ are inferred based on `<w:name val="heading #">` fallback, if there+ are no en-US "Heading#" styles+ + Look in user data dir for archive `reference.docx`.+ + Renumber header and footer relationships to avoid collisions (Jesse+ Rosenthal). We previously took the old relationship names of the+ headers and footer in secptr. That led to collisions. We now make+ a map of available names in the relationships file, and then rename+ in secptr.++ * ConTeXt writer:++ + Add function toLabel (Mark Szepieniec).+ This function can be used to sanitize reference labels so that+ they do not contain any of the illegal characters \#[]",{}%()|= .+ Currently only Links have their labels sanitized, because they+ are the only Elements that use passed labels.++ * `Text.Pandoc.Shared`:++ + Moved import of `toChunks` outside of CPP conditional (#1590).+ + Fix `inDirectory` to reset to the original directory in case+ an exception occurs (Freiric Barral).++ * Templates:++ + LaTeX template: load polyglossia before bibtex (jgm/pandoc-templates#70).+ Thanks to bluebirch.+ + LaTeX template: Added `\VerbatimFootnotes` if there is verbatim in notes+ (#1616).+ + LaTeX template: Add shorthands=off to babel options (#1648).+ + EPUB, EPUB3 templates: Added `id="cover"` to body of cover page.+ This aids styling, making it possible for example to set 0 margins+ on the title page (#1758).+ + EPUB, EPUB3 templates: Handle structured metadata on titlepage.+ Previously we just expected 'title', 'subtitle', 'author', 'date'.+ Now we still support those, but also support the format recommended+ for epub metadata in the pandoc README:++ ---+ title:+ - type: main+ text: My Book+ - type: subtitle+ text: An investigation of metadata+ creator:+ - role: author+ text: John Smith+ - role: editor+ text: Sarah Jones+ identifier:+ - scheme: DOI+ text: doi:10.234234.234/33+ publisher: My Press+ rights: (c) 2007 John Smith, CC BY-NC+ ...++ * `Text.Pandoc.Templates.getDefaultTemplate`:+ don't fail when called with "fb2" (#1660).++ * `Text.Pandoc.Parsing`:++ + Fixed `inlineMath` so it handles `\text{..}` containing `$`.+ For example: `$x = \text{the $n$th root of $y$}` (#1677).+ + Change `parseFromString` to fail if not all input is consumed.+ (Matthew Pickering)+ + Moved `addWarning` from Markdown reader to `Parsing`, so it can be+ used by more readers (API change, Daniel Bergey).++ * `Text.Pandoc.Pretty`:++ + Improve performance of `realLength` (Matthew Pickering).+ + Make CR + BLANKLINE = BLANKLINE. This fixes an extra blank line we+ were getting at the end of markdown fragments (as well as rst, org,+ etc.) (#1705).++ * `Text.Pandoc.MIME`:++ + Add mime type for WebVTT (Jason Ronallo).+ + Changed mime type for `otf` to `application/vnd.ms-opentype` (#1761).+ This is needed for epub3 validation.++ * `Text.Pandoc.MediaBag`:++ + Fix Windows specific path problems (#1597).++ * `Text.Pandoc.Shared`:++ + Make `collapseFilePath` OS-agnostic (Matthew Pickering).++ * Link the test suite using `-threaded`.+ This allows the test suite to be run using `+RTS -N`.++ * Added `network` dependency under `network-uri` flag in test section.++ * Give better error messages when someone tries to convert from+ pdf, doc, odt (#1683).++ * Added `track` to list of tags treated by `--self-contained` (#1664).+++## pandoc 1.13.1 (2014-08-30)++ * Fixed `--self-contained` with Windows paths (#1558).+ Previously `C:\foo.js` was being wrongly interpreted as a URI.++ * HTML reader: improved handling of tags that can be block or inline.+ Previously a section like this would be enclosed in a paragraph,+ with RawInline for the video tags (since video is a tag that can+ be either block or inline):++ <video controls="controls">+ <source src="../videos/test.mp4" type="video/mp4" />+ <source src="../videos/test.webm" type="video/webm" />+ <p>+ The videos can not be played back on your system.<br/>+ Try viewing on Youtube (requires Internet connection):+ <a href="http://youtu.be/etE5urBps_w">Relative Velocity on+ Youtube</a>.+ </p>+ </video>++ This change will cause the video and source tags to be parsed+ as RawBlock instead, giving better output.+ The general change is this: when we're parsing a "plain" sequence+ of inlines, we don't parse anything that COULD be a block-level tag.++ * Docx reader:++ + Be sensitive to user styles. Note that "Hyperlink" is+ "blacklisted," as we don't want the default underline styling to be+ inherited by all links by default (Jesse Rosenthal).+ + Read single paragraph in table cell as `Plain` (Jesse Rosenthal).+ This makes to docx reader's native output fit with the way the markdown+ reader understands its markdown output.++ * Txt2Tags reader:++ + Header is now parsed only if standalone flag is set (Matthew Pickering).+ + The header is now parsed as meta information. The first line is the+ `title`, the second is the `author` and third line is the `date`+ (Matthew Pickering).+ + Corrected formatting of `%%mtime` macro (Matthew Pickering).+ + Fixed crash when reading from stdin.++ * Textile writer: Extended the range of cases where native textile+ tables will be used (as opposed to raw HTML): we now handle any+ alignment type, but only for simple tables with no captions.++ * EPUB writer: Don't use page-progression-direction in EPUB2, which+ doesn't support it. Also, if page-progression-direction not specified+ in metadata, don't include the attribute even in EPUB3; not including it+ is the same as including it with the value "default", as we did before.+ (#1550)++ * Org writer: Accept example lines with indentation at the beginning+ (Calvin Beck).++ * DokuWiki writer:++ + Refactor to use Reader monad (Matthew Pickering).+ + Avoid using raw HTML in table cells; instead, use `\\`+ instead of newlines (Jesse Rosenthal).+ + Properly handle HTML table cell alignments, and use spacing+ to make the tables look prettier (#1566).++ * Docx writer:++ + Bibliography entries get `Bibliography` style (#1559).+ + Implement change tracking (Jesse Rosenthal).++ * LaTeX writer:++ + Fixed a bug that caused a table caption to repeat across all pages+ (Jose Luis Duran).+ + Improved vertical spacing in tables and made it customizable using+ standard lengths set by booktab. See+ <https://groups.google.com/forum/#!msg/pandoc-discuss/qMu6_5lYy0o/ZAU7lzAIKw0J>+ (Jose Luis Duran).+ + Added `\strut` to fix spacing in multiline tables (Jose Luis Duran).+ + Use `\tabularnewline` instead of `\\` in table cells (Jose Luis Duran).+ + Made horizontal rules more flexible (Jose Luis Duran).++ * Text.Pandoc.MIME:++ + Added `MimeType` (type synonym for `String`) and `getMimeTypeDef`.+ Code cleanups (Artyom Kazak).++ * Templates:++ + LaTeX template: disable microtype protrusion for typewriter font (#1549,+ thanks lemzwerg).++ * Improved OSX build procedure.++ * Added `network-uri` flag, to deal with split of `network-uri` from+ `network`.++ * Fix build dependencies for the `trypandoc` flag, so that they are+ ignored if `trypandoc` flag is set to False (Gabor Pali).++ * Updated README to remove outdated claim that `--self-contained`+ looks in the user data directory for missing files.++## pandoc 1.13.0.1 (2014-08-17)++ * Docx writer:++ + Fixed regression which bungled list numbering (#1544), causing+ all lists to appear as basic ordered lists.+ + Include row width in table rows (Christoffer Ackelman, Viktor Kronvall).+ Added a property to all table rows where the sum of column widths+ is specified in pct (fraction of 5000). This helps persuade Word+ to lay out the table with the widths we specify.++ * Fixed a bug in Windows 8 which caused pandoc not to find the+ `pandoc-citeproc` filter (#1542).++ * Docx reader: miscellaneous under-the-hood improvements (Jesse Rosenthal).+ Most significantly, the reader now uses Builder, leading to some+ performance improvements.++ * HTML reader: Parse appropriately styled span as SmallCaps.++ * Markdown writer: don't escape `$`, `^`, `~` when `tex_math_dollars`,+ `superscript`, and `subscript` extensions, respectively, are+ deactivated (#1127).++ * Added `trypandoc` flag to build CGI executable used in the online+ demo.++ * Makefile: Added 'quick', 'osxpkg' targets.++ * Updated README in templates to indicate templates license.+ The templates are dual-licensed, BSD3 and GPL2+.++## pandoc 1.13 (15 August 2014)++### New features++ * Added `docx` as an input format (Jesse Rosenthal). The docx+ reader includes conversion of native Word equations to pandoc+ LaTeX `Math` elements. Metadata is taken from paragraphs at the+ beginning of the document with styles `Author`, `Title`, `Subtitle`,+ `Date`, and `Abstract`.++ * Added `epub` as an input format (Matthew Pickering). The epub+ reader includes conversion of MathML to pandoc LaTeX `Math`+ elements.++ * Added `t2t` (Txt2Tags) as an input format (Matthew Pickering).+ Txt2tags is a lightweight markup format described at+ <http://txt2tags.org/>.++ * Added `dokuwiki` as an output format (Clare Macrae).++ * Added `haddock` as an output format.++ * Added `--extract-media` option to extract media contained in a zip+ container (docx or epub) while adjusting image paths to point to the+ extracted images.++ * Added a new markdown extension, `compact_definition_lists`, that+ restores the syntax for definition lists of pandoc 1.12.x, allowing+ tight definition lists with no blank space between items, and+ disallowing lazy wrapping. (See below under behavior changes.)++ * Added an extension `epub_html_exts` for parsing HTML in EPUBs.++ * Added extensions `native_spans` and `native_divs` to activate+ parsing of material in HTML span or div tags as Pandoc Span+ inlines or Div blocks.++ * `--trace` now works with the Markdown, HTML, Haddock, EPUB,+ Textile, and MediaWiki readers. This is an option intended+ for debugging parsing problems; ordinary users should not need+ to use it.++### Behavior changes++ * Changed behavior of the `markdown_attribute` extension, to bring+ it in line with PHP markdown extra and multimarkdown. Setting+ `markdown="1"` on an outer tag affects all contained tags,+ recursively, until it is reversed with `markdown="0"` (#1378).++ * Revised markdown definition list syntax (#1429). Both the reader+ and writer are affected. This change brings pandoc's definition list+ syntax into alignment with that used in PHP markdown extra and+ multimarkdown (with the exception that pandoc is more flexible about+ the definition markers, allowing tildes as well as colons). Lazily+ wrapped definitions are now allowed. Blank space is required+ between list items. The space before a definition is used to determine+ whether it is a paragraph or a "plain" element. **WARNING: This change+ may break existing documents!** Either check your documents for+ definition lists without blank space between items, or use+ `markdown+compact_definition_lists` for the old behavior.++ * `.numberLines` now works in fenced code blocks even if no language+ is given (#1287, jgm/highlighting-kate#40).++ * Improvements to `--filter`:++ + Don't search PATH for a filter with an explicit path.+ This fixed a bug wherein `--filter ./caps.py` would run `caps.py` from+ the system path, even if there was a `caps.py` in the working directory.+ + Respect shebang if filter is executable (#1389).+ + Don't print misleading error message.+ Previously pandoc would say that a filter was not found,+ even in a case where the filter had a syntax error.++ * HTML reader:++ + Parse `div` and `span` elements even without `--parse-raw`,+ provided `native_divs` and `native_spans` extensions are set.+ Motivation: these now generate native pandoc Div and Span+ elements, not raw HTML.+ + Parse EPUB-specific elements if the `epub_html_exts`+ extension is enabled. These include `switch`, `footnote`,+ `rearnote`, `noteref`.++ * Org reader:++ + Support for inline LaTeX. Inline LaTeX is now accepted and parsed by the+ org-mode reader. Both math symbols (like `\tau`) and LaTeX commands (like+ `\cite{Coffee}`), can be used without any further escaping (Albert+ Krewinkel).++ * Textile reader and writer:++ + The `raw_tex` extension is no longer set by default. You can+ enable it with `textile+raw_tex`.++ * DocBook reader:++ + Support `equation`, `informalequation`, `inlineequation` elements with+ `mml:math` content. This is converted into LaTeX and put into a Pandoc+ Math inline.++ * Revised `plain` output, largely following the style of Project+ Gutenberg:++ + Emphasis is rendered with `_underscores_`, strong emphasis+ with ALL CAPS.+ + Headings are rendered differently, with space to set them off,+ not with setext style underlines. Level 1 headers are ALL CAPS.+ + Math is rendered using unicode when possible, but without the+ distracting emphasis markers around variables.+ + Footnotes use a regular `[n]` style.++ * Markdown writer:++ + Horizontal rules are now a line across the whole page.+ + Prettier pipe tables. Columns are now aligned (#1323).+ + Respect the `raw_html` extension. `pandoc -t markdown-raw_html`+ no longer emits any raw HTML, including span and div tags+ generated by Span and Div elements.+ + Use span with style for `SmallCaps` (#1360).++ * HTML writer:++ + Autolinks now have class `uri`, and email autolinks have class+ `email`, so they can be styled.++ * Docx writer:++ + Document formatting is carried over from `reference.docx`.+ This includes margins, page size, page orientation, header,+ and footer, including images in headers and footers.+ + Include abstract (if present) with `Abstract` style (#1451).+ + Include subtitle (if present) with `Subtitle` style, rather+ than tacking it on to the title (#1451).++ * Org writer:++ + Write empty span elements with an id attribute as org anchors.+ For example `Span ("uid",[],[]) []` becomes `<<uid>>`.++ * LaTeX writer:++ + Put table captions above tables, to match the conventional+ standard. (Previously they appeared below tables.)+ + Use `\(..\)` instead of `$..$` for inline math (#1464).+ + Use `\nolinkurl` in email autolinks. This allows them to be styled+ using `\urlstyle{tt}`. Thanks to Ulrike Fischer for the solution.+ + Use `\textquotesingle` for `'` in inline code. Otherwise we get+ curly quotes in the PDF output (#1364).+ + Use `\footnote<.>{..}` for notes in beamer, so that footnotes+ do not appear before the overlays in which their markers appear+ (#1525).+ + Don't produce a `\label{..}` for a Div or Span element. Do produce+ a `\hyperdef{..}` (#1519).++ * EPUB writer:++ + If the metadata includes `page-progression-direction` (which can be+ `ltr` or `rtl`, the `page-progression-direction` attribute will+ be set in the EPUB spine (#1455).++ * Custom lua writers:++ + Custom writers now work with `--template`.+ + Removed HTML header scaffolding from `sample.lua`.+ + Made citation information available in lua writers.++ * `--normalize` and `Text.Pandoc.Shared.normalize` now consolidate+ adjacent `RawBlock`s when possible.++### API changes++ * Added `Text.Pandoc.Readers.Docx`, exporting `readDocx` (Jesse Rosenthal).++ * Added `Text.Pandoc.Readers.EPUB`, exporting `readEPUB` (Matthew+ Pickering).++ * Added `Text.Pandoc.Readers.Txt2Tags`, exporting `readTxt2Tags` (Matthew+ Pickering).++ * Added `Text.Pandoc.Writers.DokuWiki`, exporting `writeDokuWiki`+ (Clare Macrae).++ * Added `Text.Pandoc.Writers.Haddock`, exporting `writeHaddock`.++ * Added `Text.Pandoc.MediaBag`, exporting `MediaBag`, `lookupMedia`,+ `insertMedia`, `mediaDirectory`, `extractMediaBag`. The docx and epub+ readers return a pair of a `Pandoc` document and a `MediaBag` with+ the media resources they contain. This can be extracted using+ `--extract-media`. Writers that incorporate media (PDF, Docx,+ ODT, EPUB, RTF, or HTML formats with `--self-contained`) will look+ for resources in the `MediaBag` generated by the reader, in addition to+ the file system or web.++ * `Text.Pandoc.Readers.TexMath`: Removed deprecated `readTeXMath`.+ Renamed `readTeXMath'` to `texMathToInlines`.++ * `Text.Pandoc`: Added `Reader` data type (Matthew Pickering).+ `readers` now associates names of readers with `Reader`+ structures. This allows inclusion of readers, like the docx+ reader, that take binary rather than textual input.++ * `Text.Pandoc.Shared`:++ + Added `capitalize` (Artyom Kazak), and replaced uses of+ `map toUpper` (which give bad results for many languages).+ + Added `collapseFilePath`, which removes intermediate `.` and+ `..` from a path (Matthew Pickering).+ + Added `fetchItem'`, which works like `fetchItem` but searches+ a `MediaBag` before looking on the net or file system.+ + Added `withTempDir`.+ + Added `removeFormatting`.+ + Added `extractSpaces` (from HTML reader) and generalized its type+ so that it can be used by the docx reader (Matthew Pickering).+ + Added `ordNub`.+ + Added `normalizeInlines`, `normalizeBlocks`.+ + `normalize` is now `Pandoc -> Pandoc` instead of+ `Data a :: a -> a`. Some users may need to change their uses of+ `normalize` to the newly exported `normalizeInlines` or+ `normalizeBlocks`.++ * `Text.Pandoc.Options`:++ + Added `writerMediaBag` to `WriterOptions`.+ + Removed deprecated and no longer used `readerStrict` in+ `ReaderOptions`. This is handled by `readerExtensions` now.+ + Added `Ext_compact_definition_lists`.+ + Added `Ext_epub_html_exts`.+ + Added `Ext_native_divs` and `Ext_native_spans`.+ This allows users to turn off the default pandoc behavior of+ parsing contents of div and span tags in markdown and HTML+ as native pandoc Div blocks and Span inlines.++ * `Text.Pandoc.Parsing`:++ + Generalized `readWith` to `readWithM` (Matthew Pickering).+ + Export `runParserT` and `Stream` (Matthew Pickering).+ + Added `HasQuoteContext` type class (Matthew Pickering).+ + Generalized types of `mathInline`, `smartPunctuation`, `quoted`,+ `singleQuoted`, `doubleQuoted`, `failIfInQuoteContext`,+ `applyMacros` (Matthew Pickering).+ + Added custom `token` (Matthew Pickering).+ + Added `stateInHtmlBlock` to `ParserState`. This is used to keep+ track of the ending tag we're waiting for when we're parsing inside+ HTML block tags.+ + Added `stateMarkdownAttribute` to `ParserState`. This is used+ to keep track of whether the markdown attribute has been set in+ an enclosing tag.+ + Generalized type of `registerHeader`, using new type classes+ `HasReaderOptions`, `HasIdentifierList`, `HasHeaderMap` (Matthew+ Pickering). These allow certain common functions to be reused+ even in parsers that use custom state (instead of `ParserState`),+ such as the MediaWiki reader.+ + Moved `inlineMath`, `displayMath` from Markdown reader to Parsing,+ and generalized their types (Matthew Pickering).++ * `Text.Pandoc.Pretty`:++ + Added `nestle`.+ + Added `blanklines`, which guarantees a certain number of blank lines+ (and no more).++### Bug fixes++ * Markdown reader:++ + Fixed parsing of indented code in list items. Indented code+ at the beginning of a list item must be indented eight spaces+ from the margin (or edge of the container), or four spaces+ from the list marker, whichever is greater.+ + Fixed small bug in HTML parsing with `markdown_attribute`, which+ caused incorrect tag nesting for input like+ `<aside markdown="1">*hi*</aside>`.+ + Fixed regression with intraword underscores (#1121).+ + Improved parsing of inline links containing quote characters (#1534).+ + Slight rewrite of `enclosure`/`emphOrStrong` code.+ + Revamped raw HTML block parsing in markdown (#1330).+ We no longer include trailing spaces and newlines in the+ raw blocks. We look for closing tags for elements (but without+ backtracking). Each block-level tag is its own `RawBlock`;+ we no longer try to consolidate them (though `--normalize` will do so).+ + Combine consecutive latex environments. This helps when you have+ two minipages which can't have blank lines between them (#690, #1196).+ + Support smallcaps through span.+ `<span style="font-variant:small-caps;">foo</span>` will be+ parsed as a `SmallCaps` inline, and will work in all output+ formats that support small caps (#1360).+ + Prevent spurious line breaks after list items (#1137). When the+ `hard_line_breaks` option was specified, pandoc would formerly+ produce a spurious line break after a tight list item.+ + Fixed table parsing bug (#1333).+ + Handle `c++` and `objective-c` as language identifiers in+ github-style fenced blocks (#1318).+ + Inline math must have nonspace before final `$` (#1313).++ * LaTeX reader:++ + Handle comments at the end of tables. This resolves the issue+ illustrated in <http://stackoverflow.com/questions/24009489>.+ + Correctly handle table rows with too few cells. LaTeX seems to+ treat them as if they have empty cells at the end (#241).+ + Handle leading/trailing spaces in `\emph` better.+ `\emph{ hi }` gets parsed as `[Space, Emph [Str "hi"], Space]`+ so that we don't get things like `* hi *` in markdown output.+ Also applies to `textbf` and some other constructions (#1146).+ + Don't assume preamble doesn't contain environments (#1338).+ + Allow (and discard) optional argument for `\caption` (James Aspnes).++ * HTML reader:++ + Fixed major parsing problem with HTML tables. Table cells were+ being combined into one cell (#1341).+ + Fixed performance issue with malformed HTML tables.+ We let a `</table>` tag close an open `<tr>` or `<td>` (#1167).+ + Allow space between `<col>` and `</col>`.+ + Added `audio` and `source` in `eitherBlockOrInline`.+ + Moved `video`, `svg`, `progress`, `script`, `noscript`, `svg` from+ `blockTags` to `eitherBlockOrInline`.+ + `map` and `object` were mistakenly in both lists; they have been removed+ from `blockTags`.+ + Ignore `DOCTYPE` and `xml` declarations.++ * MediaWiki reader:++ + Don't parse backslash escapes inside `<source>` (#1445).+ + Tightened up template parsing.+ The opening `{{` must be followed by an alphanumeric or `:`.+ This prevents the exponential slowdown in #1033.+ + Support "Bild" for images.++ * DocBook reader:++ + Better handle elements inside code environments. Pandoc's document+ model does not allow structure inside code blocks, but at least this way+ we preserve the text (#1449).+ + Support `<?asciidoc-br?>` (#1236).++ * Textile reader:++ + Fixed list parsing. Lists can now start without an intervening+ blank line (#1513).+ + HTML block-level tags that do not start a line are parsed as+ inline HTML and do not interrupt paragraphs (as in RedCloth).++ * Org reader:++ + Make tildes create inline code (#1345). Also relabeled `code` and+ `verbatim` parsers to accord with the org-mode manual.+ + Respect `:exports` header argument in code blocks (Craig Bosma).+ + Fixed tight lists with sublists (#1437).++ * EPUB writer:++ + Avoid excess whitespace in `nav.xhtml`. This should improve+ TOC view in iBooks (#1392).+ + Fixed regression on cover image.+ In 1.12.4 and 1.12.4.2, the cover image would not appear properly,+ because the metadata id was not correct. Now we derive the id from the+ actual cover image filename, which we preserve rather than using+ "cover-image."+ + Keep newlines between block elements. This allows+ easier diff-ability (#1424).+ + Use `stringify` instead of custom `plainify`.+ + Use `renderTags'` for all tag rendering. This properly handles tags+ that should be self-closing. Previously `<hr/>` would appear in EPUB+ output as `<hr></hr>` (#1420).+ + Better handle HTML media tags.+ + Handle multiple dates with OPF `event` attributes. Note: in EPUB3 we+ can have only one dc:date, so only the first one is used.++ * LaTeX writer:++ + Correctly handle figures in notes. Notes can't contain figures in+ LaTeX, so we fake it to avoid an error (#1053).+ + Fixed strikeout + highlighted code (#1294).+ Previously strikeout highlighted code caused an error.++ * ConTeXt writer:++ + Improved detection of autolinks with URLs containing escapes.++ * RTF writer:++ + Improved image embedding: `fetchItem'` is now used to get the+ images, and calculated image sizes are indicated in the RTF.+ + Avoid extra paragraph tags in metadata (#1421).++ * HTML writer:++ + Deactivate "incremental" inside slide speaker notes (#1394).+ + Don't include empty items in the table of contents for+ slide shows. (These would result from creating a slide+ using a horizontal rule.)++ * MediaWiki writer:++ + Minor renaming of `st` prefixed names.++ * AsciiDoc writer:++ + Double up emphasis and strong emphasis markers in intraword+ contexts, as required by asciidoc (#1441).++ * Markdown writer:++ + Avoid wrapping that might start a list, blockquote, or header (#1013).+ + Use Span instead of (hackish) `SmallCaps` in `plainify`.+ + Don't use braced attributes for fenced code (#1416).+ If `Ext_fenced_code_attributes` is not set, the first class+ attribute will be printed after the opening fence as a bare word.+ + Separate adjacent lists of the same kind with an HTML comment (#1458).++ * PDF writer:++ + Fixed treatment of data uris for images (#1062).++ * Docx writer:++ + Use Compact style for empty table cells (#1353).+ Otherwise we get overly tall lines when there are empty+ table cells and the other cells are compact.+ + Create overrides per-image for `media/` in reference docx.+ This should be somewhat more robust and cover more types of images.+ + Improved `entryFromArchive` to avoid an unneeded parse.+ + Section numbering carries over from reference.docx (#1305).+ + Simplified `abstractNumId` numbering. Instead of sequential numbering,+ we assign numbers based on the list marker styles.++ * `Text.Pandoc.Options`:++ + Removed `Ext_fenced_code_attributes` from `markdown_github`+ extensions.++ * `Text.Pandoc.ImageSize`:++ + Use default instead of failing if image size not found+ in exif header (#1358).+ + ignore unknown exif header tag rather than crashing.+ Some images seem to have tag type of 256, which was causing+ a runtime error.++ * `Text.Pandoc.Shared`:++ + `fetchItem`: unescape URI encoding before reading local file (#1427).+ + `fetchItem`: strip a fragment like `?#iefix` from the extension before+ doing mime lookup, to improve mime type guessing.+ + Improved logic of `fetchItem`: absolute URIs are fetched from the net;+ other things are treated as relative URIs if `sourceURL` is `Just _`,+ otherwise as file paths on the local file system.+ + `fetchItem` now properly handles links without a protocol (#1477).+ + `fetchItem` now escapes characters not allowed in URIs before trying+ to parse the URIs.+ + Fixed runtime error with `compactify'DL` on certain lists (#1452).++ * `pandoc.hs`: Don't strip path off of `writerSourceURL`: the path is+ needed to resolve relative URLs when we fetch resources (#750).++ * `Text.Pandoc.Parsing`++ + Simplified `dash` and `ellipsis` (#1419).+ + Removed `(>>~)` in favor of the equivalent `(<*)` (Matthew Pickering).+ + Generalized functions to use `ParsecT` (Matthew Pickering).+ + Added `isbn` and `pmid` to list of recognized schemes (Matthew+ Pickering).++### Template changes++ * Added haddock template.+ * EPUB3: Added `type` attribute to `link` tags. They are supposed to+ be "advisory" in HTML5, but kindlegen seems to require them.+ * EPUB3: Put title page in section with `epub:type="titlepage"`.+ * LaTeX: Made `\subtitle` work properly (#1327).+ * LaTeX/Beamer: remove conditional around date (#1321).+ * LaTeX: Added `lot` and `lof` variables, which can be set to+ get `\listoftables` and `\listoffigures` (#1407). Note that+ these variables can be set at the command line with `-Vlot -Vlof`+ or in YAML metadata.++### Under the hood improvements++ * Rewrote normalize for efficiency (#1385).++ * Rewrote Haddock reader to use `haddock-library` (#1346).++ + This brings pandoc's rendering of haddock markup in line+ with the new haddock.+ + Fixed line breaks in `@` code blocks.+ + alex and happy are no longer build-depends.++ * Added `Text.Pandoc.Compat.Directory` to allow building against+ different versions of the `directory` library.++ + Added `Text.Pandoc.Compat.Except` to allow building against+ different versions of `mtl`.++ * Code cleanup in some writers, using Reader monad to avoid+ passing options parameter around (Matej Kollar).++ * Improved readability in `pandoc.hs`.++ * Miscellaneous code cleanups (Artyom Kazak).++ * Avoid `import Prelude hiding (catch)` (#1309, thanks to Michael+ Thompson).++ * Changed `http-conduit` flag to `https`. Depend on `http-client`+ and `http-client-tls` instead of `http-conduit`. (Note: pandoc still+ depends on `conduit` via `yaml`.)++ * Require `highlighting-kate >= 0.5.8.5` (#1271, #1317, Debian #753299).+ This change to highlighting-kate means that PHP fragments no longer need+ to start with `<?php`. It also fixes a serious bug causing failures with+ ocaml and fsharp.++ * Require latest `texmath`. This fixes `\tilde{E}` and allows+ `\left` to be used with `]`, `)` etc. (#1319), among many other+ improvements.++ * Require latest `zip-archive`. This has fixes for unicode path names.++ * Added tests for plain writer.++ * `Text.Pandoc.Templates`:++ + Fail informatively on template syntax errors.+ With the move from parsec to attoparsec, we lost good error+ reporting. In fact, since we weren't testing for end of input,+ malformed templates would fail silently. Here we revert back to+ Parsec for better error messages.+ + Use `ordNub` (#1022).++ * Benchmarks:++ + Made benchmarks compile again (Artyom Kazak).+ + Fixed so that the failure of one benchmark does not prevent others+ from running (Artyom Kazak).+ + Use `nfIO` instead of the `getLength` trick to force full evaluation.+ + Changed benchmark to use only the test suite, so that benchmarks+ run more quickly.++ * Windows build script:++ + Add `-windows` to file name.+ + Use one install command for pandoc, pandoc-citeproc.+ + Force install of pandoc-citeproc.++ * `make_osx_package`: Call zip file `pandoc-VERSION-osx.zip`.+ The zip should not be named `SOMETHING.pkg.zip`, or OSX finder+ will extract it into a folder named `SOMETHING.pkg`, which it+ will interpret as a defective package (#1308).++ * `README`:++ + Made headers for all extensions so they have IDs and can be+ linked to (Beni Cherniavsky-Paskin).+ + Fixed typos (Phillip Alday).+ + Fixed documentation of attributes (#1315).+ + Clarified documentation on small caps (#1360).+ + Better documentation for `fenced_code_attributes` extension+ (Caleb McDaniel).+ + Documented fact that you can put YAML metadata in a separate file+ (#1412).+++## pandoc 1.12.4.2 (2014-05-14)++ * Require highlighting-kate >= 0.5.8. Fixes a performance regression.++ * Shared: `addMetaValue` now behaves slightly differently:+ if both the new and old values are lists, it concatenates their+ contents to form a new list.++ * LaTeX reader:++ + Set `bibliography` in metadata from `\bibliography` or+ `\addbibresource` command.+ + Don't error on `%foo` with no trailing newline.++ * Org reader:++ + Support code block headers (`#+BEGIN_SRC ...`) (Albert Krewinkel).+ + Fix parsing of blank lines within blocks (Albert Krewinkel).+ + Support pandoc citation extension (Albert Krewinkel). This can+ be turned off by specifying `org-citation` as the input format.++ * Markdown reader:++ + `citeKey` moved to `Text.Pandoc.Parsing` so it can be used by+ other readers (Albert Krewinkel).++ * `Text.Pandoc.Parsing`:++ + Added `citeKey` (see above).+ + Added `HasLastStrPosition` type class and `updateLastStrPos`+ and `notAfterString` functions.++ * Updated copyright notices (Albert Krewinkel).++ * Added default.icml to data files so it installs with the package.++ * OSX package:++ + The binary is now built with options to ensure that it can be+ used with OSX 10.6+.+ + Moved OSX package materials to osx directory.+ + Added OSX package uninstall script, included in the zip container+ (thanks to Daniel T. Staal).++## pandoc 1.12.4 (2014-05-07)++ * Made it possible to run filters that aren't executable+ (#1096). Pandoc first tries to find the executable (searching+ the path if path isn't given). If it fails, but the file+ exists and has a `.py`, `.pl`, `.rb`, `.hs`, or `.php`+ extension, pandoc runs the filter using the appropriate+ interpreter. This should make it easier to use filters on+ Windows, and make it more convenient for everyone.++ * Added Emacs org-mode reader (Albert Krewinkel).++ * Added InDesign ICML Writer (mb21).++ * MediaWiki reader:++ + Accept image links in more languages (Jaime Marquínez Ferrándiz).+ + Fixed bug in certain nested lists (#1213). If a level 2 list was+ followed by a level 1 list, the first item of the level 1 list+ would be lost.+ + Handle table rows containing just an HTML comment (#1230).++ * LaTeX reader:++ + Give better location information on errors, pointing to line+ numbers within included files (#1274).+ + LaTeX reader: Better handling of `table` environment (#1204).+ Positioning options no longer rendered verbatim.+ + Better handling of figure and table with caption (#1204).+ + Handle `@{}` and `p{length}` in tabular. The length is not actually+ recorded, but at least we get a table (#1180).+ + Properly handle `\nocite`. It now adds a `nocite` metadata+ field. Citations there will appear in the bibliography but not+ in the text (unless you explicitly put a `$nocite$` variable+ in your template).++ * Markdown reader:++ + Ensure that whole numbers in YAML metadata are rendered without+ decimal points. (This became necessary with changes to aeson+ and yaml libraries. aeson >= 0.7 and yaml >= 0.8.8.2 are now required.)+ + Fixed regression on line breaks in strict mode (#1203).+ + Small efficiency improvements.+ + Improved parsing of nested `div`s. Formerly a closing `div` tag+ would be missed if it came right after other block-level tags.+ + Avoid backtracking when closing `</div>` not found.+ + Fixed bug in reference link parsing in `markdown_mmd`.+ + Fixed a bug in list parsing (#1154). When reading a raw list+ item, we now strip off up to 4 spaces.+ + Fixed parsing of empty reference link definitions (#1186).+ + Made one-column pipe tables work (#1218).++ * Textile reader:++ + Better support for attributes. Instead of being ignored, attributes+ are now parsed and included in Span inlines. The output will be a bit+ different from stock textile: e.g. for `*(foo)hi*`, we'll get+ `<em><span class="foo">hi</span></em>` instead of+ `<em class="foo">hi</em>`. But at least the data is not lost.+ + Improved treatment of HTML spans (%) (#1115).+ + Improved link parsing. In particular we now pick up on attributes.+ Since pandoc links can't have attributes, we enclose the whole link in+ a span if there are attributes (#1008).+ + Implemented correct parsing rules for inline markup (#1175, Matthew+ Pickering).+ + Use Builder (Matthew Pickering).++ * DocBook reader:++ + Better treatment of `formalpara`. We now emit the title (if present)+ as a separate paragraph with boldface text (#1215).+ + Set metadata `author` not `authors`.+ + Added recognition of `authorgroup` and `releaseinfo` elements (#1214,+ Matthew Pickering).+ + Converted current meta information parsing in DocBook to a more+ extensible version which is aware of the more recent meta+ representation (Matthew Pickering).++ * HTML reader:++ + Require tagsoup 0.13.1, to fix a bug with parsing of script tags+ (#1248).+ + Treat processing instructions & declarations as block. Previously+ these were treated as inline, and included in paragraph tags in HTML+ or DocBook output, which is generally not what is wanted (#1233).+ + Updated `closes` with rules from HTML5 spec.+ + Use Builder (Matthew Pickering, #1162).++ * RST reader:++ + Remove duplicate `http` in PEP links (Albert Krewinkel).+ + Make rst figures true figures (#1168, CasperVector)+ + Enhanced Pandoc's support for rST roles (Merijn Verstaaten).+ rST parser now supports: all built-in rST roles, new role definition,+ role inheritance, though with some limitations.+ + Use `author` rather than `authors` in metadata.+ + Better handling of directives. We now correctly handle field+ lists that are indented more than three spaces. We treat an+ `aafig` directive as a code block with attributes, so it can be+ processed in a filter (#1212).++ * LaTeX writer:++ + Mark span contents with label if span has an ID (Albert Krewinkel).+ + Made `--toc-depth` work well with books in latex/pdf output (#1210).+ + Handle line breaks in simple table cells (#1217).+ + Workaround for level 4-5 headers in quotes. These previously produced+ invalid LaTeX: `\paragraph` or `\subparagraph` in a `quote` environment.+ This adds an `mbox{}` in these contexts to work around the problem.+ See <http://tex.stackexchange.com/a/169833/22451> (#1221).+ + Use `\/` to avoid en-dash ligature instead of `-{}-` (Vaclav Zeman).+ This is to fix LuaLaTeX output. The `-{}-` sequence does not avoid the+ ligature with LuaLaTeX but `\/` does.+ + Fixed string escaping in `hyperref` and `hyperdef` (#1130).++ * ConTeXt writer: Improved autolinks (#1270).++ * DocBook writer:++ + Improve handling of hard line breaks in Docbook writer+ (Neil Mayhew). Use a `<literallayout>` for the entire paragraph, not+ just for the newline character.+ + Don't let line breaks inside footnotes influence the enclosing+ paragraph (Neil Mayhew).+ + Distinguish tight and loose lists in DocBook output, using+ `spacing="compact"` (Neil Mayhew, #1250).++ * Docx writer: When needed files are not present in the user's+ `reference.docx`, fall back on the versions in the `reference.docx`+ in pandoc's data files. This fixes a bug that occurs when a+ `reference.docx` saved by LibreOffice is used. (#1185)++ * EPUB writer:++ + Include extension in epub ids. This fixes a problem with duplicate+ extensions for fonts and images with the same base name but different+ extensions (#1254).+ + Handle files linked in raw `img` tags (#1170).+ + Handle media in `audio` source tags (#1170).+ Note that we now use a `media` directory rather than `images`.+ + Incorporate files linked in `video` tags (#1170). `src` and `poster`+ will both be incorporated into `content.opf` and the epub container.++ * HTML writer:++ + Add colgroup around col tags (#877). Also affects EPUB writer.+ + Fixed bug with unnumbered section headings. Unnumbered section+ headings (with class `unnumbered`) were getting numbers.+ + Improved detection of image links. Previously image links with+ queries were not recognized, causing `<embed>` to be used instead+ of `<img>`.++ * Man writer: Ensure that terms in definition lists aren't line wrapped+ (#1195).++ * Markdown writer:++ + Use proper escapes to avoid unwanted lists (#980). Previously we used+ 0-width spaces, an ugly hack.+ + Use longer backtick fences if needed (#1206). If the content contains a+ backtick fence and there are attributes, make sure longer fences are+ used to delimit the code. Note: This works well in pandoc, but github+ markdown is more limited, and will interpret the first string of three+ or more backticks as ending the code block.++ * RST writer: Avoid stack overflow with certain tables (#1197).++ * RTF writer: Fixed table cells containing paragraphs.++ * Custom writer:++ + Correctly handle UTF-8 in custom lua scripts (#1189).+ + Fix bugs with lua scripts with mixed-case filenames and+ paths containing `+` or `-` (#1267). Note that `getWriter`+ in `Text.Pandoc` no longer returns a custom writer on input+ `foo.lua`.++ * AsciiDoc writer: Handle multiblock and empty table cells+ (#1245, #1246). Added tests.++ * `Text.Pandoc.Options`: Added `readerTrace` to `ReaderOptions`++ * `Text.Pandoc.Shared`:++ + Added `compactify'DL` (formerly in markdown reader) (Albert Krewinkel).+ + Fixed bug in `toRomanNumeral`: numbers ending with '9' would+ be rendered as Roman numerals ending with 'IXIV' (#1249). Thanks to+ Jesse Rosenthal.+ + `openURL`: set proxy with value of http_proxy env variable (#1211).+ Note: proxies with non-root paths are not supported, due to+ limitations in `http-conduit`.++ * `Text.Pandoc.PDF`:++ + Ensure that temp directories deleted on Windows (#1192). The PDF is+ now read as a strict bytestring, ensuring that process ownership will+ be terminated, so the temp directory can be deleted.+ + Use `/` as path separators in a few places, even on Windows.+ This seems to be necessary for texlive (#1151, thanks to Tim Lin).+ + Use `;` for `TEXINPUTS` separator on Windows (#1151).+ + Changes to error reporting, to handle non-UTF8 error output.++ * `Text.Pandoc.Templates`:++ + Removed unneeded datatype context (Merijn Verstraaten).++ + YAML objects resolve to "true" in conditionals (#1133).+ Note: If `address` is a YAML object and you just have `$address$`+ in your template, the word `true` will appear, which may be+ unexpected. (Previously nothing would appear.)++ * `Text.Pandoc.SelfContained`: Handle `poster` attribute in `video`+ tags (#1188).++ * `Text.Pandoc.Parsing`:++ + Made `F` an instance of Applicative (#1138).+ + Added `stateCaption`.+ + Added `HasMacros`, simplified other typeclasses.+ Removed `updateHeaderMap`, `setHeaderMap`, `getHeaderMap`,+ `updateIdentifierList`, `setIdentifierList`, `getIdentifierList`.+ + Changed the smart punctuation parser to return `Inlines`+ rather than `Inline` (Matthew Pickering).+ + Changed `HasReaderOptions`, `HasHeaderMap`, `HasIdentifierList`+ from typeclasses of monads to typeclasses of states. This simplifies+ the instance definitions and provides more flexibility. Generalized+ type of `getOption` and added a default definition. Removed+ `askReaderOption`. Added `extractReaderOption`. Added+ `extractHeaderMap` and `updateHeaderMap` in `HasHeaderMap`.+ Gave default definitions for `getHeaderMap`, `putHeaderMap`,+ `modifyHeaderMap`. Added `extractIdentifierList` and+ `updateIdentifierList` in `HasIdentifierList`. Gave defaults+ for `getIdentifierList`, `putIdentifierList`, and+ `modifyIdentifierList`. The ultimate goal here is to allow different+ parsers to use their own, tailored parser states (instead of+ `ParserState`) while still using shared functions.++ * Template changes:++ + LaTeX template: Use `fontenc` package only with `pdflatex` (#1164).+ + LaTeX template: Add `linestretch` and `fontfamily` variables.+ + LaTeX template: Conditionalize author and date commands.+ + Beamer template: Consistent styles for figure and table captions+ (aaronwolen).+ + LaTeX and beamer template: Adjust widths correctly for oversized+ images. Use `\setkeys{Gin}{}` to set appropriate defaults for+ `\includegraphics` (Yihui Xie, Garrick Aden-Buie). Load+ `upquote` only after `fontenc` (Yihui Xie).+ + Beamer template: Added caption package (#1200).+ + Beamer template: changes for better unicode handling (KarolS).+ + DocBook template: use `authorgroup` if there are authors.+ + revealjs template: Move `include-after` to end (certainlyakey).+ + revealjs template: Fixed PDF print function (#1220, kevinkenan).++ * Bumped version bounds of dependencies.++ * Added a `--trace` command line option, for debugging backtracking+ bugs. So far this only works with the markdown reader.++ * MathMLinHTML: Fixed deprecation warning (#362, gwern, Albert Krewinkel).++ * Updated travis script to test with multiple GHC versions.++ * Force failure of a Travis build if GHC produces warnings (Albert+ Krewinkel).++ * Add `.editorconfig` (Albert Krewinkel).+ See <http://editorconfig.org/> for details.++ * Give more useful error message if '-t pdf' is specified (#1155).++ * Added `Cite`, `SmallCaps` to `Arbitrary` instance (#1269).++ * Allow `html4` as a synonym of `html` as a reader (it already works+ as a writer).++ * README:++ + Added an explanation of how to use YAML metadata to+ force items to appear in the bibliography without citations in+ the text (like LaTeX `\nocite`).+ + Added note to `--bibtex/--natbib`: not for use in making PDF+ (#1194, thanks to nahoj).+ + Added explanatory notes about `--natbib` and `--biblatex`.+ + Added specification of legal syntax for citation keys.+ + Fixed variable defaults documentation (Albert Krewinkel).++ * Removed copyright statements for files that have been removed+ (Albert Krewinkel).++ * Moved some doc files from `data-files` to `extra-source-files` (#1123).+ They aren't needed at runtime. We keep README and COPYRIGHT in data+ to ensure that they'll be available on all systems on which pandoc+ is installed.++ * Use cabal sandboxes in Windows build script.++## pandoc 1.12.3.3 (2014-02-03)++ * To changes to source; recompiled tarball with latest alex and+ happy, so they will work with GHC 7.8.++## pandoc 1.12.3.2 (2014-02-03)++ * Bumped version bounds for blaze-html, blaze-markup.++ * ImageSize: Avoid use of lookAhead, which is not in binary >= 0.6+ (#1124).++ * Fixed mediawiki ordered list parsing (#1122).++ * HTML reader: Fixed bug reading inline math with `$$` (#225).++ * Added support for LaTeX style literate Haskell code blocks in rST+ (Merijn Verstraaten).++## pandoc 1.12.3.1 (2014-01-14)++ * Relaxed version constraint on binary, allowing the use of binary 0.5.+++## pandoc 1.12.3 (2014-01-10)++ * The `--bibliography` option now sets the `biblio-files` variable.+ So, if you're using `--natbib` or `--biblatex`, you can just use+ `--bibliography=foo.bib` instead of `-V bibliofiles=foo`.++ * Don't run pandoc-citeproc filter if `--bibliography` is+ used together with `--natbib` or `--biblatex` (Florian Eitel).++ * Template changes:++ + Updated beamer template to include booktabs.+ + Added `abstract` variable to LaTeX template.+ + Put `header-includes` after `title` in LaTeX template (#908).+ + Allow use of `\includegraphics[size]` in beamer.+ This just required porting a macro definition from the default+ LaTeX template to the default beamer template.++ * `reference.docx`: Include `FootnoteText` style.+ Otherwise Word ignores the style, even when specified in the `pPr`.+ (#901)++ * `reference.odt`: Tidied `styles.xml`.++ * Relaxed version bounds for dependencies.++ * Added `withSocketsDo` around http conduit code in `openURL`,+ so it works on Windows (#1080).++ * Added `Cite` function to `sample.lua`.++ * Markdown reader:++ + Fixed regression in title blocks (#1089).+ If author field was empty, date was being ignored.+ + Allow backslash-newline hard line breaks in grid and+ multiline table cells.+ + Citation keys may now start with underscores, and may contain+ underscores adjacent to internal punctuation.++ * LaTeX reader:++ + Add support for `Verb` macro (jrnold) (#1090).+ + Support babel-style quoting: `` "`..."' ``.++ * Properly handle script blocks in strict mode. (That is,+ `markdown-markdown_in_html_blocks`.) Previously a spurious+ `<p>` tag was being added (#1093).++ * Docbook reader: Avoid failure if `tbody` contains no `tr` or `row`+ elements.++ * LaTeX writer:++ + Factored out function for table cell creation.+ + Better treatment of footnotes in tables.+ Notes now appear in the regular sequence, rather than in the+ table cell. (This was a regression in 1.10.)++ * HTML reader: Parse name/content pairs from meta tags as metadata.+ Closes #1106.++ * Moved `fixDisplayMath` from Docx writer to `Writer.Shared`.++ * OpenDocument writer: Fixed `RawInline`, `RawBlock` so they don't escape.++ * ODT writer: Use mathml for proper rendering of formulas.+ Note: LibreOffice's support for this seems a bit buggy. But+ it should be better than what we had before.++ * RST writer: Ensure no blank line after def in definition list (#992).++ * Markdown writer: Don't use tilde code blocks with braced attributes in+ `markdown_github` output. A consequence of this change is that the+ backtick form will be preferred in general if both are enabled. That+ is good, as it is much more widespread than the tilde form. (#1084)++ * Docx writer: Fixed problem with some modified reference docx files.+ Include `word/_rels/settings.xml.rels` if it exists, as well as other+ `rels` files besides the ones pandoc generates explicitly.++ * HTML writer:++ + With `--toc`, headers no longer link to themselves (#1081).+ + Omit footnotes from TOC entries. Otherwise we get doubled+ footnotes when headers have notes!++ * EPUB writer:++ + Avoid duplicate notes when headings contain notes.+ This arose because the headings are copied into the metadata+ "title" field, and the note gets rendered twice. We strip the+ note now before putting the heading in "title".+ + Strip out footnotes from toc entries.+ + Fixed bug with `--epub-stylesheet`. Now the contents of+ `writerEpubStylesheet` (set by `--epub-stylesheet`)+ should again work, and take precedence over a stylesheet specified+ in the metadata.++ * `Text.Pandoc.Pretty`: Added `nestle`. API change.++ * `Text.Pandoc.MIME`: Added `wmf`, `emf`.++ * `Text.Pandoc.Shared`: `fetchItem` now handles image URLs beginning+ with `//`.++ * `Text.Pandoc.ImageSize`: Parse EXIF format JPEGs. Previously+ we could only get size information for JFIF format, which led+ to squished images in Word documents. Closes #976.++ * Removed old `MarkdownTest_1.0.3` directory (#1104).+++## pandoc 1.12.2.1 (2013-12-08)++ * Markdown reader: Fixed regression in list parser, involving+ continuation lines containing raw HTML (or even verbatim raw HTML).++## pandoc 1.12.2 (2013-12-07)++ * Metadata may now be included in YAML blocks in a markdown document.+ For example,++ ---+ title:+ - type: main+ text: My Book+ - type: subtitle+ text: An investigation of metadata+ creator:+ - role: author+ text: John Smith+ - role: editor+ text: Sarah Jones+ identifier:+ - scheme: DOI+ text: doi:10.234234.234/33+ publisher: My Press+ rights: (c) 2007 John Smith, CC BY-NC+ cover-image: img/mypic.jpg+ stylesheet: style.css+ ...++ Metadata may still be provided using `--epub-metadata`; it will+ be merged with the metadata in YAML blocks.++ * EPUB writer:++ + `meta` tags are now used instead of `opf` attributes for EPUB3.+ + Insert "svg" property as needed in opf (EPUB 3).+ + Simplify `imageTypeOf` using `getMimeType`.+ + Add properties attribute to `cover-image` item for EPUB 3.+ + Don't include node for `cover.xhtml` if no cover!+ + Ensure that same identifier is used throughout (#1044).+ If an identifier is given in metadata, we use that; otherwise+ we generate a random uuid.+ + Add cover reference to guide element (EPUB 2) (Shaun Attfield).+ Fixes an issue with Calibre putting the cover at the end of the book+ if the spine has `linear="no"`. Apparently this is best practice+ for other converters as well:+ <http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.6>.+ + Allow `stylesheet` in metadata. The value is a path to the stylesheet.+ + Allow partial dates: `YYYY`, `YYYY-MM`.++ * Markdown writer: Fix rendering of tight sublists (#1050).+ Previously a spurious blank line was included after a tight sublist.++ * ODT writer: Add `draw:name` attribute to `draw:frame` elements (#1069).+ This is reported to be necessary to avoid an error from recent+ versions of Libre Office when files contain more than one image+ Thanks to wmanley for reporting and diagnosing the problem.++ * ConTeXt writer: Don't hardcode figure/table placement and numbering.+ Instead, let this be set in the template, using `\setupfloat`.+ Thanks to on4aa and Aditya Mahajan for the suggestion (#1067).++ * Implemented CSL flipflopping spans in DOCX, LaTeX, and HTML writers.++ * Fixed bug with markdown intraword emphasis. Closes #1066.++ * Docbook writer: Hierarchicalize block content in metadata.+ Previously headers just disappeared from block-level metadata+ when it was used in templates. Now we apply the 'hierarchicalize'+ transformation. Note that a block headed by a level-2 header will+ turn into a `<sect1>` element.++ * OpenDocument writer: Skip raw HTML (#1035).+ Previously it was erroneously included as verbatim text.++ * HTML/EPUB writer, footnotes: Put `<sup>` tag inside `<a>` tags.+ This allows better control of formatting, since the `<a>`+ tags have a distinguishing class (#1049).++ * Docx writer:++ + Use mime type info returned by fetchItem.+ + Fixed core metadata (#1046).+ Don't create empty date nodes if no date given.+ Don't create multiple `dc:creator` nodes; instead separate by+ semicolons.+ + Fix URL for core-properties in `_rels/.rels` (#1046).++ * Plain writer: don't print `<span>` tags.++ * LaTeX writer:++ + Fix definition lists with internal links in terms (#1032).+ This fix puts braces around a term that contains an internal+ link, to avoid problems with square brackets.+ + Properly escape pdftitle, pdfauthor (#1059).+ + Use booktabs package for tables (thanks to Jose Luis Duran).++ * Updated beamer template. Now references should work properly+ (in a slide) when `--biblatex` or `--natbib` is used.++ * LaTeX reader:++ + Parse contents of curly quotes or matched `"` as quotes.+ + Support `\textnormal` as span with class `nodecor`.+ This is needed for pandoc-citeproc.+ + Improved citation parsing. This fixes a run-time error that occurred+ with `\citet{}` (empty list of keys). It also ensures that empty keys+ don't get produced.++ * MediaWiki reader: Add automatic header identifiers.++ * HTML reader:++ + Use pandoc `Div` and `Span` for raw `<div>`, `<span>` when+ `--parse-raw`.+ + Recognize `svg` tags as block level content (thanks to MinRK).+ + Parse LaTeX math if appropriate options are set.++ * Markdown reader:++ + Yaml block must start immediately after `---`. If there's a blank+ line after `---`, we interpreted it as a horizontal rule.+ + Correctly handle empty bullet list items.+ + Stop parsing "list lines" when we hit a block tag.+ This fixes exponential slowdown in certain input, e.g.+ a series of lists followed by `</div>`.++ * Slides: Preserve `<div class="references">` in references slide.++ * `Text.Pandoc.Writer.Shared`:++ + Fixed bug in `tagWithAttrs`. A space was omitted before key-value+ attributes, leading to invalid HTML.+ + `normalizeDate`: Allow dates with year only (thanks to Shaun Attfield).+ + Fixed bug in `openURL` with `data:` URIs. Previously the base-64+ encoded bytestring was returned. We now decode it so it's a proper+ image!++ * DocBook reader: Handle numerical attributes starting with decimal.+ Also use `safeRead` instead of `read`.++ * `Text.Pandoc.Parsing`:++ + Generalized type of `registerHeader`, using new type classes+ `HasReadeOptions`, `HasIdentifierList`, `HasHeaderMap`.+ These allow certain common functions to be reused+ even in parsers that use custom state (instead of `ParserState`),+ such as the MediaWiki reader.+ + Moved inlineMath, displayMath from Markdown reader to Parsing.+ Generalize their types and export them from Parsing. (API change.)++ * `Text.Pandoc.Readers.TexMath`: Export `readTeXMath'`, which attends+ to display/inline. Deprecate `readTeXMath`, and use `readTeXMath'`+ in all the writers. Require `texmath >= 0.6.5.2`.++ * `Text.Pandoc.MIME`:++ + Add entry for `jfif`.+ + In looking up extensions, drop the encoding info.+ E.g. for 'image/jpg;base64' we should lookup 'image/jpg'.++ * Templates: Changed how array variables are resolved. Previously if+ `foo` is an array (which might be because multiple values were set on+ the command line), `$foo$` would resolve to the concatenation of the+ elements of foo. This is rarely useful behavior. It has been changed+ so that the first value is rendered. Of course, you can still iterate+ over the values using `$for(foo)$`. This has the result that you can+ override earlier settings using `-V` by putting new values later on the+ command line, which is useful for many purposes.++ * `Text.Pandoc`: Don't default to `pandocExtensions` for all writers.++ * Allow "epub2" as synonym for "epub", "html4" for "html".++ * Don't look for slidy files in data files with `--self-contained`.++ * Allow `https:` command line arguments to be downloaded.++ * Fixed `make_osx_package.sh` so data files embedded in `pandoc-citeproc`.++## pandoc 1.12.1 (2013-10-20)++ * `Text.Pandoc.Definition`: Changed default JSON serialization format.+ Instead of `{"Str": "foo"}`, for example, we now have `{"t": "Str",+ "c": "foo"}`. This new format is easier to work with outside of Haskell.+ Incidentally, "t" stands for "tag", "c" for "contents".++ * MediaWiki reader: Trim contents of `<math>` tags, to avoid problems+ when converting to markdown (#1027).++ * LaTeX reader:++ + Ensure that preamble doesn't contribute to the text of+ the document.+ + Fixed character escaping in `\url{}`. Previously `\~` wasn't handled+ properly, among others.+ + Parse `{groups}` as `Span`. This is needed for accurate conversion of+ bibtex titles, since we need to know what was protected from+ titlecase conversions.++ * LaTeX writer:++ + Specially escape non-ascii characters in labels.+ Otherwise we can get compile errors and other bugs when+ compiled with pdflatex (#1007). Thanks to begemotv2718 for the fix.+ + Add link anchors for code blocks with identifiers (#1025).++ * Throughout the code, use `isURI` instead of `isAbsoluteURI`.+ It allows fragments identifiers.++ * Slide formats:++ + A Div element with class "notes" is treated as speaker+ notes. Currently beamer goes to `\note{}`, revealjs to+ `<aside class="notes">`, and the notes are simply suppressed in+ other formats (#925).+ + Fixed `. . .` (pause) on HTML slide formats. Closes #1029.+ The old version caused a pause to be inserted before the first+ material on a slide. This has been fixed.+ + Removed data files for s5, slideous, slidy.+ Users of s5 and slideous will have to download the needed+ files, as has been documented for some time in the README.+ By default, slidy code will be sought on the web, as before.++ * HTML writer: Insert command to typeset mathjax only in slideous output+ (#966, #1012).++ * RST writer: Skip spaces after display math. Otherwise we get indentation+ problems, and part of the next paragraph may be rendered as part of the+ math.++ * OpenDocument writer: Fix formatting of strikeout code (#995),+ thanks to wilx. don't use `font-face-decls` variable.++ * Fixed test suite so it works with cabal sandboxes.++## pandoc 1.12.0.2 (2013-09-20)++ * Removed an unused dependency (`stringable`) from pandoc.cabal.+ This will help packagers, but users should not need to upgrade.++## pandoc 1.12.0.1 (2013-09-20)++ * Allow `--metadata` to be repeated for the same key to form a list.+ This also has the effect that `--bibliography` can be repeated,+ as before.++ * Handle boolean values in `--metadata`. Note that anything not parseable+ as a YAML boolean or string is treated as a literal string.+ You can get a string value with "yes", or any of the strings interpretable+ as booleans, by quoting it:++ -M boolvalue=yes -M stringvalue='"yes"'++ * LaTeX writer: Don't print references if `--natbib` or `--biblatex`+ option used.++ * DOCX writer: Add `settings.xml` to the zip container. Fixes a bug+ in which docx files could not be read by some versions of Word+ and LibreOffice (#990).++ * Fixed a regression involving slide shows with bibliographies.+ The Div container around references messed up the procedure for carving+ a document into slides. So we now remove the surrounding Div in+ `prepSlides`.++ * More informative error message when a filter is not found in path.++ * Depend on pandoc-types 1.12.1. This provide `ToJSONFilter`+ instances for `Data a => a -> [a]` and `Data a => a -> IO [a]`.++ * Don't use unicode_collation in building OSX package:+ it adds something like 50MB of dependencies to the package.++ * Declare alex and happy as build-tools (#986).++## pandoc 1.12 (2013-09-15)++### New features++ * Much more flexible metadata, including arbitrary fields and structured+ values. Metadata can be specified flexibly in pandoc markdown using+ YAML metadata blocks, which may occur anywhere in the document:++ ---+ title: Here is my title.+ abstract: |+ This is the abstract.++ 1. It can contain+ 2. block content+ and *inline markup*++ tags: [cat, dog, animal]+ ...++ Metadata fields automatically populate template variables.++ * Added `opml` (OPML) as input and output format. The `_note` attribute,+ used in OmniOutliner and supported by multimarkdown, is supported.+ We treat the contents as markdown blocks under a section header.++ * Added `haddock` (Haddock markup) as input format (David Lazar).++ * Added `revealjs` output format, for reveal.js HTML 5 slide shows.+ (Thanks to Jamie F. Olson for the initial patch.)+ Nested vertical stacks are used for hierarchical structure.+ Results for more than one level of nesting may be odd.++ * Custom writers can now be written in lua.++ pandoc -t data/sample.lua++ will load the script sample.lua and use it as a custom writer.+ (For a sample, do `pandoc --print-default-data-file sample.lua`.)+ Note that pandoc embeds a lua interpreter, so lua need not be+ installed separately.++ * New `--filter/-F` option to make it easier to run "filters"+ (Pandoc AST transformations that operate on JSON serializations).+ Filters are always passed the name of the output format, so their+ behavior can be tailored to it. The repository+ <https://github.com/jgm/pandocfilters> contains+ a python module for writing pandoc filters in python, with+ a number of examples.++ * Added `--metadata/-M` option.+ This is like `--variable/-V`, but actually adds to metadata, not+ just variables.++ * Added `--print-default-data-file` option, which allows printing+ of any of pandoc's data files. (For example,+ `pandoc --print-default-data-file reference.odt` will print+ `reference.odt`.)++ * Added syntax for "pauses" in slide shows:++ This gives++ . . .++ me pause.++ * New markdown extensions:++ + `ignore_line_breaks`: causes intra-paragraph line breaks to be ignored,+ rather than being treated as hard line breaks or spaces. This is useful+ for some East Asian languages, where spaces aren't used between words,+ but text is separated into lines for readability.+ + `yaml_metadata_block`: Parse YAML metadata blocks. (Default.)+ + `ascii_identifiers`: This will force `auto_identifiers` to use ASCII+ only. (Default for `markdown_github`.) (#807)+ + `lists_without_preceding_blankline`: Allow lists to start without+ preceding blank space. (Default for `markdown_github`.) (#972)++### Behavior changes++ * `--toc-level` no longer implies `--toc`.+ Reason: EPUB users who don't want a visible TOC may still want+ to set the TOC level for in the book navigation.++ * `--help` now prints in and out formats in alphabetical order, and+ says something about PDF output (#720).++ * `--self-contained` now returns less verbose output (telling you+ which URLs it is fetching, but not giving the full header). In+ addition, there are better error messages when fetching a URL fails.++ * Citation support is no longer baked in to core pandoc. Users who+ need citations will need to install and use a separate filter+ (`--filter pandoc-citeproc`). This filter will take `bibliography`,+ `csl`, and `citation-abbreviations` from the metadata, though it+ may still be specified on the command line as before.++ * A `Cite` element is now created in parsing markdown whether or not+ there is a matching reference.++ * The `pandoc-citeproc` script will put the bibliography at the+ end of the document, as before. However, it will be put inside a `Div`+ element with class "references", allowing users some control+ over the styling of references. A final header, if any, will+ be included in the `Div`.++ * The markdown writer will not print a bibliography if the+ `citations` extension is enabled. (If the citations are formatted+ as markdown citations, it is redundant to have a bibliography,+ since one will be generated automatically.)++ * Previously we used to store the directory of the first input file,+ even if it was local, and used this as a base directory for finding+ images in ODT, EPUB, Docx, and PDF. This has been confusing to many+ users. So we now look for images relative to the current+ working directory, even if the first file argument is in another+ directory. Note that this change may break some existing workflows.+ If you have been assuming that relative links will be interpreted+ relative to the directory of the first file argument, you'll need+ to make that the current directory before running pandoc. (#942)++ * Better error reporting in some readers, due to changes in `readWith`:+ the line in which the error occurred is printed, with a caret pointing+ to the column.++ * All slide formats now support incremental slide view for definition lists.++ * Parse `\(..\)` and `\[..\]` as math in MediaWiki reader.+ Parse `:<math>...</math>` as display math. These notations are used with+ the MathJax MediaWiki extension.++ * All writers: template variables are set automatically from metadata+ fields. However, variables specified on the command line with+ `--variable` will completely shadow metadata fields.++ * If `--variable` is used to set many variables with the same name,+ a list is created.++ * Man writer: The `title`, `section`, `header`, and `footer` can now+ all be set individually in metadata. The `description` variable has been+ removed. Quotes have been added so that spaces are allowed in the+ title. If you have a title that begins++ COMMAND(1) footer here | header here++ pandoc will still parse it into a title, section, header, and+ footer. But you can also specify these elements explicitly (#885).++ * Markdown reader++ + Added support for YAML metadata blocks, which can come anywhere+ in the document (not just at the beginning). A document can contain+ multiple YAML metadata blocks.+ + HTML span and div tags are parsed as pandoc Span and Div elements.++ * Markdown writer++ + Allow simple tables to be printed as grid tables,+ if other table options are disabled. This means you can do+ `pandoc -t markdown-pipe_tables-simple_tables-multiline_tables`+ and all tables will render as grid tables.+ + Support YAML title block (render fields in alphabetical order+ to make output predictable).++### API changes++ * `Meta` in `Text.Pandoc.Definition` has been changed to allow+ structured metadata. (Note: existing code that pattern-matches+ on `Meta` will have to be revised.) Metadata can now contain+ indefinitely many fields, with content that can be a string,+ a Boolean, a list of `Inline` elements, a list of `Block`+ elements, or a map or list of these.++ * A new generic block container (`Div`) has been added to `Block`,+ and a generic inline container (`Span`) has been added to `Inline`.+ These can take attributes. They will render in HTML, Textile,+ MediaWiki, Org, RST and Markdown (with `markdown_in_html`+ extension) as HTML `<div>` and `<span>` elements; in other formats+ they will simply pass through their contents. But they can be+ targeted by scripts.++ * `Format` is now a newtype, not an alias for String.+ Equality comparisons are case-insensitive.++ * Added `Text.Pandoc.Walk`, which exports hand-written tree-walking+ functions that are much faster than the SYB functions from+ `Text.Pandoc.Generic`. These functions are now used where possible+ in pandoc's code. (`Tests.Walk` verifies that `walk` and `query`+ match the generic traversals `bottomUp` and `queryWith`.)++ * Added `Text.Pandoc.JSON`, which provides `ToJSON` and `FromJSON`+ instances for the basic pandoc types. They use GHC generics and+ should be faster than the old JSON serialization using+ `Data.Aeson.Generic`.++ * Added `Text.Pandoc.Process`, exporting `pipeProcess`.+ This is a souped-up version of `readProcessWithErrorcode` that+ uses lazy bytestrings instead of strings and allows setting+ environment variables. (Used in `Text.Pandoc.PDF`.)++ * New module `Text.Pandoc.Readers.OPML`.++ * New module `Text.Pandoc.Writers.OPML`.++ * New module `Text.Pandoc.Readers.Haddock` (David Lazar).+ This is based on Haddock's own lexer/parser.++ * New module `Text.Pandoc.Writers.Custom`.++ * In `Text.Pandoc.Shared`, `openURL` and `fetchItem` now return an+ Either, for better error handling.++ * Made `stringify` polymorphic in `Text.Pandoc.Shared`.++ * Removed `stripTags` from `Text.Pandoc.XML`.++ * `Text.Pandoc.Templates`:++ + Simplified `Template` type to a newtype.+ + Removed `Empty`.+ + Changed type of `renderTemplate`: it now takes a JSON context+ and a compiled template.+ + Export `compileTemplate`.+ + Export `renderTemplate'` that takes a string instead of a compiled+ template.+ + Export `varListToJSON`.++ * `Text.Pandoc.PDF` exports `makePDF` instead of `tex2pdf`.++ * `Text.Pandoc`:++ + Made `toJsonFilter` an alias for `toJSONFilter` from `Text.Pandoc.JSON`.+ + Removed `ToJsonFilter` typeclass. `ToJSONFilter` from+ `Text.Pandoc.JSON` should be used instead. (Compiling against+ pandoc-types instead of pandoc will also produce smaller executables.)+ * Removed the deprecated `jsonFilter` function.+ + Added `readJSON`, `writeJSON` to the API (#817).++ * `Text.Pandoc.Options`:++ + Added `Ext_lists_without_preceding_blankline`,+ `Ext_ascii_identifiers`, `Ext_ignore_line_breaks`,+ `Ext_yaml_metadataBlock` to `Extension`.+ + Changed `writerSourceDirectory` to `writerSourceURL` and changed the+ type to a `Maybe`. `writerSourceURL` is set to 'Just url' when the+ first command-line argument is an absolute URL. (So, relative links+ will be resolved in relation to the first page.) Otherwise, 'Nothing'.+ + All bibliography-related fields have been removed from+ `ReaderOptions` and `WriterOptions`: `writerBiblioFiles`,+ `readerReferences`, `readerCitationStyle`.++ * The `Text.Pandoc.Biblio` module has been removed. Users of the+ pandoc library who want citation support will need to use+ `Text.CSL.Pandoc` from `pandoc-citeproc`.++### Bug fixes++ * In markdown, don't autolink a bare URI that is followed by `</a>`+ (#937).++ * `Text.Pandoc.Shared`++ + `openURL` now follows redirects (#701), properly handles `data:`+ URIs, and prints diagnostic output to stderr rather than stdout.+ + `readDefaultDataFile`: normalize the paths. This fixes bugs in+ `--self-contained` on pandoc compiled with `embed_data_files` (#833).+ + Fixed `readDefaultDataFile` so it works on Windows.+ + Better error messages for `readDefaultDataFile`. Instead of+ listing the last path tried, which can confuse people who are+ using `--self-contained`, so now we just list the data file name.+ + URL-escape pipe characters. Even though these are legal, `Network.URI`+ doesn't regard them as legal in URLs. So we escape them first (#535).++ * Mathjax in HTML slide shows: include explicit "Typeset" call.+ This seems to be needed for some formats (e.g. slideous) and won't+ hurt in others (#966).++ * `Text.Pandoc.PDF`++ + On Windows, create temdir in working directory, since the system+ temp directory path may contain tildes, which can cause+ problems in LaTeX (#777).+ + Put temporary output directory in `TEXINPUTS` (see #917).+ + `makePDF` tries to download images that are not found locally,+ if the first argument is a URL (#917).+ + If compiling with `pdflatex` yields an encoding error, offer+ the suggestion to use `--latex-engine=xelatex`.++ * Produce automatic header identifiers in parsing textile, RST,+ and LaTeX, unless `auto_identifiers` extension is disabled (#967).++ * `Text.Pandoc.SelfContained`: Strip off fragment, query of relative URL+ before treating as a filename. This fixes `--self-contained` when used+ with CSS files that include web fonts using the method described here:+ <http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/>+ (#739). Handle `src` in `embed`, `audio`, `source`, `input` tags.++ * `Text.Pandoc.Parsing`: `uri` parser no longer treats punctuation before+ percent-encoding, or a `+` character, as final punctuation.++ * `Text.Pandoc.ImageSize`: Handle EPS (#903). This change will make+ EPS images properly sized on conversion to Word.++ * Slidy: Use slidy.js rather than slidy.js.gz.+ Reason: some browsers have trouble with the gzipped js file,+ at least on the local file system (#795).++ * Markdown reader++ + Properly handle blank line at beginning of input (#882).+ + Fixed bug in unmatched reference links. The input+ `[*infile*] [*outfile*]` was getting improperly parsed:+ "infile" was emphasized, but "*outfile*" was literal (#883).+ + Allow internal `+` in citation identifiers (#856).+ + Allow `.` or `)` after `#` in ATX headers if no `fancy_lists`.+ + Do not generate blank title, author, or date metadata elements.+ Leave these out entirely if they aren't present.+ + Allow backtick code blocks not to be preceded by blank line (#975).++ * Textile reader:++ + Correctly handle entities.+ + Improved handling of `<pre>` blocks (#927). Remove internal HTML tags+ in code blocks, rather than printing them verbatim. Parse attributes+ on `<pre>` tag for code blocks.++ * HTML reader: Handle non-simple tables (#893). Column widths are read from+ `col` tags if present, otherwise divided equally.++ * LaTeX reader++ + Support alltt environment (#892).+ + Support `\textasciitilde`, `\textasciicircum` (#810).+ + Treat `\textsl` as emphasized text reader (#850).+ + Skip positional options after `\begin{figure}`.+ + Support `\v{}` for hacek (#926).+ + Don't add spurious ", " to citation suffixes.+ This is added when needed in pandoc-citeproc.+ + Allow spaces in alignment spec in tables, e.g. `{ l r c }`.+ + Improved support for accented characters (thanks to Scott Morrison).+ + Parse label after section command and set id (#951).++ * RST reader:++ + Don't insert paragraphs where docutils doesn't.+ `rst2html` doesn't add `<p>` tags to list items (even when they are+ separated by blank lines) unless there are multiple paragraphs in the+ list. This commit changes the RST reader to conform more closely to+ what docutils does (#880).+ + Improved metadata. Treat initial field list as metadata when+ standalone specified. Previously ALL fields "title", "author",+ "date" in field lists were treated as metadata, even if not at+ the beginning. Use `subtitle` metadata field for subtitle.+ + Fixed 'authors' metadata parsing in reST. Semicolons separate+ different authors.++ * MediaWiki reader++ + Allow space before table rows.+ + Fixed regression for `<ref>URL</ref>`.+ `<` is no longer allowed in URLs, according to the uri parser+ in `Text.Pandoc.Parsing`. Added a test case.+ + Correctly handle indented preformatted text without preceding+ or following blank line.+ + Fixed `|` links inside table cells. Improved attribute parsing.+ + Skip attributes on table rows. Previously we just crashed if+ rows had attributes, now we ignore them.+ + Ignore attributes on headers.+ + Allow `Image:` for images (#971).+ + Parse an image with caption in a paragraph by itself as a figure.++ * LaTeX writer++ + Don't use ligatures in escaping inline code.+ + Fixed footnote numbers in LaTeX/PDF tables. This fixes a bug+ wherein notes were numbered incorrectly in tables (#827).+ + Always create labels for sections. Previously the labels were only+ created when there were links to the section in the document (#871).+ + Stop escaping `|` in LaTeX math.+ This caused problems with array environments (#891).+ + Change `\` to `/` in paths. `/` works even on Windows in LaTeX.+ `\` will cause major problems if unescaped.+ + Write id for code block to label attribute in LaTeX when listings+ is used (thanks to Florian Eitel).+ + Scale LaTeX tables so they don't exceed columnwidth.+ + Avoid problem with footnotes in unnumbered headers (#940).++ * Beamer writer: when creating beamer slides, add `allowframebreaks` option+ to the slide if it is one of the header classes. It is recommended+ that your bibliography slide have this attribute:++ # References {.allowframebreaks}++ This causes multiple slides to be created if necessary, depending+ on the length of the bibliography.++ * ConTeXt writer: Properly handle tables without captions. The old output+ only worked in MkII. This should work in MkIV as well (#837).++ * MediaWiki writer: Use native mediawiki tables instead of HTML (#720).++ * HTML writer:++ + Fixed `--no-highlight` (Alexander Kondratskiy).+ + Don't convert to lowercase in email obfuscation (#839).+ + Ensure proper escaping in `<title>` and `<meta>` fields.++ * AsciiDoc writer:++ + Support `--atx-headers` (Max Rydahl Andersen).+ + Don't print empty identifier blocks `([[]])` on headers (Max+ Rydahl Andersen).++ * ODT writer:++ + Fixing wrong numbered-list indentation in open document format+ (Alexander Kondratskiy) (#369).+ + `reference.odt`: Added pandoc as "generator" in `meta.xml`.+ + Minor changes for ODF 1.2 conformance (#939). We leave the+ nonconforming `contextual-spacing` attribute, which is provided by+ LibreOffice itself and seems well supported.++ * Docx writer:++ + Fixed rendering of display math in lists.+ In 1.11 and 1.11.1, display math in lists rendered as a new list+ item. Now it always appears centered, just as outside of lists,+ and in proper display math style, no matter how far indented the+ containing list item is (#784).+ + Use `w:br` with `w:type` `textWrapping` for linebreaks.+ Previously we used `w:cr` (#873).+ + Use Compact style for Plain block elements, to+ differentiate between tight and loose lists (#775).+ + Ignore most components of `reference.docx`.+ We take the `word/styles.xml`, `docProps/app.xml`,+ `word/theme/theme1.xml`, and `word/fontTable.xml` from+ `reference.docx`, ignoring everything else. This should help+ with the corruption problems caused when different versions of+ Word resave the reference.docx and reorganize things.+ + Made `--no-highlight` work properly.++ * EPUB writer++ + Don't add `dc:creator` tags if present in EPUB metadata.+ + Add `id="toc-title"` to `h1` in `nav.xhtml` (#799).+ + Don't put blank title page in reading sequence.+ Set `linear="no"` if no title block. Addresses #797.+ + Download webtex images and include as data URLs.+ This allows you to use `--webtex` in creating EPUBs.+ Math with `--webtex` is automatically made self-contained.+ + In `data/epub.css`, removed highlighting styles (which+ are no longer needed, since styles are added by the HTML+ writer according to `--highlighting-style`). Simplified+ margin fields.+ + If resource not found, skip it, as in Docx writer (#916).++ * RTF writer:++ + Properly handle characters above the 0000-FFFF range.+ Uses surrogate pairs. Thanks to Hiromi Ishii for the patch.+ + Fixed regression with RTF table of contents.+ + Only autolink absolute URIs. This fixes a regression, #830.++ * Markdown writer:++ + Only autolink absolute URIs. This fixes a regression, #830.+ + Don't wrap attributes in fenced code blocks.+ + Write full metadata in MMD style title blocks.+ + Put multiple authors on separate lines in pandoc titleblock.+ Also, don't wrap long author entries, as new lines get treated+ as new authors.++ * `Text.Pandoc.Templates`:++ + Fixed bug retrieving default template for markdown variants.+ + Templates can now contain "record lookups" in variables;+ for example, `author.institution` will retrieve the `institution`+ field of the `author` variable.+ + More consistent behavior of `$for$`. When `foo` is not a list,+ `$for(foo)$...$endfor$` should behave like $if(foo)$...$endif$.+ So if `foo` resolves to "", no output should be produced.+ See pandoc-templates#39.++ * Citation processing improvements (now part of pandoc-citeproc):++ + Fixed `endWithPunct` The new version correctly sees a sentence+ ending in '.)' as ending with punctuation. This fixes a bug which+ led such sentences to receive an extra period at the end: '.).'.+ Thanks to Steve Petersen for reporting.+ + Don't interfere with Notes that aren't citation notes.+ This fixes a bug in which notes not generated from citations were+ being altered (e.g. first letter capitalized) (#898).+ + Only capitalize footnote citations when they have a prefix.+ + Changes in suffix parsing. A suffix beginning with a digit gets 'p'+ inserted before it before passing to citeproc-hs, so that bare numbers+ are treated as page numbers by default. A suffix not beginning with+ punctuation has a space added at the beginning (rather than a comma and+ space, as was done before for not-author-in-text citations).+ The result is that `\citep[23]{item1}` in LaTeX will be interpreted+ properly, with '23' treated as a locator of type 'page'.+ + Many improvements to citation rendering, due to fixes in citeproc-hs+ (thanks to Andrea Rossato).+ + Warnings are issued for undefined citations, which are rendered+ as `???`.+ + Fixed hanging behavior when locale files cannot be found.++### Template changes++ * DocBook: Use DocBook 4.5 doctype.++ * Org: '#+TITLE:' is inserted before the title.+ Previously the writer did this.++ * LaTeX: Changes to make mathfont work with xelatex.+ We need the mathspec library, not just fontspec, for this.+ We also need to set options for setmathfont (#734).++ * LaTeX: Use `tex-ansi` mapping for `monofont`.+ This ensures that straight quotes appear as straight, rather than+ being treated as curly. See #889.++ * Made `\includegraphics` more flexible in LaTeX template.+ Now it can be used with options, if needed. Thanks to Bernhard Weichel.++ * LaTeX/Beamer: Added `classoption` variable.+ This is intended for class options like `oneside`; it may+ be repeated with different options. (Thanks to Oliver Matthews.)++ * Beamer: Added `fonttheme` variable. (Thanks to Luis Osa.)++ * LaTeX: Added `biblio-style` variable (#920).++ * DZSlides: title attribute on title section.++ * HTML5: add meta tag to allow scaling by user (Erik Evenson)++### Under-the-hood improvements++ * Markdown reader:Improved strong/emph parsing, using the strategy of+ <https://github.com/jgm/Markdown>. The new parsing algorithm requires+ no backtracking, and no keeping track of nesting levels. It will give+ different results in some edge cases, but these should not affect normal+ uses.++ * Added `Text.Pandoc.Compat.Monoid`.+ This allows pandoc to compile with `base` < 4.5, where `Data.Monoid`+ doesn't export `<>`. Thanks to Dirk Ullirch for the patch.++ * Added `Text.Pandoc.Compat.TagSoupEntity`.+ This allows pandoc to compile with `tagsoup` 0.13.x.+ Thanks to Dirk Ullrich for the patch.++ * Most of `Text.Pandoc.Readers.TeXMath` has been moved to the+ `texmath` module (0.6.4). (This allows `pandoc-citeproc` to+ handle simple math in bibliography fields.)++ * Added `Text.Pandoc.Writers.Shared` for shared functions used+ only in writers. `metaToJSON` is used in writers to create a+ JSON object for use in the templates from the pandoc metadata+ and variables. `getField`, `setField`, and `defField` are+ for working with JSON template contexts.++ * Added `Text.Pandoc.Asciify` utility module.+ This exports functions to create ASCII-only versions of identifiers.++ * `Text.Pandoc.Parsing`++ + Generalized state type on `readWith` (API change).+ + Specialize readWith to `String` input. (API change).+ + In `ParserState`, replace `stateTitle`, `stateAuthors`, `stateDate`+ with `stateMeta` and `stateMeta'`.++ * `Text.Pandoc.UTF8`: use strict bytestrings in reading. The use of lazy+ bytestrings seemed to cause problems using pandoc on 64-bit Windows+ 7/8 (#874).++ * Factored out `registerHeader` from markdown reader, added to+ `Text.Pandoc.Parsing`.++ * Removed `blaze_html_0_5` flag, require `blaze-html` >= 0.5.+ Reason: < 0.5 does not provide a monoid instance for Attribute,+ which is now needed by the HTML writer (#803).++ * Added `http-conduit` flag, which allows fetching https resources.+ It also brings in a large number of dependencies (`http-conduit`+ and its dependencies), which is why for now it is an optional flag+ (#820).++ * Added CONTRIBUTING.md.++ * Improved INSTALL instructions.++ * `make-windows-installer.bat`: Removed explicit paths for executables.++ * `aeson` is now used instead of `json` for JSON.++ * Set default stack size to 16M. This is needed for some large+ conversions, esp. if pandoc is compiled with 64-bit ghc.++ * Various small documentation improvements.+ Thanks to achalddave and drothlis for patches.++ * Removed comment that chokes recent versions of CPP (#933).++ * Removed support for GHC version < 7.2, since pandoc-types now+ requires at least GHC 7.2 for GHC generics.+++## pandoc 1.11.1 (2013-03-17)++ * Markdown reader:++ + Fixed regression in which parentheses were lost in link URLs.+ Added tests. Closes #786.+ + Better handling of unmatched double quotes in `--smart` mode.+ These occur frequently in fiction, since it is customary not to+ close quotes in dialogue if the speaker does not change between+ paragraphs. The unmatched quotes now get turned into literal+ left double quotes. (No `Quoted` inline is generated, however.)+ Closes #99 (again).++ * HTML writer: Fixed numbering mismatch between TOC and sections.+ `--number-offset` now affects TOC numbering as well+ as section numbering, as it should have all along. Closes #789.++ * Markdown writer: Reverted 1.11 change that caused citations to be rendered+ as markdown citations, even if `--bibliography` was specified, unless+ `citation` extension is disabled. Now, formatted citations are always+ printed if `--bibliography` was specified. If you want to reformat+ markdown keeping pandoc markdown citations intact, don't use+ `--bibliography`. Note that citations parsed from LaTeX documents will+ be rendered as pandoc markdown citations when `--bibliography` is not+ specified.++ * ODT writer: Fixed regression leading to corrupt ODTs.+ This was due to a change in the `Show` instance for+ `Text.Pandoc.Pretty.Doc`. Closes #780.++ * Fixed spacing bugs involving code block attributes in+ RST reader and Markdown writer. Closes #763.++ * Windows package: Various improvements due to Fyodor Sheremetyev.++ + Automatically set installation path (Program Files or Local App Data).+ + Set system PATH environment variable when installing for all users.+ + Pandoc can installed for all users using the following command.+ `msiexec /i pandoc-1.11.msi ALLUSERS=1`.++ * Bumped QuickCheck version bound.++## pandoc 1.11 (2013-03-09)++ * Added `--number-offset` option. (See README for description.)++ * Added `--default-image-extension` option. (See README for description.)++ * `--number-sections` behavior change: headers with class `unnumbered`+ will not be numbered.++ * `--version` now reports the default data directory.++ * `Text.Pandoc.Parsing` is no longer exposed. (API change.)++ * `Text.Pandoc.Highlighting` is no longer exposed. (API change.)++ * `Text.Pandoc.Shared`: Changed type of `Element`. `Sec` now includes+ a field for `Attr` rather than just `String`. (API change.)++ * Added `markdown_github` as input format. This was an accidental+ omission in 1.10.++ * Added `readerDefaultImageExtension` field to `ReaderOptions`. (API+ change.)++ * Added `writerNumberOffset` field in `WriterOptions`. (API change.)++ * Beamer template:++ + Fixed captions with longtable. Thanks to Joost Kremers.+ + Provide `\Oldincludegraphics` as in LaTeX template (Benjamin Bannier).++ * LaTeX template:++ + Load microtype after fonts. Microtype needs to know+ what fonts are being used. Thanks to dfc for the patch.+ + Set `secnumdepth` to 5 if `--number-sections` specified.+ This yields behavior equivalent to the other writers, numbering+ level 4 and 5 headers too. Closes #753.++ * HTML reader:++ + Handle `<colgroup>` tag.+ + Preserve all header attributes.++ * LaTeX reader:++ + Parse `\hrule` as `HorizontalRule`. Closes #746.+ + Parse starred variants of `\section` etc. as headers with+ attribute `unnumbered`.+ + Read optional attributes in `lstlisting` and `Verbatim` environments.+ We convert these to pandoc standard names, e.g. `numberLines`+ for `numbers=left`, `startFrom=100` from `firstnumber=100`.+ + Handle language attribute for lstlistings.+ + Better support for Verbatim and minted environments. Closes #763.++ * Markdown reader:++ + `-` in an attribute context = `.unnumbered`. The point of this+ is to provide a way to specify unnumbered headers in non-English+ documents.+ + Fixed bug parsing key/value attributes. Parsing failed if you+ had an unquoted attribute immediately before the final '}'.+ + Make backslash escape work in attributes.+ + Fix title block parsing. Now if `mmd_title_blocks` is specified,+ pandoc will parse a MMD title block if it sees one, even if+ `pandoc_title_blocks` is enabled.+ + Refactoring: `litChar` now includes entities, so we don't need+ to use `fromEntities` e.g. on titles.+ + Allow spaces around borders in pipe tables. Closes #772.+ + Allow all punctuation in angle-bracket autolinks. Previously+ things like `----` were disallowed, because the uri parser+ treated them as trailing punctuation. Closes #768.+ + Make `implicit_header_references` work properly when+ headers are given explicit identifiers.+ + Check for tables before line blocks. Otherwise some pipe+ tables get treated as line blocks.+ + Allow `&` in emails (for entities).+ + Properly handle entities in titles and links. A markdown link+ `<http://göogle.com>` should be a link to `http://göogle.com`.+ Closes #723.++ * Textile reader:++ + Handle attributes on headers.++ * LaTeX reader:++ + Add `fig:` as title for images with captions.+ This is needed for them to be rendered as figures. Closes #766.+ + Never emit an empty paragraph. See #761.+ + Handle `\caption` for images in figures. Closes #766.+ + Parse `\section*`, etc. as unnumbered sections.++ * HTML writer:++ + Support header attributes. The attributes go on+ the enclosing `section` or `div` tag if `--section-divs` is specified.+ + Fixed a regression (only now noticed) in html+lhs output.+ Previously the bird tracks were being omitted.++ * LaTeX writer:++ + Omit lists with no items to avoid LaTeX errors.+ + Support line numbering with `--listings`.+ If `numberLines` class is present, we add `numbers=left`;+ if `startFrom` is present, we add `firstnumber=`. (#763)++ * ConTeXt writer:++ + Removed `\placecontent`. This produced a duplicate toc,+ in conjunction with `\placelist`.+ + Use `\title`, `\subject` etc. for headers with+ `unnumbered` class.++ * Textile writer:++ + Support header attributes.++ * Markdown writer:++ + Use grid tables when needed, and if enabled. Closes #740.+ + Render citations as pandoc-markdown citations.+ Previously citations were rendered as citeproc-formatted citations+ by default. Now we render them as pandoc citations, e.g. `[@item1]`,+ unless the `citations` extension is disabled.+ If you still want formatted citations in your markdown output,+ use `pandoc -t markdown-citations`.++ * RST writer:++ + Support `:number-lines:` in code blocks.++ * Docx writer:++ + Better treatment of display math. Display math inside a+ paragraph is now put in a separate paragraph, so it will render+ properly (centered and without extra blank lines around it).+ Partially addresses #742.+ + Content types and document rels xml files are now created from+ scratch, rather than being taken over from `reference.docx`.+ This fixes problems that arise when you edit the `reference.docx`+ with Word.+ + We also now encode mime types for each individual image rather+ than using defaults. This should allow us to handle a wider+ range of image types (including PDF). Closes #414.+ + Changed style names in `reference docx`.+ `FootnoteReference` -> `FootnoteRef`, `Hyperlink` -> `Link`.+ The old names got changed by Word when the `reference.docx` was+ edited. Closes #414.++ * EPUB writer:++ + Fix section numbering. Previously the numbering restarted from 1+ in each chapter (with `--number-sections`), though the numbers in+ the table of contents were correct.+ + Headers with "unnumbered" attribute are not numbered. (Nor do they+ cause an increment in running numbering.) Section numbers now work+ properly, even when there is material before the first numbered section.+ + Include HTML TOC, even in epub2. The TOC is included in `<spine>`,+ but `linear` is set to `no` unless the `--toc` option is specified.+ Include `<guide>` element in OPF. This should allow the TOC to+ be usable in Kindles when converted with kindlegen. Closes #773.++ * `Text.Pandoc.Parsing`: Optimized `oneOfStringsCI`.+ This dramatically reduces the speed penalty that comes from enabling the+ `autolink_bare_uris` extension. The penalty is still substantial (in one+ test, from 0.33s to 0.44s), but nowhere near what it used to be.+ The RST reader is also much faster now, as it autodetects URIs.++ * `Text.Pandoc.Shared`: `hierarchicalize` will not number section+ with class "unnumbered". Unnumbered sections get `[]` for their+ section number.++ * `Text.Pandoc.Pretty`:++ + Fixed `chomp` so it works inside `Prefixed` elements.+ + Changed `Show` instance so it is better for debugging.++ * `Text.Pandoc.ImageSize`: Added `Pdf` to `ImageType`.++ * `Text.Pandoc.UTF8`: Strip off BOM if present. Closes #743.++ * Windows installer improvements:++ + The installer is now signed with a certificate (thanks to+ Fyodor Sheremetyev).+ + WiX is used instead of InnoSetup. The installer is now a+ standard msi file.+ + The version number is now auto-detected, and need not be+ updated separately.++ * OSX installer improvements:++ + The package and pandoc executable are now signed with a+ certificate (thanks to Fyodor Sheremetyev).+ + RTF version of license is used.+ + Use full path for sysctl in `InstallationCheck` script (jonahbull).+ Closes #580.++ * Converted COPYING to markdown.++ * pandoc.cabal: Require latest versions of highlighting-kate,+ texmath, citeproc-hs, zip-archive.++## pandoc 1.10.1 (2013-01-23)++ * Markdown reader: various optimizations, leading to a+ significant performance boost.++ * RST reader: Allow anonymous form of inline links:+ `` `hello <url>`__ `` Closes #724.++ * Mediawiki reader: Don't require newlines after tables.+ Thanks to jrunningen for the patch. Closes #733.++ * Fixed LaTeX macro parsing. Now LaTeX macro definitions are preserved+ when output is LaTeX, and applied when it is another format.+ Partially addresses #730.++ * Markdown and RST readers: Added parser to `block` that skips blank+ lines. This fixes a subtle regression involving grid tables with+ empty cells. Also added test for grid table with empty cells.+ Closes #732.++ * RST writer: Use `.. code:: language` for code blocks with language.+ Closes #721.++ * DocBook writer: Fixed output for hard line breaks, adding a newline+ between `<literallayout>` tags.++ * Markdown writer: Use an autolink when link text matches url.+ Previously we also checked for a null title, but this+ test fails for links produced by citeproc-hs in bibliographies.+ So, if the link has a title, it will be lost on conversion+ to an autolink, but that seems okay.++ * Markdown writer: Set title, author, date variables as before.+ These are no longer used in the default template, since we use+ titleblock, but we set them anyway for those who use custom templates.++ * LaTeX writer: Avoid extra space at start/end of table cell.+ Thanks to Nick Bart for the suggestion of using @{}.++ * `Text.Pandoc.Parsing`:++ + More efficient version of `anyLine`.+ + Type of `macro` has changed; the parser now returns `Blocks`+ instead of `Block`.++ * Relaxed old-time version bound, allowing 1.0.*.++ * Removed obsolete `hsmarkdown` script. Those who need `hsmarkdown`+ should create a symlink as described in the README.++## pandoc 1.10.0.5 (2013-01-23)++ * Markdown reader: Try `lhsCodeBlock` before `rawTeXBlock`. Otherwise+ `\begin{code}...\end{code}` isn't handled properly in markdown+lhs.+ Thanks to Daniel Miot for noticing the bug and suggesting the fix.++ * Markdown reader: Fixed bug with headerless grid tables.+ The 1.10 code assumed that each table header cell contains exactly one+ block. That failed for headerless tables (0) and also for tables with+ multiple blocks in a header cell. The code is fixed and tests provided.+ Thanks to Andrew Lee for pointing out the bug.++ * Markdown reader: Fixed regressions in fenced code blocks. Closes #722.++ + Tilde code fences can again take a bare language string+ (`~~~ haskell`), not just curly-bracketed attributes+ (`~~~ {.haskell}`).+ + Backtick code blocks can take the curly-bracketed attributes.+ + Backtick code blocks don't *require* a language.+ + Consolidated code for the two kinds of fenced code blocks.++ * LaTeX template: Use `\urlstyle{same}` to avoid monospace URLs.++ * Markdown writer: Use proportional font for email autolinks with+ obfuscation. Closes #714.++ * Corrected name of `blank_before_blockquote` in README. Closes #718.++ * `Text.Pandoc.Shared`: Fixed bug in `uri` parser.+ The bug prevented an autolink at the end of a string (e.g.+ at the end of a line block line) from counting as a link. Closes #711.++ * Use the `hsb2hs` preprocessor instead of TH for embed_data_files.+ This should work on Windows, unlike the TH solution with+ file-embed.++ * Eliminated use of TH in test suite.++ * Added `Text.Pandoc.Data` (non-exported) to hold the association+ list of embedded data files, if the `embed_data_files` flag is selected.+ This isolates the code that needs special treatment with file-embed or+ `hsb2hs`.++ * Changes to `make-windows-installer.bat`.++ + Exit batch file if any of the cabal-dev installs fail.+ + There's no longer any need to reinstall `highlighting-kate`.+ + Don't start with a `cabal update`; leave that to the user.+ + Force reinstall of pandoc.++ * Fixed EPUB writer so it builds with blaze-html 0.4.x. Thanks to+ Jens Petersen.++## pandoc 1.10.0.4 (2013-01-20)++ * Fixed bug with escaped % in LaTeX reader. Closes #710.++## pandoc 1.10.0.3 (2013-01-20)++ * Added further missing fb2 tests to cabal file.++## pandoc 1.10.0.2 (2013-01-20)++ * Added fb2 tests to cabal file's extra-source-files.++## pandoc 1.10.0.1 (2013-01-20)++ * Bump version bounds on test-framework packages.++## pandoc 1.10 (2013-01-19)++### New features++ * New input formats: `mediawiki` (MediaWiki markup).++ * New output formats: `epub3` (EPUB v3 with MathML),+ `fb2` (FictionBook2 ebooks).++ * New `--toc-depth` option, specifying how many levels of+ headers to include in a table of contents.++ * New `--epub-chapter-level` option, specifying the header+ level at which to divide EPUBs into separate files.+ Note that this normally affects only performance, not the+ visual presentation of the EPUB in a reader.++ * Removed the `--strict` option. Instead of using `--strict`,+ one can now use the format name `markdown_strict` for either input+ or output. This gives more fine-grained control that `--strict`+ did, allowing one to convert from pandoc's markdown to strict+ markdown or vice versa.++ * It is now possible to enable or disable specific syntax+ extensions by appending them (with `+` or `-`) to the writer+ or reader name. For example,++ pandoc -f markdown-footnotes+hard_line_breaks++ disables footnotes and enables treating newlines as hard+ line breaks. The literate Haskell extensions are now implemented+ this way as well, using either `+lhs` or `+literate_haskell`.+ For a list of extension names, see the README under+ "Pandoc's Markdown."++ * The following aliases have been introduced for specific+ combinations of markdown extensions: `markdown_phpextra`,+ `markdown_github`, `markdown_mmd`, `markdown_strict`. These aliases+ work just like regular reader and writer names, and can be modified+ with extension modifiers as described above. (Note that conversion+ from one markdown dialect to another does not work perfectly,+ because there are differences in markdown parsers besides+ just the extensions, and because pandoc's internal document model is+ not rich enough to capture all of the extensions.)++ * New `--html-q-tags` option. The previous default was to use `<q>`+ tags for smart quotes in HTML5. But `<q>` tags are also valid HTML4.+ Moreover, they are not a robust way of typesetting quotes, since+ some user agents don't support them, and some CSS resets (e.g.+ bootstrap) prevent pandoc's quotes CSS from working properly.+ We now just insert literal quote characters by default in both+ `html` and `html5` output, but this option is provided for+ those who still want `<q>` tags.++ * The markdown reader now prints warnings (to stderr) about+ duplicate link and note references. Closes #375.++ * Markdown syntax extensions:++ + Added pipe tables. Thanks to François Gannaz for the initial patch.+ These conform to PHP Markdown Extra's pipe table syntax. A subset+ of org-mode table syntax is also supported, which means that you can+ use org-mode's nice table editor to create tables.++ + Added support for RST-style line blocks. These are+ useful for verse and addresses.++ + Attributes can now be specified for headers, using the same+ syntax as in code blocks. (However, currently only the+ identifier has any effect in most writers.) For example,++ # My header {#foo}++ See [the header above](#foo).++ + Pandoc will now act as if link references have been defined+ for all headers without explicit identifiers.+ So, you can do this:++ # My header++ Link to [My header].+ Another link to [it][My header].++ Closes #691.++ * LaTeX reader:++ + Command macros now work everywhere, including non-math.+ Environment macros still not supported.+ + `\input` now works, as well as `\include`. TEXINPUTS is used.+ Pandoc looks recursively into included files for more included files.++### Behavior changes++ * The Markdown reader no longer puts the text of autolinks in a+ `Code` inline. This means that autolinks will no longer appear+ in a monospace font.++ * The character `/` can now appear in markdown citation keys.++ * HTML blocks in strict_markdown are no longer required to begin+ at the left margin. Technically this is required, according to+ the markdown syntax document, but `Markdown.pl` and other markdown+ processors are more liberal.++ * The `-V` option has been changed so that if there are duplicate+ variables, those specified later on the command line take precedence.++ * Tight lists now work in LaTeX and ConTeXt output.++ * The LaTeX writer no longer relien on the `enumerate` package.+ Instead, it uses standard LaTeX commands to change the list numbering+ style.++ * The LaTeX writer now uses `longtable` instead of `ctable`. This allows+ tables to be split over page boundaries.++ * The RST writer now uses a line block to render paragraphs containing+ linebreaks (which previously weren't supported at all).++ * The markdown writer now applies the `--id-prefix` to footnote IDs.+ Closes #614.++ * The plain writer no longer uses backslash-escaped line breaks+ (which are not very "plain").++ * `Text.Pandoc.UTF8`: Better error message for invalid UTF8.+ Read bytestring and use `Text`'s decodeUtf8 instead of using+ `System.IO.hGetContents`. This way you get a message saying+ "invalid UTF-8 stream" instead of "invalid byte sequence."+ You are also told which byte caused the problem.++ * Docx, ODT, and EPUB writers now download images specified by a URL+ instead of skipping them or raising an error.++ * EPUB writer:++ + The default CSS now left-aligns headers by default, instead of+ centering. This is more consistent with the rest of the writers.+ + A proper multi-level table of contents is now used in `toc.ncx`.+ There is no longer a subsidiary table of contents at the beginning+ of each chapter.+ + Code highlighting now works by default.+ + Section divs are used by default for better semantic markup.+ + The title is used instead of "Title Page" in the table of contents.+ Otherwise we have a hard-coded English string, which looks+ strange in ebooks written in other languages. Closes #572.++ * HTML writer:++ + Put mathjax in span with class "math". Closes #562.+ + Put citations in a span with class "citation." In HTML5, also include+ a `data-cite` attribute with a space-separated list of citation+ keys.++ * `Text.Pandoc.UTF8`: use universalNewlineMode in reading.+ This treats both `\r\n` and `\n` as `\n` on input, no matter+ what platform we're running on.++ * Citation processing is now done in the Markdown and LaTeX+ readers, not in `pandoc.hs`. This makes it easier for library users+ to use citations.++### Template changes++ * HTML: Added css to template to preserve spaces in `<code>` tags.+ Thanks to Dirk Laurie.++ * Beamer: Remove English-centric strings in section pages.+ Section pages used to have "Section" and a number as well as the+ section title. Now they just have the title. Similarly for part+ and subsection. Closes #566.++ * LaTeX, ConTeXt: Added papersize variable.++ * LaTeX, Beamer templates: Use longtable instead of ctable.++ * LaTeX, Beamer templates: Don't require 'float' package for tables.+ We don't actually seem to use the '[H]' option.++ * Markdown, plain: Fixed titleblock so it is just a single string.+ Previously separate title, author, and date variables were used,+ but this didn't allow different kinds of title blocks.++ * EPUB:++ + Rationalized templates. Previously there were three different+ templates involved in epub production. There is now just one+ template, `default.epub` or `default.epub3`. It can now be+ overridden using `--template`, just like other templates.+ The titlepage is now folded into the default template.+ A `titlepage` variable selects it.+ + UTF-8, lang tag, meta tags, title element.++ * Added scale-to-width feature to beamer template++### API changes++ * `Text.Pandoc.Definition`: Added `Attr` field to `Header`.+ Previously header identifiers were autogenerated by the writers.+ Now they are added in the readers (either automatically or explicitly).++ * `Text.Pandoc.Builder`:++ + `Inlines` and `Blocks` are now synonyms for `Many Inline` and+ `Many Block`. `Many` is a newtype wrapper around `Seq`, with+ custom Monoid instances for `Many Inline` and `Many Block. This+ allows `Many` to be made an instance of `Foldable` and `Traversable`.+ + The old `Listable` class has been removed.+ + The module now exports `isNull`, `toList`, `fromList`.+ + The old `Read` and `Show` instances have been removed; derived+ instances are now used.+ + Added `headerWith`.++ * The readers now take a `ReaderOptions` rather than a `ParserState`+ as a parameter. Indeed, not all parsers use the `ParserState` type;+ some have a custom state. The motivation for this change was to separate+ user-specifiable options from the accounting functions of parser state.++ * New module `Text.Pandoc.Options`. This includes the `WriterOptions`+ formerly in `Text.Pandoc.Shared`, and its associated+ data types. It also includes a new type `ReaderOptions`, which+ contains many options formerly in `ParserState`, and its associated+ data types:++ + `ParserState.stateParseRaw` -> `ReaderOptions.readerParseRaw`.+ + `ParserState.stateColumns` -> `ReaderOptions.readerColumns`.+ + `ParserState.stateTabStop` -> `ReaderOptions.readerTabStop`.+ + `ParserState.stateOldDashes` -> `ReaderOptions.readerOldDashes`.+ + `ParserState.stateLiterateHaskell` -> `ReaderOptions.readerLiterateHaskell`.+ + `ParserState.stateCitations` -> `ReaderOptions.readerReferences`.+ + `ParserState.stateApplyMacros` -> `ReaderOptions.readerApplyMacros`.+ + `ParserState.stateIndentedCodeClasses` ->+ `ReaderOptions.readerIndentedCodeClasses`.+ + Added `ReaderOptions.readerCitationStyle`.++ * `WriterOptions` now includes `writerEpubVersion`, `writerEpubChapterLevel`,+ `writerEpubStylesheet`, `writerEpubFonts`, `writerReferenceODT`,+ `writerReferenceDocx`, and `writerTOCDepth`. `writerEPUBMetadata` has+ been renamed `writerEpubMetadata` for consistency.++ * Changed signatures of `writeODT`, `writeDocx`, `writeEPUB`, since they no+ longer stylesheet, fonts, reference files as separate parameters.++ * Removed `writerLiterateHaskell` from `WriterOptions`, and+ `readerLiterateHaskell` from `ReaderOptions`. LHS is now handled+ by an extension (`Ext_literate_haskell`).++ * Removed deprecated `writerXeTeX`.++ * Removed `writerStrict` from `WriterOptions`. Added `writerExtensions`.+ Strict is now handled through extensions.++ * `Text.Pandoc.Options` exports `pandocExtensions`, `strictExtensions`,+ `phpMarkdownExtraExtensions`, `githubMarkdownExtensions`,+ and `multimarkdownExtensions`, as well as the `Extensions` type.++ * New `Text.Pandoc.Readers.MediaWiki` module, exporting+ `readMediaWiki`.++ * New `Text.Pandoc.Writers.FB2` module, exporting `writeFB2`+ (thanks to Sergey Astanin).++ * `Text.Pandoc`:++ + Added `getReader`, `getWriter` to `Text.Pandoc`.+ + `writers` is now an association list `(String, Writer)`.+ A `Writer` can be a `PureStringWriter`, an `IOStringWriter`, or+ an `IOByteStringWriter`. ALL writers are now in the 'writers'+ list, including the binary writers and FB2 writer. This allows+ code in `pandoc.hs` to be simplified.+ + Changed type of `readers`, so all readers are in IO.+ Users who want pure readers can still get them form the reader+ modules; this just affects the function `getReader` that looks up+ a reader based on the format name. The point of this change is to+ make it possible to print warnings from the parser.++ * `Text.Pandoc.Parsing`:++ + `Text.Parsec` now exports all Parsec functions used in pandoc code.+ No other module directly imports Parsec. This will make it easier+ to change the parsing backend in the future, if we want to.+ + `Text.Parsec` is used instead of `Text.ParserCombinators.Parsec`.+ + Export the type synonym `Parser`.+ + Export `widthsFromIndices`, `NoteTable'`, `KeyTable'`, `Key'`, `toKey'`,+ `withQuoteContext`, `singleQuoteStart`, `singleQuoteEnd`,+ `doubleQuoteStart`, `doubleQuoteEnd`, `ellipses`, `apostrophe`,+ `dash`, `nested`, `F(..)`, `askF`, `asksF`, `runF`, `lineBlockLines`.+ + `ParserState` is no longer an instance of `Show`.+ + Added `stateSubstitutions` and `stateWarnings` to `ParserState`.+ + Generalized type of `withQuoteContext`.+ + Added `guardEnabled`, `guardDisabled`, `getOption`.+ + Removed `failIfStrict`.+ + `lookupKeySrc` and `fromKey` are no longer exported.++ * `Data.Default` instances are now provided for `ReaderOptions`,+ `WriterOptions`, and `ParserState`. `Text.Pandoc` re-exports `def`.+ Now you can use `def` (which is re-exported by `Text.Pandoc`) instead+ of `defaultWriterOptions` (which is still defined). Closes #546.++ * `Text.Pandoc.Shared`:++ + Added `safeRead`.+ + Renamed `removedLeadingTrailingSpace` to `trim`,+ `removeLeadingSpace` to `triml`, and `removeTrailingSpace` to `trimr`.+ + Count `\r` as space in `trim` functions.+ + Moved `renderTags'` from HTML reader and `Text.Pandoc.SelfContained`+ to `Shared`.+ + Removed `failUnlessLHS`.+ + Export `compactify'`, formerly in Markdown reader.+ + Export `isTightList`.+ + Do not export `findDataFile`.+ + `readDataFile` now returns a strict ByteString.+ + Export `readDataFileUTF8` which returns a String, like the+ old `readDataFile`.+ + Export `fetchItem` and `openURL`.++ * `Text.Pandoc.ImageSize`: Use strict, not lazy bytestrings.+ Removed `readImageSize`.++ * `Text.Pandoc.UTF8`: Export `encodePath`, `decodePath`,+ `decodeArg`, `toString`, `fromString`, `toStringLazy`,+ `fromStringLazy`.++ * `Text.Pandoc.UTF8` is now an exposed module.++ * `Text.Pandoc.Biblio`:++ + csl parameter now a `String` rather than a `FilePath`.+ + Changed type of `processBiblio`. It is no longer in the IO monad.+ It now takes a `Maybe Style` argument rather than parameters for CSL+ and abbrev filenames. (`pandoc.hs` now calls the functions to parse+ the style file and add abbreviations.)++ * Markdown reader now exports `readMarkdownWithWarnings`.++ * `Text.Pandoc.RTF` now exports `writeRTFWithEmbeddedImages` instead of+ `rtfEmbedImage`.++### Bug fixes++ * Make `--ascii` work properly with `--self-contained`. Closes #568.++ * Markdown reader:++ + Fixed link parser to avoid exponential slowdowns. Closes #620.+ Previously the parser would hang on input like this:++ [[[[[[[[[[[[[[[[[[hi++ We fixed this by making the link parser parser characters+ between balanced brackets (skipping brackets in inline code spans),+ then parsing the result as an inline list. One change is that++ [hi *there]* bud](/url)++ is now no longer parsed as a link. But in this respect pandoc behaved+ differently from most other implementations anyway, so that seems okay.++ + Look for raw html/latex blocks before tables.+ Otherwise the following gets parsed as a table:++ \begin{code}+ --------------+ -- My comment.+ \end{code}++ Closes #578.++ * RST reader:++ + Added support for `:target:` on `.. image::` blocks+ and substitutions.+ + Field list fixes:++ - Fixed field lists items with body beginning after a new line+ (Denis Laxalde).+ - Allow any char but ':' in names of field lists in RST reader+ (Denis Laxalde).+ - Don't allow line breaks in field names.+ - Require whitespace after field list field names.+ - Don't create empty definition list for metadata field lists.+ Previously a field list consisting only of metadata fields (author,+ title, date) would be parsed as an empty DefinitionList, which is+ not legal in LaTeX and not needed in any format.++ + Don't recognize inline-markup starts inside words.+ For example, `2*2 = 4*1` should not contain an emphasized+ section. Added test case for "Literal symbols". Closes #569.+ + Allow dashes as separator in simple tables. Closes #555.+ + Added support for `container`, `compound`, `epigraph`,+ `rubric`, `highlights`, `pull-quote`.+ + Added support for `.. code::`.+ + Made directive labels case-insensitive.+ + Removed requirement that directives begin at left margin.+ This was (correctly) not in earlier releases; docutils doesn't+ make the requirement.+ + Added support for `replace::` and `unicode::` substitutions.+ + Ignore unknown interpreted roles.+ + Renamed image parser to `subst`, since it now handles all+ substitution references.++ * Textile reader:++ + Allow newlines before pipes in table. Closes #654.+ + Fixed bug with list items containing line breaks.+ Now pandoc correctly handles hard line breaks inside list items.+ Previously they broke list parsing.+ + Implemented comment blocks.+ + Fixed bug affected words ending in hyphen.+ + Properly handle links with surrounding brackets.+ Square brackets need to be used when the link isn't surrounded by+ spaces or punctuation, or when the URL ending may be ambiguous.+ Closes #564.+ + Removed nullBlock. Better to know about parsing problems than+ to skip stuff when we get stuck.+ + Allow ID attributes on headers.+ + Textile reader: Avoid parsing dashes as strikeout.+ Previously the input++ text--+ text--+ text--+ text--++ would be parsed with strikeouts rather than dashes. This fixes+ the problem by requiring that a strikeout delimiting - not be+ followed by a -. Closes #631.+ + Expanded list of `stringBreakers`.+ This fixes a bug on input like "(_hello_)" which should+ be a parenthesized emphasized "hello".+ The new list is taken from the PHP source of textile 2.4.+ + Fixed autolinks. Previously the textile reader and writer+ incorrectly implemented RST-style autolinks for URLs and email+ addresses. This has been fixed. Now an autolink is done this way:+ `"$":http://myurl.com`.+ + Fixed footnotes bug in textile. This affected notes occurring+ before punctuation, e.g. `foo[1].`. Closes #518.++ * LaTeX reader:++ + Better handling of citation commands.+ + Better handling of `\noindent`.+ + Added a 'try' in rawLaTeXBlock, so we can handle `\begin` without `{`.+ Closes #622.+ + Made `rawLaTeXInline` try to parse block commands as well. This+ is usually what we want, given how `rawLaTeXInline` is used in+ the markdown and textile readers. If a block-level LaTeX command+ is used in the middle of a paragraph (e.g. `\subtitle` inside a title),+ we can treat it as raw inline LaTeX.+ + Handle `\slash` command. Closes #605.+ + Basic `\enquote` support.+ + Fixed parsing of paragraphs beginning with a group. Closes #606.+ + Use curly quotes for bare straight quotes.+ + Support obeylines environment. Closes #604.+ + Guard against "begin", "end" in inlineCommand and+ blockCommand.+ + Better error messages for environments. Now it should tell you that+ it was looking for \end{env}, instead of giving "unknown parse error."++ * HTML reader:++ + Added HTML 5 tags to list of block-level tags.+ + HTML reader: Fixed bug in `htmlBalanced`, which+ caused hangs in parsing certain markdown input using+ strict mode.+ + Parse `<q>` as `Quoted DoubleQuote`.+ + Handle nested `<q>` tags properly.+ + Modified `htmlTag` for fewer false positives.+ A tag must start with `<` followed by `!`,`?`, `/`, or a letter.+ This makes it more useful in the wikimedia and markdown parsers.++ * DocBook reader: Support title in "figure" element. Closes #650.++ * MediaWiki writer:++ + Remove newline after `<br/>` in translation of `LineBreak`+ There's no particular need for a newline (other than making the+ generated MediaWiki source look nice to a human), and in fact+ sometimes it is incorrect: in particular, inside an enumeration, list+ items cannot have embedded newline characters. (Brent Yorgey)+ + Use `<code>` not `<tt>` for Code.++ * Man writer: Escape `-` as `\-`.+ Unescaped `-`'s become hyphens, while `\-`'s are left as ascii minus+ signs. That is preferable for use with command-line options. See+ <http://lintian.debian.org/tags/hyphen-used-as-minus-sign.html>. Thanks+ to Andrea Bolognani for bringing the issue to our attention.++ * RST writer:++ + Improved line block output. Use nonbreaking spaces for+ initial indent (otherwise lost in HTML and LaTeX).+ Allow multiple paragraphs in a single line block.+ Allow soft breaks w continuations in line blocks.+ + Properly handle images with no alt text. Closes #678.+ + Fixed bug with links with duplicate text. We now (a) use anonymous+ links for links with inline URLs, and (b) use an inline link instead+ of a reference link if the reference link would require a label that+ has already been used for a different link. Closes #511.+ + Fixed hyperlinked images. Closes #611. Use `:target:`+ field when you have a simple linked image.+ + Don't add `:align: center` to figures.++ * Texinfo writer: Fixed internal cross-references.+ Now we insert anchors after each header, and use `@ref` instead of `@uref`+ for links. Commas are now escaped as `@comma{}` only when needed;+ previously all commas were escaped. (This change is needed, in part,+ because `@ref` commands must be followed by a real comma or period.) Also+ insert a blank line in from of `@verbatim` environments.++ * DocBook writer:++ + Made --id-prefix work in DocBook as well as HTML.+ Closes #607.+ + Don't include empty captions in figures. Closes #581.++ * LaTeX writer:++ + Use `\hspace*` for nonbreaking space after line break,+ since `~` spaces after a line break are just ignored.+ Closes #687.+ + Don't escape `_` in URLs or hyperref identifiers.+ + Properly escape strings inside `\url{}`. Closes #576.+ + Use `[fragile]` only for slides containing code rendered+ using listings. Closes #649.+ + Escape `|` as `\vert` in LaTeX math. This avoids a clash with+ highlighting-kate's macros, which redefine `|` as a short verbatim+ delimiter. Thanks to Björn Peemöller for raising this issue.+ + Use minipage rather than parbox for block containers in tables.+ This allows verbatim code to be included in grid tables.+ Closes #663.+ + Prevent paragraphs containing only linebreaks or spaces.++ * HTML writer:++ + Included `highlighting-css` for code spans, too.+ Previously it was only included if used in a code block. Closes #653.+ + Improved line breaks with `<dd>` tags. We now put a newline between+ `</dd>` and `<dd>` when there are multiple definitions.+ + Changed mathjax cdn url so it doesn't use https. (This caused+ problems when used with `--self-contained`.) See #609.++ * EPUB writer:++ + `--number-sections` now works properly.+ + Don't strip meta and link elements in epub metadata.+ Patch from aberrancy. Closes #589.+ + Fixed a couple validation bugs.+ + Use ch001, ch002, etc. for chapter filenames. This improves sorting+ of chapters in some readers, which apparently sort ch2 after ch10.+ Closes #610.++ * ODT writer: properly set title property (Arlo O'Keeffe).++ * Docx writer:++ + Fixed bug with nested lists. Previously a list like++ 1. one+ - a+ - b+ 2. two++ would come out with a bullet instead of "2."+ Thanks to Russell Allen for reporting the bug.+ + Use `w:cr` in `w:r` instead of `w:br` for linebreaks.+ This seems to fix a problem viewing pandoc-generated+ docx files in LibreOffice.+ + Use integer ids for bookmarks. Closes #626.+ + Added nsid to abstractNum elements. This helps when merging+ word documents with numbered or bulleted lists. Closes #627.+ + Use separate footnotes.xml for notes.+ This seems to help LibreOffice convert the file, even though+ it was valid docx before. Closes #637.+ + Use rIdNN identifiers for r:embed in images.+ + Avoid reading image files again when we've already processed them.+ + Fixed typo in `referenc.docx` that prevented image captions from+ working. Thanks to Huashan Chen.++ * `Text.Pandoc.Parsing`:++ + Fixed bug in `withRaw`, which didn't correctly handle the case+ where nothing is parsed.+ + Made `emailAddress` parser more correct. Now it is based on RFC 822,+ though it still doesn't implement quoted strings in email addresses.+ + Revised URI parser. It now allows many more schemes, allows+ uppercase URIs, and better handles trailing punctuation and+ trailing slashes in bare URIs. Added many tests.+ + Simplified and improved singleQuoteStart. This makes `'s'`, `'l'`,+ etc. parse properly. Formerly we had some English-centric heuristics,+ but they are no longer needed. Closes #698.++ * `Text.Pandoc.Pretty`: Added wide punctuation range to `charWidth`.+ This fixes bug with Chinese commas in markdown and reST tables, and+ a bug that caused combining characters to be dropped.++ * `Text.Pandoc.MIME`: Added MIME types for .wof and .eot. Closes #640.++ * `Text.Pandoc.Biblio`:++ + Run `mvPunc` and `deNote` on metadata too.+ This fixed a bug with notes on titles using footnote styles.+ + Fixed bug in fetching CSL files from CSL data directory.++ * `pandoc.hs`: Give correct value to `writerSourceDirectory` when a URL+ is provided. It should be the URL up to the path.++ * Fixed/simplified diff output for tests.+ Biblio: Make sure mvPunc and deNote run on metadata too.+ This fixed a bug with notes on titles using footnote styles.++### Under the hood improvements++ * We no longer depend on `utf8-string`. Instead we use functions+ defined in `Text.Pandoc.UTF8` that use `Data.Text`'s conversions.++ * Use `safeRead` instead of using `reads` directly (various modules).++ * "Implicit figures" (images alone in a paragraph) are now handled+ differently. The markdown reader gives their titles the prefix `fig:`; the+ writers look for this before treating the image as a figure. Though this+ is a bit of a hack, it has two advantages: (i) implicit figures can be+ limited to the markdown reader, and (ii) they can be deactivated by turning+ off the `implicit_figures` extension.++ * `catch` from `Control.Exception` is now used instead of the+ old Preface `catch`.++ * `Text.Pandoc.Shared`: Improved algorithm for `normalizeSpaces`+ and `oneOfStrings` (which is now non-backtracking).++ * `Text.Pandoc.Biblio`: Remove workaround for `toCapital`.+ Now citeproc-hs is fixed upstream, so this is no longer needed.+ Closes #531.++ * Textile reader: Improved speed of `hyphenedWords`.+ This speeds up the textile reader by about a factor of 4.++ * Use `Text.Pandoc.Builder` in RST reader, for more flexibility,+ better performance, and automatic normalization.++ * Major rewrite of markdown reader:++ + Use `Text.Pandoc.Builder` instead of lists. This also+ means that everything is normalized automatically.+ + Move to a one-pass parsing strategy, returning values in the reader+ monad, which are then run (at the end of parsing) against the final+ parser state.++ * In HTML writer, we now use `toHtml` instead of pre-escaping.+ We work around the problem that blaze-html unnecessarily escapes `'`+ by pre-escaping just the `'` characters, instead of the whole string.+ If blaze-html later stops escaping `'` characters, we can simplify+ `strToHtml` to `toHtml`. Closes #629.++ * Moved code for embedding images in RTFs from `pandoc.hs` to the+ RTF writer (which now exports `writeRTFWithEmbeddedImages`).++ * Moved citation processing from `pandoc.hs` into the readers.+ This makes things more convenient for library users.++ * The man pages are now built by an executable `make-pandoc-man-pages`,+ which has its own stanza in the cabal file so that dependencies can be+ handled by Cabal. Special treatment in `Setup.hs` ensures that this+ executable never gets installed; it is only used to create the man pages.++ * The cabal file has been modified so that the pandoc library is used+ in building the pandoc executable. (This required moving `pandoc.hs`+ from `src` to `.`.) This cuts compile time in half.++ * The `executable` and `library` flags have been removed.++ * `-threaded` has been removed from ghc-options.++ * Version bounds of dependencies have been raised, and the+ `blaze_html_0_5` flag now defaults to True. Pandoc now compiles on+ GHC 7.6.++ * We now require base >= 4.2.++ * Integrated the benchmark program into cabal. One can now do:++ cabal configure --enable-benchmarks && cabal build+ cabal bench --benchmark-option='markdown' --benchmark-option='-s 20'++ The benchmark now uses README + testsuite, so benchmark results+ from older versions aren't comparable.++ * Integrated test suite with cabal.+ To run tests, configure with `--enable-tests`, then `cabal test`.+ You can specify particular tests using `--test-options='-t markdown'`.+ No output is shown unless tests fail. The Haskell test modules+ have been moved from `src/` to `tests/`.++ * Moved all data files and templates to the `data/` subdirectory.++ * Added an `embed_data_files` cabal flag. This causes all+ data files to be embedded in the binary, so that the binary+ is self-sufficient and can be relocated anywhere, copied on+ a USB key, etc. The Windows installer now uses this.+ (Since we no longer have the option to build the executable+ without the library, this is the only way to get a relocatable+ binary on Windows.)++ * Removed pcre3.dll from windows package.+ It isn't needed unless highlighting-kate is compiled with the+ `pcre-light` flag. By default, regex-prce-builtin is used.+++## pandoc 1.9.4.5 (2012-10-21)++ * Raised version bounds on network, base64-bytestring, json,+ and template-haskell.++## pandoc 1.9.4.4 (2012-10-20)++ * Removed `tests` flag and made test suite into a proper cabal+ test suite, which can now be enabled using `--enable-tests`+ and run with `cabal test`.++ * Moved man page creation out of `Setup.hs` and into an+ executable built by Cabal, but never installed. This+ allows dependencies to be specified, and solves a problem+ with 1.9.4.3, which could only be installed if `data-default`+ had already been installed.++ * Updated `lhs-latex.tex` test for latest highlighting-kate+ representation of backticks.++## pandoc 1.9.4.3 (2012-10-20)++ * Removed `-threaded` from default compile flags.++ * Modified modules to compile with GHC 7.6 and latest version of time+ package.++## pandoc 1.9.4.2 (2012-06-29)++ * Don't encode/decode file paths if base >= 4.4.+ Prior to base 4.4, filepaths and command line arguments were treated+ as unencoded lists of bytes, not unicode strings, so we had to work+ around that by encoding and decoding them. This commit adds CPP+ checks for the base version that intelligibly enable encoding/decoding+ when needed. Fixes a bug with multilingual filenames when pandoc was+ compiled with ghc 7.4 (#540).++ * Don't generate an empty H1 after hrule slide breaks.+ We now use a slide-level header with contents `[Str "\0"]` to mark+ an hrule break. This avoids creation of an empty H1 in these+ contexts. Closes #484.++ * Docbook reader: Added support for "bold" emphasis. Thanks to mb21.++ * In make_osx_package.sh, ensure citeproc-hs is built with the+ embed_data_files flag.++ * MediaWiki writer: Avoid extra blank lines after sublists (Gavin Beatty).++ * ConTeXt writer: Don't escape `&`, `^`, `<`, `>`, `_`,+ simplified escapes for `}` and `{` to `\{` and `\}` (Aditya Mahajan).++ * Fixed handling of absolute URLs in CSS imports with `--self-contained`.+ Closes #535.++ * Added webm to mime types. Closes #543.++ * Added some missing exports and tests to the cabal file+ (Alexander V Vershilov).++ * Compile with `-rtsopts` and `-threaded` by default.++## pandoc 1.9.4.1 (2012-06-08)++ * Markdown reader: Added `cf.` and `cp.` to list of likely abbreviations.++ * LaTeX template: Added `linkcolor`, `urlcolor` and `links-as-notes`+ variables. Make TOC links black.++ * LaTeX template improvements.++ + Don't print date unless one is given explicitly in the document.+ + Simplified templates.+ + Use fontenc [T1] by default, and lmodern.+ + Use microtype if available.++ * Biblio:++ + Add comma to beginning of bare suffix, e.g. `@item1 [50]`.+ Motivation: `@item1 [50]` should be as close as possible to+ `[@item1, 50]`.+ + Added workaround for a bug in citeproc-hs 0.3.4 that causes footnotes+ beginning with a citation to be empty. Closes #531.++ * Fixed documentation on mixed lists. Closes #533.++## pandoc 1.9.4 (2012-06-03)++ * Simplified `Text.Pandoc.Biblio` and fixed bugs with citations inside+ footnotes and captions. We now handle note citations by inserting+ footnotes during initial citation processing, and doing a separate+ pass later to remove notes inside notes.++ * Added 'zenburn' highlight style from highlighting-kate.++ * Added Slideous writer. Slideous is an HTML + javascript slide show+ format, similar to Slidy, but works with IE 7. (Jonas Smedegaard)++ * LaTeX writer:++ + Ensure we don't have extra blank lines at ends of cells.+ This can cause LaTeX errors, as they are interpreted as new paragraphs.+ + More consistent interblock spacing.+ + Require highlighting-kate >= 0.5.1, for proper highlighted inline+ code in LaTeX. Closes #527.+ + Ensure that a Verbatim at the end of a footnote is followed by+ a newline. (Fixes a regression in the previous version.)+ + In default template, use black for internal links and TOC.+ Added commented-out code to use footnotes for links, as would+ be suitable in print output.++ * Beamer writer: When `--incremental` is used, lists inside+ a block quote should appear all at once. (This makes Beamer+ output consistent with the HTML slide show formats.)++ * ConTeXt writer:++ + Escape `%` as `\letterpercent{}` not `\letterpercent `,+ to avoid gobbling spaces after the `%` sign.+ + Ensure space after `\stopformula`.++ * Markdown writer:++ + Use `:` form instead of `~` in definition lists, for better+ compatibility with other markdown implementations.+ + Don't wrap the term, because it breaks definition lists.+ + Use a nonzero space to prevent false recognition+ of list marker in ordered lists. Closes #516.++ * Org writer: Add space before language name. Closes #523.++ * Docx writer: Simplified bullet characters so they work properly+ with Word 2007. Closes #520.++ * LaTeX reader: Support `\centerline`.++ * RST reader: handle figures. Closes #522.++ * Textile reader: fix for `<notextile>` and `==`. Closes #517.+ (Paul Rivier)++## pandoc 1.9.3 (2012-05-12)++ * Added docbook reader (with contributions from Mauro Bieg).++ * Fixed bug in `fromEntities`. The previous version would turn+ `hi & low you know;` into `hi &`.++ * HTML reader:++ + Don't skip nonbreaking spaces.+ Previously a paragraph containing just ` ` would be rendered+ as an empty paragraph. Thanks to Paul Vorbach for pointing out the bug.+ + Support `<col>` and `<caption>` in tables. Closes #486.++ * Markdown reader:++ + Don't recognize references inside delimited code blocks.+ + Allow list items to begin with lists.++ * LaTeX reader:++ + Handle `\bgroup`, `\egroup`, `\begingroup`, `\endgroup`.+ + Control sequences can't be followed by a letter.+ This fixes a bug where `\begingroup` was parsed as `\begin`+ followed by `group`.+ + Parse 'dimension' arguments to unknown commands. e.g. `\parindent0pt`+ + Make `\label` and `\ref` sensitive to `--parse-raw`.+ If `--parse-raw` is selected, these will be parsed as raw latex+ inlines, rather than bracketed text.+ + Don't crash on unknown block commands (like `\vspace{10pt}`)+ inside `\author`; just skip them. Closes #505.++ * Textile reader:++ + Implemented literal escapes with `==` and `<notextile>`. Closes #473.+ + Added support for LaTeX blocks and inlines (Paul Rivier).+ + Better conformance to RedCloth inline parsing (Paul Rivier).+ + Parse '+text+' as emphasized (should be underlined, but this+ is better than leaving literal plus characters in the output.++ * Docx writer: Fixed multi-paragraph list items. Previously they each+ got a list marker. Closes #457.++ * LaTeX writer:++ + Added `--no-tex-ligatures` option to avoid replacing+ quotation marks and dashes with TeX ligatures.+ + Use `fixltx2e` package to provide `\textsubscript`.+ + Improve spacing around LaTeX block environments:+ quote, verbatim, itemize, description, enumerate.+ Closes #502.+ + Use blue instead of pink for URL links in latex/pdf output.++ * ConTeXt writer: Fixed escaping of `%`.+ In text, `%` needs to be escaped as `\letterpercent`, not `\%`+ Inside URLs, `%` needs to be escaped as `\%`+ Thanks to jmarca and adityam for the fix. Closes #492.++ * Texinfo writer: Escape special characters in node titles.+ This fixes a problem pointed out by Joost Kremers. Pandoc used+ to escape an '@' in a chapter title, but not in the corresponding+ node title, leading to invalid texinfo.++ * Fixed document encoding in texinfo template.+ Resolves Debian Bug #667816.++ * Markdown writer:++ + Don't force delimited code blocks to be flush left.+ Fixes bug with delimited code blocks inside lists etc.+ + Escape `<` and `$`.++ * LaTeX writer: Use `\hyperref[ident]{text}` for internal links.+ Previously we used `\href{\#ident}{text}`, which didn't work on+ all systems. Thanks to Dirk Laurie.++ * RST writer: Don't wrap link references. Closes #487.++ * Updated to use latest versions of blaze-html, mtl.+++## pandoc 1.9.2 (2012-04-05)++ * LaTeX reader:++ + Made `lstlisting` work as a proper verbatim environment.+ + Fixed bug parsing LaTeX tables with one column.++ * LaTeX writer:++ + Use `{}` around `ctable` caption, so that formatting can be used.+ + Don't require eurosym package unless document has a €.++ * LaTeX template: Added variables for `geometry`, `romanfont`,+ `sansfont`, `mathfont`, `mainfont` so users can more easily+ customize fonts.++ * PDF writer:++ + Run latex engine at least two times, to ensure+ that PDFs will have hyperlinked bookmarks.+ + Added PDF metadata (title,author) in LaTeX standalone + PDF output.++ * Texinfo writer: retain directories in image paths. (Peter Wang)++ * RST writer: Better handling of inline formatting, in accord+ with docutils' "inline markup recognition rules" (though we don't+ implement the unicode rules fully). Now `hi*there*hi` gets+ rendered properly as `hi\ *there*\ hi`, and unnecessary+ `\ ` are avoided around `:math:`, `:sub:`, `:sup:`.++ * RST reader:++ + Parse `\ ` as null, not escaped space.+ + Allow `` :math:`...` `` even when not followed by blank+ or `\`. This does not implement the complex rule docutils follows,+ but it should be good enough for most purposes.+ + Add support for the rST default-role directive. (Greg Maslov)++ * Text.Pandoc.Parsing: Added `stateRstDefaultRole` field to `ParserState`.+ (Greg Maslov)++ * Markdown reader: Properly handle citations nested in other inline+ elements.++ * Markdown writer: don't replace empty alt in image with "image".++ * DZSlides: Updated template.html and styles in default template.+ Removed bizarre CSS for `q` in dzslides template.++ * Avoid repeated `id` attribute in section and header in HTML slides.++ * README improvements: new instructions on internal links,+ removed misleading note on reST math.++ * Build system:++ + Fixed Windows installer so that dzslides works.+ + Removed stripansi.sh.+ + Added .travis.yml for Travis continuous integration support..+ + Fixed upper bound for zlib (Sergei Trofimovich).+ + Fixed upper bound for test-framework.+ + Updated haddocks for haddock-2.10 (Sergei Trofimovich).+++## pandoc 1.9.1.2 (2012-03-09)++ * Added `beamer+lhs` as output format.++ * Don't escape `<` in `<style>` tags with `--self-contained`.+ This fixes a bug which prevented highlighting from working+ when using `--self-contained`.++ * PDF: run latex engine three times if `--toc` specified.+ This fixes page numbers in the table of contents.++ * Docx writer: Added TableNormal style to tables.++ * LaTeX math environment fixes. `aligned` is now used instead of+ the nonexistent `aligned*`. `multline` instead of the nonexistent+ `multiline`.++ * LaTeX writer: Use `\textasciitilde` for literal `~`.++ * HTML writer: Don't escape contents of EQ tags with --gladtex.+ This fixes a regression from 1.8.++ * Use `<q>` tags for Quoted items for HTML5 output.+ The quote style can be changed by modifying the template+ or including a css file. A default quote style is included.++ * LaTeX reader: Fixed accents (\~{a}, `\c{c}`).+ Correctly handle \^{}. Support "minted" as a LaTeX verbatim block.++ * Updated LaTeX template for better language support.+ Use `polyglossia` instead of `babel` with xetex.+ Set `lang` as documentclass option.+ `\setmainlanguage` will use the last of a comma-separated+ list of languages. Thanks to François Gannaz.++ * Fixed default LaTeX template so `\euro` and `€` work. The+ `eurosym` package is needed if you are using pdflatex.++ * Fixed escaping of period in man writer (thanks to Michael Thompson).++ * Fixed list label positions in beamer.++ * Set `mainlang` variable in context writer.+ This parallels behavior of latex writer. `mainlang` is the last+ of a comma-separated list of languages in lang.++ * EPUB language metadat: convert e.g. `en_US` from locale to `en-US`.++ * Changed `-V` so that you can specify a key without a value.+ Such keys get the value `true`.++ * Fixed permissions on installed man pages - thanks Magnus Therning.++ * Windows installer: require XP or higher. The installer is+ now compiled on a Windows 7 machine, which fixes a problem+ using citation functions on Windows 7.++ * OSX package: Check for 64-bit Intel CPU before installing.+++## pandoc 1.9.1.1 (2012-02-11)++ * Better handling of raw latex environments in markdown. Now++ \begin{equation}+ a_1+ \end{equation}++ turns into a raw latex block as expected.++ * Improvements to LaTeX reader:++ + Skip options after block commands.+ + Correctly handle `{\\}` in braced.+ + Added a needed 'try'.+ + Citations: add `, ` to suffix if it doesn't start with space or+ punctuation. Otherwise we get no space between the year and the+ suffix in author-date styles.++ * Added two needed data files for S5. This fixes a problem with+ `pandoc -t s5 --self-contained`. Also removed `slides.min.js`,+ which was no longer being used.++ * Fixed some minor problems in `reference.docx`:+ name on "Date" style, `xCs` instead of `xIs`.++ * Fixed a problem creating docx files using a reference docx+ modified using Word. The problem seems to be that Word+ modifies `_rels/.rels`, changing the Type of the Relationship to+ `docProps/core.xml`. Pandoc now changes this back to the correct+ value if it has been altered, fixing the problem.++ * Fixed html5 template so it works properly with highlighting.++## pandoc 1.9.1 (2012-02-09)++ * LaTeX reader:++ + Fixed regression in 1.9; properly handle escaped $ in latex math.+ + Put LaTeX verse environments in blockquotes.++ * Markdown reader:++ + Limit nesting of strong/emph. This avoids exponential lookahead+ in parasitic cases, like `a**a*a**a*a**a*a**a*a**a*a**a*a**a*a**`.+ + Improved attributes syntax (in code blocks/spans): (1)+ Attributes can contain line breaks. (2) Values in key-value+ attributes can be surrounded by either double or single quotes, or+ left unquoted if they contain no spaces.++ * Headers no longer wrap in markdown or RST writers.++ * Added `stateMaxNestingLevel` to `ParserState`.+ We set this to 6, so you can still have `Emph` inside `Emph`,+ just not indefinitely.++ * More efficient implementation of `nowrap` in `Text.Pandoc.Pretty`.++ * `Text.Pandoc.PDF`: Only run latex twice if `\tableofcontents`+ is present.++ * Require highlighting-kate >= 0.5.0.2, texmath >= 0.6.0.2.++## pandoc 1.9.0.5 (2012-02-06)++ * Changed cabal file so that build-depends for the test program+ are not required unless the tests flag is used.++ * LaTeX writer: insert `{}` between adjacent hyphens so they don't+ form ligatures (dashes) in code spans.++## pandoc 1.9.0.4 (2012-02-06)++ * Raised version bound on test-framework to avoid problems+ compiling tests on GHC 7.4.1.++ * LaTeX reader: Use raw LaTeX as fallback inline text for Cites,+ so citations don't just disappear unless you process with+ citeproc. Ignore `\bibliographystyle`, `\nocite`.++ * Simplified tex2pdf; it will always run latex twice to+ resolve table of contents and hyperrefs.++## pandoc 1.9.0.3 (2012-02-06)++ * Require Cabal >= 1.10.++ * Tweaked cabal file to meet Cabal 1.10 requirements.++## pandoc 1.9.0.2 (2012-02-05)++ * Allow build with json 0.4 or 0.5. Otherwise we can't build with+ ghc 6.12.++## pandoc 1.9 (2012-02-05)++### New features++ * Added a Microsoft Word `docx` writer. The writer includes support+ for highlighted code and for math (which is converted from TeX to OMML,+ Office's native math markup language, using texmath's new OMML module).+ A new option `--reference-docx` allows the user to customize the+ styles.++ * Added an `asciidoc` writer (<http://www.methods.co.nz/asciidoc/>).++ * Better support for slide shows:++ + Added a `dzslides` writer. DZSlides is a lightweight HTML5/javascript+ slide show format due to Paul Rouget (<http://paulrouget.com/dzslides/>).++ + Added a LaTeX `beamer` writer. Beamer is a LaTeX package for creating+ slide presentations.++ + New, flexible rules for dividing documents into sections and slides+ (see the "Structuring the slide show" in the User's Guide). These+ are backward-compatible with the old rules, but they allow slide+ shows to be organized into sections and subsections containing+ multiple slides.++ + A new `--slide-level` option allows users to override defaults+ and select a slide level below the first header level with content.++ * A new `--self-contained` option produces HTML output that does not+ depend on an internet connection or the presence of any external+ files. Linked images, CSS, and javascript is downloaded (or fetched+ locally) and encoded in `data:` URIs. This is useful for making portable+ `HTML slide shows. The --offline` option has been deprecated and is now+ `treated as a synonym or --self-contained`.++ * Support for PDF output:++ + Removed the old `markdown2pdf`.+ + `pandoc` can now create PDFs (assuming you have latex and a set of+ appropriate packages installed): just specify an output file with the+ `.pdf` extension.+ + A new option `--latex-engine` allows you to specify `pdflatex`,+ `xelatex`, or `lualatex` as the processor.++ * Highlighting changes:++ + Syntax highlighting is now a standard feature; the `highlighting`+ flag is no longer needed when compiling.+ + A new `--no-highlight` option allows highlighting to be disabled.+ + Highlighting now works in `docx`, `latex`, and `epub`, as well as+ `html`, `html5`, `dzslides`, `s5`, and `slidy`.+ + A new `--highlight-style` option selects between various highlighting+ color themes.++ * Internal links to sections now work in ConTeXt and LaTeX as well as HTML.++ * LaTeX `\include` and `\usepackage` commands are now processed,+ provided the files are in the working directory.++ * EPUB improvements:++ + Internal and external links now work in EPUB.+ + Raw HTML is allowed.+ + New `--epub-embed-font` option.+ + Customizable templates for EPUB pages offer more control over+ formatting: `epub-page.html`, `epub-coverimage.html`,+ `epub-titlepage.html`.++ * `--mathml` now works with DocBook.++ * Added support for math in RST reader and writer. Inline math uses the+ `` :math:`...` `` construct. Display math uses++ .. math:: ...++ or if the math is multiline,++ .. math::++ ...++ These constructions are now supported now by `rst2latex.py`.++ * Github syntax for fenced code blocks is supported in pandoc's+ markdown. You can now write++ ```ruby+ x = 2+ ```++ instead of++ ~~~ {.ruby}+ x = 2+ ~~~~++ * Easier scripting: a new `toJsonFilter` function makes it easier to+ write Haskell scripts to manipulate the Pandoc AST.+ See [Scripting with pandoc](scripting.html#pandoc-1.9-changes).++### Behavior changes++ * Fixed parsing of consecutive lists in markdown.+ Pandoc previously behaved like Markdown.pl for consecutive+ lists of different styles. Thus, the following would be parsed+ as a single ordered list, rather than an ordered list followed+ by an unordered list:++ 1. one+ 2. two++ - one+ - two++ This change makes pandoc behave more sensibly, parsing this as+ two lists. Any change in list type (ordered/unordered) or in+ list number style will trigger a new list. Thus, the following+ will also be parsed as two lists:++ 1. one+ 2. two++ a. one+ b. two++ Since we regard this as a bug in Markdown.pl, and not something+ anyone would ever rely on, we do not preserve the old behavior+ even when `--strict` is selected.++ * Dashes work differently with `--smart`: `---` is always em-dash,+ and `--` is always en-dash. Pandoc no longer tries to guess when+ `-` should be en-dash. *Note:* This may change how existing documents+ look when processed with pandoc. A new option, `--old-dashes`,+ is provided for legacy documents.++ * The markdown writer now uses setext headers for levels 1-2.+ The old behavior (ATX headers for all levels) can be restored+ using the new `--atx-headers` option.++ * Links are now allowed in markdown image captions. They are also+ allowed in links, but will appear there as regular text. So,++ [link with [link](/url)](/url)++ will turn into++ <p><a href="/url">link with link</a></p>++ * Improved handling of citations using `citeproc-hs-0.3.4`.+ Added `--citation-abbreviations` option.++ * Citation keys can no longer end with a punctuation character.+ This means that `@item1.` will be parsed as a citation with key+ 'item1', followed by a period, instead of a citation with key+ 'item1.', as was the case previously.++ * In HTML output, citations are now put in a span with class `citation`.++ * The markdown reader now recognizes DocBook block and inline tags.+ It was always possible to include raw DocBook tags in a markdown+ document, but now pandoc will be able to distinguish block from+ inline tags and behave accordingly. Thus, for example,++ <sidebar>+ hello+ </sidebar>++ will not be wrapped in `<para>` tags.++ * The LaTeX parser has been completely rewritten; it is now much more+ accurate, robust, and extensible. However, there are two important+ changes in how it treats unknown LaTeX. (1) Previously, unknown+ environments became BlockQuote elements; now, they are treated+ as "transparent", so `\begin{unknown}xyz\end{unknown}` is the+ same as `xyz`. (2) Previously, arguments of unknown commands+ were passed through with their braces; now the braces are stripped+ off.++ * `--smart` is no longer selected automatically with `man` output.++ * The deprecated `--xetex` option has been removed.++ * The `--html5`/`-5` option has been deprecated. Use `-t html5`+ instead. `html5` and `html5+lhs` are now separate output formats.++ * Single quotes are no longer escaped in HTML output. They do not+ need to be escaped outside of attributes.++ * Pandoc will no longer transform leading newlines in code+ blocks to `<br/>` tags.++ * The ODT writer now sizes images appropriately, using the image+ size and DPI information embedded in the image.++ * `--standalone` is once again implicitly for a non-text output format+ (ODT, EPUB). You can again do `pandoc test.txt -o test.odt`+ and get a standalone ODT file.++ * The Docbook writer now uses `<sect1>`, `<sect2>`, etc. instead of+ `<section>`.++ * The HTML writer now uses `<del>` for strikeout.++ * In HTML output with `--section-divs`, the classes `section` and+ `level[1,2,..6]` are put on the `div` tags so they can be styled.+ In HTML 5 output with `--section-divs`, the classes+ `level[1,2,...6]` are put on `section` tags.++ * EPUB writer changes:++ + The `lang` variable now sets the language+ in the metadata (if it is not set, we default to the locale).+ + EPUB: UTF-8 is used rather than decimal entities.++ * Added `titleslide` class to title slide in S5 template.++ * In HTML, EPUB, and docx metadata, the date is normalized into+ YYYY-MM-DD format if possible. (This is required for validation.)++ * Attributes in highlighted code blocks are now preserved in HTML.+ The container element will have the classes, id, and key-value attributes+ you specified in the delimited code block. Previously these were stripped+ off.++ * The reference backlink in the HTML writer no longer has a special+ `footnoteBacklink` class.++ * The HTML template has been split into `html` and `html5` templates.++ * Author and date are treated more consistently in HTML templates.+ Authors are now `<h2>`, date `<h3>`.++ * URLs are hyphenated in the ConTeXt writer (B. Scott Michel).++ * In `Text.Pandoc.Builder`, `+++` has been replaced by `<>`.++### Bug fixes++ * Better support for combining characters and East Asian wide characters+ in markdown and reST.++ * Better handling of single quotes with `--smart`.+ Previously `D'oh l'*aide*` would be parsed with left and right single+ quotes instead of apostrophes. This kind of error is now fixed.++ * Highlighting: Use `reads` instead of `read` for better error handling.+ Fixes crash on `startNum="abc"`.++ * Added blank comment after directives in rst template.++ * Unescape entities in citation `refId`. The `refId`s coming+ from citeproc contain XML numeric entities, and these don't match with the+ citation keys parsed by pandoc. Solution is to unescape them.++ * HTML reader: Fixed bug parsing tables with both thead and tbody.++ * Markdown reader:++ + Better handling of escapes in link URLs and titles.+ + Fixed backslash escapes in reference links.+ + Fixed bug in table/hrule parsing, by checking that the top+ line of a table is not followed by a blank line. This bug caused+ slowdowns on some files with hrules and tables, as pandoc tried to+ interpret the hrules as the tops of multiline tables.+ + Fixed bug in code block attribute parser. Previously the ID attribute+ got lost if it didn't come first. Now attributes can come in any order.++ * RST reader: allow footnotes followed by newline without space characters.++ * LaTeX reader:++ + Ignore empty groups {}, { }.+ + LaTeX reader: Handle `\@`.+ + LaTeX reader: Don't crash on commands like `\itemsep`.+ + LaTeX reader: Better handling of letter environments.++ * RST writer: Fixed bug involving empty table cells. isSimple was being+ calculated in a way that assumed there were no non-empty cells.++ * ConTeXt writer:++ + Made `--toc` work even without `--number-sections`.+ + Escape # in link URLs.+ + Use buffering for footnotes containing code blocks.+ + Changed 'descr' to 'description', fixed alignment.++ * LaTeX writer:++ + Escape euro character.+ + Don't escape `~` inside `\href{...}`.+ + Escape `#` in href URLs.+ + Improved detection of book classes. We now check the+ `documentclass` variable, and if that is not set, we look through+ the template itself. Also, we have added the KOMA classes scrreprt+ and scrbook. You can now make a book using+ `pandoc -V documentclass:book mybook.txt -o mybook.pdf`+ + LHS files now set the "listings" variable, so that the definition+ of the `code` environment will be included in the template.+ + Links are colored blue by default (this can be changed by+ modifying `hyperref` settings in the template).+ + Added `lang` variable to LaTeX template.++ * HTML writer:++ + Fixed bug in HTML template with html5 and mathml.+ + Don't use self-closing img, br, hr tags for HTML5.+ + Use `<section>` for footnotes if HTML5.+ + Update HTML templates to use Content-Style-Type meta tag.+ + Use separate variables for meta-date, meta-author.+ This makes footnotes work in author and date fields.+ + Use 'vertical-align:middle' in WebTeX math for better alignment.++ * S5/slidy writer: Make footnotes appear on separate slide at end.++ * MIME: Added 'layout-cache' to getMimeType. This ensures that the+ META-INF/manifest.xml for ODT files will have everything it needs, so+ that ODT files modified by LibreOffice can be used as `--reference-odt`.++ * `Text.Pandoc.Templates`: Return empty string for json template.++ * `Text.Pandoc.Biblio`:++ + Expand citations recursively inside nested inlines.+ + Treat `\160` as space when parsing locator and suffix.+ This fixes a bug with "p. 33" when `--smart` is used. Previously+ the whole "p. 33" would be included in the suffix, with no locator.+ + Put whole author-in-text citation in a Cite. Previously just the+ date and other info went in the Cite.+ + Don't add comma+space to prefix if it ends in punctuation.++ * Updated chicago-author-date.csl. The old version did not work+ properly for edited volumes with no author.++ * EPUB writer:++ + Add date to EPUB titlepage and metadata.+ + Added TOC identifier in EPUB page template.+ + Don't generate superfluous file `cover-image.jpg`.++### Under the hood improvements++ * Modified `make_osx_package.sh` to use cabal-dev.+ Items are no longer installed as root.+ Man pages are zipped and given proper permissions.++ * Modified windows installer generator to use cabal-dev.++ * Setup: Making man pages now works with cabal-dev (at least on OSX). In+ Setup.hs we now invoke 'runghc' in a way that points it to the correct+ package databases, instead of always falling back to the default user+ package db.++ * Updated to work with GHC 7.4.1.++ * Removed dependency on old-time.++ * Removed dependency on dlist.++ * New slidy directory for "self-contained."++ * TeXMath writer: Use unicode thin spaces for thin spaces.++ * Markdown citations: don't strip off initial space in locator.++### API changes++ * Removed `Apostrophe`, `EmDash`, `EnDash`, and `Ellipses`+ from the native `Inline` type in pandoc-types. Now we use `Str`+ elements with unicode.++ * Improvements to `Text.Pandoc.Builder`:++ + `Inlines` and `Blocks` are now newtypes (not synonyms for+ sequences).+ + Instances are defined for `IsString`, `Show`, `Read`, `Monoid`,+ and a new `Listable` class, which allows these to be manipulated+ to some extent like lists. Monoid append includes automatic+ normalization.+ + `+++` has been replaced by `<>` (mappend).++ * Use blaze-html instead of xhtml for HTML generation.+ This changes the type of `writeHtml`.++ * `Text.Pandoc.Shared`:++ + Added `warn` and `err`.+ + Removed `unescapeURI`, modified `escapeURI`.+ (See under [behavior changes], above.)++ * Changes in URI escaping: Previously the readers escaped URIs by+ converting unicode characters to octets and then percent encoding.+ Now unicode characters are left as they are, and `escapeURI` only+ percent-encodes space characters. This gives more readable+ URIs, and works well with modern user agents. URIs are no longer unescaped+ at all on conversion to `markdown`, `asciidoc`, `rst`, `org`.++ * New module `Text.Pandoc.SelfContained`.++ * New module `Text.Pandoc.Docx`.++ * New module `Text.Pandoc.PDF`.++ * Added `writerBeamer` to `WriterOptions`.++ * Added `normalizeDate` to `Text.Pandoc.Shared`.++ * Added `splitStringWithIndices` in `Text.Pandoc.Shared`.+ This is like `splitWithIndices`, but it is sensitive to distinctions+ between wide, combining, and regular characters.++ * `Text.Pandoc.Pretty`:++ + Added `chomp` combinator.+ + Added `beforeNonBreak` combinator. This allows you to include+ something conditionally on it being before a nonblank.+ Used for RST inline math.+ + Added `charWidth` function. All characters marked W or F in the unicode+ spec EastAsianWidth.txt get width 2.+ + Added `realLength`, based on `charWidth`. `realLength` is now+ used in calculating offsets.++ * New module `Text.Pandoc.Slides`, for common functions for breaking+ a document into slides.++ * Removed `Text.Pandoc.S5`, which is no longer needed.++ * Removed `Text.Pandoc.CharacterReferences`. Moved+ `characterReference` to `Text.Pandoc.Parsing`.+ `decodeCharacterReferences` is replaced by `fromEntities`+ in `Text.Pandoc.XML`.++ * Added `Text.Pandoc.ImageSize`. This is intened for use+ in `docx` and `odt` writers, so the size and dpi of images+ can be calculated.++ * Removed `writerAscii` in `WriterOptions`.++ * Added `writerHighlight` to `WriterOptions`.++ * Added `DZSlides` to `HTMLSlideVariant`.++ * `writeEPUB` has a new argument for font files to embed.++ * Added `stateLastStrPos` to `ParserState`. This lets us keep track+ of whether we're parsing the position immediately after a regular+ (non-space, non-symbol) string, which is useful for distinguishing+ apostrophes from single quote starts.++ * `Text.Pandoc.Parsing`:++ + `escaped` now returns a `Char`.+ + Removed `charsInBalanced'`, added a character parser as+ a parameter of `charsInBalanced`. This is needed for+ proper handling of escapes, etc.+ + Added `withRaw`.++ * Added `toEntities` to `Text.Pandoc.XML`.++ * `Text.Pandoc.Readers.LaTeX`:++ + Export `handleIncludes`.+ + Export `rawLaTeXBlock` instead of `rawLaTeXEnvironment'`.++ * Added `ToJsonFilter` class and `toJsonFilter` function to+ `Text.Pandoc`, deprecating the old `jsonFilter` function.++ * `Text.Pandoc.Highlighting`:++ + Removed `highlightHtml`, `defaultHighlightingCss`.+ + Export `formatLaTeXInline`, `formatLaTeXBlock`, and `highlight`, plus+ key functions from highlighting-kate.+ + Changed types of highlighting function. `highlight` returns a+ `Maybe`, not an `Either`.+++## pandoc 1.8.2.1 (2011-08-01)++ * Adjusted Arbitrary instance to help avoid timeouts in tests.++ * Added `Tests.Writers.Markdown` to cabal file.++ * Relaxed version bounds on pandoc-types, test-framework.++## pandoc 1.8.2 (2011-07-30)++ * Added script to produce OS X package.++ * Made `templates` directory a git submodule. This should make it+ easier for people to revise their custom templates when the default+ templates change.++ * Changed template naming scheme: `FORMAT.template` -> `default.FORMAT`.+ **Note:** If you have existing templates in `~/.pandoc/templates`, you+ must rename them to conform to the new scheme!++ * Default template improvements:++ + HTML: Display author and date after title.+ + HTML: Made table of contents more customizable. The container+ for the TOC is now in the template, so users can insert a header+ or other styling. (Thanks to Bruce D'Arcus for the suggestion.)+ + HTML, Slidy, S5: Enclose scripts in CDATA tags.+ + Slidy, S5: Added `s5-url` and `slidy-url` variables, instead of+ hard-coding. If you want to put your slidy files in the slidy+ subdirectory, for example, you can do+ `pandoc -t slidy -V slidy-url=slidy -s`.+ + LaTeX: Use `\and` to separate authors in LaTeX documents (reader+ & writer). Closes #279.+ + LaTeX: Set `\emergencystretch` to prevent overfull lines.+ + LaTeX: Use different `hyperref` options for `xetex`, fixing+ problems with unicode bookmarks (thanks to CircleCode).+ + LaTeX: Removed `ucs` package, use `utf8` rather than `utf8x`+ with `inputenc`. This covers fewer characters but is more+ robust with other packages, and `ucs` is unmaintained. Users+ who need better unicode support should use xelatex or lualatex.++ * If a template specified with `--template` is not found, look for it+ in `datadir`. Also, if no extension is provided, supply one based+ on the writer. So now you can put your `special.latex` template in+ `~/.pandoc/templates`, and use it from any directory via+ `pandoc -t latex --template special`.++ * Added `nonspaceChar` to `Text.Pandoc.Parsing`.++ * Fixed smart quotes bug, now handling `'...hi'` properly.++ * RST reader:++ + Partial support for labeled footnotes.+ + Improved accuracy of `simpleReferenceName` parser.++ * HTML reader:++ + Substitute correct unicode characters for+ characters in the 128..159 range, which are often found even in+ HTML that purports to be UTF-8.++ * LaTeX reader: Handle `\subtitle` command (a subtitle is added+ to the title, after a colon and linebreak). Closes #280.++ * Leaner `reference.odt`.++ * Added unexported module `Text.Pandoc.MIME` for use in+ the ODT writer.++ * ODT writer: Construct `manifest.xml` based on archive contents.+ This fixes a bug in ODTs containing images. Recent versions of+ LibreOffice would reject these as corrupt, because `manifest.xml`+ did not contain a reference to the image files.++ * LaTeX writer:++ + Make verbatim environments flush to avoid spurious+ blank lines. Closes #277.+ + Use `\texttt` and escapes insntead of `\verb!...!`, which+ is too fragile (doesn't work in command arguments).+ + Use `\enquote{}` for quotes if the template includes+ the `csquotes` package. This provides better support for+ local quoting styles. (Thanks to Andreas Wagner for the idea.)++ * ConTeXt writer: Make `\starttyping`/`\stoptyping` flush with+ margin, preventing spurious blank lines.++ * Slidy writer:++ + Use non-minimized version of `slidy.css` with `--offline`+ option, so users can more easily edit it.+ + Also fixed a bug in the CSS that prevented proper centering+ of title (now reported and fixed upstream).++ * S5 writer:++ + Replaced `s5/default/slides.js.{comment,packed}` with+ new compressed `s5/default/slides.min.js`.+ + Use `data:` protocol to embed S5 CSS in `<link>` tags,+ when `--offline` is specified. Using inline CSS didn't+ work with Chrome or Safari. This fixes offline+ S5 on those browsers.++ * HTML writer: Removed English title on footnote backlinks.+ This is incongrous in non-English documents.++ * Docbook writer:++ + Use CALS tables. (Some older docbook software does not work+ well with XHTML tables.) Closes #77.+ + Use `programlisting` tags (instead of `screen`) for code blocks.++ * `markdown2pdf`:++ + Calls latex with `-halt-on-error -interaction nonstopmode` instead+ of `-interaction=batchmode`, which essentially just ignored errors,+ leading to bad results. Better to know when something is wrong.+ + Fixed issues with non-UTF-8 output of `pdflatex`.+ + Better error reporting.++ * `--mathjax` now takes an optional URL argument. If it is not+ provided, pandoc links directly to the (secure) mathjax CDN,+ as now recommended (thanks to dsanson).++ * Deprecated `--xetex` option in `pandoc`. It is no longer needed,+ since the LaTeX writer now produces a file that can be processed by+ `latex`, `pdflatex`, `lualatex`, or `xelatex`.++ * Introduced `--luatex` option to `markdown2pdf`. This causes `lualatex`+ to be used to create the PDF.+++## pandoc 1.8.1.2 (2011-07-16)++ * Added `--epub-cover-image` option.++ * Documented `--biblatex` and `--natbib` options.++ * Allow `--section-divs` with slidy output. Resolves Issue #296.++ * Disallow notes within notes in reST and markdown.+ These previously caused infinite looping and stack overflows.+ For example:++ [^1]++ [^1]: See [^1]++ Note references are allowed in reST notes, so this isn't a full+ implementation of reST. That can come later. For now we need to+ prevent the stack overflows. Partially resolves Issue #297.++ * EPUB writer: Allow non-plain math methods.++ * Forbid ()s in citation item keys. Resolves Issue #304: problems with+ `(@item1; @item2)` because the final paren was being parsed as part of+ the item key.++ * Changed URI parser so it doesn't include trailing punctuation.+ So, in RST, `http://google.com.` should be parsed as a link followed by a+ period. The parser is smart enough to recognize balanced parentheses, as+ often occur in wikipedia links: `http://foo.bar/baz_(bam)`.++ * Markdown+lhs reader: Require space after inverse bird tracks, so that+ HTML tags can be used freely at the left margin of a markdown+lhs document.+ Thanks to Conal Elliot for the suggestion.++ * Markdown reader: Fixed bug in footnote order (reported by CircleCode).++ * RST reader:+ + Fixed bug in in field lists with multi-line items at the+ end of the list.+ + Added parentheses to RST `specialChars`, so+ `(http://google.com)` will be parsed as a link in parens.+ Resolves Issue #291.+ + Allow `|` followed by newline in RST line block.++ * LaTeX reader:+ + Support `\dots`.+ + Gobble option & space after linebreak `\\[10pt]`.++ * Textile reader:+ + Make it possible to have colons after links. (qerub)+ + Make it possible to have colons after links. (Christoffer Sawicki)++ * HTML reader:+ + Skip spaces after `<b>`, `<emph>`, etc.+ + Handle tbody, thead in simple tables. Closes #274.+ + Implicit `Para`s instead of `Plains` in some contexts.++ * OpenDocument writer: Use special `First paragraph` style for+ first paragraph after most non-paragraph blocks. This allows users to+ specify e.g. that only paragraphs after the first paragraph of a block are+ to be indented. Thanks to Andrea Rossato for the patch. Closes #20.++ * LaTeX writer: use `deVerb` on table and picture captions.+ Otherwise LaTeX complains about `\verb` inside command argument.+ Thanks to bbanier for reporting the bug.++ * Markdown writer: Insert HTML comment btw list and indented code block.+ This prevents the code block from being interpreted as part of the list.++ * EPUB writer: Add a meta element specify the cover.+ Some EPUB e-readers, such as the Nook, require a meta element inside the+ OPF metadata block to ensure the cover image is properly displayed.+ (Kelsey Hightower)++ * HTML writer: Use embed tag for images with non-image extensions.+ (e.g. PDFs). Closes #264.++ * LaTeX writer: Improved tables.++ + More space between lines, top-align cells.+ + Use ctable package, which allows footnotes and+ provides additional options.+ + Made cell alignments work in multiline tables.+ + Closes #271, #272.++ * Un-URI-escape image filenames in LaTeX, ConTeXt, RTF, Texinfo.+ Also do this when copying image files into EPUBs and ODTs.+ Closes #263.++ * Changed to github issue tracker.++ * Added failing emph/strong markdown test case due to Perry Wagle.++ * Slidy improvements:+ + Updated to use Slidy2.+ + Fixed bug, unclosed div tag.+ + Added `duration` variable in template.+ Setting this activates the timer.+ + Use 'titlepage' instead of 'cover' for title div.+++## pandoc 1.8.1.1 (2011-02-13)++ * `markdown2pdf`: Removed some debugging lines accidentally included+ in the 1.8.1 release. With those lines, the temp directory is created+ in the working directory, and it is not deleted. This fix restores+ the original behavior.++## pandoc 1.8.1 (2011-02-13)++ * Added `--ascii` option. Currently supported only in HTML writer,+ which it causes to use numerical entities instead of UTF-8.++ * EPUB writer: `--toc` now works to provide a table of contents+ at the beginning of each chapter.++ * LaTeX writer: Change figure defaults to `htbp`.+ This prevents "too many unprocessed floats." Resolves+ Issue #285.++ * `Text.Pandoc.UTF8`: Encode filenames even when using recent+ base.++ * `markdown2pdf`: Fixed filename encoding issues. With help from Paulo+ Tanimoto. Resolves Issue #286.++ * HTML writer: Put line breaks in section divs.++ * `Text.Pandoc.Shared`: Make `writerSectionDivs` default to False.++## pandoc 1.8.0.3 (2011-02-05)++ * Fixed Source-repository stanza in cabal file.++## pandoc 1.8.0.2 (2011-02-05)++ * HTML writer:++ + Stringify alt text instead of converting to HTML.+ + Break lines after block elements, not inside tags.+ HTML output now closely resembles that of tidy. Resolves Issue #134.++ * Markdown reader: Fixed bug in footnote block parser (pointed out+ by Jesse Rosenthal). The problem arose when the blank line+ at the end of a footnote block contained indenting spaces.++ * Shared: Improved 'normalize' function so it normalizes Spaces too.+ In normal form, Space elements only occur to separate two non-Space+ elements. So, we never have [Space], or [, ..., Space].++ * Tests:++ + Improved Arbitrary instance.+ + Added timeout for test instances.++ * README:++ + Added section on four-space rule for lists. Resolves Issue #283.+ + Clarified optional arguments on math options.++ * markdown2pdf: Fixed bug with output file extensions.+ Previously `markdown2pdf test.txt -o test.en.pdf` would produce+ `test.pdf`, not `test.en.pdf`. Thanks to Paolo Tanimoto for the fix.++## pandoc 1.8.0.1 (2011-01-31)++ * Revised Interact.hs so that it works with the CPP macros+ in the UTF8 module.++ * Revised Setup.hs so that we don't call MakeManPage.hs unless+ the man pages are out of date.++## pandoc 1.8 (2011-01-30)++### New features++ * Support for citations using Andrea Rossato's `citeproc-hs` 0.3.+ You can now write, for example,++ Water is wet [see @doe99, pp. 33-35; also @smith04, ch. 1].++ and, when you process your document using `pandoc`, specifying+ a citation style using `--csl` and a bibliography using `--bibliography`,+ the citation will be replaced by an appropriately formatted+ citation, and a list of works cited will be added to the end+ of the document.++ This means that you can switch effortlessly between different citation+ and bibliography styles, including footnote, numerical, and author-date+ formats. The bibliography can be in any of the following formats: MODS,+ BibTeX, BibLaTeX, RIS, EndNote, EndNote XML, ISI, MEDLINE, Copac, or JSON.+ See the README for further details.++ Citations are supported in the markdown reader, using a special+ syntax, and in the LaTeX reader, using natbib or biblatex syntax.+ (Thanks to Nathan Gass for the natbib and biblatex support.)++ * New `textile` reader and writer. Thanks to Paul Rivier for contributing+ the `textile` reader, an almost complete implementation of the textile+ syntax used by the ruby [RedCloth library](http://redcloth.org/textile).+ Resolves Issue #51.++ * New `org` writer, for Emacs Org-mode, contributed by Puneeth Chaganti.++ * New `json` reader and writer, for reading and writing a JSON+ representation of the native Pandoc AST. These are much faster+ than the `native` reader and writer, and should be used for+ serializing Pandoc to text. To convert between the JSON representation+ and native Pandoc, use `encodeJSON` and `decodeJSON` from+ `Text.JSON.Generic`.++ * A new `jsonFilter` function in `Text.Pandoc` makes it easy+ to write scripts that transform a JSON-encoded pandoc document.+ For example:++ -- removelinks.hs - removes links from document+ import Text.Pandoc+ main = interact $ jsonFilter $ bottomUp removeLink+ where removeLink (Link xs _) = Emph xs+ removeLink x = x++ To use this to remove links while translating markdown to LaTeX:++ pandoc -t json | runghc removelinks.hs | pandoc -f json -t latex++ * Attributes are now allowed in inline `Code` elements, for example:++ In this code, `ulist ! [theclass "special"] << elts`{.haskell} is...++ The attribute syntax is the same as for delimited code blocks.+ `Code` inline has an extra argument place for attributes, just like+ `CodeBlock`. Inline code will be highlighted in HTML output, if pandoc+ is compiled with highlighting support. Resolves Issue #119.++ * New `RawBlock` and `RawInline` elements (replacing `RawHtml`,+ `HtmlInline`, and `TeX`) provide lots of flexibility in writing+ scripts to transform Pandoc documents. Scripts can now change+ how each element is rendered in each output format.++ * You can now define LaTeX macros in markdown documents, and pandoc+ will apply them to TeX math. For example,++ \newcommand{\plus}[2]{#1 + #2}+ $\plus{3}{4}$++ yields `3+4`. Since the macros are applied in the reader, they+ will work in every output format, not just LaTeX.++ * LaTeX macros can also be used in LaTeX documents (both in math+ and in non-math contexts).++ * A new `--mathjax` option has been added for displaying+ math in HTML using MathJax. Resolves issue #259.++ * Footnotes are now supported in the RST reader. (Note, however,+ that unlike docutils, pandoc ignores the numeral or symbol used in+ the note; footnotes are put in an auto-numbered ordered list.)+ Resolves Issue #258.++ * A new `--normalize` option causes pandoc to normalize the AST+ before writing the document. This means that, for example,+ `*hi**there*` will be rendered as `<em>hithere</em>`+ instead of `<em>hi</em><em>there</em>`. This is not the default,+ because there is a significant performance penalty.++ * A new `--chapters` command-line option causes headers+ in DocBook, LaTeX, and ConTeXt to start with "chapter" (level one).+ Resolves Issue #265.++ * In DocBook output, `<chapter>` is now used for top-level+ headers if the template contains `<book>`. Resolves Issue #265.++ * A new `--listings` option in `pandoc` and `markdown2pdf` causes+ the LaTeX writer to use the listings package for code blocks.+ (Thanks to Josef Svennigsson for the pandoc patch, and Etienne+ Millon for the markdown2pdf patch.)++ * `markdown2pdf` now supports `--data-dir`.++ * URLs in autolinks now have class "url" so they can be styled.++ * Improved prettyprinting in most formats. Lines will be wrapped+ more evenly and duplicate blank lines avoided.++ * New `--columns` command-line option sets the column width for+ line wrapping and relative width calculations for tables.++ * Made `--smart` work in HTML, RST, and Textile readers, as well+ as markdown.++ * Added `--html5` option for HTML5 output.++ * Added support for listings package in LaTeX reader+ (Puneeth Chaganti).++ * Added support for simple tables in the LaTeX reader.++ * Added support for simple tables in the HTML reader.++ * Significant performance improvements in many readers and writers.++### API and program changes++ * Moved `Text.Pandoc.Definition` from the `pandoc` package to a new+ auxiliary package, `pandoc-types`. This will make it possible for other+ programs to supply output in Pandoc format, without depending on the whole+ pandoc package.++ * Added `Attr` field to `Code`.++ * Removed `RawHtml`, `HtmlInline`, and `TeX` elements; added generic+ `RawBlock` and `RawInline`.++ * Moved generic functions to `Text.Pandoc.Generic`. Deprecated+ `processWith`, replacing it with two functions, `bottomUp` and `topDown`.+ Removed previously deprecated functions `processPandoc` and `queryPandoc`.++ * Added `Text.Pandoc.Builder`, for building `Pandoc` structures.++ * `Text.Pandoc` now exports association lists `readers` and `writers`.++ * Added `Text.Pandoc.Readers.Native`, which exports `readNative`.+ `readNative` can now read full pandoc documents, block lists, blocks,+ inline lists, or inlines. It will interpret `Str "hi"`+ as if it were `Pandoc (Meta [] [] []) [Plain [Str "hi"]]`.+ This should make testing easier.++ * Removed deprecated `-C/--custom-header` option.+ Use `--template` instead.++ * `--biblio-file` has been replaced by `--bibliography`.+ `--biblio-format` has been removed; pandoc now guesses the format+ from the file extension (see README).++ * pandoc will treat an argument as a URI only if it has an+ `http(s)` scheme. Previously pandoc would treat some+ Windows pathnames beginning with `C:/` as URIs.++ * The `--sanitize-html` option and the `stateSanitize` field in+ `ParserState` have been removed. Sanitization is better done in the+ resulting HTML using `xss-sanitize`, which is based on pandoc's+ sanitization, but improved.++ * pandoc now adds a newline to the end of its output in fragment+ mode (= not `--standalone`).++ * Added support for `lang` in `html` tag in the HTML template,+ so you can do `pandoc -s -V lang=es`, for example.++ * `highlightHtml` in `Text.Pandoc.Highlighting` now takes+ a boolean argument that selects between "inline" and+ "block" HTML.++ * `Text.Pandoc.Writers.RTF` now exports `rtfEmbedImage`.+ Images are embedded in RTF output when possible (png, jpeg).+ Resolves Issue #275.++ * Added `Text.Pandoc.Pretty`. This is better suited for pandoc than the+ `pretty` package. Changed all writers that used+ `Text.PrettyPrint.HughesPJ` to use `Text.Pandoc.Pretty` instead.++ * Rewrote `writeNative` using the new prettyprinting module. It is+ now much faster. The output has been made more consistent and compressed.+ `writeNative` is also now sensitive to writerStandalone`, and will simply+ `print a block list if writerStandalone` is False.++ * Removed `Text.Pandoc.Blocks`. `Text.Pandoc.Pretty` allows you to define+ blocks and concatenate them, so a separate module is no longer needed.++ * `Text.Pandoc.Shared`:++ + Added `writerColumns`, `writerChapters`, and `writerHtml5` to+ `WriterOptions`.+ + Added `normalize`.+ + Removed unneeded prettyprinting functions:+ `wrapped`, `wrapIfNeeded`, `wrappedTeX`, `wrapTeXIfNeeded`, `hang'`,+ `BlockWrapper`, `wrappedBlocksToDoc`.+ + Made `splitBy` take a test instead of an element.+ + Added `findDataFile`, refactored `readDataFile`.+ + Added `stringify`. Rewrote `inlineListToIdentifier` using `stringify`.+ + Fixed `inlineListToIdentifier` to treat `\160` as ' '.++ * `Text.Pandoc.Readers.HTML`:++ + Removed `rawHtmlBlock`, `anyHtmlBlockTag`, `anyHtmlInlineTag`,+ `anyHtmlTag`, `anyHtmlEndTag`, `htmlEndTag`, `extractTagType`,+ `htmlBlockElement`, `htmlComment`+ + Added `htmlTag`, `htmlInBalanced`, `isInlineTag`, `isBlockTag`,+ `isTextTag`++ * Moved `smartPunctuation` from `Text.Pandoc.Readers.Markdown`+ to `Text.Pandoc.Readers.Parsing`, and parameterized it with+ an inline parser.++ * Ellipses are no longer allowed to contain spaces.+ Previously we allowed '. . .', ' . . . ', etc. This caused+ too many complications, and removed author's flexibility in+ combining ellipses with spaces and periods.++ * Allow linebreaks in URLs (treat as spaces). Also, a string of+ consecutive spaces or tabs is now parsed as a single space. If you have+ multiple spaces in your URL, use `%20%20`.++ * `Text.Pandoc.Parsing`:++ + Removed `refsMatch`.+ + Hid `Key` constructor.+ + Removed custom `Ord` and `Eq` instances for `Key`.+ + Added `toKey` and `fromKey` to convert between `Key` and `[Inline]`.+ + Generalized type on `readWith`.++ * Small change in calculation of relative widths of table columns.+ If the size of the header > the specified column width, use+ the header size as 100% for purposes of calculating+ relative widths of columns.++ * Markdown writer now uses some pandoc-specific features when `--strict`+ is not specified: `\` newline is used for a hard linebreak instead of+ two spaces then a newline. And delimited code blocks are used when+ there are attributes.++ * HTML writer: improved gladTeX output by setting ENV appropriately+ for display or inline math (Jonathan Daugherty).++ * LaTeX writer: Use `\paragraph`, `\subparagraph` for level 4,5 headers.++ * LaTeX reader:++ + `\label{foo}` and `\ref{foo}` now become `{foo}` instead of `(foo)`.+ + `\index{}` commands are skipped.++ * Added `fontsize` variable to default LaTeX template.+ This makes it easy to set the font size using `markdown2pdf`:+ `markdown2pdf -V fontsize=12pt input.txt`.++ * Fixed problem with strikeout in LaTeX headers when using+ hyperref, by adding a command to the default LaTeX template+ that disables `\sout` inside pdf strings. Thanks to Joost Kremers+ for the fix.++ * The `COLUMNS` environment variable no longer has any effect.++### Under-the-hood improvements++ * Pandoc now compiles with GHC 7. (This alone leads to a+ significant performance improvement, 15-20%.)++ * Completely rewrote HTML reader using tagsoup as a lexer. The+ new reader is faster and more accurate. Unlike the+ old reader, it does not get bogged down on some input+ (Issues #277, 255). And it handles namespaces in tags+ (Issue #274).++ * Replaced `escapeStringAsXML` with a faster version.++ * Rewrote `spaceChar` and some other parsers in Text.Pandoc.Parsing+ for a significant performance boost.++ * Improved performance of all readers by rewriting parsers.++ * Simplified Text.Pandoc.CharacterReferences by using+ entity lookup functions from TagSoup.++ * `Text.Pandoc.UTF8` now uses the unicode-aware IO functions+ from `System.IO` if base >= 4.2. This gives support for+ windows line endings on windows.++ * Remove duplications in documentation by generating the+ pandoc man page from README, using `MakeManPage.hs`.++ * README now includes a full description of markdown syntax,+ including non-pandoc-specific parts. A new `pandoc_markdown`+ man page is extracted from this, so you can look up markdown+ syntax by doing `man pandoc_markdown`.++ * Completely revised test framework (with help from Nathan Gass).+ The new test framework is built when the `tests` Cabal flag is set. It+ includes the old integration tests, but also some new unit and quickcheck+ tests. Test output has been much improved, and you can now specify a glob+ pattern after `cabal test` to indicate which tests should be run;+ for example `cabal test citations` will run all the citation tests.++ * Added a shell script, `stripansi.sh`, for filtering ANSI control+ sequences from test output: `cabal test | ./stripansi.sh > test.log`.++ * Added `Interact.hs` to make it easier to use ghci while developing.+ `Interact.hs` loads `ghci` from the `src` directory, specifying+ all the options needed to load pandoc modules (including+ specific package dependencies, which it gets by parsing+ dist/setup-config).++ * Added `Benchmark.hs`, testing all readers + writers using criterion.++ * Added `stats.sh`, to make it easier to collect and archive+ benchmark and lines-of-code stats.++ * Added upper bounds to all cabal dependencies.++ * Include man pages in extra-source-files. This allows users to+ install pandoc from the tarball without needing to build the man+ pages.++### Bug fixes++ * Filenames are encoded as UTF8. Resolves Issue #252.++ * Handle curly quotes better in `--smart` mode. Previously, curly quotes+ were just parsed literally, leading to problems in some output formats.+ Now they are parsed as `Quoted` inlines, if `--smart` is specified.+ Resolves Issue #270.++ * Text.Pandoc.Parsing: Fixed bug in grid table parser.+ Spaces at end of line were not being stripped properly,+ resulting in unintended LineBreaks.++ * Markdown reader:++ + Allow HTML comments as inline elements in markdown.+ So, `aaa <!-- comment --> bbb` can be a single paragraph.+ + Fixed superscripts with links: `^[link](/foo)^` gets+ recognized as a superscripted link, not an inline note followed by+ garbage.+ + Fixed regression, making markdown reference keys case-insensitive again.+ Resolves Issue #272.+ + Properly handle abbreviations (like `Mr.`) at the end of a line.+ + Better handling of intraword underscores, avoiding exponential+ slowdowns in some cases. Resolves Issue #182.+ + Fixed bug in alignments in tables with blank rows in the header.++ * RST reader:++ + Field lists now allow spaces in field names, and+ block content in field values. (Thanks to Lachlan Musicman+ for pointing out the bug.)+ + Definition list items are now always `Para` instead of+ `Plain`, matching behavior of `rst2xml.py`.+ + In image blocks, the description is parsed properly and+ used for the alt attribute, not also the title.+ + Skip blank lines at beginning of file. Resolves+ Debian #611328.++ * LaTeX reader:++ + Improved parsing of preamble.+ Previously you'd get unexpected behavior on a document that+ contained `\begin{document}` in, say, a verbatim block.+ + Allow spaces between `\begin` or `\end` and `{`.+ + Support `\L` and `\l`.+ + Skip comments inside paragraphs.++ * LaTeX writer:++ + Escape strings in `\href{..}`.+ + In nonsimple tables, put cells in `\parbox`.++ * OpenDocument writer: don't print raw TeX.++ * Markdown writer:++ + Fixed bug in `Image`. URI was getting unescaped twice!+ + Avoid printing extra blank lines at the end if there are+ no notes or references.++ * LaTeX and ConTeXt: Escape `[` and `]` as `{[}` and `{]}`.+ This avoids unwanted interpretation as an optional argument.++ * ConTeXt writer: Fixed problem with inline code. Previously+ `}` would be rendered `\type{}}`. Now we check the string for '}' and '{'.+ If it contains neither, use `\type{}`; otherwise use `\mono{}`+ with an escaped version of the string.++ * `:` now allowed in HTML tags. Resolves Issue #274.++++## pandoc 1.6 (2010-07-24)+++ New EPUB and HTML Slidy writers. (Issue #122)++ - [EPUB] is a standard ebook format, used in Apple's iBooks for+ the iPad and iPhone, Barnes and Noble's nook reader, the Sony+ reader, and many other devices, and by online ebook readers like+ [bookworm]. (Amazon's Kindle uses a different format, MobiPocket,+ but EPUB books can easily be converted to Kindle format.) Now you+ can write your book in markdown and produce an ebook with a single+ command! I've put up a short [tutorial here].+ - [Slidy], like S5, is a system for producing HTML+javascript slide shows.+++ All input is assumed to be UTF-8, no matter what the locale and ghc+ version, and all output is UTF-8. This reverts to pre-1.5 behavior.+ Also, a BOM, if present, is stripped from the input.+++ Markdown now supports grid tables, whose cells can contain+ arbitrary block elements. (Issue #43)+++ Sequentially numbered example lists in markdown with `@` marker.+++ Markdown table captions can begin with a bare colon and no longer need+ to include the English word "table." Also, a caption can now occur+ either before or after the table. (Issue #227)+++ New command-line options:++ - `--epub-stylesheet` allows you to specify a CSS file that will+ be used to style your ebook.+ - `--epub-metadata` allows you to specify metadata for the ebook.+ - `--offline` causes the generated HTML slideshow to include all+ needed scripts and stylesheets.+ - `--webtex` causes TeX math to be converted to images using the+ Google Charts API (unless a different URL is specified).+ - `--section-divs` causes div tags to be added around each section+ in an HTML document. (Issue #230, 239)+++ Default behavior of S5 writer in standalone mode has changed:+ previously, it would include all needed scripts and stylesheets+ in the generated HTML; now, only links are included unless+ the `--offline` option is used.+++ Default behavior of HTML writer has changed. Between 1.2 and 1.5,+ pandoc would enclose sections in div tags with identifiers on the+ div tags, so that the sections can be manipulated in javascript.+ This caused undesirable interactions with raw HTML div tags. So,+ starting with 1.6, the default is to put the identifiers directly+ on the header tags, and not to include the divs. The `--section-divs`+ option selects the 1.2-1.5 behavior.+++ API changes:++ - `HTMLMathMethod`: Added `WebTeX`, removed `MimeTeX`.+ - `WriterOptions`: Added `writerUserDataDir`, `writerSourceDirectory`,+ `writerEPUBMetadata` fields. Removed `writerIncludeBefore`,+ `writerIncludeAfter`.+ - Added `headerShift` to `Text.Pandoc.Shared`.+ - Moved parsing code and `ParserState` from `Text.Pandoc.Shared`+ to a new module, `Text.Pandoc.Parsing`.+ - Added `stateHasChapters` to `ParserState`.+ - Added `HTMLSlideVariant`.+ - Made `KeyTable` a map instead of an association list.+ - Added accessors for `Meta` fields (`docTitle`, `docAuthors`, `docDate`).+ - `Pandoc`, `Meta`, `Inline`, and `Block` have been given `Ord` instances.+ - Reference keys now have a type of their own (`Key`), with its+ own `Ord` instance for case-insensitive comparison.+ - Added `Text.Pandoc.Writers.EPUB`.+ - Added `Text.Pandoc.UUID`.+ - Removed `Text.Pandoc.ODT`, added `Text.Pandoc.Writers.ODT`.+ Removed `saveOpenDocumentAsODT`, added `writeODT`.+ - Added `Text.Pandoc.Writers.Native` and `writeNative`.+ Removed `prettyPandoc`.+ - Added `Text.Pandoc.UTF8` for portable UTF8 string IO.+ - Removed `Text.Pandoc.Writers.S5` and the `writeS5` function.+ Moved `s5Includes` to a new module, `Text.Pandoc.S5`.+ To write S5, you now use `writeHtml` with `writerSlideVariant`+ set to `S5Slides` or `SlidySlides`.+++ Template changes. If you use custom templates, please update them,+ particularly if you use syntax highlighting with pandoc. The old HTML+ templates hardcoded highlighting CSS that will no longer work with+ the most recent version of highlighting-kate.++ - HTML template: avoid empty meta tag if no date.+ - HTML template: Use default highlighting CSS from highlighting-kate+ instead of hard-coding the CSS into the template.+ - HTML template: insert-before text goes before the title, and+ immediately after the `<body>` tag, as documented. (Issue #241)+ - Added slidy and s5 templates.+ - Added amssymb to preamble of latex template. (github Issue 1)+++ Removed excess newlines at the end of output. Note: because output+ will not contain an extra newline, you may need to make adjustments+ if you are inserting pandoc's output into a template.+++ In S5 and slidy, horizontal rules now cause a new slide, so you+ are no longer limited to one slide per section.+++ Improved handling of code in man writer. Inline code is now monospace,+ not bold, and code blocks now use .nf (no fill) and .IP (indented para).+++ HTML reader parses `<tt>` as Code. (Issue #247)+++ html+lhs output now contains bird tracks, even when compiled without+ highlighting support. (Issue #242)+++ Colons are now no longer allowed in autogenerated XML/HTML identifiers,+ since they have a special meaning in XML.+++ Code improvements in ODT writer. Remote images are now replaced with+ their alt text rather than a broken link.+++ LaTeX reader improvements:++ - Made latex `\section`, `\chapter` parsers more forgiving of whitespace.+ - Parse `\chapter{}` in latex.+ - Changed `rawLaTeXInline` to accept `\section`, `\begin`, etc.+ - Use new `rawLaTeXInline'` in LaTeX reader, and export `rawLaTeXInline`+ for use in markdown reader.+ - Fixes bug wherein `\section{foo}` was not recognized as raw TeX+ in markdown document.+++ LaTeX writer: images are automatically shrunk if they would extend+ beyond the page margin.+++ Plain, markdown, RST writers now use unicode for smart punctuation.+++ Man writer converts math to unicode when possible, as in other writers.+++ `markdown2pdf` can now recognize citeproc options.+++ Command-line arguments are converted to UTF-8. (Issue #234)+++ `Text.Pandoc.TeXMath` has been rewritten to use texmath's parser.+ This allows it to handle a wider range of formulas. Also, if a formula+ cannot be converted, it is left in raw TeX; formulas are no longer+ partially converted.+++ Unicode curly quotes are left alone when parsing smart quotes. (Issue #143)+++ Cabal file changes:++ - Removed parsec < 3 restriction.+ - Added 'threaded' flag for architectures where GHC lacks a threaded+ runtime.+ - Use 'threaded' only for markdown2pdf; it is not needed for pandoc.+ - Require highlighting-kate 0.2.7.+++ Use explicit imports from `Data.Generics`. Otherwise we have a+ conflict with the 'empty' symbol, introduced in syb >= 0.2. (Issue #237)+++ New data files: slidy/slidy.min.js, slidy/slidy.min.css, epub.css.++[EPUB]: http://en.wikipedia.org/wiki/EPUB+[Slidy]: http://www.w3.org/Talks/Tools/Slidy+[bookworm]: http://bookworm.oreilly.com/+[tutorial here]: http://johnmacfarlane.net/pandoc/epub.html++## pandoc 1.5.1.1 (2010-03-29)+++ Fixed header identifiers (uniqueIdent in Shared) so they+ work as advertized in README and are guaranteed to be+ valid XHTML names. Thanks to Xyne for reporting the bug.++## pandoc 1.5.1 (2010-03-23)+++ Fixed treatment of unicode characters in URIs.++ Revised Setup.hs so it works with debian's build process.++ Fixed bug in OpenDocument writer that led to invalid+ XML for some input.++## pandoc 1.5.0.1 (2010-03-21)+++ HTML writer: Fixed error in math writer (with MathML option)+ that caused an infinite loop for unparsable MathML.++## pandoc 1.5 (2010-03-20)+++ Moved repository to [github](http://github.com/jgm/pandoc).++ New `--mathml` option, for display of TeX math as MathML.++ New `--data-dir` option, allowing users to specify a data+ directory other than `~/.pandoc`. Files placed in this directory+ will be used instead of system defaults.++ New `--base-header-level` option. For example, `--base-header-level=2`+ changes level 1 headers to level 2, level 2 to level 3, etc.++ New 'plain' output format: plain text without pictures, hyperlinks,+ inline formatting, or anything else that looks even vaguely+ markupish.++ Titles and authors in title blocks can now span multiple lines,+ as long as the continuation lines begin with a space character.++ When given an absolute URI as a parameter, pandoc will fetch+ the content via HTTP.++ The HTML reader has been made much more forgiving. It no+ longer requires well-formed xhtml as input.++ `html2markdown` has been removed; it is no longer necessary, given+ the last two changes. `pandoc` can be used by itself to convert+ web pages to markdown or other formats.++ `hsmarkdown` has also been removed. Use `pandoc --strict` instead.+ Or symlink pandoc's executable to `hsmarkdown`; `pandoc` will then+ behave like `hsmarkdown` used to.++ An image in a paragraph by itself is now rendered as a figure+ in most writers, with the alt text as the caption.++ Incomplete support for reST tables (simple and grid). Thanks to+ Eric Kow. Colspans and rowspans not yet supported.++ In mediawiki, links with relative URLs are now formatted as wikilinks.+ Also, headers have been promoted: `= head =` is now level 1 instead of+ level 2.++ The markdown reader now handles "inverse bird tracks" when parsing+ literate haskell. These are used for haskell example code that+ is not part of the literate program.++ The `-B` and `-A` options now imply `-s` and no longer work in+ fragment mode.++ Headerless tables are now printed properly in all writers.+ In addition, tbody, thead, and cols are used in HTML and Docbook+ tables.++ Improved build system; removed obsolete Makefile.++ In LaTeX writer, `\chapter` is now used instead of `\section`.+ when the documentclass is book, report, or memoir.++ Many small bug fixes. See [changelog] for details.++## pandoc 1.4 (2010-01-02)+++ New template system replaces old headers, giving users much+ more control over pandoc's output in `--standalone` mode.+ Added `--template` and `--variable` options. The `--print-default-header`+ option is now `--print-default-template`. See README under+ "Templates" for details.++ The old `--custom-header` option should still work, but it has+ been deprecated.++ New `--reference-odt` option allows users to customize styles+ in ODT output.++ Users may now put custom templates, s5 styles, and a reference+ ODT in the `~/.pandoc` directory, where they will override system+ defaults. See README for details.++ Unicode is now used whenever possible in HTML and XML output. Entities+ are used only where necessary (`>`, `<`, `"`, `&`).++ Authors and dates may now include formatting and notes.++ Added `--xetex` option for `pandoc` and `markdown2pdf`.++ Windows installer now includes highlighting support and+ `markdown2pdf` and `hsmarkdown` wrappers.++ Pandoc no longer requires Template Haskell, which should make+ it more portable.++ Pandoc can now be built on GHC 6.12, as well as earlier versions.++ See README for other small improvements and bug fixes.++## pandoc 1.3 (2009-12-10)+++ Added `--id-prefix` option to help prevent duplicate+ identifiers when you're generating HTML fragments.++ Added `--indented-code-classes` option, which specifies+ default highlighting syntax for indented code blocks.++ `--number-sections` now affects HTML output.++ Improved syntax for markdown definition lists.++ Better looking simple tables.++ Markdown tables without headers are now possible.++ New hard line break syntax: backslash followed by newline.++ Improved performance of markdown reader by ~10% by eliminating the+ need for a separate parsing pass for notes.++ Improved syntax highlighting for literate Haskell.++ Support for "..code-block" directive in RST reader.++ Windows binary now includes highlighting support.++ Many bug fixes and small improvements. See [changelog]+ for details.++## pandoc 1.2.1 (2009-07-18)+++ Improved the efficiency of the markdown reader's+ abbreviation parsing (should give a big performance+ boost with `--smart`).++ HTML writer now wraps sections in divs with unique+ identifiers, for easier manipulation.++ Improved LaTeX reader's coverage of math modes.++ Added a portable Haskell version of markdown2pdf (thanks+ to Paolo Tanimoto).++ Made `--strict` compatible with `--standalone` and `--toc.`++ Many other small improvements and bug fixes.+ See [changelog] for details.++## pandoc 1.2 (2009-03-01)+++ Added support for literate Haskell. lhs support is triggered by+ '+lhs' suffixes in formats. For example, 'latex+lhs' is literate+ Haskell LaTeX. '.lhs' files are treated by default as literate+ markdown.++ Added `--email-obfuscation` option.++ Brought citeproc support up to date for citeproc-hs-0.2.++ Many bugs fixed. See [changelog] for details.++## pandoc 1.1 (2008-11-06)+++ New `--jsmath` option supporting use of pandoc with [jsMath].++ Classes on HTML table output for better CSS styling.++ Windows installer no longer requires admin privileges.++ Many bugs fixed. See [changelog] for details.++## pandoc 1.0 (2008-09-13)+++ New writers for MediaWiki, GNU Texinfo (thanks to Peter Wang),+ OpenDocument XML (thanks to Andrea Rossato), and ODT (OpenOffice+ document).++ New [delimited code blocks](README.html#delimited-code-blocks),+ with optional syntax highlighting.++ Reorganized build system: pandoc can now be built using standard+ Cabal tools. It can be compiled on Windows without Cygwin.+ The tests can also be run without perl or unix tools.++ LaTeXMathML replaces ASCIIMathML for rendering math in HTML.++ Support for "displayed" math.++ Common abbreviations are now handled more intelligently, with+ a non-breaking space (and not a sentence-ending space) after+ the period.++ Code is -Wall clean.++ Many bug fixes and small improvements. See [changelog] for+ full details.++## pandoc 0.46 (2008-01-08)+++ Added a `--sanitize-html` option (and a corresponding parameter+ in `ParserState` for those using the pandoc libraries in programs).+ This option causes pandoc to sanitize HTML (in HTML or Markdown+ input) using a whitelist method. Possibly harmful HTML elements+ are replaced with HTML comments. This should be useful in the+ context of web applications, where pandoc may be used to convert+ user input into HTML.++ Made -H, -A, and -B options cumulative: if they are specified+ multiple times, multiple files will be included.++ Many bug fixes and small improvements. See [changelog] for full+ details.++## pandoc 0.45 (2007-12-09)+++ Many bug fixes and structural improvements. See [changelog] for+ full details.++ Improved treatment of math. Math is now rendered using unicode+ by default in HTML, RTF, and DocBook output. For more accurate+ display of math in HTML, `--gladtex`, `--mimetex`, and `--asciimathml`+ options are provided. See the [User's Guide](README.html#math) for+ details.++ Removed support for box-style block quotes in markdown.++ More idiomatic ConTeXt output.++ Text wrapping in ConTeXt and LaTeX output.++ Pandoc now correctly handles all standard line endings+ (CR, LF, CRLF).++ New `--no-wrap` option that disables line wrapping and minimizes+ whitespace in HTML output.++ Build process is now compatible with both GHC 6.8 and GHC 6.6.+ GHC and GHC_PKG environment variables may be used to specify+ which version of the compiler to use, when multiple versions are+ installed.++## pandoc 0.44 (2007-09-03)++ [ John MacFarlane ]++ * Fixed bug in HTML writer: when --toc was used, anchors were put around+ headers, which is invalid XHTML (block content within inline element).+ Now the anchors are put inside the header tags. Resolves Issue #23.++ * Added xmlns attribute to html element in html writer tests.+ This attribute is added by more recent versions of the+ xhtml library (>= 3000), and is required for valid XHTML.++ [ Recai Oktaş ]++ * On configure, compile 'Setup.hs' to 'setup' and use 'setup' as the build+ command instead of 'runhaskell', which, on some platforms (such as s390,+ alpha, m68k), throws the following error:++ runhaskell Setup.hs configure --prefix=/usr+ ghc-6.6.1: not built for interactive use++ This causes a serious FTBFS bug. Closes: #440668.++## pandoc 0.43 (2007-09-02)++ [ John MacFarlane ]++ * The focus of this release is performance. The markdown parser+ is about five times faster than in 0.42, based on benchmarks+ with the TextMate manual.++ * Main.hs: Replaced CRFilter and tabFilter with single function+ tabFilter, which operates on the whole string rather than breaking+ it into lines, and handles dos-style line-endings as well as tabs.++ * Added separate LaTeX reader and native reader tests; removed+ round-trip tests.++ * Text.Pandoc.Shared:++ + Removed tabsToSpaces and tabsInLine (they were used only in Main.hs.)+ + General code cleanup (to elimante warnings when compiling with -Wall.)+ + Added 'wrapped' function, which helps wrap text into paragraphs,+ using the prettyprinting library.+ + Rewrote charsInBalanced and charsInBalanced'.+ - Documented restriction: open and close must be distinct characters.+ - Rearranged options for greater efficiency.+ - Bug fix: Changed inner call to charsInBalanced inside+ charsInBalanced' to charsInBalanced'.+ + anyLine now requires that the line end with a newline (not eof).+ This is a harmless assumption, since we always add newlines to the+ end of a block before parsing with anyLine, and it yields a 10% speed+ boost.+ + Removed unnecessary 'try' in anyLine.+ + Removed unneeded 'try' from romanNumeral parser.+ + Use notFollowedBy instead of notFollowedBy' in charsInBalanced.+ + Removed unneeded 'try' in parseFromString.+ + Removed unneeded 'try' from stringAnyCase. (Now it behaves+ like 'string'.)+ + Changed definition of 'enclosed' in Text.Pandoc.Shared so that+ 'try' is not automatically applied to the 'end' parser. Added+ 'try' in calls to 'enclosed' where needed. Slight speed increase.++ * Writers:++ + Replaced individual wrapping routines in RST, Man, and Markdown+ writers with 'wrapped' from Text.Pandoc.Shared.+ + Rewrote LaTeX writer to use the prettyprinting library,+ so we get word wrapping, etc.+ + Modified latex writer tests for new latex writer using prettyprinter.+ + Fixed bug in LaTeX writer: autolinks would not cause+ `\usepackage{url}` to be put in the document header. Also, changes+ to state in enumerated list items would be overwritten.+ + In Markdown writer, escape paragraphs that begin with ordered list+ markers, so they don't get interpreted as ordered lists.++ * Text.Pandoc.Reades.LaTeX:++ + Fixed bug in LaTeX reader, which wrongly assumed that the roman+ numeral after "enum" in "setcounter" would consist entirely of+ "i"s. 'enumiv' is legitimate.+ + LaTeX command and environment names can't contain numbers.+ + Rearranged order of parsers in inline for slight speed improvement.+ + Added '`' to special characters and 'unescapedChar'.++ * Text.Pandoc.Readers.RST:++ + Removed unneeded try's in RST reader; also minor code cleanup.+ + Removed tabchar.+ + Rearranged parsers in inline (doubled speed).++ * Text.Pandoc.Readers.Markdown:++ + Skip notes parsing if running in strict mode. (This yields a nice+ speed improvement in strict mode.)+ + Simplify autolink parsing code, using Network.URI to test for+ URIs. Added dependency on network library to debian/control and+ pandoc.cabal.+ + More perspicuous definition of nonindentSpaces.+ + Removed unneeded 'try' in 'rawLine'.+ + Combined linebreak and whitespace into a new whitespace parser, to+ avoid unnecessary reparsing of space characters.+ + Removed unnecessary 'try' in 'codeBlock', 'ellipses', 'noteMarker',+ 'multilineRow', 'dashedLine', 'rawHtmlBlocks'.+ + Use lookAhead in parsers for setext headers and definition lists+ to see if the next line begins appropriately; if not, don't waste+ any more time parsing.+ + Don't require blank lines after code block. (It's sufficient to+ end code block with a nonindented line.)+ + Changed definition of 'emph': italics with '_' must not+ be followed by an alphanumeric character. This is to help+ prevent interpretation of e.g. `[LC_TYPE]: my_type` as+ `[LC<em>TYPE]:my</em>type`.+ + Improved Markdown.pl-compatibility in referenceLink: the two parts+ of a reference-style link may be separated by one space, but not+ more... [a] [link], [not] [a link].+ + Fixed markdown inline code parsing so it better accords with+ Markdown.pl: the marker for the end of the code section is a clump+ of the same number of `'s with which the section began, followed+ by a non-` character. So, for example,+ ` h ``` i ` -> `<code>h ``` i</code>`.+ + Split 'title' into 'linkTitle' and 'referenceTitle', since the+ rules are slightly different.+ + Rewrote 'para' for greater efficiency.+ + Rewrote link parsers for greater efficiency.+ + Removed redundant 'referenceLink' in definition of inline (it's+ already in 'link').+ + Refactored escapeChar so it doesn't need 'try'.+ + Refactored hrule for performance in Markdown reader.+ + More intelligent rearranging of 'inline' so that most frequently+ used parsers are tried first.+ + Removed tabchar parser, as whitespace handles tabs anyway.++ * Text.Pandoc.CharacterReferences:++ + Refactored.+ + Removed unnecessary 'try's for a speed improvement.+ + Removed unnecessary '&' and ';' from the entity table.++ * Build process:++ + Makefile: Get VERSION from cabal file, not Main.hs.+ + Modified MacPorts Portfile:+ - Depend on haddock+ - Build and install libraries and library documentation in+ addition to pandoc executable+ - Added template item for md5 sum in Portfile.in.+ - Incorporated changes from MacPorts repository (r28278).+ + FreeBSD port: Don't try to generate distinfo in Makefile.+ It can be made using 'make makesum' in FreeBSD.+ + Make both freebsd and macports targets depend on tarball.++ * Website and documentation:++ + Updated INSTALL instructions.+ + Added pandocwiki demo to website.+ + Removed local references to Portfile, since pandoc is now in the+ MacPorts repository.++## pandoc 0.42 (2007-08-26)++ [ John MacFarlane ]++ * Main.hs: Use utf8 conversion on the extra files loaded with+ the -H, -C, -B, and -A options. This fixes problems with unicode+ characters in these files.++ * Exposed Text.Pandoc.ASCIIMathML, since it is imported in+ Text.Pandoc.Readers.HTML and without it we get a linking error when+ using the library.++ * Markdown reader:++ + Added new rule for enhanced markdown ordered lists: if the list+ marker is a capital letter followed by a period (including a+ single-letter capital roman numeral), then it must be followed by+ at least two spaces. The point of this is to avoid accidentally+ treating people's initials as list markers: a paragraph might begin,+ "B. Russell was an English philosopher," and this shouldn't be+ treated as a list. Documented change in README.+ + Blocks that start with "p. " and a digit are no longer treated+ as ordered lists (it's a page number).+ + Added a needed 'try' to listItem.+ + Removed check for a following setext header in endline.+ A full test is too inefficient (doubles benchmark time), and the+ substitute we had before is not 100% accurate.+ + Don't use Code elements for autolinks if --strict specified.++ * LaTeX writer: When a footnote ends with a Verbatim environment, the+ close } of the footnote cannot occur on the same line or an error occurs.+ Fixed this by adding a newline before the closing } of every footnote.++ * HTML writer:+ + Removed incorrect "{}" around style information in HTML tables.+ Column widths now work properly in HTML.+ + If --strict option is specified (and --toc is not), don't include+ identifiers in headers, for better Markdown compatibility.++ * Build process:++ + Separated $(web_dest) and website targets.+ + In website, index.txt is now constructed from template index.txt.in.+ + Added freebsd target to Markefile. This creates the freebsd Makefile+ from Makefile.in, and creates distinfo. Removed Makefile and distinfo+ from the repository.+ + Added macport target to Makefile. Portfile is built from template+ Portfile.in.+ + Removed OSX package targets. (Too many difficulties involving+ dependencies on dynamic libraries.)+ + More complete INSTALL instructions for all architectures.++ * Website:+ + Added a programming demo, pandocwiki.++ [ Recai Oktaş ]++ * Do not forget to close pandoc's ITP. Closes: #391666++## pandoc 0.41 (2007-08-19)++ [ John MacFarlane ]++ * Fixed bugs in HTML reader:+ + Skip material at end *only if* `</html>` is present (previously,+ only part of the document would be parsed if an error was+ found; now a proper error message is given).+ + Added new constant eitherBlockOrInline with elements that may+ count either as block-level or as inline. Modified isInline and+ isBlock to take this into account.+ + Modified rawHtmlBlock to accept any tag (even an inline tag):+ this is innocuous, because rawHtmlBlock is tried only if a regular+ inline element can't be parsed.+ + Added a necessary 'try' in definition of 'para'.++ * Fixed bug in markdown ordered list parsing. The problem was that+ anyOrderedListStart did not check for a space following the+ ordered list marker. So in 'A.B. 2007' the parser would be+ expecting a list item, but would not find one, causing an error.+ Fixed a similar bug in the RST reader. Resolves Issue #22.++ * Refactored RST and Markdown readers using parseFromString.++ * LaTeX reader will now skip anything after \end{document}.++ * Fixed blockquote output in markdown writer: previously, block+ quotes in indented contexts would be indented only in the first+ line.++ * Added note to INSTALL about variations in versions of the xhtml+ library that can lead to failed tests (thanks to Leif LeBaron).++## pandoc 0.4 (2007-01-16)++ [ John MacFarlane ]++ * Added two new output formats: groff man pages and ConTeXt. By+ default, output files with extensions ".ctx" and ".context" are+ assumed to be ConTeXt, and output files with single-digit extensions+ are assumed to be man pages.++ * Enhanced ordered lists (documented in README, under Lists):+ + The OrderedList block element now stores information about+ list number style, list number delimiter, and starting number.+ + The readers parse this information when possible.+ + The writers use this information to style ordered lists.+ + The enhancement can be disabled using the --strict option.++ * Added support for tables (with a new Table block element). Two kinds+ of tables are supported: a simple table with one-line rows, and a+ more complex variety with multiline rows. All output formats are+ supported, but only markdown tables are parsed at the moment. The+ syntax is documented in README.++ * Added support for definition lists (with a new DefinitionList block+ element). All output and input formats are supported. The syntax is+ documented in README.++ * Added support for superscripts and subscripts (with new Superscript+ and Subscript inline elements). All input and output+ formats. The syntax is documented in README.++ * Added support for strikeout (with a new Strikeout inline element).+ All input and output formats are supported. Thanks to Bradley Kuhn,+ who contributed a patch. The syntax is documented in README. Resolves+ Issue #18.++ * Added a --toc|--table-of-contents option. This causes an automatically+ generated table of contents (or an instruction that creates one) to+ be inserted at the beginning of the document. Not supported in S5,+ DocBook, or man page writers.++ * Modified the -m|--asciimathml option:++ + If an optional URL argument is provided, a link is inserted+ instead of the contents of the ASCIIMathML.js script.+ + Nothing is inserted unless the document actually contains+ LaTeX math.++ * Removed Blank block element as unnecessary.++ * Removed Key and Note blocks from the Pandoc data structure. All+ links are now stored as explicit links, and note contents are+ stored with the (inline) notes.++ + All link Targets are now explicit (URL, title) pairs; there+ is no longer a 'Ref' target.+ + Markdown and RST parsers now need to extract data from key and+ note blocks and insert them into the relevant inline elements.+ Other parsers have been simplified, since there is no longer any need+ to construct separate key and note blocks.+ + Markdown, RST, and HTML writers need to construct lists of+ notes; Markdown and RST writers need to construct lists of link+ references (when the --reference-links option is specified); and+ the RST writer needs to construct a list of image substitution+ references. All writers have been rewritten to use the State monad+ when state is required.+ + Several functions (generateReference, keyTable,+ replaceReferenceLinks, replaceRefLinksBlockList, and some auxiliaries+ used by them) have been removed from Text.Pandoc.Shared, since+ they are no longer needed. New functions and data structures+ (Reference, isNoteBlock, isKeyBlock, isLineClump) have been+ added. The functions inTags, selfClosingTag, inTagsSimple, and+ inTagsIndented have been moved to the DocBook writer, since that+ is now the only module that uses them. NoteTable is now exported+ in Text.Pandoc.Shared.+ + Added stateKeys and stateNotes to ParserState; removed stateKeyBlocks,+ stateKeysUsed, stateNoteBlocks, stateNoteIdentifiers, stateInlineLinks.+ + Added writerNotes and writerReferenceLinks to WriterOptions.++ * Added Text.Pandoc module that exports basic readers, writers,+ definitions, and utility functions. This should export everything+ needed for most uses of Pandoc libraries. The haddock documentation+ includes a short example program.++ * Text.Pandoc.ASCIIMathML is no longer an exported module.++ * Added Text.Pandoc.Blocks module to help in printing markdown+ and RST tables. This module provides functions for working with+ fixed-width blocks of text--e.g., placing them side by side, as+ in a table row.++ * Refactored to avoid reliance on Haskell's Text.Regex library, which+ (a) is slow, and (b) does not properly handle unicode. This fixed+ some strange bugs, e.g. in parsing S-cedilla, and improved performance.++ + Replaced 'gsub' with a general list function 'substitute'+ that does not rely on Text.Regex.+ + Rewrote extractTagType in HTML reader so that it doesn't use+ regexs.+ + In Markdown reader, replaced email regex test with a custom email+ autolink parser (autoLinkEmail). Also replaced selfClosingTag regex+ with a custom function isSelfClosingTag.+ + Modified Docbook writer so that it doesn't rely on Text.Regex for+ detecting 'mailto' links.+ + Removed escapePreservingRegex and reamped entity-handling+ functions in Text.Pandoc.Shared and Text.Pandoc.CharacterReferences to+ avoid reliance on Text.Regex (see below on character reference+ handling changes).++ * Renamed Text.Pandoc.Entities as Text.Pandoc.CharacterReferences.++ * Changed handling of XML entities. Entities are now parsed (and unicode+ characters returned) in the Markdown and HTML readers, rather than being+ handled in the writers. In HTML and Docbook writers, UTF-8 is now used+ instead of entities for characters above 128. This makes the HTML and+ DocBook output much more readable and more easily editable.++ + Removed sgmlHexEntity, sgmlDecimalEntity, sgmlNamedEntity, and+ sgmlCharacterEntity regexes from Text.Pandoc.Shared.+ + Renamed escapeSGMLChar to escapeCharForXML. Added escapeStringForXML.+ Moved both functions to Text.Pandoc.Writers.Docbook.+ + Added characterReference parser to Text.Pandoc.CharacterReferences.+ This parses a string and return a unicode character.+ + Rewrote decodeCharacterReferences to use the new parser instead of+ Text.Regex.+ + Added new charRef parser for Markdown and HTML, which replaces the+ old 'entity' parser. Added '&' as a special character in Markdown reader.+ + Modified HTML and Markdown readers to call decodeEntities on all raw+ strings (e.g. authors, dates, link titles), to ensure that no+ unprocessed entities are included in the native representation of+ the document. (In the HTML reader, most of this work is done by a+ change in extractAttributeName.)+ + In XML and Markdown output, escape unicode nonbreaking space as ' ',+ since a unicode non-breaking space is impossible to distinguish visually+ from a regular space. (Resolves Issue #3.)+ + Removed encodeEntitiesNumerical.+ + Use Data.Map for entityTable and (new) reverseEntityTable, for a+ slight performance boost over the old association list.+ + Removed unneeded decodeEntities from 'str' parser in HTML and+ Markdown readers.++ * Text.Pandoc.UTF8: Renamed encodeUTF8 to toUTF8, decodeUTF8 to+ fromUTF8, for clarity.++ * Replaced old haskell98 module names replaced by hierarchical module+ names, e.g. List by Data.List. Removed haskell98 from dependencies+ in pandoc.cabal, and added mtl (needed for state monad). Substituted+ xhtml for html.++ * Refactored and cleaned up character escaping in writers, using+ backslashEscapes and escapeStringUsing functions.++ * Instead of adding `\n\n` to the end of an input string in Main.hs,+ this is now done in the readers. This makes the libraries behave+ the way you'd expect from the pandoc program. Resolves Issue #10.++ * URLs and email addresses in autolinks are now typeset as Code.++ * In Main.hs, changed putStr to putStrLn -- mainly because MacOS X+ doesn't display the whole output unless there's a line ending.++ * Major code cleanup in all modules, for greater consistency, concision,+ and readability.++ * HTML reader:++ + Fixed several bugs (extractTagType, attribute parsing).+ + Remove Null blocks in lists of blocks when possible.+ + Allow HTML comments as raw HTML inline.++ * Markdown reader:++ + Ordered list items may no longer begin with uppercase letters, or+ letters greater than 'n'. (This prevents first initials and page+ reference, e.g. 'p. 400', from being parsed as beginning lists.)+ Also, numbers beginning list items may no longer end with ')',+ which is now allowed only after letters. Note: These changes+ may cause documents to be parsed differently. Users should take+ care in upgrading.+ + Changed autoLink parsing to conform better to Markdown.pl's+ behavior. `<google.com>` is not treated as a link, but+ `<http://google.com>`, `<ftp://google.com>`, and+ `<mailto:google@google.com>` are.+ + Cleaned up handling of embedded quotes in link titles. Now these are+ stored as a '"' character, not as '"'.+ + Use lookAhead parser for the 'first pass' (looking for reference keys),+ instead of parsing normally, then using setInput to reset input. This+ yields a slight performance boost.+ + Fixed several bugs in smart quote recognition.+ + Fixed bug in indentSpaces (which didn't properly handle+ cases with mixed spaces and tabs).+ + Consolidated 'text', 'special', and 'inline' into 'inline'.+ + Fixed bug which allowed URL and title to be separated by multiple blank+ lines in links and reference keys. They can be on separate lines but+ can't have blank lines between them.+ + Correctly handle bracketed text inside inline footnotes and links,using+ new function inlinesInBalanced. Resolves Issue #14.+ + Fixed bug in footnotes: links in footnotes were not being+ processed. Solution: three-stage parse. First, get all the+ reference keys and add information to state. Next, get all the+ notes and add information to state. (Reference keys may be needed+ at this stage.) Finally, parse everything else.+ + Replaced named constants like 'emphStart' with literals.+ + Removed an extra occurrence of escapedChar in definition of inline.++ * RST reader:++ + Allow the URI in a RST hyperlink target to start on the line+ after the reference key.+ + Added 'try' in front of 'string', where needed, or used a different+ parser. This fixes a bug where ````` would not be correctly parsed as+ a verbatim `.+ + Fixed slow performance in parsing inline literals in RST reader. The+ problem was that ``#`` was seen by 'inline' as a potential link or image.+ Fix: inserted 'notFollowedBy (char '`')' in link parsers.+ Resolves Issue #8.+ + Use lookAhead instead of getInput/setInput in RST reader. Removed+ unneeded getState call, since lookAhead automatically saves and+ restores the parser state.+ + Allow hyperlink target URIs to be split over multiple lines, and+ to start on the line after the reference. Resolves Issue #7.+ + Fixed handling of autolinks.++ * LaTeX reader:++ + Replaced `choice [(try (string ...), ...]` idiom with `oneOfStrings`,+ for clarity.+ + Added clauses for tilde and caret. Tilde is `\ensuremath{\sim}`, and+ caret is `\^{}`, not `\^` as before.+ + Added parsing for `\url`.+ + Parse `\texttt{}` as code, provided there's nothing fancy inside.++ * HTML writer:++ + Modified HTML writer to use the Text.XHtml library. This results+ in cleaner, faster code, and it makes it easier to use Pandoc in+ other projects, like wikis, which use Text.XHtml. Two functions are+ now provided, writeHtml and writeHtmlString: the former outputs an+ Html structure, the latter a rendered string. The S5 writer is also+ changed, in parallel ways (writeS5, writeS5String).+ + The Html header is now written programmatically, so it has been+ removed from the 'headers' directory. The S5 header is still+ needed, but the doctype and some of the meta declarations have+ been removed, since they are written programmatically. This change+ introduces a new dependency on the xhtml package.+ + Fixed two bugs in email obfuscation involving improper escaping+ of '&' in the `<noscript>` section and in `--strict` mode. Resolves+ Issue #9.+ + Fixed another bug in email obfuscation: If the text to be obfuscated+ contains an entity, this needs to be decoded before obfuscation.+ Thanks to thsutton for the patch. Resolves Issue #15.+ + Changed the way the backlink is displayed in HTML footnotes.+ Instead of appearing on a line by itself, it now generally+ appears on the last line of the note. (Exception: when the+ note does not end with a Plain or Para block.) This saves space+ and looks better.+ + Added automatic unique identifiers to headers:+ - The identifier is derived from the header via a scheme+ documented in README.+ - WriterState now includes a list of header identifiers and a table+ of contents in addition to notes.+ - The function uniqueIdentifiers creates a list of unique identifiers+ from a list of inline lists (e.g. headers).+ - This list is part of WriterState and gets consumed by blockToHtml+ each time a header is encountered.+ + Include CSS for .strikethrough class in header only if strikethrough+ text appears in the document.+ + If the 'strict' option is specified, elements that do not appear in+ standard markdown (like definition lists) are passed through as+ raw HTML.+ + Simplified treatment of autolinks, using pattern matching instead of+ conditionals.++ * Markdown writer:++ + Links in markdown output are now printed as inline links by default,+ rather than reference links. A --reference-links option has been added+ that forces links to be printed as reference links. Resolves Issue #4.+ + Use autolinks when possible. Instead of `[site.com](site.com)`,+ use `<site.com>`.++ * LaTeX writer:++ + Rewrote to use the State monad. The preamble now includes only those+ packages that are actually required, given the document's content.+ Thus, for example, if strikeout is not used, ulem is not required.+ Modified LaTeXHeader accordingly.+ + Modified LaTeX writer to insert `\,` between consecutive quotes.+ + Removed unused function tableRowColumnWidths.+ + Simplified code for escaping special characters.+ + Leave extra blank line after `\maketitle`.+ + Include empty `\author{}` when no author specified to avoid LaTeX+ errors.+ + Include fancyvrb code in header only if needed -- that is, only+ if there is actually code in a footnote.+ + Use `\url{}` for autolinks.+ + Include [mathletters] option in ucs package, so that basic unicode+ Greek letters will work correctly.++ * RST writer: Force blank line before lists, so that sublists will+ be handled correctly.++ * Docbook writer: Fixed a bug: email links with text, like+ [foo](me@bar.baz), were being incorrectly treated as autolinks.++ * Removed Text.ParserCombinators.Pandoc and moved all its functions to+ Text.Pandoc.Shared.++ * Text.Pandoc.Shared:++ + Added defaultWriterOptions.+ + Added writerTableOfContents to WriterOptions.+ + Added writerIgnoreNotes option to WriterOptions. This is needed+ for processing header blocks for a table of contents, since notes on+ headers should not appear in the TOC.+ + Added prettyprinting for native Table format.+ + Removed some unneeded imports.+ + Moved escape and nullBlock parsers from+ Text.ParserCombinators.Pandoc, since the latter is for+ general-purpose parsers that don't depend on Text.Pandoc.Definition.+ + Moved isHeaderBlock from Text.Pandoc.Writers.HTML.+ + Moved Element, headerAtLeast, and hierarchicalize from Docbook+ writer, because HTML writer now uses these in constructing a table+ of contents.+ + Added clauses for new inline elements (Strikeout, Superscript,+ Subscript) to refsMatch.+ + Removed backslashEscape; added new functions escapeStringUsing and+ backslashEscapes.+ + Moved failIfStrict from markdown reader, since it is now used also+ by the HTML reader.+ + Added a 'try' to the definition of indentSpaces.+ + In definition of 'reference', added check to make sure it's not a note+ reference.+ + Added functions: camelCaseToHyphenated, toRomanNumeral,+ anyOrderedListMarker, orderedListmarker, orderedListMarkers,+ charsInBalanced', withHorizDisplacement, romanNumeral+ + Fixed a bug in the anyLine parser. Previously it would parse an empty+ string "", but it should fail on an empty string, or we get an error+ when it is used inside "many" combinators.+ + Removed followedBy' parser, replacing it with the lookAhead parser from+ Parsec.+ + Added some needed 'try's before multicharacter parsers, especially in+ 'option' contexts.+ + Removed the 'try' from the 'end' parser in 'enclosed', so that+ 'enclosed' behaves like 'option', 'manyTill', etc.+ + Added lineClump parser, which parses a raw line block up to and+ including any following blank lines.+ + Renamed parseFromStr to parseFromString.+ + Added a 'try' to the 'end' parser in 'enclosed'. This makes errors in+ the use of 'enclosed' less likely. Removed some now-unnecessary 'try's+ in calling code.+ + Removed unneeded 'try' in blanklines.+ + Removed endsWith function and rewrote calling functions to use+ isSuffixOf instead.+ + Added >>~ combinator.+ + Fixed bug in normalizeSpaces: Space:Str "":Space should compress to+ Space.++ * Refactored runtests.pl; added separate tests for tables.++ * Shell scripts:++ + Added -asxhtml flag to tidy in html2markdown. This will+ perhaps help the parser, which expects closing tags.+ + Modified markdown2pdf to run pdflatex a second time if --toc or+ --table-of-contents was specified; otherwise the table of+ contents won't appear.+ + Modified markdown2pdf to print a helpful message if the 'ulem'+ LaTeX package is required and not found.++ * Changes to build process:++ + Dropped support for compilation with GHC 6.4. GHC 6.6 or higher+ is now required.+ + Removed cabalize and Pandoc.cabal.in. The repository now contains+ pandoc.cabal itself.+ + Pandoc.cabal has been changed to pandoc.cabal, because HackageDB+ likes the cabal file to have the same name as the tarball.+ + Expanded and revised the package description in pandoc.cabal.+ Revised the package synopsis.+ + The tarball built by 'make tarball' now contains files built from+ templates (including man pages and shell scripts), so pandoc can+ be built directly using Cabal tools, without preprocessing.+ + Executable binaries are now stripped before installing.+ + Man pages are now generated from markdown sources, using pandoc's+ man page writer.+ + Use HTML version of README (instead of RTF) in Mac OS X installer.+ + Instead of testing for the existence of a pandoc symlink in build-exec,+ use ln -f.++ * Documentation:++ + Updated README and man pages with information on new features.+ + Updated INSTALL instructions with some useful clarifications and+ links.+ + Updated web content.++ * Added FreeBSD port.++ [ Recai Oktaş ]++ * debian/control:++ + Changed pandoc's Build-Depends to include libghc6-mtl-dev and+ libghc6-xhtml-dev. Removed libghc6-html-dev.+ + Suggest texlive-latex-recommended | tetex-extra instead of+ tetex-bin. This brings in fancyvrb and unicode support.+++## pandoc 0.3 (2007-01-05)++ [ John MacFarlane ]++ * Changes in pandoc options:++ + Allow options to follow or precede arguments.+ + Changed '--smartypants' to '--smart' and adjusted symbols accordingly.+ + Added '--strict' option.+ + Added '-o/--output' option.+ + Added '--dump-args' and '--ignore-args' options (for use in wrappers).+ + Modified '-v' and '-h' output to go to STDERR, not STDOUT, and return+ error conditions. This is helpful for writing wrappers.+ + Added copyright message to '-v' output, modeled after FSF messages.+ + Reformatted usage message so that it doesn't wrap illegibly.+ + Removed extra blanks after '-h' and '-D' output.++ * Added docbook writer.++ * Added implicit setting of default input and output format based+ on input and output filename extensions. These defaults are+ overridden if explicit input and output formats are specified using+ '-t', '-f', '-r', or '-w' options. Documented in pandoc(1) man page+ and README.++ * Allow ordered list items to begin with (single) letters, as well+ as numbers. The list item marker may now be terminated either by+ '.' or by ')'. This extension to standard markdown is documented+ in README.++ * Revised footnote syntax. (See README for full details.) The+ '[^1]' format now standard in markdown extensions is supported,+ as are inline footnotes with this syntax: `^[My note.]`.+ The earlier footnote syntax `^(1)` is no longer supported.++ * Improved HTML representation of footnotes. All footnotes+ are now auto-numbered and appear in an ordered list at the+ end of the HTML document. Since the default appearance is now+ acceptable, the old footnote styles have been removed from the+ HTML header.++ * Bug fixes:++ + Fixed a serious bug in the markdown, LaTeX, and RST readers.+ These readers ran 'runParser' on processed chunks of text to handle+ embedded block lists in lists and quotation blocks. But then+ any changes made to the parser state in these chunks was lost,+ as the state is local to the parser. So, for example, footnotes+ didn't work in quotes or list items. The fix: instead of calling+ runParser on some raw text, use setInput to make it the input, then+ parse it, then use setInput to restore the input to what it was+ before. This is shorter and more elegant, and it fixes the problem.+ + Fixed bug in notFollowedBy' combinator (adding 'try' before+ 'parser'). Adjusted code that uses this combinator accordingly.+ + Fixed bug in RTF writer that caused improper indentation on+ footnotes occurring in indented blocks like lists.+ + Fixed parsing of metadata in LaTeX reader. Now the title, author,+ and date are parsed correctly. Everything else in the preamble+ is skipped.+ + Modified escapedChar in LaTeX reader to allow a `\` at the end of a+ line to count as escaped whitespace.+ + Modified LaTeX reader to produce inline links rather than reference+ links. Otherwise, links in footnotes aren't handled properly.+ + Fixed handling of titles in links in Markdown reader, so that+ embedded quotation marks are now handled properly.+ + Fixed Markdown reader's handling of embedded brackets in links.+ + Fixed Markdown reader so that it only parses bracketed material+ as a reference link if there is actually a corresponding key.+ + Revised inline code parsing in Markdown reader to conform to+ markdown standard. Now any number of `s can begin inline code,+ which will end with the same number of `s. For example, to+ have two backticks as code, write ``` `` ```. Modified Markdown+ writer accordingly.+ + Fixed bug in text-wrapping routine in Markdown and RST writers.+ Now LineBreaks no longer cause wrapping problems.+ + Supported hexadecimal numerical entity references as well as+ decimal ones.+ + Fixed bug in Markdown reader's handling of underscores and other+ inline formatting markers inside reference labels: for example,+ in '[A_B]: /url/a_b', the material between underscores was being+ parsed as emphasized inlines.+ + Changed Markdown reader's handling of backslash escapes so that+ only non-alphanumeric characters can be escaped. Strict mode+ follows Markdown.pl in only allowing a select group of punctuation+ characters to be escaped.+ + Modified HTML reader to skip a newline following a `<br>` tag.+ Otherwise the newline will be treated as a space at the beginning+ of the next line.++ * Made handling of code blocks more consistent. Previously, some+ readers allowed trailing newlines, while others stripped them.+ Now, all readers strip trailing newlines in code blocks. Writers+ insert a newline at the end of code blocks as needed.++ * Modified readers to make spacing at the end of output more consistent.++ * Minor improvements to LaTeX reader:++ + `\thanks` now treated like a footnote.+ + Simplified parsing of LaTeX command arguments and options.+ commandArgs now returns a list of arguments OR options (in+ whatever order they appear). The brackets are included, and+ a new stripFirstAndLast function is provided to strip them off+ when needed. This fixes a problem in dealing with \newcommand+ and \newenvironment.++ * Revised RTF writer:++ + Default font is now Helvetica.+ + An `\f0` is added to each `\pard`, so that font resizing works+ correctly.++ * Moved handling of "smart typography" from the writers to the Markdown+ and LaTeX readers. This allows great simplification of the writers+ and more accurate smart quotes, dashes, and ellipses. DocBook can+ now use `<quote>`. The '--smart' option now toggles an option in+ the parser state rather than a writer option. Several new kinds+ of inline elements have been added: Quoted, Ellipses, Apostrophe,+ EmDash, EnDash.++ * Changes in HTML writer:++ + Include title block in header even when title is null.+ + Made javascript obfuscation of emails even more obfuscatory,+ by combining it with entity obfuscation.++ * Changed default ASCIIMathML text color to black.++ * Test suite:++ + Added --strip-trailing-cr option to diff in runtests.pl, for+ compatibility with Windows.+ + Added regression tests with footnotes in quote blocks and lists.++ * Makefile changes:++ + osx-pkg target creates a Mac OS X package (directory). New osx+ directory contains files needed for construction of the package.+ + osx-dmg target creates a compressed disk image containing the package.+ + win-pkg target creates Windows binary package.+ + tarball target creates distribution source tarball.+ + website target generates pandoc's website automatically, including+ demos. New 'web' directory contains files needed for construction+ of the website (which will be created as the 'pandoc' subdirectory+ of 'web').+ + Makefile checks to see if we're running Windows/Cygwin; if so,+ a '.exe' extension is added to each executable in EXECS.++ * Removed all wrappers except markdown2pdf and html2markdown.++ * Added new wrapper hsmarkdown, to be used as a drop-in replacement+ for Markdown.pl. hsmarkdown calls pandoc with the '--strict'+ option and disables other options.++ * Added code to html2markdown that tries to determine the character+ encoding of an HTML file, by parsing the "Content-type" meta tag.++ + If the encoding can't be determined, then if the content is local,+ the local encoding is used; if it comes from a URL, UTF-8 is used+ by default.+ + If input is from STDIN, don't try to determine character encoding.+ + Encoding can be specified explicitly using '-e' option.++ * Improved warning messages in wrappers:++ + Print warning if iconv not available+ + More user-friendly error messages in markdown2pdf, when+ pdflatex fails.++ * Code cleanup:++ + Renamed 'Text/Pandoc/HtmlEntities' module to+ 'Text/Pandoc/Entities'. Also changed function names so as+ not to be HTML-specific.+ + Refactored SGML string escaping functions from HTML and Docbook+ writers into Text/Pandoc/Shared. (escapeSGML, stringToSGML)+ + Removed 'BlockQuoteContext' from ParserContext, as it isn't+ used anywhere.+ + Removed splitBySpace and replaced it with a general, polymorphic+ splitBy function.+ + Refactored LaTeX reader for clarity (added isArg function).+ + Converted some CR's to LF's in src/ui/default/print.css.+ + Added license text to top of source files.+ + Added module data for haddock to source files.+ + Reformatted code for consistency.++ * Rewrote documentation and man pages. Split README into INSTALL+ and README.++ * Split LICENSE into COPYING and COPYRIGHT.++ * Removed TODO, since we now maintain ToDo on the wiki.++ * Made COPYRIGHT in top level a symlink to debian/copyright, to avoid+ duplication.++ [ Recai Oktaş ]++ * Revamped build process to conform to debian standards and created+ a proper debian package. Closes: #391666.++ * Modified build process to support GHC 6.6.++ + The package can still be compiled using GHC 6.4.2, though because+ of dependencies the "make deb" target works only with GHC 6.6+.+ + The script 'cabalize' is used to create an appropriate+ 'Pandoc.cabal' from 'Pandoc.cabal.in', depending on the GHC and+ Cabal versions.++ * Refactored template processing (fillTemplates.pl).++ * Modified wrapper scripts to make them more robust and portable.+ To avoid code duplication and ensure consistency, wrappers are+ generated via a templating system from templates in src/wrappers.++ + Wrappers now accept multiple filenames, when appropriate.+ + Spaces and tabs allowed in filenames.+ + getopts shell builtin is used for portable option parsing.+ + Improved html2markdown's web grabber code, making it more robust,+ configurable and verbose. Added '-e', '-g' options.+++## pandoc 0.2 (2006-08-14)++ * Fixed unicode/utf-8 translation++## pandoc 0.1 (2006-08-14)++ * Initial creation of debian package+
@@ -0,0 +1,1 @@+january|J\"anner|J\"an\adddot
@@ -0,0 +1,233 @@+bibliography|Bibliografia|Bibliografia+references|Refer\^encias|Refer\^encias+shorthands|Lista de abreviaturas|Abreviaturas+editor|editor|ed\adddot+editors|editores|ed\adddot+compiler|compilador|comp\adddot+compilers|compiladores|comp\adddot+redactor|redator|red\adddot+redactors|redatores|red\adddot+reviser|revisor|rev\adddot+revisers|revisores|rev\adddot+founder|fundador|fund\adddot+founders|fundadores|fund\adddot+continuator|continuador|cont\adddot+continuators|continuadores|cont\adddot+collaborator|colaborador|colab\adddot+collaborators|colaboradores|colab\adddot+translator|tradutor|trad\adddot+translators|tradutores|trad\adddot+commentator|coment\'ario|coment\adddot+commentators|coment\'ario|coment\adddot+annotator|notas|notas+annotators|notas|notas+commentary|coment\'ario|coment\adddot+annotations|notas|notas+foreword|pref\'acio|pref\adddot+afterword|posf\'acio|posf\adddot+organizer|organizador|org\adddot+organizers|organizadores|org\adddot+byauthor|por|por+byeditor|editado por|ed\adddotspace por+bycompiler|compilado por|comp\adddotspace por+byredactor|redigido por|red\adddotspace por+byreviser|revisado por|rev\adddotspace por+byreviewer|resenhado por|res\adddotspace por+byfounder|fundado por|fund\adddotspace por+bycontinuator|continuado por|cont\adddotspace por+bytranslator|traduzido \lbx@lfromlang\ por|trad\adddot\ \lbx@sfromlang\ por+bycommentator|comentado por|coment\adddot\ por+byannotator|anotado por|anot\adddot\ por+byorganizer|organizado por|org\adddotspace por+withcommentator|com coment\'ario de|com coment\adddot\ de+withannotator|com notas de|com notas de+withforeword|com pref\'acio de|com pref\adddot\ de+withafterword|com posf\'acio de|com posf\adddot\ de+and|e|e+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+andmore|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+volume|volume|vol\adddot+volumes|volumes|vol\adddot+involumes|em|em+jourvol|volume|v\adddot+jourser|s\'erie|s\'er\adddot+book|livro|livro+part|parte|parte+issue|n\'umero|n\'um\adddot+newseries|nova s\'erie|nova s\'er\adddot+oldseries|s\'erie antiga|s\'er\adddot\ antiga+reprint|reimpress\~ao|reimpr\adddot+reprintof|reimpress\~ao de|reimpr\adddotspace de+reprintas|reimpresso como|reimpr\adddotspace como+reprintfrom|reimpresso de|reimpr\adddotspace de+translationas|traduzido como|trad\adddotspace como+translationfrom|traduzido do|trad\adddotspace do+reviewof|resenha de|res\adddotspace de+origpubas|originalmente publicado como|orig\adddotspace pub\adddotspace como+origpubin|originalmente publicado em|orig\adddotspace pub\adddotspace em+astitle|como|como+bypublisher|por|por+nodate|sem\space data|s\adddot d\adddot+page|p\'agina|p\adddot+pages|p\'aginas|pp\adddot+column|coluna|col\adddot+columns|colunas|col\adddot+line|linha|l\adddot+lines|linhas|ll\adddot+verse|verso|v\adddot+verses|versos|vv\adddot+paragraph|par\'agrafo|par\adddot+paragraphs|par\'agrafos|par\adddot+pagetotal|p\'agina|p\adddot+pagetotals|p\'aginas|pp\adddot+columntotal|coluna|col\adddot+columntotals|colunas|col\adddot+linetotal|linha|l\adddot+linetotals|linhas|ll\adddot+versetotal|verso|v\adddot+versetotals|versos|vv\adddot+paragraphtotal|par\'agrafo|par\adddot+paragraphtotals|par\'agrafos|par\adddot+in|em|em+inseries|em|em+ofseries|de|de+number|n\'umero|n\adddot+chapter|cap\'\i tulo|cap\adddot+bathesis|trabalho de conclus\~ao|trab\adddotspace de conc\adddot+phdthesis|tese de doutorado|tese de dout\adddot+candthesis||+resreport|relat\'orio de pesquisa|rel\adddotspace de pesq\adddot+techreport|relat\'orio t\'ecnico|rel\adddotspace t\'ecn\adddot+software|software|software+datacd|CD-ROM|CD-ROM+audiocd|CD de \'audio|CD de \'audio+version|vers\~ao|vers\~ao+urlfrom|dispon\'ivel em|disp\adddotspace em+urlseen|acesso em|acesso em+submitted|submetido|submetido+inpress|no prelo|no prelo+prepublished|pr\'e-publicado|pr\'e-publicado+citedas|doravante citado como|doravante citado como+thiscite|especialmente|esp\adddot+seenote|ver nota|ver nota+quotedin|apud|apud+idem|idem|idem+idemsm|idem|idem+idemsf|eadem|eadem+idemsn|idem|idem+idempm|eidem|eidem+idempf|eaedem|eaedem+idempn|eadem|eadem+idempp|eidem|eidem+ibidem|ibidem|ibid\adddot+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot+confer|cf\adddot|cf\adddot+sequens|sq\adddot|sq\adddot+sequentes|sqq\adddot|sqq\adddot+passim|passim|passim+see|ver|ver+seealso|ver tamb\'em|ver tamb\'em+backrefpage|ver p\'agina|ver p\adddot+backrefpages|ver p\'aginas|ver pp\adddot+january|janeiro|jan\adddot+february|fevereiro|fev\adddot+april|abril|abr\adddot+may|maio|mai\adddot+june|junho|jun\adddot+july|julho|jul\adddot+august|agosto|ago\adddot+september|setembro|set\adddot+october|outubro|out\adddot+november|novembro|nov\adddot+december|dezembro|dez\adddot+langamerican|ingl\^es|ingl\^es+langbulgarian|b\'ulgaro|b\'ulgaro+langcatalan|catal\~ao|catal\~ao+langcroatian|croata|croata+langczech|tcheco|tcheco+langdanish|dinamarqu\^es|dinamarqu\^es+langenglish|ingl\^es|ingl\^es+langfinnish|finland\^es|finland\^es+langestonian|estoniano|estoniano+langfrench|franc\^es|franc\^es+langgalician|galego|galego+langgerman|alem\~ao|alem\~ao+langgreek|grego|grego+langhungarian|h\'ungaro|h\'ungaro+langitalian|italiano|italiano+langjapanese|japon\^es|japon\^es+langlatin|latim|latim+langlatvian|let\~ao|let\~ao+langlithuanian|lituano|lituano+langnorwegian|noruegu\^es|noruegu\^es+langpolish|polon\^es|polon\^es+langrussian|russo|russo+langserbian|s\'ervio|s\'ervio+langslovak|eslovaco|eslovaco+langslovene|esloveno|esloveno+langspanish|espanhol|espanhol+langswedish|sueco|sueco+langturkish|turco|turco+langukrainian|ucraniano|ucraniano+fromamerican|do ingl\^es|do ingl\^es+frombulgarian|do b\'ulgaro|do b\'ulgaro+fromcatalan|do catal\~ao|do catal\~ao+fromcroatian|do croata|do croata+fromczech|do tcheco|do tcheco+fromdanish|do dinamarqu\^es|do dinamarqu\^es+fromenglish|do ingl\^es|do ingl\^es+fromestonian|do estoniano|do estoniano+fromfinnish|do finland\^es|do finland\^es+fromfrench|do franc\^es|do franc\^es+fromgalician|do galego|do galego+fromgerman|do alem\~ao|do alem\~ao+fromgreek|do grego|do grego+fromhungarian|do h\'ungaro|do h\'ungaro+fromitalian|do italiano|do italiano+fromjapanese|do japon\^es|do japon\^es+fromlatin|do latim|do latim+fromlatvian|do let\~ao|do let\~ao+fromlithuanian|do lituano|do lituano+fromnorwegian|do noruegu\^es|do noruegu\^es+frompolish|do polon\^es|do polon\^es+fromrussian|do russo|do russo+fromserbian|do s\'ervio|do s\'ervio+fromslovak|do eslovaco|do eslovaco+fromslovene|do esloveno|do esloveno+fromspanish|do espanhol|do espanhol+fromswedish|do sueco|do sueco+fromturkish|do turco|do turco+fromukrainian|do ucraniano|do ucraniano+countryde|Alemanha|DE+countryeu|Uni\~ao Europeia|EU+countryep|Uni\~ao Europeia|EP+countryuk|Reino Unido|GB+countryus|Estados Unidos|US+patent|patente|pat\adddot+patentde|patente alem\~a|pat\adddot\ alem\~a+patenteu|patente europeia|pat\adddot\ europeia+patentfr|patente francesa|pat\adddot\ francesa+patentuk|patente brit\^anica|pat\adddot\ brit\^anica+patentus|patente americana|pat\adddot\ americana+patreq|pedido de patente|ped\adddot\ de pat\adddot+patreqde|pedido de patente alem\~a|ped\adddot\ de pat\adddot\ alem\~a+patreqeu|pedido de patente europeia|ped\adddot\ de pat\adddot\ europeia+patreqfr|pedido de patente francesa|ped\adddot\ de pat\adddot\ francesa+patrequk|pedido de patente brit\^anica|ped\adddot\ de pat\adddot\ brit\^anica+patrequs|pedido de patente americana|ped\adddot\ de pat\adddot\ americana+file|arquivo|arquivo+library|biblioteca|biblioteca+abstract|resumo|resumo+annotation|notas|notas+commonera|Era Comum|EC+beforecommonera|antes da Era Comum|AEC+annodomini|depois de Cristo|d\adddot C\adddot+beforechrist|antes de Cristo|a\adddot C\adddot+circa|circa|ca\adddot+spring|primavera|primavera+summer|ver\~ao|ver\~ao+autumn|outono|outono+winter|inverno|inverno+am|AM|AM+pm|PM|PM
@@ -0,0 +1,3 @@+organizer|organiser|org\adddot+organizers|organisers|orgs\adddot+byorganizer|organised by|org\adddotspace by
@@ -0,0 +1,28 @@+bibliography|Библиография|Библиография+references|Литература|Литература+shorthands|Списък на съкращенията|Съкращения+editor|редактор|ред\adddot+editors|редактори|ред\adddot+compiler|съставител|съст\adddot+compilers|съставители|съст\adddot+redactor|редактор|ред\adddot+redactors|редактори|ред\adddot+reviser|коректор|кор\adddotspace кор\adddot+revisers|коректор|кор\adddotspace кор\adddot+founder|основател|осн\adddot+founders|основатели|осн\adddot+continuator|продължител|прод\adddot+continuators|продължител|прод\adddot+collaborator|участник|участ\adddot+collaborators|участници|участ\adddot+translator|преводач|прев\adddot+translators|преводачи|прев\adddot+commentator|коментатор|комент\adddot+commentators|коментатори|комент\adddot+annotator|бележки|бел\adddot+annotators|бележки|бел\adddot+commentary|комментар|комент\adddot+annotations|бележки|бел\adddot+introduction|уводна статия|ув\adddotspace ст\adddot+foreword|предговор|предг\adddot+afterword|послеслов|послесл\adddot
@@ -0,0 +1,158 @@+bibliography|Bibliografia|Bibliografia+references|Refer\`encies|Refer\`encies+shorthands|Llista d'abreviatures|Abreviatures+editor|editor|ed\adddot+editors|editors|ed\adddot+compiler|compilador|comp\adddot+compilers|compiladors|comp\adddot+redactor|redactor|red\adddot+redactors|redactors|red\adddot+reviser|revisor|rev\adddot+revisers|revisors|rev\adddot+founder|fundador|fund\adddot+founders|fundadors|fund\adddot+continuator|continuador|cont\adddot+continuators|continuadors|cont\adddot+collaborator|co\l.laborador|co\l.l\adddot+collaborators|co\l.laboradors|co\l.l\adddot+translator|traductor|trad\adddot+translators|traductors|trad\adddot+commentator|comentarista|com\adddot+commentators|comentaristes|com\adddot+annotator|anotador|anot\adddot+annotators|anotadors|anot\adddot+commentary|comentari|com\adddot+annotations|notes|n\adddot+introduction|introducci\'o|intr\adddot+foreword|pr\`oleg|pr\`ol\adddot+editortr|editor i traductor|ed\adddotspace i trad\adddot+editorstr|editors i traductors|ed\adddotspace i trad\adddot+editorco|editor i comentarista|ed\adddotspace i com\adddot+editorsco|editors i comentaristes|ed\adddotspace i com\adddot+editoran|editor i anotador|ed\adddotspace i anot\adddot+editorsan|editors i anotadors|ed\adddotspace i anot\adddot+organizer|organitzador|org\adddot+organizers|organitzadors|org\adddot+byorganizer|organitzat per|org\adddotspace per+byauthor|per|per+byeditor|edici\'o a cura \smartof|ed\adddotspace\smartof+bycompiler|compilaci\'o a cura \smartof|comp\adddotspace\smartof+byredactor|redacci\'o a cura \smartof|red\adddotspace\smartof+byreviser|revisi\'o a cura \smartof|rev\adddotspace\smartof+byreviewer|ressenya a cura \smartof|ress\adddotspace\smartof+byfounder|fundat per|fund\adddotspace per+bycontinuator|continuat per|cont\adddotspace per+bycollaborator|amb la co\l.laboraci\'o \smartof|amb la co\l.l\adddotspace\smartof+bytranslator|traducci\'o \lbx@fromlang\ a cura \smartof|trad\adddotspace\lbx@fromlang\ \smartof+bycommentator|comentari a cura \smartof|com\adddotspace\smartof+byannotator|notes a cura \smartof|n\adddotspace\smartof+withcommentator|amb un comentari a cura \smartof|amb un com\adddotspace\smartof+withannotator|amb notes a cura \smartof|amb n\adddotspace\smartof+withintroduction|amb una introducci\'o a cura \smartof|amb una intr\adddotspace\smartof+withforeword|amb un pr\`oleg a cura \smartof|amb un pr\`ol\adddotspace\smartof+and|i|i+andothers|et al\adddot|et al\adddot+andmore|i m\'es|i m\'es+volume|volum|vol\adddot+volumes|volums|vol\adddot+involumes|en|en+jourvol|volum|vol\adddot+jourser|s\`erie|s\`er\adddot+book|llibre|llib\adddot+part|part|part+issue|n\'umero|n\'um\adddot+newseries|s\`erie nova|s\`erie nova+oldseries|s\`erie antiga|s\`erie ant\adddot+edition|edici\'o|ed\adddot+reprint|reimpressi\'o|reimpr\adddot+reprintof|reimpressi\'o \smartof|reimpr\adddotspace\smartof+reprintas|reimpr\`es com|reimpr\adddotspace com+reprintfrom|reimpr\`es \smartof|reimpr\adddotspace\smartof+reviewof|ressenya \smartof|ress\adddotspace\smartof+translationof|traducci\'o \smartof|trad\adddotspace\smartof+origpubas|publicat origin\`ariament com|pub\adddotspace orig\adddotspace com+origpubin|publicat origin\`ariament el|pub\adddotspace orig\adddotspace el+astitle|com|com+bypublisher|per|per+page|p\`agina|p\`ag\adddot+pages|p\`agines|p\`ag\adddot+column|columna|col\adddot+columns|columnes|cols\adddot+nodate|sine data|s\adddotspace d\adddot+verse|vers|v\adddot+verses|versos|v\adddot+section|apartat|\S+sections|apartats|\S+paragraph|par\`agraf|\P+paragraphs|par\`agrafs|\P+pagetotal|p\`agina|p\`ag\adddot+pagetotals|p\`agines|p\`ag\adddot+columntotal|columna|col\adddot+columntotals|columnes|col\adddot+versetotal|vers|v\adddot+versetotals|versos|v\adddot+sectiontotal|secci\'o|\S+sectiontotals|seccions|\S+paragraphtotal|par\`agrafs|\P+paragraphtotals|par\`agrafs|\P+in|a|a+inseries|a|a+ofseries|\smartof|\smartof+number|n\'umero|n\'um\adddot+bathesis|treball final de grau|treb\adddotspace fin\adddotspace de gr\adddot+mathesis|treball final de m\`aster|treb\adddotspace fin\adddotspace de m\`ast\adddot+phdthesis|tesi doctoral|tesi doct\adddot+candthesis|tesi de candidatura|tesi de cand\adddot+resreport|informe de recerca|inf\adddotspace de rec\adddot+techreport|informe t\`ecnic|inf\adddotspace t\`ec\adddot+software|programari|prog\adddot+datacd|CD de dades|CD de dades+audiocd|CD d'\`audio|CD d'\`audio+version|versi\'o|vers\adddot+urlfrom|disponible a|disp\adddotspace a+urlseen|consultat|cons\adddot+inpreparation|en preparaci\'o|en prep\adddot+inpress|a impremta|a impr\adddot+prepublished|pre-publicat|pre-publicat+submitted|enviat a publicar|env\adddotspace a pub\adddot+forthcoming|properament|prop\adddot+citedas|d'ara endavant citat com|d'ara end\adddotspace cit\adddotspace com+thiscite|concretament|concr\adddot+seenote|vegeu la nota|v\adddotspace la n\adddot+quotedin|citat a|cit\adddotspace a+opcit|\`op\adddotspace cit\adddot|\`op\adddotspace cit\adddot+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot+confer|cf\adddot|cf\adddot+sequens|seq\adddot|seq\adddot+sequentes|et seq\adddot|et seq\adddot+passim|p\`assim|p\`assim+see|vegeu|v\adddot+seealso|vegeu tamb\'e|v\adddotspace tamb\'e+backrefpage|vegeu la p\`agina|v\adddotspace la p\`ag\adddot+backrefpages|vegeu les p\`agines|v\adddotspace les p\`ag\adddot+january|gener|gen\adddot+february|febrer|febr\adddot+april|abril|abr\adddot+may|maig|maig+june|juny|juny+july|juliol|jul\adddot+august|agost|ag\adddot+september|setembre|set\adddot+october|octubre|oct\adddot+november|novembre|nov\adddot+december|desembre|des\adddot+langamerican|angl\`es americ\`a|ang\adddotspace amer\adddot+langbrazilian|portugu\`es brasiler|port\adddotspace bras\adddot+langbulgarian|b\'ulgar|b\'ulg\adddot+langcatalan|catal\`a|cat\adddot+langczech|txec|txec+langcroatian|croat|croat+langdanish|dan\`es|dan\adddot+langdutch|neerland\`es|neerl\adddot+langenglish|angl\`es|ang\adddot+langestonian|estoni\`a|eston\adddot+langfinnish|fin\`es|fin\adddot+langfrench|franc\`es|fr\adddot+langgalician|gallec|gal\adddot+langgerman|alemany|al\adddot+langgreek|grec|grec
@@ -0,0 +1,214 @@+bibliography|Bibliografija|Bibliografija+references|Literatura|Literatura+shorthands|Popis kratica|Kratice+editor|urednik|ur\adddot+editors|urednici|ur\adddot+redactor|redaktor|redaktor+redactors|redaktori|redaktori+reviser|korektor|korektor+revisers|korektori|korektori+collaborator|suradnik|sur\adddot+collaborators|suradnici|sur\adddot+translator|prijevod|prev\adddot+translators|prijevod|prev\adddot+commentator|komentator|komentator+commentators|komentatori|komentatori+commentary|komentar|komentar+introduction|uvod|uvod+foreword|predgovor|predgovor+afterword|pogovor|pogovor+editortr|prijevod i obrada|ur\adddotspace i prev\adddot+editorstr|prijevod i obrada|ur\adddotspace i prev\adddot+organizer|organizacija|organizacija+organizers|organizacija|organizacija+byorganizer|organizacija|organizacija+byauthor|autor|autor+byeditor|obrada|ur\adddot+byredactor|redaktura|red\adddot+byreviser|korektura|kor\adddot+byreviewer|recenzija|recenzija+bycontinuator|nastavio|nastavio+bycollaborator|u suradnji s|u sur\adddotspace s+bycommentator|komentari|komentari+withcommentator|komentari|komentari+withintroduction|uvod|uvod+withforeword|predgovor|predgovor+withafterword|pogovor|pogovor+and|i|i+andothers|i drugi|i dr\adddot+andmore|i drugi|i dr\adddot+volume|sv\adddot|sv\adddot+volumes|sv\adddot|sv\adddot+involumes|u|u+jourvol|sv\adddot|sv\adddot+jourser|serija|serija+book|knjiga|knj\adddot+part|dio|dio+issue|izd\adddot|izd\adddot+newseries|nova serija|nova serija+oldseries|stara serija|stara serija+edition|izdanje|izdanje+reprint|pretisak|pretisak+reprintof|pretisak|pretisak+reprintas|iznova otisnuto kao|iznova otisnuto kao+reprintfrom|iznova otisnut|iznova otisnut+translationof|prijevod|prijevod+translationas|prev\adddotspace kao|prev\adddotspace kao+translationfrom|prijevod|prijevod+reviewof|osvrt na|osvrt na+origpubas|izvorno obj\adddotspace kao|izv\adddotspace obj\adddotspace kao+origpubin|izvorno obj\adddot|izv\adddotspace obj\adddot+astitle|kao|kao+bypublisher||+nodate|bez datuma|bez datuma+page|stranica|str\adddot+pages|stranice|str\adddot+column|stupac|stupac+columns|stupci|stupci+line|linija|l\adddot+lines|linije|ll\adddot+verse|stih|stih+verses|stihovi|stihovi+section|odjeljak|\S+sections|odjeljci|\S\S+paragraph|stavak|st\adddot+paragraphs|stavci|st\adddot+pagetotal|str\adddot|str\adddot+pagetotals|str\adddot|str\adddot+columntotal|stupac|stupac+columntotals|stupaca|stupaca+linetotal|linija|lin\adddot+linetotals|linija|lin\adddot+versetotal|stih|st\adddot+versetotals|stihova|st\adddot+sectiontotal|odjeljak|odj\adddot+sectiontotals|odjeljaka|odj\adddot+paragraphtotal|stavak|st\adddot+paragraphtotals|stavaka|st\adddot+in||+inseries|u seriji|u seriji+ofseries|iz serije|iz serije+number|broj|br\adddot+chapter|poglavlje|pogl\adddot+bathesis|diplomski rad|dipl\adddotspace rad+mathesis|magistarski rad|mag\adddotspace rad+phdthesis|doktorska disertacija|disertacija+software|softver|softver+datacd|CD-ROM|CD-ROM+audiocd|audio CD|audio CD+version|verzija|verzija+url|adresa|adresa+urlfrom|dostupno na|dost\adddotspace na+urlseen|pogledano|pogledano+inpreparation|u pripremi|u pripremi+submitted|predan|predan+inpress|u tisku|u tisku+prepublished|pred objavom|pred obj\adddot+citedas|dalje citirano kao|dalje citirano kao+thiscite|napose|napose+quotedin|citirano u|citirano u+idem|idem|idem+idemsm|idem|idem+idemsf|eadem|eadem+idemsn|idem|idem+idempm|eidem|eidem+idempf|eaedem|eaedem+idempn|eadem|eadem+idempp|eidem|eidem+ibidem|ibidem|ibid\adddot+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot+confer|usporedi|usp\adddot+sequens|sq\adddot|sq\adddot+sequentes|sqq\adddot|sqq\adddot+passim|passim|pass\adddot+see|vidi|v\adddot+seealso|pogledaj i|pogl\adddotspace i+backrefpage|citirano na stranci|cit\adddotspace na str\adddot+backrefpages|cited on pages|cit\adddotspace na str\adddot+april|travanj|travanj+may|svibanj|svibanj+june|lipanj|lipanj+july|srpanj|srpanj+august|kolovoz|kolovoz+september|rujan|rujan+october|listopad|listopad+november|studeni|studeni+december|prosinac|prosinac+dateapril|travnja|travnja+datemay|svibnja|svibnja+datejune|lipnja|lipnja+datejuly|srpnja|srpnja+dateaugust|kolovoza|kolovoza+dateseptember|rujna|rujna+dateoctober|listopada|listopada+datenovember|studenoga|studenoga+datedecember|prosinca|prosinca+langamerican|engleski|engleski+langbrazilian|portugalski|portugalski+langbulgarian|bugarski|bugarski+langcatalan|katalonski|katalonski+langcroatian|hrvatski|hrvatski+langdanish|danski|danski+langdutch|nizozemski|nizozemski+langenglish|engleski|engleski+langestonian|estonski|estonski+langfinnish|finski|finski+langfrench|francuski|francuski+langgalician|galicijski|galicijski+langhungarian|ma\dj arski|ma\dj arski+langitalian|talijanski|talijanski+langjapanese|japanski|japanski+langlatin|latinski|latinski+langlatvian|letonski|letonski+langpolish|poljski|poljski+langportuguese|portugalski|portugalski+langrussian|ruski|ruski+langslovene|slovenski|slovenski+langukrainian|ukrajinski|ukrajinski+fromamerican|s engleskog|s engleskog+frombrazilian|s portugalskog|s portugalskog+frombulgarian|s bugarskog|s bugarskog+fromcatalan|s katalonskog|s katalonskog+fromcroatian|s hrvatskog|s hrvatskog+fromdanish|s danskog|s danskog+fromdutch|s nizozemskog|s nizozemskog+fromenglish|s engleskog|s engleskog+fromestonian|s estonskog|s estonskog+fromfinnish|s finskog|s finskog+fromfrench|s francuskog|s francuskog+fromgalician|s galicijskog|s galicijskog+fromhungarian|s ma\dj arskog|s ma\dj arskog+fromitalian|s talijanskog|s talijanskog+fromjapanese|s japanskog|s japanskog+fromlatin|s latinskog|s latinskog+fromlatvian|s letonskog|s letonskog+frompolish|s poljskog|s poljskog+fromportuguese|s portugalskog|s portugalskog+fromrussian|s ruskog|s ruskog+fromslovene|sa slovenskog|sa slovenskog+fromukrainian|s ukrajinskog|s ukrajinskog+countryeu|Europska unija|EU+countryep|Europska unija|EP+countryfr|Francuska|FR+countryuk|Velika Britanija|GB+patent|patent|pat\adddot+patenteu|europski patent|europski pat\adddot+patentfr|francuski patent|francuski pat\adddot+patentuk|britanski patent|britanski pat\adddot+patentus|US patent|US pat\adddot+patreq|patentni zahtjev|pat\adddot\ zahtjev+patreqeu|europski patentni zahtjev|EU pat\adddotspace zahtjev+patrequs|US patentni zahtjev|US pat\adddot\ zahtjev+file|datoteka|datoteka+library|biblioteka|biblioteka+commonera|n\adddotspace e\adddot|n\adddotspace e\adddot+beforecommonera|pr\adddotspace n\adddotspace e\adddot|pr\adddotspace n\adddotspace e\adddot+annodomini|poslije Krista|p\adddotspace Kr\adddot+beforechrist|prije Krista|pr\adddotspace Kr\adddot+circa|oko|cca\adddot+summer|ljeto|ljeto+autumn|jesen|jesen+winter|zima|zima+am|prije podne|AM+pm|poslije podne|PM
@@ -0,0 +1,91 @@+bibliography|Bibliografie|Bibliografie+references|Odkazy|Odkazy+shorthands|Seznam zkratek|Zkratky+editor|editor|ed\adddot+compiler|sestavil|sest\adddot+compilers|sestavili|sest\adddot+redactor|redaktor|red\adddot+reviser|korektor|kor\adddot+founder|zakladatel|zakl\adddot+annotations|anotace|anot\adddot+afterword|doslov|dosl\adddot+byauthor||+bycompiler|sestaveno|sest\adddot+withannotator|s\addnbspace anotacemi od|s\addnbspace anot\adddot\ od+withafterword|s\addnbspace doslovem od|s\addnbspace dosl\adddot\ od+and|a|a+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+andmore|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+volume|svazek|sv\adddot+volumes|svazky|sv\adddot+involumes|in|in+book|kniha|kniha+reprint|dotisk|dotisk+reprintof|dotisk|dotisk+reprintas|dotisknuto jako|dotisknuto jako+reprintfrom|dotisknuto z\addnbspace|dotisknuto z\addnbspace+reviewof|recenze|recenz\adddot+astitle|jako|jako+bypublisher||+page|strana|s\adddot+pages|strany|s\adddot+column|sloupec|sl\adddot+columns|sloupce|sl\adddot+section|sekce|\S+sections|sekce|\S\S+paragraph|odstavec|ods\adddot+paragraphs|odstavce|ods\adddot+pagetotal|strana|s\adddot+pagetotals|strany|s\adddot+columntotal|sloupec|sl\adddot+columntotals|sloupce|sl\adddot+sectiontotal|sekce|\S+sectiontotals|sekce|\S\S+paragraphtotal|odstavec|ods\adddot+paragraphtotals|odstavce|ods\adddot+in|in|in+inseries|in|in+ofseries|z|z+chapter|kapitola|kap\adddot+datacd|CD-ROM|CD-ROM+audiocd|audio CD|audio CD+version|verze|ver\adddot+url|URL|URL+inpress|v\addnbspace tisku|v\addnbspace tisku+idem|idem|idem+idemsm|idem|idem+idemsf|eadem|eadem+idemsn|idem|idem+idempm|eidem|eidem+idempf|eaedem|eaedem+idempn|eadem|eadem+idempp|eidem|eidem+ibidem|ibidem|ibid\adddot+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot+confer|cf\adddot|cf\adddot+sequens|sq\adddot|sq\adddot+sequentes|sqq\adddot|sqq\adddot+passim|passim|pass\adddot+see|viz|viz+january|leden|led\adddot+april|duben|dub\adddot+august|srpen|srp\adddot+november|listopad|lis\adddot+december|prosinec|pros\adddot+langlatin|latina|lat\adddot+fromlatin|z\addnbspace latiny|z\addnbspace lat\adddot+countryfr|Francie|FR+patent|patent|pat\adddot+patentus|US patent|US pat\adddot+file|soubor|soub\adddot+library|knihovna|knih\adddot+abstract|abstrakt|abst\adddot+annotation|anotace|anot\adddot+annodomini|po Kristu|po Kr\adddot+circa|cirka|ca\adddot+spring|jaro|jaro+autumn|podzim|podzim+winter|zima|zima+am|AM|AM+pm|PM|PM
@@ -0,0 +1,106 @@+bibliography|Bibliografi|Bibliografi+references|Litteraturhenvisninger|Litteratur+shorthands|Forkortelser|Forkortelser+editor|redakt\o r|red\adddot+editors|redakt\o rer|red\adddot+compiler|kompilator|kompilator+compilers|kompilatorer|kompilatorer+redactor|medredakt\o r|medred\adddot+redactors|medredakt\o rer|medred\adddot+reviser|revision|rev\adddot+revisers|revision|rev\adddot+founder|stifter|stifter+founders|stiftere|stiftere+continuator|videref\o rer|videref\adddot+continuators|videref\o rere|videref\adddot+collaborator|medarbejder|medarb\adddot+collaborators|medarbejdere|medarb\adddot+translator|overs\ae tter|overs\adddot+translators|overs\ae ttere|overs\adddot+commentator|kommentator|komm\adddot+commentators|kommentatorer|komm\adddot+annotator|kommentator|komm\adddot+annotators|kommentatorer|komm\adddot+commentary|kommentar|komm\adddot+annotations|annoteringer|ann\adddot+introduction|indledning|indl\adddot+foreword|forord|forord+afterword|efterord|efterord+organizer|organisator|org\adddot+organizers|organisatorer|org\adddot+byorganizer|organiseret af|org\adddotspace av+byauthor|af|af+byeditor|redigeret af|red\adddotspace af+bycompiler|kompileret af|komp\adddotspace af+byredactor|bearbejdet af|bearb\adddotspace af+byreviser|revideret af|rev\adddotspace af+byreviewer|bed\o mt af|bed\adddotspace af+byfounder|stiftet af|stiftet af+bycontinuator|videref\o rt af|videref\adddotspace af+bycollaborator|i samarbejde med|i samarb\adddotspace m\adddot+bycommentator|kommenteret af|komm\adddot\ af+byannotator|annoteret af|ann\adddot\ af+withcommentator|med kommentarer af|m\adddotspace komm\adddot\ af+withannotator|med annoteringer af|m\adddotspace ann\adddot\ af+withintroduction|med indledning af|m\adddotspace indl\adddot\ af+withforeword|med forord af|m\adddotspace forord af+withafterword|med efterord af|m\adddotspace efterord af+and|og|og+andothers|med flere|m.fl\adddot+andmore|med mere|m.m\adddot+volume|bind|bd\adddot+volumes|bind|bd\adddot+involumes|i|i+jourvol|\aa rgang|\aa rg\adddot+jourser|r\ae kke|rk\adddot+book|bog|bog+part|del|del+issue|nummer|nr\adddot+newseries|ny r\ae kke|ny rk\adddot+oldseries|gammel r\ae kke|gl. rk\adddot+edition|udgave|udg\adddot+reprint|genoptryk|genoptr\adddot+reprintof|genoptryk af|genoptr\adddot\ af+reprintas|genoptryk under titlen|genoptr\adddot\ under titlen+reprintfrom|genoptryk fra|genoptr\adddot\ fra+translationof|overs\ae ttelse af|overs\adddot\ af+translationas|oversat under titlen|overs\adddotspace\ under titlen+translationfrom|oversat fra|overs\adddotspace\ fra+reviewof|bed\o mmelse af|bed\adddotspace af+origpubas|oprindeligt udgivet som|opr\adddot\ udg\adddot\ som+origpubin|oprindeligt udgivet i|opr\adddot\ udg\adddot\ i+astitle|under titlen|under titlen+bypublisher|af|af+nodate|uden \aa rstal|u.\aa\adddot+page|side|s\adddot+pages|sider|s\adddot+column|spalte|sp\adddot+columns|spalter|sp\adddot+line|linje|l\adddot+lines|linjer|l\adddot+verse|vers|v\adddot+verses|vers|v\adddot+section|paragraf|par\adddot+sections|paragraffer|par\adddot+paragraph|afsnit|afsn\adddot+paragraphs|afsnit|afsn\adddot+pagetotal|side|s\adddot+pagetotals|sider|s\adddot+columntotal|spalte|sp\adddot+columntotals|spalter|sp\adddot+line|linje|l\adddot+lines|linjer|l\adddot+verse|vers|v\adddot+verses|vers|v\adddot+linetotal|linje|l\adddot+linetotals|linje|l\adddot+versetotal|vers|v\adddot+versetotals|vers|v\adddot+sectiontotal|paragraf|par\adddot+sectiontotals|paragraffer|par\adddot+paragraphtotal|afsnit|afsn\adddot+paragraphtotals|afsnit|afsn\adddot+in|i|i+inseries|i r\ae kken|i rk\adddot+ofseries|fra r\ae kken|fra rk\adddot+number|nummer|nr\adddot
@@ -0,0 +1,23 @@+bibliography|Bibliografie|Bibliografie+references|Referenties|Referenties+shorthands|Lijst van afkortingen|Afkortingen+editor|redacteur|red\adddot+editors|redacteurs|red\adddot+compiler|samensteller|samenst\adddot+compilers|samenstellers|samenst\adddot+founder|oprichter|opr\adddot+founders|oprichters|opr\adddot+continuator|opvolger|opv\adddot+continuators|opvolgers|opv\adddot+redactor|redacteur|red\adddot+redactors|redacteuren|red\adddot+reviser|revisor|rev\adddot+revisers|revisors|rev\adddot+collaborator|medewerker|med\adddot+collaborators|medewerkers|med\adddot+translator|vertaler|vert\adddot+translators|vertalers|vert\adddot+commentator|commentator|comm\adddot+commentators|commentatoren|comm\adddot+annotator|annotator|annot\adddot+annotators|annotatoren|annot\adddot
@@ -0,0 +1,254 @@+bibliography|Bibliography|Bibliography+references|References|References+shorthands|List of Abbreviations|Abbreviations+editor|editor|ed\adddot+editors|editors|eds\adddot+compiler|compiler|comp\adddot+compilers|compilers|comp\adddot+redactor|redactor|red\adddot+redactors|redactors|red\adddot+reviser|reviser|rev\adddot+revisers|revisers|rev\adddot+founder|founder|found\adddot+founders|founders|found\adddot+continuator|continued|cont\adddot+continuators|continued|cont\adddot+collaborator|collaborator|collab\adddot+collaborators|collaborators|collab\adddot+translator|translator|trans\adddot+translators|translators|trans\adddot+commentator|commentator|comm\adddot+commentators|commentators|comm\adddot+annotator|annotator|annot\adddot+annotators|annotators|annot\adddot+commentary|commentary|comm\adddot+annotations|annotations|annot\adddot+introduction|introduction|intro\adddot+foreword|foreword|forew\adddot+afterword|afterword|afterw\adddot+organizer|organizer|org\adddot+organizers|organizers|orgs\adddot+byorganizer|organized by|org\adddotspace by+byauthor|by|by+byeditor|edited by|ed\adddotspace by+bycompiler|compiled by|comp\adddotspace by+byredactor|redacted by|red\adddotspace by+byreviser|revised by|rev\adddotspace by+byreviewer|reviewed by|rev\adddotspace by+byfounder|founded by|found\adddotspace by+bycontinuator|continued by|cont\adddotspace by+bycollaborator|in collaboration with|in collab\adddotspace with+bytranslator|translated \lbx@lfromlang\ by|trans\adddot\ \lbx@sfromlang\ by+bycommentator|commented by|comm\adddot\ by+byannotator|annotated by|annot\adddot\ by+withcommentator|with a commentary by|with a comment\adddot\ by+withannotator|with annotations by|with annots\adddot\ by+withintroduction|with an introduction by|with an intro\adddot\ by+withforeword|with a foreword by|with a forew\adddot\ by+withafterword|with an afterword by|with an afterw\adddot\ by+and|and|and+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+andmore|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+volume|volume|vol\adddot+volumes|volumes|vols\adddot+involumes|in|in+jourvol|volume|vol\adddot+jourser|series|ser\adddot+book|book|book+part|part|part+issue|issue|issue+newseries|new series|new ser\adddot+oldseries|old series|old ser\adddot+edition|edition|ed\adddot+reprint|reprint|repr\adddot+reprintof|reprint of|repr\adddotspace of+reprintas|reprinted as|rpt\adddotspace as+reprintfrom|reprinted from|repr\adddotspace from+reviewof|review of|rev\adddotspace of+translationof|translation of|trans\adddotspace of+translationas|translated as|trans\adddotspace as+translationfrom|translated from|trans\adddotspace from+origpubas|originally published as|orig\adddotspace pub\adddotspace as+origpubin|originally published in|orig\adddotspace pub\adddotspace in+astitle|as|as+bypublisher|by|by+nodate|no date|n\adddot d\adddot+page|page|p\adddot+pages|pages|pp\adddot+column|column|col\adddot+columns|columns|cols\adddot+line|line|l\adddot+lines|lines|ll\adddot+verse|verse|v\adddot+verses|verses|vv\adddot+section|section|\S+sections|sections|\S\S+paragraph|paragraph|par\adddot+paragraphs|paragraphs|par\adddot+pagetotal|page|p\adddot+pagetotals|pages|pp\adddot+columntotal|column|col\adddot+columntotals|columns|cols\adddot+linetotal|line|l\adddot+linetotals|lines|ll\adddot+versetotal|verse|v\adddot+versetotals|verses|vv\adddot+sectiontotal|section|\S+sectiontotals|sections|\S\S+paragraphtotal|paragraph|par\adddot+paragraphtotals|paragraphs|par\adddot+in|in|in+inseries|in|in+ofseries|of|of+number|number|no\adddot+chapter|chapter|chap\adddot+bathesis|Bachelor's thesis|BA\addabbrvspace thesis+mathesis|Master's thesis|MA\addabbrvspace thesis+phdthesis|PhD\addabbrvspace thesis|PhD\addabbrvspace thesis+candthesis|Candidate thesis|Cand\adddotspace thesis+resreport|research report|research rep\adddot+techreport|technical report|tech\adddotspace rep\adddot+software|computer software|comp\adddotspace software+datacd|CD-ROM|CD-ROM+audiocd|audio CD|audio CD+version|version|version+url|address|address+urlfrom|available from|available from+urlseen|visited on|visited on+inpreparation|in preparation|in preparation+submitted|submitted|submitted+forthcoming|forthcoming|forthcoming+inpress|in press|in press+prepublished|pre-published|pre-published+citedas|henceforth cited as|henceforth cited as+thiscite|especially|esp\adddot+seenote|see note|see n\adddot+quotedin|quoted in|qtd\adddotspace in+idem|idem|idem+idemsm|idem|idem+idemsf|eadem|eadem+idemsn|idem|idem+idempm|eidem|eidem+idempf|eaedem|eaedem+idempn|eadem|eadem+idempp|eidem|eidem+ibidem|ibidem|ibid\adddot+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot+confer|cf\adddot|cf\adddot+sequens|sq\adddot|sq\adddot+sequentes|sqq\adddot|sqq\adddot+passim|passim|pass\adddot+see|see|see+seealso|see also|see also+backrefpage|cited on page|cit\adddotspace on p\adddot+backrefpages|cited on pages|cit\adddotspace on pp\adddot+january|January|Jan\adddot+february|February|Feb\adddot+march|March|Mar\adddot+april|April|Apr\adddot+may|May|May+june|June|June+july|July|July+august|August|Aug\adddot+september|September|Sept\adddot+october|October|Oct\adddot+november|November|Nov\adddot+december|December|Dec\adddot+langamerican|American|American+langbrazilian|Brazilian|Brazilian+langbulgarian|Bulgarian|Bulgarian+langcatalan|Catalan|Catalan+langcroatian|Croatian|Croatian+langczech|Czech|Czech+langdanish|Danish|Danish+langdutch|Dutch|Dutch+langenglish|English|English+langestonian|Estonian|Estonian+langfinnish|Finnish|Finnish+langfrench|French|French+langgalician|Galician|Galician+langgerman|German|German+langgreek|Greek|Greek+langhungarian|Hungarian|Hungarian+langitalian|Italian|Italian+langjapanese|Japanese|Japanese+langlatin|Latin|Latin+langlatvian|Latvian|Latvian+langlithuanian|Lithuanian|Lithuanian+langnorwegian|Norwegian|Norwegian+langpolish|Polish|Polish+langportuguese|Portuguese|Portuguese+langrussian|Russian|Russian+langserbian|Serbian|Serbian+langslovak|Slovak|Slovak+langslovene|Slovene|Slovene+langspanish|Spanish|Spanish+langswedish|Swedish|Swedish+langturkish|Turkish|Turkish+langukrainian|Ukrainian|Ukrainian+fromamerican|from the American|from the American+frombrazilian|from the Brazilian|from the Brazilian+frombulgarian|from the Bulgarian|from the Bulgarian+fromcatalan|from the Catalan|from the Catalan+fromcroatian|from the Croatian|from the Croatian+fromczech|from the Czech|from the Czech+fromdanish|from the Danish|from the Danish+fromdutch|from the Dutch|from the Dutch+fromenglish|from the English|from the English+fromestonian|from the Estonian|from the Estonian+fromfinnish|from the Finnish|from the Finnish+fromfrench|from the French|from the French+fromgalician|from the Galician|from the Galician+fromgerman|from the German|from the German+fromgreek|from the Greek|from the Greek+fromhungarian|from the Hungarian|from the Hungarian+fromitalian|from the Italian|from the Italian+fromjapanese|from the Japanese|from the Japanese+fromlatin|from the Latin|from the Latin+fromlatvian|from the Latvian|from the Latvian+fromlithuanian|from the Lithuanian|from the Lithuanian+fromnorwegian|from the Norwegian|from the Norwegian+frompolish|from the Polish|from the Polish+fromportuguese|from the Portuguese|from the Portuguese+fromrussian|from the Russian|from the Russian+fromserbian|from the Serbian|from the Serbian+fromslovak|from the Slovak|from the Slovak+fromslovene|from the Slovene|from the Slovene+fromspanish|from the Spanish|from the Spanish+fromswedish|from the Swedish|from the Swedish+fromturkish|from the Turkish|from the Turkish+fromukrainian|from the Ukrainian|from the Ukrainian+countryde|Germany|DE+countryeu|European Union|EU+countryep|European Union|EP+countryfr|France|FR+countryuk|United Kingdom|GB+countryus|United States of America|US+patent|patent|pat\adddot+patentde|German patent|German pat\adddot+patenteu|European patent|European pat\adddot+patentfr|French patent|French pat\adddot+patentuk|British patent|British pat\adddot+patentus|U.S\adddotspace patent|U.S\adddotspace pat\adddot+patreq|patent request|pat\adddot\ req\adddot+patreqde|German patent request|German pat\adddot\ req\adddot+patreqeu|European patent request|European pat\adddot\ req\adddot+patreqfr|French patent request|French pat\adddot\ req\adddot+patrequk|British patent request|British pat\adddot\ req\adddot+patrequs|U.S\adddotspace patent request|U.S\adddotspace pat\adddot\ req\adddot+file|file|file+library|library|library+abstract|abstract|abstract+annotation|annotations|annotations+commonera|Common Era|CE+beforecommonera|Before Common Era|BCE+annodomini|Anno Domini|AD+beforechrist|Before Christ|BC+circa|circa|ca\adddot+spring|Spring|Spr\adddot+summer|Summer|Sum\adddot+autumn|Autumn|Aut\adddot+winter|Winter|Win\adddot+am|AM|AM+pm|PM|PM
@@ -0,0 +1,178 @@+bibliography|bibliograafia|bibliograafia+references|viited|viited+editor|toimetaja|toim\adddot+editors|toimetajad|toim\adddot+compiler|koostaja|koost\adddot+compilers|koostajad|koost\adddot+redactor|toimetaja|toim\adddot+redactors|toimetajad|toim\adddot+reviser|toimetaja|toim\adddot+revisers|toimetajad|toim\adddot+founder|asutaja|asutaja+founders|asutajad|asutajad+commentator|kommenteerija|kommenteerija+commentators|kommenteerijad|kommenteerijad+annotator|kommenteerija|kommenteerija+annotators|kommenteerijad|kommenteerijad+commentary|kommentaarid|kommentaarid+annotations|kommentaarid|kommentaarid+introduction|sissejuhatus|sissejuhatus+organizer|korraldaja|korraldaja+organizers|korraldajad|korraldajad+byorganizer|korraldanud|korraldanud+byauthor|kirjutanud|kirj\adddot+byeditor|toimetanud|toim\adddot+bycompiler|koostanud|koost\adddot+byredactor|toimetanud|toim\adddot+byreviewer|vaadanud|vaadanud+byfounder|asutanud|asutanud+bycommentator|kommenteerinud|kommenteerinud+byannotator|kommenteerinud|kommenteerinud+withcommentator|koos kommentaaridega|koos kommentaaridega+withannotator|koos kommentaaridega|koos kommentaaridega+withintroduction|koos tutvustusega|koos tutvustusega+and|ja|ja+involumes|osas|osas+jourser|seeria|seeria+book|raamat|raamat+part|osa|osa+issue|number|nr\adddot+newseries|uus seerias|uus seer\adddot+oldseries|vana seeria|vana seer\adddot+reviewof|arvustus teosest|arvustus teosest+origpubas|algselt avaldatud kui|algselt avaldatud kui+origpubin|algselt avaldatud aastal|algselt avaldatud aastal+astitle|pealkirjaga|pealkirjaga+column|veerg|veerg+columns|veerud|veerud+line|rida|rida+lines|read|read+verse|salm|salm+verses|salmid|salmid+section|jagu|jagu+sections|jaod|jaod+columntotal|veerge kokku|veerge kokku+columntotals|veergusid kokku|veergusid kokku+linetotal|ridu kokku|ridu kokku+linetotals|ridasid kokku|ridasid kokku+versetotal|salmi kokku|salmi kokku+versetotals|salmesid kokku|salmesid kokku+sectiontotal|jagusid kokku|jagusid kokku+sectiontotals|jagusid kokku|jagusid kokku+in|teoses|teoses+inseries|sarjas|sarjas+ofseries|sarjast|sarjast+number|number|nr+resreport|uuringuraport|uuringuraport+techreport|tehniline raport|tehniline raport+software|tarkvara|tarkvara+datacd|CD-ROM|CD-ROM+audiocd|audioplaat|audioplaat+version|versioon|versioon+url|aadress|aadress+urlfrom|saadaval|saadaval+urlseen|vaadatud|vaadatud+inpreparation|koostamisel|koostamisel+submitted|esitatud|esitatud+forthcoming|tulevases|tulevases+citedas|edaspidi viidatud kui|edaspidi viidatud kui+thiscite|eriti|eriti+quotedin|noteeritud|noteeritud+see|vaata|vt+seealso|vaata ka|vt ka+backrefpage|viidatud lehel|viidatud lehel+january|jaanuar|jaanuar+february|veebruar|veebruar+april|aprill|aprill+may|mai|mai+june|juuni|juuni+july|juuli|juuli+august|august|august+september|september|september+october|oktoober|oktoober+november|november|november+december|detsember|detsember+langamerican|Ameerika inglise keel|Ameerika inglise keel+langbrazilian|brasiilia keel|brasiilia keel+langbulgarian|bulgaaria keel|bulgaaria keel+langcatalan|katalaani keel|katalaani keel+langcroatian|horvaadi keel|horvaadi keel+langdanish|taani keel|taani keel+langdutch|hollandi keel|hollandi keel+langenglish|inglise keel|inglise keel+langestonian|eesti keel|eesti keel+langfinnish|soome keel|soome keel+langfrench|prantsuse keel|prantsuse keel+langgalician|galeegi keel|galeegi keel+langgerman|saksa keel|saksa keel+langgreek|kreeka keel|kreeka keel+langhungarian|ungari keel|ungari keel+langitalian|itaalia keel|itaalia keel+langjapanese|jaapani keel|jaapani keel+langlatin|ladina keel|ladina keel+langnorwegian|norra keel|norra keel+langpolish|poola keel|poola keel+langportuguese|portugali keel|portugali keel+langrussian|vene keel|vene keel+langslovak|slovakia keel|slovakia keel+langslovene|sloveeni keel|sloveeni keel+langspanish|hispaania keel|hispaania keel+langswedish|rootsi keel|rootsi keel+langukrainian|ukraina keel|ukraina keel+fromamerican|Ameerika inglise keelest|Ameerika inglise keelest+frombrazilian|brasiilia keelest|brasiilia keelest+frombulgarian|bulgaaria keelest|bulgaaria keelest+fromcatalan|katalani keelest|kalatalani keelest+fromcroatian|horvaadi keelest|horvaadi keelest+fromdanish|taani keelest|taani keelest+fromdutch|hollandi keelest|hollandi keelest+fromenglish|inglise keelest|inglise keelest+fromestonian|eesti keelest|eesti keelest+fromfinnish|soome keelest|soome keelest+fromfrench|prantsuse keelest|prantsuse keelest+fromgalician|galeegi keelest|galeegi keelest+fromgerman|saksa keelest|saksa keelest+fromgreek|kreeka keelest|kreeka keelest+fromhungarian|ungari keelest|ungari keelest+fromitalian|itaalia keelest|itaalia keelest+fromjapanese|jaapani keelest|jaapani keelest+fromlatin|ladina keelest|ladina keelest+fromnorwegian|norra keelest|norra keelest+fromportuguese|portugali keelest|portugali keelest+fromrussian|vene keelest|vene keelest+fromslovak|slovakia keelest|slovakia keelest+fromslovene|sloveenia keelest|sloveenia keelest+fromspanish|hispaania keelest|hispaania keelest+fromswedish|rootsi keelest|rootsi keelest+fromukrainian|ukraina keelest|ukraina keelest+countryde|Saksamaa|DE+countryeu|Euroopa Liit|EL+countryep|Euroopa Parlament|EP+countryfr|Prantsusmaa|FR+countryuk|Suurbritannia|GB+countryus|Ameerika|US+patent|patent|pat\adddot+patentde|Saksa patent|Saksa pat\adddot+patenteu|Euroopa patent|Euroopa pat\adddot+patentfr|Prantsuse patent|Prantsuse pat\adddot+patentuk|Briti patent|Briti pat\adddot+patentus|U.S\adddotspace patent|U.S\adddotspace pat\adddot+patreq|patendi taotlus|pat\adddotspace taotl\adddot+patreqde|Saksa patendi taotlus|Saksa pat\adddotspace taotl\adddot+patreqeu|Euroopa patendi taotlus|Euroopa pat\adddotspace taotl\adddot+patreqfr|Prantsuse patendi taotlus|Prantsuse pat\adddotspace taotl\adddot+patrequk|Briti patendi taotlus|Briti pat\adddotspace taotl\adddot+patrequs|U.S\adddotspace patendi taotlus.|U.S\adddotspace pat\adddotspace taotl\adddot+file|fail|fail+library|raamatukogu|raamatukogu+abstract|teesid|teesid+annotation|kommentaarid|kommentaarid+commonera|meie ajaarvamise j\"argi|m\adddot a\adddot j+beforecommonera|enne meie ajaarvamist|e\adddot m\adddot a+annodomini|p\"arast Kristust|pKr+beforechrist|enne Kristust|eKr+spring|kevadel|kevadel+summer|suvel|suvel+winter|talvel|talvel+am|AM|AM+pm|PM|PM
@@ -0,0 +1,254 @@+bibliography|Kirjallisuusluettelo|Kirjallisuus+references|Viitteet|Viitteet+shorthands|Lyhenteet|Lyhenteet+editor|toimittanut|toim\adddot+editors|toimittaneet|toim\adddot+compiler|koontanut|koontanut+compilers|koontaneet|koontaneet+redactor|toimittanut|toim\adddot+redactors|toimittaneet|toim\adddot+reviser|toimittanut|toim\adddot+revisers|toimittaneet|toim\adddot+founder|perustaja|perustaja+founders|perustajat|perustajat+continuator|jatkaja|jatkaja+continuators|jatkajat|jatkajat+collaborator|avustaja|avustaja+collaborators|avustajat|avustajat+translator|k\"a\"ant\"anyt|k\"a\"ant\adddot+translators|k\"a\"ant\"anyt|k\"a\"ant\adddot+commentator|kommentaarin kirjoittanut|kommentaarin kirjoittanut+commentators|kommentaarin kirjoittaneet|kommentaarin kirjoittaneet+annotator|selityksin varustanut|selityksin varustanut+annotators|selityksin varustaneet|selityksin varustaneet+commentary|kommentaari|kommentaari+annotations|selitykset|selitykset+introduction|johdanto|johdanto+foreword|esipuhe|esipuhe+afterword|j\"alkisanat|j\"alkisanat+organizer|toimittanut|toim\adddot+organizers|toimittaneet|toim\adddot+byorganizer|toimittanut|toim\adddot+byauthor|kirjoittanut|kirj\adddot+byeditor|toimittanut|toim\adddot+bycompiler|koontanut|koontanut+byredactor|toimittanut|toim\adddot+byreviser|toimittanut|toim\adddot+byreviewer|toimittanut|toim\adddot+byfounder|perustanut|perustanut+bycontinuator|jatkanut|jatkanut+bycollaborator|yhteisty\"oss\"a|yhteisty\"oss\"a+bytranslator|\lbx@lfromlang k\"a\"ant\"anyt|\lbx@sfromlang k\"a\"ant\adddot+bycommentator|kommentaarin kirjoittanut|kommentaarin kirjoittanut+byannotator|selityksin varustanut|selityksin varustanut+withcommentator|kommentaarin kirjoittanut|kommentaarin kirjoittanut+withannotator|selityksin varustanut|selityksin varustanut+withintroduction|johdannon kirjottanut|johdannon kirjottanut+withforeword|esipuheen kirjoittanut|esipuheen kirjoittanut+withafterword|j\"alkisanat kirjoittanut|j\"alkisanat kirjoittanut+and|ja|ja+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+andmore|jne\adddot|jne\adddot+volume|volyymi|vol\adddot+volumes|volyymit|vol\adddot+involumes||+jourvol|volyymi|vol\adddot+jourser|sarja|sarja+book|kirja|kirja+part|osa|osa+issue|numero|numero+newseries|uusi sarja|uusi sarja+oldseries|vanha sarja|vanha sarja+edition|painos|painos+reprint|j\"alkipainos|j\"alkipainos+reprintof|julkaistu aiemmin nimell\"a|julkaistu aiemmin nimell\"a+reprintas|julkaistu uudelleen nimell\"a|julkaistu uudelleen nimell\"a+reprintfrom|julkaistu aiemmin nimell\"a|julkaistu aiemmin nimell\"a+translationof|k\"a\"ann\"os teoksesta|k\"a\"ann\"os teoksesta+translationas|k\"a\"annetty nimell\"a|k\"a\"annetty nimell\"a+translationfrom|k\"a\"annetty kielest\"a|k\"a\"annetty kielest\"a+reviewof|arvostelu teoksesta|arvostelu teoksesta+origpubas|julkaistu ensi kerran nimell\"a|julkaistu ensi kerran nimell\"a+origpubin|julkaistu ensi kerran vuonna|julkaistu ensi kerran vuonna+astitle|nimell\"a|nimell\"a+bypublisher|julkaissut|julkaissut+page|sivu|s\adddot+pages|sivut|s\adddot+column|palsta|palsta+columns|palstat|palstat+line|rivi|rivi+lines|rivit|rivit+nodate|ei julkaisup\"aiv\"a\"a|ei julkaisup\"aiv\"a\"a+verse|s\"ae|s\"ae+verses|s\"akeet|s\"akeet+section|kohta|kohta+sections|kohdat|kohdat+paragraph|kappale|kappale+paragraphs|kappaleet|kappaleet+pagetotal|sivu|s\adddot+pagetotals|sivut|s\adddot+columntotal|palsta|palsta+columntotals|palstat|palstat+linetotal|rivi|rivi+linetotals|rivit|rivit+versetotal|s\"ae|s\"ae+versetotals|s\"akeet|s\"akeet+sectiontotal|kohta|kohta+sectiontotals|kohdat|kohdat+paragraphtotal|kappale|kappale+paragraphtotals|kappaleet|kappaleet+in|teoksessa|teoksessa+inseries|sarjassa|sarjassa+ofseries|sarjassa|sarjassa+number|numero|nro+chapter|luku|luku+bathesis|tutkielma|tutkielma+mathesis|tutkielma|tutkielma+phdthesis|tohtorinv\"ait\"oskirja|tohtorinv\"ait\"oskirja+candthesis|kanditaatintutkielma|kanditaatintutkielma+resreport|tutkimusraportti|tutkimusraportti+techreport|tekninen raportti|tekninen raportti+software|ohjelmisto|ohjelmisto+datacd|data-CD|data-CD+audiocd|\"a\"ani-CD|\"a\"ani-CD+version|versio|versio+url|url|url+urlfrom|saatavilla osoitteesta|saatavilla osoitteesta+urlseen|viitattu|viitattu+inpreparation|valmisteilla|valmisteilla+submitted|l\"ahetetty|l\"ahetetty+forthcoming|hyv\"aksytty julkaistavaksi|hyv\"aksytty julkaistavaksi+inpress|painossa|painossa+prepublished|esijulkaistu|esijulkaistu+citedas|jatkossa|jatkossa+thiscite|sama|sama+seenote|katso viite|katso viite+quotedin|lainattu teoksessa|lainattu teoksessa+idem|idem|id\adddot+idemsf|idem|id\adddot+idemsm|idem|id\adddot+idemsn|idem|id\adddot+idempf|idem|id\adddot+idempm|idem|id\adddot+idempn|idem|id\adddot+idempp|idem|id\adddot+ibidem|ibidem|ibid\adddot+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot+confer|cf\adddot|cf\adddot+sequens|sq\adddot|sq\adddot+sequentes|sqq\adddot|sqq\adddot+passim|passim|pass\adddot+see|katso|ks\adddot+seealso|katso my\"os|katso my\"os+backrefpage|katso sivu|ks\adddotspace s\adddot+backrefpages|katso sivut|ks\adddotspace s\adddot+january|tammikuuta|tammikuuta+february|helmikuuta|helmikuuta+march|maaliskuuta|maaliskuuta+april|huhtikuuta|huhtikuuta+may|toukokuuta|toukokuuta+june|kes\"akuuta|kes\"akuuta+july|hein\"akuuta|hein\"akuuta+august|elokuuta|elokuuta+september|syyskuuta|syyskuuta+october|lokakuuta|lokakuuta+november|marraskuuta|marraskuuta+december|joulukuuta|joulukuuta+basicjanuary|tammikuu|tammikuu+basicfebruary|helmikuu|helmikuu+basicmarch|maaliskuu|maaliskuu+basicapril|huhtikuu|huhtikuu+basicmay|toukokuu|toukokuu+basicjune|kes\"akuu|kes\"akuu+basicjuly|hein\"akuu|hein\"akuu+basicaugust|elokuu|elokuu+basicseptember|syyskuu|syyskuu+basicoctober|lokakuu|lokakuu+basicnovember|marraskuu|marraskuu+basicdecember|joulukuu|joulukuu+langamerican|amerikanenglanti|amerikanenglanti+langbrazilian|brasilianportugali|brasilianportugali+langbulgarian|bulgaria|bulgaria+langcatalan|katalonia|katalonia+langcroatian|kroatia|kroatia+langdanish|tanska|tanska+langdutch|hollanti|hollanti+langenglish|englanti|englanti+langestonian|viro|viro+langfinnish|suomi|suomi+langfrench|ranska|ranska+langgalician|galicia|galicia+langgerman|saksa|saksa+langgreek|kreikka|kreikka+langhungarian|unkari|unkari+langitalian|italia|italia+langlatin|latina|latina+langlatvian|latvia|latvia+langnorwegian|norja|norja+langpolish|puola|puola+langportuguese|portugali|portugali+langrussian|ven\"aj\"a|ven\"aj\"a+langslovak|slovakia|slovakia+langslovene|slovenia|slovenia+langspanish|espanja|espanja+langswedish|ruotsi|ruotsi+fromamerican|englannin kielest\"a|englannin kielest\"a+frombrazilian|portugalin kielest\"a|portugalin kielest\"a+frombulgarian|bulgarian kielest\"a|bulgarian kielest\"a+fromcatalan|katalonian kielest\"a|katalonian kielest\"a+fromcroatian|kroatian kielest\"a|kroatian kielest\"a+fromdanish|tanskan kielest\"a|tanskan kielest\"a+fromdutch|hollannin kielest\"a|hollannin kielest\"a+fromenglish|englannin kielest\"a|englannin kielest\"a+fromestonian|viron kielest\"a|viron kielest\"a+fromfinnish|suomen kielest\"a|suomen kielest\"a+fromfrench|ranskan kielest\"a|ranskan kielest\"a+fromgalician|galician kielest\"a|galician kielest\"a+fromgerman|saksan kielest\"a|saksan kielest\"a+fromgreek|kreikan kielest\"a|kreikan kielest\"a+fromhungarian|unkarin kielest\"a|unkarin kielest\"a+fromitalian|italian kielest\"a|italian kielest\"a+fromlatin|latinan kielest\"a|latinan kielest\"a+fromlatvian|latvian kielest\"a|latvian kielest\"a+fromnorwegian|norjan kielest\"a|norjan kielest\"a+frompolish|puolan kielest\"a|puolan kielest\"a+fromportuguese|portugalin kielest\"a|portugalin kielest\"a+fromrussian|ven\"aj\"an kielest\"a|ven\"aj\"an kielest\"a+fromslovak|slovakian kielest\"a|slovakian kielest\"a+fromslovene|slovenian kielest\"a|slovenian kielest\"a+fromspanish|espanjan kielest\"a|espanjan kielest\"a+fromswedish|ruotsin kielest\"a|ruotsin kielest\"a+countryde|Saksa|DE+countryeu|Euroopan Unioni|EU+countryep|Euroopan Unioni|EP+countryfr|Ranska|FR+countryuk|Iso-Britannia|GB+countryus|Yhdysvallat|US+patent|patentti|pat\adddot+patentde|saksalainen patentti|saksalainen pat\adddot+patenteu|Euroopan Unionin patentti|Euroopan Unionin pat\adddot+patentfr|ranskalainen patentti|ranskalainen pat\adddot+patentuk|isobritannialainen patentti|isobritannialainen pat\adddot+patentus|yhdysvaltalainen patentti|yhdysvaltalainen pat\adddot+patreq|patenttihakemus|pat\adddot\ hak\adddot+patreqde|saksalainen patenttihakemus|saksalainen pat\adddot\ hak\adddot+patreqeu|Euroopan Unionin patenttihakemus|Euroopan Unionin pat\adddot\ hak\adddot+patreqfr|ranskalainen patenttihakemus|ranskalainen pat\adddot\ hak\adddot+patrequk|isobritannialainen patenttihakemus|isobritannialainen pat\adddot\ hak\adddot+patrequs|yhdysvaltalainen patenttihakemus|yhdysvaltalainen pat\adddot\ hak\adddot+file|tiedosto|tiedosto+library|kirjasto|kirjasto+abstract|tiivistelm\"a|tiivistelm\"a+annotation|selitykset|selitykset+commonera|j\"alkeen ajanlaskun alun|jaa\adddot+beforecommonera|ennen ajanlaskun alkua|eaa\adddot+annodomini|j\"alkeen Kristuksen syntym\"an|jKr\adddot+beforechrist|ennen Kristuksen syntym\"a\"a|eKr\adddot+circa|noin|n\adddot+spring|kev\"at|kev\"at+summer|kes\"a|kes\"a+autumn|syksy|syksy+winter|talvi|talvi+am|ap\adddot|ip\adddot+pm|ip\adddot|ip\adddot
@@ -0,0 +1,245 @@+bibliography|Bibliographie|Bibliographie+references|R\'ef\'erences|R\'ef\'erences+shorthands|Liste des abr\'eviations|Abr\'eviations+editor|\'editeur|\'ed\adddot+editors|\'editeurs|\'ed\adddot+compiler|compilateur|comp\adddot+compilers|compilateurs|comp\adddot+redactor|r\'edacteur|r\'ed\adddot+redactors|r\'edacteurs|r\'ed\adddot+reviser|r\'eviseur|r\'ev\adddot+revisers|r\'eviseurs|r\'ev\adddot+founder|fondateur|fond\adddot+founders|fondateurs|fond\adddot+continuator|continuateur|cont\adddot+continuators|continuateurs|cont\adddot+collaborator|collaborateur|coll\adddot+collaborators|collaborateurs|coll\adddot+translator|traducteur|trad\adddot+translators|traducteurs|trad\adddot+commentator|commentateur|comm\adddot+commentators|commentateurs|comm\adddot+annotator|annotateur|annot\adddot+annotators|annotateurs|annot\adddot+commentary|commentaires|comment\adddot+annotations|annotations|annot\adddot+introduction|introduction|introd\adddot+foreword|pr\'eface|pr\'ef\adddot+afterword|postface|postf\adddot+editortr|\'editeur et traducteur|\'ed\adddotspace et trad\adddot+editorstr|\'editeurs et traducteurs|\'ed\adddotspace et trad\adddot+organizer|organisateur|org\adddot+organizers|organisateurs|org\adddot+byorganizer|organis\'e par|org\adddotspace par+byauthor|par|par+byeditor|sous la direction \smartof|sous la dir\adddotspace\smartof+bycompiler|compil\'e par|comp\adddotspace par+byredactor|r\'edig\'e par|r\'ed\adddotspace par+byreviser|r\'evis\'e par|r\'ev\adddotspace par+byreviewer|examin\'e par|ex\adddotspace par+byfounder|d\'ecouvert par|d\'ecouv\adddotspace par+bycontinuator|continu\'e par|cont\adddotspace par+bytranslator|traduit \lbx@lfromlang\ par|trad\adddotspace \lbx@sfromlang\ par+bycommentator|comment\'e par|comm\adddotspace par+byannotator|annot\'e par|annot\adddotspace par+withcommentator|avec des commentaires \smartof|avec des comment\adddotspace\smartof+withannotator|avec des annotations \smartof|avec des annot\adddotspace\smartof+withintroduction|avec une introduction \smartof|avec une introd\adddotspace\smartof+withforeword|avec une pr\'eface \smartof|avec une pr\'ef\adddotspace\smartof+withafterword|avec une postface \smartof|avec une postf\adddotspace\smartof+and|et|et+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+andmore|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+volume|tome|t\adddot+volumes|tomes|t\adddot+involumes|en|en+jourvol|tome|t\adddot+jourser|s\'erie|s\'er\adddot+book|livre|livre+part|partie|partie+issue|\'edition|\'ed\adddot+newseries|nouvelle s\'erie|nouv\adddotspace s\'er\adddot+oldseries|ancienne s\'erie|anc\adddotspace s\'er\adddot+edition|\'edition|\'ed\adddot+reprint|r\'eimpression|r\'eimpr\adddot+reprintof|r\'eimpression de|r\'eimpr\adddotspace de+reprintas|r\'eimpression sous le titre|r\'eimpr\adddotspace sous le titre+reprintfrom|r\'eimpression \`a partir \smartof|r\'eimpr\adddotspace \`a part\adddotspace\smartof+translationof|traduction de|trad\adddotspace de+translationas|traduit sous le titre|trad\adddotspace sous le titre+translationfrom|traduit de|trad\adddotspace de+reviewof|critique de|crit.\adddotspace de+origpubas|publi\'e \`a l'origine sous le titre|pub\adddotspace \`a l'orig\adddotspace sous le titre+origpubin|publi\'e \`a l'origine en|pub\adddotspace \`a l'orig\adddotspace en+astitle|sous le titre|sous le titre+bypublisher|par|par+page|page|p\adddot+pages|pages|p\adddot+column|colonne|col\adddot+columns|colonnes|col\adddot+line|ligne|l\adddot+lines|lignes|l\adddot+verse|vers|v\adddot+verses|vers|v\adddot+section|section|sect\adddot+sections|sections|sect\adddot+paragraph|paragraphe|\S+paragraphs|paragraphes|\S+pagetotal|page|p\adddot+pagetotals|pages|p\adddot+columntotal|colonne|col\adddot+columntotals|colonnes|col\adddot+linetotal|ligne|l\adddot+linetotals|lignes|l\adddot+versetotal|vers|v\adddot+versetotals|vers|v\adddot+sectiontotal|section|sect\adddot+sectiontotals|sections|sect\adddot+paragraphtotal|paragraphe|\S+paragraphtotals|paragraphes|\S+in|in|in+inseries|in|in+ofseries|de|de+number|num\'ero|n\textsuperscript{o+chapter|chapitre|chap\adddot+bathesis|m\'emoire de bachelor|m\'em\adddotspace de bach\adddot+mathesis|m\'emoire de master|m\'em\adddotspace de mast\adddot+phdthesis|th\`ese de doctorat|th\`ese de doct\adddot+candthesis|th\`ese de candidature|th\`ese de cand\adddot+resreport|rapport scientifique|rapp\adddotspace scient\adddot+techreport|rapport technique|rapp\adddotspace tech\adddot+software|logiciel|logiciel+datacd|c\'ed\'erom|c\'ed\'erom+audiocd|disque compact audio|CD+version|version|version+url|adresse|adresse+urlfrom|disponible \`a l'adresse|disp\adddotspace \`a l'adr\adddot+urlseen|visit\'e le|visit\'e le+inpreparation|en pr\'eparation|en pr\'ep\adddot+submitted|soumis|soumis+inpress|sous presse|sous presse+prepublished|pr\'epubli\'e|pr\'epubl\adddot+citedas|d\'esign\'e ci-apr\`es par|ci-apr\`es+thiscite|sp\'ecialement|sp\'ec\adddot+seenote|voir note|cf\adddotspace note+quotedin|cit\'e dans|cit\'e dans+idem|idem|idem+idemsm|idem|idem+idemsf|eadem|eadem+idemsn|idem|idem+idempm|eidem|eidem+idempf|eaedem|eaedem+idempn|eadem|eadem+idempp|eidem|eidem+ibidem|ibidem|ibid\adddot+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot+confer|cf\adddot|cf\adddot+sequens|sq\adddot|sq\adddot+sequentes|sqq\adddot|sqq\adddot+passim|passim|pass\adddot+see|cf\adddot|cf\adddot+seealso|cf\adddotspace aussi|cf\adddotspace aussi+backrefpage|cf\adddotspace page|cf\adddotspace p\adddot+backrefpages|cf\adddotspace pages|cf\adddotspace p\adddot+january|janvier|jan\adddot+february|f\'evrier|f\'ev\adddot+march|mars|mars+april|avril|avr\adddot+may|mai|mai+june|juin|juin+july|juillet|juill\adddot+august|ao\^ut|ao\^ut+september|septembre|sept\adddot+october|octobre|oct\adddot+november|novembre|nov\adddot+december|d\'ecembre|d\'ec\adddot+langamerican|am\'ericain|am\'ericain+langbrazilian|br\'esilien|br\'esilien+langbulgarian|bulgare|bulgare+langcatalan|catalan|catalan+langcroatian|croate|croate+langczech|tch\`eque|tch\`eque+langdanish|danois|danois+langdutch|n\'eerlandais|n\'eerlandais+langenglish|anglais|anglais+langestonian|estonien|estonien+langfinnish|finnois|finnois+langgalician|galicien|galicien+langgerman|allemand|allemand+langgreek|grec|grec+langhungarian|hongrois|hongrois+langitalian|italien|italien+langjapanese|japonais|japonais+langlatin|latin|latin+langlatvian|letton|letton+langnorwegian|norv\'egien|norv\'egien+langpolish|polonais|polonais+langportuguese|portugais|portugais+langrussian|russe|russe+langserbian|serbe|serbe+langslovak|slovaque|slovaque+langslovene|slov\`ene|slov\`ene+langspanish|espagnol|espagnol+langswedish|su\'edois|su\'edois+langukrainian|ukrainien|ukrainien+fromamerican|de l'am\'ericain|de l'am\'ericain+frombrazilian|du br\'esilien|du br\'esilien+frombulgarian|du bulgare|du bulgare+fromcatalan|du catalan|du catalan+fromcroatian|du croate|du croate+fromczech|du tch\`eque|du tch\`eque+fromdanish|du danois|du danois+fromdutch|du n\'eerlandais|du n\'eerlandais+fromenglish|de l'anglais|de l'anglais+fromestonian|de l'estonien|de l'estonien+fromfinnish|du finnois|du finnois+fromgalician|du galicien|du galicien+fromgerman|de l'allemand|de l'allemand+fromgreek|du grec|du grec+fromhungarian|du hongrois|du hongrois+fromitalian|de l'italien|de l'italien+fromjapanese|du japonais|du japonais+fromlatin|du latin|du latin+fromlatvian|du letton|du letton+fromnorwegian|du norv\'egien|du norv\'egien+frompolish|du polonais|du polonais+fromportuguese|du portugais|du portugais+fromrussian|du russe|du russe+fromserbian|du serbe|du serbe+fromslovak|du slovaque|du slovaque+fromslovene|du slov\`ene|du slov\`ene+fromspanish|de l'espagnol|de l'espagnol+fromswedish|du su\'edois|du su\'edois+fromukrainian|de l'ukrainien|de l'ukrainien+countryde|Allemagne|DE+countryeu|Union europ\'eenne|EU+countryep|Union europ\'eenne|EP+countryfr|France|FR+countryuk|Royaume-Uni|GB+countryus|\'Etats-Unis|US+patent|brevet|brev\adddot+patentde|brevet allemand|brev\adddotspace allem\adddot+patenteu|brevet europ\'een|brev\adddotspace europ\adddot+patentuk|brevet britannique|brev\adddotspace brit\adddot+patentus|brevet am\'ericain|brev\adddotspace am\'er\adddot+patreq|demande de brevet|demande de brev\adddot+patreqde|demande de brevet allemand|demande de brev\adddotspace allem\adddot+patreqeu|demande de brevet europ\'een|demande de brev\adddotspace europ\adddot+patrequk|demande de brevet britannique|demande de brev\adddotspace brit\adddot+patrequs|demande de brevet am\'ericain|demande de brev\adddotspace am\'er\adddot+file|fichier|fichier+library|biblioth\`eque|biblioth\adddot+abstract|r\'esum\'e|r\'es\adddot+annotation|annotations|annotations+commonera|de l'\`ere commune|EC+beforecommonera|avant l'\`ere commune|AEC+annodomini|apr\`es J\'esus-Christ|apr\adddotspace J\adddot-C\adddot+beforechrist|avant J\'esus-Christ|av\adddotspace J\adddot-C\adddot+circa|vers|vers+spring|printemps|printemps+summer|\'et\'e|\'et\'e+autumn|automne|automne+winter|hiver|hiver+am|AM|AM+pm|PM|PM
@@ -0,0 +1,28 @@+bibliography|Bibliograf\'ia|Bibliograf\'ia+references|Referencias|Referencias+shorthands|Lista de abreviaturas|Abreviaturas+editor|editor|ed\adddot+editors|editores|eds\adddot+compiler|compilador|comp\adddot+compilers|compiladores|comp\adddot+redactor|redactor|red\adddot+redactors|redactores|red\adddot+reviser|revisor|rev\adddot+revisers|revisores|revs\adddot+founder|fundador|fund\adddot+founders|fundadores|fund\adddot+continuator|continuador|cont\adddot+continuators|continuadores|cont\adddot+collaborator|colaborador|col\adddot+collaborators|colaboradores|cols\adddot+translator|tradutor|trad\adddot+translators|tradutores|trads\adddot+commentator|comentador|coment\adddot+commentators|comentadores|coments\adddot+annotator|anotador|anot\adddot+annotators|anotadores|anots\adddot+commentary|comentario|coment\adddot+annotations|notas|notas+introduction|introduci\'on|introd\adddot+foreword|prefacio|pref\adddot+afterword|posfacio|posf\adddot
@@ -0,0 +1,28 @@+bibliography|Literaturverzeichnis|Literatur+references|Literaturverzeichnis|Literatur+shorthands|Sigelverzeichnis|Sigel+editor|Herausgeber|Hrsg\adddot+editors|Herausgeber|Hrsg\adddot+compiler|Kompilator|Komp\adddot+compilers|Kompilatoren|Komp\adddot+redactor|Bearbeiter|Bearb\adddot+redactors|Bearbeiter|Bearb\adddot+reviser|\"Uberarbeiter|\"Uberarb\adddot+revisers|\"Uberarbeiter|\"Uberarb\adddot+founder|Begr\"under|Begr\adddot+founders|Begr\"under|Begr\adddot+continuator|Fortf\"uhrer|Fortf\adddot+continuators|Fortf\"uhrer|Fortf\adddot+collaborator|Mitarbeiter|Mitarb\adddot+collaborators|Mitarbeiter|Mitarb\adddot+translator|\"Ubersetzer|\"Ubers\adddot+translators|\"Ubersetzer|\"Ubers\adddot+commentator|Kommentator|Komm\adddot+commentators|Kommentatoren|Komm\adddot+annotator|Kommentator|Komm\adddot+annotators|Kommentatoren|Komm\adddot+commentary|Kommentar|Komm\adddot+annotations|Erl\"auterungen|Erl\"aut\adddot+introduction|Einleitung|Einl\adddot+foreword|Vorwort|Vorw\adddot+afterword|Nachwort|Nachw\adddot
@@ -0,0 +1,9 @@+bibliography|Βιβλιογραφία|Βιβλιογραφία+references|Αναφορές|Αναφορές+shorthands|Κατάλογος συντμήσεων|Συντμήσεις+editor|επιμελητής|επιμελητής+editors|επιμελητές|επιμελητές+compiler|συντάκτης|συντάκτης+compilers|συντάκτες|συντάκτες+redactor|συντάκτης|συντάκτης+redactors|συντάκτες|συντάκτες
@@ -0,0 +1,7 @@+bibliography|Heimildaskr\'a|Heimildaskr\'a+references|Heimildir|Heimildir+shorthands|Listi yfir skammstafanir|Skammstafanir+editor|ristj\'ori|ritstj\adddot+editors|ritstj\'orar|ritstj\adddot+compiler|samantekt|samantekt+compilers|samantekt|samantekt
@@ -0,0 +1,9 @@+bibliography|Bibliografia|Bibliografia+references|Riferimenti bibliografici|Riferimenti bibliografici+shorthands|Elenco delle sigle|Sigle+editor|curatore|cur\adddot+editors|curatori|cur\adddot+compiler|compilatore|comp\adddot+compilers|compilatori|comp\adddot+redactor|redattore|red\adddot+redactors|redattori|red\adddot
@@ -0,0 +1,75 @@+redactor|redaktors|redakt\adddot+redactors|redaktori|radakt\adddot+reviser|revidents|revid\adddot+revisers|revidenti|revid\adddot+introduction|ievads|ievads+byeditor|izdevis|izdevis+bytranslator|tulkojis|tulk\adddot+withintroduction|ar ievadu no|ar ievadu no+byeditortr|izdevis un tulkojis|izdev\adddotspace un tulk\adddot+and|un|un+andothers|un citi|u\adddotspace c\adddot+jourvol|izdevums|izdev\adddot+issue|izdevums|izdev\adddot+edition|izdevums|izdev\adddot+translationof|tulkojums no|tulk\adddotspace no+translationfrom|tulkots no|tulk\adddotspace no+reviewof|recenzija|recenz\adddot+bypublisher|no|no+nodate|bez datuma|bez dat\adddot+page|lappuse|lpp\adddot+pages|lappuses|lpp\adddot+column|sleja|sleja+columns|slejas|slejas+line|rinda|rinda+lines|rindas|rindas+verse|pants|pants+verses|panti|panti+paragraph|rindkopa|rindk\adddot+paragraphs|rindkopas|rindk\adddot+pagetotal|lappuse|lpp\adddot+pagetotals|lappuses|lpp\adddot+columntotal|sleja|sleja+columntotals|slejas|slejas+linetotal|rinda|rinda+linetotals|rindas|rindas+versetotal|pants|pants+versetotals|panti|panti+paragraphtotal|rindkopa|rindk\adddot+paragraphtotals|rindkopas|rindk\adddot+in||+number|numurs|nr\adddot+datacd|datu CD|datu CD+audiocd|audio CD|audio CD+version|versija|versija+url|pieejams|pieejams+urlfrom|pieejams no|pieejams no+inpreparation|tiek gatavots|tiek gatavots+submitted|iesniegts|iesniegts+march|marts|marts+may|maijs|maijs+august|augusts|aug\adddot+september|septembris|sept\adddot+october|oktobris|okt\adddot+november|novembris|nov\adddot+december|decembris|dec\adddot+langfinnish|somu|somu+langrussian|krievu|krievu+langswedish|zviedru|zviedru+fromfinnish|no somu|no somu+fromrussian|no krievu|no krievu+fromswedish|no zviedru|no zviedru+countryep|Eiropas Parlaments|EP+countryfr|Francija|FR+patent|patents|patents+patenteu|Eiropas patents|Eiropas pat\adddot+patentus|ASV patents|ASV pat\adddot+file|fails|fails+circa|ap|ap+spring|pavasaris|pav\adddot+summer|vasara|vas\adddot+autumn|rudens|rud\adddot+winter|ziema|ziema+am|AM|AM+pm|PM|PM+dateyear|gada|g\adddot
@@ -0,0 +1,31 @@+bibliography|Bibliografija|Bibliografija+references|Literatūros sąrašas|Literatūra+shorthands|Santrumpų sąrašas|Santrumpos+editor|sudarytojas|sud\adddot+editors|sudarytojai|sud\adddot+compiler|parengėjas|pareng\adddot+compilers|parengėjai|pareng\adddot+redactor|redaktorius|red\adddot+redactors|redaktoriai|red\adddot+reviser|korektorius|kor\adddot+revisers|korektoriai|kor\adddot+founder|pradininkas|prad\adddot+founders|pradininkai|prad\adddot+continuator|tęsėjas|tęs\adddot+continuators|tęsėjai|tęs\adddot+collaborator|bendradarbis|bendr\adddot+collaborators|bendradarbiai|bendr\adddot+translator|vertėjas|vert\adddot+translators|vertėjai|vert\adddot+commentator|komentarų autorius|koment\adddotspace aut\adddot+commentators|komentarų autoriai|koment\adddotspace aut\adddot+annotator|paaiškinimų autorius|paaišk\adddotspace aut\adddot+annotators|paaiškinimų autoriai|paaišk\adddotspace aut\adddot+commentary|komentarai|koment\adddot+annotations|paaiškinimai|paaišk\adddot+introduction|įvadas|įv\adddot+foreword|pratarmė|prat\adddot+afterword|pabaigos žodis|pab\adddotspace žodis+organizer|organizatorius|org\adddot+organizers|organizatoriai|org\adddot+byorganizer|organizavo|org\adddot
@@ -0,0 +1,29 @@+bibliography|Irodalomjegyz\'ek|Irodalom+references|Hivatkoz\'asok|Hivatkoz\'asok+shorthands|R\"ovid\'it\'esek jegyz\'eke|R\"ovid\'it\'esek+compiler|\"ossze\'all\'it\'o|\"ossze\'all\adddot+compilers|\"ossze\'all\'it\'ok|\"ossze\'all\adddot+reviser|korrektor|korr\adddot+revisers|korrektorok|korr\adddot+founder|alap\'it\'o|alap\adddot+founders|alap\'it\'ok|alap\adddot+%continuator||+%continuators||+translator|ford\'it\'o|ford\adddot+translators|ford\'it\'ok|ford\adddot+commentator|komment\'ator|komm\adddot+commentators|komment\'atorok|komm\adddot+annotator|jegyzetek \'ir\'oja|jegyz\adddot+annotators|jegyzetek \'ir\'oi|jegyz\adddot+commentary|komment\'ar|komm\adddot+annotations|jegyzetek|jegyz\adddot+introduction|bevezet\'es|bev\adddot+afterword|ut\'osz\'o|ut\'osz\'o+byorganizer|szervezte|szerv\adddot+byauthor|\'irta|\'irta+byeditor|szerkesztette|szerk\adddot+bycompiler|\"ossze\'all\'itotta|\"ossze\'all\adddot+byredactor|sajt\'o al\'a rendezte|kiad\adddot+byreviser|jav\'itotta|jav\adddot+byreviewer|b\'ir\'alta|b\'ir\adddot+byfounder|alap\'itotta|alap\adddot
@@ -0,0 +1,2 @@+citedas|im Folgenden zitiert als|im Folgenden zit\adddotspace als+january|J\"anner|J\"an\adddot
@@ -0,0 +1,1 @@+citedas|im Folgenden zitiert als|im Folgenden zit\adddotspace als
@@ -0,0 +1,98 @@+bibliography|Bibliografi|Bibliografi+references|Referanser|Referanser+shorthands|Forkortelser|Forkortelser+compiler|kompilator|komp\adddot+compilers|kompilatorer|komp\adddot+redactor|bearbeidelse|bearb\adddot+redactors|bearbeidelse|bearb\adddot+reviser|revisjon|rev\adddot+revisers|revisjon|rev\adddot+founder|grunnlegger|grunnl\adddot+founders|grunnleggere|grunnl\adddot+collaborator|samarbeid|samarb\adddot+collaborators|samarbeid|samarb\adddot+translator|oversetter|overs\adddot+translators|oversettere|overs\adddot+commentator|kommentarer|komm\adddot+commentators|kommentarer|komm\adddot+annotator|forklaringer|forkl\adddot+annotators|forklaringer|forkl\adddot+commentary|kommentarer|komm\adddot+annotations|forklaringer|forkl\adddot+introduction|innledning|innl\adddot+foreword|forord|forord+afterword|etterord|etterord+organizer|organisator|org\adddot+organizers|organisatorer|org\adddot+byorganizer|organisert av|org\adddotspace av+byauthor|av|av+byeditor|redigert av|red\adddotspace av+bycompiler|kompilert av|komp\adddotspace av+byredactor|bearbeidet av|bearb\adddotspace av+byreviser|revidert av|rev\adddotspace av+byreviewer|kritikk ved|krit\adddotspace ved+byfounder|grunnlagt av|grunnl\adddotspace av+bycollaborator|i samarbeid med|i samarb\adddotspace med+bytranslator|oversatt \lbx@lfromlang\ av|overs\adddot\ \lbx@sfromlang\ av+bycommentator|kommentert av|komm\adddot\ av+byannotator|forklart av|forkl\adddot\ av+withcommentator|med kommentarer av|med komm\adddot\ av+withannotator|med forklaringer av|med forkl\adddot\ av+withintroduction|med innledning av|med innl\adddot\ av+withforeword|med forord av|med forord av+withafterword|med etterord av|med etterord av+and|og|og+andothers|med flere|mfl\adddot+andmore|med mer|m.m\adddot+volume|bind|bd\adddot+volumes|bind|bd\adddot+involumes|i|i+jourser|serie|ser\adddot+book|bok|bok+part|del|del+issue|nummer|nr\adddot+newseries|ny serie|ny ser\adddot+oldseries|gammel serie|gl\adddotspace ser\adddot+edition|utgave|utg\adddot+reprint|opptrykk|opptr\adddot+reprintof|opptrykk av|opptr\adddotspace av+reprintas|trykt om som|tr\adddotspace om som+reprintfrom|opptrykk fra|opptr\adddotspace fra+translationof|oversettelse av|overs\adddotspace av+translationas|oversatt som|overs\adddotspace som+translationfrom|oversatt fra|overs\adddotspace fra+reviewof|kritikk av|krit\adddotspace av+origpubas|opprinnelig utgitt som|oppr\adddot\ utg\adddot\ som+origpubin|opprinnelig utgitt i|oppr\adddot\ utg\adddot\ i+astitle|som|som+bypublisher|av|av+nodate|udatert|udatert+page|side|s\adddot+pages|sider|s\adddot+column|spalte|sp\adddot+columns|spalter|sp\adddot+line|linje|l\adddot+lines|linjer|l\adddot+verse|vers|v\adddot+verses|vers|v\adddot+section|avsnitt|avsn\adddot+sections|avsnitt|avsn\adddot+paragraph|avsnitt|avsn\adddot+paragraphs|avsnitt|avsn\adddot+pagetotal|side|s\adddot+pagetotals|sider|s\adddot+columntotal|spalte|sp\adddot+columntotals|spalter|sp\adddot+linetotal|linje|l\adddot+linetotals|linjer|l\adddot+versetotal|vers|v\adddot+versetotals|vers|v\adddot+sectiontotal|avsnitt|avsn\adddot+sectiontotals|avsnitt|avsn\adddot+paragraphtotal|avsnitt|avsn\adddot+paragraphtotals|avsnitt|avsn\adddot+in|i|i+inseries|i|i+ofseries|av|av+number|nummer|nr\adddot+chapter|kapittel|kap\adddot
@@ -0,0 +1,2 @@+citedas|im Folgenden zitiert als|im Folgenden zit\adddotspace als+countryuk|Grossbritannien|GB
@@ -0,0 +1,28 @@+references|Referansar|Referansar+shorthands|Forkortingar|Forkortingar+compilers|kompilatorar|komp\adddot+redactor|omarbeiding|omarb\adddot+redactors|omarbeiding|omarb\adddot+founder|grunnleggjar|grunnl\adddot+founders|grunnleggjarar|grunnl\adddot+translator|omsetjar|oms\adddot+translators|omsetjarar|oms\adddot+commentator|kommentarar|komm\adddot+commentators|kommentarar|komm\adddot+annotator|forklaringar|forkl\adddot+annotators|forklaringar|forkl\adddot+commentary|kommentarar|komm\adddot+annotations|forklaringar|forkl\adddot+introduction|innleiing|innl\adddot+organizers|organisatorar|org\adddot+byredactor|omarbeidd av|omarb\adddotspace av+withcommentator|med kommentarar av|med komm\adddot\ av+withannotator|med forklaringar av|med forkl\adddot\ av+withintroduction|med innleiing av|med innl\adddot\ av+andothers|med fleire|mfl\adddot+andmore|med meir|m.m\adddot+oldseries|gamal serie|gl\adddotspace ser\adddot+translationof|omsetjing av|oms\adddotspace av+translationas|omsett som|oms\adddotspace som+origpubas|opphavleg utgitt som|opph\adddot\ utg\adddot\ som+origpubin|opphavleg utgitt i|opph\adddot\ utg\adddot\ i
@@ -0,0 +1,100 @@+bibliography|Bibliografia|Bibliografia+references|Bibliografia|Bibliografia+editor|redaktor|red\adddot+editors|redaktorzy|red\adddot+compiler|redaktor|red\adddot+compilers|redaktorzy|red\adddot+redactor|redaktor|red\adddot+redactors|redaktorzy|red\adddot+reviser|korektor|kor\adddot+revisers|korektorzy|kor\adddot+collaborator|uczestnik|ucz\adddot+collaborators|uczestnicy|ucz\adddot+translator|t\l umacz|t\l um\adddot+translators|t\l umacze|t\l um\adddot+commentator|komentator|kom\adddot+commentators|komentatorzy|kom\adddot+annotator|uwaga|uw\adddot+annotators|uwagi|uw\adddot+commentary|komentarz|kom\adddot+annotations|komentarze|kom\adddot+foreword|przedmowa|przedm\adddot+afterword|pos\l owie|pos\l \adddot+editortr|redaktor i t\l umacz|red\adddotspace i per\adddot+editorstr|redaktorzy i t\l umacze|red\adddotspace i per\adddot+editorco|redaktor i komentator|red\adddotspace i kom\adddot+translatorco|t\l umacz i komentator|t\l um\adddotspace i kom\adddot+translatorsco|t\l umacze i komentatorzy|t\l um\adddotspace i kom\adddot+organizer|organizator|org\adddot+organizers|organizatorzy|org\adddot+byorganizer|organizowane|org\adddot+byauthor|autorstwo|aut\adddot+byeditor|redagowa\l|red\adddot+byredactor|zredagowano|zred\adddot+byreviser|poprawione|popr\adddot+byreviewer|recenzja|rec\adddot+bytranslator|t\l umaczenie \lbx@lfromlang|t\l um\adddotspace \lbx@sfromlang+bycommentator|skomentowane przez|skom\adddot+byannotator|uwagi od|uw\adddot+withcommentator|komentarze|kom\adddot+withannotator|uwagi|uw\adddot+withforeword|przedmowa|przedm\adddot+withafterword|pos\l owie|pos\l \adddot+byeditoran|zredagowany i z uwagami|zredag\adddotspace i z uw\adddot+byeditoraf|zredagowany, z pos\l owiem|zred., z pos\l \adddot+byeditorcofo|zredagowany, komentarze i przedmowa|zred., kom\adddotspace i przedm\adddot+byeditorcoaf|zredagowany, komentarze i pos\l owie|zred., kom\adddotspace i pos\l \adddot+byeditoranfo|zredagowany, uwagi i przedmowa|zred., uw\adddotspace i przedm\adddot+byeditoranaf|zredagowany, uwagi i pos\l owie|zred., uw\adddotspace i pos\l \adddot+and|i|i+andothers|i inni|i in\adddot+andmore|i inni|i in\adddot+volume|tom|t\adddot+volumes|tomy|t\adddot+involumes|w|w+jourvol|tom|t\adddot+jourser|seria|ser\adddot+issue|wydanie|wyd\adddot+newseries|nowa seria|now\adddotspace ser\adddot+oldseries|stara seria|star\adddotspace ser\adddot+edition|wydruk|wyd\adddot+reprint|przedruk|przedr\adddot+reprintof|przedruk|przedr\adddot+reprintas|przedrukowano jako|przedr\adddotspace jako+reprintfrom|przedrukowano z|przedr\adddotspace z+translationof|t\l umaczenie|t\l um\adddot+translationas|t\l umaczenie jako|t\l um\adddotspace jako+translationfrom|t\l umaczenie z|t\l um\adddotspace z+reviewof|recenzja na\addcolon|rec\adddotspace na\addcolon+origpubin|pierwodruk wydano w|pierw\adddotspace wyd\adddotspace w+astitle|pod tytu\l em|pod tyt\adddot+page|strona|s\adddot+pages|strony|s\adddot+column|kolumna|kol\adddot+columns|kolumny|kol\adddot+line|linijka|l\adddot+lines|linijki|l\adddot+nodate|bez daty|b\adddot d\adddot+verse|werset|wer\adddot+verses|wersety|wer\adddot+section|paragraf|par\adddot+sections|paragrafy|par\adddot+paragraph|akapit|akap\adddot+paragraphs|akapity|akap\adddot+pagetotal|strona|s\adddot+pagetotals|strony|s\adddot+columntotal|kolumna|kol\adddot+columntotals|kolumny|kol\adddot+linetotal|wers|wer\adddot+linetotals|wersy|wer\adddot+versetotal|wiersz|wier\adddot+versetotals|wiersze|wier\adddot+sectiontotal|paragraf|par\adddot+sectiontotals|paragrafy|par\adddot+paragraphtotal|akapit|akap\adddot+paragraphtotals|akapit|akap\adddot+in|w|w+inseries|w|w+ofseries|z|z+number|numer|nr\adddot+chapter|rozdzia\l |rozd\adddot
@@ -0,0 +1,95 @@+bibliography|Bibliografia|Bibliografia+references|Refer\^encias|Refer\^encias+shorthands|Lista de Abreviaturas|Abreviaturas+editor|editor|ed\adddot+editors|editores|eds\adddot+compiler|compilador|comp\adddot+compilers|compiladores|comp\adddot+redactor|redator|red\adddot+redactors|redatores|red\adddot+reviser|revisor|rev\adddot+revisers|revisores|rev\adddot+founder|fundador|fund\adddot+founders|fundadores|fund\adddot+continuator|continuador|cont\adddot+continuators|continuadores|cont\adddot+collaborator|colaborador|col\adddot+collaborators|colaboradores|col\adddot+translator|tradutor|trad\adddot+translators|tradutores|trad\adddot+commentator|comentador|coment\adddot+commentators|comentadores|coment\adddot+annotator|anotador|anot\adddot+annotators|anotadores|anot\adddot+commentary|coment\'ario|coment\adddot+annotations|notas|notas+foreword|pref\'acio|pref\adddot+afterword|posf\'acio|posf\adddot+organizer|organizador|org\adddot+organizers|organizadores|orgs\adddot+byorganizer|organizado por|org\adddotspace por+byauthor|por|por+byeditor|editado por|ed\adddotspace por+bycompiler|compilado por|comp\adddotspace por+byredactor|redigido por|red\adddotspace por+byreviser|revisto por|rev\adddotspace por+byreviewer|resenhado por|res\adddotspace por+byfounder|fundado por|fund\adddotspace por+bycontinuator|continuado por|cont\adddotspace por+bytranslator|traduzido \lbx@lfromlang\ por|trad\adddot\ \lbx@sfromlang\ por+bycommentator|comentado por|coment\adddot\ por+byannotator|notas de|notas de+withcommentator|com coment\'arios de|com coment\adddot\ de+withannotator|com notas de|com notas de+withforeword|com pref\'acio de|com pref\adddot\ de+withafterword|com posf\'acio de|com posf\adddot\ de+and|e|e+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+andmore|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+volume|volume|vol\adddot+volumes|volumes|vols\adddot+involumes|em|em+jourvol|volume|vol\adddot+jourser|s\'erie|s\'er\adddot+book|livro|livro+part|parte|parte+issue|n\'umero|n\'umero+newseries|nova s\'erie|nova s\'er\adddot+oldseries|s\'erie antiga|s\'er\adddot\ antiga+reprint|reimpress\~ao|reimpr\adddot+reprintof|reimpress\~ao de|reimpr\adddotspace de+reprintas|reimpresso como|reimpr\adddotspace como+reprintfrom|reimpresso|reimpr\adddot+translationas|traduzido como|trad\adddotspace como+translationfrom|traduzido do|trad\adddotspace do+reviewof|resenha de|res\adddotspace de+origpubas|originalmente publicado como|orig\adddotspace pub\adddotspace como+origpubin|originalmente publicado em|orig\adddotspace pub\adddotspace em+astitle|como|como+bypublisher|por|por+nodate|sem data|s\adddot d\adddot+page|p\'agina|p\adddot+pages|p\'aginas|pp\adddot+column|coluna|col\adddot+columns|colunas|cols\adddot+line|linha|l\adddot+lines|linhas|ll\adddot+verse|verso|v\adddot+verses|versos|vv\adddot+paragraph|par\'agrafo|par\adddot+paragraphs|par\'agrafo|par\adddot+pagetotal|p\'agina|p\adddot+pagetotals|p\'aginas|pp\adddot+columntotal|coluna|col\adddot+columntotals|colunas|cols\adddot+linetotal|linha|l\adddot+linetotals|linhas|ll\adddot+versetotal|verso|v\adddot+versetotals|versos|vv\adddot+paragraphtotal|par\'agrafo|par\adddot+paragraphtotals|par\'agrafo|par\adddot+in|em|em+inseries|em|em+ofseries|de|de+number|n\'umero|n\adddot\textordmasculine+chapter|cap\'\i tulo|cap\adddot
@@ -0,0 +1,102 @@+bibliography|Список литературы|Список литературы+references|Список литературы|Список литературы+shorthands|Список сокращений|Сокращения+editor|редактор|ред\adddot+editors|редакторы|ред\adddot+compiler|составитель|сост\adddot+compilers|составители|сост\adddot+redactor|редактор|ред\adddot+redactors|редакторы|ред\adddot+reviser|ревизионный корректор|ревиз\adddotspace кор\adddot+revisers|ревизионные корректоры|ревиз\adddotspace кор\adddot+founder|основатель|осн\adddot+founders|основатели|осн\adddot+continuator|продолжатель|прод\adddot+continuators|продолжатели|прод\adddot+collaborator|участник|участ\adddot+collaborators|участники|участ\adddot+translator|переводчик|пер\adddot+translators|переводчики|пер\adddot+commentator|комментатор|коммент\adddot+commentators|комментаторы|коммент\adddot+annotator|примечания|примеч\adddot+annotators|примечания|примеч\adddot+commentary|комментарий|коммент\adddot+annotations|примечания|примеч\adddot+introduction|вступительная статья|вступ\adddotspace ст\adddot+foreword|предисловие|предисл\adddot+afterword|послесловие|послесл\adddot+organizer|организатор|орг\adddot+organizers|организаторы|орг\adddot+byorganizer|организатор|орг\adddot+byauthor||+byeditor|под редакцией|под\addabbrvspace ред\adddot+bycompiler|составитель|сост\adddot+byredactor|под редакцией|под\addabbrvspace ред\adddot+byreviser|исправлено|испр\adddot+byreviewer|рецензия|рец\adddot+byfounder|учредитель|учр\adddot+bycontinuator|продолжение|продолж\adddot+bycollaborator|при участии|при\addabbrvspace уч\adddot+bytranslator|перевод \lbx@lfromlang|пер\adddot\ \lbx@sfromlang+bycommentator|комментарии|коммент\adddot+byannotator|примечания|примеч\adddot+withcommentator|комментарии|коммент\adddot+withannotator|примечания|примеч\adddot+withintroduction|вступительная статья|вступ\adddotspace ст\adddot+withforeword|предисловие|предисл\adddot+withafterword|послесловие|послесл\adddot+and|и|и+andothers|и\addabbrvspace др\adddot|и\addabbrvspace др\adddot+andmore|и\addabbrvspace др\adddot|и\addabbrvspace др\adddot+volume|том|т\adddot+volumes|томах|т\adddot+involumes|в|в+jourvol|том|т\adddot+jourser|серия|сер\adddot+book|книга|кн\adddot+part|часть|ч\adddot+issue|выпуск|вып\adddot+newseries|новая серия|нов\adddotspace сер\adddot+oldseries|старая серия|стар\adddotspace сер\adddot+edition|издание|изд\adddot+reprint|переиздание|переизд\adddot+reprintof|переиздание|переизд\adddot+reprintas|переиздано как|переизд\adddotspace как+reprintfrom|переиздано с|переизд\adddotspace с+translationof|перевод по изданию\addcolon|пер\adddotspace по изд\adddot\addcolon+translationas|перевод\addcolon|пер\adddot\addcolon+translationfrom|перевод с|пер\adddotspace с+reviewof|рецензия на\addcolon|рец\adddotspace на\addcolon+astitle|\addcolon|\addcolon+bypublisher|\addcomma|\addcomma+nodate|б\adddot г\adddot|б\adddot г\adddot+page|страница|с\adddot+pages|страницы|с\adddot+column|колонка|кол\adddot+columns|колонки|кол\adddot+line|строка|строка+lines|строки|строка+verse|стих|стих+verses|стихи|стихи+section|параграф|\S+sections|параграфы|\S\S+paragraph|абзац|абз\adddot+paragraphs|абзацы|абз\adddot+pagetotal|страница|с\adddot+pagetotals|страницы|с\adddot+columntotal|колонка|кол\adddot+columntotals|колонки|кол\adddot+linetotal|строка|строка+linetotals|строки|строка+versetotal|стих|стих+versetotals|стихи|стихи+sectiontotal|параграф|\S+sectiontotals|параграфы|\S\S+paragraphtotal|абзац|абз\adddot+paragraphtotals|абзацы|абз\adddot+in|в|в+inseries|в|в+ofseries|из|из+number|номер|№+chapter|глава|гл\adddot
@@ -0,0 +1,82 @@+references|Referencie|Referencie+shorthands|Zoznam skratiek|Skratky+editor|editor|ed\adddot+editors|editori|ed\adddot+compilers|zostavovatelia|zost\adddot+redactor|redaktor|red\adddot+redactors|redaktori|red\adddot+reviser|korektor|kor\adddot+revisers|korektori|kor\adddot+founders|zakladatelia|zakl\adddot+translators|prekladatelia|prekl\adddot+foreword|predhovor|predh\adddot+afterword|doslov|dosl\adddot+byauthor||+withforeword|s\addnbspace predhovorom od|s\addnbspace predh\adddot\ od+withafterword|s\addnbspace doslovom od|s\addnbspace dosl\adddot\ od+and|a|a+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+andmore|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot+involumes|in|in+book|kniha|kniha+edition|vydanie|vyd\adddot+reviewof|recenzia|recenz\adddot+translationof|preklad|prekl\adddot+astitle|ako|ako+bypublisher||+page|strana|s\adddot+pages|strany|s\adddot+line|riadok|r\adddot+lines|riadky|r\adddot+section|sekcia|\S+sections|sekcie|\S\S+paragraph|odsek|ods\adddot+paragraphs|odseky|ods\adddot+pagetotal|strana|s\adddot+pagetotals|strany|s\adddot+linetotal|riadok|r\adddot+linetotals|riadky|r\adddot+sectiontotal|sekcia|\S+sectiontotals|sekcie|\S\S+paragraphtotal|odsek|ods\adddot+paragraphtotals|odseky|ods\adddot+in|in|in+inseries|in|in+ofseries|z|z+chapter|kapitola|kap\adddot+datacd|CD-ROM|CD-ROM+audiocd|audio CD|audio CD+version|verzia|ver\adddot+url|URL|URL+idem|idem|idem+idemsm|idem|idem+idemsf|eadem|eadem+idemsn|idem|idem+idempm|eidem|eidem+idempf|eaedem|eaedem+idempn|eadem|eadem+idempp|eidem|eidem+ibidem|ibidem|ibid\adddot+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot+confer|cf\adddot|cf\adddot+sequens|sq\adddot|sq\adddot+sequentes|sqq\adddot|sqq\adddot+passim|passim|pass\adddot+march|marec|mar\adddot+august|august|aug\adddot+september|september|sept\adddot+november|november|nov\adddot+december|december|dec\adddot+countryde|Nemecko|DE+patent|patent|pat\adddot+patentus|US patent|US pat\adddot+abstract|abstrakt|abst\adddot+annodomini|po Kristovi|po Kr\adddot+beforechrist|pred Kristom|pred Kr\adddot+circa|cirka|ca\adddot+spring|jar|jar+summer|leto|leto+winter|zima|zima+am|AM|AM+pm|PM|PM
@@ -0,0 +1,28 @@+bibliography|Literatura|Literatura+references|Literatura|Literatura+shorthands|Kratice|Kratice+editor|urednik|ur\adddot+editors|uredniki|ur\adddot+compiler|sestavljalec|sest\adddot+compilers|sestavljalci|sest\adddot+redactor|redaktor|redaktor+redactors|redaktorji|redaktorji+reviser|korektor|korektor+revisers|korektorji|korektorji+founder|snovalec|snovalec+founders|snovalci|snovalci+continuator|nadaljevalec|nadaljevalec+continuators|nadaljevalci|nadaljevalci+collaborator|sodelavec|sod\adddot+collaborators|sodelavci|sod\adddot+translator|prevajalec|prev\adddot+translators|prevajalci|prev\adddot+commentator|komentator|komentator+commentators|komentatorji|komentatorji+annotator|anotator|anotator+annotators|anotatorji|anotatorji+commentary|komentar|komentar+annotations|opombe|op\adddot+introduction|uvod|uvod+foreword|predgovor|predg\adddot+afterword|spremna beseda|spr\adddotspace b\adddot
@@ -0,0 +1,190 @@+references|Referencias|Referencias+shorthands|Lista de abreviaturas|Abreviaturas+editor|edici\'on|ed\adddot+editors|edici\'on|eds\adddot+commentator|comentario|com\adddot+commentators|comentarios|coms\adddot+annotator|anotaciones|anot\adddot+annotators|anotaciones|anots\adddot+commentary|comentario|com\adddot+annotations|notas|notas+introduction|introducci\'on|intr\adddot+foreword|pr\'ologo|pr\'ol\adddot+organizer|organizaci\'on|org\adddot+organizers|organizaci\'on|orgs\adddot+byorganizer|organizado por|org\adddotspace por+byauthor|de|de+byeditor|editado por|ed\adddotspace por+bycompiler|compilado por|comp\adddotspace por+byredactor|redacci\'on de|red\adddotspace de+byreviser|revisado por|rev\adddotspace por+byfounder|fundado por|fund\adddotspace por+bycontinuator|continuado por|cont\adddotspace por+bytranslator|traducido \lbx@lfromlang\ por|trad\adddot \lbx@sfromlang\ por+bycommentator|comentado por|com\adddotspace por+byannotator|anotado por|anot\adddotspace por+withcommentator|con comentario de|con com\adddotspace de+withannotator|con notas de|con notas de+withintroduction|con introduci\'on de|con intr\adddotspace de+withforeword|con pr\'ologo de|con pr\'ol\adddotspace de+and|y|y+andothers|y~col\adddot|y~col\adddot+andmore|et\adddotspace al\adddot|et\adddotspace al\adddot+volume|volumen|vol\adddot+volumes|vol\'umenes|vols\adddot+involumes|en|en+jourvol|volumen|vol\adddot+jourser|\'epoca|\'ep\adddot+book|libro|libro+part|parte|parte+issue|n\'umero|n\'um\adddot+newseries|nueva \'epoca|n\adddotspace \'ep\adddot+oldseries|antigua \'epoca|ant\adddotspace \'ep\adddot+edition|edici\'on|ed\adddot+reprintas|reimpreso como|reimp\adddotspace como+translationas|traducido como|trad\adddotspace como+translationfrom|traducido del|trad\adddotspace del+origpubas|publicado originalmente como|pub\adddotspace orig\adddotspace como+origpubin|publicado originalmente en|pub\adddot orig\adddot en+bypublisher|por la editorial|por la ed\adddot+page|p\'agina|p\'ag\adddot+pages|p\'aginas|p\'ags\adddot+column|columna|col\adddot+columns|columnas|cols\adddot+verse|verso|v\adddot+verses|versos|vv\adddot+sections|secciones|secs\adddot+pagetotal|p\'agina|p\'ag\adddot+pagetotals|p\'aginas|p\'ags\adddot+columntotal|columna|col\adddot+columntotals|columnas|cols\adddot+versetotal|verso|v\adddot+versetotals|versos|vv\adddot+sectiontotals|secciones|secs\adddot+in|en|en+inseries|en|en+ofseries|de|de+number|n\'umero|n\sptext{o+chapter|cap\'itulo|cap\adddot+bathesis|Tesis de licenciatura|Tesis de lic\adddot+phdthesis|Tesis doctoral|Tesis doct\adddot+candthesis|Tesis de candidatura doctoral|Tesis de cand\adddotspace doct\adddot+techreport|informe t\'ecnico|inf\adddotspace t\'ec\adddot+software|programa|prog\adddot+datacd|disco de datos|CD de datos+audiocd|disco de audio|CD de audio+version|versi\'on|ver\adddot+url|direcci\'on|direcci\'on+urlfrom|disponible desde|disp\adddotspace desde+urlseen|visitado|visitado+submitted|enviado|enviado+forthcoming|pr\'oximamente|prox\adddot+inpress|en prensa|en prensa+prepublished|previamente publicado|prepublicado+citedas|citado en adelante como|cit\adddotspace en adelante como+thiscite|especialmente|esp\adddot+seenote|ver nota|ver n\adddot+quotedin|citado en|cit\adddotspace en+loccit|loc\adddotspace cit\adddot|loc\adddot cit\adddot+confer|cf\adddot|cf\adddot+sequens|s\adddot|s\adddot+sequentes|ss\adddot|ss\adddot+passim|p\'assim|p\'assim+see|v\'ease|vid\adddot+seealso|v\'ease tambi\'en|vid\adddotspace tambi\'en+backrefpage|v\'ease p\'agina|vid\adddotspace p\'ag\adddot+backrefpages|v\'eanse p\'aginas|vid\adddotspace p\'ags\adddot+january|enero|ene\adddot+february|febrero|feb\adddot+march|marzo|mar\adddot+april|abril|abr\adddot+may|mayo|mayo+june|junio|jun\adddot+july|julio|jul\adddot+august|agosto|ago\adddot+september|septiembre|sep\adddot+october|octubre|oct\adddot+november|noviembre|nov\adddot+december|diciembre|dic\adddot+langbrazilian|brasile\~no|brasile\~no+langbulgarian|b\'ulgaro|b\'ulgaro+langcroatian|croata|croata+langczech|checo|checo+langdanish|dan\'es|dan\'es+langdutch|neerland\'es|neerland\'es+langenglish|ingl\'es|ingl\'es+langestonian|estonio|estonio+langfrench|franc\'es|franc\'es+langgalician|gallego|gallego+langgerman|alem\'an|alem\'an+langgreek|griego|griego+langhungarian|h\'ungaro|h\'ungaro+langitalian|italiano|italiano+langjapanese|japon\'es|japon\'es+langlatvian|lituano|lituano+langnorwegian|noruego|noruego+langpolish|polaco|polaco+langportuguese|portugu\'es|portugu\'es+langrussian|ruso|ruso+langslovak|eslovaco|eslovaco+langslovene|esloveno|esloveno+langspanish|espa\~nol|espa\~nol+langswedish|sueco|sueco+langukrainian|ucraniano|ucraniano+frombrazilian|del brasile\~no|del brasile\~no+frombulgarian|del b\'ulgaro|del b\'ulgaro+fromcroatian|del croata|del croata+fromczech|del checo|del checo+fromdanish|del dan\'es|del dan\'es+fromdutch|del neerland\'es|del neerland\'es+fromenglish|del ingl\'es|del ingl\'es+fromestonian|del estonio|del estonio+fromfrench|del franc\'es|del franc\'es+fromgalician|del gallego|del gallego+fromgerman|del alem\'an|del alem\'an+fromgreek|del griego|del griego+fromhungarian|del h\'ungaro|del h\'ungaro+fromitalian|del italiano|del italiano+fromjapanese|del japon\'es|del japon\'es+fromlatvian|del lituano|del lituano+fromnorwegian|del noruego|del noruego+frompolish|del polaco|del polaco+fromportuguese|del portugu\'es|del portugu\'es+fromrussian|del ruso|del ruso+fromslovak|del eslovaco|del eslovaco+fromslovene|del esloveno|del esloveno+fromspanish|del espa\~nol|del espa\~nol+fromswedish|del sueco|del sueco+fromukrainian|del ucraniano|del ucraniano+countryde|Alemania|DE+countryeu|Uni\'on Europea|EU+countryep|Uni\'on Europea|EP+countryfr|Francia|FR+countryuk|Reino Unido|GB+countryus|Estados Unidos|US+patent|patente|pat\adddot+patentde|patente alemana|pat\adddotspace alemana+patenteu|patente europea|pat\adddotspace europea+patentfr|patente francesa|pat\adddotspace francesa+patentuk|patente brit\'anica|pat\adddotspace brit\'anica+patentus|patente estadounidense|pat\adddotspace estadounidense+patreq|solicitud de patente|sol\adddotspace de pat\adddot+patreqde|solicitud de patente alemana|sol\adddotspace de pat\adddot alemana+patreqeu|solicitud de patente europea|sol\adddotspace de pat\adddot europea+patreqfr|solicitud de patente francesa|sol\adddotspace de pat\adddot francesa+patrequk|solicitud de patente brit\'anica|sol\adddotspace de pat\adddot brit\'anica+patrequs|solicitud de patente estadounidense|sol\adddotspace de pat\adddot estadounidense+file|archivo|archivo+library|biblioteca|bibl\adddot+abstract|resumen|resumen+commonera|era com\'un|e\adddotspace c\adddot+beforecommonera|antes de la era com\'un|a\adddotspace e\adddotspace c\adddot+annodomini|despu\'es de Cristo|d\adddotspace C\adddot+beforechrist|antes de Cristo|a\adddotspace C\adddot+circa|circa|ca\adddot+spring|primavera|prim\adddot+summer|verano|ver\adddot+autumn|oto\~no|ot\adddot+winter|invierno|inv\adddot+am|a\adddotspace m\adddot|a\adddot m\adddot+pm|p\adddotspace m\adddot|p\adddot m\adddot
@@ -0,0 +1,9 @@+bibliography|Litteraturf\"orteckning|Litteratur+references|Referenser|Referenser+shorthands|F\"orkortningar|F\"orkortningar+editor|utgivare|utg\adddot+editors|utgivare|utg\adddot+compiler|sammanst\"allare|sammanst\adddot+compilers|sammanst\"allare|sammanst\adddot+redactor|redakt\"or|red\adddot+redactors|redakt\"orer|red\adddot
@@ -0,0 +1,1 @@+countryuk|Grossbritannien|GB
@@ -0,0 +1,157 @@+references|Kaynaklar|Kaynaklar+shorthands|K\i saltmalar dizini|K\i saltmalar+compiler|derleyen|der\adddot+compilers|derleyenler|der\adddot+redactor|yay\i na haz\i rlayan|yay\adddot\ haz\adddot+redactors|yay\i na haz\i rlayanlar|yay\adddot\ haz\adddot+reviser|tashih eden|tashih\adddot+revisers|tashih edenler|tashih\adddot+founder|kurucu|kur\adddot+founders|kurucular|kur\adddot+continuator|tamamlayan|tam\adddot+continuators|tamamlayanlar|tam\adddot+collaborator|ortak|ortak+collaborators|ortaklar|ortaklar+commentator|yorumlayan|yrm\adddot+commentators|yorumlayanlar|yrm\adddot+commentary|yorum|yrm\adddot+byauthor|yazar|yazar+bycompiler|derleyen|der\adddot+byredactor|yay\i na haz\i rlayan|yay\adddot\ haz\adddot+byreviser|tashih|tashih+byfounder|kurucu|kur\adddot+bycontinuator|tamamlayan|tam\adddot+bycommentator|yorumlayan|yrm\adddot+withcommentator|yorumlar\i yla katk\i da bulunan|yrm\adddot\ kat\adddot\ bul\adddot+and|ve|ve+volume|cilt|c\adddot+volumes|cilt|c\adddot+jourvol|cilt|c\adddot+jourser|seri|seri+book|kitap|kitap+part|k\i s\i m|k\i s\i m+issue|say\i|say\i+newseries|yeni seri|yeni seri+oldseries|eski seri|eski seri+edition|bask\i|bs\adddot+reprint|yeni bask\i s\i|yeni bask\i s\i+reprintof|yeni bask\i s\i|yeni bask\i s\i+reprintas|yeni bask\i s\i|yeni bask\i s\i+reprintfrom|yeni bask\i s\i|yeni bask\i s\i+reviewof|derlenen eser|der\adddot\ eser+origpubas|as\i l eser|as\i l eser+origpubin|as\i l eser yay\i n tarihi|as\i l eser yay\i n tarihi+bypublisher|yay\i n evi|yay\i n evi+nodate|tarih yok|t\adddot y\adddot+page|sayfa|s\adddot+pages|sayfalar|ss\adddot+line|sat\i r|sat\adddot+lines|sat\i rlar|sat\adddot+verse|m\i sra|m\i s\adddot+verses|m\i sralar|m\i s\adddot+paragraph|paragraf|par\adddot+paragraphs|paragraflar|par\adddot+pagetotal|toplam sayfa|s\adddot+pagetotals|toplam sayfalar|ss\adddot+linetotal|toplam sat\i r|sat\adddot+linetotals|toplam sat\i rlar|sat\adddot+versetotal|toplam m\i sra|m\i s\adddot+versetotals|toplam m\i sralar|m\i s\adddot+paragraphtotal|toplam paragraf|par\adddot+paragraphtotals|toplam paragraflar|par\adddot+inseries|serilerde|serilerde+ofseries|serilerde|serilerde+number|numara|no\adddot+bathesis|lisans tezi|lis\adddot\ tezi+phdthesis|doktora tezi|dok\adddot\ tezi+candthesis|aday tezi|aday tezi+techreport|teknik rapor|tek\adddot\ rap\adddot+software|bilgisayar yaz\i l\i m\i|bilg\adddot\ yaz\adddot+datacd|CD|CD+audiocd|ses CD'si|ses CD'si+version|versiyon|ver\adddot+forthcoming|yak\i nda|yak\i nda+prepublished|taslak bas\i m\i|taslak bas\i m\i+citedas|at\i f olarak|at\i f olarak+seenote|nota bak\i n\i z|nota bkz\adddot+quotedin|al\i nt\i|al\i nt\i+idem|ayn\i|ayn\i+idemsm|ayn\i|ayn\i+idemsf|ayn\i|ayn\i+idemsn|ayn\i|ayn\i+idempm|ayn\i lar\i|ayn\i lar\i+idempf|ayn\i lar\i|ayn\i lar\i+idempn|ayn\i lar\i|ayn\i lar\i+idempp|ayn\i lar\i|ayn\i lar\i+loccit|at\i f yap\i lan yer|at\i f yap\adddot\ yer+sequens|takip eden|takip eden+sequentes|takip eden|takip eden+passim|rastgele|rastgele+see|bak\i n\i z|bkz\adddot+seealso|ayr\i ca bak\i n\i z|ayr\i ca bkz\adddot+january|Ocak|Ocak+march|Mart|Mar\adddot+april|Nisan|Nis\adddot+may|May\i s|May\adddot+june|Haziran|Haz\adddot+july|Temmuz|Tem\adddot+october|Ekim|Ekim+november|Kas\i m|Kas\adddot+december|Aral\i k|Ara\adddot+langamerican|Amerikanca|Amerikanca+langbrazilian|Brezilyanca|Brezilyanca+langbulgarian|Bulgarca|Bulgarca+langcatalan|Katalanca|Katalanca+langdanish|Danimarkanca|Danimarkanca+langestonian|Estonca|Estonca+langfinnish|Fince|Fince+langfrench|Frans\i zca|Frans\i zca+langgalician|Galce|Galce+langgerman|Almanca|Almanca+langgreek|Yunanca|Yunanca+langhungarian|Macarca|Macarca+langjapanese|Japonca|Japonca+langlatin|Latince|Latince+langlatvian|Letonca|Letonca+langlithuanian|Litvanca|Litvanca+langpolish|Polonyaca|Polonyaca+langportuguese|Portekizce|Portekizce+langslovene|Slovence|Slovence+langukrainian|Ukraynaca|Ukraynaca+fromamerican|Amerikanca'dan|Amerikanca'dan+frombrazilian|Brezilyanca'dan|Brezilyanca'dan+frombulgarian|Bulgarca'dan|Bulgarca'dan+fromcatalan|Katalanca'dan|Katalanca'dan+fromdanish|Danimarkanca'dan|Danimarkanca'dan+fromestonian|Estonyaca'dan|Estonyaca'dan+fromfinnish|Fince'den|Fince'den+fromfrench|Frans\i zca'dan|Frans\i zca'dan+fromgalician|Galyaca'dan|Galyaca'dan+fromgerman|Almanca'dan|Almanca'dan+fromgreek|Yunanca'dan|Yunanca'dan+fromhungarian|Macarca'dan|Macarca'dan+fromjapanese|Japonca'dan|Japonca'dan+fromlatin|Latince'den|Latince'den+fromlatvian|Latvianca'dan|Latvianca'dan+fromlithuanian|Litvanca'dan|Litvanca'dan+frompolish|Polonyaca'dan|Polonyaca'dan+fromportuguese|Portekizce'den|Portekizce'den+fromslovene|Slovence'den|Slovence'den+fromukrainian|Ukraynaca'dan|Ukraynaca'dan+countryde|Almanya|DE+countryfr|Fransa|FR+patent|patent|pat\adddot+patentde|Alman patenti|Alman pat\adddot+patenteu|Avrupa patenti|Avrupa pat\adddot+patentfr|Frans\i z patenti|Frans\i z pat\adddot+patentus|Amerika patenti|Amerika pat\adddot+patreq|patent beklemede|pat\adddot\ bek\adddot+patreqde|Alman patenti beklemede|Alman pat\adddot\ bek\adddot+patreqeu|Avrupa patenti beklemede|Avrupa pat\adddot\ bek\adddot+patreqfr|Frans\i z patenti beklemede|Frans\i z pat\adddot\ bek\adddot+patrequs|Amerika patenti beklemede|Amerika pat\adddot\ bek\adddot+file|dosya|dosya+commonera|milattan sonra|MS+annodomini|milattan sonra|MS+summer|Yaz|Yaz+autumn|Sonbahar|Sonbahar
@@ -0,0 +1,102 @@+bibliography|Перелік літератури|Література+references|Перелік літератури|Література+shorthands|Перелік скорочень|Скорочення+editor|редактор|ред\adddot+editors|редактори|ред\adddot+compiler|укладач|уклад\adddot+compilers|укладачі|уклад\adddot+redactor|редактор|ред\adddot+redactors|редактори|ред\adddot+reviser|ревізійний коректор|ревіз\adddotspace кор\adddot+revisers|ревізійні коректори|ревіз\adddotspace кор\adddot+founder|засновник|засн\adddot+founders|засновник|засн\adddot+continuator|продовжувач|прод\adddot+continuators|продовжувачі|прод\adddot+collaborator|учасник|учас\adddot+collaborators|учасники|учас\adddot+translator|перекладач|пер\adddot+translators|перекладачі|пер\adddot+commentator|коментатор|комент\adddot+commentators|коментатори|комент\adddot+annotator|примітки|прим\adddot+annotators|примітки|прим\adddot+commentary|коментар|комент\adddot+annotations|примітки|прим\adddot+introduction|вступна стаття|вступ\adddotspace ст\adddot+foreword|передмова|передм\adddot+afterword|післямова|післям\adddot+organizer|організатор|орг\adddot+organizers|організатори|орг\adddot+byorganizer|організатор|орг\adddot+byauthor|згідно автора|згідн\adddot авт\adddot+byeditor|за редакцією|за\addabbrvspace ред\adddot+bycompiler|укладач|уклад\adddot+byredactor|за редакцією|за\addabbrvspace ред\adddot+byreviser|виправлено|випр\adddot+byreviewer|рецензія|рец\adddot+byfounder|засновник|засн\adddot+bycontinuator|продовження|продовж\adddot+bycollaborator|за участю|за\addabbrvspace уч\adddot+bytranslator|переклад \lbx@lfromlang|пер\adddot\ \lbx@sfromlang+bycommentator|коментарі|комент\adddot+byannotator|примітки|прим\adddot+withcommentator|коментарі|комент\adddot+withannotator|примітки|прим\adddot+withintroduction|вступна стаття|вступ\adddotspace ст\adddot+withforeword|передмовие|передм\adddot+withafterword|післямовие|післям\adddot+and|та|та+andothers|та\addabbrvspace ін\adddot|та\addabbrvspace ін\adddot+andmore|та\addabbrvspace ін\adddot|та\addabbrvspace ін\adddot+volume|том|т\adddot+volumes|томах|т\adddot+involumes|в|в+jourvol|том|т\adddot+jourser|серія|сер\adddot+book|книга|кн\adddot+part|частина|ч\adddot+issue|випуск|вип\adddot+newseries|нова серія|нов\adddotspace сер\adddot+oldseries|стара серія|стар\adddotspace сер\adddot+edition|видання|вид\adddot+reprint|перевидання|перевид\adddot+reprintof|перевидання|перевид\adddot+reprintas|перевидано як|перевид\adddotspace як+reprintfrom|перевидано з|перевид\adddotspace з+translationof|переклад по виданню\addcolon|пер\adddotspace по вид\adddot\addcolon+translationas|переклад\addcolon|пер\adddot\addcolon+translationfrom|переклад з|пер\adddotspace з+reviewof|рецензія на\addcolon|рец\adddotspace на\addcolon+astitle|\addcolon|\addcolon+bypublisher|\addcomma|\addcomma+nodate|б\adddot р\adddot|б\adddot р\adddot+page|сторінка|с\adddot+pages|сторінки|с\adddot+column|колонка|кол\adddot+columns|колонки|кол\adddot+line|рядок|рядок+lines|рядки|рядки+verse|вірш|вірш+verses|вірші|вірші+section|параграф|\S+sections|параграфи|\S\S+paragraph|абзац|абз\adddot+paragraphs|абзаци|абз\adddot+pagetotal|сторінка|с\adddot+pagetotals|сторінки|с\adddot+columntotal|колонка|кол\adddot+columntotals|колонки|кол\adddot+linetotal|рядок|рядок+linetotals|рядки|рядки+versetotal|вірш|вірш+versetotals|вірші|вірші+sectiontotal|параграф|\S+sectiontotals|параграфи|\S\S+paragraphtotal|абзац|абз\adddot+paragraphtotals|абзаци|абз\adddot+in|в|в+inseries|в|в+ofseries|із|із+number|номер|№+chapter|глава|гл\adddot
@@ -1,198 +0,0 @@-/*-LaTeXMathML.js from http://math.etsu.edu/LaTeXMathML/-Adapted by Jeff Knisely and Douglas Woodall from ASCIIMathML.js v. 1.4.7,-(c) 2005 Peter Jipsen http://www.chapman.edu/~jipsen.-Released under the GNU General Public License version 2 or later.-See the GNU General Public License (at http://www.gnu.org/copyleft/gpl.html)-for more details.-*/-var checkForMathML=true;var notifyIfNoMathML=true;var alertIfNoMathML=false;var mathcolor="";var mathfontfamily="";var showasciiformulaonhover=true;var isIE=document.createElementNS==null;if(document.getElementById==null)-alert("This webpage requires a recent browser such as \nMozilla/Netscape 7+ or Internet Explorer 6+MathPlayer")-function AMcreateElementXHTML(t){if(isIE)return document.createElement(t);else return document.createElementNS("http://www.w3.org/1999/xhtml",t);}-function AMnoMathMLNote(){var nd=AMcreateElementXHTML("h3");nd.setAttribute("align","center")-nd.appendChild(AMcreateElementXHTML("p"));nd.appendChild(document.createTextNode("To view the "));var an=AMcreateElementXHTML("a");an.appendChild(document.createTextNode("LaTeXMathML"));an.setAttribute("href","http://www.maths.nott.ac.uk/personal/drw/lm.html");nd.appendChild(an);nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));an=AMcreateElementXHTML("a");an.appendChild(document.createTextNode("MathPlayer"));an.setAttribute("href","http://www.dessci.com/en/products/mathplayer/download.htm");nd.appendChild(an);nd.appendChild(document.createTextNode(" or Netscape/Mozilla/Firefox"));nd.appendChild(AMcreateElementXHTML("p"));return nd;}-function AMisMathMLavailable(){if(navigator.appName.slice(0,8)=="Netscape")-if(navigator.appVersion.slice(0,1)>="5")return null;else return AMnoMathMLNote();else if(navigator.appName.slice(0,9)=="Microsoft")-try{var ActiveX=new ActiveXObject("MathPlayer.Factory.1");return null;}catch(e){return AMnoMathMLNote();}-else return AMnoMathMLNote();}-var AMcal=[0xEF35,0x212C,0xEF36,0xEF37,0x2130,0x2131,0xEF38,0x210B,0x2110,0xEF39,0xEF3A,0x2112,0x2133,0xEF3B,0xEF3C,0xEF3D,0xEF3E,0x211B,0xEF3F,0xEF40,0xEF41,0xEF42,0xEF43,0xEF44,0xEF45,0xEF46];var AMfrk=[0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF63,0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0x211C,0xEF6B,0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0x2128];var AMbbb=[0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124];var CONST=0,UNARY=1,BINARY=2,INFIX=3,LEFTBRACKET=4,RIGHTBRACKET=5,SPACE=6,UNDEROVER=7,DEFINITION=8,TEXT=9,BIG=10,LONG=11,STRETCHY=12,MATRIX=13;var AMsqrt={input:"\\sqrt",tag:"msqrt",output:"sqrt",ttype:UNARY},AMroot={input:"\\root",tag:"mroot",output:"root",ttype:BINARY},AMfrac={input:"\\frac",tag:"mfrac",output:"/",ttype:BINARY},AMover={input:"\\stackrel",tag:"mover",output:"stackrel",ttype:BINARY},AMatop={input:"\\atop",tag:"mfrac",output:"",ttype:INFIX},AMchoose={input:"\\choose",tag:"mfrac",output:"",ttype:INFIX},AMsub={input:"_",tag:"msub",output:"_",ttype:INFIX},AMsup={input:"^",tag:"msup",output:"^",ttype:INFIX},AMtext={input:"\\mathrm",tag:"mtext",output:"text",ttype:TEXT},AMmbox={input:"\\mbox",tag:"mtext",output:"mbox",ttype:TEXT};var AMsymbols=[{input:"\\alpha",tag:"mi",output:"\u03B1",ttype:CONST},{input:"\\beta",tag:"mi",output:"\u03B2",ttype:CONST},{input:"\\gamma",tag:"mi",output:"\u03B3",ttype:CONST},{input:"\\delta",tag:"mi",output:"\u03B4",ttype:CONST},{input:"\\epsilon",tag:"mi",output:"\u03B5",ttype:CONST},{input:"\\varepsilon",tag:"mi",output:"\u025B",ttype:CONST},{input:"\\zeta",tag:"mi",output:"\u03B6",ttype:CONST},{input:"\\eta",tag:"mi",output:"\u03B7",ttype:CONST},{input:"\\theta",tag:"mi",output:"\u03B8",ttype:CONST},{input:"\\vartheta",tag:"mi",output:"\u03D1",ttype:CONST},{input:"\\iota",tag:"mi",output:"\u03B9",ttype:CONST},{input:"\\kappa",tag:"mi",output:"\u03BA",ttype:CONST},{input:"\\lambda",tag:"mi",output:"\u03BB",ttype:CONST},{input:"\\mu",tag:"mi",output:"\u03BC",ttype:CONST},{input:"\\nu",tag:"mi",output:"\u03BD",ttype:CONST},{input:"\\xi",tag:"mi",output:"\u03BE",ttype:CONST},{input:"\\pi",tag:"mi",output:"\u03C0",ttype:CONST},{input:"\\varpi",tag:"mi",output:"\u03D6",ttype:CONST},{input:"\\rho",tag:"mi",output:"\u03C1",ttype:CONST},{input:"\\varrho",tag:"mi",output:"\u03F1",ttype:CONST},{input:"\\varsigma",tag:"mi",output:"\u03C2",ttype:CONST},{input:"\\sigma",tag:"mi",output:"\u03C3",ttype:CONST},{input:"\\tau",tag:"mi",output:"\u03C4",ttype:CONST},{input:"\\upsilon",tag:"mi",output:"\u03C5",ttype:CONST},{input:"\\phi",tag:"mi",output:"\u03C6",ttype:CONST},{input:"\\varphi",tag:"mi",output:"\u03D5",ttype:CONST},{input:"\\chi",tag:"mi",output:"\u03C7",ttype:CONST},{input:"\\psi",tag:"mi",output:"\u03C8",ttype:CONST},{input:"\\omega",tag:"mi",output:"\u03C9",ttype:CONST},{input:"\\Gamma",tag:"mo",output:"\u0393",ttype:CONST},{input:"\\Delta",tag:"mo",output:"\u0394",ttype:CONST},{input:"\\Theta",tag:"mo",output:"\u0398",ttype:CONST},{input:"\\Lambda",tag:"mo",output:"\u039B",ttype:CONST},{input:"\\Xi",tag:"mo",output:"\u039E",ttype:CONST},{input:"\\Pi",tag:"mo",output:"\u03A0",ttype:CONST},{input:"\\Sigma",tag:"mo",output:"\u03A3",ttype:CONST},{input:"\\Upsilon",tag:"mo",output:"\u03A5",ttype:CONST},{input:"\\Phi",tag:"mo",output:"\u03A6",ttype:CONST},{input:"\\Psi",tag:"mo",output:"\u03A8",ttype:CONST},{input:"\\Omega",tag:"mo",output:"\u03A9",ttype:CONST},{input:"\\frac12",tag:"mo",output:"\u00BD",ttype:CONST},{input:"\\frac14",tag:"mo",output:"\u00BC",ttype:CONST},{input:"\\frac34",tag:"mo",output:"\u00BE",ttype:CONST},{input:"\\frac13",tag:"mo",output:"\u2153",ttype:CONST},{input:"\\frac23",tag:"mo",output:"\u2154",ttype:CONST},{input:"\\frac15",tag:"mo",output:"\u2155",ttype:CONST},{input:"\\frac25",tag:"mo",output:"\u2156",ttype:CONST},{input:"\\frac35",tag:"mo",output:"\u2157",ttype:CONST},{input:"\\frac45",tag:"mo",output:"\u2158",ttype:CONST},{input:"\\frac16",tag:"mo",output:"\u2159",ttype:CONST},{input:"\\frac56",tag:"mo",output:"\u215A",ttype:CONST},{input:"\\frac18",tag:"mo",output:"\u215B",ttype:CONST},{input:"\\frac38",tag:"mo",output:"\u215C",ttype:CONST},{input:"\\frac58",tag:"mo",output:"\u215D",ttype:CONST},{input:"\\frac78",tag:"mo",output:"\u215E",ttype:CONST},{input:"\\pm",tag:"mo",output:"\u00B1",ttype:CONST},{input:"\\mp",tag:"mo",output:"\u2213",ttype:CONST},{input:"\\triangleleft",tag:"mo",output:"\u22B2",ttype:CONST},{input:"\\triangleright",tag:"mo",output:"\u22B3",ttype:CONST},{input:"\\cdot",tag:"mo",output:"\u22C5",ttype:CONST},{input:"\\star",tag:"mo",output:"\u22C6",ttype:CONST},{input:"\\ast",tag:"mo",output:"\u002A",ttype:CONST},{input:"\\times",tag:"mo",output:"\u00D7",ttype:CONST},{input:"\\div",tag:"mo",output:"\u00F7",ttype:CONST},{input:"\\circ",tag:"mo",output:"\u2218",ttype:CONST},{input:"\\bullet",tag:"mo",output:"\u2022",ttype:CONST},{input:"\\oplus",tag:"mo",output:"\u2295",ttype:CONST},{input:"\\ominus",tag:"mo",output:"\u2296",ttype:CONST},{input:"\\otimes",tag:"mo",output:"\u2297",ttype:CONST},{input:"\\bigcirc",tag:"mo",output:"\u25CB",ttype:CONST},{input:"\\oslash",tag:"mo",output:"\u2298",ttype:CONST},{input:"\\odot",tag:"mo",output:"\u2299",ttype:CONST},{input:"\\land",tag:"mo",output:"\u2227",ttype:CONST},{input:"\\wedge",tag:"mo",output:"\u2227",ttype:CONST},{input:"\\lor",tag:"mo",output:"\u2228",ttype:CONST},{input:"\\vee",tag:"mo",output:"\u2228",ttype:CONST},{input:"\\cap",tag:"mo",output:"\u2229",ttype:CONST},{input:"\\cup",tag:"mo",output:"\u222A",ttype:CONST},{input:"\\sqcap",tag:"mo",output:"\u2293",ttype:CONST},{input:"\\sqcup",tag:"mo",output:"\u2294",ttype:CONST},{input:"\\uplus",tag:"mo",output:"\u228E",ttype:CONST},{input:"\\amalg",tag:"mo",output:"\u2210",ttype:CONST},{input:"\\bigtriangleup",tag:"mo",output:"\u25B3",ttype:CONST},{input:"\\bigtriangledown",tag:"mo",output:"\u25BD",ttype:CONST},{input:"\\dag",tag:"mo",output:"\u2020",ttype:CONST},{input:"\\dagger",tag:"mo",output:"\u2020",ttype:CONST},{input:"\\ddag",tag:"mo",output:"\u2021",ttype:CONST},{input:"\\ddagger",tag:"mo",output:"\u2021",ttype:CONST},{input:"\\lhd",tag:"mo",output:"\u22B2",ttype:CONST},{input:"\\rhd",tag:"mo",output:"\u22B3",ttype:CONST},{input:"\\unlhd",tag:"mo",output:"\u22B4",ttype:CONST},{input:"\\unrhd",tag:"mo",output:"\u22B5",ttype:CONST},{input:"\\sum",tag:"mo",output:"\u2211",ttype:UNDEROVER},{input:"\\prod",tag:"mo",output:"\u220F",ttype:UNDEROVER},{input:"\\bigcap",tag:"mo",output:"\u22C2",ttype:UNDEROVER},{input:"\\bigcup",tag:"mo",output:"\u22C3",ttype:UNDEROVER},{input:"\\bigwedge",tag:"mo",output:"\u22C0",ttype:UNDEROVER},{input:"\\bigvee",tag:"mo",output:"\u22C1",ttype:UNDEROVER},{input:"\\bigsqcap",tag:"mo",output:"\u2A05",ttype:UNDEROVER},{input:"\\bigsqcup",tag:"mo",output:"\u2A06",ttype:UNDEROVER},{input:"\\coprod",tag:"mo",output:"\u2210",ttype:UNDEROVER},{input:"\\bigoplus",tag:"mo",output:"\u2A01",ttype:UNDEROVER},{input:"\\bigotimes",tag:"mo",output:"\u2A02",ttype:UNDEROVER},{input:"\\bigodot",tag:"mo",output:"\u2A00",ttype:UNDEROVER},{input:"\\biguplus",tag:"mo",output:"\u2A04",ttype:UNDEROVER},{input:"\\int",tag:"mo",output:"\u222B",ttype:CONST},{input:"\\oint",tag:"mo",output:"\u222E",ttype:CONST},{input:":=",tag:"mo",output:":=",ttype:CONST},{input:"\\lt",tag:"mo",output:"<",ttype:CONST},{input:"\\gt",tag:"mo",output:">",ttype:CONST},{input:"\\ne",tag:"mo",output:"\u2260",ttype:CONST},{input:"\\neq",tag:"mo",output:"\u2260",ttype:CONST},{input:"\\le",tag:"mo",output:"\u2264",ttype:CONST},{input:"\\leq",tag:"mo",output:"\u2264",ttype:CONST},{input:"\\leqslant",tag:"mo",output:"\u2264",ttype:CONST},{input:"\\ge",tag:"mo",output:"\u2265",ttype:CONST},{input:"\\geq",tag:"mo",output:"\u2265",ttype:CONST},{input:"\\geqslant",tag:"mo",output:"\u2265",ttype:CONST},{input:"\\equiv",tag:"mo",output:"\u2261",ttype:CONST},{input:"\\ll",tag:"mo",output:"\u226A",ttype:CONST},{input:"\\gg",tag:"mo",output:"\u226B",ttype:CONST},{input:"\\doteq",tag:"mo",output:"\u2250",ttype:CONST},{input:"\\prec",tag:"mo",output:"\u227A",ttype:CONST},{input:"\\succ",tag:"mo",output:"\u227B",ttype:CONST},{input:"\\preceq",tag:"mo",output:"\u227C",ttype:CONST},{input:"\\succeq",tag:"mo",output:"\u227D",ttype:CONST},{input:"\\subset",tag:"mo",output:"\u2282",ttype:CONST},{input:"\\supset",tag:"mo",output:"\u2283",ttype:CONST},{input:"\\subseteq",tag:"mo",output:"\u2286",ttype:CONST},{input:"\\supseteq",tag:"mo",output:"\u2287",ttype:CONST},{input:"\\sqsubset",tag:"mo",output:"\u228F",ttype:CONST},{input:"\\sqsupset",tag:"mo",output:"\u2290",ttype:CONST},{input:"\\sqsubseteq",tag:"mo",output:"\u2291",ttype:CONST},{input:"\\sqsupseteq",tag:"mo",output:"\u2292",ttype:CONST},{input:"\\sim",tag:"mo",output:"\u223C",ttype:CONST},{input:"\\simeq",tag:"mo",output:"\u2243",ttype:CONST},{input:"\\approx",tag:"mo",output:"\u2248",ttype:CONST},{input:"\\cong",tag:"mo",output:"\u2245",ttype:CONST},{input:"\\Join",tag:"mo",output:"\u22C8",ttype:CONST},{input:"\\bowtie",tag:"mo",output:"\u22C8",ttype:CONST},{input:"\\in",tag:"mo",output:"\u2208",ttype:CONST},{input:"\\ni",tag:"mo",output:"\u220B",ttype:CONST},{input:"\\owns",tag:"mo",output:"\u220B",ttype:CONST},{input:"\\propto",tag:"mo",output:"\u221D",ttype:CONST},{input:"\\vdash",tag:"mo",output:"\u22A2",ttype:CONST},{input:"\\dashv",tag:"mo",output:"\u22A3",ttype:CONST},{input:"\\models",tag:"mo",output:"\u22A8",ttype:CONST},{input:"\\perp",tag:"mo",output:"\u22A5",ttype:CONST},{input:"\\smile",tag:"mo",output:"\u2323",ttype:CONST},{input:"\\frown",tag:"mo",output:"\u2322",ttype:CONST},{input:"\\asymp",tag:"mo",output:"\u224D",ttype:CONST},{input:"\\notin",tag:"mo",output:"\u2209",ttype:CONST},{input:"\\begin{eqnarray}",output:"X",ttype:MATRIX,invisible:true},{input:"\\begin{array}",output:"X",ttype:MATRIX,invisible:true},{input:"\\\\",output:"}&{",ttype:DEFINITION},{input:"\\end{eqnarray}",output:"}}",ttype:DEFINITION},{input:"\\end{array}",output:"}}",ttype:DEFINITION},{input:"\\big",tag:"mo",output:"X",atval:"1.2",ieval:"2.2",ttype:BIG},{input:"\\Big",tag:"mo",output:"X",atval:"1.6",ieval:"2.6",ttype:BIG},{input:"\\bigg",tag:"mo",output:"X",atval:"2.2",ieval:"3.2",ttype:BIG},{input:"\\Bigg",tag:"mo",output:"X",atval:"2.9",ieval:"3.9",ttype:BIG},{input:"\\left",tag:"mo",output:"X",ttype:LEFTBRACKET},{input:"\\right",tag:"mo",output:"X",ttype:RIGHTBRACKET},{input:"{",output:"{",ttype:LEFTBRACKET,invisible:true},{input:"}",output:"}",ttype:RIGHTBRACKET,invisible:true},{input:"(",tag:"mo",output:"(",atval:"1",ttype:STRETCHY},{input:"[",tag:"mo",output:"[",atval:"1",ttype:STRETCHY},{input:"\\lbrack",tag:"mo",output:"[",atval:"1",ttype:STRETCHY},{input:"\\{",tag:"mo",output:"{",atval:"1",ttype:STRETCHY},{input:"\\lbrace",tag:"mo",output:"{",atval:"1",ttype:STRETCHY},{input:"\\langle",tag:"mo",output:"\u2329",atval:"1",ttype:STRETCHY},{input:"\\lfloor",tag:"mo",output:"\u230A",atval:"1",ttype:STRETCHY},{input:"\\lceil",tag:"mo",output:"\u2308",atval:"1",ttype:STRETCHY},{input:")",tag:"mo",output:")",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"]",tag:"mo",output:"]",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rbrack",tag:"mo",output:"]",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\}",tag:"mo",output:"}",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rbrace",tag:"mo",output:"}",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rangle",tag:"mo",output:"\u232A",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rfloor",tag:"mo",output:"\u230B",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rceil",tag:"mo",output:"\u2309",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"|",tag:"mo",output:"\u2223",atval:"1",ttype:STRETCHY},{input:"\\|",tag:"mo",output:"\u2225",atval:"1",ttype:STRETCHY},{input:"\\vert",tag:"mo",output:"\u2223",atval:"1",ttype:STRETCHY},{input:"\\Vert",tag:"mo",output:"\u2225",atval:"1",ttype:STRETCHY},{input:"\\mid",tag:"mo",output:"\u2223",atval:"1",ttype:STRETCHY},{input:"\\parallel",tag:"mo",output:"\u2225",atval:"1",ttype:STRETCHY},{input:"/",tag:"mo",output:"/",atval:"1.01",ttype:STRETCHY},{input:"\\backslash",tag:"mo",output:"\u2216",atval:"1",ttype:STRETCHY},{input:"\\setminus",tag:"mo",output:"\\",ttype:CONST},{input:"\\!",tag:"mspace",atname:"width",atval:"-0.167em",ttype:SPACE},{input:"\\,",tag:"mspace",atname:"width",atval:"0.167em",ttype:SPACE},{input:"\\>",tag:"mspace",atname:"width",atval:"0.222em",ttype:SPACE},{input:"\\:",tag:"mspace",atname:"width",atval:"0.222em",ttype:SPACE},{input:"\\;",tag:"mspace",atname:"width",atval:"0.278em",ttype:SPACE},{input:"~",tag:"mspace",atname:"width",atval:"0.333em",ttype:SPACE},{input:"\\quad",tag:"mspace",atname:"width",atval:"1em",ttype:SPACE},{input:"\\qquad",tag:"mspace",atname:"width",atval:"2em",ttype:SPACE},{input:"\\prime",tag:"mo",output:"\u2032",ttype:CONST},{input:"'",tag:"mo",output:"\u02B9",ttype:CONST},{input:"''",tag:"mo",output:"\u02BA",ttype:CONST},{input:"'''",tag:"mo",output:"\u2034",ttype:CONST},{input:"''''",tag:"mo",output:"\u2057",ttype:CONST},{input:"\\ldots",tag:"mo",output:"\u2026",ttype:CONST},{input:"\\cdots",tag:"mo",output:"\u22EF",ttype:CONST},{input:"\\vdots",tag:"mo",output:"\u22EE",ttype:CONST},{input:"\\ddots",tag:"mo",output:"\u22F1",ttype:CONST},{input:"\\forall",tag:"mo",output:"\u2200",ttype:CONST},{input:"\\exists",tag:"mo",output:"\u2203",ttype:CONST},{input:"\\Re",tag:"mo",output:"\u211C",ttype:CONST},{input:"\\Im",tag:"mo",output:"\u2111",ttype:CONST},{input:"\\aleph",tag:"mo",output:"\u2135",ttype:CONST},{input:"\\hbar",tag:"mo",output:"\u210F",ttype:CONST},{input:"\\ell",tag:"mo",output:"\u2113",ttype:CONST},{input:"\\wp",tag:"mo",output:"\u2118",ttype:CONST},{input:"\\emptyset",tag:"mo",output:"\u2205",ttype:CONST},{input:"\\infty",tag:"mo",output:"\u221E",ttype:CONST},{input:"\\surd",tag:"mo",output:"\\sqrt{}",ttype:DEFINITION},{input:"\\partial",tag:"mo",output:"\u2202",ttype:CONST},{input:"\\nabla",tag:"mo",output:"\u2207",ttype:CONST},{input:"\\triangle",tag:"mo",output:"\u25B3",ttype:CONST},{input:"\\therefore",tag:"mo",output:"\u2234",ttype:CONST},{input:"\\angle",tag:"mo",output:"\u2220",ttype:CONST},{input:"\\diamond",tag:"mo",output:"\u22C4",ttype:CONST},{input:"\\Diamond",tag:"mo",output:"\u25C7",ttype:CONST},{input:"\\neg",tag:"mo",output:"\u00AC",ttype:CONST},{input:"\\lnot",tag:"mo",output:"\u00AC",ttype:CONST},{input:"\\bot",tag:"mo",output:"\u22A5",ttype:CONST},{input:"\\top",tag:"mo",output:"\u22A4",ttype:CONST},{input:"\\square",tag:"mo",output:"\u25AB",ttype:CONST},{input:"\\Box",tag:"mo",output:"\u25A1",ttype:CONST},{input:"\\wr",tag:"mo",output:"\u2240",ttype:CONST},{input:"\\arccos",tag:"mi",output:"arccos",ttype:UNARY,func:true},{input:"\\arcsin",tag:"mi",output:"arcsin",ttype:UNARY,func:true},{input:"\\arctan",tag:"mi",output:"arctan",ttype:UNARY,func:true},{input:"\\arg",tag:"mi",output:"arg",ttype:UNARY,func:true},{input:"\\cos",tag:"mi",output:"cos",ttype:UNARY,func:true},{input:"\\cosh",tag:"mi",output:"cosh",ttype:UNARY,func:true},{input:"\\cot",tag:"mi",output:"cot",ttype:UNARY,func:true},{input:"\\coth",tag:"mi",output:"coth",ttype:UNARY,func:true},{input:"\\csc",tag:"mi",output:"csc",ttype:UNARY,func:true},{input:"\\deg",tag:"mi",output:"deg",ttype:UNARY,func:true},{input:"\\det",tag:"mi",output:"det",ttype:UNARY,func:true},{input:"\\dim",tag:"mi",output:"dim",ttype:UNARY,func:true},{input:"\\exp",tag:"mi",output:"exp",ttype:UNARY,func:true},{input:"\\gcd",tag:"mi",output:"gcd",ttype:UNARY,func:true},{input:"\\hom",tag:"mi",output:"hom",ttype:UNARY,func:true},{input:"\\inf",tag:"mo",output:"inf",ttype:UNDEROVER},{input:"\\ker",tag:"mi",output:"ker",ttype:UNARY,func:true},{input:"\\lg",tag:"mi",output:"lg",ttype:UNARY,func:true},{input:"\\lim",tag:"mo",output:"lim",ttype:UNDEROVER},{input:"\\liminf",tag:"mo",output:"liminf",ttype:UNDEROVER},{input:"\\limsup",tag:"mo",output:"limsup",ttype:UNDEROVER},{input:"\\ln",tag:"mi",output:"ln",ttype:UNARY,func:true},{input:"\\log",tag:"mi",output:"log",ttype:UNARY,func:true},{input:"\\max",tag:"mo",output:"max",ttype:UNDEROVER},{input:"\\min",tag:"mo",output:"min",ttype:UNDEROVER},{input:"\\Pr",tag:"mi",output:"Pr",ttype:UNARY,func:true},{input:"\\sec",tag:"mi",output:"sec",ttype:UNARY,func:true},{input:"\\sin",tag:"mi",output:"sin",ttype:UNARY,func:true},{input:"\\sinh",tag:"mi",output:"sinh",ttype:UNARY,func:true},{input:"\\sup",tag:"mo",output:"sup",ttype:UNDEROVER},{input:"\\tan",tag:"mi",output:"tan",ttype:UNARY,func:true},{input:"\\tanh",tag:"mi",output:"tanh",ttype:UNARY,func:true},{input:"\\gets",tag:"mo",output:"\u2190",ttype:CONST},{input:"\\leftarrow",tag:"mo",output:"\u2190",ttype:CONST},{input:"\\to",tag:"mo",output:"\u2192",ttype:CONST},{input:"\\rightarrow",tag:"mo",output:"\u2192",ttype:CONST},{input:"\\leftrightarrow",tag:"mo",output:"\u2194",ttype:CONST},{input:"\\uparrow",tag:"mo",output:"\u2191",ttype:CONST},{input:"\\downarrow",tag:"mo",output:"\u2193",ttype:CONST},{input:"\\updownarrow",tag:"mo",output:"\u2195",ttype:CONST},{input:"\\Leftarrow",tag:"mo",output:"\u21D0",ttype:CONST},{input:"\\Rightarrow",tag:"mo",output:"\u21D2",ttype:CONST},{input:"\\Leftrightarrow",tag:"mo",output:"\u21D4",ttype:CONST},{input:"\\iff",tag:"mo",output:"~\\Longleftrightarrow~",ttype:DEFINITION},{input:"\\Uparrow",tag:"mo",output:"\u21D1",ttype:CONST},{input:"\\Downarrow",tag:"mo",output:"\u21D3",ttype:CONST},{input:"\\Updownarrow",tag:"mo",output:"\u21D5",ttype:CONST},{input:"\\mapsto",tag:"mo",output:"\u21A6",ttype:CONST},{input:"\\longleftarrow",tag:"mo",output:"\u2190",ttype:LONG},{input:"\\longrightarrow",tag:"mo",output:"\u2192",ttype:LONG},{input:"\\longleftrightarrow",tag:"mo",output:"\u2194",ttype:LONG},{input:"\\Longleftarrow",tag:"mo",output:"\u21D0",ttype:LONG},{input:"\\Longrightarrow",tag:"mo",output:"\u21D2",ttype:LONG},{input:"\\Longleftrightarrow",tag:"mo",output:"\u21D4",ttype:LONG},{input:"\\longmapsto",tag:"mo",output:"\u21A6",ttype:CONST},AMsqrt,AMroot,AMfrac,AMover,AMsub,AMsup,AMtext,AMmbox,AMatop,AMchoose,{input:"\\acute",tag:"mover",output:"\u00B4",ttype:UNARY,acc:true},{input:"\\grave",tag:"mover",output:"\u0060",ttype:UNARY,acc:true},{input:"\\breve",tag:"mover",output:"\u02D8",ttype:UNARY,acc:true},{input:"\\check",tag:"mover",output:"\u02C7",ttype:UNARY,acc:true},{input:"\\dot",tag:"mover",output:".",ttype:UNARY,acc:true},{input:"\\ddot",tag:"mover",output:"..",ttype:UNARY,acc:true},{input:"\\mathring",tag:"mover",output:"\u00B0",ttype:UNARY,acc:true},{input:"\\vec",tag:"mover",output:"\u20D7",ttype:UNARY,acc:true},{input:"\\overrightarrow",tag:"mover",output:"\u20D7",ttype:UNARY,acc:true},{input:"\\overleftarrow",tag:"mover",output:"\u20D6",ttype:UNARY,acc:true},{input:"\\hat",tag:"mover",output:"\u005E",ttype:UNARY,acc:true},{input:"\\widehat",tag:"mover",output:"\u0302",ttype:UNARY,acc:true},{input:"\\tilde",tag:"mover",output:"~",ttype:UNARY,acc:true},{input:"\\widetilde",tag:"mover",output:"\u02DC",ttype:UNARY,acc:true},{input:"\\bar",tag:"mover",output:"\u203E",ttype:UNARY,acc:true},{input:"\\overbrace",tag:"mover",output:"\uFE37",ttype:UNARY,acc:true},{input:"\\overbracket",tag:"mover",output:"\u23B4",ttype:UNARY,acc:true},{input:"\\overline",tag:"mover",output:"\u00AF",ttype:UNARY,acc:true},{input:"\\underbrace",tag:"munder",output:"\uFE38",ttype:UNARY,acc:true},{input:"\\underbracket",tag:"munder",output:"\u23B5",ttype:UNARY,acc:true},{input:"\\underline",tag:"munder",output:"\u00AF",ttype:UNARY,acc:true},{input:"\\displaystyle",tag:"mstyle",atname:"displaystyle",atval:"true",ttype:UNARY},{input:"\\textstyle",tag:"mstyle",atname:"displaystyle",atval:"false",ttype:UNARY},{input:"\\scriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"1",ttype:UNARY},{input:"\\scriptscriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"2",ttype:UNARY},{input:"\\textrm",tag:"mstyle",output:"\\mathrm",ttype:DEFINITION},{input:"\\mathbf",tag:"mstyle",atname:"mathvariant",atval:"bold",ttype:UNARY},{input:"\\textbf",tag:"mstyle",atname:"mathvariant",atval:"bold",ttype:UNARY},{input:"\\mathit",tag:"mstyle",atname:"mathvariant",atval:"italic",ttype:UNARY},{input:"\\textit",tag:"mstyle",atname:"mathvariant",atval:"italic",ttype:UNARY},{input:"\\mathtt",tag:"mstyle",atname:"mathvariant",atval:"monospace",ttype:UNARY},{input:"\\texttt",tag:"mstyle",atname:"mathvariant",atval:"monospace",ttype:UNARY},{input:"\\mathsf",tag:"mstyle",atname:"mathvariant",atval:"sans-serif",ttype:UNARY},{input:"\\mathbb",tag:"mstyle",atname:"mathvariant",atval:"double-struck",ttype:UNARY,codes:AMbbb},{input:"\\mathcal",tag:"mstyle",atname:"mathvariant",atval:"script",ttype:UNARY,codes:AMcal},{input:"\\mathfrak",tag:"mstyle",atname:"mathvariant",atval:"fraktur",ttype:UNARY,codes:AMfrk},{input:"\\textcolor",tag:"mstyle",atname:"mathvariant",atval:"mathcolor",ttype:BINARY},{input:"\\colorbox",tag:"mstyle",atname:"mathvariant",atval:"background",ttype:BINARY}];function compareNames(s1,s2){if(s1.input>s2.input)return 1-else return-1;}-var AMnames=[];function AMinitSymbols(){AMsymbols.sort(compareNames);for(i=0;i<AMsymbols.length;i++)AMnames[i]=AMsymbols[i].input;}-var AMmathml="http://www.w3.org/1998/Math/MathML";function AMcreateElementMathML(t){if(isIE)return document.createElement("m:"+t);else return document.createElementNS(AMmathml,t);}-function AMcreateMmlNode(t,frag){if(isIE)var node=document.createElement("m:"+t);else var node=document.createElementNS(AMmathml,t);node.appendChild(frag);return node;}-function newcommand(oldstr,newstr){AMsymbols=AMsymbols.concat([{input:oldstr,tag:"mo",output:newstr,ttype:DEFINITION}]);}-function AMremoveCharsAndBlanks(str,n){var st;st=str.slice(n);for(var i=0;i<st.length&&st.charCodeAt(i)<=32;i=i+1);return st.slice(i);}-function AMposition(arr,str,n){if(n==0){var h,m;n=-1;h=arr.length;while(n+1<h){m=(n+h)>>1;if(arr[m]<str)n=m;else h=m;}-return h;}else-for(var i=n;i<arr.length&&arr[i]<str;i++);return i;}-function AMgetSymbol(str){var k=0;var j=0;var mk;var st;var tagst;var match="";var more=true;for(var i=1;i<=str.length&&more;i++){st=str.slice(0,i);j=k;k=AMposition(AMnames,st,j);if(k<AMnames.length&&str.slice(0,AMnames[k].length)==AMnames[k]){match=AMnames[k];mk=k;i=match.length;}-more=k<AMnames.length&&str.slice(0,AMnames[k].length)>=AMnames[k];}-AMpreviousSymbol=AMcurrentSymbol;if(match!=""){AMcurrentSymbol=AMsymbols[mk].ttype;return AMsymbols[mk];}-AMcurrentSymbol=CONST;k=1;st=str.slice(0,1);if("0"<=st&&st<="9")tagst="mn";else tagst=(("A">st||st>"Z")&&("a">st||st>"z")?"mo":"mi");return{input:st,tag:tagst,output:st,ttype:CONST};}-var AMpreviousSymbol,AMcurrentSymbol;function AMparseSexpr(str){var symbol,node,result,result2,i,st,newFrag=document.createDocumentFragment();str=AMremoveCharsAndBlanks(str,0);symbol=AMgetSymbol(str);if(symbol==null||symbol.ttype==RIGHTBRACKET)-return[null,str,null];if(symbol.ttype==DEFINITION){str=symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length);symbol=AMgetSymbol(str);if(symbol==null||symbol.ttype==RIGHTBRACKET)-return[null,str,null];}-str=AMremoveCharsAndBlanks(str,symbol.input.length);switch(symbol.ttype){case SPACE:node=AMcreateElementMathML(symbol.tag);node.setAttribute(symbol.atname,symbol.atval);return[node,str,symbol.tag];case UNDEROVER:if(isIE){if(symbol.input.substr(0,4)=="\\big"){str="\\"+symbol.input.substr(4)+str;symbol=AMgetSymbol(str);symbol.ttype=UNDEROVER;str=AMremoveCharsAndBlanks(str,symbol.input.length);}}-return[AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)),str,symbol.tag];case CONST:var output=symbol.output;if(isIE){if(symbol.input=="'")-output="\u2032";else if(symbol.input=="''")-output="\u2033";else if(symbol.input=="'''")-output="\u2033\u2032";else if(symbol.input=="''''")-output="\u2033\u2033";else if(symbol.input=="\\square")-output="\u25A1";else if(symbol.input.substr(0,5)=="\\frac"){var denom=symbol.input.substr(6,1);if(denom=="5"||denom=="6"){str=symbol.input.replace(/\\frac/,"\\frac ")+str;return[node,str,symbol.tag];}}}-node=AMcreateMmlNode(symbol.tag,document.createTextNode(output));return[node,str,symbol.tag];case LONG:node=AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output));node.setAttribute("minsize","1.5");node.setAttribute("maxsize","1.5");node=AMcreateMmlNode("mover",node);node.appendChild(AMcreateElementMathML("mspace"));return[node,str,symbol.tag];case STRETCHY:if(isIE&&symbol.input=="\\backslash")-symbol.output="\\";node=AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output));if(symbol.input=="|"||symbol.input=="\\vert"||symbol.input=="\\|"||symbol.input=="\\Vert"){node.setAttribute("lspace","0em");node.setAttribute("rspace","0em");}-node.setAttribute("maxsize",symbol.atval);if(symbol.rtag!=null)-return[node,str,symbol.rtag];else-return[node,str,symbol.tag];case BIG:var atval=symbol.atval;if(isIE)-atval=symbol.ieval;symbol=AMgetSymbol(str);if(symbol==null)-return[null,str,null];str=AMremoveCharsAndBlanks(str,symbol.input.length);node=AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output));if(isIE){var space=AMcreateElementMathML("mspace");space.setAttribute("height",atval+"ex");node=AMcreateMmlNode("mrow",node);node.appendChild(space);}else{node.setAttribute("minsize",atval);node.setAttribute("maxsize",atval);}-return[node,str,symbol.tag];case LEFTBRACKET:if(symbol.input=="\\left"){symbol=AMgetSymbol(str);if(symbol!=null){if(symbol.input==".")-symbol.invisible=true;str=AMremoveCharsAndBlanks(str,symbol.input.length);}}-result=AMparseExpr(str,true,false);if(symbol==null||(typeof symbol.invisible=="boolean"&&symbol.invisible))-node=AMcreateMmlNode("mrow",result[0]);else{node=AMcreateMmlNode("mo",document.createTextNode(symbol.output));node=AMcreateMmlNode("mrow",node);node.appendChild(result[0]);}-return[node,result[1],result[2]];case MATRIX:if(symbol.input=="\\begin{array}"){var mask="";symbol=AMgetSymbol(str);str=AMremoveCharsAndBlanks(str,0);if(symbol==null)-mask="l";else{str=AMremoveCharsAndBlanks(str,symbol.input.length);if(symbol.input!="{")-mask="l";else do{symbol=AMgetSymbol(str);if(symbol!=null){str=AMremoveCharsAndBlanks(str,symbol.input.length);if(symbol.input!="}")-mask=mask+symbol.input;}}while(symbol!=null&&symbol.input!=""&&symbol.input!="}");}-result=AMparseExpr("{"+str,true,true);node=AMcreateMmlNode("mtable",result[0]);mask=mask.replace(/l/g,"left ");mask=mask.replace(/r/g,"right ");mask=mask.replace(/c/g,"center ");node.setAttribute("columnalign",mask);node.setAttribute("displaystyle","false");if(isIE)-return[node,result[1],null];var lspace=AMcreateElementMathML("mspace");lspace.setAttribute("width","0.167em");var rspace=AMcreateElementMathML("mspace");rspace.setAttribute("width","0.167em");var node1=AMcreateMmlNode("mrow",lspace);node1.appendChild(node);node1.appendChild(rspace);return[node1,result[1],null];}else{result=AMparseExpr("{"+str,true,true);node=AMcreateMmlNode("mtable",result[0]);if(isIE)-node.setAttribute("columnspacing","0.25em");else-node.setAttribute("columnspacing","0.167em");node.setAttribute("columnalign","right center left");node.setAttribute("displaystyle","true");node=AMcreateMmlNode("mrow",node);return[node,result[1],null];}-case TEXT:if(str.charAt(0)=="{")i=str.indexOf("}");else i=0;if(i==-1)-i=str.length;st=str.slice(1,i);if(st.charAt(0)==" "){node=AMcreateElementMathML("mspace");node.setAttribute("width","0.33em");newFrag.appendChild(node);}-newFrag.appendChild(AMcreateMmlNode(symbol.tag,document.createTextNode(st)));if(st.charAt(st.length-1)==" "){node=AMcreateElementMathML("mspace");node.setAttribute("width","0.33em");newFrag.appendChild(node);}-str=AMremoveCharsAndBlanks(str,i+1);return[AMcreateMmlNode("mrow",newFrag),str,null];case UNARY:result=AMparseSexpr(str);if(result[0]==null)return[AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)),str];if(typeof symbol.func=="boolean"&&symbol.func){st=str.charAt(0);if(st=="^"||st=="_"||st==","){return[AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)),str,symbol.tag];}else{node=AMcreateMmlNode("mrow",AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)));if(isIE){var space=AMcreateElementMathML("mspace");space.setAttribute("width","0.167em");node.appendChild(space);}-node.appendChild(result[0]);return[node,result[1],symbol.tag];}}-if(symbol.input=="\\sqrt"){if(isIE){var space=AMcreateElementMathML("mspace");space.setAttribute("height","1.2ex");space.setAttribute("width","0em");node=AMcreateMmlNode(symbol.tag,result[0])-node.appendChild(space);return[node,result[1],symbol.tag];}else-return[AMcreateMmlNode(symbol.tag,result[0]),result[1],symbol.tag];}else if(typeof symbol.acc=="boolean"&&symbol.acc){node=AMcreateMmlNode(symbol.tag,result[0]);var output=symbol.output;if(isIE){if(symbol.input=="\\hat")-output="\u0302";else if(symbol.input=="\\widehat")-output="\u005E";else if(symbol.input=="\\bar")-output="\u00AF";else if(symbol.input=="\\grave")-output="\u0300";else if(symbol.input=="\\tilde")-output="\u0303";}-var node1=AMcreateMmlNode("mo",document.createTextNode(output));if(symbol.input=="\\vec"||symbol.input=="\\check")-node1.setAttribute("maxsize","1.2");if(isIE&&symbol.input=="\\bar")-node1.setAttribute("maxsize","0.5");if(symbol.input=="\\underbrace"||symbol.input=="\\underline")-node1.setAttribute("accentunder","true");else-node1.setAttribute("accent","true");node.appendChild(node1);if(symbol.input=="\\overbrace"||symbol.input=="\\underbrace")-node.ttype=UNDEROVER;return[node,result[1],symbol.tag];}else{if(!isIE&&typeof symbol.codes!="undefined"){for(i=0;i<result[0].childNodes.length;i++)-if(result[0].childNodes[i].nodeName=="mi"||result[0].nodeName=="mi"){st=(result[0].nodeName=="mi"?result[0].firstChild.nodeValue:result[0].childNodes[i].firstChild.nodeValue);var newst=[];for(var j=0;j<st.length;j++)-if(st.charCodeAt(j)>64&&st.charCodeAt(j)<91)newst=newst+-String.fromCharCode(symbol.codes[st.charCodeAt(j)-65]);else newst=newst+st.charAt(j);if(result[0].nodeName=="mi")-result[0]=AMcreateElementMathML("mo").appendChild(document.createTextNode(newst));else result[0].replaceChild(AMcreateElementMathML("mo").appendChild(document.createTextNode(newst)),result[0].childNodes[i]);}}-node=AMcreateMmlNode(symbol.tag,result[0]);node.setAttribute(symbol.atname,symbol.atval);if(symbol.input=="\\scriptstyle"||symbol.input=="\\scriptscriptstyle")-node.setAttribute("displaystyle","false");return[node,result[1],symbol.tag];}-case BINARY:result=AMparseSexpr(str);if(result[0]==null)return[AMcreateMmlNode("mo",document.createTextNode(symbol.input)),str,null];result2=AMparseSexpr(result[1]);if(result2[0]==null)return[AMcreateMmlNode("mo",document.createTextNode(symbol.input)),str,null];if(symbol.input=="\\textcolor"||symbol.input=="\\colorbox"){var tclr=str.match(/\{\s*([#\w]+)\s*\}/);str=str.replace(/\{\s*[#\w]+\s*\}/,"");if(tclr!=null){if(IsColorName.test(tclr[1].toLowerCase())){tclr=LaTeXColor[tclr[1].toLowerCase()];}else{tclr=tclr[1];}-node=AMcreateElementMathML("mstyle");node.setAttribute(symbol.atval,tclr);node.appendChild(result2[0]);return[node,result2[1],symbol.tag];}}-if(symbol.input=="\\root"||symbol.input=="\\stackrel")newFrag.appendChild(result2[0]);newFrag.appendChild(result[0]);if(symbol.input=="\\frac")newFrag.appendChild(result2[0]);return[AMcreateMmlNode(symbol.tag,newFrag),result2[1],symbol.tag];case INFIX:str=AMremoveCharsAndBlanks(str,symbol.input.length);return[AMcreateMmlNode("mo",document.createTextNode(symbol.output)),str,symbol.tag];default:return[AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)),str,symbol.tag];}}-function AMparseIexpr(str){var symbol,sym1,sym2,node,result,tag,underover;str=AMremoveCharsAndBlanks(str,0);sym1=AMgetSymbol(str);result=AMparseSexpr(str);node=result[0];str=result[1];tag=result[2];symbol=AMgetSymbol(str);if(symbol.ttype==INFIX){str=AMremoveCharsAndBlanks(str,symbol.input.length);result=AMparseSexpr(str);if(result[0]==null)-result[0]=AMcreateMmlNode("mo",document.createTextNode("\u25A1"));str=result[1];tag=result[2];if(symbol.input=="_"||symbol.input=="^"){sym2=AMgetSymbol(str);tag=null;underover=((sym1.ttype==UNDEROVER)||(node.ttype==UNDEROVER));if(symbol.input=="_"&&sym2.input=="^"){str=AMremoveCharsAndBlanks(str,sym2.input.length);var res2=AMparseSexpr(str);str=res2[1];tag=res2[2];node=AMcreateMmlNode((underover?"munderover":"msubsup"),node);node.appendChild(result[0]);node.appendChild(res2[0]);}else if(symbol.input=="_"){node=AMcreateMmlNode((underover?"munder":"msub"),node);node.appendChild(result[0]);}else{node=AMcreateMmlNode((underover?"mover":"msup"),node);node.appendChild(result[0]);}-node=AMcreateMmlNode("mrow",node);}else{node=AMcreateMmlNode(symbol.tag,node);if(symbol.input=="\\atop"||symbol.input=="\\choose")-node.setAttribute("linethickness","0ex");node.appendChild(result[0]);if(symbol.input=="\\choose")-node=AMcreateMmlNode("mfenced",node);}}-return[node,str,tag];}-function AMparseExpr(str,rightbracket,matrix){var symbol,node,result,i,tag,newFrag=document.createDocumentFragment();do{str=AMremoveCharsAndBlanks(str,0);result=AMparseIexpr(str);node=result[0];str=result[1];tag=result[2];symbol=AMgetSymbol(str);if(node!=undefined){if((tag=="mn"||tag=="mi")&&symbol!=null&&typeof symbol.func=="boolean"&&symbol.func){var space=AMcreateElementMathML("mspace");space.setAttribute("width","0.167em");node=AMcreateMmlNode("mrow",node);node.appendChild(space);}-newFrag.appendChild(node);}}while((symbol.ttype!=RIGHTBRACKET)&&symbol!=null&&symbol.output!="");tag=null;if(symbol.ttype==RIGHTBRACKET){if(symbol.input=="\\right"){str=AMremoveCharsAndBlanks(str,symbol.input.length);symbol=AMgetSymbol(str);if(symbol!=null&&symbol.input==".")-symbol.invisible=true;if(symbol!=null)-tag=symbol.rtag;}-if(symbol!=null)-str=AMremoveCharsAndBlanks(str,symbol.input.length);var len=newFrag.childNodes.length;if(matrix&&len>0&&newFrag.childNodes[len-1].nodeName=="mrow"&&len>1&&newFrag.childNodes[len-2].nodeName=="mo"&&newFrag.childNodes[len-2].firstChild.nodeValue=="&"){var pos=[];var m=newFrag.childNodes.length;for(i=0;matrix&&i<m;i=i+2){pos[i]=[];node=newFrag.childNodes[i];for(var j=0;j<node.childNodes.length;j++)-if(node.childNodes[j].firstChild.nodeValue=="&")-pos[i][pos[i].length]=j;}-var row,frag,n,k,table=document.createDocumentFragment();for(i=0;i<m;i=i+2){row=document.createDocumentFragment();frag=document.createDocumentFragment();node=newFrag.firstChild;n=node.childNodes.length;k=0;for(j=0;j<n;j++){if(typeof pos[i][k]!="undefined"&&j==pos[i][k]){node.removeChild(node.firstChild);row.appendChild(AMcreateMmlNode("mtd",frag));k++;}else frag.appendChild(node.firstChild);}-row.appendChild(AMcreateMmlNode("mtd",frag));if(newFrag.childNodes.length>2){newFrag.removeChild(newFrag.firstChild);newFrag.removeChild(newFrag.firstChild);}-table.appendChild(AMcreateMmlNode("mtr",row));}-return[table,str];}-if(typeof symbol.invisible!="boolean"||!symbol.invisible){node=AMcreateMmlNode("mo",document.createTextNode(symbol.output));newFrag.appendChild(node);}}-return[newFrag,str,tag];}-function AMparseMath(str){var result,node=AMcreateElementMathML("mstyle");var cclr=str.match(/\\color\s*\{\s*([#\w]+)\s*\}/);str=str.replace(/\\color\s*\{\s*[#\w]+\s*\}/g,"");if(cclr!=null){if(IsColorName.test(cclr[1].toLowerCase())){cclr=LaTeXColor[cclr[1].toLowerCase()];}else{cclr=cclr[1];}-node.setAttribute("mathcolor",cclr);}else{if(mathcolor!="")node.setAttribute("mathcolor",mathcolor);};if(mathfontfamily!="")node.setAttribute("fontfamily",mathfontfamily);node.appendChild(AMparseExpr(str.replace(/^\s+/g,""),false,false)[0]);node=AMcreateMmlNode("math",node);if(showasciiformulaonhover)-node.setAttribute("title",str.replace(/\s+/g," "));if(false){var fnode=AMcreateElementXHTML("font");fnode.setAttribute("face",mathfontfamily);fnode.appendChild(node);return fnode;}-return node;}-function AMstrarr2docFrag(arr,linebreaks){var newFrag=document.createDocumentFragment();var expr=false;for(var i=0;i<arr.length;i++){if(expr)newFrag.appendChild(AMparseMath(arr[i]));else{var arri=(linebreaks?arr[i].split("\n\n"):[arr[i]]);newFrag.appendChild(AMcreateElementXHTML("span").appendChild(document.createTextNode(arri[0])));for(var j=1;j<arri.length;j++){newFrag.appendChild(AMcreateElementXHTML("p"));newFrag.appendChild(AMcreateElementXHTML("span").appendChild(document.createTextNode(arri[j])));}}-expr=!expr;}-return newFrag;}-function AMprocessNodeR(n,linebreaks){var mtch,str,arr,frg,i;if(n.childNodes.length==0){if((n.nodeType!=8||linebreaks)&&n.parentNode.nodeName!="form"&&n.parentNode.nodeName!="FORM"&&n.parentNode.nodeName!="textarea"&&n.parentNode.nodeName!="TEXTAREA"&&n.parentNode.nodeName!="pre"&&n.parentNode.nodeName!="PRE"){str=n.nodeValue;if(!(str==null)){str=str.replace(/\r\n\r\n/g,"\n\n");str=str.replace(/\x20+/g," ");str=str.replace(/\s*\r\n/g," ");mtch=(str.indexOf("\$")==-1?false:true);str=str.replace(/([^\\])\$/g,"$1 \$");str=str.replace(/^\$/," \$");arr=str.split(" \$");for(i=0;i<arr.length;i++)-arr[i]=arr[i].replace(/\\\$/g,"\$");if(arr.length>1||mtch){if(checkForMathML){checkForMathML=false;var nd=AMisMathMLavailable();AMnoMathML=nd!=null;if(AMnoMathML&¬ifyIfNoMathML)-if(alertIfNoMathML)-alert("To view the ASCIIMathML notation use Internet Explorer 6 +\nMathPlayer (free from www.dessci.com)\nor Firefox/Mozilla/Netscape");else AMbody.insertBefore(nd,AMbody.childNodes[0]);}-if(!AMnoMathML){frg=AMstrarr2docFrag(arr,n.nodeType==8);var len=frg.childNodes.length;n.parentNode.replaceChild(frg,n);return len-1;}else return 0;}}}else return 0;}else if(n.nodeName!="math"){for(i=0;i<n.childNodes.length;i++)-i+=AMprocessNodeR(n.childNodes[i],linebreaks);}-return 0;}-function AMprocessNode(n,linebreaks,spanclassAM){var frag,st;if(spanclassAM!=null){frag=document.getElementsByTagName("span")-for(var i=0;i<frag.length;i++)-if(frag[i].className=="AM")-AMprocessNodeR(frag[i],linebreaks);}else{try{st=n.innerHTML;}catch(err){}-if(st==null||st.indexOf("\$")!=-1)-AMprocessNodeR(n,linebreaks);}-if(isIE){frag=document.getElementsByTagName('math');for(var i=0;i<frag.length;i++)frag[i].update()}}-var inAppendix=false;var sectionCntr=0;var IEcommentWarning=true;var biblist=[];var bibcntr=0;var LaTeXCounter=[];LaTeXCounter["definition"]=0;LaTeXCounter["proposition"]=0;LaTeXCounter["lemma"]=0;LaTeXCounter["theorem"]=0;LaTeXCounter["corollary"]=0;LaTeXCounter["example"]=0;LaTeXCounter["exercise"]=0;LaTeXCounter["subsection"]=0;LaTeXCounter["subsubsection"]=0;LaTeXCounter["figure"]=0;LaTeXCounter["equation"]=0;LaTeXCounter["table"]=0;var LaTeXColor=[];LaTeXColor["greenyellow"]="#D9FF4F";LaTeXColor["yellow"]="#FFFF00";LaTeXColor["goldenrod"]="#FFE529";LaTeXColor["dandelion"]="#FFB529";LaTeXColor["apricot"]="#FFAD7A";LaTeXColor["peach"]="#FF804D";LaTeXColor["melon"]="#FF8A80";LaTeXColor["yelloworange"]="#FF9400";LaTeXColor["orange"]="#FF6321";LaTeXColor["burntorange"]="#FF7D00";LaTeXColor["bittersweet"]="#C20300";LaTeXColor["redorange"]="#FF3B21";LaTeXColor["mahogany"]="#A60000";LaTeXColor["maroon"]="#AD0000";LaTeXColor["brickred"]="#B80000";LaTeXColor["red"]="#FF0000";LaTeXColor["orangered"]="#FF0080";LaTeXColor["rubinered"]="#FF00DE";LaTeXColor["wildstrawberry"]="#FF0A9C";LaTeXColor["salmon"]="#FF789E";LaTeXColor["carnationpink"]="#FF5EFF";LaTeXColor["magenta"]="#FF00FF";LaTeXColor["violetred"]="#FF30FF";LaTeXColor["rhodamine"]="#FF2EFF";LaTeXColor["mulberry"]="#A314FA";LaTeXColor["redviolet"]="#9600A8";LaTeXColor["fuchsia"]="#7303EB";LaTeXColor["lavender"]="#FF85FF";LaTeXColor["thistle"]="#E069FF";LaTeXColor["orchid"]="#AD5CFF";LaTeXColor["darkorchid"]="#9933CC";LaTeXColor["purple"]="#8C24FF";LaTeXColor["plum"]="#8000FF";LaTeXColor["violet"]="#361FFF";LaTeXColor["royalpurple"]="#401AFF";LaTeXColor["blueviolet"]="#1A0DF5";LaTeXColor["periwinkle"]="#6E73FF";LaTeXColor["cadetblue"]="#616EC4";LaTeXColor["cornflowerblue"]="#59DEFF";LaTeXColor["midnightblue"]="#007091";LaTeXColor["navyblue"]="#0F75FF";LaTeXColor["royalblue"]="#0080FF";LaTeXColor["blue"]="#0000FF";LaTeXColor["cerulean"]="#0FE3FF";LaTeXColor["cyan"]="#00FFFF";LaTeXColor["processblue"]="#0AFFFF";LaTeXColor["skyblue"]="#61FFE0";LaTeXColor["turquoise"]="#26FFCC";LaTeXColor["tealblue"]="#1FFAA3";LaTeXColor["aquamarine"]="#2EFFB2";LaTeXColor["bluegreen"]="#26FFAB";LaTeXColor["emerald"]="#00FF80";LaTeXColor["junglegreen"]="#03FF7A";LaTeXColor["seagreen"]="#4FFF80";LaTeXColor["green"]="#00FF00";LaTeXColor["forestgreen"]="#00E000";LaTeXColor["pinegreen"]="#00BF29";LaTeXColor["limegreen"]="#80FF00";LaTeXColor["yellowgreen"]="#8FFF42";LaTeXColor["springgreen"]="#BDFF3D";LaTeXColor["olivegreen"]="#009900";LaTeXColor["rawsienna"]="#8C0000";LaTeXColor["sepia"]="#4D0000";LaTeXColor["brown"]="#660000";LaTeXColor["tan"]="#DB9470";LaTeXColor["gray"]="#808080";LaTeXColor["grey"]="#808080";LaTeXColor["black"]="#000000";LaTeXColor["white"]="#FFFFFF";var IsColorName=/^(?:greenyellow|yellow|goldenrod|dandelion|apricot|peach|melon|yelloworange|orange|burntorange|bittersweet|redorange|mahogany|maroon|brickred|red|orangered|rubinered|wildstrawberry|salmon|carnationpink|magenta|violetred|rhodamine|mulberry|redviolet|fuchsia|lavender|thistle|orchid|darkorchid|purple|plum|violet|royalpurple|blueviolet|periwinkle|cadetblue|cornflowerblue|midnightblue|navyblue|royalblue|blue|cerulean|cyan|processblue|skyblue|turquoise|tealblue|aquamarine|bluegreen|emerald|junglegreen|seagreen|green|forestgreen|pinegreen|limegreen|yellowgreen|springgreen|olivegreen|rawsienna|sepia|brown|tan|gray|grey|black|white)$/;var IsCounter=/^(?:definition|proposition|lemma|theorem|corollary|example|exercise|subsection|subsubsection|figure|equation|table)$/;var IsLaTeXElement=/^(?:displayequation|title|author|address|date|abstract|keyword|section|subsection|subsubsection|ref|cite|thebibliography|definition|proposition|lemma|theorem|corollary|example|exercise|itemize|enumerate|enddefinition|endproposition|endlemma|endtheorem|endcorollary|endexample|endexercise|enditemize|endenumerate|LaTeXMathMLlabel|LaTeXMathML|smallskip|medskip|bigskip|quote|quotation|endquote|endquotation|center|endcenter|description|enddescription|inlinemath)$/;var IsTextOnlyArea=/^(?:form|textarea|pre)$/i;var tableid=0;function makeNumberString(cntr){if(sectionCntr>0){if(inAppendix){return"A"+sectionCntr+"."+cntr;}else{return sectionCntr+"."+cntr;}}else{return""+cntr;}};function LaTeXpreProcess(thebody){var TheBody=thebody;if(TheBody.hasChildNodes()){if(!(IsLaTeXElement.test(TheBody.className)))-{for(var i=0;i<TheBody.childNodes.length;i++){LaTeXpreProcess(TheBody.childNodes[i])}}}-else{if(TheBody.nodeType==3&&!(IsTextOnlyArea.test(TheBody.parentNode.nodeName)))-{var str=TheBody.nodeValue;if(!(str==null)){str=str.replace(/\\%/g,"<per>");str=str.replace(/%[^\n]*(?=\n)/g,"");str=str.replace(/%[^\r]*(?=\r)/g,"");str=str.replace(/%[^\n]*$/,"")-if(isIE&&str.match(/%/g)!=null&&IEcommentWarning){alert("Comments may not have parsed properly. Try putting in <pre class='LaTeX><div>..</div></pre> structure.");IEcommentWarning=false;}-str=str.replace(/<per>/g,"%");if(str.match(/XXX[\s\S]*/)!=null){var tmp=str.match(/XXX[\s\S]*/)[0];var tmpstr=tmp.charCodeAt(7)+"::"+tmp.charCodeAt(8)+"::"+tmp.charCodeAt(9)+"::"+tmp.charCodeAt(10)+"::"+tmp.charCodeAt(11)+"::"+tmp.charCodeAt(12)+"::"+tmp.charCodeAt(13);alert(tmpstr);}-str=str.replace(/([^\\])\\(\s)/g,"$1\u00A0$2");str=str.replace(/\\quad/g,"\u2001");str=str.replace(/\\qquad/g,"\u2001\u2001");str=str.replace(/\\enspace/g,"\u2002");str=str.replace(/\\;/g,"\u2004");str=str.replace(/\\:/g,"\u2005");str=str.replace(/\\,/g,"\u2006");str=str.replace(/\\thinspace/g,"\u200A");str=str.replace(/([^\\])~/g,"$1\u00A0");str=str.replace(/\\~/g,"~");str=str.replace(/\\\[/g," <DEQ> $\\displaystyle{");str=str.replace(/\\\]/g,"}$ <DEQ> ");str=str.replace(/\$\$/g,"${$<DEQ>$}$");str=str.replace(/\\begin\s*\{\s*array\s*\}/g,"\\begin{array}");str=str.replace(/\\end\s*\{\s*array\s*\}/g,"\\end{array}");str=str.replace(/\\begin\s*\{\s*eqnarray\s*\}/g," <DEQ>eqno$\\begin{eqnarray}");str=str.replace(/\\end\s*\{\s*eqnarray\s*\}/g,"\\end{eqnarray}$<DEQ> ");str=str.replace(/\\begin\s*\{\s*eqnarray\*\s*\}/g," <DEQ>$\\begin{eqnarray}");str=str.replace(/\\end\s*\{\s*eqnarray\*\s*\}/g,"\\end{eqnarray}$<DEQ> ");str=str.replace(/\\begin\s*\{\s*displaymath\s*\}/g," <DEQ> $\\displaystyle{");str=str.replace(/\\end\s*\{\s*displaymath\s*\}/g,"}$ <DEQ> ");str=str.replace(/\\begin\s*\{\s*equation\s*\*\s*\}/g," <DEQ> $\\displaystyle{");str=str.replace(/\\end\s*\{\s*equation\s*\*\s*\}/g,"}$ <DEQ> ");str=str.replace(/\\begin\s*\{\s*equation\s*\}/g," <DEQ>eqno$\\displaystyle{");str=str.replace(/\\end\s*\{\s*equation\s*\}/g,"}$ <DEQ> ");str=str.split("<DEQ>");var newFrag=document.createDocumentFragment();for(var i=0;i<str.length;i++){if(i%2){var DEQtable=document.createElement("table");DEQtable.className='displayequation';var DEQtbody=document.createElement("tbody");var DEQtr=document.createElement("tr");var DEQtdeq=document.createElement("td");DEQtdeq.className='eq';str[i]=str[i].replace(/\$\}\$/g,"$\\displaystyle{");str[i]=str[i].replace(/\$\{\$/g,"}");var lbl=str[i].match(/\\label\s*\{\s*(\w+)\s*\}/);var ISeqno=str[i].match(/^eqno/);str[i]=str[i].replace(/^eqno/," ");str[i]=str[i].replace(/\\label\s*\{\s*\w+\s*\}/," ");DEQtdeq.appendChild(document.createTextNode(str[i]));DEQtr.appendChild(DEQtdeq);str[i]=str[i].replace(/\\nonumber/g,"");if(ISeqno!=null||lbl!=null){var DEQtdno=document.createElement("td");DEQtdno.className='eqno';LaTeXCounter["equation"]++;var eqnoString=makeNumberString(LaTeXCounter["equation"]);var DEQanchor=document.createElement("a");if(lbl!=null){DEQanchor.id=lbl[1]};DEQanchor.className="eqno";var anchorSpan=document.createElement("span");anchorSpan.className="eqno";anchorSpan.style.display="none";anchorSpan.appendChild(document.createTextNode(eqnoString));DEQanchor.appendChild(anchorSpan);DEQtdno.appendChild(DEQanchor);var DEQspan=document.createElement("span");DEQspan.className="eqno";DEQspan.appendChild(document.createTextNode("("+eqnoString+")"));DEQtdno.appendChild(DEQspan);DEQtr.appendChild(DEQtdno);}-DEQtbody.appendChild(DEQtr);DEQtable.appendChild(DEQtbody);newFrag.appendChild(DEQtable);}-else{str[i]=str[i].replace(/\$\}\$/g,"");str[i]=str[i].replace(/\$\{\$/g,"");str[i]=str[i].replace(/\\maketitle/g,"");str[i]=str[i].replace(/\\begin\s*\{\s*document\s*\}/g,"");str[i]=str[i].replace(/\\end\s*\{\s*document\s*\}/g,"");str[i]=str[i].replace(/\\documentclass[^\}]*?\}/g,"");str[i]=str[i].replace(/\\usepackage[^\}]*?\}/g,"");str[i]=str[i].replace(/\\noindent/g,"");str[i]=str[i].replace(/\\notag/g,"");str[i]=str[i].replace(/\\ref\s*\{\s*(\w+)\}/g," \\[ref\\]$1\\[ ");str[i]=str[i].replace(/\\url\s*\{\s*([^\}\n]+)\}/g," \\[url\\]$1\\[ ");str[i]=str[i].replace(/\\href\s*\{\s*([^\}]+)\}\s*\{\s*([^\}]+)\}/g," \\[href\\]$1\\]$2\\[ ");str[i]=str[i].replace(/\\cite\s*\{\s*(\w+)\}/g," \\[cite\\]$1\\[ ");str[i]=str[i].replace(/\\qed/g,"\u220E");str[i]=str[i].replace(/\\endproof/g,"\u220E");str[i]=str[i].replace(/\\proof/g,"\\textbf{Proof: }");str[i]=str[i].replace(/\\n(?=\s)/g," \\[br\\] \\[ ");str[i]=str[i].replace(/\\newline/g," \\[br\\] \\[ ");str[i]=str[i].replace(/\\linebreak/g," \\[br\\] \\[ ");str[i]=str[i].replace(/\\smallskip/g," \\[logicalbreak\\]smallskip\\[ ");str[i]=str[i].replace(/\\medskip/g," \\[logicalbreak\\]medskip\\[ ");str[i]=str[i].replace(/\\bigskip/g," \\[logicalbreak\\]bigskip\\[ ");str[i]=str[i].replace(/[\n\r]+[ \f\n\r\t\v\u2028\u2029]*[\n\r]+/g," \\[logicalbreak\\]LaTeXMathML\\[ ");if(isIE){str[i]=str[i].replace(/\r/g," ");}-str[i]=str[i].replace(/\\bibitem\s*([^\{]*\{\s*\w*\s*\})/g," \\[bibitem\\]$1\\[ ");str[i]=str[i].replace(/\\bibitem\s*/g," \\[bibitem\\] \\[ ");str[i]=str[i].replace(/\\item\s*\[\s*(\w+)\s*\]/g," \\[alistitem\\]$1\\[ ");str[i]=str[i].replace(/\\item\s*/g," \\[alistitem\\] \\[ ");str[i]=str[i].replace(/\\appendix/g," \\[appendix\\] \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*figure\s*\}([\s\S]+?)\\end\s*\{\s*figure\s*\}/g," \\[figure\\]$1\\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*table\s*\}([\s\S]+?)\\end\s*\{\s*table\s*\}/g," \\[table\\]$1\\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*theorem\s*\}/g," \\[theorem\\]Theorem \\[ ");str[i]=str[i].replace(/\\end\s*\{\s*theorem\s*\}/g," \\[endtheorem\\] \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*definition\s*\}/g," \\[definition\\]Definition \\[ ");str[i]=str[i].replace(/\\end\s*\{\s*definition\s*\}/g," \\[enddefinition\\] \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*lemma\s*\}/g," \\[lemma\\]Lemma \\[ ");str[i]=str[i].replace(/\\end\s*\{\s*lemma\s*\}/g," \\[endlemma\\] \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*corollary\s*\}/g," \\[corollary\\]Corollary \\[ ");str[i]=str[i].replace(/\\end\s*\{\s*corollary\s*\}/g," \\[endcorollary\\] \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*proposition\s*\}/g," \\[proposition\\]Proposition \\[ ");str[i]=str[i].replace(/\\end\s*\{\s*proposition\s*\}/g," \\[endproposition\\] \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*example\s*\}/g," \\[example\\]Example \\[ ");str[i]=str[i].replace(/\\end\s*\{\s*example\s*\}/g," \\[endexample\\] \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*exercise\s*\}/g," \\[exercise\\]Exercise \\[ ");str[i]=str[i].replace(/\\end\s*\{\s*exercise\s*\}/g," \\[endexercise\\] \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*thebibliography\s*\}\s*\{\s*\w+\s*\}/g," \\[thebibliography\\]References \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*thebibliography\s*\}/g," \\[thebibliography\\]References \\[ ");str[i]=str[i].replace(/\\end\s*\{\s*thebibliography\s*\}/g," \\[endthebibliography\\]References \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*proof\s*\}/g," \\[proof\\]Proof: \\[ ");if(isIE){str[i]=str[i].replace(/\\end\s*\{\s*proof\s*\}/g,"\u220E \\[endproof\\] \\[ ");}else{str[i]=str[i].replace(/\\end\s*\{\s*proof\s*\}/g," \\[endproof\\] \\[ ");}-str[i]=str[i].replace(/\\title\s*\{\s*([^\}]+)\}/g," \\[title\\] \\[$1 \\[endtitle\\] \\[ ");str[i]=str[i].replace(/\\author\s*\{\s*([^\}]+)\}/g," \\[author\\] \\[$1 \\[endauthor\\] \\[ ");str[i]=str[i].replace(/\\address\s*\{\s*([^\}]+)\}/g," \\[address\\] \\[$1 \\[endaddress\\] \\[ ");str[i]=str[i].replace(/\\date\s*\{\s*([^\}]+)\}/g," \\[date\\] \\[$1 \\[enddate\\] \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*keyword\s*\}/g," \\[keyword\\] \\[ ");str[i]=str[i].replace(/\\end\s*\{\s*keyword\s*\}/g," \\[endkeyword\\] \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*abstract\s*\}/g," \\[abstract\\] \\[ ");str[i]=str[i].replace(/\\end\s*\{\s*abstract\s*\}/g," \\[endabstract\\] \\[ ");str[i]=str[i].replace(/\\begin\s*\{\s*(?!array|tabular)(\w+)\s*\}/g," \\[$1\\] \\[ ");str[i]=str[i].replace(/\\end\s*\{\s*(?!array|tabular)(\w+)\s*\}/g," \\[end$1\\] \\[ ");var sectionIndex=str[i].search(/\\section\s*\{\s*[\s\S]+\}/);while(sectionIndex>=0){str[i]=str[i].replace(/\\section\s*\{/," \\[section\\]");var delimcnt=1;for(var ii=sectionIndex;ii<str[i].length;ii++){if(str[i].charAt(ii)=="{"){delimcnt++};if(str[i].charAt(ii)=="}"){delimcnt--};if(delimcnt==0){str[i]=str[i].substring(0,ii)+"\\[ "+str[i].substring(ii+1,str[i].length);break;}};sectionIndex=str[i].search(/\\section\s*\{\s*[\s\S]+\}/);}-sectionIndex=str[i].search(/\\subsection\s*\{\s*[\s\S]+\}/);while(sectionIndex>=0){str[i]=str[i].replace(/\\subsection\s*\{/," \\[subsection\\]");var delimcnt=1;for(var ii=sectionIndex;ii<str[i].length;ii++){if(str[i].charAt(ii)=="{"){delimcnt++};if(str[i].charAt(ii)=="}"){delimcnt--};if(delimcnt==0){str[i]=str[i].substring(0,ii)+"\\[ "+str[i].substring(ii+1,str[i].length);break;}};sectionIndex=str[i].search(/\\subsection\s*\{\s*[\s\S]+\}/);}-sectionIndex=str[i].search(/\\subsubsection\s*\{\s*[\s\S]+\}/);while(sectionIndex>=0){str[i]=str[i].replace(/\\subsubsection\s*\{/," \\[subsubsection\\]");var delimcnt=1;for(var ii=sectionIndex;ii<str[i].length;ii++){if(str[i].charAt(ii)=="{"){delimcnt++};if(str[i].charAt(ii)=="}"){delimcnt--};if(delimcnt==0){str[i]=str[i].substring(0,ii)+"\\[ "+str[i].substring(ii+1,str[i].length);break;}};sectionIndex=str[i].search(/\\subsubsection\s*\{\s*[\s\S]+\}/);}-var CatToNextEven="";var strtmp=str[i].split("\\[");for(var j=0;j<strtmp.length;j++){if(j%2){var strtmparray=strtmp[j].split("\\]");switch(strtmparray[0]){case"section":var nodeTmp=document.createElement("H2");nodeTmp.className='section';sectionCntr++;for(var div in LaTeXCounter){LaTeXCounter[div]=0};var nodeAnchor=document.createElement("a");if(inAppendix){nodeAnchor.className='appendixsection';}else{nodeAnchor.className='section';}-var nodeNumString=makeNumberString("");var anchorSpan=document.createElement("span");anchorSpan.className="section";anchorSpan.style.display="none";anchorSpan.appendChild(document.createTextNode(nodeNumString));nodeAnchor.appendChild(anchorSpan);nodeTmp.appendChild(nodeAnchor);var nodeSpan=document.createElement("span");nodeSpan.className='section';nodeSpan.appendChild(document.createTextNode(nodeNumString+" "));nodeTmp.appendChild(nodeSpan);nodeTmp.appendChild(document.createTextNode(strtmparray[1]));newFrag.appendChild(nodeTmp);break;case"subsection":var nodeTmp=document.createElement("H3");nodeTmp.className='subsection';LaTeXCounter["subsection"]++;LaTeXCounter["subsubsection"]=0;var nodeAnchor=document.createElement("a");nodeAnchor.className='subsection';var nodeNumString=makeNumberString(LaTeXCounter["subsection"]);var anchorSpan=document.createElement("span");anchorSpan.className="subsection";anchorSpan.style.display="none";anchorSpan.appendChild(document.createTextNode(nodeNumString));nodeAnchor.appendChild(anchorSpan);nodeTmp.appendChild(nodeAnchor);var nodeSpan=document.createElement("span");nodeSpan.className='subsection';nodeSpan.appendChild(document.createTextNode(nodeNumString+". "));nodeTmp.appendChild(nodeSpan);nodeTmp.appendChild(document.createTextNode(strtmparray[1]));newFrag.appendChild(nodeTmp);break;case"subsubsection":var nodeTmp=document.createElement("H4");nodeTmp.className='subsubsection';LaTeXCounter["subsubsection"]++;var nodeAnchor=document.createElement("a");nodeAnchor.className='subsubsection';var nodeNumString=makeNumberString(LaTeXCounter["subsection"]+"."+LaTeXCounter["subsubsection"]);var anchorSpan=document.createElement("span");anchorSpan.className="subsubsection";anchorSpan.style.display="none";anchorSpan.appendChild(document.createTextNode(nodeNumString));nodeAnchor.appendChild(anchorSpan);nodeTmp.appendChild(nodeAnchor);var nodeSpan=document.createElement("span");nodeSpan.className='subsubsection';nodeSpan.appendChild(document.createTextNode(nodeNumString+". "));nodeTmp.appendChild(nodeSpan);nodeTmp.appendChild(document.createTextNode(strtmparray[1]));newFrag.appendChild(nodeTmp);break;case"href":var nodeTmp=document.createElement("a");nodeTmp.className='LaTeXMathML';nodeTmp.href=strtmparray[1];nodeTmp.appendChild(document.createTextNode(strtmparray[2]));newFrag.appendChild(nodeTmp);break;case"url":var nodeTmp=document.createElement("a");nodeTmp.className='LaTeXMathML';nodeTmp.href=strtmparray[1];nodeTmp.appendChild(document.createTextNode(strtmparray[1]));newFrag.appendChild(nodeTmp);break;case"figure":var nodeTmp=document.createElement("table");nodeTmp.className='figure';var FIGtbody=document.createElement("tbody");var FIGlbl=strtmparray[1].match(/\\label\s*\{\s*(\w+)\s*\}/);strtmparray[1]=strtmparray[1].replace(/\\label\s*\{\w+\}/g,"");var capIndex=strtmparray[1].search(/\\caption\s*\{[\s\S]+\}/);var FIGcap="";if(capIndex>=0){var tmp=strtmparray[1];var delimcnt=0;var capstart=-1;for(var pos=capIndex;pos<tmp.length;pos++){if(tmp.charAt(pos)=="{"){delimcnt++};if(tmp.charAt(pos)=="}"){delimcnt--};if(delimcnt==1&&capstart<0){capstart=pos+1};if(delimcnt==0&&capstart>0){capend=pos-1;FIGcap=tmp.substring(capstart,pos);break}}}-var FIGtr2=document.createElement("tr");var FIGtd2=document.createElement("td");FIGtd2.className="caption";var FIGanchor=document.createElement("a");FIGanchor.className="figure";if(FIGlbl!=null){FIGanchor.id=FIGlbl[1];}-LaTeXCounter["figure"]++;var fignmbr=makeNumberString(LaTeXCounter["figure"]);var anchorSpan=document.createElement("span");anchorSpan.className="figure";anchorSpan.style.display="none";anchorSpan.appendChild(document.createTextNode(fignmbr));FIGanchor.appendChild(anchorSpan);FIGtd2.appendChild(FIGanchor);var FIGspan=document.createElement("span");FIGspan.className="figure";FIGspan.appendChild(document.createTextNode("Figure "+fignmbr+". "));FIGtd2.appendChild(FIGspan);FIGtd2.appendChild(document.createTextNode(""+FIGcap));FIGtr2.appendChild(FIGtd2);FIGtbody.appendChild(FIGtr2);var IsSpecial=false;var FIGinfo=strtmparray[1].match(/\\includegraphics\s*\{([^\}]+)\}/);if(FIGinfo==null){FIGinfo=strtmparray[1].match(/\\includegraphics\s*\[[^\]]*\]\s*\{\s*([^\}]+)\s*\}/);}-if(FIGinfo==null){FIGinfo=strtmparray[1].match(/\\special\s*\{\s*([^\}]+)\}/);IsSpecial=true};if(FIGinfo!=null){var FIGtr1=document.createElement("tr");var FIGtd1=document.createElement("td");FIGtd1.className="image";var FIGimg=document.createElement("img");var FIGsrc=FIGinfo[1];FIGimg.src=FIGsrc;FIGimg.alt="Figure "+FIGsrc+" did not load";FIGimg.title="Figure "+fignmbr+". "+FIGcap;FIGimg.id="figure"+fignmbr;FIGtd1.appendChild(FIGimg);FIGtr1.appendChild(FIGtd1);FIGtbody.appendChild(FIGtr1);}-nodeTmp.appendChild(FIGtbody);newFrag.appendChild(nodeTmp);break;case"table":var nodeTmp=document.createElement("table");if(strtmparray[1].search(/\\centering/)>=0){nodeTmp.className='LaTeXtable centered';nodeTmp.align="center";}else{nodeTmp.className='LaTeXtable';};tableid++;nodeTmp.id="LaTeXtable"+tableid;var TABlbl=strtmparray[1].match(/\\label\s*\{\s*(\w+)\s*\}/);strtmparray[1]=strtmparray[1].replace(/\\label\s*\{\w+\}/g,"");var capIndex=strtmparray[1].search(/\\caption\s*\{[\s\S]+\}/);var TABcap="";if(capIndex>=0){var tmp=strtmparray[1];var delimcnt=0;var capstart=-1;for(var pos=capIndex;pos<tmp.length;pos++){if(tmp.charAt(pos)=="{"){delimcnt++};if(tmp.charAt(pos)=="}"){delimcnt--};if(delimcnt==1&&capstart<0){capstart=pos+1};if(delimcnt==0&&capstart>0){capend=pos-1;TABcap=tmp.substring(capstart,pos);break}}}-if(TABcap!=""){var TABtbody=document.createElement("tbody");var TABcaption=document.createElement("caption");TABcaption.className="LaTeXtable centered";var TABanchor=document.createElement("a");TABanchor.className="LaTeXtable";if(TABlbl!=null){TABanchor.id=TABlbl[1];}-LaTeXCounter["table"]++;var tabnmbr=makeNumberString(LaTeXCounter["table"]);var anchorSpan=document.createElement("span");anchorSpan.className="LaTeXtable";anchorSpan.style.display="none";anchorSpan.appendChild(document.createTextNode(tabnmbr));TABanchor.appendChild(anchorSpan);TABcaption.appendChild(TABanchor);var TABspan=document.createElement("span");TABspan.className="LaTeXtable";TABspan.appendChild(document.createTextNode("Table "+tabnmbr+". "));TABcaption.appendChild(TABspan);TABcaption.appendChild(document.createTextNode(""+TABcap));nodeTmp.appendChild(TABcaption);}-var TABinfo=strtmparray[1].match(/\\begin\s*\{\s*tabular\s*\}([\s\S]+)\\end\s*\{\s*tabular\s*\}/);if(TABinfo!=null){var TABtbody=document.createElement('tbody');var TABrow=null;var TABcell=null;var row=0;var col=0;var TABalign=TABinfo[1].match(/^\s*\{([^\}]+)\}/);TABinfo=TABinfo[1].replace(/^\s*\{[^\}]+\}/,"");TABinfo=TABinfo.replace(/\\hline/g,"");TABalign[1]=TABalign[1].replace(/\|/g,"");TABalign[1]=TABalign[1].replace(/\s/g,"");TABinfo=TABinfo.split("\\\\");for(row=0;row<TABinfo.length;row++){TABrow=document.createElement("tr");TABinfo[row]=TABinfo[row].split("&");for(col=0;col<TABinfo[row].length;col++){TABcell=document.createElement("td");switch(TABalign[1].charAt(col)){case"l":TABcell.align="left";break;case"c":TABcell.align="center";break;case"r":TABcell.align="right";break;default:TABcell.align="left";};TABcell.appendChild(document.createTextNode(TABinfo[row][col]));TABrow.appendChild(TABcell);}-TABtbody.appendChild(TABrow);}-nodeTmp.appendChild(TABtbody);}-newFrag.appendChild(nodeTmp);break;case"logicalbreak":var nodeTmp=document.createElement("p");nodeTmp.className=strtmparray[1];nodeTmp.appendChild(document.createTextNode("\u00A0"));newFrag.appendChild(nodeTmp);break;case"appendix":inAppendix=true;sectionCntr=0;break;case"alistitem":var EndDiv=document.createElement("div");EndDiv.className="endlistitem";newFrag.appendChild(EndDiv);var BegDiv=document.createElement("div");BegDiv.className="listitem";if(strtmparray[1]!=" "){var BegSpan=document.createElement("span");BegSpan.className="listitemmarker";var boldBegSpan=document.createElement("b");boldBegSpan.appendChild(document.createTextNode(strtmparray[1]+" "));BegSpan.appendChild(boldBegSpan);BegDiv.appendChild(BegSpan);}-newFrag.appendChild(BegDiv);break;case"br":newFrag.appendChild(document.createElement("br"));break;case"bibitem":newFrag.appendChild(document.createElement("br"));var nodeTmp=document.createElement("a");nodeTmp.className='bibitem';var nodeSpan=document.createElement("span");nodeSpan.className='bibitem';bibcntr++;var lbl=strtmparray[1].match(/\{\s*(\w+)\s*\}/);strtmparray[1]=strtmparray[1].replace(/\s*\{\s*\w+\s*\}/g,"");strtmparray[1]=strtmparray[1].replace(/^\s*\[/,"");strtmparray[1]=strtmparray[1].replace(/\s*\]$/,"");strtmparray[1]=strtmparray[1].replace(/^\s+|\s+$/g,"");if(lbl==null){biblist[bibcntr]="bibitem"+bibcntr}else{biblist[bibcntr]=lbl[1];};nodeTmp.name=biblist[bibcntr];nodeTmp.id=biblist[bibcntr];if(strtmparray[1]!=""){nodeSpan.appendChild(document.createTextNode(strtmparray[1]));}else{nodeSpan.appendChild(document.createTextNode("["+bibcntr+"]"));}-nodeTmp.appendChild(nodeSpan);newFrag.appendChild(nodeTmp);break;case"cite":var nodeTmp=document.createElement("a");nodeTmp.className='cite';nodeTmp.name='cite';nodeTmp.href="#"+strtmparray[1];newFrag.appendChild(nodeTmp);break;case"ref":var nodeTmp=document.createElement("a");nodeTmp.className='ref';nodeTmp.name='ref';nodeTmp.href="#"+strtmparray[1];newFrag.appendChild(nodeTmp);break;default:var nodeTmp=document.createElement("div");nodeTmp.className=strtmparray[0];if(IsCounter.test(strtmparray[0])){LaTeXCounter[strtmparray[0]]++;var nodeAnchor=document.createElement("a");nodeAnchor.className=strtmparray[0];var divnum=makeNumberString(LaTeXCounter[strtmparray[0]]);var anchorSpan=document.createElement("span");anchorSpan.className=strtmparray[0];anchorSpan.appendChild(document.createTextNode(divnum));anchorSpan.style.display="none";nodeAnchor.appendChild(anchorSpan);nodeTmp.appendChild(nodeAnchor);var nodeSpan=document.createElement("span");nodeSpan.className=strtmparray[0];nodeSpan.appendChild(document.createTextNode(strtmparray[1]+" "+divnum+". "));nodeTmp.appendChild(nodeSpan);}-if(isIE){if(strtmparray[0]==("thebibliography"||"abstract"||"keyword"||"proof")){var nodeSpan=document.createElement("span");nodeSpan.className=strtmparray[0];nodeSpan.appendChild(document.createTextNode(strtmparray[1]));nodeTmp.appendChild(nodeSpan);}}-if(strtmparray[0]=="endenumerate"||strtmparray[0]=="enditemize"||strtmparray[0]=="enddescription"){var endDiv=document.createElement("div");endDiv.className="endlistitem";newFrag.appendChild(endDiv);}-newFrag.appendChild(nodeTmp);if(strtmparray[0]=="enumerate"||strtmparray[0]=="itemize"||strtmparray[0]=="description"){var endDiv=document.createElement("div");endDiv.className="listitem";newFrag.appendChild(endDiv);}}}else{strtmp[j]=strtmp[j].replace(/\\\$/g,"<per>");strtmp[j]=strtmp[j].replace(/\$([^\$]+)\$/g," \\[$1\\[ ");strtmp[j]=strtmp[j].replace(/<per>/g,"\\$");strtmp[j]=strtmp[j].replace(/\\begin\s*\{\s*math\s*\}([\s\S]+?)\\end\s*\{\s*math\s*\}/g," \\[$1\\[ ");var strtmptmp=strtmp[j].split("\\[");for(var jjj=0;jjj<strtmptmp.length;jjj++){if(jjj%2){var nodeTmp=document.createElement("span");nodeTmp.className='inlinemath';nodeTmp.appendChild(document.createTextNode("$"+strtmptmp[jjj]+"$"));newFrag.appendChild(nodeTmp);}else{var TagIndex=strtmptmp[jjj].search(/\\\w+/);var tmpIndex=TagIndex;while(tmpIndex>-1){if(/^\\textcolor/.test(strtmptmp[jjj].substring(TagIndex,strtmptmp[jjj].length))){strtmptmp[jjj]=strtmptmp[jjj].replace(/\\textcolor\s*\{\s*(\w+)\s*\}\s*/," \\[textcolor\\]$1\\]|");}else{if(/^\\colorbox/.test(strtmptmp[jjj].substring(TagIndex,strtmptmp[jjj].length))){strtmptmp[jjj]=strtmptmp[jjj].replace(/\\colorbox\s*\{\s*(\w+)\s*\}\s*/," \\[colorbox\\]$1\\]|");}else{strtmptmp[jjj]=strtmptmp[jjj].substring(0,TagIndex)+strtmptmp[jjj].substring(TagIndex,strtmptmp[jjj].length).replace(/\\\s*(\w+)\s*/," \\[$1\\]|");}}-TagIndex+=strtmptmp[jjj].substring(TagIndex,strtmptmp[jjj].length).search(/\|/);TagIndex++;strtmptmp[jjj]=strtmptmp[jjj].replace(/\\\]\|/,"\\] ");if(strtmptmp[jjj].charAt(TagIndex)=="{"){strtmptmp[jjj]=strtmptmp[jjj].substring(0,TagIndex)+strtmptmp[jjj].substring(TagIndex+1,strtmptmp[jjj].length);var delimcnt=1;for(var kk=TagIndex;kk<strtmptmp[jjj].length;kk++){if(strtmptmp[jjj].charAt(kk)=="{"){delimcnt++};if(strtmptmp[jjj].charAt(kk)=="}"){delimcnt--};if(delimcnt==0){break;}}-strtmptmp[jjj]=strtmptmp[jjj].substring(0,kk)+"\\[ "+strtmptmp[jjj].substring(kk+1,strtmptmp[jjj].length);TagIndex=kk+3;}else{strtmptmp[jjj]=strtmptmp[jjj].substring(0,TagIndex)+"\\[ "+strtmptmp[jjj].substring(TagIndex+1,strtmptmp[jjj].length);TagIndex=TagIndex+3;}-if(TagIndex<strtmptmp[jjj].length){tmpIndex=strtmptmp[jjj].substring(TagIndex,strtmptmp[jjj].length).search(/\\\w+/);}-else{tmpIndex=-1};TagIndex+=tmpIndex;}-strtmptmp[jjj]=strtmptmp[jjj].replace(/\\\\\s*\\\\/g,"\\\\");strtmptmp[jjj]=strtmptmp[jjj].replace(/\\\\/g," \\[br\\] \\[ ");strtmptmp[jjj]=strtmptmp[jjj].replace(/\\label\s*\{\s*(\w+)\s*\}/g," \\[a\\]$1\\[ ");var strlbls=strtmptmp[jjj].split("\\[");for(var jj=0;jj<strlbls.length;jj++){if(jj%2){var strtmparray=strlbls[jj].split("\\]");switch(strtmparray[0]){case"textcolor":var nodeTmp=document.createElement("span");nodeTmp.className='LaTeXColor';if(IsColorName.test(strtmparray[1].toLowerCase())){nodeTmp.style.color=LaTeXColor[strtmparray[1].toLowerCase()];}else{nodeTmp.style.color=strtmparray[1];};nodeTmp.appendChild(document.createTextNode(strtmparray[2]));newFrag.appendChild(nodeTmp);break;case"colorbox":var nodeTmp=document.createElement("span");nodeTmp.className='LaTeXColor';if(IsColorName.test(strtmparray[1].toLowerCase())){nodeTmp.style.background=LaTeXColor[strtmparray[1].toLowerCase()];}else{nodeTmp.style.background=strtmparray[1];};nodeTmp.appendChild(document.createTextNode(strtmparray[2]));newFrag.appendChild(nodeTmp);break;case"br":newFrag.appendChild(document.createElement("br"));break;case"a":var nodeTmp=document.createElement("a");nodeTmp.className='LaTeXMathMLlabel';nodeTmp.id=strtmparray[1];nodeTmp.style.display="none";newFrag.appendChild(nodeTmp);break;default:var nodeTmp=document.createElement("span");nodeTmp.className=strtmparray[0];nodeTmp.appendChild(document.createTextNode(strtmparray[1]))-newFrag.appendChild(nodeTmp);}}else{newFrag.appendChild(document.createTextNode(strlbls[jj]));}}}}}}}};TheBody.parentNode.replaceChild(newFrag,TheBody);}}}-return TheBody;}-function LaTeXDivsAndRefs(thebody){var TheBody=thebody;var EndDivClass=null;var AllDivs=TheBody.getElementsByTagName("div");var lbl2id="";var lblnode=null;for(var i=AllDivs.length-1;i>=0;i--){EndDivClass=AllDivs[i].className.match(/end\w+/);if(EndDivClass!=null){EndDivClass=EndDivClass[0];var DivClass=EndDivClass.substring(3,EndDivClass.length);var EndDivNode=AllDivs[i];break;}}-while(EndDivClass!=null){var newFrag=document.createDocumentFragment();var RootNode=EndDivNode.parentNode;var ClassCount=1;while(EndDivNode.previousSibling!=null&&ClassCount>0){switch(EndDivNode.previousSibling.className){case EndDivClass:ClassCount++;newFrag.insertBefore(EndDivNode.previousSibling,newFrag.firstChild);break;case DivClass:if(EndDivNode.previousSibling.nodeName=="DIV"){ClassCount--;if(lbl2id!=""){EndDivNode.previousSibling.id=lbl2id;lbl2id=""}-if(ClassCount==0){RootNode=EndDivNode.previousSibling;}else{newFrag.insertBefore(EndDivNode.previousSibling,newFrag.firstChild);}};break;case'LaTeXMathMLlabel':lbl2id=EndDivNode.previousSibling.id;EndDivNode.parentNode.removeChild(EndDivNode.previousSibling);break;default:newFrag.insertBefore(EndDivNode.previousSibling,newFrag.firstChild);}}-RootNode.appendChild(newFrag);EndDivNode.parentNode.removeChild(EndDivNode);AllDivs=TheBody.getElementsByTagName("DIV");for(i=AllDivs.length-1;i>=0;i--){EndDivClass=AllDivs[i].className.match(/end\w+/);if(EndDivClass!=null){ClassCount=0;EndDivClass=EndDivClass[0];DivClass=EndDivClass.substring(3,EndDivClass.length);EndDivNode=AllDivs[i];RootNode=EndDivNode.parentNode;break;}}}-var AllDivs=TheBody.getElementsByTagName("div");var DIV2LI=null;for(var i=0;i<AllDivs.length;i++){if(AllDivs[i].className=="itemize"||AllDivs[i].className=="enumerate"||AllDivs[i].className=="description"){if(AllDivs[i].className=="itemize"){RootNode=document.createElement("UL");}else{RootNode=document.createElement("OL");}-RootNode.className='LaTeXMathML';if(AllDivs[i].hasChildNodes()){AllDivs[i].removeChild(AllDivs[i].firstChild)};while(AllDivs[i].hasChildNodes()){if(AllDivs[i].firstChild.hasChildNodes()){DIV2LI=document.createElement("LI");while(AllDivs[i].firstChild.hasChildNodes()){DIV2LI.appendChild(AllDivs[i].firstChild.firstChild);}-if(DIV2LI.firstChild.className=="listitemmarker"){DIV2LI.style.listStyleType="none";}-RootNode.appendChild(DIV2LI)}-AllDivs[i].removeChild(AllDivs[i].firstChild);}-AllDivs[i].appendChild(RootNode);}}-var AllAnchors=TheBody.getElementsByTagName("a");for(var i=0;i<AllAnchors.length;i++){if(AllAnchors[i].className=="ref"||AllAnchors[i].className=="cite"){var label=AllAnchors[i].href.match(/\#(\w+)/);if(label!=null){var labelNode=document.getElementById(label[1]);if(labelNode!=null){var TheSpans=labelNode.getElementsByTagName("SPAN");if(TheSpans!=null){var refNode=TheSpans[0].cloneNode(true);refNode.style.display="inline"-refNode.className=AllAnchors[i].className;AllAnchors[i].appendChild(refNode);}}}}}-return TheBody;}-var AMbody;var AMnoMathML=false,AMtranslated=false;function translate(spanclassAM){if(!AMtranslated){AMtranslated=true;AMinitSymbols();var LaTeXContainers=[];var AllContainers=document.getElementsByTagName('*');var ExtendName="";for(var k=0,l=0;k<AllContainers.length;k++){ExtendName=" "+AllContainers[k].className+" ";if(ExtendName.match(/\sLaTeX\s/)!=null){LaTeXContainers[l]=AllContainers[k];l++;}};if(LaTeXContainers.length>0){for(var m=0;m<LaTeXContainers.length;m++){AMbody=LaTeXContainers[m];try{AMbody=LaTeXDivsAndRefs(LaTeXpreProcess(AMbody));}catch(err){alert("Unknown Error: Defaulting to Original LaTeXMathML");}-if(AMbody.tagName=="PRE"){var PreChilds=document.createDocumentFragment();var DivChilds=document.createElement("DIV");while(AMbody.hasChildNodes()){DivChilds.appendChild(AMbody.firstChild);}-PreChilds.appendChild(DivChilds);AMbody.parentNode.replaceChild(PreChilds,AMbody);AMbody=DivChilds;}-AMprocessNode(AMbody,false,spanclassAM);}}else{AMbody=document.getElementsByTagName("body")[0];try{AMbody=LaTeXDivsAndRefs(LaTeXpreProcess(AMbody));}catch(err){alert("Unknown Error: Defaulting to Original LaTeXMathML");}-AMprocessNode(AMbody,false,spanclassAM);}}}-if(isIE){document.write("<object id=\"mathplayer\" classid=\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\"></object>");document.write("<?import namespace=\"m\" implementation=\"#mathplayer\"?>");}-function generic()-{translate();};if(typeof window.addEventListener!='undefined')-{window.addEventListener('load',generic,false);}-else if(typeof document.addEventListener!='undefined')-{document.addEventListener('load',generic,false);}-else if(typeof window.attachEvent!='undefined')-{window.attachEvent('onload',generic);}-else-{if(typeof window.onload=='function')-{var existing=onload;window.onload=function()-{existing();generic();};}-else-{window.onload=generic;}}
@@ -1,70 +0,0 @@-/*-March 19, 2004 MathHTML (c) Peter Jipsen http://www.chapman.edu/~jipsen-Released under the GNU General Public License version 2 or later.-See the GNU General Public License (at http://www.gnu.org/copyleft/gpl.html)-for more details.-*/--function convertMath(node) {// for Gecko- if (node.nodeType==1) {- var newnode =- document.createElementNS("http://www.w3.org/1998/Math/MathML",- node.nodeName.toLowerCase());- for(var i=0; i < node.attributes.length; i++)- newnode.setAttribute(node.attributes[i].nodeName,- node.attributes[i].value);- for (var i=0; i<node.childNodes.length; i++) {- var st = node.childNodes[i].nodeValue;- if (st==null || st.slice(0,1)!=" " && st.slice(0,1)!="\n")- newnode.appendChild(convertMath(node.childNodes[i]));- }- return newnode;- }- else return node;-}--function convert() {- var mmlnode = document.getElementsByTagName("math");- var st,str,node,newnode;- for (var i=0; i<mmlnode.length; i++)- if (document.createElementNS!=null)- mmlnode[i].parentNode.replaceChild(convertMath(mmlnode[i]),mmlnode[i]);- else { // convert for IE- str = "";- node = mmlnode[i];- while (node.nodeName!="/MATH") {- st = node.nodeName.toLowerCase();- if (st=="#text") str += node.nodeValue;- else {- str += (st.slice(0,1)=="/" ? "</m:"+st.slice(1) : "<m:"+st);- if (st.slice(0,1)!="/")- for(var j=0; j < node.attributes.length; j++)- if (node.attributes[j].value!="italic" &&- node.attributes[j].value!="" &&- node.attributes[j].value!="inherit" &&- node.attributes[j].value!=undefined)- str += " "+node.attributes[j].nodeName+"="+- "\""+node.attributes[j].value+"\"";- str += ">";- }- node = node.nextSibling;- node.parentNode.removeChild(node.previousSibling);- }- str += "</m:math>";- newnode = document.createElement("span");- node.parentNode.replaceChild(newnode,node);- newnode.innerHTML = str;- }-}--if (document.createElementNS==null) {- document.write("<object id=\"mathplayer\"\- classid=\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\"></object>");- document.write("<?import namespace=\"m\" implementation=\"#mathplayer\"?>");-}-if(typeof window.addEventListener != 'undefined'){- window.addEventListener('load', convert, false);-}-if(typeof window.attachEvent != 'undefined') {- window.attachEvent('onload', convert);-}
@@ -0,0 +1,80 @@+aet.+aetat.+al.+Apr.+Aug.+bk.+Bros.+c.+Capt.+cf.+ch.+chap.+chs.+Co.+col.+Corp.+cp.+d.+Dec.+Dr.+e.g.+ed.+eds.+esp.+f.+fasc.+Feb.+ff.+fig.+fl.+fol.+fols.+Fr.+Gen.+Gov.+Hon.+i.e.+ill.+Inc.+incl.+Jan.+Jr.+Jul.+Jun.+Ltd.+M.A.+M.D.+Mar.+Mr.+Mrs.+Ms.+n.+n.b.+nn.+No.+Nov.+Oct.+p.+Ph.D.+pp.+Pres.+Prof.+pt.+q.v.+Rep.+Rev.+s.v.+s.vv.+saec.+sec.+Sen.+Sep.+Sept.+Sgt.+Sr.+St.+univ.+viz.+vol.+vs.
@@ -0,0 +1,90 @@+# This script enables bash autocompletion for pandoc. To enable+# bash completion, add this to your .bashrc:+# eval "$(pandoc --bash-completion)"++_pandoc()+{+ local cur prev opts lastc informats outformats highlight_styles datafiles+ COMPREPLY=()+ cur="${COMP_WORDS[COMP_CWORD]}"+ prev="${COMP_WORDS[COMP_CWORD-1]}"++ # These should be filled in by pandoc:+ opts="%s"+ informats="%s"+ outformats="%s"+ highlight_styles="%s"+ datafiles="%s"++ case "${prev}" in+ --from|-f|--read|-r)+ COMPREPLY=( $(compgen -W "${informats}" -- ${cur}) )+ return 0+ ;;+ --to|-t|--write|-w|-D|--print-default-template)+ COMPREPLY=( $(compgen -W "${outformats}" -- ${cur}) )+ return 0+ ;;+ --email-obfuscation)+ COMPREPLY=( $(compgen -W "references javascript none" -- ${cur}) )+ return 0+ ;;+ --ipynb-output)+ COMPREPLY=( $(compgen -W "all none best" -- ${cur}) )+ return 0+ ;;+ --pdf-engine)+ COMPREPLY=( $(compgen -W "pdflatex lualatex xelatex latexmk tectonic wkhtmltopdf weasyprint prince context pdfroff groff" -- ${cur}) )+ return 0+ ;;+ --print-default-data-file)+ COMPREPLY=( $(compgen -W "${datafiles}" -- ${cur}) )+ return 0+ ;;+ --wrap)+ COMPREPLY=( $(compgen -W "auto none preserve" -- ${cur}) )+ return 0+ ;;+ --track-changes)+ COMPREPLY=( $(compgen -W "accept reject all" -- ${cur}) )+ return 0+ ;;+ --reference-location)+ COMPREPLY=( $(compgen -W "block section document" -- ${cur}) )+ return 0+ ;;+ --top-level-division)+ COMPREPLY=( $(compgen -W "section chapter part" -- ${cur}) )+ return 0+ ;;+ --highlight-style|--print-highlight-style)+ COMPREPLY=( $(compgen -W "${highlight_styles}" -- ${cur}) )+ return 0+ ;;+ --eol)+ COMPREPLY=( $(compgen -W "crlf lf native" -- ${cur}) )+ return 0+ ;;+ --markdown-headings)+ COMPREPLY=( $(compgen -W "setext atx" -- ${cur}) )+ return 0+ ;;+ *)+ ;;+ esac++ case "${cur}" in+ -*)+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )+ return 0+ ;;+ *)+ local IFS=$'\n'+ COMPREPLY=( $(compgen -X '' -f "${cur}") )+ return 0+ ;;+ esac++}++complete -o filenames -o bashdefault -F _pandoc pandoc
@@ -0,0 +1,190 @@+-- A sample custom reader for Creole 1.0 (common wiki markup)+-- http://www.wikicreole.org/wiki/CheatSheet++-- For better performance we put these functions in local variables:+local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt =+ lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V,+ lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt++local whitespacechar = S(" \t\r\n")+local specialchar = S("/*~[]\\{}|")+local wordchar = (1 - (whitespacechar + specialchar))+local spacechar = S(" \t")+local newline = P"\r"^-1 * P"\n"+local blankline = spacechar^0 * newline+local endline = newline * #-blankline+local endequals = spacechar^0 * P"="^0 * spacechar^0 * newline+local cellsep = spacechar^0 * P"|"++local function trim(s)+ return (s:gsub("^%s*(.-)%s*$", "%1"))+end++local function ListItem(lev, ch)+ local start+ if ch == nil then+ start = S"*#"+ else+ start = P(ch)+ end+ local subitem = function(c)+ if lev < 6 then+ return ListItem(lev + 1, c)+ else+ return (1 - 1) -- fails+ end+ end+ local parser = spacechar^0+ * start^lev+ * #(- start)+ * spacechar^0+ * Ct((V"Inline" - (newline * spacechar^0 * S"*#"))^0)+ * newline+ * (Ct(subitem("*")^1) / pandoc.BulletList+ ++ Ct(subitem("#")^1) / pandoc.OrderedList+ ++ Cc(nil))+ / function (ils, sublist)+ return { pandoc.Plain(ils), sublist }+ end+ return parser+end++-- Grammar+G = P{ "Doc",+ Doc = Ct(V"Block"^0)+ / pandoc.Pandoc ;+ Block = blankline^0+ * ( V"Header"+ + V"HorizontalRule"+ + V"CodeBlock"+ + V"List"+ + V"Table"+ + V"Para") ;+ Para = Ct(V"Inline"^1)+ * newline+ / pandoc.Para ;+ HorizontalRule = spacechar^0+ * P"----"+ * spacechar^0+ * newline+ / pandoc.HorizontalRule;+ Header = (P("=")^1 / string.len)+ * spacechar^1+ * Ct((V"Inline" - endequals)^1)+ * endequals+ / pandoc.Header;+ CodeBlock = P"{{{"+ * blankline+ * C((1 - (newline * P"}}}"))^0)+ * newline+ * P"}}}"+ / pandoc.CodeBlock;+ Placeholder = P"<<<"+ * C(P(1) - P">>>")^0+ * P">>>"+ / function() return pandoc.Div({}) end;+ List = V"BulletList"+ + V"OrderedList" ;+ BulletList = Ct(ListItem(1,'*')^1)+ / pandoc.BulletList ;+ OrderedList = Ct(ListItem(1,'#')^1)+ / pandoc.OrderedList ;+ Table = (V"TableHeader" + Cc{})+ * Ct(V"TableRow"^1)+ / function(headrow, bodyrows)+ local numcolumns = #(bodyrows[1])+ local aligns = {}+ local widths = {}+ for i = 1,numcolumns do+ aligns[i] = pandoc.AlignDefault+ widths[i] = 0+ end+ return pandoc.utils.from_simple_table(+ pandoc.SimpleTable({}, aligns, widths, headrow, bodyrows))+ end ;+ TableHeader = Ct(V"HeaderCell"^1)+ * cellsep^-1+ * spacechar^0+ * newline ;+ TableRow = Ct(V"BodyCell"^1)+ * cellsep^-1+ * spacechar^0+ * newline ;+ HeaderCell = cellsep+ * P"="+ * spacechar^0+ * Ct((V"Inline" - (newline + cellsep))^0)+ / function(ils) return { pandoc.Plain(ils) } end ;+ BodyCell = cellsep+ * spacechar^0+ * Ct((V"Inline" - (newline + cellsep))^0)+ / function(ils) return { pandoc.Plain(ils) } end ;+ Inline = V"Emph"+ + V"Strong"+ + V"LineBreak"+ + V"Link"+ + V"URL"+ + V"Image"+ + V"Str"+ + V"Space"+ + V"SoftBreak"+ + V"Escaped"+ + V"Placeholder"+ + V"Code"+ + V"Special" ;+ Str = wordchar^1+ / pandoc.Str;+ Escaped = P"~"+ * C(P(1))+ / pandoc.Str ;+ Special = specialchar+ / pandoc.Str;+ Space = spacechar^1+ / pandoc.Space ;+ SoftBreak = endline+ * # -(V"HorizontalRule" + V"CodeBlock")+ / pandoc.SoftBreak ;+ LineBreak = P"\\\\"+ / pandoc.LineBreak ;+ Code = P"{{{"+ * C((1 - P"}}}")^0)+ * P"}}}"+ / trim / pandoc.Code ;+ Link = P"[["+ * C((1 - (P"]]" + P"|"))^0)+ * (P"|" * Ct((V"Inline" - P"]]")^1))^-1 * P"]]"+ / function(url, desc)+ local txt = desc or {pandoc.Str(url)}+ return pandoc.Link(txt, url)+ end ;+ Image = P"{{"+ * #-P"{"+ * C((1 - (S"}"))^0)+ * (P"|" * Ct((V"Inline" - P"}}")^1))^-1+ * P"}}"+ / function(url, desc)+ local txt = desc or ""+ return pandoc.Image(txt, url)+ end ;+ URL = P"http"+ * P"s"^-1+ * P":"+ * (1 - (whitespacechar + (S",.?!:;\"'" * #whitespacechar)))^1+ / function(url)+ return pandoc.Link(pandoc.Str(url), url)+ end ;+ Emph = P"//"+ * Ct((V"Inline" - P"//")^1)+ * P"//"+ / pandoc.Emph ;+ Strong = P"**"+ * Ct((V"Inline" -P"**")^1)+ * P"**"+ / pandoc.Strong ;+}++function Reader(input, reader_options)+ return lpeg.match(G, tostring(input))+end
@@ -0,0 +1,3933 @@+<?xml version="1.0" encoding="utf-8"?>+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" demote-non-dropping-particle="display-and-sort" page-range-format="chicago-16" version="1.0">+ <!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->+ <info>+ <title>Chicago Manual of Style 18th edition (author-date)</title>+ <title-short>CMOS with Bluebook (author-date [13.102])</title-short>+ <id>http://www.zotero.org/styles/chicago-author-date</id>+ <link href="http://www.zotero.org/styles/chicago-author-date" rel="self"/>+ <link href="http://www.zotero.org/styles/chicago-notes-bibliography" rel="template"/>+ <link href="https://www.chicagomanualofstyle.org/" rel="documentation"/>+ <author>+ <name>Andrew Dunning</name>+ <uri>https://orcid.org/0000-0003-0464-5036</uri>+ </author>+ <category citation-format="author-date"/>+ <category field="anthropology"/>+ <category field="communications"/>+ <category field="generic-base"/>+ <category field="geography"/>+ <category field="history"/>+ <category field="humanities"/>+ <category field="law"/>+ <category field="linguistics"/>+ <category field="literature"/>+ <category field="philosophy"/>+ <category field="political_science"/>+ <category field="science"/>+ <category field="social_science"/>+ <category field="sociology"/>+ <category field="theology"/>+ <summary>Chicago-style source citations (with Bluebook for legal citations), author-date system</summary>+ <updated>2025-08-07T00:00:00+00:00</updated>+ <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>+ </info>+ <locale xml:lang="en">+ <terms>+ <!-- Chicago omits 'by' from `verb-short` forms; it abbreviates only the most common roles -->+ <term name="advance-online-publication">ahead of print</term>+ <term name="anonymous">unsigned</term>+ <term form="verb-short" name="collection-editor">ed.</term>+ <term form="short" name="collection-number">+ <single>vol.</single>+ <multiple>vols.</multiple>+ </term>+ <term form="verb-short" name="compiler">comp.</term>+ <term form="verb-short" name="editor">ed.</term>+ <term form="short" name="editor-translator">+ <single>ed. and trans.</single>+ <multiple>eds. and trans.</multiple>+ </term>+ <term form="short" name="editortranslator">+ <single>ed. and trans.</single>+ <multiple>eds. and trans.</multiple>+ </term>+ <term form="verb" name="editor-translator">edited and translated by</term>+ <term form="verb" name="editortranslator">edited and translated by</term>+ <term form="verb-short" name="editor-translator">ed. and trans.</term>+ <term form="verb-short" name="editortranslator">ed. and trans.</term>+ <term form="verb-short" name="illustrator">ill.</term>+ <term form="short" name="legislation">Pub. L.</term>+ <term name="manuscript">unpublished manuscript</term>+ <term name="original-work-published">originally published as</term>+ <term form="short" name="paper-conference">paper</term>+ <!-- 'under' replaces 's.v.' from CMOS17 and earlier (CMOS18 14.130) -->+ <term name="sub-verbo">under</term>+ <term form="short" name="sub-verbo">under</term>+ <term name="timestamp">at</term>+ <term form="verb-short" name="translator">trans.</term>+ </terms>+ </locale>+ <locale xml:lang="en-GB">+ <terms>+ <!-- ensure consistency with other `en-GB` contractions -->+ <term form="short" name="collection-number">+ <single>vol.</single>+ <multiple>vols</multiple>+ </term>+ <term form="short" name="editor-translator">+ <single>ed. and trans.</single>+ <multiple>eds and trans.</multiple>+ </term>+ <term form="short" name="editortranslator">+ <single>ed. and trans.</single>+ <multiple>eds and trans.</multiple>+ </term>+ </terms>+ </locale>+ <!-- Contents:+ + This file interprets Chicago using APA's four basic reference elements+ (cf. CMOS18 14.2, 14.64, 14.161):++ 1. Author (CMOS18 13.74-86)+ 2. Date (author-date system only, CMOS18 13.102)+ 3. Title and descriptions (CMOS18 13.87-101)+ 3.1. Title+ 3.2. Description+ 3.3. Identifiers (edition, contributors, volume)+ 4. Source+ 4.1. Serial sources+ 4.2. Monographic sources+ 4.3. Series+ 4.4. Event+ 4.5. Publisher+ 4.6. Date+ 4.7. Locator (including page references)+ 4.8. Medium+ 4.9. Archival location+ 4.10. URL or persistent identifier+ + Freeform annotations to bibliography entries: + + 5. Notes+ + Chicago also provides parallel rules for legal references following+ The Bluebook: A Uniform System of Citation (code shared with APA):++ 6. Legal references+ -->+ <!-- In this file, macros suffixed `-bib` and `-note` are parallel versions+ of the same features for the bibliography and notes, and all changes+ must be applied to both. They should only contain differences of+ punctuation (periods in bibliography, commas in notes) and capitalization,+ except where the comments indicate structural changes. -->+ <!-- Categories of CSL item types:++ Serial+ : article-journal article-magazine article-newspaper periodical post-weblog review review-book++ Serial or Monographic+ : interview paper-conference++ Monographic with any of `collection-editor compiler editor editorial-director`.+ A serial `paper-conference` is unpublished if it lacks any of `issue page supplement-number volume`.++ Monographic+ : article book broadcast chapter classic collection dataset document+ entry entry-dictionary entry-encyclopedia event figure+ graphic manuscript map motion_picture musical_score+ pamphlet patent performance personal_communication post report+ software song speech standard thesis webpage++ Legal+ : bill hearing legal_case legislation regulation treaty+ -->+ <!-- Variable labels -->+ <macro name="label-chapter-number">+ <group delimiter=" ">+ <choose>+ <if is-numeric="chapter-number" type="song">+ <text value="track"/>+ </if>+ <else-if is-numeric="chapter-number">+ <label form="short" variable="chapter-number"/>+ </else-if>+ </choose>+ <text variable="chapter-number"/>+ </group>+ </macro>+ <macro name="label-chapter-number-capitalized">+ <group delimiter=" ">+ <choose>+ <if is-numeric="chapter-number" type="song">+ <text text-case="capitalize-first" value="track"/>+ </if>+ <else-if is-numeric="chapter-number">+ <label form="short" text-case="capitalize-first" variable="chapter-number"/>+ </else-if>+ </choose>+ <text text-case="capitalize-first" variable="chapter-number"/>+ </group>+ </macro>+ <macro name="label-collection-number">+ <group delimiter=" ">+ <choose>+ <if is-numeric="collection-number">+ <label form="short" variable="collection-number"/>+ </if>+ </choose>+ <text variable="collection-number"/>+ </group>+ </macro>+ <macro name="label-edition">+ <group delimiter=" ">+ <choose>+ <if is-numeric="edition">+ <number form="ordinal" variable="edition"/>+ <label form="short" variable="edition"/>+ </if>+ <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">+ <!-- full label for serial edition (CMOS18 14.89) -->+ <text variable="edition"/>+ <label variable="edition"/>+ </else-if>+ <else-if match="any" type="interview paper-conference">+ <choose>+ <if match="any" variable="collection-editor compiler editor editorial-director">+ <!-- monographic usage -->+ <text variable="edition"/>+ </if>+ <else>+ <!-- serial usage -->+ <text variable="edition"/>+ <label variable="edition"/>+ </else>+ </choose>+ </else-if>+ <else>+ <text variable="edition"/>+ </else>+ </choose>+ </group>+ </macro>+ <macro name="label-edition-capitalized">+ <group delimiter=" ">+ <choose>+ <if is-numeric="edition">+ <number form="ordinal" variable="edition"/>+ <label form="short" variable="edition"/>+ </if>+ <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">+ <!-- full label for serial edition (CMOS18 14.89) -->+ <text text-case="title" variable="edition"/>+ <label text-case="capitalize-first" variable="edition"/>+ </else-if>+ <else-if match="any" type="interview paper-conference">+ <choose>+ <if match="any" variable="collection-editor compiler editor editorial-director">+ <!-- monographic usage -->+ <text text-case="capitalize-first" variable="edition"/>+ </if>+ <else>+ <!-- serial usage -->+ <text text-case="title" variable="edition"/>+ <label text-case="capitalize-first" variable="edition"/>+ </else>+ </choose>+ </else-if>+ <else>+ <text text-case="capitalize-first" variable="edition"/>+ </else>+ </choose>+ </group>+ </macro>+ <macro name="label-issue">+ <group delimiter=" ">+ <label form="short" variable="issue"/>+ <text variable="issue"/>+ </group>+ </macro>+ <macro name="label-locator">+ <group delimiter=" ">+ <choose>+ <if locator="page"/>+ <else-if match="any" type="bill hearing legal_case legislation regulation treaty">+ <!-- Bluebook-style labels for legal types (CMOS18 14.174) -->+ <choose>+ <if locator="chapter paragraph section" match="any">+ <label form="symbol" variable="locator"/>+ </if>+ <else>+ <label form="short" variable="locator"/>+ </else>+ </choose>+ </else-if>+ <else-if is-numeric="locator">+ <choose>+ <if locator="line">+ <label variable="locator"/>+ </if>+ <else>+ <label form="short" variable="locator"/>+ </else>+ </choose>+ </else-if>+ <else-if locator="chapter line verse" match="any"/>+ <!-- a non-numeric canonical reference is identified by its formatting and does not need a label (CMOS18 14.143-54) -->+ <else>+ <label form="short" variable="locator"/>+ </else>+ </choose>+ <text variable="locator"/>+ </group>+ </macro>+ <macro name="label-number-capitalized">+ <group delimiter=" ">+ <choose>+ <if type="standard"/>+ <else-if is-numeric="number" match="any" type="legislation regulation">+ <label form="short" text-case="capitalize-first" variable="number"/>+ </else-if>+ </choose>+ <text text-case="capitalize-first" variable="number"/>+ </group>+ </macro>+ <macro name="label-number-of-volumes">+ <group delimiter=" ">+ <text variable="number-of-volumes"/>+ <choose>+ <if is-numeric="number-of-volumes">+ <label form="short" variable="number-of-volumes"/>+ </if>+ </choose>+ </group>+ </macro>+ <macro name="label-part-number">+ <group delimiter=" ">+ <choose>+ <if is-numeric="part-number">+ <!-- TODO: Replace with `part-number` label when CSL provides one -->+ <text form="short" term="part"/>+ </if>+ </choose>+ <text variable="part-number"/>+ </group>+ </macro>+ <macro name="label-part-number-capitalized">+ <group delimiter=" ">+ <choose>+ <if is-numeric="part-number">+ <!-- TODO: Replace with `part-number` label when CSL provides one -->+ <text form="short" term="part" text-case="capitalize-first"/>+ </if>+ </choose>+ <text text-case="capitalize-first" variable="part-number"/>+ </group>+ </macro>+ <macro name="label-section-capitalized">+ <group delimiter=" ">+ <choose>+ <if is-numeric="section">+ <label form="short" text-case="capitalize-first" variable="section"/>+ </if>+ </choose>+ <text text-case="title" variable="section"/>+ </group>+ </macro>+ <macro name="label-section-symbol">+ <group delimiter=" ">+ <label form="symbol" variable="section"/>+ <text variable="section"/>+ </group>+ </macro>+ <macro name="label-supplement-number">+ <group delimiter=" ">+ <choose>+ <!-- TODO: Replace with `supplement-number` label when CSL provides one -->+ <if is-numeric="supplement-number" variable="volume-title">+ <!-- if there is a volume title, it is already described as a supplement -->+ <text form="short" term="issue"/>+ </if>+ <else-if is-numeric="supplement-number" type="periodical" variable="title">+ <text form="short" term="issue"/>+ </else-if>+ <else-if is-numeric="supplement-number">+ <text form="short" term="supplement"/>+ </else-if>+ </choose>+ <text variable="supplement-number"/>+ </group>+ </macro>+ <macro name="label-version">+ <group delimiter=" ">+ <choose>+ <if type="software">+ <!-- short version label for software (CMOS18 14.169) -->+ <label form="short" variable="version"/>+ </if>+ <else>+ <label variable="version"/>+ </else>+ </choose>+ <text variable="version"/>+ </group>+ </macro>+ <macro name="label-version-capitalized">+ <group delimiter=" ">+ <choose>+ <if type="software">+ <!-- short version label for software (CMOS18 14.169) -->+ <label form="short" text-case="capitalize-first" variable="version"/>+ </if>+ <else>+ <label text-case="capitalize-first" variable="version"/>+ </else>+ </choose>+ <text variable="version"/>+ </group>+ </macro>+ <macro name="label-volume">+ <group delimiter=" ">+ <choose>+ <if is-numeric="volume">+ <label form="short" variable="volume"/>+ </if>+ </choose>+ <text variable="volume"/>+ </group>+ </macro>+ <macro name="label-volume-capitalized">+ <group delimiter=" ">+ <choose>+ <if is-numeric="volume">+ <label form="short" text-case="capitalize-first" variable="volume"/>+ </if>+ </choose>+ <text text-case="capitalize-first" variable="volume"/>+ </group>+ </macro>+ <!-- 1. Author (CMOS18 13.74-86) -->+ <macro name="author-bib">+ <names variable="composer">+ <name and="text" delimiter-precedes-last="always" name-as-sort-order="first"/>+ <label form="short" prefix=", "/>+ <substitute>+ <names variable="author"/>+ <!-- cf. `interview` model (CMOS18 14.110); if it is desired to prioritize `host` over `guest`, the latter could be encoded as a `contributor` -->+ <names variable="guest"/>+ <names variable="host"/>+ <choose>+ <if type="song">+ <names variable="performer"/>+ </if>+ </choose>+ <choose>+ <if type="classic">+ <!-- contributors fall after the title of `classic` (CMOS18 14.147) -->+ <text macro="author-title-substitute-bib"/>+ </if>+ <else-if type="entry-dictionary" variable="container-title">+ <!-- contributors fall after the title of unsigned reference entries (CMOS18 14.130) -->+ <text macro="author-title-substitute-container"/>+ </else-if>+ <else-if type="entry-encyclopedia" variable="container-title">+ <text macro="author-title-substitute-container"/>+ </else-if>+ </choose>+ <names variable="illustrator"/>+ <choose>+ <if match="none" type="standard">+ <names variable="editor-translator"/>+ <names variable="editor"/>+ <names variable="translator"/>+ <names variable="collection-editor"/>+ </if>+ </choose>+ <names variable="director"/>+ <choose>+ <!-- serial `broadcast` prioritizes title (CMOS18 14.165, 14.168) -->+ <if type="broadcast" variable="container-title number title"/>+ <else>+ <names variable="producer"/>+ <names variable="executive-producer"/>+ <names variable="series-creator"/>+ <choose>+ <if type="broadcast">+ <names variable="contributor"/>+ </if>+ </choose>+ </else>+ </choose>+ <names variable="editorial-director"/>+ <names variable="compiler"/>+ <choose>+ <if match="any" type="event performance speech">+ <names variable="chair"/>+ <names variable="organizer"/>+ </if>+ </choose>+ <names variable="curator"/>+ <choose>+ <if type="software">+ <!-- `software` listed under the name of the publisher or developer (CMOS18 14.169) -->+ <text variable="publisher"/>+ </if>+ <else-if type="standard">+ <!-- `standard` listed in bibliography under organization, but note omits this (CMOS18 14.159) -->+ <text variable="authority"/>+ </else-if>+ </choose>+ <text macro="author-title-substitute-container"/>+ <text macro="author-title-substitute-bib"/>+ <choose>+ <if type="manuscript">+ <choose>+ <if match="none" variable="container-title event-date event-place event-title genre title publisher publisher-place">+ <text macro="source-archive-bib"/>+ </if>+ </choose>+ </if>+ </choose>+ </substitute>+ </names>+ </macro>+ <macro name="author-inline">+ <choose>+ <if match="any" type="bill hearing legal_case legislation regulation treaty">+ <text macro="title-and-descriptions-short"/>+ </if>+ <else-if match="any" type="interview personal_communication">+ <text macro="author-inline-and-recipient"/>+ </else-if>+ <else>+ <names variable="composer">+ <name and="text" form="short" initialize-with=". "/>+ <substitute>+ <names variable="author"/>+ <names variable="guest"/>+ <names variable="host"/>+ <choose>+ <if type="song">+ <names variable="performer"/>+ </if>+ </choose>+ <choose>+ <if match="any" type="classic performance">+ <!-- contributors fall after the title of `classic` (CMOS18 14.147), `performance` (CMOS18 14.166) -->+ <text macro="author-title-substitute-short"/>+ </if>+ <else-if match="any" type="entry entry-dictionary entry-encyclopedia">+ <!-- contributors fall after the title of unsigned reference entries (CMOS18 14.130) -->+ <choose>+ <if variable="container-title">+ <text macro="author-title-substitute-container"/>+ </if>+ </choose>+ </else-if>+ </choose>+ <names variable="illustrator"/>+ <choose>+ <if match="none" type="standard">+ <names variable="editor-translator"/>+ <names variable="editor"/>+ <names variable="translator"/>+ <names variable="collection-editor"/>+ </if>+ </choose>+ <choose>+ <if type="broadcast" variable="container-title number title"/>+ <else>+ <names variable="director"/>+ <names variable="producer"/>+ <names variable="executive-producer"/>+ <names variable="series-creator"/>+ <choose>+ <if type="broadcast">+ <names variable="contributor"/>+ </if>+ </choose>+ </else>+ </choose>+ <names variable="editorial-director"/>+ <names variable="compiler"/>+ <choose>+ <if match="any" type="event performance speech">+ <names variable="chair"/>+ <names variable="organizer"/>+ </if>+ </choose>+ <names variable="curator"/>+ <choose>+ <if type="software">+ <!-- `software` listed under the name of the publisher or developer (CMOS18 14.169) -->+ <text variable="publisher"/>+ </if>+ <else-if type="standard">+ <!-- `standard` listed in bibliography under organization, but note omits this (CMOS18 14.159) -->+ <text variable="authority"/>+ </else-if>+ </choose>+ <text macro="author-title-substitute-container-short"/>+ <text macro="author-title-substitute-short"/>+ <choose>+ <if type="manuscript">+ <choose>+ <if match="none" variable="container-title event-date event-place event-title genre title publisher publisher-place">+ <text macro="source-archive-note"/>+ </if>+ </choose>+ </if>+ </choose>+ </substitute>+ </names>+ </else>+ </choose>+ </macro>+ <macro name="author-sort">+ <choose>+ <if match="any" type="bill hearing legal_case legislation regulation treaty">+ <text macro="legal-title"/>+ </if>+ <else>+ <text macro="author-bib"/>+ </else>+ </choose>+ </macro>+ <!-- Author elements -->+ <macro name="author-inline-and-recipient">+ <!-- identical to `author-short-and-recipient` but with initialization -->+ <group delimiter=" ">+ <choose>+ <!-- Inaccessible personal commmunication is cited in-text (CMOS18 14.111) -->+ <if match="none" variable="archive archive-place container-title DOI number publisher references URL">+ <!-- These variables indicate whether the letter is retrievable by the reader -->+ <group delimiter=", ">+ <names variable="author">+ <name and="text" initialize-with=". "/>+ <substitute>+ <text macro="title-and-descriptions-short"/>+ </substitute>+ </names>+ </group>+ <choose>+ <if match="none" variable="genre">+ <names variable="recipient">+ <label form="verb" suffix=" "/>+ <name and="text" initialize-with=". "/>+ </names>+ </if>+ </choose>+ </if>+ <else-if variable="author recipient">+ <names variable="author">+ <label/>+ <name and="text" form="short" initialize-with=". "/>+ </names>+ <choose>+ <if match="none" variable="genre">+ <names variable="recipient">+ <label form="verb" suffix=" "/>+ <name and="text" form="short" initialize-with=". "/>+ </names>+ </if>+ </choose>+ </else-if>+ <else>+ <names variable="author">+ <name and="text" form="short" initialize-with=". "/>+ <substitute>+ <text macro="title-and-descriptions-short"/>+ </substitute>+ </names>+ </else>+ </choose>+ </group>+ </macro>+ <macro name="author-title-substitute-bib">+ <choose>+ <if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">+ <!-- If a review has no `reviewed-genre` or `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->+ <choose>+ <if variable="reviewed-genre title">+ <text macro="title-bib"/>+ </if>+ <else-if variable="reviewed-genre reviewed-title title">+ <text macro="title-bib"/>+ </else-if>+ <else>+ <text macro="title-and-descriptions-bib"/>+ </else>+ </choose>+ </if>+ <else-if variable="title">+ <text macro="title-bib"/>+ </else-if>+ <else>+ <!-- If an item has no `title`, substitute with descriptions. -->+ <text macro="title-and-descriptions-bib"/>+ </else>+ </choose>+ </macro>+ <macro name="author-title-substitute-short">+ <choose>+ <if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">+ <!-- If a review has no `reviewed-genre` or `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->+ <choose>+ <if variable="reviewed-genre title">+ <text macro="title-short"/>+ </if>+ <else-if variable="reviewed-genre reviewed-title title">+ <text macro="title-short"/>+ </else-if>+ <else>+ <text macro="title-and-descriptions-short"/>+ </else>+ </choose>+ </if>+ <else-if variable="title">+ <text macro="title-short"/>+ </else-if>+ <else>+ <!-- If an item has no `title`, substitute with descriptions and capitalize -->+ <text macro="title-and-descriptions-bib"/>+ </else>+ </choose>+ </macro>+ <macro name="author-title-substitute-container">+ <choose>+ <if match="none" variable="container-title"/>+ <else-if match="any" type="article-magazine article-newspaper">+ <!-- Anonymous magazine and newspaper articles substitute name of publication (CMOS18 14.87, 14.97) -->+ <text macro="source-serial-name"/>+ </else-if>+ <else-if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">+ <!-- Publication name also substituted for unsigned reviews (CMOS18 14.102) -->+ <text macro="source-serial-name"/>+ </else-if>+ <else-if match="any" type="interview paper-conference">+ <choose>+ <if match="none" variable="collection-editor compiler editor editorial-director">+ <!-- serial usage -->+ <text macro="source-serial-name"/>+ </if>+ </choose>+ </else-if>+ <else-if match="any" type="entry entry-dictionary entry-encyclopedia">+ <!-- Anonymous entries in reference works (CMOS18 14.130) -->+ <text font-style="italic" text-case="title" variable="container-title"/>+ </else-if>+ <else-if type="broadcast">+ <!-- TV broadcasts and podcasts (CMOS18 14.165, 14.168) -->+ <text font-style="italic" text-case="title" variable="container-title"/>+ </else-if>+ <else-if type="webpage">+ <!-- Website title substituted in bibliography only (CMOS18 14.104) -->+ <text text-case="title" variable="container-title"/>+ </else-if>+ </choose>+ </macro>+ <macro name="author-title-substitute-container-short">+ <choose>+ <if match="none" variable="container-title"/>+ <else-if match="any" type="article-magazine article-newspaper">+ <!-- Anonymous magazine/newspaper articles substitute name of publication (CMOS18 14.87, 14.97) -->+ <text font-style="italic" text-case="title" variable="container-title"/>+ </else-if>+ <else-if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">+ <!-- Publication name also substituted for unsigned reviews (CMOS18 14.102) -->+ <text font-style="italic" text-case="title" variable="container-title"/>+ </else-if>+ <else-if match="any" type="interview paper-conference">+ <choose>+ <if match="none" variable="collection-editor compiler editor editorial-director">+ <!-- serial usage -->+ <text font-style="italic" text-case="title" variable="container-title"/>+ </if>+ </choose>+ </else-if>+ <else-if match="any" type="entry entry-dictionary entry-encyclopedia">+ <!-- Anonymous entries in reference works (CMOS18 14.130) -->+ <text font-style="italic" text-case="title" variable="container-title"/>+ </else-if>+ <else-if type="broadcast">+ <!-- TV broadcasts and podcasts (CMOS18 14.165, 14.168) -->+ <text font-style="italic" text-case="title" variable="container-title"/>+ </else-if>+ <else-if type="webpage">+ <!-- Website title substituted in bibliography only (CMOS18 14.104) -->+ <text text-case="title" variable="container-title"/>+ </else-if>+ </choose>+ </macro>+ <!-- 2. Date (CMOS18 13.102) -->+ <macro name="date">+ <choose>+ <if variable="issued">+ <group delimiter=" ">+ <!-- reprints and earlier editions may give original year in brackets (CMOS18 14.16) -->+ <text macro="date-original-year" prefix="(" suffix=")"/>+ <group>+ <text macro="date-issued-year"/>+ <text variable="year-suffix"/>+ </group>+ </group>+ </if>+ <else-if variable="available-date">+ <date date-parts="year" form="text" variable="available-date"/>+ </else-if>+ <else-if variable="event-date">+ <text macro="date-event-year"/>+ </else-if>+ <else-if variable="status">+ <group>+ <!-- Print the status variable rather than use generic CSL terms (`in press`, etc.) -->+ <text text-case="capitalize-first" variable="status"/>+ <text prefix="-" variable="year-suffix"/>+ </group>+ </else-if>+ <else-if type="collection">+ <!-- do not give n.d. for archival collections (CMOS18 14.128) -->+ <text prefix="-" variable="year-suffix"/>+ </else-if>+ <else-if type="manuscript">+ <!-- do not give n.d. with a bare shelfmark -->+ <choose>+ <if match="any" variable="container-title event-date event-place event-title genre title publisher publisher-place">+ <text form="short" term="no date"/>+ <text prefix="-" variable="year-suffix"/>+ </if>+ </choose>+ </else-if>+ <else>+ <text form="short" term="no date"/>+ <text prefix="-" variable="year-suffix"/>+ </else>+ </choose>+ </macro>+ <macro name="date-short">+ <choose>+ <if variable="issued">+ <group delimiter=" ">+ <choose>+ <if is-uncertain-date="original-date">+ <!-- Uncertain date already has square brackets -->+ <text macro="date-original-year"/>+ </if>+ <else>+ <text macro="date-original-year" prefix="[" suffix="]"/>+ </else>+ </choose>+ <group>+ <choose>+ <if match="any" type="interview personal_communication">+ <choose>+ <if match="any" variable="archive archive-place container-title DOI number publisher references URL">+ <!-- These variables indicate that the communication is retrievable by the reader. If not, then use the in-text-only personal communication format -->+ <text macro="date-issued-year"/>+ </if>+ <else>+ <text macro="date-issued-full"/>+ </else>+ </choose>+ </if>+ <else>+ <text macro="date-issued-year"/>+ </else>+ </choose>+ <text variable="year-suffix"/>+ </group>+ </group>+ </if>+ <else-if variable="available-date">+ <date date-parts="year" form="text" variable="available-date"/>+ </else-if>+ <else-if variable="event-date">+ <text macro="date-event-year"/>+ </else-if>+ <else-if variable="status">+ <!-- Print the status variable rather than use generic CSL terms (`in press`, etc.) -->+ <text text-case="lowercase" variable="status"/>+ <text prefix="-" variable="year-suffix"/>+ </else-if>+ <else-if match="any" type="interview personal_communication">+ <choose>+ <if match="any" variable="archive archive-place container-title DOI number publisher references URL">+ <!-- only give n.d. for accessible personal communication (CMOS18 14.111)-->+ <text form="short" term="no date"/>+ </if>+ </choose>+ <text prefix="-" variable="year-suffix"/>+ </else-if>+ <else-if match="any" type="classic collection entry entry-dictionary entry-encyclopedia">+ <!-- do not give n.d. for archival collections (CMOS18 14.128), `classic` (CMOS18 14.143), or reference entries (CMOS18 14.131) -->+ <text prefix="-" variable="year-suffix"/>+ </else-if>+ <else-if type="manuscript">+ <!-- do not give n.d. with a bare shelfmark -->+ <choose>+ <if match="any" variable="container-title event-date event-place event-title genre title publisher publisher-place">+ <text form="short" term="no date"/>+ <text prefix="-" variable="year-suffix"/>+ </if>+ </choose>+ </else-if>+ <else>+ <text form="short" term="no date"/>+ <text prefix="-" variable="year-suffix"/>+ </else>+ </choose>+ </macro>+ <macro name="date-sort-group">+ <!-- Sort items with and without dates (CMOS18 14.44):++ 1. items with dates (= 0)+ 2. `no date` items (= 1)+ 3. items with `status` (forthcoming, in press, etc.) (= 2) -->+ <choose>+ <if variable="issued">+ <text value="0"/>+ </if>+ <else-if variable="status">+ <text value="2"/>+ </else-if>+ <else>+ <!-- n.d. -->+ <text value="1"/>+ </else>+ </choose>+ </macro>+ <macro name="date-sort-year">+ <!-- while reference lists are to be sorted chronologically (CMOS18 13.112), it appears that only the year is to be taken into account (CMOS18 13.114) -->+ <choose>+ <if type="personal_communication" variable="event-date issued">+ <date date-parts="year" form="text" variable="event-date"/>+ </if>+ <else>+ <text macro="date-issued-year"/>+ </else>+ </choose>+ </macro>+ <!-- Date elements -->+ <macro name="date-event-full">+ <choose>+ <if is-uncertain-date="issued">+ <!-- guessed-at date (CMOS18 14.44) -->+ <date form="text" prefix="[" suffix="?]" variable="event-date"/>+ </if>+ <else>+ <date form="text" variable="event-date"/>+ </else>+ </choose>+ </macro>+ <macro name="date-event-year">+ <choose>+ <if is-uncertain-date="issued">+ <!-- guessed-at date (CMOS18 14.44) -->+ <date date-parts="year" form="text" prefix="[" suffix="?]" variable="event-date"/>+ </if>+ <else>+ <date date-parts="year" form="text" variable="event-date"/>+ </else>+ </choose>+ </macro>+ <macro name="date-issued-full">+ <choose>+ <if is-uncertain-date="issued">+ <!-- guessed-at date (CMOS18 14.44) -->+ <date form="text" prefix="[" suffix="?]" variable="issued"/>+ </if>+ <else>+ <date form="text" variable="issued"/>+ </else>+ </choose>+ </macro>+ <macro name="date-issued-month">+ <date variable="issued">+ <date-part name="month"/>+ </date>+ </macro>+ <macro name="date-issued-month-day">+ <date variable="issued">+ <date-part name="month"/>+ <date-part name="day" prefix=" "/>+ </date>+ </macro>+ <macro name="date-issued-year">+ <choose>+ <if is-uncertain-date="issued">+ <!-- guessed-at date (CMOS18 14.44) -->+ <date date-parts="year" form="text" prefix="[" suffix="?]" variable="issued"/>+ </if>+ <else>+ <date date-parts="year" form="text" variable="issued"/>+ </else>+ </choose>+ </macro>+ <macro name="date-original-month">+ <date variable="original-date">+ <date-part name="month"/>+ </date>+ </macro>+ <macro name="date-original-month-day">+ <date variable="original-date">+ <date-part name="month"/>+ <date-part name="day" prefix=" "/>+ </date>+ </macro>+ <macro name="date-original-year">+ <choose>+ <if is-uncertain-date="original-date">+ <date date-parts="year" form="text" prefix="[" suffix="?]" variable="original-date"/>+ </if>+ <else>+ <date date-parts="year" form="text" variable="original-date"/>+ </else>+ </choose>+ </macro>+ <!-- 3. Title and descriptions (CMOS18 13.87-101) -->+ <macro name="title-and-descriptions-bib">+ <group delimiter=". ">+ <choose>+ <if variable="title">+ <text macro="title-bib"/>+ <text macro="description-bib"/>+ <text macro="identifier-bib"/>+ </if>+ <else-if match="any" type="bill report">+ <!-- Bills, resolutions, and congressional reports substitute bill number if no title -->+ <!-- Congressional reports are indistinguishable from other reports -->+ <text macro="identifier-number-bib"/>+ <text macro="identifier-bib"/>+ <text macro="description-bib"/>+ </else-if>+ <else>+ <text macro="description-bib"/>+ <text macro="identifier-bib"/>+ </else>+ </choose>+ </group>+ </macro>+ <macro name="title-and-descriptions-short">+ <choose>+ <if variable="title">+ <text macro="title-short"/>+ </if>+ <else-if match="any" type="bill report">+ <!-- Bills, resolutions, and congressional reports substitute bill number if no title -->+ <text macro="legal-identifier-bill-report"/>+ </else-if>+ <else>+ <text macro="description-short"/>+ </else>+ </choose>+ </macro>+ <macro name="title-and-source-bib">+ <group delimiter=". ">+ <choose>+ <if type="broadcast" variable="container-title number title">+ <!-- Bespoke `broadcast` format (CMOS18 14.165, 14.168) -->+ <text macro="source-monographic-title-bib"/>+ <group delimiter=", ">+ <text macro="identifier-number-bib"/>+ <text macro="title-bib"/>+ <text macro="description-bib"/>+ <text macro="source-monographic-identifier-contributors-bib"/>+ </group>+ <text macro="source-series-bib"/>+ <choose>+ <!-- show event information here only if not collapsed with `issued` (CMOS18 14.167) -->+ <if match="any" variable="event-date original-date original-publisher original-publisher-place publisher status">+ <text macro="source-event-bib"/>+ </if>+ </choose>+ </if>+ <else-if type="chapter" variable="container-title genre">+ <!-- 'Introduction to' etc. (CMOS18 14.12, 14.14) -->+ <group delimiter=" ">+ <text macro="title-and-descriptions-bib"/>+ <text macro="source-bib"/>+ </group>+ </else-if>+ <else>+ <text macro="title-and-descriptions-bib"/>+ <text macro="source-bib"/>+ </else>+ </choose>+ <group delimiter=", ">+ <choose>+ <!-- show event information here only if collapsed with `issued` (CMOS18 14.167) -->+ <if match="any" variable="event-date original-date original-publisher original-publisher-place publisher status"/>+ <!-- monographic usage only -->+ <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book"/>+ <else-if match="any" type="interview paper-conference">+ <choose>+ <if match="any" variable="collection-editor container-author editor editorial-director">+ <!-- monographic usage -->+ <text macro="source-event-bib"/>+ </if>+ </choose>+ </else-if>+ <else>+ <text macro="source-event-bib"/>+ </else>+ </choose>+ <text macro="source-monographic-publication-bib"/>+ </group>+ <text macro="source-medium-bib"/>+ <text macro="source-archive-bib"/>+ <text macro="source-date-accessed-DOI-URL-bib"/>+ </group>+ </macro>+ <!-- 3.1. Title -->+ <macro name="title-bib">+ <choose>+ <if match="any" type="post webpage">+ <!-- Handle `container-title` on `post` or `webpage` in manner of `publisher` -->+ <text macro="title-and-part-filter-review-bib"/>+ </if>+ <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">+ <text macro="title-and-part-filter-review-bib"/>+ </else-if>+ <else-if match="any" type="interview paper-conference">+ <choose>+ <if match="any" variable="collection-editor compiler editor editorial-director">+ <!-- monographic usage -->+ <text macro="title-monographic-bib"/>+ </if>+ <else>+ <!-- serial usage -->+ <text macro="title-and-part-filter-review-bib"/>+ </else>+ </choose>+ </else-if>+ <else>+ <text macro="title-monographic-bib"/>+ </else>+ </choose>+ </macro>+ <macro name="title-short">+ <choose>+ <if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">+ <!-- If a review has no `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->+ <choose>+ <if variable="reviewed-genre title">+ <!-- Quotes, title case -->+ <text form="short" quotes="true" text-case="title" variable="title"/>+ </if>+ <else-if variable="reviewed-genre reviewed-title title">+ <!-- Quotes, title case -->+ <text form="short" quotes="true" text-case="title" variable="title"/>+ </else-if>+ <else>+ <text macro="description-short"/>+ </else>+ </choose>+ </if>+ <else>+ <text macro="title-primary-short"/>+ </else>+ </choose>+ </macro>+ <!-- Title elements -->+ <macro name="title-and-part-filter-review-bib">+ <choose>+ <if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">+ <!-- `title` is only the review title if there is a separate `reviewed-genre` or `reviewed-title`; otherwise, it is the title of the reviewed work, printed in the description -->+ <choose>+ <if match="any" variable="reviewed-genre reviewed-title">+ <text macro="title-and-part-title-bib"/>+ </if>+ </choose>+ </if>+ <else>+ <text macro="title-and-part-title-bib"/>+ </else>+ </choose>+ </macro>+ <macro name="title-and-part-title-bib">+ <group delimiter=". ">+ <text macro="title-primary"/>+ <group delimiter=", ">+ <text macro="label-part-number-capitalized"/>+ <text macro="title-part"/>+ </group>+ </group>+ </macro>+ <macro name="title-monographic-bib">+ <!-- For monographic items, assume `part-number` and `part-title` refer to the book/volume. -->+ <!-- There is no `title-monographic-note` as notes always open with the primary title. -->+ <choose>+ <if variable="container-title">+ <text macro="title-primary"/>+ </if>+ <!-- For monographic items without `container-title`, bibliography entries list `part-title` or `volume-title` first if available -->+ <else-if variable="part-title">+ <text macro="title-part"/>+ </else-if>+ <else-if variable="volume-title">+ <text font-style="italic" text-case="title" variable="volume-title"/>+ </else-if>+ <else>+ <text macro="title-primary"/>+ </else>+ </choose>+ </macro>+ <macro name="title-part">+ <choose>+ <if type="patent">+ <!-- No italics or quotes, sentence case -->+ <text form="short" text-case="capitalize-first" variable="part-title"/>+ </if>+ <else-if match="any" type="bill collection legislation regulation treaty">+ <!-- No italics or quotes, title case -->+ <text text-case="title" variable="part-title"/>+ </else-if>+ <else-if type="legal_case">+ <!-- Italicized, sentence case -->+ <text font-style="italic" variable="part-title"/>+ </else-if>+ <else-if match="any" type="book classic graphic hearing map">+ <!-- Italicized, title case (regardless of `container-title`) -->+ <text font-style="italic" text-case="title" variable="part-title"/>+ </else-if>+ <else-if type="entry-encyclopedia" variable="author container-title">+ <!-- Signed encyclopedia entry in quotes, title case (CMOS18 14.132) -->+ <text quotes="true" text-case="title" variable="part-title"/>+ </else-if>+ <else-if type="entry-dictionary" variable="container-title">+ <!-- Quotes, sentence case -->+ <text quotes="true" variable="part-title"/>+ </else-if>+ <else-if type="entry-encyclopedia" variable="container-title">+ <!-- Quotes, sentence case -->+ <text quotes="true" variable="part-title"/>+ </else-if>+ <else-if type="post">+ <!-- Quotes, sentence case -->+ <text quotes="true" variable="part-title"/>+ </else-if>+ <!-- Other types are formatted based on presence of `container-title` -->+ <else-if variable="container-title">+ <!-- Quotes, title case -->+ <text quotes="true" text-case="title" variable="part-title"/>+ </else-if>+ <else-if match="any" type="article dataset document interview manuscript paper-conference personal_communication speech thesis webpage">+ <!-- Container-like but not necessarily with `container-title` -->+ <!-- Quotes, title case -->+ <text quotes="true" text-case="title" variable="part-title"/>+ </else-if>+ <else>+ <!-- Italicized, title case (default) -->+ <text font-style="italic" text-case="title" variable="part-title"/>+ </else>+ </choose>+ </macro>+ <macro name="title-primary">+ <choose>+ <if type="patent">+ <!-- No italics or quotes, sentence case -->+ <text form="short" text-case="capitalize-first" variable="title"/>+ </if>+ <else-if match="any" type="bill collection legislation regulation treaty">+ <!-- No italics or quotes, title case -->+ <text text-case="title" variable="title"/>+ </else-if>+ <else-if type="legal_case">+ <!-- Italicized, sentence case -->+ <text font-style="italic" variable="title"/>+ </else-if>+ <else-if match="any" type="book classic graphic hearing map">+ <!-- Italicized, title case (regardless of `container-title`) -->+ <text font-style="italic" text-case="title" variable="title"/>+ </else-if>+ <else-if type="entry-encyclopedia" variable="author container-title">+ <!-- Signed encyclopedia entry in quotes, title case (CMOS18 14.132) -->+ <text quotes="true" text-case="title" variable="title"/>+ </else-if>+ <else-if type="entry-dictionary" variable="container-title">+ <!-- Quotes, sentence case -->+ <text quotes="true" variable="title"/>+ </else-if>+ <else-if type="entry-encyclopedia" variable="container-title">+ <!-- Quotes, sentence case -->+ <text quotes="true" variable="title"/>+ </else-if>+ <else-if type="post">+ <!-- Quotes, sentence case -->+ <text quotes="true" variable="title"/>+ </else-if>+ <!-- Other types are formatted based on presence of `container-title` -->+ <else-if variable="container-title">+ <!-- Quotes, title case -->+ <text quotes="true" text-case="title" variable="title"/>+ </else-if>+ <else-if match="any" type="article dataset document interview manuscript paper-conference personal_communication speech thesis webpage">+ <!-- Container-like but not necessarily with `container-title` -->+ <!-- Quotes, title case -->+ <text quotes="true" text-case="title" variable="title"/>+ </else-if>+ <else>+ <!-- Italicized, title case (default) -->+ <text font-style="italic" text-case="title" variable="title"/>+ </else>+ </choose>+ </macro>+ <macro name="title-primary-short">+ <choose>+ <if type="patent">+ <!-- No italics or quotes, sentence case -->+ <text form="short" text-case="capitalize-first" variable="title"/>+ </if>+ <else-if match="any" type="bill collection legislation regulation treaty">+ <!-- No italics or quotes, title case -->+ <text form="short" text-case="title" variable="title"/>+ </else-if>+ <else-if type="legal_case">+ <!-- Italicized, sentence case -->+ <text font-style="italic" form="short" variable="title"/>+ </else-if>+ <else-if match="any" type="book classic graphic hearing map">+ <!-- Italicized, title case (regardless of `container-title`) -->+ <text font-style="italic" form="short" text-case="title" variable="title"/>+ </else-if>+ <else-if type="entry-encyclopedia" variable="author container-title">+ <!-- Signed encyclopedia entry in quotes, title case (CMOS18 14.132) -->+ <text form="short" quotes="true" text-case="title" variable="title"/>+ </else-if>+ <else-if type="entry-dictionary" variable="container-title">+ <!-- Quotes, sentence case -->+ <text form="short" quotes="true" variable="title"/>+ </else-if>+ <else-if type="entry-encyclopedia" variable="container-title">+ <!-- Quotes, sentence case -->+ <text form="short" quotes="true" variable="title"/>+ </else-if>+ <else-if type="post">+ <!-- Quotes, sentence case -->+ <text form="short" quotes="true" variable="title"/>+ </else-if>+ <!-- Other types are formatted based on presence of `container-title` -->+ <else-if variable="container-title">+ <!-- Quotes, title case -->+ <text form="short" quotes="true" text-case="title" variable="title"/>+ </else-if>+ <else-if match="any" type="article dataset document interview manuscript paper-conference personal_communication speech thesis webpage">+ <!-- Container-like but not necessarily with `container-title` -->+ <!-- Quotes, title case -->+ <text form="short" quotes="true" text-case="title" variable="title"/>+ </else-if>+ <else>+ <!-- Italicized, title case (default) -->+ <text font-style="italic" form="short" text-case="title" variable="title"/>+ </else>+ </choose>+ </macro>+ <!-- 3.2. Description -->+ <macro name="description-bib">+ <choose>+ <if match="any" type="interview" variable="interviewer">+ <text macro="description-interview-bib"/>+ </if>+ <else-if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">+ <text macro="description-review-bib"/>+ </else-if>+ <else-if type="personal_communication">+ <text macro="description-letter-bib"/>+ </else-if>+ <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">+ <text macro="description-serial-bib"/>+ </else-if>+ <else-if type="paper-conference">+ <text macro="description-paper-conference-bib"/>+ </else-if>+ <else-if type="song" variable="composer">+ <text macro="description-song-bib"/>+ </else-if>+ <!-- thesis type appears with university name (CMOS18 14.113) -->+ <else-if type="thesis"/>+ <else-if match="none" variable="container-title">+ <!-- Other description -->+ <text macro="description-format-bib"/>+ </else-if>+ <else>+ <text macro="description-generic-bib"/>+ </else>+ </choose>+ </macro>+ <macro name="description-short">+ <choose>+ <if match="any" type="interview" variable="interviewer">+ <text macro="description-interview-short"/>+ </if>+ <else-if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">+ <text macro="description-review-short"/>+ </else-if>+ <else-if type="personal_communication">+ <text macro="description-letter-short"/>+ </else-if>+ <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">+ <text macro="description-serial-short"/>+ </else-if>+ <else-if type="paper-conference">+ <choose>+ <if match="any" variable="collection-editor container-author editor editorial-director">+ <!-- monographic usage -->+ <text macro="description-format-short"/>+ </if>+ <else>+ <!-- serial usage -->+ <text macro="description-serial-short"/>+ </else>+ </choose>+ </else-if>+ <else>+ <text macro="description-format-short"/>+ </else>+ </choose>+ </macro>+ <!-- Description elements -->+ <macro name="description-format-bib">+ <choose>+ <if variable="genre number"/>+ <else-if variable="genre">+ <text text-case="capitalize-first" variable="genre"/>+ </else-if>+ <else-if type="manuscript">+ <!-- 'unpublished manuscript' if no `genre` (CMOS18 14.114) -->+ <choose>+ <if match="none" variable="archive archive-place container-title DOI number publisher references URL">+ <text term="manuscript" text-case="capitalize-first"/>+ </if>+ </choose>+ </else-if>+ <else-if type="personal_communication">+ <!-- 'personal communication' if no `genre` (CMOS18 14.111) -->+ <choose>+ <if match="none" variable="archive archive-place container-title DOI number publisher references URL">+ <text term="personal-communication" text-case="capitalize-first"/>+ </if>+ </choose>+ </else-if>+ </choose>+ </macro>+ <macro name="description-format-short">+ <choose>+ <if variable="genre">+ <text variable="genre"/>+ </if>+ <else-if variable="medium">+ <text variable="medium"/>+ </else-if>+ <else-if type="manuscript">+ <!-- 'unpublished manuscript' if no `genre` (CMOS18 14.114) -->+ <choose>+ <if match="none" variable="archive archive-place container-title DOI number publisher references URL">+ <text term="manuscript"/>+ </if>+ </choose>+ </else-if>+ <else-if type="personal_communication">+ <!-- 'pers. comm.' if no `genre` (CMOS18 14.111) -->+ <choose>+ <if match="none" variable="archive archive-place container-title DOI number publisher references URL">+ <text form="short" term="personal-communication"/>+ </if>+ </choose>+ </else-if>+ <else-if variable="chapter-number">+ <text macro="label-chapter-number"/>+ </else-if>+ </choose>+ </macro>+ <macro name="description-generic-bib">+ <!-- For conference presentations/performances/events, chapters in reports/standards/generic documents, software, place description within the source element -->+ <choose>+ <if match="any" type="event paper-conference performance speech">+ <choose>+ <if match="any" variable="collection-editor compiler editor editorial-director">+ <!-- monographic usage -->+ <text macro="description-format-bib"/>+ </if>+ </choose>+ </if>+ <else-if match="none" type="document report software standard">+ <text macro="description-format-bib"/>+ </else-if>+ </choose>+ </macro>+ <macro name="description-interview-bib">+ <group delimiter=", ">+ <choose>+ <if variable="genre number">+ <!-- `genre` printed with `number` -->+ <names variable="interviewer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ </if>+ <else-if variable="genre">+ <group delimiter=" ">+ <text text-case="capitalize-first" variable="genre"/>+ <group delimiter=" ">+ <text form="verb" term="container-author"/>+ <names variable="interviewer"/>+ </group>+ </group>+ </else-if>+ <else-if variable="interviewer">+ <names variable="interviewer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ </else-if>+ <else>+ <text macro="description-format-bib"/>+ </else>+ </choose>+ <text macro="source-event-place-first"/>+ </group>+ </macro>+ <macro name="description-interview-short">+ <choose>+ <if disambiguate="true">+ <names variable="interviewer">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ <substitute>+ <text macro="description-format-short"/>+ </substitute>+ </names>+ </if>+ <else-if match="any" variable="genre medium">+ <choose>+ <if match="none" variable="author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator">+ <!-- capitalize if no author or title -->+ <text macro="description-format-bib"/>+ </if>+ <else>+ <text macro="description-format-short"/>+ </else>+ </choose>+ </else-if>+ <else>+ <!-- generic description for an unpublished interview (CMOS18 14.108) -->+ <text term="interview"/>+ </else>+ </choose>+ </macro>+ <macro name="description-letter-bib">+ <choose>+ <if variable="recipient">+ <group delimiter=", ">+ <choose>+ <if variable="genre number">+ <!-- `genre` appears with `number` -->+ <names variable="recipient">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ </if>+ <else-if variable="genre">+ <group delimiter=" ">+ <text macro="description-format-bib"/>+ <names variable="recipient">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ </group>+ </else-if>+ <else>+ <names variable="recipient">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ </else>+ </choose>+ <text variable="event-place"/>+ <text macro="date-event-full"/>+ </group>+ </if>+ <else>+ <text macro="description-format-bib"/>+ </else>+ </choose>+ </macro>+ <macro name="description-letter-short">+ <!-- shortened notes ideally give author, recipient, place, and date (CMOS18 14.13) -->+ <group delimiter=", ">+ <choose>+ <if variable="genre recipient">+ <group delimiter=" ">+ <text macro="description-format-short"/>+ <names variable="recipient">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ </group>+ </if>+ <else>+ <text macro="description-format-short"/>+ </else>+ </choose>+ <text variable="event-place"/>+ <text macro="date-event-full"/>+ </group>+ </macro>+ <macro name="description-paper-conference-bib">+ <choose>+ <if match="any" variable="collection-editor container-author editor editorial-director">+ <!-- monographic usage -->+ <text macro="description-generic-bib"/>+ </if>+ <else>+ <!-- serial usage -->+ <group delimiter=". ">+ <text macro="description-serial-bib"/>+ <text macro="source-event-bib"/>+ </group>+ </else>+ </choose>+ </macro>+ <macro name="description-review-bib">+ <!-- Reviewed item -->+ <group delimiter=". ">+ <group delimiter=", ">+ <group delimiter=" ">+ <text macro="description-review-genre-bib"/>+ <text macro="description-review-title"/>+ </group>+ <choose>+ <if variable="reviewed-genre reviewed-title title">+ <names variable="reviewed-author">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ </if>+ <else-if variable="reviewed-genre"/>+ <else>+ <names variable="reviewed-author">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ </else>+ </choose>+ <text macro="source-event-place-first"/>+ </group>+ <text macro="label-section-capitalized"/>+ </group>+ </macro>+ <macro name="description-review-genre-bib">+ <choose>+ <if variable="reviewed-genre">+ <group delimiter=" ">+ <text macro="description-review-term-unsigned-bib"/>+ <text variable="reviewed-genre"/>+ <choose>+ <if match="none" variable="reviewed-title">+ <names variable="reviewed-author">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ </if>+ </choose>+ </group>+ </if>+ <else-if variable="number">+ <text macro="description-review-term-unsigned-bib"/>+ </else-if>+ <!-- If no `reviewed-genre`, assume that `genre` is entered as 'Review of the book' or similar -->+ <else-if variable="genre">+ <text text-case="capitalize-first" variable="genre"/>+ </else-if>+ <else>+ <text macro="description-review-term-unsigned-bib"/>+ </else>+ </choose>+ </macro>+ <macro name="description-review-short">+ <group delimiter=" ">+ <text term="review-of"/>+ <text macro="description-review-title-short"/>+ </group>+ </macro>+ <macro name="description-review-term-unsigned-bib">+ <!-- Anonymous reviews appear as 'unsigned' (CMOS18 14.102) -->+ <choose>+ <if match="any" variable="author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator">+ <text term="review-of" text-case="capitalize-first"/>+ </if>+ <else>+ <group delimiter=" ">+ <text term="anonymous" text-case="capitalize-first"/>+ <text term="review-of"/>+ </group>+ </else>+ </choose>+ </macro>+ <macro name="description-review-title">+ <choose>+ <if match="any" variable="reviewed-genre reviewed-title">+ <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title -->+ <!-- Adapt for `reviewed-container-title` or similar if it becomes available -->+ <text font-style="italic" text-case="title" variable="reviewed-title"/>+ </if>+ <else>+ <!-- Assume title is title of reviewed work -->+ <text font-style="italic" text-case="title" variable="title"/>+ </else>+ </choose>+ </macro>+ <macro name="description-review-title-short">+ <choose>+ <if match="any" variable="reviewed-genre reviewed-title">+ <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title -->+ <!-- Adapt for `reviewed-container-title` or similar if it becomes available -->+ <text font-style="italic" form="short" text-case="title" variable="reviewed-title"/>+ </if>+ <else>+ <!-- Assume title is title of reviewed work -->+ <text font-style="italic" form="short" text-case="title" variable="title"/>+ </else>+ </choose>+ </macro>+ <macro name="description-serial-bib">+ <group delimiter=". ">+ <text macro="description-format-bib"/>+ <!-- `section` provides magazine departments (CMOS18 14.88) and newspaper column names (CMOS18 14.93) -->+ <text macro="label-section-capitalized"/>+ </group>+ </macro>+ <macro name="description-serial-short">+ <choose>+ <if variable="title"/>+ <else-if variable="genre">+ <text macro="description-format-short"/>+ </else-if>+ <else>+ <text variable="section"/>+ </else>+ </choose>+ </macro>+ <macro name="description-song-bib">+ <!-- Performer of classical music works -->+ <!-- TODO: remove when Zotero fixes mapping of performer to `author` -->+ <group delimiter=" ">+ <!-- Based on `description-format` macro -->+ <choose>+ <if variable="genre">+ <text text-case="capitalize-first" variable="genre"/>+ <text form="verb" term="performer"/>+ </if>+ <!-- providing 'performed by' label for recorded readings (CMOS18 14.164), but it should be omitted for classical music (CMOS18 14.163) -->+ <else>+ <text form="verb" term="performer" text-case="capitalize-first"/>+ </else>+ </choose>+ <names variable="author">+ <substitute>+ <names variable="performer"/>+ </substitute>+ </names>+ </group>+ </macro>+ <!-- 3.3. Identifier (edition, contributors, volume) -->+ <macro name="identifier-bib">+ <group delimiter=". ">+ <choose>+ <if type="patent">+ <text macro="identifier-patent"/>+ </if>+ <else-if type="report">+ <text macro="identifier-report-bib"/>+ </else-if>+ <else-if match="any" type="post webpage">+ <!-- Handle `container-title` on `post` or `webpage` as `publisher` -->+ <text macro="identifier-number-bib"/>+ <text macro="label-version-capitalized"/>+ <text macro="identifier-edition-bib"/>+ <text macro="identifier-contributors-bib"/>+ <text macro="identifier-volume-monographic-bib"/>+ </else-if>+ <else-if variable="container-title">+ <choose>+ <if match="any" type="broadcast graphic map motion_picture">+ <!-- For audiovisual media, number information comes after `title`, not `container-title`; `song` places album catalogue `number` with `publisher` (CMOS18 14.163-164) -->+ <text macro="identifier-number-bib"/>+ </if>+ </choose>+ <text macro="identifier-contributors-bib"/>+ </else-if>+ <else>+ <choose>+ <if match="none" type="song">+ <text macro="identifier-number-bib"/>+ </if>+ </choose>+ <text macro="label-version-capitalized"/>+ <text macro="identifier-edition-bib"/>+ <choose>+ <if match="any" variable="part-title volume-title">+ <text macro="identifier-contributors-bib"/>+ </if>+ <else-if match="any" variable="number-of-volumes part-number volume">+ <!-- `collection-editor` belongs with `collection-title` if item is not multivolume -->+ <choose>+ <if variable="collection-editor">+ <names variable="collection-editor">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ </if>+ <else>+ <text macro="identifier-contributors-bib"/>+ </else>+ </choose>+ </else-if>+ <else>+ <text macro="identifier-contributors-bib"/>+ </else>+ </choose>+ <text macro="identifier-volume-monographic-bib"/>+ <choose>+ <!-- `collection-editor` supplied in `identifier-volume-monographic-bib` if there is a `part-title` or `volume-title` -->+ <if match="any" variable="part-title volume-title"/>+ <else-if match="any" variable="number-of-volumes part-number volume">+ <choose>+ <if variable="collection-editor">+ <text macro="identifier-contributors-bib"/>+ </if>+ </choose>+ </else-if>+ </choose>+ </else>+ </choose>+ </group>+ </macro>+ <!-- Identifier elements -->+ <macro name="identifier-contributors-bib">+ <choose>+ <if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">+ <text macro="identifier-contributors-serial-bib"/>+ </if>+ <else-if match="any" type="interview paper-conference">+ <choose>+ <if match="any" variable="collection-editor compiler editor editorial-director">+ <!-- monographic usage -->+ <text macro="identifier-contributors-monographic-bib"/>+ </if>+ <else>+ <!-- serial usage -->+ <text macro="identifier-contributors-serial-bib"/>+ </else>+ </choose>+ </else-if>+ <else>+ <text macro="identifier-contributors-monographic-bib"/>+ </else>+ </choose>+ </macro>+ <macro name="identifier-contributors-monographic-bib">+ <group delimiter=". ">+ <choose>+ <if match="any" type="post webpage">+ <group delimiter=". ">+ <names variable="container-author">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="editor-translator">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names delimiter=". " variable="editor translator">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="editorial-director">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="guest">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="host">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="illustrator">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="narrator">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names delimiter=". " variable="compiler chair organizer curator">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names delimiter=". " variable="series-creator executive-producer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="producer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="director">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <choose>+ <if match="any" type="broadcast performance">+ <names variable="script-writer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ </if>+ </choose>+ <names variable="performer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <choose>+ <if match="none" type="thesis">+ <names variable="contributor">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ </if>+ </choose>+ </group>+ </if>+ <else>+ <!-- Handle `container-title` on `post` or `webpage` as `publisher` -->+ <group delimiter=". ">+ <choose>+ <if match="none" variable="container-title">+ <names variable="container-author">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="editor-translator">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names delimiter=". " variable="editor translator">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="editorial-director">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="guest">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="host">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ </if>+ </choose>+ <names variable="illustrator">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="narrator">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <choose>+ <if match="none" variable="container-title">+ <names delimiter=". " variable="compiler chair organizer curator">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names delimiter=". " variable="series-creator executive-producer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="producer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="director">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <choose>+ <if match="any" type="broadcast performance">+ <names variable="script-writer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ </if>+ </choose>+ <names variable="performer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <choose>+ <if match="none" type="song thesis">+ <names variable="contributor">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ </if>+ </choose>+ </if>+ </choose>+ <choose>+ <if type="song">+ <!-- Song contributors attached to album (CMOS18 14.163) -->+ <names variable="contributor">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ </if>+ </choose>+ </group>+ </else>+ </choose>+ </group>+ </macro>+ <macro name="identifier-contributors-serial-bib">+ <group delimiter=". ">+ <names delimiter=". " variable="translator narrator">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names delimiter=", " variable="compiler chair organizer curator">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names delimiter=", " variable="series-creator executive-producer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="producer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="director">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="script-writer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ <names variable="performer">+ <label form="verb" suffix=" " text-case="capitalize-first"/>+ <name and="text"/>+ </names>+ </group>+ </macro>+ <macro name="identifier-edition-bib">+ <choose>+ <if match="none" variable="original-date">+ <text macro="label-edition-capitalized"/>+ </if>+ <else-if variable="original-title">+ <text macro="label-edition-capitalized"/>+ </else-if>+ </choose>+ </macro>+ <macro name="identifier-number-bib">+ <group delimiter=" ">+ <choose>+ <if is-numeric="number" type="broadcast" variable="genre">+ <text text-case="capitalize-first" variable="genre"/>+ <text variable="number"/>+ </if>+ <else-if is-numeric="number" type="broadcast">+ <text text-case="capitalize-first" value="episode"/>+ <text variable="number"/>+ </else-if>+ <else-if variable="number">+ <text text-case="title" variable="genre"/>+ <text macro="label-number-capitalized"/>+ </else-if>+ </choose>+ </group>+ </macro>+ <macro name="identifier-patent">+ <group delimiter=", ">+ <group delimiter=" ">+ <!-- `authority`: US ; `genre`: patent ; `number`: 123,445 -->+ <text form="short" variable="authority"/>+ <!-- 'US Patent' capitalized in both bibliography and note forms -->+ <choose>+ <if variable="genre">+ <text text-case="capitalize-first" variable="genre"/>+ </if>+ <else>+ <text term="patent" text-case="capitalize-first"/>+ </else>+ </choose>+ <text variable="number"/>+ </group>+ <group delimiter=" ">+ <text value="filed"/>+ <date form="text" variable="submitted"/>+ </group>+ <group delimiter=" ">+ <choose>+ <if variable="issued submitted">+ <text term="and"/>+ </if>+ </choose>+ <text value="issued"/>+ <!-- Always give full issue date, even in author-date (CMOS18 14.158) -->+ <text macro="date-issued-full"/>+ </group>+ </group>+ </macro>+ <macro name="identifier-report-bib">+ <group delimiter=". ">+ <choose>+ <if variable="container-title">+ <!-- If the report is a chapter in a larger report, then most identifying information is printed in the source. -->+ <text macro="identifier-contributors-bib"/>+ </if>+ <else-if variable="title">+ <text macro="identifier-number-bib"/>+ <text macro="label-version-capitalized"/>+ <text macro="identifier-edition-bib"/>+ <text macro="identifier-contributors-bib"/>+ <text macro="identifier-volume-monographic-bib"/>+ </else-if>+ <else>+ <!-- If there is no `title`, then `genre` and `number` are already printed as the title. -->+ <text macro="label-version-capitalized"/>+ <text macro="identifier-edition-bib"/>+ <text macro="identifier-contributors-bib"/>+ <text macro="identifier-volume-monographic-bib"/>+ </else>+ </choose>+ </group>+ </macro>+ <macro name="identifier-volume-bib">+ <!-- In notes styles, bibliography entries may be listed either under an individual volume title or its series, but the former approach is required for author-date, which is the form that this macro implements (CMOS18 14.21) -->+ <group delimiter=", ">+ <choose>+ <if variable="part-number part-title volume volume-title">+ <!-- part and title with individual titles -->+ <group delimiter=" ">+ <text macro="label-part-number-capitalized"/>+ <text value="of"/>+ <text font-style="italic" text-case="title" variable="volume-title"/>+ </group>+ <group delimiter=" ">+ <text macro="label-volume"/>+ <text value="of"/>+ <group delimiter=", ">+ <text macro="title-primary"/>+ <names variable="collection-editor">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ </group>+ </group>+ </if>+ <else-if match="any" variable="part-title volume-title">+ <group delimiter=" ">+ <choose>+ <if variable="part-number volume">+ <group delimiter=", ">+ <text macro="label-volume-capitalized"/>+ <text macro="label-part-number"/>+ <text value="of"/>+ </group>+ </if>+ <else-if variable="part-number">+ <text macro="label-part-number-capitalized"/>+ <text value="of"/>+ </else-if>+ <else-if variable="volume">+ <text macro="label-volume-capitalized"/>+ <text value="of"/>+ </else-if>+ </choose>+ <group delimiter=", ">+ <text macro="title-primary"/>+ <names variable="collection-editor">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ </group>+ </group>+ </else-if>+ <else-if variable="part-number volume">+ <text macro="label-volume-capitalized"/>+ <text macro="label-part-number"/>+ </else-if>+ <else-if variable="part-number">+ <text macro="label-part-number-capitalized"/>+ </else-if>+ <else-if variable="volume">+ <text macro="label-volume-capitalized"/>+ </else-if>+ <else>+ <text macro="label-number-of-volumes"/>+ </else>+ </choose>+ </group>+ </macro>+ <macro name="identifier-volume-monographic-bib">+ <choose>+ <if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book"/>+ <else-if match="any" type="interview paper-conference">+ <choose>+ <if match="any" variable="collection-editor compiler editor editorial-director">+ <!-- monographic usage -->+ <text macro="identifier-volume-bib"/>+ </if>+ </choose>+ </else-if>+ <else>+ <text macro="identifier-volume-bib"/>+ </else>+ </choose>+ </macro>+ <!-- 4. Source -->+ <macro name="source-bib">+ <choose>+ <if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">+ <!-- serial usage -->+ <text macro="source-serial-bib"/>+ </if>+ <else-if match="any" type="interview paper-conference">+ <choose>+ <if match="any" variable="collection-editor container-author editor editorial-director">+ <!-- monographic usage -->+ <text macro="source-monographic-bib"/>+ </if>+ <else>+ <!-- serial usage -->+ <text macro="source-serial-bib"/>+ </else>+ </choose>+ </else-if>+ <else-if match="any" type="patent post webpage"/>+ <else>+ <text macro="source-monographic-bib"/>+ </else>+ </choose>+ </macro>+ <!-- 4.1. Serial sources -->+ <macro name="source-serial-bib">+ <group delimiter=". ">+ <text macro="source-serial-title-volume-bib"/>+ <choose>+ <if type="article-newspaper">+ <group delimiter=", ">+ <text macro="source-serial-title-bib"/>+ <text macro="source-serial-identifier-bib"/>+ </group>+ </if>+ <else-if variable="collection-title volume">+ <group delimiter=", ">+ <text macro="source-serial-title-bib"/>+ <text macro="source-serial-identifier-bib"/>+ </group>+ </else-if>+ <else-if variable="volume">+ <group delimiter=" ">+ <text macro="source-serial-title-bib"/>+ <text macro="source-serial-identifier-bib"/>+ </group>+ </else-if>+ <else>+ <group delimiter=", ">+ <text macro="source-serial-title-bib"/>+ <text macro="source-serial-identifier-bib"/>+ </group>+ </else>+ </choose>+ </group>+ </macro>+ <!-- Serial source title -->+ <macro name="source-serial-name">+ <group delimiter=" ">+ <text font-style="italic" text-case="title" variable="container-title"/>+ <choose>+ <!-- TODO: remove conditional when Zotero stops double-mapping `event-place` and `publisher-place` -->+ <if match="none" variable="event-date event-title">+ <text prefix="(" suffix=")" variable="publisher-place"/>+ </if>+ </choose>+ </group>+ </macro>+ <macro name="source-serial-title-bib">+ <group delimiter=", ">+ <choose>+ <!-- Journal special issues (CMOS18 14.77) and supplements (CMOS18 14.78) -->+ <if match="none" variable="container-title"/>+ <else-if match="none" type="periodical" variable="supplement-number volume-title"/>+ <!-- TODO: use `container-genre` here once available to allow a custom description of the journal volume -->+ <else-if variable="supplement-number volume-title">+ <text term="supplement" text-case="capitalize-first"/>+ </else-if>+ <else-if type="periodical" variable="supplement-number title">+ <text term="supplement" text-case="capitalize-first"/>+ </else-if>+ <else-if variable="volume-title">+ <text term="special-issue" text-case="capitalize-first"/>+ </else-if>+ <else-if type="periodical" variable="title">+ <text term="special-issue" text-case="capitalize-first"/>+ </else-if>+ </choose>+ <text macro="source-serial-name"/>+ <choose>+ <!-- 'ahead of print' is placed akin to a series (CMOS18 14.75) -->+ <if match="any" variable="available-date collection-title issue number page status supplement-number volume"/>+ <else-if type="article-journal" variable="DOI issued">+ <text term="advance-online-publication"/>+ </else-if>+ </choose>+ </group>+ </macro>+ <macro name="source-serial-title-volume-bib">+ <choose>+ <if variable="volume-title">+ <!-- Journal special issues (CMOS18 14.77) and supplements (CMOS18 14.78) -->+ <group delimiter=", ">+ <group delimiter=" ">+ <text macro="source-monographic-preposition-bib"/>+ <text quotes="true" text-case="title" variable="volume-title"/>+ </group>+ <text macro="source-monographic-identifier-contributors-bib"/>+ </group>+ </if>+ </choose>+ </macro>+ <!-- Serial source identifier -->+ <macro name="source-serial-identifier-bib">+ <choose>+ <if match="any" variable="issue supplement-number volume">+ <group delimiter=": ">+ <text macro="source-serial-identifier-volume-author-date"/>+ <text macro="source-serial-locator"/>+ </group>+ </if>+ <else>+ <group delimiter=", ">+ <group delimiter=". ">+ <text macro="source-serial-identifier-volume-author-date"/>+ <!-- periodical edition always capitalized (CMOS18 14.89) -->+ <text macro="label-edition-capitalized"/>+ </group>+ <text macro="source-serial-locator"/>+ </group>+ </else>+ <!-- TODO: If CSL adds `date-part` detection, add two further conditions to address CMOS18 14.74: delimiting with ":" if there is a `volume` and no month or `issue` or `supplement number`; delimiting with ", " or there is an `issue` or `supplement number` and no month -->+ </choose>+ </macro>+ <macro name="source-serial-identifier-volume-author-date">+ <group delimiter=", ">+ <choose>+ <if type="article-newspaper">+ <!-- newspapers provide the full date in place of volume/issue numbers (CMOS18 14.89) -->+ <text variable="collection-title"/>+ <text macro="source-serial-volume-status-bib"/>+ </if>+ <else-if match="any" variable="issue supplement-number volume">+ <choose>+ <if match="any" type="article-magazine review review-book" variable="reviewed-author reviewed-genre reviewed-title">+ <!-- date appears first if the magazine or review `container-title` has been substituted for a missing author (CMOS18 14.87, 14.102) -->+ <choose>+ <if match="none" variable="author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator">+ <choose>+ <!-- no extra date details with a volume plus issue/supplement -->+ <if variable="issue volume"/>+ <else-if variable="supplement-number"/>+ <!-- nothing to substitute if there is no issue/supplement/volume -->+ <else-if match="none" variable="issue volume"/>+ <else>+ <text macro="source-date-bib"/>+ <!-- for CMOS17 author-date: -->+ <!-- <text macro="source-date-issued-month-day"/> -->+ </else>+ </choose>+ </if>+ </choose>+ </if>+ </choose>+ <!-- `collection-title` is for any serial with multiple series (e.g. '4th ser.') -->+ <text variable="collection-title"/>+ <group delimiter=" ">+ <choose>+ <if variable="volume">+ <choose>+ <if variable="collection-title">+ <text macro="label-volume"/>+ </if>+ <else-if match="any" type="article-magazine review review-book" variable="reviewed-author reviewed-genre reviewed-title">+ <!-- provide label if a magazine or review `container-title` has been substituted for a missing author (CMOS18 14.87, 14.102) -->+ <choose>+ <if match="any" variable="author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator">+ <text variable="volume"/>+ </if>+ <!-- TODO: when CSL provides date part detection, volume should be lowercase if there is a month, but otherwise capitalized -->+ <else>+ <text macro="label-volume-capitalized"/>+ </else>+ </choose>+ </else-if>+ <else>+ <text variable="volume"/>+ </else>+ </choose>+ <group delimiter=", " prefix="(" suffix=")">+ <choose>+ <if match="any" variable="issue supplement-number">+ <text variable="issue"/>+ <text macro="label-supplement-number"/>+ </if>+ <else-if match="any" type="article-magazine review review-book" variable="reviewed-author reviewed-genre reviewed-title">+ <!-- date for anonymous magazine and review articles only appears here if it did not earlier (CMOS18 14.87, 14.102) -->+ <choose>+ <if match="any" variable="author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator">+ <text macro="source-date-bib"/>+ <!-- for CMOS17 author-date: -->+ <!-- <text macro="source-date-issued-month-day"/> -->+ </if>+ </choose>+ </else-if>+ <else>+ <text macro="source-date-bib"/>+ <!-- for CMOS17 author-date: -->+ <!-- <text macro="source-date-issued-month-day"/> -->+ </else>+ </choose>+ </group>+ </if>+ <else-if match="any" variable="issue supplement-number">+ <group delimiter=" ">+ <group delimiter=", ">+ <text macro="label-issue"/>+ <text macro="label-supplement-number"/>+ </group>+ <choose>+ <if match="any" variable="author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator">+ <text macro="source-date-bib" prefix="(" suffix=")"/>+ <!-- for CMOS17 author-date: -->+ <!-- <text macro="source-date-issued-month-day" prefix="(" suffix=")"/> -->+ </if>+ </choose>+ </group>+ </else-if>+ </choose>+ </group>+ </else-if>+ <else>+ <text variable="collection-title"/>+ <choose>+ <if match="any" type="interview" variable="interviewer">+ <!-- publisher possible with `interview` (cf. CMOS18 14.110) -->+ <text variable="publisher"/>+ </if>+ </choose>+ <text macro="source-serial-volume-status-bib"/>+ </else>+ </choose>+ </group>+ </macro>+ <macro name="source-serial-volume-status-bib">+ <group delimiter=", ">+ <choose>+ <if match="none" variable="collection-title issue number page supplement-number volume">+ <group delimiter=" ">+ <!-- article accepted for publication and available on publisher website (CMOS18 14.75) -->+ <!-- TODO: use CSL term for `available-date` when available -->+ <text value="accepted"/>+ <date form="text" variable="available-date"/>+ </group>+ </if>+ </choose>+ <group delimiter=" ">+ <text macro="source-date-status-bib"/>+ <text macro="source-date-bib"/>+ <!-- for CMOS17 author-date: -->+ <!-- <text macro="source-date-issued-full-serial"/> -->+ </group>+ </group>+ </macro>+ <!-- Serial source locator -->+ <macro name="source-serial-locator">+ <choose>+ <if match="any" variable="locator number">+ <group delimiter=", ">+ <text macro="label-locator"/>+ <!-- an article ID appears alongside locators in notes (CMOS18 14.71) -->+ <text variable="number"/>+ </group>+ </if>+ <!-- do not give pages for newspapers (CMOS18 14.89) -->+ <else-if type="article-newspaper"/>+ <else>+ <text variable="page"/>+ </else>+ </choose>+ </macro>+ <!-- 4.2. Monographic sources -->+ <macro name="source-monographic-bib">+ <group delimiter=". ">+ <!-- Monographic sources repeat main reference elements -->+ <choose>+ <if variable="container-title">+ <group delimiter=", ">+ <group delimiter=" ">+ <choose>+ <if match="none" type="broadcast motion_picture">+ <text macro="source-monographic-preposition-bib"/>+ </if>+ </choose>+ <text macro="source-monographic-title-bib"/>+ </group>+ <text macro="source-monographic-description-bib"/>+ <text macro="source-monographic-identifier-bib"/>+ <text macro="source-monographic-locator"/>+ </group>+ </if>+ </choose>+ <text macro="source-series-bib"/>+ <choose>+ <!-- show event information here only if not collapsed with `issued` (CMOS18 14.167) -->+ <if match="any" variable="event-date original-date original-publisher original-publisher-place publisher status">+ <text macro="source-event-bib"/>+ </if>+ </choose>+ </group>+ </macro>+ <!-- Monographic source title -->+ <macro name="source-monographic-preposition-bib">+ <choose>+ <if type="chapter" variable="container-title genre">+ <text value="to"/>+ </if>+ <else-if match="any" type="entry entry-dictionary entry-encyclopedia">+ <choose>+ <if match="any" variable="author composer">+ <!-- Give preposition only for signed entries; otherwise, title is substituted -->+ <text term="in" text-case="capitalize-first"/>+ </if>+ </choose>+ </else-if>+ <!-- if printing chapter page numbers (CMOS17/classic):+ <else-if variable="chapter-number page title"><text term="in" text-case="capitalize-first"/></else-if>+ -->+ <else-if variable="chapter-number">+ <group delimiter=" ">+ <text macro="label-chapter-number-capitalized"/>+ <choose>+ <if type="song">+ <text term="on"/>+ </if>+ <else>+ <text term="in"/>+ </else>+ </choose>+ </group>+ </else-if>+ <else>+ <text term="in" text-case="capitalize-first"/>+ </else>+ </choose>+ </macro>+ <macro name="source-monographic-title-bib">+ <choose>+ <if variable="part-title">+ <text macro="title-part"/>+ </if>+ <else-if variable="volume-title">+ <text font-style="italic" text-case="title" variable="volume-title"/>+ </else-if>+ <else>+ <text font-style="italic" text-case="title" variable="container-title"/>+ </else>+ </choose>+ </macro>+ <!-- Monographic source description -->+ <macro name="source-monographic-description-bib">+ <choose>+ <if match="any" type="event paper-conference performance speech">+ <!-- Conference presentations should describe the session unless published in a proceedings -->+ <choose>+ <if match="none" variable="collection-editor compiler editor editorial-director">+ <!-- serial usage -->+ <text macro="description-format-bib"/>+ </if>+ </choose>+ </if>+ <else-if type="software">+ <!-- For entries in mobile app reference works, place description after `container-title` -->+ <text macro="description-format-bib"/>+ </else-if>+ <else-if match="any" type="document report standard">+ <!-- For chapters in report, standards, and generic documents, place description after `container-title` -->+ <text macro="description-format-bib"/>+ </else-if>+ </choose>+ </macro>+ <!-- Monographic source identifier -->+ <macro name="source-monographic-identifier-bib">+ <!-- Based on `identifier-bib` -->+ <choose>+ <if variable="container-title">+ <group delimiter=", ">+ <choose>+ <if match="none" type="broadcast graphic map motion_picture song">+ <!-- For audiovisual media, number information comes after `title`, not `container-title`; `song` places album catalogue `number` with `publisher` (CMOS18 14.163-164) -->+ <text macro="identifier-number-bib"/>+ </if>+ </choose>+ <text macro="label-version"/>+ <text macro="label-edition"/>+ <choose>+ <if match="any" variable="part-title volume-title">+ <text macro="source-monographic-identifier-contributors-bib"/>+ </if>+ <else-if match="any" variable="number-of-volumes part-number volume">+ <!-- `collection-editor` belongs with `collection-title` if item is not multivolume -->+ <choose>+ <if variable="collection-editor">+ <names variable="collection-editor">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ </if>+ <else>+ <text macro="source-monographic-identifier-contributors-bib"/>+ </else>+ </choose>+ </else-if>+ <else>+ <text macro="source-monographic-identifier-contributors-bib"/>+ </else>+ </choose>+ <text macro="source-monographic-identifier-volume-bib"/>+ <choose>+ <!-- `collection-editor` supplied in `source-monographic-identifier-volume-bib` if there is a `part-title` or `volume-title` -->+ <if match="any" variable="part-title volume-title"/>+ <else-if match="any" variable="number-of-volumes part-number volume">+ <choose>+ <if variable="collection-editor">+ <text macro="source-monographic-identifier-contributors-bib"/>+ </if>+ </choose>+ </else-if>+ </choose>+ </group>+ </if>+ </choose>+ </macro>+ <macro name="source-monographic-identifier-contributors-bib">+ <group delimiter=", ">+ <names variable="container-author">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <names variable="editor-translator">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <names delimiter=", " variable="editor translator">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <names variable="guest">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <names variable="host">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <names delimiter=", " variable="chair organizer">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <names delimiter=", " variable="illustrator narrator compiler curator">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <names delimiter=", " variable="series-creator executive-producer">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <names variable="producer">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <names variable="editorial-director">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <choose>+ <if match="any" type="broadcast performance">+ <names variable="script-writer">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ </if>+ </choose>+ <names variable="director">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <names variable="performer">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <choose>+ <if match="none" type="song thesis">+ <!-- Song contributors attached to album (CMOS18 14.163) -->+ <names variable="contributor">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ </if>+ </choose>+ </group>+ </macro>+ <macro name="source-monographic-identifier-volume-bib">+ <!-- Mostly identical to `identifier-volume-bib` but without capitalization; giving `container-title` rather than `title-primary`; and ensuring volume number -->+ <group delimiter=", ">+ <choose>+ <if variable="part-number part-title volume volume-title">+ <!-- part and title with individual titles -->+ <group delimiter=" ">+ <text macro="label-part-number"/>+ <text value="of"/>+ <text font-style="italic" text-case="title" variable="volume-title"/>+ </group>+ <group delimiter=" ">+ <text macro="label-volume"/>+ <text value="of"/>+ <group delimiter=", ">+ <text font-style="italic" text-case="title" variable="container-title"/>+ <names variable="collection-editor">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ </group>+ </group>+ </if>+ <else-if match="any" variable="part-title volume-title">+ <group delimiter=" ">+ <choose>+ <if variable="part-number volume">+ <group delimiter=", ">+ <text macro="label-volume"/>+ <text macro="label-part-number"/>+ <text value="of"/>+ </group>+ </if>+ <else-if variable="part-number">+ <text macro="label-part-number"/>+ <text value="of"/>+ </else-if>+ <else-if variable="volume">+ <text macro="label-volume"/>+ <text value="of"/>+ </else-if>+ </choose>+ <group delimiter=", ">+ <text font-style="italic" text-case="title" variable="container-title"/>+ <names variable="collection-editor">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ </group>+ </group>+ </else-if>+ <else-if match="any" variable="part-number volume">+ <choose>+ <if is-numeric="volume" match="none">+ <text macro="label-volume"/>+ </if>+ <else-if variable="container-title">+ <!-- remove condition in styles that print chapter page numbers (CMOS17/classic) -->+ <text macro="label-volume"/>+ </else-if>+ <else-if is-numeric="volume" variable="page">+ <choose>+ <!-- check for variables that might come between the volume and page number -->+ <if match="any" variable="collection-editor part-number part-title volume-title">+ <text macro="label-volume"/>+ </if>+ </choose>+ </else-if>+ <else>+ <text macro="label-volume"/>+ </else>+ </choose>+ <text macro="label-part-number"/>+ </else-if>+ <else>+ <text macro="label-number-of-volumes"/>+ </else>+ </choose>+ </group>+ </macro>+ <!-- Monographic source locator -->+ <macro name="source-monographic-locator">+ <choose>+ <if is-numeric="volume" locator="page">+ <group delimiter=":">+ <choose>+ <if match="none" variable="collection-editor part-number part-title volume-title">+ <text variable="volume"/>+ </if>+ </choose>+ <text variable="locator"/>+ </group>+ </if>+ <else-if variable="locator">+ <text macro="label-locator"/>+ </else-if>+ <!-- remove `container-title` condition in styles that print chapter page numbers (CMOS17/classic) -->+ <else-if variable="container-title"/>+ <else-if is-numeric="volume" variable="page">+ <!-- collapse the volume and page number if adjacent -->+ <group delimiter=":">+ <choose>+ <!-- check for variables that might come between the volume and page number -->+ <if match="none" variable="collection-editor part-number part-title volume-title">+ <text variable="volume"/>+ </if>+ </choose>+ <text variable="page"/>+ </group>+ </else-if>+ <else>+ <text variable="page"/>+ </else>+ </choose>+ </macro>+ <!-- 4.3. Series -->+ <macro name="source-series-bib">+ <group delimiter=", ">+ <choose>+ <if variable="collection-editor collection-title">+ <choose>+ <if match="any" variable="number-of-volumes part-number part-title volume volume-title">+ <text macro="source-series-title"/>+ </if>+ <else>+ <text text-case="title" variable="collection-title"/>+ <names variable="collection-editor">+ <label form="verb" suffix=" "/>+ <name and="text"/>+ </names>+ <text macro="label-collection-number"/>+ <text macro="label-issue"/>+ </else>+ </choose>+ </if>+ <else>+ <text macro="source-series-title"/>+ </else>+ </choose>+ </group>+ </macro>+ <macro name="source-series-title">+ <group delimiter=", ">+ <choose>+ <if variable="issue">+ <text text-case="title" variable="collection-title"/>+ <text macro="label-collection-number"/>+ <text macro="label-issue"/>+ </if>+ <else-if is-numeric="collection-number" variable="collection-title">+ <group delimiter=" ">+ <text text-case="title" variable="collection-title"/>+ <text variable="collection-number"/>+ </group>+ </else-if>+ <else-if variable="collection-title">+ <text text-case="title" variable="collection-title"/>+ <text variable="collection-number"/>+ </else-if>+ </choose>+ </group>+ </macro>+ <!-- 4.4. Event -->+ <macro name="source-event-bib">+ <group delimiter=" ">+ <choose>+ <!-- omit types that provide event information in description -->+ <if match="any" type="interview" variable="interviewer"/>+ <else-if type="personal_communication" variable="recipient"/>+ <else-if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title"/>+ <else-if match="any" variable="event event-date event-title">+ <!-- TODO: To prevent Zotero from printing `event-place`, due to its double-mapping of `publisher-place` and `event-place`. Remove this when that is changed. -->+ <choose>+ <if type="paper-conference">+ <choose>+ <if match="none" variable="collection-editor compiler editor editorial-director issue page supplement-number volume">+ <!-- Don't print event info for conference papers published in proceedings -->+ <text macro="source-event-status-bib"/>+ <text macro="source-event-description-bib"/>+ </if>+ </choose>+ </if>+ <else>+ <!-- For other item types, print event info even if published (e.g. collection catalogs, performance programs). -->+ <text macro="source-event-status-bib"/>+ <text macro="source-event-description-bib"/>+ </else>+ </choose>+ </else-if>+ </choose>+ </group>+ </macro>+ <macro name="source-event-place-first">+ <!-- for descriptive elements for interviews, reviews, letters -->+ <choose>+ <if match="any" variable="event event-date event-title">+ <group delimiter=", ">+ <text variable="event-title"/>+ <text variable="event-place"/>+ <text macro="date-event-full"/>+ </group>+ </if>+ </choose>+ </macro>+ <macro name="source-event-status-bib">+ <group delimiter=" ">+ <choose>+ <if type="broadcast" variable="status">+ <!-- 'aired', 'performed', etc. (CMOS18 14.165) -->+ <text text-case="capitalize-first" variable="status"/>+ </if>+ <else-if type="paper-conference">+ <choose>+ <if variable="genre">+ <text text-case="capitalize-first" value="presented"/>+ </if>+ <else>+ <text form="short" term="paper-conference" text-case="capitalize-first"/>+ <text value="presented"/>+ </else>+ </choose>+ <choose>+ <if variable="event-title">+ <text term="at"/>+ </if>+ </choose>+ </else-if>+ <else-if type="song">+ <text text-case="capitalize-first" value="recorded"/>+ <choose>+ <if variable="event-title">+ <text term="at"/>+ </if>+ </choose>+ </else-if>+ <else-if variable="event-date issued"/>+ <else-if match="none" variable="issued">+ <text text-case="capitalize-first" variable="status"/>+ </else-if>+ </choose>+ </group>+ </macro>+ <macro name="source-event-title">+ <choose>+ <!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->+ <if variable="event-title">+ <text variable="event-title"/>+ </if>+ <else>+ <text variable="event"/>+ </else>+ </choose>+ </macro>+ <macro name="source-event-title-capitalized">+ <choose>+ <!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->+ <if variable="event-title">+ <text text-case="capitalize-first" variable="event-title"/>+ </if>+ <else>+ <text text-case="capitalize-first" variable="event"/>+ </else>+ </choose>+ </macro>+ <macro name="source-event-description-bib">+ <group delimiter=", ">+ <choose>+ <if type="song">+ <text macro="source-event-title"/>+ </if>+ <else-if type="paper-conference" variable="genre">+ <text macro="source-event-title-capitalized"/>+ </else-if>+ <else-if type="paper-conference">+ <text macro="source-event-title"/>+ </else-if>+ <else>+ <text macro="source-event-title-capitalized"/>+ </else>+ </choose>+ <text macro="date-event-full"/>+ <text variable="event-place"/>+ </group>+ </macro>+ <!-- 4.5. Facts of publication -->+ <macro name="source-monographic-publication-bib">+ <group delimiter=". ">+ <choose>+ <!-- Provide only for monographic types -->+ <if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book"/>+ <else-if match="any" type="interview paper-conference">+ <choose>+ <if match="any" variable="collection-editor container-author editor editorial-director">+ <!-- monographic usage -->+ <text macro="source-publication-and-date-bib"/>+ </if>+ </choose>+ </else-if>+ <!-- `patent` date in identification (CMOS18 14.158) -->+ <else-if type="patent"/>+ <else>+ <text macro="source-publication-and-date-bib"/>+ </else>+ </choose>+ <text macro="source-publication-original-title-bib"/>+ </group>+ </macro>+ <macro name="source-publication-and-date-bib">+ <group delimiter=", ">+ <choose>+ <if match="any" type="post webpage">+ <!-- `container-title` functions like a publisher with social media and website sources (CMOS18 14.104-106) -->+ <text text-case="title" variable="container-title"/>+ </if>+ </choose>+ <choose>+ <if type="broadcast" variable="DOI">+ <!-- a podcast publisher appears before the date, whereas the network of an aired show appears after (CMOS18 14.165); unfortunately CSL stores both in `publisher` -->+ <!-- TODO: `DOI` or `URL` detection is the only way to distinguish radio/TV from podcasts, but it is obviously imprecise; modify if CSL provides a `podcast` type -->+ <text macro="source-publication-history-bib"/>+ </if>+ <else-if type="broadcast" variable="URL">+ <text macro="source-publication-history-bib"/>+ </else-if>+ <else-if type="broadcast"/>+ <else>+ <text macro="source-publication-history-bib"/>+ </else>+ </choose>+ <group delimiter=" ">+ <text macro="source-date-status-bib"/>+ <text macro="source-date-bib"/>+ </group>+ <choose>+ <if type="broadcast" variable="URL"/>+ <else-if type="broadcast">+ <group delimiter=" ">+ <text term="on"/>+ <text macro="source-publication-history-bib"/>+ </group>+ </else-if>+ </choose>+ </group>+ </macro>+ <!-- Facts of publication elements -->+ <macro name="source-publication-description-bib">+ <choose>+ <if type="article" variable="genre"/>+ <else-if type="article">+ <!-- `preprint` term attached to repository name, but specific working paper descriptors appear in description (CMOS18 14.76, 14.116) -->+ <text term="preprint" text-case="capitalize-first"/>+ </else-if>+ <else-if type="thesis">+ <!-- thesis type appears with university name (CMOS18 14.113) -->+ <text macro="description-format-bib"/>+ </else-if>+ <else-if match="any" variable="original-publisher original-publisher-place">+ <choose>+ <!-- `edition` provides an alternative label to `reprint` (CMOS18 14.16) -->+ <if match="any" variable="edition original-title"/>+ <else-if match="none" type="book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis"/>+ <else-if variable="issued original-date">+ <text text-case="capitalize-first" value="reprint"/>+ </else-if>+ </choose>+ </else-if>+ </choose>+ </macro>+ <macro name="source-publication-history-bib">+ <choose>+ <if variable="original-title">+ <!-- `original-title` is covered in `source-publication-original-title-bib` -->+ <group delimiter=", ">+ <text macro="source-publication-description-bib"/>+ <text macro="source-publication-publisher-bib"/>+ </group>+ </if>+ <else-if match="any" variable="edition original-publisher original-publisher-place">+ <group delimiter=". ">+ <!-- full stop to separate original date if `original-publisher` (CMOS18 14.16) -->+ <group delimiter=", ">+ <text macro="source-publication-publisher-original-bib"/>+ <text macro="source-date-original"/>+ </group>+ <group delimiter=". ">+ <choose>+ <if variable="issued original-date">+ <text macro="label-edition-capitalized"/>+ </if>+ </choose>+ <group delimiter=", ">+ <text macro="source-publication-description-bib"/>+ <text macro="source-publication-publisher-bib"/>+ </group>+ </group>+ </group>+ </else-if>+ <else>+ <group delimiter="; ">+ <!-- semicolon to separate original date if no publisher (CMOS18 14.165) -->+ <text macro="source-date-original"/>+ <group delimiter=", ">+ <text macro="source-publication-description-bib"/>+ <text macro="source-publication-publisher-bib"/>+ </group>+ </group>+ </else>+ </choose>+ </macro>+ <macro name="source-publication-original-title-bib">+ <!-- Work originally published under a different title (CMOS18 13.101) -->+ <choose>+ <if variable="original-title">+ <group delimiter=" ">+ <text term="original-work-published" text-case="capitalize-first"/>+ <group delimiter=", ">+ <names variable="original-author"/>+ <text font-style="italic" text-case="title" variable="original-title"/>+ </group>+ <group delimiter=", " prefix="(" suffix=")">+ <text macro="source-publication-publisher-original-bib"/>+ <text macro="source-date-original"/>+ </group>+ </group>+ </if>+ </choose>+ </macro>+ <macro name="source-publication-publisher-bib">+ <group delimiter=" ">+ <choose>+ <if type="thesis" variable="publisher">+ <text text-case="capitalize-first" variable="publisher"/>+ </if>+ <else-if variable="publisher">+ <group delimiter=": ">+ <!-- <text text-case="capitalize-first" variable="publisher-place"/> -->+ <text text-case="capitalize-first" variable="publisher"/>+ </group>+ </else-if>+ <!-- TODO: remove conditional when Zotero fixes double-mapping of `event-place` -->+ <else-if match="any" variable="event-date event-title"/>+ <else>+ <text text-case="capitalize-first" variable="publisher-place"/>+ </else>+ </choose>+ <choose>+ <if type="song">+ <!-- Album catalogue number follows label name (CMOS18 14.163-164) -->+ <text variable="number"/>+ </if>+ </choose>+ </group>+ </macro>+ <macro name="source-publication-publisher-original-bib">+ <choose>+ <if variable="original-publisher">+ <group delimiter=": ">+ <!-- <text text-case="capitalize-first" variable="original-publisher-place"/> -->+ <text text-case="capitalize-first" variable="original-publisher"/>+ </group>+ </if>+ <else>+ <text text-case="capitalize-first" variable="original-publisher-place"/>+ </else>+ </choose>+ </macro>+ <!-- 4.6. Date -->+ <macro name="source-date-bib">+ <!-- the date represents the last-mentioned title (CMOS18 14.21) -->+ <!-- there is no `source-date-note` as the date of a multivolume work is not used in note form -->+ <choose>+ <if variable="available-date volume-title">+ <!-- TODO: Is there a better CSL variable for a date of a multivolume work (CMOS18 14.21)? -->+ <date date-parts="year" form="text" variable="available-date"/>+ </if>+ <else-if variable="available-date part-title">+ <date date-parts="year" form="text" variable="available-date"/>+ </else-if>+ <else>+ <text macro="source-date-issued-month-day"/>+ </else>+ </choose>+ </macro>+ <!-- Date elements -->+ <macro name="source-date-issued-month-day">+ <!-- Variant for author-date styles -->+ <!-- Give full date for more ephemeral types -->+ <!-- NB: any changes must also be applied to `source-date-original-month-day` -->+ <choose>+ <if type="personal_communication" variable="event-date issued">+ <!-- Provide issue date for letters listed under event-date -->+ <text macro="date-issued-year"/>+ </if>+ <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">+ <text macro="source-date-issued-month-day-serial"/>+ </else-if>+ <else-if match="any" type="interview paper-conference">+ <choose>+ <if match="none" variable="collection-editor compiler editor editorial-director">+ <!-- serial usage -->+ <text macro="source-date-issued-month-day-serial"/>+ </if>+ </choose>+ </else-if>+ <else-if match="any" type="entry entry-dictionary entry-encyclopedia">+ <choose>+ <if match="any" variable="DOI URL">+ <!-- Online reference works use full dates (CMOS18 14.131) -->+ <text macro="date-issued-month-day"/>+ </if>+ </choose>+ </else-if>+ <else-if match="any" type="article broadcast collection dataset document event graphic interview manuscript map patent performance personal_communication post software song speech standard webpage">+ <text macro="date-issued-month-day"/>+ </else-if>+ </choose>+ </macro>+ <macro name="source-date-issued-month-day-serial">+ <choose>+ <if type="article-newspaper">+ <!-- newspapers provide the full date in place of volume/issue numbers (CMOS18 14.89) -->+ <text macro="date-issued-month-day"/>+ </if>+ <else-if match="any" variable="issue supplement-number volume">+ <text macro="date-issued-month"/>+ </else-if>+ <else>+ <text macro="date-issued-month-day"/>+ </else>+ </choose>+ </macro>+ <macro name="source-date-original">+ <text macro="source-date-original-month-day"/>+ </macro>+ <macro name="source-date-original-month-day">+ <!-- Give full date for more ephemeral types -->+ <!-- Macro derived from `source-date-issued-month-day` -->+ <choose>+ <if type="personal_communication" variable="event-date original-date">+ <!-- Provide original date for letters listed under event-date -->+ <text macro="date-original-year"/>+ </if>+ <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">+ <choose>+ <if match="any" variable="issue supplement-number volume">+ <text macro="date-original-month"/>+ </if>+ <else>+ <text macro="date-original-month-day"/>+ </else>+ </choose>+ </else-if>+ <else-if match="any" type="interview paper-conference">+ <choose>+ <if match="none" variable="collection-editor compiler editor editorial-director">+ <!-- serial usage -->+ <choose>+ <if match="any" variable="issue supplement-number volume">+ <text macro="date-original-month"/>+ </if>+ <else>+ <text macro="date-original-month-day"/>+ </else>+ </choose>+ </if>+ </choose>+ </else-if>+ <else-if match="any" type="entry entry-dictionary entry-encyclopedia">+ <choose>+ <if match="any" variable="DOI URL">+ <!-- Online reference works use full dates (CMOS18 14.131) -->+ <text macro="date-original-month-day"/>+ </if>+ </choose>+ </else-if>+ <else-if match="any" type="article broadcast collection dataset document event graphic interview manuscript map patent performance personal_communication post software song speech standard webpage">+ <text macro="date-original-month-day"/>+ </else-if>+ </choose>+ </macro>+ <macro name="source-date-status-bib">+ <choose>+ <if type="broadcast" variable="event-title issued status"/>+ <!-- on a `broadcast`, if there is an `event-title`, `status` appears with `event-date` as part of `source-event` (CMOS18 14.165) -->+ <else-if variable="issued status">+ <!-- `status` specifies date type, e.g. 'effective', 'last modified', 'approved' (CMOS18 14.104 for `webpage`; CMOS18 14.159 for `standard`) -->+ <choose>+ <if match="any" variable="original-date original-publisher original-publisher-place original-title publisher">+ <text variable="status"/>+ </if>+ <else>+ <text text-case="capitalize-first" variable="status"/>+ </else>+ </choose>+ </else-if>+ <else-if type="broadcast" variable="issued URL"/>+ <else-if type="broadcast" variable="issued">+ <!-- `status` of a radio or TV broadcast is 'aired' if unspecified (CMOS18 14.165) -->+ <text text-case="capitalize-first" value="aired"/>+ </else-if>+ <else-if type="software" variable="issued publisher">+ <!-- `status` of software is 'released' if unspecified (CMOS18 14.169) -->+ <choose>+ <if match="any" variable="author chair collection-editor compiler composer contributor curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator">+ <!-- lowercase if `publisher` is adjacent -->+ <text value="released"/>+ </if>+ <else>+ <text text-case="capitalize-first" value="released"/>+ </else>+ </choose>+ </else-if>+ <else-if type="software" variable="original-date">+ <!-- lowercase if `original-date` is adjacent -->+ <text value="released"/>+ </else-if>+ <else-if type="software" variable="issued">+ <!-- capitalize if `publisher` is not present -->+ <text text-case="capitalize-first" value="released"/>+ </else-if>+ </choose>+ </macro>+ <!-- 4.7. Locator (including page references) -->+ <macro name="source-locator-author-date">+ <choose>+ <if match="any" type="entry entry-dictionary entry-encyclopedia">+ <choose>+ <if match="any" variable="author locator">+ <text macro="label-locator"/>+ </if>+ <else-if variable="container-title title">+ <!-- unsigned reference entry title appears in the locator (CMOS18 13.130) -->+ <group delimiter=" ">+ <choose>+ <if match="none" variable="DOI URL">+ <!-- Only print reference entries use `sub-verbo` (CMOS18 14.131) -->+ <text form="short" term="sub-verbo"/>+ </if>+ </choose>+ <text form="short" quotes="true" variable="title"/>+ </group>+ </else-if>+ </choose>+ </if>+ <else>+ <text macro="label-locator"/>+ </else>+ </choose>+ </macro>+ <!-- 4.8. Medium -->+ <macro name="source-medium-bib">+ <group delimiter=", ">+ <text text-case="capitalize-first" variable="medium"/>+ <text variable="scale"/>+ <text variable="dimensions"/>+ </group>+ </macro>+ <!-- 4.9. Archival location -->+ <macro name="source-archive-bib">+ <choose>+ <!-- With `archive_collection` or `archive-place`: physical archives -->+ <if type="graphic">+ <text macro="source-archive-name-first"/>+ </if>+ <else-if match="any" type="collection document manuscript personal_communication" variable="archive_collection archive-place">+ <text macro="source-archive-location-first-bib"/>+ </else-if>+ <!-- Without `archive_collection` or `archive-place`: digital archives (database and identifier) -->+ <else>+ <text macro="source-archive-identifier"/>+ </else>+ </choose>+ </macro>+ <macro name="source-archive-note">+ <choose>+ <!-- With `archive_collection` or `archive-place`: physical archives -->+ <if type="graphic">+ <text macro="source-archive-name-first"/>+ </if>+ <else-if match="any" type="collection document manuscript personal_communication" variable="archive_collection archive-place">+ <text macro="source-archive-location-first-note"/>+ </else-if>+ <!-- Without `archive_collection` or `archive-place`: digital archives (database and identifier) -->+ <else>+ <text macro="source-archive-identifier"/>+ </else>+ </choose>+ </macro>+ <!-- Archival elements -->+ <macro name="source-archive-identifier">+ <choose>+ <if variable="archive archive_location">+ <!-- database identifier: the only example is `thesis`, but presumably this is for all types (CMOS18 14.113) -->+ <group delimiter=" ">+ <text variable="archive"/>+ <text prefix="(" suffix=")" variable="archive_location"/>+ </group>+ </if>+ <else>+ <group delimiter=", ">+ <text variable="archive"/>+ <text variable="archive_location"/>+ </group>+ </else>+ </choose>+ </macro>+ <macro name="source-archive-location-first-bib">+ <!-- Order of elements begins with the most specific (CMOS18 14.119, 14.127) -->+ <!-- In note styles, the bibliography generally provide entries for a `collection` rather than individual items (CMOS18 14.120, 14.128) -->+ <group delimiter=". ">+ <group delimiter=", ">+ <text text-case="capitalize-first" variable="archive_location"/>+ <text variable="archive_collection"/>+ </group>+ <group delimiter=", ">+ <text variable="archive"/>+ <text variable="archive-place"/>+ </group>+ </group>+ </macro>+ <macro name="source-archive-location-first-note">+ <!-- Order of elements begins with the most specific (CMOS18 14.119, 14.127) -->+ <!-- In note styles, the bibliography generally provide entries for a `collection` rather than individual items (CMOS18 14.120, 14.128) -->+ <group delimiter=", ">+ <group delimiter=", ">+ <text variable="archive_location"/>+ <text variable="archive_collection"/>+ </group>+ <group delimiter=", ">+ <text variable="archive"/>+ <text variable="archive-place"/>+ </group>+ </group>+ </macro>+ <macro name="source-archive-name-first">+ <!-- Archive (gallery) name first for art (CMOS18 14.133) -->+ <group delimiter=", ">+ <text variable="archive"/>+ <text variable="archive-place"/>+ <text variable="archive_collection"/>+ <text variable="archive_location"/>+ </group>+ </macro>+ <!-- 4.10. URL or persistent identifier -->+ <macro name="source-date-accessed-DOI-URL-bib">+ <group delimiter=". ">+ <choose>+ <if variable="DOI"/>+ <else-if match="any" variable="available-date event-date issued status"/>+ <else-if variable="accessed URL">+ <group delimiter=" ">+ <text term="accessed" text-case="capitalize-first"/>+ <date form="text" variable="accessed"/>+ </group>+ </else-if>+ </choose>+ <text macro="source-DOI-URL"/>+ </group>+ </macro>+ <macro name="source-DOI-URL">+ <choose>+ <if variable="DOI">+ <text prefix="https://doi.org/" variable="DOI"/>+ </if>+ <else-if variable="URL">+ <text variable="URL"/>+ </else-if>+ </choose>+ </macro>+ <!-- 5. Notes -->+ <!-- TODO: add variables for distributor and exhibitions if available in CSL -->+ <!-- 6. Legal references: Bluebook style (shared with APA) -->+ <!-- Where APA or Chicago diverge from Bluebook, the official manual is followed -->+ <macro name="legal-reference">+ <!-- Type usage:++ `bill`+ : bills, resolutions, federal reports++ `legal_case`+ : all legal and court cases++ `hearing`+ : hearings and testimony++ `legislation`+ : statutes, constitutional items, and charters++ `regulation`+ : codified regulations, uncodified regulations, executive orders++ `treaty`+ : treaties+ -->+ <group delimiter=", ">+ <choose>+ <if type="treaty">+ <text macro="legal-title"/>+ <names variable="author">+ <!-- Treaty parties should be included at least for bilateral treaties (Bluebook 21.4.2) -->+ <name delimiter="-" et-al-min="100" et-al-use-first="99" form="short"/>+ </names>+ <text macro="legal-date"/>+ <!-- treaty source/report in addition to URL (Bluebook 21.4.5) -->+ <text macro="legal-source"/>+ </if>+ <else>+ <group delimiter=" ">+ <group delimiter=", ">+ <text macro="legal-title"/>+ <text macro="legal-source"/>+ </group>+ <text macro="legal-date"/>+ <text macro="legal-identifier"/>+ </group>+ </else>+ </choose>+ <group delimiter=" ">+ <!-- locator for use in notes -->+ <choose>+ <if locator="page" variable="page">+ <text term="at"/>+ </if>+ </choose>+ <text macro="label-locator"/>+ </group>+ </group>+ </macro>+ <!-- 6.1. Legal date -->+ <macro name="legal-date">+ <choose>+ <if type="treaty">+ <text macro="date-issued-full"/>+ </if>+ <else-if type="legal_case">+ <text macro="legal-date-case"/>+ </else-if>+ <else-if match="any" type="bill hearing legislation regulation">+ <group delimiter=" " prefix="(" suffix=")">+ <group delimiter=" ">+ <text macro="date-original-year"/>+ <text form="symbol" term="and"/>+ </group>+ <choose>+ <if variable="issued">+ <text macro="date-issued-year"/>+ </if>+ <else>+ <!-- Show proposal date for uncodified regulations. Assume date is entered literally ala "proposed May 23, 2016". -->+ <!-- TODO: Add `proposed` date here if that becomes available -->+ <date form="text" variable="submitted"/>+ </else>+ </choose>+ </group>+ </else-if>+ </choose>+ </macro>+ <macro name="legal-date-case">+ <group delimiter=" " prefix="(" suffix=")">+ <text variable="authority"/>+ <choose>+ <if variable="container-title">+ <!-- Print only year for cases published in reporters-->+ <text macro="date-issued-year"/>+ </if>+ <else>+ <text macro="date-issued-full"/>+ </else>+ </choose>+ </group>+ </macro>+ <!-- 6.2.1. Legal title -->+ <macro name="legal-title">+ <choose>+ <if match="any" type="bill legal_case legislation regulation treaty">+ <text text-case="title" variable="title"/>+ </if>+ <else-if type="hearing">+ <!-- use standard format (Bluebook 13.3) -->+ <group delimiter=": " font-style="italic">+ <text text-case="capitalize-first" variable="title"/>+ <group delimiter=" ">+ <text term="hearing" text-case="capitalize-first"/>+ <group delimiter=" ">+ <group delimiter=" ">+ <text term="on"/>+ <text variable="number"/>+ </group>+ <group delimiter=" ">+ <text value="before the"/>+ <text variable="section"/>+ </group>+ </group>+ </group>+ </group>+ </else-if>+ </choose>+ </macro>+ <!-- 6.2.2. Legal identifier -->+ <macro name="legal-identifier">+ <choose>+ <if type="hearing">+ <group delimiter=" " prefix="(" suffix=")">+ <!-- Use the 'verb' form of the hearing term to hold 'testimony of' -->+ <text form="verb" term="hearing"/>+ <names variable="author">+ <name and="symbol" initialize="false"/>+ </names>+ </group>+ </if>+ <else-if match="any" type="bill legislation regulation">+ <!-- For uncodified regulations, assume future code section is in `status`. -->+ <text prefix="(" suffix=")" variable="status"/>+ </else-if>+ </choose>+ </macro>+ <macro name="legal-identifier-bill-report">+ <group delimiter=" ">+ <text variable="genre"/>+ <choose>+ <if match="any" variable="authority chapter-number container-title">+ <text variable="number"/>+ </if>+ <else>+ <!-- If there is no legislative body, session number, or code/record title, assume the item is a congressional report and include 'No.' label. -->+ <text macro="label-number-capitalized"/>+ </else>+ </choose>+ </group>+ </macro>+ <!-- 6.3. Legal source -->+ <macro name="legal-source">+ <!-- Expect legal item `container-title` to be stored in short form -->+ <choose>+ <if type="bill">+ <text macro="legal-source-bill"/>+ </if>+ <else-if type="hearing">+ <text macro="legal-source-hearing"/>+ </else-if>+ <else-if type="legal_case">+ <text macro="legal-source-case"/>+ </else-if>+ <else-if type="legislation">+ <text macro="legal-source-legislation"/>+ </else-if>+ <else-if type="regulation">+ <text macro="legal-source-regulation"/>+ </else-if>+ <else-if type="treaty">+ <text macro="legal-source-treaty"/>+ </else-if>+ </choose>+ </macro>+ <!-- Legal source types -->+ <macro name="legal-source-bill">+ <group delimiter=", ">+ <text macro="legal-identifier-bill-report"/>+ <group delimiter=" ">+ <text variable="authority"/>+ <!-- `chapter-number` is a session number -->+ <text variable="chapter-number"/>+ </group>+ <group delimiter=" ">+ <text variable="volume"/>+ <text variable="container-title"/>+ <text variable="page-first"/>+ </group>+ </group>+ </macro>+ <macro name="legal-source-case">+ <group delimiter=" ">+ <choose>+ <if variable="container-title">+ <group delimiter=" ">+ <text variable="volume"/>+ <text variable="container-title"/>+ <text macro="label-section-symbol"/>+ <choose>+ <if match="any" variable="page page-first">+ <text variable="page-first"/>+ </if>+ <else>+ <text value="___"/>+ </else>+ </choose>+ </group>+ </if>+ <else>+ <text macro="label-number-capitalized"/>+ </else>+ </choose>+ </group>+ </macro>+ <macro name="legal-source-hearing">+ <group delimiter=" ">+ <text variable="authority"/>+ <!-- `chapter-number` is a session number -->+ <text variable="chapter-number"/>+ </group>+ </macro>+ <macro name="legal-source-legislation">+ <choose>+ <if variable="number">+ <!-- `number` is a public law number -->+ <group delimiter=", ">+ <group delimiter=" ">+ <choose>+ <if variable="genre">+ <text text-case="capitalize-first" variable="genre"/>+ </if>+ <else>+ <text form="short" term="legislation" text-case="capitalize-first"/>+ </else>+ </choose>+ <text macro="label-number-capitalized"/>+ </group>+ <group delimiter=" ">+ <text variable="volume"/>+ <text variable="container-title"/>+ <text variable="page-first"/>+ </group>+ </group>+ </if>+ <else>+ <group delimiter=" ">+ <text variable="volume"/>+ <text variable="container-title"/>+ <choose>+ <if variable="section">+ <text macro="label-section-symbol"/>+ </if>+ <else>+ <text variable="page-first"/>+ </else>+ </choose>+ </group>+ </else>+ </choose>+ </macro>+ <macro name="legal-source-regulation">+ <group delimiter=", ">+ <group delimiter=" ">+ <text variable="genre"/>+ <text macro="label-number-capitalized"/>+ </group>+ <group delimiter=" ">+ <text variable="volume"/>+ <text variable="container-title"/>+ <choose>+ <if variable="section">+ <text macro="label-section-symbol"/>+ </if>+ <else>+ <text variable="page-first"/>+ </else>+ </choose>+ </group>+ </group>+ </macro>+ <macro name="legal-source-treaty">+ <group delimiter=" ">+ <number variable="volume"/>+ <text variable="container-title"/>+ <choose>+ <if match="any" variable="page page-first">+ <text variable="page-first"/>+ </if>+ <else>+ <text macro="label-number-capitalized"/>+ </else>+ </choose>+ </group>+ </macro>+ <!-- Citation -->+ <macro name="citation-author-date-item">+ <group delimiter=", ">+ <choose>+ <if type="classic">+ <text macro="author-inline"/>+ <choose>+ <if variable="author">+ <text macro="title-and-descriptions-short"/>+ </if>+ </choose>+ </if>+ <else-if match="any" variable="event-date issued">+ <choose>+ <if match="any" type="interview personal_communication">+ <choose>+ <if match="any" variable="archive archive-place container-title DOI number publisher references URL">+ <group delimiter=" ">+ <text macro="author-inline"/>+ <text macro="date-short"/>+ </group>+ </if>+ <else>+ <!-- unpublished `interview` or `personal_communication` use inline format (CMOS18 14.111) -->+ <text macro="author-inline"/>+ <text macro="title-and-descriptions-short"/>+ <text macro="date-short"/>+ </else>+ </choose>+ </if>+ <else>+ <group delimiter=" ">+ <text macro="author-inline"/>+ <text macro="date-short"/>+ </group>+ </else>+ </choose>+ </else-if>+ <else>+ <!--- Comma with forthcoming or n.d. -->+ <text macro="author-inline"/>+ <choose>+ <if match="any" type="interview personal_communication">+ <choose>+ <if match="none" variable="archive archive-place container-title DOI number publisher references URL">+ <!-- unpublished `interview` or `personal_communication` use inline format (CMOS18 14.111) -->+ <text macro="title-and-descriptions-short"/>+ </if>+ </choose>+ </if>+ </choose>+ <text macro="date-short"/>+ </else>+ </choose>+ </group>+ </macro>+ <citation after-collapse-delimiter="; " collapse="year" disambiguate-add-givenname="true" disambiguate-add-names="true" disambiguate-add-year-suffix="true" et-al-min="3" et-al-use-first="1">+ <layout delimiter="; " prefix="(" suffix=")">+ <choose>+ <if type="classic">+ <!-- with `classic`, a non-numeric canonical reference or identifying number is separated by a space rather than a comma (CMOS18 14.145) -->+ <choose>+ <if is-numeric="locator">+ <group delimiter=", ">+ <text macro="citation-author-date-item"/>+ <text macro="source-locator-author-date"/>+ </group>+ </if>+ <else-if locator="chapter line verse" match="any">+ <group delimiter=" ">+ <text macro="citation-author-date-item"/>+ <text macro="source-locator-author-date"/>+ </group>+ </else-if>+ <else>+ <group delimiter=", ">+ <text macro="citation-author-date-item"/>+ <text macro="source-locator-author-date"/>+ </group>+ </else>+ </choose>+ </if>+ <else>+ <group delimiter=", ">+ <text macro="citation-author-date-item"/>+ <text macro="source-locator-author-date"/>+ </group>+ </else>+ </choose>+ </layout>+ </citation>+ <!-- Bibliography -->+ <macro name="bibliography-author-date">+ <group delimiter=". ">+ <choose>+ <if match="any" type="bill hearing legal_case legislation regulation treaty">+ <!-- Legal items have different orders and delimiters -->+ <text macro="legal-reference"/>+ <text macro="source-date-accessed-DOI-URL-bib"/>+ <text variable="references"/>+ </if>+ <else>+ <text macro="author-bib"/>+ <text macro="date"/>+ <text macro="title-and-source-bib"/>+ <text variable="references"/>+ </else>+ </choose>+ </group>+ </macro>+ <bibliography et-al-min="7" et-al-use-first="3" hanging-indent="true">+ <sort>+ <key macro="author-sort"/>+ <key macro="date-sort-group"/>+ <key macro="date-sort-year"/>+ <key macro="date"/>+ <key macro="title-and-descriptions-bib"/>+ <key macro="source-bib"/>+ <key variable="volume"/>+ <key variable="part-number"/>+ <key variable="event-date"/>+ <key variable="issued"/>+ <key macro="source-archive-bib"/>+ </sort>+ <layout suffix=".">+ <choose>+ <if type="classic">+ <choose>+ <if match="any" variable="archive editor translator publisher">+ <text macro="bibliography-author-date"/>+ </if>+ </choose>+ </if>+ <else-if match="any" type="entry entry-dictionary entry-encyclopedia">+ <choose>+ <if variable="author">+ <!-- Signed reference entries appear in the bibliography (CMOS18 14.132) -->+ <text macro="bibliography-author-date"/>+ </if>+ <else-if match="any" variable="DOI URL">+ <!-- Provide a bibliography if necessary identifying information is not in text -->+ <text macro="bibliography-author-date"/>+ </else-if>+ </choose>+ </else-if>+ <else-if match="any" type="interview personal_communication">+ <choose>+ <if match="any" variable="archive archive-place container-title DOI number publisher references URL">+ <!-- Personal communications only appear in the bibliography if the reader can retrieve them (CMOS18 14.13, 14.111) -->+ <text macro="bibliography-author-date"/>+ </if>+ </choose>+ </else-if>+ <else>+ <text macro="bibliography-author-date"/>+ </else>+ </choose>+ </layout>+ </bibliography>+</style>
@@ -0,0 +1,2237 @@+aacgr 03AC+Aacgr 0386+aacute 00E1+Aacute 00C1+abreve 0103+Abreve 0102+ac 223E+acd 223F+acE 223E 0333+acirc 00E2+Acirc 00C2+acute 00B4+acy 0430+Acy 0410+aelig 00E6+AElig 00C6+af 2061+afr 1D51E+Afr 1D504+agr 03B1+Agr 0391+agrave 00E0+Agrave 00C0+alefsym 2135+aleph 2135+alpha 03B1+Alpha 0391+amacr 0101+Amacr 0100+amalg 2A3F+amp 0026+AMP 0026+and 2227+And 2A53+andand 2A55+andd 2A5C+andslope 2A58+andv 2A5A+ang 2220+ange 29A4+angle 2220+angmsd 2221+angmsdaa 29A8+angmsdab 29A9+angmsdac 29AA+angmsdad 29AB+angmsdae 29AC+angmsdaf 29AD+angmsdag 29AE+angmsdah 29AF+angrt 221F+angrtvb 22BE+angrtvbd 299D+angsph 2222+angst 00C5+angzarr 237C+aogon 0105+Aogon 0104+aopf 1D552+Aopf 1D538+ap 2248+apacir 2A6F+ape 224A+apE 2A70+apid 224B+apos 0027+ApplyFunction 2061+approx 2248+approxeq 224A+aring 00E5+Aring 00C5+ascr 1D4B6+Ascr 1D49C+Assign 2254+ast 002A+asymp 2248+asympeq 224D+atilde 00E3+Atilde 00C3+auml 00E4+Auml 00C4+awconint 2233+awint 2A11+b.alpha 1D6C2+b.beta 1D6C3+b.chi 1D6D8+b.delta 1D6C5+b.Delta 1D6AB+b.epsi 1D6C6+b.epsiv 1D6DC+b.eta 1D6C8+b.gamma 1D6C4+b.Gamma 1D6AA+b.gammad 1D7CB+b.Gammad 1D7CA+b.iota 1D6CA+b.kappa 1D6CB+b.kappav 1D6DE+b.lambda 1D6CC+b.Lambda 1D6B2+b.mu 1D6CD+b.nu 1D6CE+b.omega 1D6DA+b.Omega 1D6C0+b.phi 1D6D7+b.Phi 1D6BD+b.phiv 1D6DF+b.pi 1D6D1+b.Pi 1D6B7+b.piv 1D6E1+b.psi 1D6D9+b.Psi 1D6BF+b.rho 1D6D2+b.rhov 1D6E0+b.sigma 1D6D4+b.Sigma 1D6BA+b.sigmav 1D6D3+b.tau 1D6D5+b.Theta 1D6AF+b.thetas 1D6C9+b.thetav 1D6DD+b.upsi 1D6D6+b.UpsiUpsilon+b.xi 1D6CF+b.Xi 1D6B5+b.zeta 1D6C7+backcong 224C+backepsilon 03F6+backprime 2035+backsim 223D+backsimeq 22CD+Backslash 2216+Barv 2AE7+barvee 22BD+barwed 2305+Barwed 2306+barwedge 2305+bbrk 23B5+bbrktbrk 23B6+bcong 224C+bcy 0431+Bcy 0411+bdquo 201E+becaus 2235+because 2235+Because 2235+bemptyv 29B0+bepsi 03F6+bernou 212C+Bernoullis 212C+beta 03B2+Beta 0392+beth 2136+between 226C+bfr 1D51F+Bfr 1D505+bgr 03B2+Bgr 0392+bigcap 22C2+bigcirc 25EF+bigcup 22C3+bigodot 2A00+bigoplus 2A01+bigotimes 2A02+bigsqcup 2A06+bigstarUB starf+bigtriangledown 25BD+bigtriangleup 25B3+biguplus 2A04+bigvee 22C1+bigwedge 22C0+bkarow 290D+blacklozengeUB lozf+blacksquare 25AA+blacktriangleUB utrif+blacktriangledownUB dtrif+blacktriangleleftUB ltrif+blacktrianglerightUB rtrif+blank 2423+blk12 2592+blk14 2591+blk34 2593+block 2588+bne 003D 20E5+bnequiv 2261 20E5+bnot 2310+bNot 2AED+bopf 1D553+Bopf 1D539+bot 22A5+bottom 22A5+bowtie 22C8+boxbox 29C9+boxdl 2510+boxdL 2555+boxDl 2556+boxDL 2557+boxdr 250C+boxdR 2552+boxDr 2553+boxDR 2554+boxh 2500+boxH 2550+boxhd 252C+boxhD 2565+boxHd 2564+boxHD 2566+boxhu 2534+boxhU 2568+boxHu 2567+boxHU 2569+boxminus 229F+boxplus 229E+boxtimes 22A0+boxul 2518+boxuL 255B+boxUl 255C+boxUL 255D+boxur 2514+boxuR 2558+boxUr 2559+boxUR 255A+boxv 2502+boxV 2551+boxvh 253C+boxvH 256A+boxVh 256B+boxVH 256C+boxvl 2524+boxvL 2561+boxVl 2562+boxVL 2563+boxvr 251C+boxvR 255E+boxVr 255F+boxVR 2560+bprime 2035+breve 02D8+Breve 02D8+brvbar 00A6+bscr 1D4B7+Bscr 212C+bsemi 204F+bsim 223D+bsime 22CD+bsol 005C+bsolb 29C5+bsolhsub 27C8+bull 2022+bulletUB bull+bump 224E+bumpe 224F+bumpE 2AAE+bumpeq 224F+Bumpeq 224E+cacute 0107+Cacute 0106+cap 2229+Cap 22D2+capand 2A44+capbrcup 2A49+capcap 2A4B+capcup 2A47+capdot 2A40+CapitalDifferentialD 2145+caps 2229 FE00+caret 2041+caron 02C7+Cayleys 212D+ccaps 2A4D+ccaron 010D+Ccaron 010C+ccedil 00E7+Ccedil 00C7+ccirc 0109+Ccirc 0108+Cconint 2230+ccups 2A4C+ccupssm 2A50+cdot 010B+Cdot 010A+cedil 00B8+Cedilla 00B8+cemptyv 29B2+cent 00A2+centerdotUM middot+CenterDotUM middot+cfr 1D520+Cfr 212D+chcy 0447+CHcy 0427+check 2713+checkmarkUB check+chi 03C7+Chi 03A7+cir 25CB+circ 02C6+circeq 2257+circlearrowleft 21BA+circlearrowright 21BB+circledast 229B+circledcirc 229A+circleddash 229D+CircleDot 2299+circledRUM reg+circledS 24C8+CircleMinus 2296+CirclePlus 2295+CircleTimes 2297+cire 2257+cirE 29C3+cirfnint 2A10+cirmid 2AEF+cirscir 29C2+ClockwiseContourIntegral 2232+CloseCurlyDoubleQuoteUM rdquo+CloseCurlyQuoteUM rsquo+clubs 2663+clubsuitUB clubs+colon 003A+Colon 2237+colone 2254+Colone 2A74+coloneq 2254+comma 002C+commat 0040+comp 2201+compfn 2218+complement 2201+complexes 2102+cong 2245+congdot 2A6D+Congruent 2261+conint 222E+Conint 222F+ContourIntegral 222E+copf 1D554+Copf 2102+coprod 2210+Coproduct 2210+copy 00A9+COPY 00A9+copysr 2117+CounterClockwiseContourIntegral 2233+crarr 21B5+cross 2717+Cross 2A2F+cscr 1D4B8+Cscr 1D49E+csub 2ACF+csube 2AD1+csup 2AD0+csupe 2AD2+ctdot 22EF+cudarrl 2938+cudarrr 2935+cuepr 22DE+cuesc 22DF+cularr 21B6+cularrp 293D+cup 222A+Cup 22D3+cupbrcap 2A48+cupcap 2A46+CupCap 224D+cupcup 2A4A+cupdot 228D+cupor 2A45+cups 222A FE00+curarr 21B7+curarrm 293C+curlyeqprec 22DE+curlyeqsucc 22DF+curlyvee 22CE+curlywedge 22CF+curren 00A4+curvearrowleft 21B6+curvearrowright 21B7+cuvee 22CE+cuwed 22CF+cwconint 2232+cwint 2231+cylcty 232D+dagger 2020+Dagger 2021+daleth 2138+darr 2193+dArr 21D3+Darr 21A1+dash 2010+dashv 22A3+Dashv 2AE4+dbkarow 290F+dblac 02DD+dcaron 010F+Dcaron 010E+dcy 0434+Dcy 0414+dd 2146+DD 2145+ddaggerUB Dagger+ddarr 21CA+DDotrahd 2911+ddotseq 2A77+deg 00B0+Del 2207+delta 03B4+Delta 0394+demptyv 29B1+dfisht 297F+dfr 1D521+Dfr 1D507+dgr 03B4+Dgr 0394+dHar 2965+dharl 21C3+dharr 21C2+DiacriticalAcute 00B4+DiacriticalDot 02D9+DiacriticalDoubleAcute 02DD+DiacriticalGrave 0060+DiacriticalTilde 02DC+diam 22C4+diamond 22C4+Diamond 22C4+diamondsuitUB diams+diams 2666+die 00A8+DifferentialD 2146+digamma 03DD+disin 22F2+divUM divide+divide 00F7+divideontimes 22C7+divonx 22C7+djcy 0452+DJcy 0402+dlcorn 231E+dlcrop 230D+dollar 0024+dopf 1D555+Dopf 1D53B+dot 02D9+Dot 00A8+DotDot 20DC+doteq 2250+doteqdot 2251+DotEqual 2250+dotminus 2238+dotplus 2214+dotsquare 22A1+doublebarwedge 2306+DoubleContourIntegral 222F+DoubleDot 00A8+DoubleDownArrow 21D3+DoubleLeftArrow 21D0+DoubleLeftRightArrow 21D4+DoubleLeftTee 2AE4+DoubleLongLeftArrow 27F8+DoubleLongLeftRightArrow 27FA+DoubleLongRightArrow 27F9+DoubleRightArrow 21D2+DoubleRightTee 22A8+DoubleUpArrow 21D1+DoubleUpDownArrow 21D5+DoubleVerticalBar 2225+downarrowUM darr+Downarrow 21D3+DownArrowUM darr+DownArrowBar 2913+DownArrowUpArrow 21F5+DownBreve 0311+downdownarrows 21CA+downharpoonleft 21C3+downharpoonright 21C2+DownLeftRightVector 2950+DownLeftTeeVector 295E+DownLeftVector 21BD+DownLeftVectorBar 2956+DownRightTeeVector 295F+DownRightVector 21C1+DownRightVectorBar 2957+DownTee 22A4+DownTeeArrow 21A7+drbkarow 2910+drcorn 231F+drcrop 230C+dscr 1D4B9+Dscr 1D49F+dscy 0455+DScy 0405+dsol 29F6+dstrok 0111+Dstrok 0110+dtdot 22F1+dtri 25BF+dtrif 25BE+duarr 21F5+duhar 296F+dwangle 29A6+dzcy 045F+DZcy 040F+dzigrarr 27FF+eacgr 03AD+Eacgr 0388+eacute 00E9+Eacute 00C9+easter 2A6E+ecaron 011B+Ecaron 011A+ecir 2256+ecirc 00EA+Ecirc 00CA+ecolon 2255+ecy 044D+Ecy 042D+eDDot 2A77+edot 0117+eDot 2251+Edot 0116+ee 2147+eeacgr 03AE+EEacgr 0389+eegr 03B7+EEgr 0397+efDot 2252+efr 1D522+Efr 1D508+eg 2A9A+egr 03B5+Egr 0395+egrave 00E8+Egrave 00C8+egs 2A96+egsdot 2A98+el 2A99+Element 2208+elinters 23E7+ell 2113+els 2A95+elsdot 2A97+emacr 0113+Emacr 0112+empty 2205+emptyset 2205+EmptySmallSquare 25FB+emptyv 2205+EmptyVerySmallSquare 25AB+emsp 2003+emsp13 2004+emsp14 2005+eng 014B+ENG 014A+ensp 2002+eogon 0119+Eogon 0118+eopf 1D556+Eopf 1D53C+epar 22D5+eparsl 29E3+eplus 2A71+epsi 03B5+epsilon 03B5+Epsilon 0395+epsiv 03F5+eqcirc 2256+eqcolon 2255+eqsim 2242+eqslantgtr 2A96+eqslantless 2A95+Equal 2A75+equals 003D+EqualTilde 2242+equest 225F+Equilibrium 21CC+equiv 2261+equivDD 2A78+eqvparsl 29E5+erarr 2971+erDot 2253+escr 212F+Escr 2130+esdot 2250+esim 2242+Esim 2A73+eta 03B7+Eta 0397+eth 00F0+ETH 00D0+euml 00EB+Euml 00CB+euro 20AC+excl 0021+exist 2203+Exists 2203+expectation 2130+exponentiale 2147+ExponentialE 2147+fallingdotseq 2252+fcy 0444+Fcy 0424+female 2640+ffilig FB03+fflig FB00+ffllig FB04+ffr 1D523+Ffr 1D509+filig FB01+FilledSmallSquare 25FC+FilledVerySmallSquare 25AA+fjlig 0066 006A+flat 266D+fllig FB02+fltns 25B1+fnof 0192+fopf 1D557+Fopf 1D53D+forall 2200+ForAll 2200+fork 22D4+forkv 2AD9+Fouriertrf 2131+fpartint 2A0D+frac12 00BD+frac13 2153+frac14 00BC+frac15 2155+frac16 2159+frac18 215B+frac23 2154+frac25 2156+frac34 00BE+frac35 2157+frac38 215C+frac45 2158+frac56 215A+frac58 215D+frac78 215E+frasl 2044+frown 2322+fscr 1D4BB+Fscr 2131+gacute 01F5+gamma 03B3+Gamma 0393+gammad 03DD+Gammad 03DC+gap 2A86+gbreve 011F+Gbreve 011E+Gcedil 0122+gcirc 011D+Gcirc 011C+gcy 0433+Gcy 0413+gdot 0121+Gdot 0120+ge 2265+gE 2267+gel 22DB+gEl 2A8C+geq 2265+geqq 2267+geqslant 2A7E+ges 2A7E+gescc 2AA9+gesdot 2A80+gesdoto 2A82+gesdotol 2A84+gesl 22DB FE00+gesles 2A94+gfr 1D524+Gfr 1D50A+gg 226B+Gg 22D9+ggg 22D9+ggr 03B3+Ggr 0393+gimel 2137+gjcy 0453+GJcy 0403+gl 2277+gla 2AA5+glE 2A92+glj 2AA4+gnap 2A8A+gnapprox 2A8A+gne 2A88+gnE 2269+gneq 2A88+gneqq 2269+gnsim 22E7+gopf 1D558+Gopf 1D53E+grave 0060+GreaterEqual 2265+GreaterEqualLess 22DB+GreaterFullEqual 2267+GreaterGreater 2AA2+GreaterLess 2277+GreaterSlantEqual 2A7E+GreaterTilde 2273+gscr 210A+Gscr 1D4A2+gsim 2273+gsime 2A8E+gsiml 2A90+gt 003E+Gt 226B+GT 003E+gtcc 2AA7+gtcir 2A7A+gtdot 22D7+gtlPar 2995+gtquest 2A7C+gtrapprox 2A86+gtrarr 2978+gtrdot 22D7+gtreqless 22DB+gtreqqless 2A8C+gtrless 2277+gtrsim 2273+gvertneqq 2269 FE00+gvnE 2269 FE00+Hacek 02C7+hairsp 200A+half 00BD+hamilt 210B+hardcy 044A+HARDcy 042A+harr 2194+hArr 21D4+harrcir 2948+harrw 21AD+Hat 005E+hbar 210F+hcirc 0125+Hcirc 0124+hearts 2665+heartsuitUB hearts+hellip 2026+hercon 22B9+hfr 1D525+Hfr 210C+HilbertSpace 210B+hksearow 2925+hkswarow 2926+hoarr 21FF+homtht 223B+hookleftarrow 21A9+hookrightarrow 21AA+hopf 1D559+Hopf 210D+horbar 2015+HorizontalLine 2500+hscr 1D4BD+Hscr 210B+hslash 210F+hstrok 0127+Hstrok 0126+HumpDownHump 224E+HumpEqual 224F+hybull 2043+hyphen 2010+iacgr 03AF+Iacgr 038A+iacute 00ED+Iacute 00CD+ic 2063+icirc 00EE+Icirc 00CE+icy 0438+Icy 0418+idiagr 0390+idigr 03CA+Idigr 03AA+Idot 0130+iecy 0435+IEcy 0415+iexcl 00A1+iff 21D4+ifr 1D526+Ifr 2111+igr 03B9+Igr 0399+igrave 00EC+Igrave 00CC+ii 2148+iiiint 2A0C+iiint 222D+iinfin 29DC+iiota 2129+ijlig 0133+IJlig 0132+Im 2111+imacr 012B+Imacr 012A+image 2111+ImaginaryI 2148+imagline 2110+imagpart 2111+imath 0131+imof 22B7+imped 01B5+Implies 21D2+in 2208+incare 2105+infin 221E+infintie 29DD+inodot 0131+int 222B+Int 222C+intcal 22BA+integers 2124+Integral 222B+intercal 22BA+Intersection 22C2+intlarhk 2A17+intprod 2A3C+InvisibleComma 2063+InvisibleTimes 2062+iocy 0451+IOcy 0401+iogon 012F+Iogon 012E+iopf 1D55A+Iopf 1D540+iota 03B9+Iota 0399+iprod 2A3C+iquest 00BF+iscr 1D4BE+Iscr 2110+isin 2208+isindot 22F5+isinE 22F9+isins 22F4+isinsv 22F3+isinv 2208+it 2062+itilde 0129+Itilde 0128+iukcyUkrainian+IukcyUkrainian+iuml 00EF+Iuml 00CF+jcirc 0135+Jcirc 0134+jcy 0439+Jcy 0419+jfr 1D527+Jfr 1D50D+jmath 0237+jopf 1D55B+Jopf 1D541+jscr 1D4BF+Jscr 1D4A5+jsercy 0458+Jsercy 0408+jukcyUkrainian+JukcyUkrainian+kappa 03BA+Kappa 039A+kappav 03F0+kcedil 0137+Kcedil 0136+kcy 043A+Kcy 041A+kfr 1D528+Kfr 1D50E+kgr 03BA+Kgr 039A+kgreen 0138+khcy 0445+KHcy 0425+khgr 03C7+KHgr 03A7+kjcy 045C+KJcy 040C+kopf 1D55C+Kopf 1D542+kscr 1D4C0+Kscr 1D4A6+lAarr 21DA+lacute 013A+Lacute 0139+laemptyv 29B4+lagran 2112+lambda 03BB+Lambda 039B+lang 27E8+Lang 27EA+langd 2991+langle 27E8+lap 2A85+Laplacetrf 2112+laquo 00AB+larr 2190+lArr 21D0+Larr 219E+larrb 21E4+larrbfs 291F+larrfs 291D+larrhk 21A9+larrlp 21AB+larrpl 2939+larrsim 2973+larrtl 21A2+lat 2AAB+latail 2919+lAtail 291B+late 2AAD+lates 2AAD FE00+lbarr 290C+lBarr 290E+lbbrk 2772+lbraceUM lcub+lbrackUM lsqb+lbrke 298B+lbrksld 298F+lbrkslu 298D+lcaron 013E+Lcaron 013D+lcedil 013C+Lcedil 013B+lceil 2308+lcub 007B+lcy 043B+Lcy 041B+ldca 2936+ldquo 201C+ldquor 201E+ldrdhar 2967+ldrushar 294B+ldsh 21B2+le 2264+lE 2266+LeftAngleBracket 27E8+leftarrowUM larr+Leftarrow 21D0+LeftArrowUM larr+LeftArrowBar 21E4+LeftArrowRightArrow 21C6+leftarrowtail 21A2+LeftCeiling 2308+LeftDoubleBracket 27E6+LeftDownTeeVector 2961+LeftDownVector 21C3+LeftDownVectorBar 2959+LeftFloor 230A+leftharpoondown 21BD+leftharpoonup 21BC+leftleftarrows 21C7+leftrightarrow 2194+Leftrightarrow 21D4+LeftRightArrow 2194+leftrightarrows 21C6+leftrightharpoons 21CB+leftrightsquigarrow 21AD+LeftRightVector 294E+LeftTee 22A3+LeftTeeArrow 21A4+LeftTeeVector 295A+leftthreetimes 22CB+LeftTriangle 22B2+LeftTriangleBar 29CF+LeftTriangleEqual 22B4+LeftUpDownVector 2951+LeftUpTeeVector 2960+LeftUpVector 21BF+LeftUpVectorBar 2958+LeftVector 21BC+LeftVectorBar 2952+leg 22DA+lEg 2A8B+leq 2264+leqq 2266+leqslant 2A7D+les 2A7D+lescc 2AA8+lesdot 2A7F+lesdoto 2A81+lesdotor 2A83+lesg 22DA FE00+lesges 2A93+lessapprox 2A85+lessdot 22D6+lesseqgtr 22DA+lesseqqgtr 2A8B+LessEqualGreater 22DA+LessFullEqual 2266+LessGreater 2276+lessgtr 2276+LessLess 2AA1+lesssim 2272+LessSlantEqual 2A7D+LessTilde 2272+lfisht 297C+lfloor 230A+lfr 1D529+Lfr 1D50F+lg 2276+lgE 2A91+lgr 03BB+Lgr 039B+lHar 2962+lhard 21BD+lharu 21BC+lharul 296A+lhblk 2584+ljcy 0459+LJcy 0409+ll 226A+Ll 22D8+llarr 21C7+llcorner 231E+Lleftarrow 21DA+llhard 296B+lltri 25FA+lmidot 0140+Lmidot 013F+lmoust 23B0+lmoustache 23B0+lnap 2A89+lnapprox 2A89+lne 2A87+lnE 2268+lneq 2A87+lneqq 2268+lnsim 22E6+loang 27EC+loarr 21FD+lobrk 27E6+longleftarrow 27F5+Longleftarrow 27F8+LongLeftArrow 27F5+longleftrightarrow 27F7+Longleftrightarrow 27FA+LongLeftRightArrow 27F7+longmapsto 27FC+longrightarrow 27F6+Longrightarrow 27F9+LongRightArrow 27F6+looparrowleft 21AB+looparrowright 21AC+lopar 2985+lopf 1D55D+Lopf 1D543+loplus 2A2D+lotimes 2A34+lowast 2217+lowbar 005F+LowerLeftArrow 2199+LowerRightArrow 2198+loz 25CA+lozengeUB loz+lozf 29EB+lpar 0028+lparlt 2993+lrarr 21C6+lrcorner 231F+lrhar 21CB+lrhard 296D+lrm 200E+lrtri 22BF+lsaquo 2039+lscr 1D4C1+Lscr 2112+lsh 21B0+Lsh 21B0+lsim 2272+lsime 2A8D+lsimg 2A8F+lsqb 005B+lsquo 2018+lsquor 201A+lstrok 0142+Lstrok 0141+lt 003C+Lt 226A+LT 003C+ltcc 2AA6+ltcir 2A79+ltdot 22D6+lthree 22CB+ltimes 22C9+ltlarr 2976+ltquest 2A7B+ltri 25C3+ltrie 22B4+ltrif 25C2+ltrPar 2996+lurdshar 294A+luruhar 2966+lvertneqq 2268 FE00+lvnE 2268 FE00+macr 00AF+male 2642+malt 2720+malteseUB malt+map 21A6+Map 2905+mapsto 21A6+mapstodown 21A7+mapstoleft 21A4+mapstoup 21A5+marker 25AE+mcomma 2A29+mcy 043C+Mcy 041C+mdash 2014+mDDot 223A+measuredangle 2221+MediumSpace 205F+Mellintrf 2133+mfr 1D52A+Mfr 1D510+mgr 03BC+Mgr 039C+mho 2127+micro 00B5+mid 2223+midast 002A+midcir 2AF0+middot 00B7+minus 2212+minusb 229F+minusd 2238+minusdu 2A2A+MinusPlus 2213+mlcp 2ADB+mldr 2026+mnplus 2213+models 22A7+mopf 1D55E+Mopf 1D544+mp 2213+mscr 1D4C2+Mscr 2133+mstpos 223E+mu 03BC+Mu 039C+multimap 22B8+mumap 22B8+nabla 2207+nacute 0144+Nacute 0143+nang 2220 20D2+nap 2249+napE 2A70 0338+napid 224B 0338+napos 0149+napprox 2249+natur 266E+naturalUB natur+naturals 2115+nbsp 00A0+nbump 224E 0338+nbumpe 224F 0338+ncap 2A43+ncaron 0148+Ncaron 0147+ncedil 0146+Ncedil 0145+ncong 2247+ncongdot 2A6D 0338+ncup 2A42+ncy 043D+Ncy 041D+ndash 2013+ne 2260+nearhk 2924+nearr 2197+neArr 21D7+nearrow 2197+nedot 2250 0338+NegativeMediumSpace 200B+NegativeThickSpace 200B+NegativeThinSpace 200B+NegativeVeryThinSpace 200B+nequiv 2262+nesear 2928+nesim 2242 0338+NestedGreaterGreater 226B+NestedLessLess 226A+NewLine 000A+nexist 2204+nexists 2204+nfr 1D52B+Nfr 1D511+nge 2271+ngE 2267 0338+ngeq 2271+ngeqq 2267 0338+ngeqslant 2A7E 0338+nges 2A7E 0338+nGg 22D9 0338+ngr 03BD+Ngr 039D+ngsim 2275+ngt 226F+nGt 226B 20D2+ngtr 226F+nGtv 226B 0338+nharr 21AE+nhArr 21CE+nhpar 2AF2+ni 220B+nis 22FC+nisd 22FA+niv 220B+njcy 045A+NJcy 040A+nlarr 219A+nlArr 21CD+nldr 2025+nle 2270+nlE 2266 0338+nleftarrow 219A+nLeftarrow 21CD+nleftrightarrow 21AE+nLeftrightarrow 21CE+nleq 2270+nleqq 2266 0338+nleqslant 2A7D 0338+nles 2A7D 0338+nless 226E+nLl 22D8 0338+nlsim 2274+nlt 226E+nLt 226A 20D2+nltri 22EA+nltrie 22EC+nLtv 226A 0338+nmid 2224+NoBreak 2060+NonBreakingSpaceUM nbsp+nopf 1D55F+Nopf 2115+not 00AC+Not 2AEC+NotCongruent 2262+NotCupCap 226D+NotDoubleVerticalBar 2226+NotElement 2209+NotEqual 2260+NotEqualTilde 2242 0338+NotExists 2204+NotGreater 226F+NotGreaterEqual 2271+NotGreaterFullEqual 2267 0338+NotGreaterGreater 226B 0338+NotGreaterLess 2279+NotGreaterSlantEqual 2A7E 0338+NotGreaterTilde 2275+NotHumpDownHump 224E 0338+NotHumpEqual 224F 0338+notin 2209+notindot 22F5 0338+notinE 22F9 0338+notinva 2209+notinvb 22F7+notinvc 22F6+NotLeftTriangle 22EA+NotLeftTriangleBar 29CF 0338+NotLeftTriangleEqual 22EC+NotLess 226E+NotLessEqual 2270+NotLessGreater 2278+NotLessLess 226A 0338+NotLessSlantEqual 2A7D 0338+NotLessTilde 2274+NotNestedGreaterGreater 2AA2 0338+NotNestedLessLess 2AA1 0338+notni 220C+notniva 220C+notnivb 22FE+notnivc 22FD+NotPrecedes 2280+NotPrecedesEqual 2AAF 0338+NotPrecedesSlantEqual 22E0+NotReverseElement 220C+NotRightTriangle 22EB+NotRightTriangleBar 29D0 0338+NotRightTriangleEqual 22ED+NotSquareSubset 228F 0338+NotSquareSubsetEqual 22E2+NotSquareSuperset 2290 0338+NotSquareSupersetEqual 22E3+NotSubset 2282 20D2+NotSubsetEqual 2288+NotSucceeds 2281+NotSucceedsEqual 2AB0 0338+NotSucceedsSlantEqual 22E1+NotSucceedsTilde 227F 0338+NotSuperset 2283 20D2+NotSupersetEqual 2289+NotTilde 2241+NotTildeEqual 2244+NotTildeFullEqual 2247+NotTildeTilde 2249+NotVerticalBar 2224+npar 2226+nparallel 2226+nparsl 2AFD 20E5+npart 2202 0338+npolint 2A14+npr 2280+nprcue 22E0+npre 2AAF 0338+nprec 2280+npreceq 2AAF 0338+nrarr 219B+nrArr 21CF+nrarrc 2933 0338+nrarrw 219D 0338+nrightarrow 219B+nRightarrow 21CF+nrtri 22EB+nrtrie 22ED+nsc 2281+nsccue 22E1+nsce 2AB0 0338+nscr 1D4C3+Nscr 1D4A9+nshortmid 2224+nshortparallel 2226+nsim 2241+nsime 2244+nsimeq 2244+nsmid 2224+nspar 2226+nsqsube 22E2+nsqsupe 22E3+nsub 2284+nsube 2288+nsubE 2AC5 0338+nsubset 2282 20D2+nsubseteq 2288+nsubseteqq 2AC5 0338+nsucc 2281+nsucceq 2AB0 0338+nsup 2285+nsupe 2289+nsupE 2AC6 0338+nsupset 2283 20D2+nsupseteq 2289+nsupseteqq 2AC6 0338+ntgl 2279+ntilde 00F1+Ntilde 00D1+ntlg 2278+ntriangleleft 22EA+ntrianglelefteq 22EC+ntriangleright 22EB+ntrianglerighteq 22ED+nu 03BD+Nu 039D+num 0023+numero 2116+numsp 2007+nvap 224D 20D2+nvdash 22AC+nvDash 22AD+nVdash 22AE+nVDash 22AF+nvge 2265 20D2+nvgt 003E 20D2+nvHarr 2904+nvinfin 29DE+nvlArr 2902+nvle 2264 20D2+nvlt 003C 20D2+nvltrie 22B4 20D2+nvrArr 2903+nvrtrie 22B5 20D2+nvsim 223C 20D2+nwarhk 2923+nwarr 2196+nwArr 21D6+nwarrow 2196+nwnear 2927+oacgr 03CC+Oacgr 038C+oacute 00F3+Oacute 00D3+oast 229B+ocir 229A+ocirc 00F4+Ocirc 00D4+ocy 043E+Ocy 041E+odash 229D+odblac 0151+Odblac 0150+odiv 2A38+odot 2299+odsold 29BC+oelig 0153+OElig 0152+ofcir 29BF+ofr 1D52C+Ofr 1D512+ogon 02DB+ogr 03BF+Ogr 039F+ograve 00F2+Ograve 00D2+ogt 29C1+ohacgr 03CE+OHacgr 038F+ohbar 29B5+ohgr 03C9+OHgr 03A9+ohm 03A9+oint 222E+olarr 21BA+olcir 29BE+olcross 29BB+oline 203E+olt 29C0+omacr 014D+Omacr 014C+omega 03C9+Omega 03A9+omicron 03BF+Omicron 039F+omid 29B6+ominus 2296+oopf 1D560+Oopf 1D546+opar 29B7+OpenCurlyDoubleQuoteUM ldquo+OpenCurlyQuoteUM lsquo+operp 29B9+oplus 2295+or 2228+Or 2A54+orarr 21BB+ord 2A5D+order 2134+orderof 2134+ordf 00AA+ordm 00BA+origof 22B6+oror 2A56+orslope 2A57+orv 2A5B+oS 24C8+oscr 2134+Oscr 1D4AA+oslash 00F8+Oslash 00D8+osol 2298+otilde 00F5+Otilde 00D5+otimes 2297+Otimes 2A37+otimesas 2A36+ouml 00F6+Ouml 00D6+ovbar 233D+OverBar 203E+OverBrace 23DE+OverBracket 23B4+OverParenthesis 23DC+par 2225+para 00B6+parallel 2225+parsim 2AF3+parsl 2AFD+part 2202+PartialD 2202+pcy 043F+Pcy 041F+percnt 0025+period 002E+permil 2030+perp 22A5+pertenk 2031+pfr 1D52D+Pfr 1D513+pgr 03C0+Pgr 03A0+phgr 03C6+PHgr 03A6+phi 03C6+Phi 03A6+phiv 03D5+phmmat 2133+phone 260E+pi 03C0+Pi 03A0+pitchfork 22D4+piv 03D6+planck 210F+planckh 210E+plankv 210F+plus 002B+plusacir 2A23+plusb 229E+pluscir 2A22+plusdo 2214+plusdu 2A25+pluse 2A72+PlusMinusUM plusmn+plusmn 00B1+plussim 2A26+plustwo 2A27+pmUM plusmn+Poincareplane 210C+pointint 2A15+popf 1D561+Popf 2119+pound 00A3+pr 227A+Pr 2ABB+prap 2AB7+prcue 227C+pre 2AAF+prE 2AB3+prec 227A+precapprox 2AB7+preccurlyeq 227C+Precedes 227A+PrecedesEqual 2AAF+PrecedesSlantEqual 227C+PrecedesTilde 227E+preceq 2AAF+precnapprox 2AB9+precneqq 2AB5+precnsim 22E8+precsim 227E+prime 2032+Prime 2033+primes 2119+prnap 2AB9+prnE 2AB5+prnsim 22E8+prod 220F+Product 220F+profalar 232E+profline 2312+profsurf 2313+prop 221D+Proportion 2237+Proportional 221D+propto 221D+prsim 227E+prurel 22B0+pscr 1D4C5+Pscr 1D4AB+psgr 03C8+PSgr 03A8+psi 03C8+Psi 03A8+puncsp 2008+qfr 1D52E+Qfr 1D514+qint 2A0C+qopf 1D562+Qopf 211A+qprime 2057+qscr 1D4C6+Qscr 1D4AC+quaternions 210D+quatint 2A16+quest 003F+questeq 225F+quot 0022+QUOT 0022+rAarr 21DB+race 223D 0331+racute 0155+Racute 0154+radic 221A+raemptyv 29B3+rang 27E9+Rang 27EB+rangd 2992+range 29A5+rangle 27E9+raquo 00BB+rarr 2192+rArr 21D2+Rarr 21A0+rarrap 2975+rarrb 21E5+rarrbfs 2920+rarrc 2933+rarrfs 291E+rarrhk 21AA+rarrlp 21AC+rarrpl 2945+rarrsim 2974+rarrtl 21A3+Rarrtl 2916+rarrw 219D+ratail 291A+rAtail 291C+ratio 2236+rationals 211A+rbarr 290D+rBarr 290F+RBarr 2910+rbbrk 2773+rbraceUM rcub+rbrackUM rsqb+rbrke 298C+rbrksld 298E+rbrkslu 2990+rcaron 0159+Rcaron 0158+rcedil 0157+Rcedil 0156+rceil 2309+rcub 007D+rcy 0440+Rcy 0420+rdca 2937+rdldhar 2969+rdquo 201D+rdquor 201D+rdsh 21B3+Re 211C+real 211C+realine 211B+realpart 211C+reals 211D+rect 25AD+reg 00AE+REG 00AE+ReverseElement 220B+ReverseEquilibrium 21CB+ReverseUpEquilibrium 296F+rfisht 297D+rfloor 230B+rfr 1D52F+Rfr 211C+rgr 03C1+Rgr 03A1+rHar 2964+rhard 21C1+rharu 21C0+rharul 296C+rho 03C1+Rho 03A1+rhov 03F1+RightAngleBracket 27E9+rightarrowUM rarr+Rightarrow 21D2+RightArrowUM rarr+RightArrowBar 21E5+RightArrowLeftArrow 21C4+rightarrowtail 21A3+RightCeiling 2309+RightDoubleBracket 27E7+RightDownTeeVector 295D+RightDownVector 21C2+RightDownVectorBar 2955+RightFloor 230B+rightharpoondown 21C1+rightharpoonup 21C0+rightleftarrows 21C4+rightleftharpoons 21CC+rightrightarrows 21C9+rightsquigarrow 219D+RightTee 22A2+RightTeeArrow 21A6+RightTeeVector 295B+rightthreetimes 22CC+RightTriangle 22B3+RightTriangleBar 29D0+RightTriangleEqual 22B5+RightUpDownVector 294F+RightUpTeeVector 295C+RightUpVector 21BE+RightUpVectorBar 2954+RightVector 21C0+RightVectorBar 2953+ring 02DA+risingdotseq 2253+rlarr 21C4+rlhar 21CC+rlm 200F+rmoust 23B1+rmoustache 23B1+rnmid 2AEE+roang 27ED+roarr 21FE+robrk 27E7+ropar 2986+ropf 1D563+Ropf 211D+roplus 2A2E+rotimes 2A35+RoundImplies 2970+rpar 0029+rpargt 2994+rppolint 2A12+rrarr 21C9+Rrightarrow 21DB+rsaquo 203A+rscr 1D4C7+Rscr 211B+rsh 21B1+Rsh 21B1+rsqb 005D+rsquo 2019+rsquor 2019+rthree 22CC+rtimes 22CA+rtri 25B9+rtrie 22B5+rtrif 25B8+rtriltri 29CE+RuleDelayed 29F4+ruluhar 2968+rx 211E+sacute 015B+Sacute 015A+sbquo 201A+sc 227B+Sc 2ABC+scap 2AB8+scaron 0161+Scaron 0160+sccue 227D+sce 2AB0+scE 2AB4+scedil 015F+Scedil 015E+scirc 015D+Scirc 015C+scnap 2ABA+scnE 2AB6+scnsim 22E9+scpolint 2A13+scsim 227F+scy 0441+Scy 0421+sdot 22C5+sdotb 22A1+sdote 2A66+searhk 2925+searr 2198+seArr 21D8+searrow 2198+sect 00A7+semi 003B+seswar 2929+setminus 2216+setmn 2216+sext 2736+sfgr 03C2+sfr 1D530+Sfr 1D516+sfrown 2322+sgr 03C3+Sgr 03A3+sharp 266F+shchcy 0449+SHCHcy 0429+shcy 0448+SHcy 0428+ShortDownArrow 2193+ShortLeftArrow 2190+shortmid 2223+shortparallel 2225+ShortRightArrow 2192+ShortUpArrow 2191+shy 00AD+sigma 03C3+Sigma 03A3+sigmaf 03C2+sigmav 03C2+sim 223C+simdot 2A6A+sime 2243+simeq 2243+simg 2A9E+simgE 2AA0+siml 2A9D+simlE 2A9F+simne 2246+simplus 2A24+simrarr 2972+slarr 2190+SmallCircle 2218+smallsetminus 2216+smashp 2A33+smeparsl 29E4+smid 2223+smile 2323+smt 2AAA+smte 2AAC+smtes 2AAC FE00+softcy 044C+SOFTcy 042C+sol 002F+solb 29C4+solbar 233F+sopf 1D564+Sopf 1D54A+spades 2660+spadesuitUB spades+spar 2225+sqcap 2293+sqcaps 2293 FE00+sqcup 2294+sqcups 2294 FE00+Sqrt 221A+sqsub 228F+sqsube 2291+sqsubset 228F+sqsubseteq 2291+sqsup 2290+sqsupe 2292+sqsupset 2290+sqsupseteq 2292+squ 25A1+square 25A1+Square 25A1+SquareIntersection 2293+SquareSubset 228F+SquareSubsetEqual 2291+SquareSuperset 2290+SquareSupersetEqual 2292+SquareUnion 2294+squarf 25AA+squf 25AA+srarr 2192+sscr 1D4C8+Sscr 1D4AE+ssetmn 2216+ssmile 2323+sstarf 22C6+star 2606+Star 22C6+starf 2605+straightepsilon 03F5+straightphi 03D5+strns 00AF+sub 2282+Sub 22D0+subdot 2ABD+sube 2286+subE 2AC5+subedot 2AC3+submult 2AC1+subne 228A+subnE 2ACB+subplus 2ABF+subrarr 2979+subset 2282+Subset 22D0+subseteq 2286+subseteqq 2AC5+SubsetEqual 2286+subsetneq 228A+subsetneqq 2ACB+subsim 2AC7+subsub 2AD5+subsup 2AD3+succ 227B+succapprox 2AB8+succcurlyeq 227D+Succeeds 227B+SucceedsEqual 2AB0+SucceedsSlantEqual 227D+SucceedsTilde 227F+succeq 2AB0+succnapprox 2ABA+succneqq 2AB6+succnsim 22E9+succsim 227F+SuchThat 220B+sum 2211+Sum 2211+sung 266A+sup 2283+Sup 22D1+sup1 00B9+sup2 00B2+sup3 00B3+supdot 2ABE+supdsub 2AD8+supe 2287+supE 2AC6+supedot 2AC4+Superset 2283+SupersetEqual 2287+suphsol 27C9+suphsub 2AD7+suplarr 297B+supmult 2AC2+supne 228B+supnE 2ACC+supplus 2AC0+supset 2283+Supset 22D1+supseteq 2287+supseteqq 2AC6+supsetneq 228B+supsetneqq 2ACC+supsim 2AC8+supsub 2AD4+supsup 2AD6+swarhk 2926+swarr 2199+swArr 21D9+swarrow 2199+swnwar 292A+szlig 00DF+Tab 0009+target 2316+tau 03C4+Tau 03A4+tbrk 23B4+tcaron 0165+Tcaron 0164+tcedil 0163+Tcedil 0162+tcy 0442+Tcy 0422+tdot 20DB+telrec 2315+tfr 1D531+Tfr 1D517+tgr 03C4+Tgr 03A4+there4 2234+therefore 2234+Therefore 2234+theta 03B8+Theta 0398+thetasym 03D1+thetav 03D1+thgr 03B8+THgr 0398+thickapprox 2248+thicksim 223C+ThickSpace 205F 200A+thinsp 2009+ThinSpaceUB thinsp+thkap 2248+thksim 223C+thorn 00FE+THORN 00DE+tilde 02DC+Tilde 223C+TildeEqual 2243+TildeFullEqual 2245+TildeTilde 2248+times 00D7+timesb 22A0+timesbar 2A31+timesd 2A30+tint 222D+toea 2928+top 22A4+topbot 2336+topcir 2AF1+topf 1D565+Topf 1D54B+topfork 2ADA+tosa 2929+tprime 2034+trade 2122+TRADE 2122+triangleUB utri+triangledownUB dtri+triangleleftUB ltri+trianglelefteq 22B4+triangleq 225C+trianglerightUB rtri+trianglerighteq 22B5+tridot 25EC+trie 225C+triminus 2A3A+TripleDot 20DB+triplus 2A39+trisb 29CD+tritime 2A3B+trpezium 23E2+tscr 1D4C9+Tscr 1D4AF+tscy 0446+TScy 0426+tshcy 045B+TSHcy 040B+tstrok 0167+Tstrok 0166+twixt 226C+twoheadleftarrow 219E+twoheadrightarrow 21A0+uacgr 03CD+UacgrUpsilon+uacute 00FA+UacuteU with acute+uarr 2191+uArr 21D1+Uarr 219F+Uarrocir 2949+ubrcy 045E+UbrcyU+ubreve 016D+UbreveU+ucirc 00FB+UcircU with circumflex+ucy 0443+UcyU+udarr 21C5+udblac 0171+UdblacU+udhar 296E+udiagr 03B0+udigr 03CB+UdigrUpsilon+ufisht 297E+ufr 1D532+UfrU+ugr 03C5+UgrUpsilon+ugrave 00F9+UgraveU with grave+uHar 2963+uharl 21BF+uharr 21BE+uhblk 2580+ulcorn 231C+ulcorner 231C+ulcrop 230F+ultri 25F8+umacr 016B+UmacrU+uml 00A8+UnderBar 005F+UnderBrace 23DF+UnderBracket 23B5+UnderParenthesis 23DD+Union 22C3+UnionPlus 228E+uogon 0173+UogonU+uopf 1D566+UopfU+uparrowUM uarr+Uparrow 21D1+UpArrowUM uarr+UpArrowBar 2912+UpArrowDownArrow 21C5+updownarrow 2195+Updownarrow 21D5+UpDownArrow 2195+UpEquilibrium 296E+upharpoonleft 21BF+upharpoonright 21BE+uplus 228E+UpperLeftArrow 2196+UpperRightArrow 2197+upsi 03C5+UpsiUpsilon capital Upsilon+upsih 03D2+upsilon 03C5+UpsilonUgr+UpTee 22A5+UpTeeArrow 21A5+upuparrows 21C8+urcorn 231D+urcorner 231D+urcrop 230E+uring 016F+UringU+urtri 25F9+uscr 1D4CA+UscrU+utdot 22F0+utilde 0169+UtildeU+utri 25B5+utrif 25B4+uuarr 21C8+uuml 00FC+UumlU with diaeresis+uwangle 29A7+vangrt 299C+varepsilon 03F5+varkappa 03F0+varnothing 2205+varphi 03D5+varpi 03D6+varpropto 221D+varr 2195+vArrUpdownarrow A: up&down dbl arrow+varrho 03F1+varsigma 03C2+varsubsetneq 228A FE00+varsubsetneqq 2ACB FE00+varsupsetneq 228B FE00+varsupsetneqq 2ACC FE00+vartheta 03D1+vartriangleleft 22B2+vartriangleright 22B3+vBar 2AE8+Vbar 2AEB+vBarv 2AE9+vcy 0432+Vcy 0412+vdash 22A2+vDash 22A8+Vdash 22A9+VDash 22AB+Vdashl 2AE6+vee 2228+Vee 22C1+veebar 22BB+veeeq 225A+vellip 22EE+verbar 007C+Verbar 2016+vertUM verbar+Vert 2016+VerticalBar 2223+VerticalLineUM verbar+VerticalSeparator 2758+VerticalTilde 2240+VeryThinSpaceUB hairsp+vfr 1D533+Vfr 1D519+vltri 22B2+vnsub 2282 20D2+vnsup 2283 20D2+vopf 1D567+Vopf 1D54D+vprop 221D+vrtri 22B3+vscr 1D4CB+Vscr 1D4B1+vsubne 228A FE00+vsubnE 2ACB FE00+vsupne 228B FE00+vsupnE 2ACC FE00+Vvdash 22AA+vzigzag 299A+wcirc 0175+Wcirc 0174+wedbar 2A5F+wedge 2227+Wedge 22C0+wedgeq 2259+weierp 2118+wfr 1D534+Wfr 1D51A+wopf 1D568+Wopf 1D54E+wp 2118+wr 2240+wreath 2240+wscr 1D4CC+Wscr 1D4B2+xcap 22C2+xcirc 25EF+xcup 22C3+xdtri 25BD+xfr 1D535+Xfr 1D51B+xgr 03BE+Xgr 039E+xharr 27F7+xhArr 27FA+xi 03BE+Xi 039E+xlarr 27F5+xlArr 27F8+xmap 27FC+xnis 22FB+xodot 2A00+xopf 1D569+Xopf 1D54F+xoplus 2A01+xotime 2A02+xrarr 27F6+xrArr 27F9+xscr 1D4CD+Xscr 1D4B3+xsqcup 2A06+xuplus 2A04+xutri 25B3+xvee 22C1+xwedge 22C0+yacute 00FD+Yacute 00DD+yacy 044F+YAcy 042F+ycirc 0177+Ycirc 0176+ycy 044B+YcyU+yen 00A5+yfr 1D536+Yfr 1D51C+yicyUkrainian+YIcyUkrainian+yopf 1D56A+Yopf 1D550+yscr 1D4CE+Yscr 1D4B4+yucy 044E+YUcyU+yuml 00FF+Yuml 0178+zacute 017A+Zacute 0179+zcaron 017E+Zcaron 017D+zcy 0437+Zcy 0417+zdot 017C+Zdot 017B+zeetrf 2128+ZeroWidthSpace 200B+zeta 03B6+Zeta 0396+zfr 1D537+Zfr 2128+zgr 03B6+Zgr 0396+zhcy 0436+ZHcy 0416+zigrarr 21DD+zopf 1D56B+Zopf 2124+zscr 1D4CF+Zscr 1D4B5+zwj 200D+zwnj 200C
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml" /><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Override PartName="/word/webSettings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml" /><Override PartName="/word/numbering.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml" /><Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml" /><Override PartName="/word/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml" /><Override PartName="/word/fontTable.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /><Override PartName="/docProps/custom.xml" ContentType="application/vnd.openxmlformats-officedocument.custom-properties+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml" /><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" /><Override PartName="/word/comments.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml" /><Override PartName="/word/footnotes.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml" /></Types>
@@ -0,0 +1,3 @@+<?xml version="1.0" encoding="UTF-8"?>+<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml" /><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml" /><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml" /><Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties" Target="docProps/custom.xml"/>+</Relationships>
@@ -0,0 +1,18 @@+<?xml version="1.0" encoding="UTF-8"?>+<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">+ <Words>83</Words>+ <SharedDoc>false</SharedDoc>+ <HyperlinksChanged>false</HyperlinksChanged>+ <Lines>12</Lines>+ <AppVersion>12.0000</AppVersion>+ <LinksUpToDate>false</LinksUpToDate>+ <Application>Microsoft Word 12.0.0</Application>+ <CharactersWithSpaces>583</CharactersWithSpaces>+ <Template>Normal.dotm</Template>+ <DocSecurity>0</DocSecurity>+ <TotalTime>6</TotalTime>+ <ScaleCrop>false</ScaleCrop>+ <Characters>475</Characters>+ <Paragraphs>8</Paragraphs>+ <Pages>1</Pages>+</Properties>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:title>Title</dc:title><dc:creator>Author</dc:creator><cp:keywords></cp:keywords><dcterms:created xsi:type="dcterms:W3CDTF">2017-12-27T05:22:50Z</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">2017-12-27T05:22:50Z</dcterms:modified></cp:coreProperties>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>+<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"></Properties>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering" Id="rId1" Target="numbering.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Id="rId2" Target="styles.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Id="rId3" Target="settings.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings" Id="rId4" Target="webSettings.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" Id="rId5" Target="fontTable.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Id="rId6" Target="theme/theme1.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes" Id="rId7" Target="footnotes.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" Id="rId8" Target="comments.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Id="rId30" Target="http://example.com" TargetMode="External" /></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Id="rId30" Target="http://example.com" TargetMode="External" /></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<w:comments xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" />
@@ -0,0 +1,330 @@+<?xml version="1.0" encoding="utf-8"?>+<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"+xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"+xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"+xmlns:o="urn:schemas-microsoft-com:office:office"+xmlns:v="urn:schemas-microsoft-com:vml"+xmlns:w10="urn:schemas-microsoft-com:office:word"+xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"+xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"+xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing">++ <w:body>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Title" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Title</w:t>+ </w:r>+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Subtitle" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Subtitle</w:t>+ </w:r>+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Author" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Author</w:t>+ </w:r>+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Date" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Date</w:t>+ </w:r>+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Abstract" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Abstract</w:t>+ </w:r>+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Heading1" />+ </w:pPr>+ <w:bookmarkStart w:id="21" w:name="heading-1" />+ <w:r>+ <w:t xml:space="preserve">Heading 1</w:t>+ </w:r>+ <w:bookmarkEnd w:id="21" />+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Heading2" />+ </w:pPr>+ <w:bookmarkStart w:id="22" w:name="heading-2" />+ <w:r>+ <w:t xml:space="preserve">Heading 2</w:t>+ </w:r>+ <w:bookmarkEnd w:id="22" />+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Heading3" />+ </w:pPr>+ <w:bookmarkStart w:id="23" w:name="heading-3" />+ <w:r>+ <w:t xml:space="preserve">Heading 3</w:t>+ </w:r>+ <w:bookmarkEnd w:id="23" />+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Heading4" />+ </w:pPr>+ <w:bookmarkStart w:id="24" w:name="heading-4" />+ <w:r>+ <w:t xml:space="preserve">Heading 4</w:t>+ </w:r>+ <w:bookmarkEnd w:id="24" />+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Heading5" />+ </w:pPr>+ <w:bookmarkStart w:id="25" w:name="heading-5" />+ <w:r>+ <w:t xml:space="preserve">Heading 5</w:t>+ </w:r>+ <w:bookmarkEnd w:id="25" />+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Heading6" />+ </w:pPr>+ <w:bookmarkStart w:id="26" w:name="heading-6" />+ <w:r>+ <w:t xml:space="preserve">Heading 6</w:t>+ </w:r>+ <w:bookmarkEnd w:id="26" />+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Heading7" />+ </w:pPr>+ <w:bookmarkStart w:id="27" w:name="heading-7" />+ <w:r>+ <w:t xml:space="preserve">Heading 7</w:t>+ </w:r>+ <w:bookmarkEnd w:id="27" />+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Heading8" />+ </w:pPr>+ <w:bookmarkStart w:id="28" w:name="heading-8" />+ <w:r>+ <w:t xml:space="preserve">Heading 8</w:t>+ </w:r>+ <w:bookmarkEnd w:id="28" />+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Heading9" />+ </w:pPr>+ <w:bookmarkStart w:id="29" w:name="heading-9" />+ <w:r>+ <w:t xml:space="preserve">Heading 9</w:t>+ </w:r>+ <w:bookmarkEnd w:id="29" />+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="FirstParagraph" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">First Paragraph.</w:t>+ </w:r>+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="BodyText" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Body Text. Body Text Char.</w:t>+ </w:r>+ <w:r>+ <w:t xml:space="preserve"> </w:t>+ </w:r>+ <w:r>+ <w:rPr>+ <w:rStyle w:val="VerbatimChar" />+ </w:rPr>+ <w:t xml:space="preserve">Verbatim Char</w:t>+ </w:r>+ <w:r>+ <w:t xml:space="preserve">.</w:t>+ </w:r>+ <w:r>+ <w:t xml:space="preserve"> </w:t>+ </w:r>+ <w:hyperlink r:id="rId30">+ <w:r>+ <w:rPr>+ <w:rStyle w:val="Hyperlink" />+ </w:rPr>+ <w:t xml:space="preserve">Hyperlink</w:t>+ </w:r>+ </w:hyperlink>+ <w:r>+ <w:t xml:space="preserve">.</w:t>+ </w:r>+ <w:r>+ <w:t xml:space="preserve"> </w:t>+ </w:r>+ <w:r>+ <w:t xml:space="preserve">Footnote.</w:t>+ </w:r>+ <w:r>+ <w:rPr>+ <w:rStyle w:val="FootnoteReference" />+ </w:rPr>+ <w:footnoteReference w:id="31" />+ </w:r>+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="BlockText" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Block Text.</w:t>+ </w:r>+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="TableCaption" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Table caption.</w:t>+ </w:r>+ </w:p>+ <w:tbl>+ <w:tblPr>+ <w:tblStyle w:val="Table" />+ <w:tblLook w:firstRow="1" />+ <w:tblCaption w:val="Table caption." />+ </w:tblPr>+ <w:tblGrid />+ <w:tr>+ <w:trPr>+ <w:cnfStyle w:firstRow="1" w:val="100000000000" />+ </w:trPr>+ <w:tc>+ <w:tcPr>+ <w:tcBorders>+ <w:bottom w:val="single" />+ </w:tcBorders>+ <w:vAlign w:val="bottom" />+ </w:tcPr>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Compact" />+ <w:jc w:val="left" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Table</w:t>+ </w:r>+ </w:p>+ </w:tc>+ <w:tc>+ <w:tcPr>+ <w:tcBorders>+ <w:bottom w:val="single" />+ </w:tcBorders>+ <w:vAlign w:val="bottom" />+ </w:tcPr>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Compact" />+ <w:jc w:val="left" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Table</w:t>+ </w:r>+ </w:p>+ </w:tc>+ </w:tr>+ <w:tr>+ <w:tc>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Compact" />+ <w:jc w:val="left" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">1</w:t>+ </w:r>+ </w:p>+ </w:tc>+ <w:tc>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Compact" />+ <w:jc w:val="left" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">2</w:t>+ </w:r>+ </w:p>+ </w:tc>+ </w:tr>+ </w:tbl>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="ImageCaption" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Image Caption</w:t>+ </w:r>+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="DefinitionTerm" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">DefinitionTerm</w:t>+ </w:r>+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Definition" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Definition</w:t>+ </w:r>+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="DefinitionTerm" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">DefinitionTerm</w:t>+ </w:r>+ </w:p>+ <w:p>+ <w:pPr>+ <w:pStyle w:val="Definition" />+ </w:pPr>+ <w:r>+ <w:t xml:space="preserve">Definition</w:t>+ </w:r>+ </w:p>+ <w:sectPr>+ <w:footnotePr>+ <w:numRestart w:val="eachSect" />+ </w:footnotePr>+ </w:sectPr>+ </w:body>+</w:document>
@@ -0,0 +1,52 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>+<w:fonts xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">+ <w:font w:name="Aptos">+ <w:panose1 w:val="020B0004020202020204"/>+ <w:charset w:val="00"/>+ <w:family w:val="swiss"/>+ <w:pitch w:val="variable"/>+ <w:sig w:usb0="20000287" w:usb1="00000003" w:usb2="00000000" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>+ </w:font>+ <w:font w:name="Times New Roman">+ <w:panose1 w:val="02020603050405020304"/>+ <w:charset w:val="00"/>+ <w:family w:val="roman"/>+ <w:pitch w:val="variable"/>+ <w:sig w:usb0="E0002EFF" w:usb1="C000785B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>+ </w:font>+ <w:font w:name="Aptos Display">+ <w:panose1 w:val="020B0004020202020204"/>+ <w:charset w:val="00"/>+ <w:family w:val="swiss"/>+ <w:pitch w:val="variable"/>+ <w:sig w:usb0="20000287" w:usb1="00000003" w:usb2="00000000" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>+ </w:font>+ <w:font w:name="Cambria Math">+ <w:panose1 w:val="02040503050406030204"/>+ <w:charset w:val="00"/>+ <w:family w:val="roman"/>+ <w:pitch w:val="variable"/>+ <w:sig w:usb0="E00002FF" w:usb1="420024FF" w:usb2="00000000" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>+ </w:font>+ <w:font w:name="Courier New">+ <w:panose1 w:val="02070309020205020404"/>+ <w:charset w:val="00"/>+ <w:family w:val="modern"/>+ <w:pitch w:val="fixed"/>+ <w:sig w:usb0="E0002AFF" w:usb1="C0007843" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>+ </w:font>+ <w:font w:name="Cambria">+ <w:panose1 w:val="02040503050406030204"/>+ <w:charset w:val="00"/>+ <w:family w:val="roman"/>+ <w:pitch w:val="variable"/>+ <w:sig w:usb0="E00002FF" w:usb1="400004FF" w:usb2="00000000" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>+ </w:font>+ <w:font w:name="Calibri">+ <w:panose1 w:val="020F0502020204030204"/>+ <w:charset w:val="00"/>+ <w:family w:val="swiss"/>+ <w:pitch w:val="variable"/>+ <w:sig w:usb0="E0002AFF" w:usb1="C000247B" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>+ </w:font>+</w:fonts>
@@ -0,0 +1,21 @@+<?xml version="1.0" encoding="UTF-8"?>+<w:footnotes xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing">+ <w:footnote w:type="continuationSeparator" w:id="0"><w:p><w:r><w:continuationSeparator /></w:r></w:p></w:footnote>+ <w:footnote w:type="separator" w:id="-1"><w:p><w:r><w:separator /></w:r></w:p></w:footnote>+ <w:footnote w:id="31">+ <w:p>+ <w:pPr><w:pStyle w:val="FootnoteText" /></w:pPr>+ <w:r>+ <w:rPr>+ <w:rStyle w:val="FootnoteReference" />+ </w:rPr>+ <w:footnoteRef />+ </w:r>+ <w:r><w:t>Footnote Text.</w:t></w:r>+ </w:p>+ <w:p>+ <w:pPr><w:pStyle w:val="FootnoteBlockText"/></w:pPr>+ <w:r><w:t>Footnote Block Text</w:t></w:r>+ </w:p>+ </w:footnote>+</w:footnotes>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<w:numbering xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:abstractNum w:abstractNumId="990"><w:nsid w:val="170cd2de" /><w:multiLevelType w:val="multilevel" /><w:lvl w:ilvl="0"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="0" /></w:tabs><w:ind w:left="480" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="1"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="720" /></w:tabs><w:ind w:left="1200" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="2"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="1440" /></w:tabs><w:ind w:left="1920" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="3"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="2160" /></w:tabs><w:ind w:left="2640" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="4"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="2880" /></w:tabs><w:ind w:left="3360" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="5"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="3600" /></w:tabs><w:ind w:left="4080" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="6"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="4320" /></w:tabs><w:ind w:left="4800" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="7"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="5040" /></w:tabs><w:ind w:left="5520" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="8"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="5760" /></w:tabs><w:ind w:left="6240" w:hanging="480" /></w:pPr></w:lvl></w:abstractNum><w:num w:numId="1000"><w:abstractNumId w:val="990" /></w:num></w:numbering>
@@ -0,0 +1,37 @@+<?xml version="1.0" encoding="UTF-8"?>+<w:settings xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main">+ <w:zoom w:percent="100" />+ <w:embedSystemFonts />+ <w:proofState w:spelling="clean" w:grammar="clean" />+ <w:stylePaneFormatFilter w:val="0004" />+ <w:doNotTrackMoves />+ <w:defaultTabStop w:val="720" />+ <w:drawingGridHorizontalSpacing w:val="360" />+ <w:drawingGridVerticalSpacing w:val="360" />+ <w:displayHorizontalDrawingGridEvery w:val="0" />+ <w:displayVerticalDrawingGridEvery w:val="0" />+ <w:characterSpacingControl w:val="doNotCompress" />+ <w:savePreviewPicture />+ <w:footnotePr>+ <w:footnote w:id="-1" />+ <w:footnote w:id="0" />+ </w:footnotePr>+ <w:rsids>+ </w:rsids>+ <m:mathPr>+ <m:mathFont m:val="Cambria Math" />+ <m:brkBin m:val="before" />+ <m:brkBinSub m:val="--" />+ <m:smallFrac m:val="0" />+ <m:dispDef />+ <m:lMargin m:val="0" />+ <m:rMargin m:val="0" />+ <m:wrapRight />+ <m:intLim m:val="subSup" />+ <m:naryLim m:val="undOvr" />+ </m:mathPr>+ <w:themeFontLang w:val="en-US" />+ <w:clrSchemeMapping w:bg1="light1" w:t1="dark1" w:bg2="light2" w:t2="dark2" w:accent1="accent1" w:accent2="accent2" w:accent3="accent3" w:accent4="accent4" w:accent5="accent5" w:accent6="accent6" w:hyperlink="hyperlink" w:followedHyperlink="followedHyperlink" />+ <w:decimalSymbol w:val="." />+ <w:listSeparator w:val="," />+</w:settings>
@@ -0,0 +1,714 @@+<?xml version="1.0" encoding="UTF-8"?>+<w:styles xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">+ <w:docDefaults>+ <w:rPrDefault>+ <w:rPr>+ <w:rFonts w:asciiTheme="minorHAnsi" w:eastAsiaTheme="minorEastAsia" w:hAnsiTheme="minorHAnsi" w:cstheme="minorBidi" />+ <w:sz w:val="24" />+ <w:szCs w:val="24" />+ <w:lang w:val="en-US" w:eastAsia="zh-CN" w:bidi="ar-SA" />+ </w:rPr>+ </w:rPrDefault>+ <w:pPrDefault>+ <w:pPr>+ <w:spacing w:after="200" />+ </w:pPr>+ </w:pPrDefault>+ </w:docDefaults>+ <w:latentStyles w:defLockedState="0" w:defUIPriority="0" w:defSemiHidden="0" w:defUnhideWhenUsed="0" w:defQFormat="0" w:count="276" />+ <w:style w:type="paragraph" w:default="1" w:styleId="Normal">+ <w:name w:val="Normal" />+ <w:qFormat />+ </w:style>+ <w:style w:type="paragraph" w:styleId="BodyText">+ <w:name w:val="Body Text" />+ <w:basedOn w:val="Normal" />+ <w:link w:val="BodyTextChar" />+ <w:qFormat />+ <w:pPr>+ <w:spacing w:before="180" w:after="180" />+ </w:pPr>+ </w:style>+ <w:style w:type="paragraph" w:customStyle="1" w:styleId="FirstParagraph">+ <w:name w:val="First Paragraph" />+ <w:basedOn w:val="BodyText" />+ <w:next w:val="BodyText" />+ <w:qFormat />+ </w:style>+ <w:style w:type="paragraph" w:customStyle="1" w:styleId="Compact">+ <w:name w:val="Compact" />+ <w:basedOn w:val="BodyText" />+ <w:qFormat />+ <w:pPr>+ <w:spacing w:before="36" w:after="36" />+ </w:pPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="Title">+ <w:name w:val="Title" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="BodyText" />+ <w:link w:val="TitleChar" />+ <w:uiPriority w:val="10" />+ <w:qFormat />+ <w:rsid w:val="00A10FD9" />+ <w:pPr>+ <w:spacing w:after="80" w:line="240" w:lineRule="auto" />+ <w:contextualSpacing />+ <w:jc w:val="center" />+ </w:pPr>+ <w:rPr>+ <w:rFonts w:asciiTheme="majorHAnsi"+ w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi"+ w:cstheme="majorBidi" />+ <w:sz w:val="56" />+ <w:szCs w:val="56" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1"+ w:styleId="TitleChar">+ <w:name w:val="Title Char" />+ <w:basedOn w:val="DefaultParagraphFont" />+ <w:link w:val="Title" />+ <w:uiPriority w:val="10" />+ <w:rsid w:val="00A10FD9" />+ <w:rPr>+ <w:rFonts w:asciiTheme="majorHAnsi"+ w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi"+ w:cstheme="majorBidi" />+ <w:sz w:val="56" />+ <w:szCs w:val="56" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="Subtitle">+ <w:name w:val="Subtitle" />+ <w:basedOn w:val="Title" />+ <w:next w:val="BodyText" />+ <w:link w:val="SubtitleChar" />+ <w:uiPriority w:val="11" />+ <w:qFormat />+ <w:rsid w:val="00A10FD9" />+ <w:pPr>+ <w:numPr>+ <w:ilvl w:val="1" />+ </w:numPr>+ </w:pPr>+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:spacing w:val="15" />+ <w:sz w:val="28" />+ <w:szCs w:val="28" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1"+ w:styleId="SubtitleChar">+ <w:name w:val="Subtitle Char" />+ <w:basedOn w:val="DefaultParagraphFont" />+ <w:link w:val="Subtitle" />+ <w:uiPriority w:val="11" />+ <w:rsid w:val="00A10FD9" />+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:color w:val="595959" w:themeColor="text1"+ w:themeTint="A6" />+ <w:spacing w:val="15" />+ <w:sz w:val="28" />+ <w:szCs w:val="28" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:customStyle="1" w:styleId="Author">+ <w:name w:val="Author" />+ <w:basedOn w:val="Title" />+ <w:next w:val="BodyText" />+ <w:qFormat />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ </w:pPr>+ <w:rPr>+ <w:sz w:val="24" />+ <w:szCs w:val="24" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="Date">+ <w:name w:val="Date" />+ <w:basedOn w:val="Title" />+ <w:next w:val="BodyText" />+ <w:qFormat />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ </w:pPr>+ <w:rPr>+ <w:sz w:val="24" />+ <w:szCs w:val="24" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:customStyle="1" w:styleId="AbstractTitle">+ <w:name w:val="Abstract Title" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="Abstract" />+ <w:qFormat />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ <w:spacing w:before="300" w:after="0" />+ <w:jc w:val="center" />+ </w:pPr>+ <w:rPr>+ <w:b />+ <w:sz w:val="20" />+ <w:szCs w:val="20" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:customStyle="1" w:styleId="Abstract">+ <w:name w:val="Abstract" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="BodyText" />+ <w:qFormat />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ <w:spacing w:before="100" w:after="300" />+ </w:pPr>+ <w:rPr>+ <w:sz w:val="20" />+ <w:szCs w:val="20" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="Bibliography">+ <w:name w:val="Bibliography" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="Bibliography" />+ <w:qFormat />+ <w:pPr />+ <w:rPr />+ </w:style>+ <w:style w:type="paragraph" w:styleId="Heading1">+ <w:name w:val="heading 1" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="BodyText" />+ <w:link w:val="Heading1Char" />+ <w:uiPriority w:val="9" />+ <w:qFormat />+ <w:rsid w:val="00A10FD9" />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ <w:spacing w:before="360" w:after="80" />+ <w:outlineLvl w:val="0" />+ </w:pPr>+ <w:rPr>+ <w:rFonts w:asciiTheme="majorHAnsi"+ w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi"+ w:cstheme="majorBidi" />+ <w:color w:val="0F4761" w:themeColor="accent1"+ w:themeShade="BF" />+ <w:sz w:val="40" />+ <w:szCs w:val="40" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="Heading2">+ <w:name w:val="heading 2" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="BodyText" />+ <w:link w:val="Heading2Char" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:unhideWhenUsed />+ <w:qFormat />+ <w:rsid w:val="00A10FD9" />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ <w:spacing w:before="160" w:after="80" />+ <w:outlineLvl w:val="1" />+ </w:pPr>+ <w:rPr>+ <w:rFonts w:asciiTheme="majorHAnsi"+ w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi"+ w:cstheme="majorBidi" />+ <w:color w:val="0F4761" w:themeColor="accent1"+ w:themeShade="BF" />+ <w:sz w:val="32" />+ <w:szCs w:val="32" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="Heading3">+ <w:name w:val="heading 3" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="BodyText" />+ <w:link w:val="Heading3Char" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:unhideWhenUsed />+ <w:qFormat />+ <w:rsid w:val="00A10FD9" />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ <w:spacing w:before="160" w:after="80" />+ <w:outlineLvl w:val="2" />+ </w:pPr>+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:color w:val="0F4761" w:themeColor="accent1"+ w:themeShade="BF" />+ <w:sz w:val="28" />+ <w:szCs w:val="28" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="Heading4">+ <w:name w:val="heading 4" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="BodyText" />+ <w:link w:val="Heading4Char" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:unhideWhenUsed />+ <w:qFormat />+ <w:rsid w:val="00A10FD9" />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ <w:spacing w:before="80" w:after="40" />+ <w:outlineLvl w:val="3" />+ </w:pPr>+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:i />+ <w:iCs />+ <w:color w:val="0F4761" w:themeColor="accent1"+ w:themeShade="BF" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="Heading5">+ <w:name w:val="heading 5" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="BodyText" />+ <w:link w:val="Heading5Char" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:unhideWhenUsed />+ <w:qFormat />+ <w:rsid w:val="00A10FD9" />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ <w:spacing w:before="80" w:after="40" />+ <w:outlineLvl w:val="4" />+ </w:pPr>+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:color w:val="0F4761" w:themeColor="accent1"+ w:themeShade="BF" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="Heading6">+ <w:name w:val="heading 6" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="BodyText" />+ <w:link w:val="Heading6Char" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:unhideWhenUsed />+ <w:qFormat />+ <w:rsid w:val="00A10FD9" />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ <w:spacing w:before="40" w:after="0" />+ <w:outlineLvl w:val="5" />+ </w:pPr>+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:i />+ <w:iCs />+ <w:color w:val="595959" w:themeColor="text1"+ w:themeTint="A6" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="Heading7">+ <w:name w:val="heading 7" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="BodyText" />+ <w:link w:val="Heading7Char" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:unhideWhenUsed />+ <w:qFormat />+ <w:rsid w:val="00A10FD9" />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ <w:spacing w:before="40" w:after="0" />+ <w:outlineLvl w:val="6" />+ </w:pPr>+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:color w:val="595959" w:themeColor="text1"+ w:themeTint="A6" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="Heading8">+ <w:name w:val="heading 8" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="BodyText" />+ <w:link w:val="Heading8Char" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:unhideWhenUsed />+ <w:qFormat />+ <w:rsid w:val="00A10FD9" />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ <w:spacing w:after="0" />+ <w:outlineLvl w:val="7" />+ </w:pPr>+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:i />+ <w:iCs />+ <w:color w:val="272727" w:themeColor="text1"+ w:themeTint="D8" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="Heading9">+ <w:name w:val="heading 9" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="BodyText" />+ <w:link w:val="Heading9Char" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:unhideWhenUsed />+ <w:qFormat />+ <w:rsid w:val="00A10FD9" />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ <w:spacing w:after="0" />+ <w:outlineLvl w:val="8" />+ </w:pPr>+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:color w:val="272727" w:themeColor="text1"+ w:themeTint="D8" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1" w:styleId="Heading1Char">+ <w:name w:val="Heading 1 Char" />+ <w:basedOn w:val="DefaultParagraphFont" />+ <w:link w:val="Heading1" />+ <w:uiPriority w:val="9" />+ <w:rsid w:val="00A10FD9" />+ <w:rPr>+ <w:rFonts w:asciiTheme="majorHAnsi"+ w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi"+ w:cstheme="majorBidi" />+ <w:color w:val="0F4761" w:themeColor="accent1"+ w:themeShade="BF" />+ <w:sz w:val="40" />+ <w:szCs w:val="40" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1"+ w:styleId="Heading2Char">+ <w:name w:val="Heading 2 Char" />+ <w:basedOn w:val="DefaultParagraphFont" />+ <w:link w:val="Heading2" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:rsid w:val="00A10FD9" />+ <w:rPr>+ <w:rFonts w:asciiTheme="majorHAnsi"+ w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi"+ w:cstheme="majorBidi" />+ <w:color w:val="0F4761" w:themeColor="accent1"+ w:themeShade="BF" />+ <w:sz w:val="32" />+ <w:szCs w:val="32" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1"+ w:styleId="Heading3Char">+ <w:name w:val="Heading 3 Char" />+ <w:basedOn w:val="DefaultParagraphFont" />+ <w:link w:val="Heading3" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:rsid w:val="00A10FD9" />+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:color w:val="0F4761" w:themeColor="accent1"+ w:themeShade="BF" />+ <w:sz w:val="28" />+ <w:szCs w:val="28" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1"+ w:styleId="Heading4Char">+ <w:name w:val="Heading 4 Char" />+ <w:basedOn w:val="DefaultParagraphFont" />+ <w:link w:val="Heading4" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:rsid w:val="00A10FD9" />+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:i />+ <w:iCs />+ <w:color w:val="0F4761" w:themeColor="accent1"+ w:themeShade="BF" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1"+ w:styleId="Heading5Char">+ <w:name w:val="Heading 5 Char" />+ <w:basedOn w:val="DefaultParagraphFont" />+ <w:link w:val="Heading5" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:rsid w:val="00A10FD9" />+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:color w:val="0F4761" w:themeColor="accent1"+ w:themeShade="BF" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1"+ w:styleId="Heading6Char">+ <w:name w:val="Heading 6 Char" />+ <w:basedOn w:val="DefaultParagraphFont" />+ <w:link w:val="Heading6" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:rsid w:val="00A10FD9" />+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:i />+ <w:iCs />+ <w:color w:val="595959" w:themeColor="text1"+ w:themeTint="A6" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1"+ w:styleId="Heading7Char">+ <w:name w:val="Heading 7 Char" />+ <w:basedOn w:val="DefaultParagraphFont" />+ <w:link w:val="Heading7" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:rsid w:val="00A10FD9" />+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:color w:val="595959" w:themeColor="text1"+ w:themeTint="A6" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1"+ w:styleId="Heading8Char">+ <w:name w:val="Heading 8 Char" />+ <w:basedOn w:val="DefaultParagraphFont" />+ <w:link w:val="Heading8" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:rsid w:val="00A10FD9" />+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:i />+ <w:iCs />+ <w:color w:val="272727" w:themeColor="text1"+ w:themeTint="D8" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1"+ w:styleId="Heading9Char">+ <w:name w:val="Heading 9 Char" />+ <w:basedOn w:val="DefaultParagraphFont" />+ <w:link w:val="Heading9" />+ <w:uiPriority w:val="9" />+ <w:semiHidden />+ <w:rsid w:val="00A10FD9" />+ <w:rPr>+ <w:rFonts w:eastAsiaTheme="majorEastAsia"+ w:cstheme="majorBidi" />+ <w:color w:val="272727" w:themeColor="text1"+ w:themeTint="D8" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="BlockText">+ <w:name w:val="Block Text" />+ <w:basedOn w:val="BodyText" />+ <w:next w:val="BodyText" />+ <w:uiPriority w:val="9" />+ <w:unhideWhenUsed />+ <w:qFormat />+ <w:pPr>+ <w:spacing w:before="100" w:after="100" />+ <w:ind w:firstLine="0" w:left="480" w:right="480" />+ </w:pPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="FootnoteText">+ <w:name w:val="Footnote Text" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="FootnoteText" />+ <w:uiPriority w:val="9" />+ <w:unhideWhenUsed />+ <w:qFormat />+ </w:style>+ <w:style w:type="paragraph" w:styleId="FootnoteBlockText">+ <w:name w:val="Footnote Block Text" />+ <w:basedOn w:val="FootnoteText" />+ <w:next w:val="FootnoteText" />+ <w:uiPriority w:val="9" />+ <w:unhideWhenUsed />+ <w:qFormat />+ <w:pPr>+ <w:spacing w:before="100" w:after="100" />+ <w:ind w:firstLine="0" w:left="480" w:right="480" />+ </w:pPr>+ </w:style>+ <w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont">+ <w:name w:val="Default Paragraph Font" />+ <w:semiHidden />+ <w:unhideWhenUsed />+ </w:style>+ <w:style w:type="table" w:default="1" w:styleId="Table">+ <w:name w:val="Table" />+ <w:basedOn w:val="TableNormal" />+ <w:semiHidden />+ <w:unhideWhenUsed />+ <w:qFormat />+ <w:tblPr>+ <w:tblInd w:w="0" w:type="dxa" />+ <w:tblCellMar>+ <w:top w:w="0" w:type="dxa" />+ <w:left w:w="108" w:type="dxa" />+ <w:bottom w:w="0" w:type="dxa" />+ <w:right w:w="108" w:type="dxa" />+ </w:tblCellMar>+ </w:tblPr>+ <w:tblStylePr w:type="firstRow">+ <w:tcPr>+ <w:tcBorders>+ <w:bottom w:val="single"/>+ </w:tcBorders>+ <w:vAlign w:val="bottom"/>+ </w:tcPr>+ </w:tblStylePr>+ </w:style>+ <w:style w:type="paragraph" w:customStyle="1" w:styleId="DefinitionTerm">+ <w:name w:val="Definition Term" />+ <w:basedOn w:val="Normal" />+ <w:next w:val="Definition" />+ <w:pPr>+ <w:keepNext />+ <w:keepLines />+ <w:spacing w:after="0" />+ </w:pPr>+ <w:rPr>+ <w:b />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:customStyle="1" w:styleId="Definition">+ <w:name w:val="Definition" />+ <w:basedOn w:val="Normal" />+ </w:style>+ <w:style w:type="paragraph" w:styleId="Caption">+ <w:name w:val="Caption" />+ <w:basedOn w:val="Normal" />+ <w:link w:val="BodyTextChar" />+ <w:pPr>+ <w:spacing w:before="0" w:after="120" />+ </w:pPr>+ <w:rPr>+ <w:i />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:customStyle="1" w:styleId="TableCaption">+ <w:name w:val="Table Caption" />+ <w:basedOn w:val="Caption" />+ <w:pPr>+ <w:keepNext />+ </w:pPr>+ </w:style>+ <w:style w:type="paragraph" w:customStyle="1" w:styleId="ImageCaption">+ <w:name w:val="Image Caption" />+ <w:basedOn w:val="Caption" />+ </w:style>+ <w:style w:type="paragraph" w:customStyle="1" w:styleId="Figure">+ <w:name w:val="Figure" />+ <w:basedOn w:val="Normal" />+ </w:style>+ <w:style w:type="paragraph" w:customStyle="1" w:styleId="CaptionedFigure">+ <w:name w:val="Captioned Figure" />+ <w:basedOn w:val="Figure" />+ <w:pPr>+ <w:keepNext />+ </w:pPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1" w:styleId="BodyTextChar">+ <w:name w:val="Body Text Char" />+ <w:basedOn w:val="DefaultParagraphFont" />+ <w:link w:val="BodyText" />+ </w:style>+ <w:style w:type="character" w:customStyle="1" w:styleId="VerbatimChar">+ <w:name w:val="Verbatim Char" />+ <w:basedOn w:val="BodyTextChar" />+ <w:rPr>+ <w:rFonts w:ascii="Consolas" w:hAnsi="Consolas" />+ <w:sz w:val="22" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:customStyle="1" w:styleId="SectionNumber">+ <w:name w:val="Section Number" />+ <w:basedOn w:val="BodyTextChar" />+ </w:style>+ <w:style w:type="character" w:styleId="FootnoteReference">+ <w:name w:val="Footnote Reference" />+ <w:basedOn w:val="BodyTextChar" />+ <w:rPr>+ <w:vertAlign w:val="superscript" />+ </w:rPr>+ </w:style>+ <w:style w:type="character" w:styleId="Hyperlink">+ <w:name w:val="Hyperlink" />+ <w:basedOn w:val="BodyTextChar" />+ <w:rPr>+ <w:color w:val="4F81BD" w:themeColor="accent1" />+ </w:rPr>+ </w:style>+ <w:style w:type="paragraph" w:styleId="TOCHeading">+ <w:name w:val="TOC Heading" />+ <w:basedOn w:val="Heading1" />+ <w:next w:val="BodyText" />+ <w:uiPriority w:val="39" />+ <w:unhideWhenUsed />+ <w:qFormat />+ <w:pPr>+ <w:spacing w:before="240" w:line="259" w:lineRule="auto" />+ <w:outlineLvl w:val="9" />+ </w:pPr>+ <w:rPr>+ <w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi" />+ <w:b w:val="0" />+ <w:bCs w:val="0" />+ <w:color w:val="365F91" w:themeColor="accent1" w:themeShade="BF" />+ </w:rPr>+ </w:style>+</w:styles>
@@ -0,0 +1,293 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>+<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">+ <a:themeElements>+ <a:clrScheme name="Office">+ <a:dk1>+ <a:sysClr val="windowText" lastClr="000000"/>+ </a:dk1>+ <a:lt1>+ <a:sysClr val="window" lastClr="FFFFFF"/>+ </a:lt1>+ <a:dk2>+ <a:srgbClr val="0E2841"/>+ </a:dk2>+ <a:lt2>+ <a:srgbClr val="E8E8E8"/>+ </a:lt2>+ <a:accent1>+ <a:srgbClr val="156082"/>+ </a:accent1>+ <a:accent2>+ <a:srgbClr val="E97132"/>+ </a:accent2>+ <a:accent3>+ <a:srgbClr val="196B24"/>+ </a:accent3>+ <a:accent4>+ <a:srgbClr val="0F9ED5"/>+ </a:accent4>+ <a:accent5>+ <a:srgbClr val="A02B93"/>+ </a:accent5>+ <a:accent6>+ <a:srgbClr val="4EA72E"/>+ </a:accent6>+ <a:hlink>+ <a:srgbClr val="467886"/>+ </a:hlink>+ <a:folHlink>+ <a:srgbClr val="96607D"/>+ </a:folHlink>+ </a:clrScheme>+ <a:fontScheme name="Office">+ <a:majorFont>+ <a:latin typeface="Aptos Display" panose="02110004020202020204"/>+ <a:ea typeface=""/>+ <a:cs typeface=""/>+ <a:font script="Jpan" typeface="游ゴシック Light"/>+ <a:font script="Hang" typeface="맑은 고딕"/>+ <a:font script="Hans" typeface="等线 Light"/>+ <a:font script="Hant" typeface="新細明體"/>+ <a:font script="Arab" typeface="Times New Roman"/>+ <a:font script="Hebr" typeface="Times New Roman"/>+ <a:font script="Thai" typeface="Angsana New"/>+ <a:font script="Ethi" typeface="Nyala"/>+ <a:font script="Beng" typeface="Vrinda"/>+ <a:font script="Gujr" typeface="Shruti"/>+ <a:font script="Khmr" typeface="MoolBoran"/>+ <a:font script="Knda" typeface="Tunga"/>+ <a:font script="Guru" typeface="Raavi"/>+ <a:font script="Cans" typeface="Euphemia"/>+ <a:font script="Cher" typeface="Plantagenet Cherokee"/>+ <a:font script="Yiii" typeface="Microsoft Yi Baiti"/>+ <a:font script="Tibt" typeface="Microsoft Himalaya"/>+ <a:font script="Thaa" typeface="MV Boli"/>+ <a:font script="Deva" typeface="Mangal"/>+ <a:font script="Telu" typeface="Gautami"/>+ <a:font script="Taml" typeface="Latha"/>+ <a:font script="Syrc" typeface="Estrangelo Edessa"/>+ <a:font script="Orya" typeface="Kalinga"/>+ <a:font script="Mlym" typeface="Kartika"/>+ <a:font script="Laoo" typeface="DokChampa"/>+ <a:font script="Sinh" typeface="Iskoola Pota"/>+ <a:font script="Mong" typeface="Mongolian Baiti"/>+ <a:font script="Viet" typeface="Times New Roman"/>+ <a:font script="Uigh" typeface="Microsoft Uighur"/>+ <a:font script="Geor" typeface="Sylfaen"/>+ <a:font script="Armn" typeface="Arial"/>+ <a:font script="Bugi" typeface="Leelawadee UI"/>+ <a:font script="Bopo" typeface="Microsoft JhengHei"/>+ <a:font script="Java" typeface="Javanese Text"/>+ <a:font script="Lisu" typeface="Segoe UI"/>+ <a:font script="Mymr" typeface="Myanmar Text"/>+ <a:font script="Nkoo" typeface="Ebrima"/>+ <a:font script="Olck" typeface="Nirmala UI"/>+ <a:font script="Osma" typeface="Ebrima"/>+ <a:font script="Phag" typeface="Phagspa"/>+ <a:font script="Syrn" typeface="Estrangelo Edessa"/>+ <a:font script="Syrj" typeface="Estrangelo Edessa"/>+ <a:font script="Syre" typeface="Estrangelo Edessa"/>+ <a:font script="Sora" typeface="Nirmala UI"/>+ <a:font script="Tale" typeface="Microsoft Tai Le"/>+ <a:font script="Talu" typeface="Microsoft New Tai Lue"/>+ <a:font script="Tfng" typeface="Ebrima"/>+ </a:majorFont>+ <a:minorFont>+ <a:latin typeface="Aptos" panose="02110004020202020204"/>+ <a:ea typeface=""/>+ <a:cs typeface=""/>+ <a:font script="Jpan" typeface="游明朝"/>+ <a:font script="Hang" typeface="맑은 고딕"/>+ <a:font script="Hans" typeface="等线"/>+ <a:font script="Hant" typeface="新細明體"/>+ <a:font script="Arab" typeface="Arial"/>+ <a:font script="Hebr" typeface="Arial"/>+ <a:font script="Thai" typeface="Cordia New"/>+ <a:font script="Ethi" typeface="Nyala"/>+ <a:font script="Beng" typeface="Vrinda"/>+ <a:font script="Gujr" typeface="Shruti"/>+ <a:font script="Khmr" typeface="DaunPenh"/>+ <a:font script="Knda" typeface="Tunga"/>+ <a:font script="Guru" typeface="Raavi"/>+ <a:font script="Cans" typeface="Euphemia"/>+ <a:font script="Cher" typeface="Plantagenet Cherokee"/>+ <a:font script="Yiii" typeface="Microsoft Yi Baiti"/>+ <a:font script="Tibt" typeface="Microsoft Himalaya"/>+ <a:font script="Thaa" typeface="MV Boli"/>+ <a:font script="Deva" typeface="Mangal"/>+ <a:font script="Telu" typeface="Gautami"/>+ <a:font script="Taml" typeface="Latha"/>+ <a:font script="Syrc" typeface="Estrangelo Edessa"/>+ <a:font script="Orya" typeface="Kalinga"/>+ <a:font script="Mlym" typeface="Kartika"/>+ <a:font script="Laoo" typeface="DokChampa"/>+ <a:font script="Sinh" typeface="Iskoola Pota"/>+ <a:font script="Mong" typeface="Mongolian Baiti"/>+ <a:font script="Viet" typeface="Arial"/>+ <a:font script="Uigh" typeface="Microsoft Uighur"/>+ <a:font script="Geor" typeface="Sylfaen"/>+ <a:font script="Armn" typeface="Arial"/>+ <a:font script="Bugi" typeface="Leelawadee UI"/>+ <a:font script="Bopo" typeface="Microsoft JhengHei"/>+ <a:font script="Java" typeface="Javanese Text"/>+ <a:font script="Lisu" typeface="Segoe UI"/>+ <a:font script="Mymr" typeface="Myanmar Text"/>+ <a:font script="Nkoo" typeface="Ebrima"/>+ <a:font script="Olck" typeface="Nirmala UI"/>+ <a:font script="Osma" typeface="Ebrima"/>+ <a:font script="Phag" typeface="Phagspa"/>+ <a:font script="Syrn" typeface="Estrangelo Edessa"/>+ <a:font script="Syrj" typeface="Estrangelo Edessa"/>+ <a:font script="Syre" typeface="Estrangelo Edessa"/>+ <a:font script="Sora" typeface="Nirmala UI"/>+ <a:font script="Tale" typeface="Microsoft Tai Le"/>+ <a:font script="Talu" typeface="Microsoft New Tai Lue"/>+ <a:font script="Tfng" typeface="Ebrima"/>+ </a:minorFont>+ </a:fontScheme>+ <a:fmtScheme name="Office">+ <a:fillStyleLst>+ <a:solidFill>+ <a:schemeClr val="phClr"/>+ </a:solidFill>+ <a:gradFill rotWithShape="1">+ <a:gsLst>+ <a:gs pos="0">+ <a:schemeClr val="phClr">+ <a:lumMod val="110000"/>+ <a:satMod val="105000"/>+ <a:tint val="67000"/>+ </a:schemeClr>+ </a:gs>+ <a:gs pos="50000">+ <a:schemeClr val="phClr">+ <a:lumMod val="105000"/>+ <a:satMod val="103000"/>+ <a:tint val="73000"/>+ </a:schemeClr>+ </a:gs>+ <a:gs pos="100000">+ <a:schemeClr val="phClr">+ <a:lumMod val="105000"/>+ <a:satMod val="109000"/>+ <a:tint val="81000"/>+ </a:schemeClr>+ </a:gs>+ </a:gsLst>+ <a:lin ang="5400000" scaled="0"/>+ </a:gradFill>+ <a:gradFill rotWithShape="1">+ <a:gsLst>+ <a:gs pos="0">+ <a:schemeClr val="phClr">+ <a:satMod val="103000"/>+ <a:lumMod val="102000"/>+ <a:tint val="94000"/>+ </a:schemeClr>+ </a:gs>+ <a:gs pos="50000">+ <a:schemeClr val="phClr">+ <a:satMod val="110000"/>+ <a:lumMod val="100000"/>+ <a:shade val="100000"/>+ </a:schemeClr>+ </a:gs>+ <a:gs pos="100000">+ <a:schemeClr val="phClr">+ <a:lumMod val="99000"/>+ <a:satMod val="120000"/>+ <a:shade val="78000"/>+ </a:schemeClr>+ </a:gs>+ </a:gsLst>+ <a:lin ang="5400000" scaled="0"/>+ </a:gradFill>+ </a:fillStyleLst>+ <a:lnStyleLst>+ <a:ln w="6350" cap="flat" cmpd="sng" algn="ctr">+ <a:solidFill>+ <a:schemeClr val="phClr"/>+ </a:solidFill>+ <a:prstDash val="solid"/>+ <a:miter lim="800000"/>+ </a:ln>+ <a:ln w="12700" cap="flat" cmpd="sng" algn="ctr">+ <a:solidFill>+ <a:schemeClr val="phClr"/>+ </a:solidFill>+ <a:prstDash val="solid"/>+ <a:miter lim="800000"/>+ </a:ln>+ <a:ln w="19050" cap="flat" cmpd="sng" algn="ctr">+ <a:solidFill>+ <a:schemeClr val="phClr"/>+ </a:solidFill>+ <a:prstDash val="solid"/>+ <a:miter lim="800000"/>+ </a:ln>+ </a:lnStyleLst>+ <a:effectStyleLst>+ <a:effectStyle>+ <a:effectLst/>+ </a:effectStyle>+ <a:effectStyle>+ <a:effectLst/>+ </a:effectStyle>+ <a:effectStyle>+ <a:effectLst>+ <a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0">+ <a:srgbClr val="000000">+ <a:alpha val="63000"/>+ </a:srgbClr>+ </a:outerShdw>+ </a:effectLst>+ </a:effectStyle>+ </a:effectStyleLst>+ <a:bgFillStyleLst>+ <a:solidFill>+ <a:schemeClr val="phClr"/>+ </a:solidFill>+ <a:solidFill>+ <a:schemeClr val="phClr">+ <a:tint val="95000"/>+ <a:satMod val="170000"/>+ </a:schemeClr>+ </a:solidFill>+ <a:gradFill rotWithShape="1">+ <a:gsLst>+ <a:gs pos="0">+ <a:schemeClr val="phClr">+ <a:tint val="93000"/>+ <a:satMod val="150000"/>+ <a:shade val="98000"/>+ <a:lumMod val="102000"/>+ </a:schemeClr>+ </a:gs>+ <a:gs pos="50000">+ <a:schemeClr val="phClr">+ <a:tint val="98000"/>+ <a:satMod val="130000"/>+ <a:shade val="90000"/>+ <a:lumMod val="103000"/>+ </a:schemeClr>+ </a:gs>+ <a:gs pos="100000">+ <a:schemeClr val="phClr">+ <a:shade val="63000"/>+ <a:satMod val="120000"/>+ </a:schemeClr>+ </a:gs>+ </a:gsLst>+ <a:lin ang="5400000" scaled="0"/>+ </a:gradFill>+ </a:bgFillStyleLst>+ </a:fmtScheme>+ </a:themeElements>+ <a:objectDefaults/>+ <a:extraClrSchemeLst/>+ <a:extLst>+ <a:ext uri="{05A4C25C-085E-4340-85A3-A5531E510DB2}">+ <thm15:themeFamily xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main" name="Office Theme" id="{2E142A2C-CD16-42D6-873A-C26D2A0506FA}" vid="{1BDDFF52-6CD6-40A5-AB3C-68EB2F1E4D0A}"/>+ </a:ext>+ </a:extLst>+</a:theme>
@@ -0,0 +1,5 @@+<?xml version="1.0" encoding="UTF-8"?>+<ns0:webSettings xmlns:ns0="http://schemas.openxmlformats.org/wordprocessingml/2006/main">+ <ns0:allowPNG />+ <ns0:doNotSaveAsSingleFile />+</ns0:webSettings>
@@ -23,14 +23,23 @@ <li>Item 1 <li>Item 2 <li>Item 3+ <ul class="incremental">+ <li> Item 3.1+ <li> Item 3.2+ </ul> </ul>- <details>Some notes. They are only visible using onstage shell.</details>+ <div role="note">Some notes. They are only visible using onstage shell.</div> </section> <section>- <q>+ <blockquote> Who's brave enough to fly into something we all keep calling a death sphere?- </q>+ </blockquote>+ <details>+ <p>In the onstage shell, notes scroll rather than overflow:</p>+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac dui eu est feugiat lacinia sit amet nec leo. Mauris eu ipsum leo. Nulla mi odio, cursus sed sollicitudin non, fringilla id magna. Suspendisse sit amet posuere elit. Maecenas iaculis, turpis a placerat imperdiet, libero lorem feugiat nisi, nec tincidunt diam nibh sit amet massa. Vestibulum quis adipiscing tellus. Maecenas sollicitudin sodales pulvinar. Donec dui ipsum, bibendum facilisis consequat interdum, tempus ut mauris. Aliquam ut dolor nec odio scelerisque bibendum quis in neque. Aliquam dui dui, pulvinar quis fermentum quis, gravida eu augue. Nunc tristique dolor a urna pulvinar bibendum. Curabitur mollis cursus neque, in scelerisque metus porta non. Donec tempor enim in nibh vestibulum et convallis nisi malesuada. Duis ut lectus sed metus venenatis porttitor id pharetra quam. Suspendisse sapien turpis, ornare in molestie et, gravida eget turpis.+ </p>+ </details> </section> <section>@@ -42,7 +51,7 @@ <img src="http://placekitten.com/g/800/600"> <figcaption>An image</figcaption> </figure>- <details>Kittens are so cute!</details>+ <div role="note">Kittens are so cute!</div> </section> <section>@@ -63,14 +72,28 @@ <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet'> <style>- html { background-color: black; }- body { background-color: white; border-radius: 12px}+ html, .view body { background-color: black; counter-reset: slideidx; }+ body, .view section { background-color: white; border-radius: 12px } /* A section is a slide. It's size is 800x600, and this will never change */- section {+ section, .view head > title { /* The font from Google */ font-family: 'Oswald', arial, serif; font-size: 30px; }++ .view section:after {+ counter-increment: slideidx;+ content: counter(slideidx, decimal-leading-zero);+ position: absolute; bottom: -80px; right: 100px;+ color: white;+ }++ .view head > title {+ color: white;+ text-align: center;+ margin: 1em 0 1em 0;+ }+ h1, h2 { margin-top: 200px; text-align: center;@@ -83,27 +106,42 @@ ul { margin: 50px 200px; }+ li > ul {+ margin: 15px 50px;+ } p { margin: 75px; font-size: 50px; } - q {- display: block;- width: 100%;+ blockquote { height: 100%; background-color: black; color: white; font-size: 60px; padding: 50px; }+ blockquote:before {+ content: open-quote;+ }+ blockquote:after {+ content: close-quote;+ } /* Figures are displayed full-page, with the caption on top of the image/video */ figure { background-color: black;+ width: 100%;+ height: 100%; }+ figure > * {+ position: absolute;+ }+ figure > img, figure > video {+ width: 100%; height: 100%;+ } figcaption { margin: 70px; font-size: 50px;@@ -125,12 +163,22 @@ https://developer.mozilla.org/en/CSS/CSS_transitions How to use CSS3 Transitions: */ section {- -moz-transition: left 400ms linear 0s;- -webkit-transition: left 400ms linear 0s;- -ms-transition: left 400ms linear 0s;- transition: left 400ms linear 0s;+ -moz-transition: left 400ms linear 0s;+ -webkit-transition: left 400ms linear 0s;+ -ms-transition: left 400ms linear 0s;+ transition: left 400ms linear 0s; }+ .view section {+ -moz-transition: none;+ -webkit-transition: none;+ -ms-transition: none;+ transition: none;+ } + .view section[aria-selected] {+ border: 5px red solid;+ }+ /* Before */ section { left: -150%; } /* Now */@@ -176,21 +224,50 @@ <!-- Default Style --> <style> * { margin: 0; padding: 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }- details { display: none; }+ [role="note"] { display: none; } body { width: 800px; height: 600px; margin-left: -400px; margin-top: -300px; position: absolute; top: 50%; left: 50%; overflow: hidden;+ display: none; }+ .view body {+ position: static;+ margin: 0; padding: 0;+ width: 100%; height: 100%;+ display: inline-block;+ overflow: visible; overflow-x: hidden;+ /* undo Dz.onresize */+ transform: none !important;+ -moz-transform: none !important;+ -webkit-transform: none !important;+ -o-transform: none !important;+ -ms-transform: none !important;+ }+ .view head, .view head > title { display: block } section { position: absolute; pointer-events: none; width: 100%; height: 100%; }+ .view section {+ pointer-events: auto;+ position: static;+ width: 800px; height: 600px;+ margin: -150px -200px;+ float: left;++ transform: scale(.4);+ -moz-transform: scale(.4);+ -webkit-transform: scale(.4);+ -o-transform: scale(.4);+ -ms-transform: scale(.4);+ }+ .view section > * { pointer-events: none; } section[aria-selected] { pointer-events: auto; } html { overflow: hidden; }- body { display: none; }+ html.view { overflow: visible; } body.loaded { display: block; } .incremental {visibility: hidden; } .incremental[active] {visibility: visible; }@@ -202,15 +279,8 @@ -ms-transition: width 400ms linear 0s; transition: width 400ms linear 0s; }- figure {- width: 100%;- height: 100%;- }- figure > * {- position: absolute;- }- figure > img, figure > video {- width: 100%; height: 100%;+ .view #progress-bar {+ display: none; } </style> @@ -219,6 +289,7 @@ remoteWindows: [], idx: -1, step: 0,+ html: null, slides: null, progressBar : null, params: {@@ -228,14 +299,16 @@ Dz.init = function() { document.body.className = "loaded";- this.slides = $$("body > section");+ this.slides = Array.prototype.slice.call($$("body > section")); this.progressBar = $("#progress-bar");+ this.html = document.body.parentNode; this.setupParams(); this.onhashchange(); this.setupTouchEvents(); this.onresize();+ this.setupView(); }- + Dz.setupParams = function() { var p = window.location.search.substr(1).split('&'); p.forEach(function(e, i, a) {@@ -285,6 +358,10 @@ aEvent.preventDefault(); this.goFullscreen(); }+ if (aEvent.keyCode == 79) { // o+ aEvent.preventDefault();+ this.toggleView();+ } } /* Touch Events */@@ -318,6 +395,16 @@ } } + Dz.setupView = function() {+ document.body.addEventListener("click", function ( e ) {+ if (!Dz.html.classList.contains("view")) return;+ if (!e.target || e.target.nodeName != "SECTION") return;++ Dz.html.classList.remove("view");+ Dz.setCursor(Dz.slides.indexOf(e.target) + 1);+ }, false);+ }+ /* Adapt the size of the slides to the window */ Dz.onresize = function() {@@ -334,9 +421,9 @@ } - Dz.getDetails = function(aIdx) {+ Dz.getNotes = function(aIdx) { var s = $("section:nth-of-type(" + aIdx + ")");- var d = s.$("details");+ var d = s.$("[role='note']"); return d ? d.innerHTML : ""; } @@ -365,7 +452,7 @@ if (argv[0] === "GET_CURSOR" && argc === 1) this.postMsg(win, "CURSOR", this.idx + "." + this.step); if (argv[0] === "GET_NOTES" && argc === 1)- this.postMsg(win, "NOTES", this.getDetails(this.idx));+ this.postMsg(win, "NOTES", this.getNotes(this.idx)); } Dz.toggleContent = function() {@@ -449,6 +536,14 @@ this.setCursor(lastIdx, lastStep); } + Dz.toggleView = function() {+ this.html.classList.toggle("view");++ if (this.html.classList.contains("view")) {+ $("section[aria-selected]").scrollIntoView(true);+ }+ }+ Dz.setSlide = function(aIdx) { this.idx = aIdx; var old = $("section[aria-selected]");@@ -462,6 +557,9 @@ } if (next) { next.setAttribute("aria-selected", "true");+ if (this.html.classList.contains("view")) {+ next.scrollIntoView();+ } var video = next.$("video"); if (video && !!+this.params.autoplay) { video.play();
@@ -1,14 +1,217 @@ /* This defines styles and classes used in the book */-body { margin: 5%; text-align: justify; font-size: medium; }-code { font-family: monospace; }-h1 { text-align: left; }-h2 { text-align: left; }-h3 { text-align: left; }-h4 { text-align: left; }-h5 { text-align: left; }-h6 { text-align: left; }+@page {+ margin: 10px;+}+html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p,+blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img,+ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center,+fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td,+article, aside, canvas, details, embed, figure, figcaption, footer, header,+hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video, ol,+ul, li, dl, dt, dd {+ margin: 0;+ padding: 0;+ border: 0;+ font-size: 100%;+ vertical-align: baseline;+}+html {+ line-height: 1.2;+ font-family: Georgia, serif;+ color: #1a1a1a;+}+p {+ text-indent: 0;+ margin: 1em 0;+ widows: 2;+ orphans: 2;+}+img {+ max-width: 100%;+}+sup {+ vertical-align: super;+ font-size: smaller;+}+sub {+ vertical-align: sub;+ font-size: smaller;+}+h1 {+ margin: 3em 0 0 0;+ font-size: 2em;+ page-break-before: always;+ line-height: 150%;+}+h2 {+ margin: 1.5em 0 0 0;+ font-size: 1.5em;+ line-height: 135%;+}+h3 {+ margin: 1.3em 0 0 0;+ font-size: 1.3em;+}+h4 {+ margin: 1.2em 0 0 0;+ font-size: 1.2em;+}+h5 {+ margin: 1.1em 0 0 0;+ font-size: 1.1em;+}+h6 {+ font-size: 1em;+}+h1, h2, h3, h4, h5, h6 {+ text-indent: 0;+ text-align: left;+ font-weight: bold;+ page-break-after: avoid;+ page-break-inside: avoid;+}++ol, ul {+ margin: 1em 0 0 1.7em;+}+li > ol, li > ul {+ margin-top: 0;+}+blockquote {+ margin: 1em 0 1em 1.7em;+}+code {+ font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace;+ font-size: 85%;+ margin: 0;+ hyphens: manual;+}+pre {+ margin: 1em 0;+ overflow: auto;+}+pre code {+ padding: 0;+ overflow: visible;+ overflow-wrap: normal;+}+.sourceCode {+ background-color: transparent;+ overflow: visible;+}+hr {+ background-color: #1a1a1a;+ border: none;+ height: 1px;+ margin: 1em 0;+}+table {+ margin: 1em 0;+ border-collapse: collapse;+ width: 100%;+ overflow-x: auto;+ display: block;+}+table caption {+ margin-bottom: 0.75em;+}+tbody {+ margin-top: 0.5em;+ border-top: 1px solid #1a1a1a;+ border-bottom: 1px solid #1a1a1a;+}+th, td {+ padding: 0.25em 0.5em 0.25em 0.5em;+}+th {+ border-top: 1px solid #1a1a1a;+}+header {+ margin-bottom: 4em;+ text-align: center;+}+#TOC li {+ list-style: none;+}+#TOC ul {+ padding-left: 1.3em;+}+#TOC > ul {+ padding-left: 0;+}+#TOC a:not(:hover) {+ text-decoration: none;+}+code {+ white-space: pre-wrap;+}+span.smallcaps {+ font-variant: small-caps;+}++/* This is the most compatible CSS, but it only allows two columns: */+div.column {+ display: inline-block;+ vertical-align: top;+ width: 50%;+}+/* If you can rely on CSS3 support, use this instead: */+/* div.columns {+ display: flex;+ gap: min(4vw, 1.5em);+}+div.column {+ flex: auto;+ overflow-x: auto;+} */++div.hanging-indent {+ margin-left: 1.5em;+ text-indent: -1.5em;+}+ul.task-list {+ list-style: none;+}+ul.task-list li input[type="checkbox"] {+ width: 0.8em;+ margin: 0 0.8em 0.2em -1.6em;+ vertical-align: middle;+}+.display.math {+ display: block;+ text-align: center;+ margin: 0.5rem auto;+}++/* For title, author, and date on the cover page */ h1.title { }-h2.author { }-h3.date { }-ol.toc { padding: 0; margin-left: 1em; }-ol.toc li { list-style-type: none; margin: 0; padding: 0; }+p.author { }+p.date { }++nav#toc ol, nav#landmarks ol {+ padding: 0;+ margin-left: 1em;+}+nav#toc ol li, nav#landmarks ol li {+ list-style-type: none;+ margin: 0;+ padding: 0;+}+a.footnote-ref {+ vertical-align: super;+}+em, em em em, em em em em em {+ font-style: italic;+}+em em, em em em em {+ font-style: normal;+}+q {+ quotes: "“" "”" "‘" "’";+}+@media screen { /* Workaround for iBooks issue; see #6242 */+ .sourceCode {+ overflow: visible !important;+ white-space: pre-wrap !important;+ }+}
@@ -0,0 +1,3 @@+-- This Lua script is run every time the Lua interpreter is started when running+-- a Lua filter. It can be customized to load additional modules or to alter the+-- default modules.
@@ -0,0 +1,8 @@+<?xml version="1.0" encoding="UTF-8"?>+<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.3">+ <manifest:file-entry manifest:full-path="/" manifest:version="1.3" manifest:media-type="application/vnd.oasis.opendocument.text"/>+ <manifest:file-entry manifest:full-path="meta.xml" manifest:media-type="text/xml"/>+ <manifest:file-entry manifest:full-path="content.xml" manifest:media-type="text/xml"/>+ <manifest:file-entry manifest:full-path="manifest.rdf" manifest:media-type="application/rdf+xml"/>+ <manifest:file-entry manifest:full-path="styles.xml" manifest:media-type="text/xml"/>+</manifest:manifest>
@@ -0,0 +1,82 @@+<?xml version="1.0" encoding="UTF-8"?>+<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.3">+ <office:scripts/>+ <office:font-face-decls>+ <style:font-face style:name="StarSymbol" svg:font-family="StarSymbol"/>+ <style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/>+ <style:font-face style:name="Courier New" svg:font-family="'Courier New'" style:font-family-generic="modern" style:font-pitch="fixed"/>+ <style:font-face style:name="Times New Roman" svg:font-family="'Times New Roman'" style:font-family-generic="roman" style:font-pitch="variable"/>+ <style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/>+ <style:font-face style:name="Lucida Sans Unicode" svg:font-family="'Lucida Sans Unicode'" style:font-family-generic="system" style:font-pitch="variable"/>+ <style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-family-generic="system" style:font-pitch="variable"/>+ </office:font-face-decls>+ <office:automatic-styles>+ <style:style style:name="DemoTable" style:family="table">+ <style:table-properties style:width="6in" table:align="margins"/>+ </style:style>+ <style:style style:name="DemoTable.A" style:family="table-column">+ <style:table-column-properties style:column-width="3in"/>+ </style:style>+ </office:automatic-styles>+ <office:body>+ <office:text>+ <text:sequence-decls>+ <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>+ <text:sequence-decl text:display-outline-level="0" text:name="Table"/>+ <text:sequence-decl text:display-outline-level="0" text:name="Text"/>+ <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>+ </text:sequence-decls>+ <text:p text:style-name="Title">Title</text:p>+ <text:p text:style-name="Subtitle">Subtitle</text:p>+ <text:p text:style-name="Author">Author</text:p>+ <text:p text:style-name="Date">Date</text:p>+ <text:p text:style-name="Abstract">Abstract.</text:p>+ <text:h text:style-name="Heading_20_1" text:outline-level="1">Heading 1</text:h>+ <text:h text:style-name="Heading_20_2" text:outline-level="2">Heading 2</text:h>+ <text:h text:style-name="Heading_20_3" text:outline-level="3">Heading 3</text:h>+ <text:h text:style-name="Heading_20_4" text:outline-level="4">Heading 4</text:h>+ <text:h text:style-name="Heading_20_5" text:outline-level="5">Heading 5</text:h>+ <text:h text:style-name="Heading_20_6" text:outline-level="6">Heading 6</text:h>+ <text:p text:style-name="First_20_paragraph">First Paragraph.</text:p>+ <text:p text:style-name="Text_20_body">Body Text. <text:span text:style-name="Emphasis">Emphasis</text:span>. <text:span text:style-name="Strong_20_Emphasis">Strong Emphasis</text:span>. <text:span text:style-name="Strikeout">Strikeout</text:span>. <text:span text:style-name="Superscript">Superscript</text:span>. <text:span text:style-name="Subscript">Subscript</text:span>. <text:span text:style-name="Source_20_Text">Source Text</text:span>. <text:span text:style-name="Highlighted">Highlighted</text:span>. <text:a xlink:type="simple" xlink:href="https://pandoc.org"><text:span text:style-name="Definition">Hyperlink</text:span></text:a>. Footnote.<text:note text:id="ftn1" text:note-class="footnote"><text:note-citation>1</text:note-citation><text:note-body><text:p text:style-name="Footnote">Footnote text.</text:p></text:note-body></text:note></text:p>+ <text:p text:style-name="Quotations">Block quote.</text:p>+ <text:p text:style-name="Preformatted_20_Text">Preformatted Text.</text:p>+ <text:list text:style-name="List_20_1">+ <text:list-item>+ <text:p text:style-name="List_20_Bullet">Bullet list item.</text:p>+ </text:list-item>+ </text:list>+ <text:list text:style-name="Numbering_20_1">+ <text:list-item>+ <text:p text:style-name="List_20_Number">Numbered list item.</text:p>+ </text:list-item>+ </text:list>+ <text:p text:style-name="TableCaption">Table caption.</text:p>+ <table:table table:name="DemoTable" table:style-name="DemoTable">+ <table:table-column table:style-name="DemoTable.A"/>+ <table:table-column table:style-name="DemoTable.A"/>+ <table:table-header-rows>+ <table:table-row>+ <table:table-cell office:value-type="string">+ <text:p text:style-name="Table_20_Heading">Table Heading</text:p>+ </table:table-cell>+ <table:table-cell office:value-type="string">+ <text:p text:style-name="Table_20_Heading">Table Heading</text:p>+ </table:table-cell>+ </table:table-row>+ </table:table-header-rows>+ <table:table-row>+ <table:table-cell office:value-type="string">+ <text:p text:style-name="Table_20_Contents">Table Contents</text:p>+ </table:table-cell>+ <table:table-cell office:value-type="string">+ <text:p text:style-name="Table_20_Contents">Table Contents</text:p>+ </table:table-cell>+ </table:table-row>+ </table:table>+ <text:p text:style-name="FigureCaption">Image caption.</text:p>+ <text:p text:style-name="Definition_20_Term">Definition Term</text:p>+ <text:p text:style-name="Definition_20_Definition">Definition.</text:p>+ </office:text>+ </office:body>+</office:document-content>
@@ -0,0 +1,18 @@+<?xml version="1.0" encoding="utf-8"?>+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">+ <rdf:Description rdf:about="styles.xml">+ <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/odf#StylesFile"/>+ </rdf:Description>+ <rdf:Description rdf:about="">+ <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="styles.xml"/>+ </rdf:Description>+ <rdf:Description rdf:about="content.xml">+ <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/odf#ContentFile"/>+ </rdf:Description>+ <rdf:Description rdf:about="">+ <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="content.xml"/>+ </rdf:Description>+ <rdf:Description rdf:about="">+ <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#Document"/>+ </rdf:Description>+</rdf:RDF>
@@ -0,0 +1,18 @@+<?xml version="1.0" encoding="UTF-8"?>+<office:document-meta+ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"+ xmlns:xlink="http://www.w3.org/1999/xlink"+ xmlns:dc="http://purl.org/dc/elements/1.1/"+ xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"+ xmlns:ooo="http://openoffice.org/2004/office"+ xmlns:grddl="http://www.w3.org/2003/g/data-view#"+ office:version="1.3">+ <office:meta>+ <meta:document-statistic+ meta:table-count="0" meta:image-count="0" meta:object-count="0"+ meta:page-count="1" meta:paragraph-count="2" meta:word-count="3"+ meta:character-count="14"+ meta:non-whitespace-character-count="12"/>+ <meta:generator>Pandoc</meta:generator>+ </office:meta>+</office:document-meta>
@@ -0,0 +1,1 @@+application/vnd.oasis.opendocument.text
@@ -0,0 +1,1171 @@+<?xml version="1.0" encoding="utf-8"?>+<office:document-styles xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"+xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"+xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"+xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"+xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"+xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"+xmlns:xlink="http://www.w3.org/1999/xlink"+xmlns:dc="http://purl.org/dc/elements/1.1/"+xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"+xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"+xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"+xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"+xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"+xmlns:math="http://www.w3.org/1998/Math/MathML"+xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"+xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"+xmlns:ooo="http://openoffice.org/2004/office"+xmlns:ooow="http://openoffice.org/2004/writer"+xmlns:oooc="http://openoffice.org/2004/calc"+xmlns:dom="http://www.w3.org/2001/xml-events"+xmlns:rpt="http://openoffice.org/2005/report"+xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"+xmlns:xhtml="http://www.w3.org/1999/xhtml"+xmlns:grddl="http://www.w3.org/2003/g/data-view#"+xmlns:officeooo="http://openoffice.org/2009/office"+xmlns:tableooo="http://openoffice.org/2009/table"+xmlns:drawooo="http://openoffice.org/2010/draw"+xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"+xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.3">+ <office:font-face-decls>+ <style:font-face style:name="StarSymbol"+ svg:font-family="StarSymbol" />+ <style:font-face style:name="Tahoma1"+ svg:font-family="Tahoma" />+ <style:font-face style:name="Courier New"+ svg:font-family="'Courier New'"+ style:font-family-generic="modern" style:font-pitch="fixed" />+ <style:font-face style:name="Times New Roman"+ svg:font-family="'Times New Roman'"+ style:font-family-generic="roman"+ style:font-pitch="variable" />+ <style:font-face style:name="Arial" svg:font-family="Arial"+ style:font-family-generic="swiss"+ style:font-pitch="variable" />+ <style:font-face style:name="Lucida Sans Unicode"+ svg:font-family="'Lucida Sans Unicode'"+ style:font-family-generic="system"+ style:font-pitch="variable" />+ <style:font-face style:name="Tahoma" svg:font-family="Tahoma"+ style:font-family-generic="system"+ style:font-pitch="variable" />+ </office:font-face-decls>+ <office:styles>+ <style:default-style style:family="graphic">+ <style:graphic-properties fo:wrap-option="wrap"+ draw:shadow-offset-x="0.1181in"+ draw:shadow-offset-y="0.1181in"+ draw:start-line-spacing-horizontal="0.1114in"+ draw:start-line-spacing-vertical="0.1114in"+ draw:end-line-spacing-horizontal="0.1114in"+ draw:end-line-spacing-vertical="0.1114in"+ style:flow-with-text="false" />+ <style:paragraph-properties style:text-autospace="ideograph-alpha"+ style:line-break="strict" style:writing-mode="lr-tb"+ style:font-independent-line-spacing="false">+ <style:tab-stops />+ </style:paragraph-properties>+ <style:text-properties style:use-window-font-color="true"+ fo:font-size="12pt" fo:language="en" fo:country="US"+ style:letter-kerning="true" style:font-size-asian="12pt"+ style:language-asian="zxx" style:country-asian="none"+ style:font-size-complex="12pt" style:language-complex="zxx"+ style:country-complex="none" />+ </style:default-style>+ <style:style style:name="Title" style:family="paragraph"+ style:parent-style-name="Heading" style:next-style-name="Subtitle"+ style:class="chapter">+ <style:paragraph-properties fo:text-align="center"+ style:justify-single-word="false" fo:margin-top="0in"+ fo:margin-bottom="0.0835in" style:contextual-spacing="false" />+ <style:text-properties fo:font-size="28pt" fo:font-weight="bold"+ style:font-size-asian="28pt" style:font-weight-asian="bold"+ style:font-size-complex="28pt" style:font-weight-complex="bold" />+ </style:style>+ <style:style style:name="Subtitle" style:family="paragraph"+ style:parent-style-name="Heading" style:next-style-name="Text_20_body"+ style:class="chapter">+ <style:paragraph-properties fo:text-align="center"+ style:justify-single-word="false" fo:margin-top="0.0835in"+ fo:margin-bottom="0.0835in" style:contextual-spacing="false" />+ <style:text-properties fo:font-size="18pt" fo:font-style="italic"+ style:font-size-asian="18pt" style:font-style-asian="italic"+ style:font-size-complex="18pt" style:font-style-complex="italic" />+ </style:style>+ <style:style style:name="Author" style:family="paragraph"+ style:parent-style-name="Standard" style:class="html">+ <style:paragraph-properties fo:text-align="center" />+ </style:style>+ <style:style style:name="Date" style:family="paragraph"+ style:parent-style-name="Standard" style:class="html">+ <style:paragraph-properties fo:text-align="center" />+ </style:style>+ <style:style style:name="Abstract" style:family="paragraph"+ style:parent-style-name="Standard" style:class="html">+ <style:paragraph-properties fo:margin-left="0.3937in"+ fo:margin-right="0.3937in" fo:margin-top="0.1in"+ fo:margin-bottom="0.1in" style:contextual-spacing="false"+ fo:text-indent="0in" style:auto-text-indent="false" />+ </style:style>+ <style:default-style style:family="paragraph">+ <style:paragraph-properties fo:hyphenation-ladder-count="no-limit"+ style:text-autospace="ideograph-alpha"+ style:punctuation-wrap="hanging" style:line-break="strict"+ style:tab-stop-distance="0.4925in"+ style:writing-mode="page" />+ <style:text-properties style:use-window-font-color="true"+ style:font-name="Times New Roman" fo:font-size="12pt"+ fo:language="en" fo:country="US" style:letter-kerning="true"+ style:font-name-asian="Lucida Sans Unicode"+ style:font-size-asian="12pt" style:language-asian="zxx"+ style:country-asian="none" style:font-name-complex="Tahoma"+ style:font-size-complex="12pt" style:language-complex="zxx"+ style:country-complex="none" fo:hyphenate="false"+ fo:hyphenation-remain-char-count="2"+ fo:hyphenation-push-char-count="2" />+ </style:default-style>+ <style:default-style style:family="table">+ <style:table-properties table:border-model="collapsing" />+ </style:default-style>+ <style:default-style style:family="table-row">+ <style:table-row-properties fo:keep-together="auto" />+ </style:default-style>+ <style:style style:name="Standard" style:family="paragraph"+ style:class="text" />+ <style:style style:name="Heading" style:family="paragraph"+ style:parent-style-name="Standard"+ style:next-style-name="Text_20_body" style:class="text">+ <style:paragraph-properties fo:margin-top="0.1665in"+ fo:margin-bottom="0.0835in" style:contextual-spacing="false"+ fo:keep-with-next="always" />+ <style:text-properties style:font-name="Arial"+ fo:font-size="14pt"+ style:font-name-asian="Lucida Sans Unicode"+ style:font-size-asian="14pt" style:font-name-complex="Tahoma"+ style:font-size-complex="14pt" />+ </style:style>+ <style:style style:name="Text_20_body"+ style:display-name="Text body" style:family="paragraph"+ style:parent-style-name="Standard" style:class="text">+ <style:paragraph-properties fo:margin-top="0.0598in"+ fo:margin-bottom="0.0598in"+ style:contextual-spacing="false" />+ </style:style>+ <style:style style:name="List" style:family="paragraph"+ style:parent-style-name="Text_20_body" style:class="list">+ <style:text-properties style:font-name-complex="Tahoma1" />+ </style:style>+ <style:style style:name="List_20_Bullet"+ style:display-name="List Bullet" style:family="paragraph"+ style:parent-style-name="List" style:class="list" />+ <style:style style:name="List_20_Bullet_20_Tight"+ style:display-name="List Bullet Tight" style:family="paragraph"+ style:parent-style-name="List" style:class="list">+ <style:paragraph-properties fo:margin-top="0in"+ fo:margin-bottom="0in" style:contextual-spacing="false" />+ </style:style>+ <style:style style:name="List_20_Number"+ style:display-name="List Number" style:family="paragraph"+ style:parent-style-name="List" style:class="list" />+ <style:style style:name="List_20_Number_20_Tight"+ style:display-name="List Number Tight" style:family="paragraph"+ style:parent-style-name="List" style:class="list">+ <style:paragraph-properties fo:margin-top="0in"+ fo:margin-bottom="0in" style:contextual-spacing="false" />+ </style:style>+ <style:style style:name="Caption" style:family="paragraph"+ style:parent-style-name="Standard" style:class="extra">+ <style:paragraph-properties fo:margin-top="0.0835in"+ fo:margin-bottom="0.0835in" style:contextual-spacing="false"+ text:number-lines="false" text:line-number="0" />+ <style:text-properties fo:font-size="12pt"+ fo:font-style="italic" style:font-size-asian="12pt"+ style:font-style-asian="italic"+ style:font-name-complex="Tahoma1"+ style:font-size-complex="12pt"+ style:font-style-complex="italic" />+ </style:style>+ <style:style style:name="TableCaption" style:family="paragraph"+ style:parent-style-name="Caption" style:class="extra">+ </style:style>+ <style:style style:name="Table" style:family="paragraph"+ style:parent-style-name="Caption" style:class="extra">+ </style:style>+ <style:style style:name="FigureCaption" style:family="paragraph"+ style:parent-style-name="Caption" style:class="extra">+ </style:style>+ <style:style style:name="Figure" style:family="paragraph"+ style:parent-style-name="Standard" style:class="extra">+ <style:paragraph-properties text:number-lines="false"+ text:line-number="0" />+ </style:style>+ <style:style style:name="FigureWithCaption" style:family="paragraph"+ style:parent-style-name="Figure" style:class="extra">+ <style:paragraph-properties text:number-lines="false"+ text:line-number="0" fo:keep-with-next="always" />+ </style:style>+ <style:style style:name="Index" style:family="paragraph"+ style:parent-style-name="Standard" style:class="index">+ <style:paragraph-properties text:number-lines="false"+ text:line-number="0" />+ <style:text-properties style:font-name-complex="Tahoma1" />+ </style:style>+ <style:style style:name="Heading_20_1"+ style:display-name="Heading 1" style:family="paragraph"+ style:parent-style-name="Heading"+ style:next-style-name="Text_20_body"+ style:default-outline-level="1" style:class="text">+ <style:text-properties fo:font-size="115%"+ fo:font-weight="bold" style:font-size-asian="115%"+ style:font-weight-asian="bold" style:font-size-complex="115%"+ style:font-weight-complex="bold" />+ </style:style>+ <style:style style:name="Heading_20_2"+ style:display-name="Heading 2" style:family="paragraph"+ style:parent-style-name="Heading"+ style:next-style-name="Text_20_body"+ style:default-outline-level="2" style:class="text">+ <style:text-properties fo:font-size="14pt"+ fo:font-style="italic" fo:font-weight="bold"+ style:font-size-asian="14pt" style:font-style-asian="italic"+ style:font-weight-asian="bold" style:font-size-complex="14pt"+ style:font-style-complex="italic"+ style:font-weight-complex="bold" />+ </style:style>+ <style:style style:name="Heading_20_3"+ style:display-name="Heading 3" style:family="paragraph"+ style:parent-style-name="Heading"+ style:next-style-name="Text_20_body"+ style:default-outline-level="3" style:class="text">+ <style:text-properties fo:font-size="14pt"+ fo:font-weight="bold" style:font-size-asian="14pt"+ style:font-weight-asian="bold" style:font-size-complex="14pt"+ style:font-weight-complex="bold" />+ </style:style>+ <style:style style:name="Heading_20_4"+ style:display-name="Heading 4" style:family="paragraph"+ style:parent-style-name="Heading"+ style:next-style-name="Text_20_body"+ style:default-outline-level="4" style:class="text">+ <style:text-properties fo:font-size="85%"+ fo:font-style="italic" fo:font-weight="bold"+ style:font-size-asian="85%" style:font-style-asian="italic"+ style:font-weight-asian="bold" style:font-size-complex="85%"+ style:font-style-complex="italic"+ style:font-weight-complex="bold" />+ </style:style>+ <style:style style:name="Heading_20_5"+ style:display-name="Heading 5" style:family="paragraph"+ style:parent-style-name="Heading"+ style:next-style-name="Text_20_body"+ style:default-outline-level="5" style:class="text">+ <style:text-properties fo:font-size="85%"+ fo:font-weight="bold" style:font-size-asian="85%"+ style:font-weight-asian="bold" style:font-size-complex="85%"+ style:font-weight-complex="bold" />+ </style:style>+ <style:style style:name="Heading_20_6"+ style:display-name="Heading 6" style:family="paragraph"+ style:parent-style-name="Heading"+ style:next-style-name="Text_20_body"+ style:default-outline-level="6" style:class="text">+ <style:text-properties fo:font-size="75%"+ fo:font-weight="bold" style:font-size-asian="75%"+ style:font-weight-asian="bold" style:font-size-complex="75%"+ style:font-weight-complex="bold" />+ </style:style>+ <style:style style:name="Quotations" style:family="paragraph"+ style:parent-style-name="Standard" style:class="html">+ <style:paragraph-properties fo:margin-left="0.3937in"+ fo:margin-right="0.3937in" fo:margin-top="0.1in"+ fo:margin-bottom="0.1in" style:contextual-spacing="false"+ fo:text-indent="0in" style:auto-text-indent="false" />+ </style:style>+ <style:style style:name="Preformatted_20_Text"+ style:display-name="Preformatted Text" style:family="paragraph"+ style:parent-style-name="Standard" style:class="html">+ <style:paragraph-properties fo:margin-top="0in"+ fo:margin-bottom="0in" style:contextual-spacing="false" />+ <style:text-properties style:font-name="Courier New"+ fo:font-family="'Courier New'"+ style:font-family-generic="modern"+ style:font-pitch="fixed"+ fo:font-size="10pt"+ style:font-name-asian="Courier New"+ style:font-family-asian="'Courier New'"+ style:font-family-generic-asian="modern"+ style:font-pitch-asian="fixed"+ style:font-size-asian="10pt"+ style:font-name-complex="Courier New"+ style:font-family-complex="'Courier New'"+ style:font-family-generic-complex="modern"+ style:font-pitch-complex="fixed"+ style:font-size-complex="10pt"+ fo:language="zxx" />+ </style:style>+ <style:style style:name="Source_20_Text" style:display-name="Source Text" style:family="text">+ <style:text-properties style:font-name="Courier New"+ fo:font-family="'Courier New'"+ style:font-family-generic="modern"+ style:font-pitch="fixed"+ style:font-name-asian="Courier New"+ style:font-family-asian="'Courier New'"+ style:font-family-generic-asian="modern"+ style:font-pitch-asian="fixed"+ style:font-name-complex="Courier New"+ style:font-family-complex="'Courier New'"+ style:font-family-generic-complex="modern"+ style:font-pitch-complex="fixed"+ fo:language="zxx" />+ </style:style>+ <style:style style:name="Highlighted" style:family="text">+ <style:text-properties fo:background-color="#ffff38" />+ </style:style>+ <style:style style:name="Definition_20_Term"+ style:display-name="Definition Term" style:family="paragraph"+ style:parent-style-name="Standard"+ style:next-style-name="Definition_20_Definition">+ <style:paragraph-properties fo:margin-top="0.0598in"+ fo:margin-bottom="0.0598in"+ style:contextual-spacing="false" />+ </style:style>+ <style:style style:name="Definition_20_Definition"+ style:display-name="Definition Definition"+ style:family="paragraph" style:parent-style-name="Standard"+ style:next-style-name="Text_20_body">+ <style:paragraph-properties fo:margin-left="0.5in"+ fo:margin-right="0in" fo:text-indent="0in"+ style:auto-text-indent="false" />+ </style:style>+ <style:style style:name="Table_20_Contents"+ style:display-name="Table Contents" style:family="paragraph"+ style:parent-style-name="Standard" style:class="extra">+ <style:paragraph-properties fo:margin-left="0.0299in"+ fo:margin-right="0.0299in" fo:text-indent="0in"+ style:auto-text-indent="false" text:number-lines="false"+ text:line-number="0" />+ </style:style>+ <style:style style:name="Table_20_Heading"+ style:display-name="Table Heading" style:family="paragraph"+ style:parent-style-name="Table_20_Contents"+ style:class="extra">+ <style:paragraph-properties fo:margin-left="0.0299in"+ fo:margin-right="0.0299in" fo:text-align="start"+ style:justify-single-word="false" fo:text-indent="0in"+ style:auto-text-indent="false" style:shadow="none"+ text:number-lines="false" text:line-number="0" />+ <style:text-properties fo:font-weight="bold"+ style:font-weight-asian="bold"+ style:font-weight-complex="bold" />+ </style:style>+ <style:style style:name="Footnote" style:family="paragraph"+ style:parent-style-name="Standard" style:class="extra">+ <style:paragraph-properties fo:margin-left="0.1965in"+ fo:margin-right="0in" fo:text-indent="-0.1965in"+ style:auto-text-indent="false" text:number-lines="false"+ text:line-number="0" />+ <style:text-properties fo:font-size="10pt"+ style:font-size-asian="10pt"+ style:font-size-complex="10pt" />+ </style:style>+ <style:style style:name="Footer" style:family="paragraph"+ style:parent-style-name="Standard" style:class="extra">+ <style:paragraph-properties text:number-lines="false"+ text:line-number="0">+ <style:tab-stops>+ <style:tab-stop style:position="3.25in"+ style:type="center" />+ <style:tab-stop style:position="6.5in"+ style:type="right" />+ </style:tab-stops>+ </style:paragraph-properties>+ </style:style>+ <style:style style:name="Definition_20_Term_20_Tight"+ style:display-name="Definition Term Tight"+ style:family="paragraph" style:parent-style-name="Standard"+ style:next-style-name="Definition_20_Definition_20_Tight">+ <style:paragraph-properties fo:margin-top="0.0799in"+ fo:margin-bottom="0.0799in"+ style:contextual-spacing="false" />+ </style:style>+ <style:style style:name="Definition_20_Definition_20_Tight"+ style:display-name="Definition Definition Tight"+ style:family="paragraph" style:parent-style-name="Standard">+ <style:paragraph-properties fo:margin-left="0.5in"+ fo:margin-right="0in" fo:margin-top="0in"+ fo:margin-bottom="0in" style:contextual-spacing="false"+ fo:text-indent="0in" style:auto-text-indent="false" />+ </style:style>+ <style:style style:name="Horizontal_20_Line"+ style:display-name="Horizontal Line" style:family="paragraph"+ style:parent-style-name="Standard"+ style:next-style-name="Text_20_body" style:class="html">+ <style:paragraph-properties fo:margin-top="0in"+ fo:margin-bottom="0.1965in" style:contextual-spacing="false"+ style:border-line-width-bottom="0.0008in 0.0138in 0.0008in"+ fo:padding="0in" fo:border-left="none" fo:border-right="none"+ fo:border-top="none" fo:border-bottom="1.11pt double #808080"+ text:number-lines="false" text:line-number="0"+ style:join-border="false" />+ <style:text-properties fo:font-size="6pt"+ style:font-size-asian="6pt" style:font-size-complex="6pt" />+ </style:style>+ <style:style style:name="First_20_paragraph"+ style:display-name="First paragraph" style:family="paragraph"+ style:parent-style-name="Text_20_body"+ style:next-style-name="Text_20_body" style:class="text" />+ <style:style style:name="Numbering_20_Symbols"+ style:display-name="Numbering Symbols" style:family="text" />+ <style:style style:name="Bullet_20_Symbols"+ style:display-name="Bullet Symbols" style:family="text">+ <style:text-properties style:font-name="StarSymbol"+ fo:font-size="9pt" style:font-name-asian="StarSymbol"+ style:font-size-asian="9pt"+ style:font-name-complex="StarSymbol"+ style:font-size-complex="9pt" />+ </style:style>+ <style:style style:name="Emphasis" style:family="text">+ <style:text-properties fo:font-style="italic"+ style:font-style-asian="italic"+ style:font-style-complex="italic" />+ </style:style>+ <style:style style:name="Strong_20_Emphasis"+ style:display-name="Strong Emphasis" style:family="text">+ <style:text-properties fo:font-weight="bold"+ style:font-weight-asian="bold"+ style:font-weight-complex="bold" />+ </style:style>+ <style:style style:name="Strikeout" style:family="text">+ <style:text-properties style:text-line-through-style="solid" />+ </style:style>+ <style:style style:name="Superscript" style:family="text">+ <style:text-properties style:text-position="super 58%" />+ </style:style>+ <style:style style:name="Subscript" style:family="text">+ <style:text-properties style:text-position="sub 58%" />+ </style:style>+ <style:style style:name="Citation" style:family="text">+ <style:text-properties fo:font-style="italic"+ style:font-style-asian="italic"+ style:font-style-complex="italic" />+ </style:style>+ <style:style style:name="Teletype" style:family="text">+ <style:text-properties style:font-name="Courier New"+ style:font-name-asian="Courier New"+ style:font-name-complex="Courier New" />+ </style:style>++ <style:style style:name="Internet_20_link"+ style:display-name="Internet link" style:family="text">+ <style:text-properties fo:color="#000080"+ style:text-underline-style="solid"+ style:text-underline-width="auto"+ style:text-underline-color="font-color" />+ </style:style>+ <style:style style:name="Footnote_20_Symbol"+ style:display-name="Footnote Symbol" style:family="text" />+ <style:style style:name="Footnote_20_anchor"+ style:display-name="Footnote anchor" style:family="text">+ <style:text-properties style:text-position="super 58%" />+ </style:style>+ <style:style style:name="Definition" style:family="text" />+ <text:outline-style style:name="Outline">+ <text:outline-level-style text:level="1" style:num-format="">+ <style:list-level-properties text:min-label-distance="0.15in" />+ </text:outline-level-style>+ <text:outline-level-style text:level="2" style:num-format="">+ <style:list-level-properties text:min-label-distance="0.15in" />+ </text:outline-level-style>+ <text:outline-level-style text:level="3" style:num-format="">+ <style:list-level-properties text:min-label-distance="0.15in" />+ </text:outline-level-style>+ <text:outline-level-style text:level="4" style:num-format="">+ <style:list-level-properties text:min-label-distance="0.15in" />+ </text:outline-level-style>+ <text:outline-level-style text:level="5" style:num-format="">+ <style:list-level-properties text:min-label-distance="0.15in" />+ </text:outline-level-style>+ <text:outline-level-style text:level="6" style:num-format="">+ <style:list-level-properties text:min-label-distance="0.15in" />+ </text:outline-level-style>+ <text:outline-level-style text:level="7" style:num-format="">+ <style:list-level-properties text:min-label-distance="0.15in" />+ </text:outline-level-style>+ <text:outline-level-style text:level="8" style:num-format="">+ <style:list-level-properties text:min-label-distance="0.15in" />+ </text:outline-level-style>+ <text:outline-level-style text:level="9" style:num-format="">+ <style:list-level-properties text:min-label-distance="0.15in" />+ </text:outline-level-style>+ <text:outline-level-style text:level="10"+ style:num-format="">+ <style:list-level-properties text:min-label-distance="0.15in" />+ </text:outline-level-style>+ </text:outline-style>+ <text:list-style style:name="Numbering_20_1"+ style:display-name="Numbering 1">+ <text:list-level-style-number text:level="1"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="1">+ <style:list-level-properties text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="2"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="1">+ <style:list-level-properties text:space-before="0.1972in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="3"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="1">+ <style:list-level-properties text:space-before="0.3937in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="4"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="1">+ <style:list-level-properties text:space-before="0.5909in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="5"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="1">+ <style:list-level-properties text:space-before="0.7874in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="6"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="1">+ <style:list-level-properties text:space-before="0.9846in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="7"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="1">+ <style:list-level-properties text:space-before="1.1815in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="8"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="1">+ <style:list-level-properties text:space-before="1.3787in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="9"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="1">+ <style:list-level-properties text:space-before="1.5752in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="10"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="1">+ <style:list-level-properties text:space-before="1.7724in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ </text:list-style>+ <text:list-style style:name="Numbering_20_2"+ style:display-name="Numbering 2">+ <text:list-level-style-number text:level="1"+ text:style-name="Numbering_20_Symbols" style:num-format="1">+ <style:list-level-properties text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="2"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="2">+ <style:list-level-properties text:space-before="0.1965in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="3"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="3">+ <style:list-level-properties text:space-before="0.3929in"+ text:min-label-width="0.3937in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="4"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="4">+ <style:list-level-properties text:space-before="0.7866in"+ text:min-label-width="0.4925in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="5"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="5">+ <style:list-level-properties text:space-before="1.2791in"+ text:min-label-width="0.5902in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="6"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="6">+ <style:list-level-properties text:space-before="1.8693in"+ text:min-label-width="0.7091in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="7"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="7">+ <style:list-level-properties text:space-before="2.5783in"+ text:min-label-width="0.9055in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="8"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="8">+ <style:list-level-properties text:space-before="3.4839in"+ text:min-label-width="1.0236in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="9"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="9">+ <style:list-level-properties text:space-before="4.5075in"+ text:min-label-width="1.1028in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="10"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="10">+ <style:list-level-properties text:space-before="5.6102in"+ text:min-label-width="1.2209in" />+ </text:list-level-style-number>+ </text:list-style>+ <text:list-style style:name="Numbering_20_3"+ style:display-name="Numbering 3">+ <text:list-level-style-number text:level="1"+ text:style-name="Numbering_20_Symbols" style:num-format="1">+ <style:list-level-properties text:min-label-width="1.1811in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="2"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="2">+ <style:list-level-properties text:space-before="1.1815in"+ text:min-label-width="1.1811in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="3"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="3">+ <style:list-level-properties text:space-before="2.3626in"+ text:min-label-width="1.1811in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="4"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="4">+ <style:list-level-properties text:space-before="3.5441in"+ text:min-label-width="1.1811in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="5"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="5">+ <style:list-level-properties text:space-before="4.7252in"+ text:min-label-width="1.1811in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="6"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="6">+ <style:list-level-properties text:space-before="5.9063in"+ text:min-label-width="1.1811in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="7"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="7">+ <style:list-level-properties text:space-before="7.0878in"+ text:min-label-width="1.1811in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="8"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="8">+ <style:list-level-properties text:space-before="8.2689in"+ text:min-label-width="1.1811in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="9"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="9">+ <style:list-level-properties text:space-before="9.45in"+ text:min-label-width="1.1811in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="10"+ text:style-name="Numbering_20_Symbols" style:num-format="1"+ text:start-value="10">+ <style:list-level-properties text:space-before="10.6315in"+ text:min-label-width="1.1811in" />+ </text:list-level-style-number>+ </text:list-style>+ <text:list-style style:name="Numbering_20_4"+ style:display-name="Numbering 4">+ <text:list-level-style-number text:level="1"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="I">+ <style:list-level-properties text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="2"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="I" text:start-value="2">+ <style:list-level-properties text:space-before="0.1972in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="3"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="I" text:start-value="3">+ <style:list-level-properties text:space-before="0.3937in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="4"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="I" text:start-value="4">+ <style:list-level-properties text:space-before="0.5909in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="5"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="I" text:start-value="5">+ <style:list-level-properties text:space-before="0.7874in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="6"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="I" text:start-value="6">+ <style:list-level-properties text:space-before="0.9846in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="7"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="I" text:start-value="7">+ <style:list-level-properties text:space-before="1.1815in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="8"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="I" text:start-value="8">+ <style:list-level-properties text:space-before="1.3787in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="9"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="I" text:start-value="9">+ <style:list-level-properties text:space-before="1.5752in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="10"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="I" text:start-value="10">+ <style:list-level-properties text:space-before="1.7724in"+ text:min-label-width="0.1965in" />+ </text:list-level-style-number>+ </text:list-style>+ <text:list-style style:name="Numbering_20_5"+ style:display-name="Numbering 5">+ <text:list-level-style-number text:level="1"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="1">+ <style:list-level-properties text:min-label-width="0.1575in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="2"+ text:style-name="Numbering_20_Symbols" style:num-suffix="."+ style:num-format="1" text:start-value="2"+ text:display-levels="2">+ <style:list-level-properties text:space-before="0.1772in"+ text:min-label-width="0.2563in" />+ </text:list-level-style-number>+ <text:list-level-style-number text:level="3"+ text:style-name="Numbering_20_Symbols" style:num-suffix=")"+ style:num-format="a" text:start-value="3">+ <style:list-level-properties text:space-before="0.4331in"+ text:min-label-width="0.1772in" />+ </text:list-level-style-number>+ <text:list-level-style-bullet text:level="4"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="0.6319in"+ text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="5"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="0.7874in"+ text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="6"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="0.9429in"+ text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="7"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="1.0988in"+ text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="8"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="1.2543in"+ text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="9"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="1.4098in"+ text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="10"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="1.5654in"+ text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ </text:list-style>+ <text:list-style style:name="List_20_1"+ style:display-name="List 1">+ <text:list-level-style-bullet text:level="1"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="2"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="0.1579in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="3"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="0.3146in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="4"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="0.4724in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="5"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="0.6299in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="6"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="0.7878in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="7"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="0.9445in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="8"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="1.1024in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="9"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="1.2598in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="10"+ text:style-name="Numbering_20_Symbols" text:bullet-char="•">+ <style:list-level-properties text:space-before="1.4177in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ </text:list-style>+ <text:list-style style:name="List_20_2"+ style:display-name="List 2">+ <text:list-level-style-bullet text:level="1"+ text:style-name="Numbering_20_Symbols" text:bullet-char="–">+ <style:list-level-properties text:min-label-width="0.1181in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="2"+ text:style-name="Numbering_20_Symbols" text:bullet-char="–">+ <style:list-level-properties text:space-before="0.1181in"+ text:min-label-width="0.1181in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="3"+ text:style-name="Numbering_20_Symbols" text:bullet-char="–">+ <style:list-level-properties text:space-before="0.2362in"+ text:min-label-width="0.1181in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="4"+ text:style-name="Numbering_20_Symbols" text:bullet-char="–">+ <style:list-level-properties text:space-before="0.3539in"+ text:min-label-width="0.1181in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="5"+ text:style-name="Numbering_20_Symbols" text:bullet-char="–">+ <style:list-level-properties text:space-before="0.472in"+ text:min-label-width="0.1181in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="6"+ text:style-name="Numbering_20_Symbols" text:bullet-char="–">+ <style:list-level-properties text:space-before="0.5902in"+ text:min-label-width="0.1181in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="7"+ text:style-name="Numbering_20_Symbols" text:bullet-char="–">+ <style:list-level-properties text:space-before="0.7091in"+ text:min-label-width="0.1181in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="8"+ text:style-name="Numbering_20_Symbols" text:bullet-char="–">+ <style:list-level-properties text:space-before="0.8272in"+ text:min-label-width="0.1181in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="9"+ text:style-name="Numbering_20_Symbols" text:bullet-char="–">+ <style:list-level-properties text:space-before="0.9453in"+ text:min-label-width="0.1181in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="10"+ text:style-name="Numbering_20_Symbols" text:bullet-char="–">+ <style:list-level-properties text:space-before="1.063in"+ text:min-label-width="0.1181in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ </text:list-style>+ <text:list-style style:name="List_20_3"+ style:display-name="List 3">+ <text:list-level-style-bullet text:level="1"+ text:style-name="Numbering_20_Symbols" text:bullet-char="☑">+ <style:list-level-properties text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="2"+ text:style-name="Numbering_20_Symbols" text:bullet-char="□">+ <style:list-level-properties text:space-before="0.1555in"+ text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="3"+ text:style-name="Numbering_20_Symbols" text:bullet-char="☑">+ <style:list-level-properties text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="4"+ text:style-name="Numbering_20_Symbols" text:bullet-char="□">+ <style:list-level-properties text:space-before="0.1555in"+ text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="5"+ text:style-name="Numbering_20_Symbols" text:bullet-char="☑">+ <style:list-level-properties text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="6"+ text:style-name="Numbering_20_Symbols" text:bullet-char="□">+ <style:list-level-properties text:space-before="0.1555in"+ text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="7"+ text:style-name="Numbering_20_Symbols" text:bullet-char="☑">+ <style:list-level-properties text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="8"+ text:style-name="Numbering_20_Symbols" text:bullet-char="□">+ <style:list-level-properties text:space-before="0.1555in"+ text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="9"+ text:style-name="Numbering_20_Symbols" text:bullet-char="☑">+ <style:list-level-properties text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="10"+ text:style-name="Numbering_20_Symbols" text:bullet-char="□">+ <style:list-level-properties text:space-before="0.1555in"+ text:min-label-width="0.1555in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ </text:list-style>+ <text:list-style style:name="List_20_4"+ style:display-name="List 4">+ <text:list-level-style-bullet text:level="1"+ text:style-name="Numbering_20_Symbols" text:bullet-char="➢">+ <style:list-level-properties text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="2"+ text:style-name="Numbering_20_Symbols" text:bullet-char="">+ <style:list-level-properties text:space-before="0.1579in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="3"+ text:style-name="Numbering_20_Symbols" text:bullet-char="">+ <style:list-level-properties text:space-before="0.3146in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="4"+ text:style-name="Numbering_20_Symbols" text:bullet-char="">+ <style:list-level-properties text:space-before="0.4724in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="5"+ text:style-name="Numbering_20_Symbols" text:bullet-char="">+ <style:list-level-properties text:space-before="0.6299in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="6"+ text:style-name="Numbering_20_Symbols" text:bullet-char="">+ <style:list-level-properties text:space-before="0.7878in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="7"+ text:style-name="Numbering_20_Symbols" text:bullet-char="">+ <style:list-level-properties text:space-before="0.9445in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="8"+ text:style-name="Numbering_20_Symbols" text:bullet-char="">+ <style:list-level-properties text:space-before="1.1024in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="9"+ text:style-name="Numbering_20_Symbols" text:bullet-char="">+ <style:list-level-properties text:space-before="1.2598in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="10"+ text:style-name="Numbering_20_Symbols" text:bullet-char="">+ <style:list-level-properties text:space-before="1.4177in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ </text:list-style>+ <text:list-style style:name="List_20_5"+ style:display-name="List 5">+ <text:list-level-style-bullet text:level="1"+ text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+ <style:list-level-properties text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="2"+ text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+ <style:list-level-properties text:space-before="0.1579in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="3"+ text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+ <style:list-level-properties text:space-before="0.3146in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="4"+ text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+ <style:list-level-properties text:space-before="0.4724in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="5"+ text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+ <style:list-level-properties text:space-before="0.6299in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="6"+ text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+ <style:list-level-properties text:space-before="0.7878in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="7"+ text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+ <style:list-level-properties text:space-before="0.9445in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="8"+ text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+ <style:list-level-properties text:space-before="1.1024in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="9"+ text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+ <style:list-level-properties text:space-before="1.2598in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ <text:list-level-style-bullet text:level="10"+ text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+ <style:list-level-properties text:space-before="1.4177in"+ text:min-label-width="0.1575in" />+ <style:text-properties style:font-name="StarSymbol" />+ </text:list-level-style-bullet>+ </text:list-style>+ <text:notes-configuration text:note-class="footnote"+ text:citation-style-name="Footnote_20_Symbol"+ text:citation-body-style-name="Footnote_20_anchor"+ style:num-format="1" text:start-value="0"+ text:footnotes-position="page"+ text:start-numbering-at="document" />+ <text:notes-configuration text:note-class="endnote"+ style:num-format="i" text:start-value="0" />+ <text:linenumbering-configuration text:number-lines="false"+ text:offset="0.1965in" style:num-format="1"+ text:number-position="left" text:increment="5" />+ </office:styles>+ <office:automatic-styles>+ <style:style style:name="MP1" style:family="paragraph"+ style:parent-style-name="Footer">+ <style:paragraph-properties fo:text-align="center"+ style:justify-single-word="false" />+ </style:style>+ <style:page-layout style:name="Mpm1">+ <style:page-layout-properties fo:page-width="8.5in"+ fo:page-height="11in" style:num-format="1"+ style:print-orientation="portrait" fo:margin-top="1in"+ fo:margin-bottom="1in" fo:margin-left="1in"+ fo:margin-right="1in" style:writing-mode="lr-tb"+ style:footnote-max-height="0in">+ <style:footnote-sep style:width="0.0071in"+ style:distance-before-sep="0.0398in"+ style:distance-after-sep="0.0398in" style:line-style="none"+ style:adjustment="left" style:rel-width="25%"+ style:color="#000000" />+ </style:page-layout-properties>+ <style:header-style />+ <style:footer-style>+ <style:header-footer-properties fo:min-height="0.4in"+ fo:margin-left="0in" fo:margin-right="0in"+ fo:margin-top="0.2in" style:dynamic-spacing="false" />+ </style:footer-style>+ </style:page-layout>+ </office:automatic-styles>+ <office:master-styles>+ <style:master-page style:name="Standard"+ style:page-layout-name="Mpm1">+ <style:footer>+ <text:p text:style-name="MP1">+ <text:page-number text:select-page="current">+ 1</text:page-number>+ </text:p>+ </style:footer>+ </style:master-page>+ </office:master-styles>+</office:document-styles>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/ppt/presentation.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"/><Override PartName="/ppt/slideMasters/slideMaster1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"/><Override PartName="/ppt/slides/slide1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+xml"/><Override PartName="/ppt/slides/slide2.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+xml"/><Override PartName="/ppt/slides/slide3.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+xml"/><Override PartName="/ppt/slides/slide4.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+xml"/><Override PartName="/ppt/notesMasters/notesMaster1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml"/><Override PartName="/ppt/presProps.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.presProps+xml"/><Override PartName="/ppt/viewProps.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml"/><Override PartName="/ppt/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/ppt/tableStyles.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml"/><Override PartName="/ppt/slideLayouts/slideLayout1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/><Override PartName="/ppt/slideLayouts/slideLayout2.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/><Override PartName="/ppt/slideLayouts/slideLayout3.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/><Override PartName="/ppt/slideLayouts/slideLayout4.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/><Override PartName="/ppt/slideLayouts/slideLayout5.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/><Override PartName="/ppt/slideLayouts/slideLayout6.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/><Override PartName="/ppt/slideLayouts/slideLayout7.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/><Override PartName="/ppt/slideLayouts/slideLayout8.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/><Override PartName="/ppt/slideLayouts/slideLayout9.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/><Override PartName="/ppt/slideLayouts/slideLayout10.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/><Override PartName="/ppt/slideLayouts/slideLayout11.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/><Override PartName="/ppt/theme/theme2.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/ppt/notesSlides/notesSlide1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml"/><Override PartName="/ppt/notesSlides/notesSlide2.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/></Types>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="ppt/presentation.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><TotalTime>2</TotalTime><Words>49</Words><Application>Microsoft Macintosh PowerPoint</Application><PresentationFormat>On-screen Show (16:9)</PresentationFormat><Paragraphs>15</Paragraphs><Slides>4</Slides><Notes>2</Notes><HiddenSlides>0</HiddenSlides><MMClips>0</MMClips><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="6" baseType="variant"><vt:variant><vt:lpstr>Fonts Used</vt:lpstr></vt:variant><vt:variant><vt:i4>2</vt:i4></vt:variant><vt:variant><vt:lpstr>Theme</vt:lpstr></vt:variant><vt:variant><vt:i4>1</vt:i4></vt:variant><vt:variant><vt:lpstr>Slide Titles</vt:lpstr></vt:variant><vt:variant><vt:i4>4</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="7" baseType="lpstr"><vt:lpstr>Arial</vt:lpstr><vt:lpstr>Calibri</vt:lpstr><vt:lpstr>Office Theme</vt:lpstr><vt:lpstr>Presentation Title</vt:lpstr><vt:lpstr>Slide Title</vt:lpstr><vt:lpstr>Section header</vt:lpstr><vt:lpstr>Slide Title for Two-Content</vt:lpstr></vt:vector></TitlesOfParts><Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>16.0000</AppVersion></Properties>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:title>Title</dc:title><dc:creator>Jesse Rosenthal</dc:creator><cp:lastModifiedBy>Jesse Rosenthal</cp:lastModifiedBy><cp:revision>5</cp:revision><dcterms:created xsi:type="dcterms:W3CDTF">2017-06-05T14:10:58Z</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">2022-01-02T22:49:03Z</dcterms:modified></cp:coreProperties>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId8" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps" Target="viewProps.xml"/><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" Target="slides/slide2.xml"/><Relationship Id="rId7" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps" Target="presProps.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" Target="slides/slide1.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="slideMasters/slideMaster1.xml"/><Relationship Id="rId6" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster" Target="notesMasters/notesMaster1.xml"/><Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" Target="slides/slide4.xml"/><Relationship Id="rId10" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles" Target="tableStyles.xml"/><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" Target="slides/slide3.xml"/><Relationship Id="rId9" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="../theme/theme2.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:notesMaster xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:bg><p:bgRef idx="1001"><a:schemeClr val="bg1"/></p:bgRef></p:bg><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Header Placeholder 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="hdr" sz="quarter"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="2971800" cy="458788"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0"/><a:lstStyle><a:lvl1pPr algn="l"><a:defRPr sz="1200"/></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Date Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="3884613" y="0"/><a:ext cx="2971800" cy="458788"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0"/><a:lstStyle><a:lvl1pPr algn="r"><a:defRPr sz="1200"/></a:lvl1pPr></a:lstStyle><a:p><a:fld id="{0F9C1CCF-B725-44A7-AA57-5E433BD85C9F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Slide Image Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1" noRot="1" noChangeAspect="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldImg" idx="2"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="685800" y="1143000"/><a:ext cx="5486400" cy="3086100"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/><a:ln w="12700"><a:solidFill><a:prstClr val="black"/></a:solidFill></a:ln></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr"/><a:lstStyle/><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Notes Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" sz="quarter" idx="3"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="685800" y="4400550"/><a:ext cx="5486400" cy="3600450"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0"/><a:lstStyle/><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1"/><a:r><a:rPr lang="en-US"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2"/><a:r><a:rPr lang="en-US"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3"/><a:r><a:rPr lang="en-US"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4"/><a:r><a:rPr lang="en-US"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Footer Placeholder 5"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="4"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="0" y="8685213"/><a:ext cx="2971800" cy="458787"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="b"/><a:lstStyle><a:lvl1pPr algn="l"><a:defRPr sz="1200"/></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="7" name="Slide Number Placeholder 6"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="5"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="3884613" y="8685213"/><a:ext cx="2971800" cy="458787"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="b"/><a:lstStyle><a:lvl1pPr algn="r"><a:defRPr sz="1200"/></a:lvl1pPr></a:lstStyle><a:p><a:fld id="{18BDFEC3-8487-43E8-A154-7C12CBC1FFF2}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="3782709779"/></p:ext></p:extLst></p:cSld><p:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/><p:notesStyle><a:lvl1pPr marL="0" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1200" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL="457200" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1200" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL="914400" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1200" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL="1371600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1200" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL="1828800" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1200" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL="2286000" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1200" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL="2743200" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1200" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL="3200400" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1200" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL="3657600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1200" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl9pPr></p:notesStyle></p:notesMaster>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" Target="../slides/slide1.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster" Target="../notesMasters/notesMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" Target="../slides/slide2.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster" Target="../notesMasters/notesMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:notes xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Slide Image Placeholder 1"/><p:cNvSpPr><a:spLocks noGrp="1" noRot="1" noChangeAspect="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldImg"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="685800" y="1143000"/><a:ext cx="5486400" cy="3086100"/></a:xfrm></p:spPr></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Notes Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" dirty="0"/><a:t>Here</a:t></a:r><a:r><a:rPr lang="en-US" baseline="0" dirty="0"/><a:t> is a note</a:t></a:r></a:p><a:p><a:endParaRPr lang="en-US" baseline="0" dirty="0"/></a:p><a:p><a:r><a:rPr lang="en-US" baseline="0" dirty="0"/><a:t>With another paragraph.</a:t></a:r><a:endParaRPr lang="en-US" dirty="0"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Slide Number Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{18BDFEC3-8487-43E8-A154-7C12CBC1FFF2}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>1</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="3171319170"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:notes>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:notes xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Slide Image Placeholder 1"/><p:cNvSpPr><a:spLocks noGrp="1" noRot="1" noChangeAspect="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldImg"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="685800" y="1143000"/><a:ext cx="5486400" cy="3086100"/></a:xfrm></p:spPr></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Notes Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" dirty="0"/><a:t>A</a:t></a:r><a:r><a:rPr lang="en-US" baseline="0" dirty="0"/><a:t> speaker note on </a:t></a:r><a:r><a:rPr lang="en-US" baseline="0"/><a:t>this slide too.</a:t></a:r><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Slide Number Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{18BDFEC3-8487-43E8-A154-7C12CBC1FFF2}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>2</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="3016900036"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:notes>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:presentationPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:extLst><p:ext uri="{E76CE94A-603C-4142-B9EB-6D1370010A27}"><p14:discardImageEditData xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="0"/></p:ext><p:ext uri="{D31A062A-798A-4329-ABDD-BBA856620510}"><p14:defaultImageDpi xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="0"/></p:ext><p:ext uri="{FD5EFAAD-0ECE-453E-9831-46B23BE46B34}"><p15:chartTrackingRefBased xmlns:p15="http://schemas.microsoft.com/office/powerpoint/2012/main" val="0"/></p:ext></p:extLst></p:presentationPr>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" saveSubsetFonts="1" autoCompressPictures="0"><p:sldMasterIdLst><p:sldMasterId id="2147483648" r:id="rId1"/></p:sldMasterIdLst><p:notesMasterIdLst><p:notesMasterId r:id="rId6"/></p:notesMasterIdLst><p:sldIdLst><p:sldId id="256" r:id="rId2"/><p:sldId id="257" r:id="rId3"/><p:sldId id="258" r:id="rId4"/><p:sldId id="259" r:id="rId5"/></p:sldIdLst><p:sldSz cx="9144000" cy="5143500" type="screen16x9"/><p:notesSz cx="6858000" cy="9144000"/><p:defaultTextStyle><a:defPPr><a:defRPr lang="en-US"/></a:defPPr><a:lvl1pPr marL="0" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL="457200" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL="914400" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL="1371600" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL="1828800" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL="2286000" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL="2743200" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL="3200400" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL="3657600" algn="l" defTabSz="457200" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl9pPr></p:defaultTextStyle><p:extLst><p:ext uri="{EFAFB233-063F-42B5-8137-9DF3F51BA10A}"><p15:sldGuideLst xmlns:p15="http://schemas.microsoft.com/office/powerpoint/2012/main"><p15:guide id="1" orient="horz" pos="1620" userDrawn="1"><p15:clr><a:srgbClr val="A4A3A4"/></p15:clr></p15:guide><p15:guide id="2" pos="2880" userDrawn="1"><p15:clr><a:srgbClr val="A4A3A4"/></p15:clr></p15:guide></p15:sldGuideLst></p:ext></p:extLst></p:presentation>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="../slideMasters/slideMaster1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="title" preserve="1"><p:cSld name="Title Slide"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ctrTitle"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="685800" y="1597819"/><a:ext cx="7772400" cy="1102519"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Subtitle 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="subTitle" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="1371600" y="2914650"/><a:ext cx="6400800" cy="1314450"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr marL="0" indent="0" algn="ctr"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr><a:lvl2pPr marL="342900" indent="0" algn="ctr"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl2pPr><a:lvl3pPr marL="685800" indent="0" algn="ctr"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl3pPr><a:lvl4pPr marL="1028700" indent="0" algn="ctr"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl4pPr><a:lvl5pPr marL="1371600" indent="0" algn="ctr"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl5pPr><a:lvl6pPr marL="1714500" indent="0" algn="ctr"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl6pPr><a:lvl7pPr marL="2057400" indent="0" algn="ctr"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl7pPr><a:lvl8pPr marL="2400300" indent="0" algn="ctr"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl8pPr><a:lvl9pPr marL="2743200" indent="0" algn="ctr"><a:buNone/><a:defRPr><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl9pPr></a:lstStyle><a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master subtitle style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Date Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Footer Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Slide Number Placeholder 5"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{C5EF2332-01BF-834F-8236-50238282D533}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="1444357513"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="vertTx" preserve="1"><p:cSld name="Title and Vertical Text"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Vertical Text Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" orient="vert" idx="1"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr vert="eaVert"/><a:lstStyle/><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1"/><a:r><a:rPr lang="en-US"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2"/><a:r><a:rPr lang="en-US"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3"/><a:r><a:rPr lang="en-US"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4"/><a:r><a:rPr lang="en-US"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Date Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Footer Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Slide Number Placeholder 5"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{C5EF2332-01BF-834F-8236-50238282D533}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="313914798"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="vertTitleAndTx" preserve="1"><p:cSld name="Vertical Title and Text"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Vertical Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title" orient="vert"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="6629400" y="205979"/><a:ext cx="2057400" cy="4388644"/></a:xfrm></p:spPr><p:txBody><a:bodyPr vert="eaVert"/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Vertical Text Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" orient="vert" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="205979"/><a:ext cx="6019800" cy="4388644"/></a:xfrm></p:spPr><p:txBody><a:bodyPr vert="eaVert"/><a:lstStyle/><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1"/><a:r><a:rPr lang="en-US"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2"/><a:r><a:rPr lang="en-US"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3"/><a:r><a:rPr lang="en-US"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4"/><a:r><a:rPr lang="en-US"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Date Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Footer Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Slide Number Placeholder 5"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{C5EF2332-01BF-834F-8236-50238282D533}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="2581529045"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="obj" preserve="1"><p:cSld name="Title and Content"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Content Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph idx="1"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1"/><a:r><a:rPr lang="en-US"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2"/><a:r><a:rPr lang="en-US"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3"/><a:r><a:rPr lang="en-US"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4"/><a:r><a:rPr lang="en-US"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Date Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Footer Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Slide Number Placeholder 5"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{C5EF2332-01BF-834F-8236-50238282D533}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="338346009"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="secHead" preserve="1"><p:cSld name="Section Header"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="722313" y="3305176"/><a:ext cx="7772400" cy="1021556"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor="t"/><a:lstStyle><a:lvl1pPr algn="l"><a:defRPr sz="3000" b="1" cap="all"/></a:lvl1pPr></a:lstStyle><a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Text Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="722313" y="2180035"/><a:ext cx="7772400" cy="1125140"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor="b"/><a:lstStyle><a:lvl1pPr marL="0" indent="0"><a:buNone/><a:defRPr sz="1500"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr><a:lvl2pPr marL="342900" indent="0"><a:buNone/><a:defRPr sz="1350"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl2pPr><a:lvl3pPr marL="685800" indent="0"><a:buNone/><a:defRPr sz="1200"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl3pPr><a:lvl4pPr marL="1028700" indent="0"><a:buNone/><a:defRPr sz="1050"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl4pPr><a:lvl5pPr marL="1371600" indent="0"><a:buNone/><a:defRPr sz="1050"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl5pPr><a:lvl6pPr marL="1714500" indent="0"><a:buNone/><a:defRPr sz="1050"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl6pPr><a:lvl7pPr marL="2057400" indent="0"><a:buNone/><a:defRPr sz="1050"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl7pPr><a:lvl8pPr marL="2400300" indent="0"><a:buNone/><a:defRPr sz="1050"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl8pPr><a:lvl9pPr marL="2743200" indent="0"><a:buNone/><a:defRPr sz="1050"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Date Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Footer Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Slide Number Placeholder 5"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{C5EF2332-01BF-834F-8236-50238282D533}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="1073069076"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="twoObj" preserve="1"><p:cSld name="Two Content"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Content Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph sz="half" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="1200151"/><a:ext cx="4038600" cy="3394472"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr><a:defRPr sz="2100"/></a:lvl1pPr><a:lvl2pPr><a:defRPr sz="1800"/></a:lvl2pPr><a:lvl3pPr><a:defRPr sz="1500"/></a:lvl3pPr><a:lvl4pPr><a:defRPr sz="1350"/></a:lvl4pPr><a:lvl5pPr><a:defRPr sz="1350"/></a:lvl5pPr><a:lvl6pPr><a:defRPr sz="1350"/></a:lvl6pPr><a:lvl7pPr><a:defRPr sz="1350"/></a:lvl7pPr><a:lvl8pPr><a:defRPr sz="1350"/></a:lvl8pPr><a:lvl9pPr><a:defRPr sz="1350"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1"/><a:r><a:rPr lang="en-US"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2"/><a:r><a:rPr lang="en-US"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3"/><a:r><a:rPr lang="en-US"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4"/><a:r><a:rPr lang="en-US"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Content Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph sz="half" idx="2"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="4648200" y="1200151"/><a:ext cx="4038600" cy="3394472"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr><a:defRPr sz="2100"/></a:lvl1pPr><a:lvl2pPr><a:defRPr sz="1800"/></a:lvl2pPr><a:lvl3pPr><a:defRPr sz="1500"/></a:lvl3pPr><a:lvl4pPr><a:defRPr sz="1350"/></a:lvl4pPr><a:lvl5pPr><a:defRPr sz="1350"/></a:lvl5pPr><a:lvl6pPr><a:defRPr sz="1350"/></a:lvl6pPr><a:lvl7pPr><a:defRPr sz="1350"/></a:lvl7pPr><a:lvl8pPr><a:defRPr sz="1350"/></a:lvl8pPr><a:lvl9pPr><a:defRPr sz="1350"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1"/><a:r><a:rPr lang="en-US"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2"/><a:r><a:rPr lang="en-US"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3"/><a:r><a:rPr lang="en-US"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4"/><a:r><a:rPr lang="en-US"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Date Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Footer Placeholder 5"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="7" name="Slide Number Placeholder 6"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{C5EF2332-01BF-834F-8236-50238282D533}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="2619886245"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="twoTxTwoObj" preserve="1"><p:cSld name="Comparison"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr><a:defRPr/></a:lvl1pPr></a:lstStyle><a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Text Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="1151335"/><a:ext cx="4040188" cy="479822"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor="b"/><a:lstStyle><a:lvl1pPr marL="0" indent="0"><a:buNone/><a:defRPr sz="1800" b="1"/></a:lvl1pPr><a:lvl2pPr marL="342900" indent="0"><a:buNone/><a:defRPr sz="1500" b="1"/></a:lvl2pPr><a:lvl3pPr marL="685800" indent="0"><a:buNone/><a:defRPr sz="1350" b="1"/></a:lvl3pPr><a:lvl4pPr marL="1028700" indent="0"><a:buNone/><a:defRPr sz="1200" b="1"/></a:lvl4pPr><a:lvl5pPr marL="1371600" indent="0"><a:buNone/><a:defRPr sz="1200" b="1"/></a:lvl5pPr><a:lvl6pPr marL="1714500" indent="0"><a:buNone/><a:defRPr sz="1200" b="1"/></a:lvl6pPr><a:lvl7pPr marL="2057400" indent="0"><a:buNone/><a:defRPr sz="1200" b="1"/></a:lvl7pPr><a:lvl8pPr marL="2400300" indent="0"><a:buNone/><a:defRPr sz="1200" b="1"/></a:lvl8pPr><a:lvl9pPr marL="2743200" indent="0"><a:buNone/><a:defRPr sz="1200" b="1"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Content Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph sz="half" idx="2"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="1631156"/><a:ext cx="4040188" cy="2963466"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr><a:defRPr sz="1800"/></a:lvl1pPr><a:lvl2pPr><a:defRPr sz="1500"/></a:lvl2pPr><a:lvl3pPr><a:defRPr sz="1350"/></a:lvl3pPr><a:lvl4pPr><a:defRPr sz="1200"/></a:lvl4pPr><a:lvl5pPr><a:defRPr sz="1200"/></a:lvl5pPr><a:lvl6pPr><a:defRPr sz="1200"/></a:lvl6pPr><a:lvl7pPr><a:defRPr sz="1200"/></a:lvl7pPr><a:lvl8pPr><a:defRPr sz="1200"/></a:lvl8pPr><a:lvl9pPr><a:defRPr sz="1200"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1"/><a:r><a:rPr lang="en-US"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2"/><a:r><a:rPr lang="en-US"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3"/><a:r><a:rPr lang="en-US"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4"/><a:r><a:rPr lang="en-US"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Text Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" sz="quarter" idx="3"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="4645026" y="1151335"/><a:ext cx="4041775" cy="479822"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor="b"/><a:lstStyle><a:lvl1pPr marL="0" indent="0"><a:buNone/><a:defRPr sz="1800" b="1"/></a:lvl1pPr><a:lvl2pPr marL="342900" indent="0"><a:buNone/><a:defRPr sz="1500" b="1"/></a:lvl2pPr><a:lvl3pPr marL="685800" indent="0"><a:buNone/><a:defRPr sz="1350" b="1"/></a:lvl3pPr><a:lvl4pPr marL="1028700" indent="0"><a:buNone/><a:defRPr sz="1200" b="1"/></a:lvl4pPr><a:lvl5pPr marL="1371600" indent="0"><a:buNone/><a:defRPr sz="1200" b="1"/></a:lvl5pPr><a:lvl6pPr marL="1714500" indent="0"><a:buNone/><a:defRPr sz="1200" b="1"/></a:lvl6pPr><a:lvl7pPr marL="2057400" indent="0"><a:buNone/><a:defRPr sz="1200" b="1"/></a:lvl7pPr><a:lvl8pPr marL="2400300" indent="0"><a:buNone/><a:defRPr sz="1200" b="1"/></a:lvl8pPr><a:lvl9pPr marL="2743200" indent="0"><a:buNone/><a:defRPr sz="1200" b="1"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Content Placeholder 5"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph sz="quarter" idx="4"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="4645026" y="1631156"/><a:ext cx="4041775" cy="2963466"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr><a:defRPr sz="1800"/></a:lvl1pPr><a:lvl2pPr><a:defRPr sz="1500"/></a:lvl2pPr><a:lvl3pPr><a:defRPr sz="1350"/></a:lvl3pPr><a:lvl4pPr><a:defRPr sz="1200"/></a:lvl4pPr><a:lvl5pPr><a:defRPr sz="1200"/></a:lvl5pPr><a:lvl6pPr><a:defRPr sz="1200"/></a:lvl6pPr><a:lvl7pPr><a:defRPr sz="1200"/></a:lvl7pPr><a:lvl8pPr><a:defRPr sz="1200"/></a:lvl8pPr><a:lvl9pPr><a:defRPr sz="1200"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1"/><a:r><a:rPr lang="en-US"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2"/><a:r><a:rPr lang="en-US"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3"/><a:r><a:rPr lang="en-US"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4"/><a:r><a:rPr lang="en-US"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="7" name="Date Placeholder 6"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="8" name="Footer Placeholder 7"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="9" name="Slide Number Placeholder 8"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{C5EF2332-01BF-834F-8236-50238282D533}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="2535793967"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="titleOnly" preserve="1"><p:cSld name="Title Only"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Date Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Footer Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Slide Number Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{C5EF2332-01BF-834F-8236-50238282D533}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="3472721253"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="blank" preserve="1"><p:cSld name="Blank"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Date Placeholder 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Footer Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Slide Number Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{C5EF2332-01BF-834F-8236-50238282D533}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="2130901097"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="objTx" preserve="1"><p:cSld name="Content with Caption"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457201" y="204787"/><a:ext cx="3008313" cy="871538"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor="b"/><a:lstStyle><a:lvl1pPr algn="l"><a:defRPr sz="1500" b="1"/></a:lvl1pPr></a:lstStyle><a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Content Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="3575050" y="204788"/><a:ext cx="5111750" cy="4389835"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr><a:defRPr sz="2400"/></a:lvl1pPr><a:lvl2pPr><a:defRPr sz="2100"/></a:lvl2pPr><a:lvl3pPr><a:defRPr sz="1800"/></a:lvl3pPr><a:lvl4pPr><a:defRPr sz="1500"/></a:lvl4pPr><a:lvl5pPr><a:defRPr sz="1500"/></a:lvl5pPr><a:lvl6pPr><a:defRPr sz="1500"/></a:lvl6pPr><a:lvl7pPr><a:defRPr sz="1500"/></a:lvl7pPr><a:lvl8pPr><a:defRPr sz="1500"/></a:lvl8pPr><a:lvl9pPr><a:defRPr sz="1500"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1"/><a:r><a:rPr lang="en-US"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2"/><a:r><a:rPr lang="en-US"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3"/><a:r><a:rPr lang="en-US"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4"/><a:r><a:rPr lang="en-US"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Text Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" sz="half" idx="2"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457201" y="1076326"/><a:ext cx="3008313" cy="3518297"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr marL="0" indent="0"><a:buNone/><a:defRPr sz="1050"/></a:lvl1pPr><a:lvl2pPr marL="342900" indent="0"><a:buNone/><a:defRPr sz="900"/></a:lvl2pPr><a:lvl3pPr marL="685800" indent="0"><a:buNone/><a:defRPr sz="750"/></a:lvl3pPr><a:lvl4pPr marL="1028700" indent="0"><a:buNone/><a:defRPr sz="675"/></a:lvl4pPr><a:lvl5pPr marL="1371600" indent="0"><a:buNone/><a:defRPr sz="675"/></a:lvl5pPr><a:lvl6pPr marL="1714500" indent="0"><a:buNone/><a:defRPr sz="675"/></a:lvl6pPr><a:lvl7pPr marL="2057400" indent="0"><a:buNone/><a:defRPr sz="675"/></a:lvl7pPr><a:lvl8pPr marL="2400300" indent="0"><a:buNone/><a:defRPr sz="675"/></a:lvl8pPr><a:lvl9pPr marL="2743200" indent="0"><a:buNone/><a:defRPr sz="675"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Date Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Footer Placeholder 5"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="7" name="Slide Number Placeholder 6"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{C5EF2332-01BF-834F-8236-50238282D533}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="3540895647"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sldLayout xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" type="picTx" preserve="1"><p:cSld name="Picture with Caption"><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="1792288" y="3600450"/><a:ext cx="5486400" cy="425054"/></a:xfrm></p:spPr><p:txBody><a:bodyPr anchor="b"/><a:lstStyle><a:lvl1pPr algn="l"><a:defRPr sz="1500" b="1"/></a:lvl1pPr></a:lstStyle><a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Picture Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="pic" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="1792288" y="459581"/><a:ext cx="5486400" cy="3086100"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr marL="0" indent="0"><a:buNone/><a:defRPr sz="2400"/></a:lvl1pPr><a:lvl2pPr marL="342900" indent="0"><a:buNone/><a:defRPr sz="2100"/></a:lvl2pPr><a:lvl3pPr marL="685800" indent="0"><a:buNone/><a:defRPr sz="1800"/></a:lvl3pPr><a:lvl4pPr marL="1028700" indent="0"><a:buNone/><a:defRPr sz="1500"/></a:lvl4pPr><a:lvl5pPr marL="1371600" indent="0"><a:buNone/><a:defRPr sz="1500"/></a:lvl5pPr><a:lvl6pPr marL="1714500" indent="0"><a:buNone/><a:defRPr sz="1500"/></a:lvl6pPr><a:lvl7pPr marL="2057400" indent="0"><a:buNone/><a:defRPr sz="1500"/></a:lvl7pPr><a:lvl8pPr marL="2400300" indent="0"><a:buNone/><a:defRPr sz="1500"/></a:lvl8pPr><a:lvl9pPr marL="2743200" indent="0"><a:buNone/><a:defRPr sz="1500"/></a:lvl9pPr></a:lstStyle><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Text Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" sz="half" idx="2"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="1792288" y="4025503"/><a:ext cx="5486400" cy="603647"/></a:xfrm></p:spPr><p:txBody><a:bodyPr/><a:lstStyle><a:lvl1pPr marL="0" indent="0"><a:buNone/><a:defRPr sz="1050"/></a:lvl1pPr><a:lvl2pPr marL="342900" indent="0"><a:buNone/><a:defRPr sz="900"/></a:lvl2pPr><a:lvl3pPr marL="685800" indent="0"><a:buNone/><a:defRPr sz="750"/></a:lvl3pPr><a:lvl4pPr marL="1028700" indent="0"><a:buNone/><a:defRPr sz="675"/></a:lvl4pPr><a:lvl5pPr marL="1371600" indent="0"><a:buNone/><a:defRPr sz="675"/></a:lvl5pPr><a:lvl6pPr marL="1714500" indent="0"><a:buNone/><a:defRPr sz="675"/></a:lvl6pPr><a:lvl7pPr marL="2057400" indent="0"><a:buNone/><a:defRPr sz="675"/></a:lvl7pPr><a:lvl8pPr marL="2400300" indent="0"><a:buNone/><a:defRPr sz="675"/></a:lvl8pPr><a:lvl9pPr marL="2743200" indent="0"><a:buNone/><a:defRPr sz="675"/></a:lvl9pPr></a:lstStyle><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Date Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="10"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Footer Placeholder 5"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="11"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="7" name="Slide Number Placeholder 6"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="12"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:fld id="{C5EF2332-01BF-834F-8236-50238282D533}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="3566899855"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId8" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout8.xml"/><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout3.xml"/><Relationship Id="rId7" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout7.xml"/><Relationship Id="rId12" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="../theme/theme1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout2.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout1.xml"/><Relationship Id="rId6" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout6.xml"/><Relationship Id="rId11" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout11.xml"/><Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout5.xml"/><Relationship Id="rId10" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout10.xml"/><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout4.xml"/><Relationship Id="rId9" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout9.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sldMaster xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:bg><p:bgRef idx="1001"><a:schemeClr val="bg1"/></p:bgRef></p:bg><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title Placeholder 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="205979"/><a:ext cx="8229600" cy="857250"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr"><a:normAutofit/></a:bodyPr><a:lstStyle/><a:p><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master title style</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Text Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="1200151"/><a:ext cx="8229600" cy="3394472"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0"><a:normAutofit/></a:bodyPr><a:lstStyle/><a:p><a:pPr lvl="0"/><a:r><a:rPr lang="en-US"/><a:t>Click to edit Master text styles</a:t></a:r></a:p><a:p><a:pPr lvl="1"/><a:r><a:rPr lang="en-US"/><a:t>Second level</a:t></a:r></a:p><a:p><a:pPr lvl="2"/><a:r><a:rPr lang="en-US"/><a:t>Third level</a:t></a:r></a:p><a:p><a:pPr lvl="3"/><a:r><a:rPr lang="en-US"/><a:t>Fourth level</a:t></a:r></a:p><a:p><a:pPr lvl="4"/><a:r><a:rPr lang="en-US"/><a:t>Fifth level</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="4" name="Date Placeholder 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="dt" sz="half" idx="2"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="457200" y="4767263"/><a:ext cx="2133600" cy="273844"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr"/><a:lstStyle><a:lvl1pPr algn="l"><a:defRPr sz="900"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr></a:lstStyle><a:p><a:fld id="{241EB5C9-1307-BA42-ABA2-0BC069CD8E7F}" type="datetimeFigureOut"><a:rPr lang="en-US" smtClean="0"/><a:t>1/2/22</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Footer Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ftr" sz="quarter" idx="3"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="3124200" y="4767263"/><a:ext cx="2895600" cy="273844"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr"/><a:lstStyle><a:lvl1pPr algn="ctr"><a:defRPr sz="900"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Slide Number Placeholder 5"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="sldNum" sz="quarter" idx="4"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="6553200" y="4767263"/><a:ext cx="2133600" cy="273844"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert="horz" lIns="91440" tIns="45720" rIns="91440" bIns="45720" rtlCol="0" anchor="ctr"/><a:lstStyle><a:lvl1pPr algn="r"><a:defRPr sz="900"><a:solidFill><a:schemeClr val="tx1"><a:tint val="75000"/></a:schemeClr></a:solidFill></a:defRPr></a:lvl1pPr></a:lstStyle><a:p><a:fld id="{C5EF2332-01BF-834F-8236-50238282D533}" type="slidenum"><a:rPr lang="en-US" smtClean="0"/><a:t>‹#›</a:t></a:fld><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="3676200875"/></p:ext></p:extLst></p:cSld><p:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/><p:sldLayoutIdLst><p:sldLayoutId id="2147483649" r:id="rId1"/><p:sldLayoutId id="2147483650" r:id="rId2"/><p:sldLayoutId id="2147483651" r:id="rId3"/><p:sldLayoutId id="2147483652" r:id="rId4"/><p:sldLayoutId id="2147483653" r:id="rId5"/><p:sldLayoutId id="2147483654" r:id="rId6"/><p:sldLayoutId id="2147483655" r:id="rId7"/><p:sldLayoutId id="2147483656" r:id="rId8"/><p:sldLayoutId id="2147483657" r:id="rId9"/><p:sldLayoutId id="2147483658" r:id="rId10"/><p:sldLayoutId id="2147483659" r:id="rId11"/></p:sldLayoutIdLst><p:txStyles><p:titleStyle><a:lvl1pPr algn="ctr" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="0"/></a:spcBef><a:buNone/><a:defRPr sz="3300" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mj-lt"/><a:ea typeface="+mj-ea"/><a:cs typeface="+mj-cs"/></a:defRPr></a:lvl1pPr></p:titleStyle><p:bodyStyle><a:lvl1pPr marL="342900" indent="-342900" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="•"/><a:defRPr sz="2400" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL="685800" indent="-342900" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="–"/><a:defRPr sz="2100" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL="1028700" indent="-342900" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="•"/><a:defRPr sz="1800" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL="1371600" indent="-342900" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="–"/><a:defRPr sz="1500" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL="1714500" indent="-342900" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="»"/><a:defRPr sz="1500" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL="2057400" indent="-342900" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="•"/><a:defRPr sz="1500" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL="2400300" indent="-342900" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="•"/><a:defRPr sz="1500" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL="2743200" indent="-342900" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="•"/><a:defRPr sz="1500" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL="3086100" indent="-342900" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:spcBef><a:spcPct val="20000"/></a:spcBef><a:buFont typeface="Arial"/><a:buChar char="•"/><a:defRPr sz="1500" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl9pPr></p:bodyStyle><p:otherStyle><a:defPPr><a:defRPr lang="en-US"/></a:defPPr><a:lvl1pPr marL="0" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1350" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl1pPr><a:lvl2pPr marL="342900" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1350" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl2pPr><a:lvl3pPr marL="685800" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1350" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl3pPr><a:lvl4pPr marL="1028700" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1350" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl4pPr><a:lvl5pPr marL="1371600" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1350" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl5pPr><a:lvl6pPr marL="1714500" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1350" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl6pPr><a:lvl7pPr marL="2057400" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1350" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl7pPr><a:lvl8pPr marL="2400300" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1350" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl8pPr><a:lvl9pPr marL="2743200" algn="l" defTabSz="342900" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1"><a:defRPr sz="1350" kern="1200"><a:solidFill><a:schemeClr val="tx1"/></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:lvl9pPr></p:otherStyle></p:txStyles></p:sldMaster>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide" Target="../notesSlides/notesSlide1.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout1.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide" Target="../notesSlides/notesSlide2.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout2.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout3.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout4.xml"/></Relationships>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sld xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="ctrTitle"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" dirty="0"/><a:t>Presentation Title</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Subtitle 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="subTitle" idx="1"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" dirty="0"/><a:t>Presentation Subtitle</a:t></a:r></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="392669009"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sld>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sld xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" dirty="0"/><a:t>Slide Title</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Content Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph idx="1"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:pPr marL="0" indent="0"><a:buNone/></a:pPr><a:r><a:rPr lang="en-US" dirty="0"/><a:t>Hello</a:t></a:r><a:r><a:rPr lang="en-US"/><a:t>, world.</a:t></a:r></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="572707455"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sld>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sld xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" dirty="0"/><a:t>Section header</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Text Placeholder 2"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1"/></p:nvPr></p:nvSpPr><p:spPr/></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="3996781534"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sld>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:sld xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="4" name="Title 3"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" dirty="0"/><a:t>Slide Title for Two-Content</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="5" name="Content Placeholder 4"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph sz="half" idx="1"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" dirty="0"/><a:t>Some content on </a:t></a:r><a:r><a:rPr lang="en-US"/><a:t>the left.</a:t></a:r><a:endParaRPr lang="en-US" dirty="0"/></a:p><a:p><a:pPr marL="0" indent="0"><a:buNone/></a:pPr><a:endParaRPr lang="en-US" dirty="0"/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="6" name="Content Placeholder 5"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph sz="half" idx="2"/></p:nvPr></p:nvSpPr><p:spPr/><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" dirty="0"/><a:t>Some content on the right.</a:t></a:r></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="1324621109"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sld>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<a:tblStyleLst xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" def="{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}"/>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="1F497D"/></a:dk2><a:lt2><a:srgbClr val="EEECE1"/></a:lt2><a:accent1><a:srgbClr val="4F81BD"/></a:accent1><a:accent2><a:srgbClr val="C0504D"/></a:accent2><a:accent3><a:srgbClr val="9BBB59"/></a:accent3><a:accent4><a:srgbClr val="8064A2"/></a:accent4><a:accent5><a:srgbClr val="4BACC6"/></a:accent5><a:accent6><a:srgbClr val="F79646"/></a:accent6><a:hlink><a:srgbClr val="0000FF"/></a:hlink><a:folHlink><a:srgbClr val="800080"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="MS Pゴシック"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="宋体"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Times New Roman"/><a:font script="Hebr" typeface="Times New Roman"/><a:font script="Thai" typeface="Angsana New"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Times New Roman"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="MS Pゴシック"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="宋体"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Arial"/><a:font script="Hebr" typeface="Arial"/><a:font script="Thai" typeface="Cordia New"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="DaunPenh"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Arial"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="1"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst><a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d><a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults><a:spDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style></a:spDef><a:lnDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style></a:lnDef></a:objectDefaults><a:extraClrSchemeLst/></a:theme>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="44546A"/></a:dk2><a:lt2><a:srgbClr val="E7E6E6"/></a:lt2><a:accent1><a:srgbClr val="5B9BD5"/></a:accent1><a:accent2><a:srgbClr val="ED7D31"/></a:accent2><a:accent3><a:srgbClr val="A5A5A5"/></a:accent3><a:accent4><a:srgbClr val="FFC000"/></a:accent4><a:accent5><a:srgbClr val="4472C4"/></a:accent5><a:accent6><a:srgbClr val="70AD47"/></a:accent6><a:hlink><a:srgbClr val="0563C1"/></a:hlink><a:folHlink><a:srgbClr val="954F72"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri Light" panose="020F0302020204030204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="MS Pゴシック"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="宋体"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Times New Roman"/><a:font script="Hebr" typeface="Times New Roman"/><a:font script="Thai" typeface="Angsana New"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Times New Roman"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/></a:majorFont><a:minorFont><a:latin typeface="Calibri" panose="020F0502020204030204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="MS Pゴシック"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="宋体"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Arial"/><a:font script="Hebr" typeface="Arial"/><a:font script="Thai" typeface="Cordia New"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="DaunPenh"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Arial"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="103000"/><a:tint val="73000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:satMod val="103000"/><a:lumMod val="102000"/><a:tint val="94000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:satMod val="110000"/><a:lumMod val="100000"/><a:shade val="100000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000"/><a:satMod val="120000"/><a:shade val="78000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="6350" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="63000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"><a:tint val="95000"/><a:satMod val="170000"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="93000"/><a:satMod val="150000"/><a:shade val="98000"/><a:lumMod val="102000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="98000"/><a:satMod val="130000"/><a:shade val="90000"/><a:lumMod val="103000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="63000"/><a:satMod val="120000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults/><a:extraClrSchemeLst/><a:extLst><a:ext uri="{05A4C25C-085E-4340-85A3-A5531E510DB2}"><thm15:themeFamily xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main" name="Office Theme" id="{62F939B6-93AF-4DB8-9C6B-D6C7DFDC589F}" vid="{4A3C46E8-61CC-4603-A589-7422A47A8E4A}"/></a:ext></a:extLst></a:theme>
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<p:viewPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" lastView="sldThumbnailView"><p:normalViewPr><p:restoredLeft sz="15643" autoAdjust="0"/><p:restoredTop sz="94694" autoAdjust="0"/></p:normalViewPr><p:slideViewPr><p:cSldViewPr snapToGrid="0" snapToObjects="1"><p:cViewPr varScale="1"><p:scale><a:sx n="161" d="100"/><a:sy n="161" d="100"/></p:scale><p:origin x="560" y="200"/></p:cViewPr><p:guideLst><p:guide orient="horz" pos="1620"/><p:guide pos="2880"/></p:guideLst></p:cSldViewPr></p:slideViewPr><p:outlineViewPr><p:cViewPr><p:scale><a:sx n="33" d="100"/><a:sy n="33" d="100"/></p:scale><p:origin x="0" y="0"/></p:cViewPr></p:outlineViewPr><p:notesTextViewPr><p:cViewPr><p:scale><a:sx n="100" d="100"/><a:sy n="100" d="100"/></p:scale><p:origin x="0" y="0"/></p:cViewPr></p:notesTextViewPr><p:gridSpacing cx="76200" cy="76200"/></p:viewPr>
binary file changed (8619 → absent bytes)
binary file changed (10890 → absent bytes)
@@ -1,314 +0,0 @@--- This is a sample custom writer for pandoc. It produces output--- that is very similar to that of pandoc's HTML writer.--- There is one new feature: code blocks marked with class 'dot'--- are piped through graphviz and images are included in the HTML--- output using 'data:' URLs.------ Invoke with: pandoc -t sample.lua------ Note: you need not have lua installed on your system to use this--- custom writer. However, if you do have lua installed, you can--- use it to test changes to the script. 'lua sample.lua' will--- produce informative error messages if your code contains--- syntax errors.---- Character escaping-local function escape(s, in_attribute)- return s:gsub("[<>&\"']",- function(x)- if x == '<' then- return '<'- elseif x == '>' then- return '>'- elseif x == '&' then- return '&'- elseif x == '"' then- return '"'- elseif x == "'" then- return '''- else- return x- end- end)-end---- Helper function to convert an attributes table into--- a string that can be put into HTML tags.-local function attributes(attr)- local attr_table = {}- for x,y in pairs(attr) do- if y and y ~= "" then- table.insert(attr_table, ' ' .. x .. '="' .. escape(y,true) .. '"')- end- end- return table.concat(attr_table)-end---- Run cmd on a temporary file containing inp and return result.-local function pipe(cmd, inp)- local tmp = os.tmpname()- local tmph = io.open(tmp, "w")- tmph:write(inp)- tmph:close()- local outh = io.popen(cmd .. " " .. tmp,"r")- local result = outh:read("*all")- outh:close()- os.remove(tmp)- return result-end---- Table to store footnotes, so they can be included at the end.-local notes = {}---- Blocksep is used to separate block elements.-function Blocksep()- return "\n\n"-end---- This function is called once for the whole document. Parameters:--- body is a string, metadata is a table, variables is a table.--- This gives you a fragment. You could use the metadata table to--- fill variables in a custom lua template. Or, pass `--template=...`--- to pandoc, and pandoc will add do the template processing as--- usual.-function Doc(body, metadata, variables)- local buffer = {}- local function add(s)- table.insert(buffer, s)- end- add(body)- if #notes > 0 then- add('<ol class="footnotes">')- for _,note in pairs(notes) do- add(note)- end- add('</ol>')- end- return table.concat(buffer,'\n')-end---- The functions that follow render corresponding pandoc elements.--- s is always a string, attr is always a table of attributes, and--- items is always an array of strings (the items in a list).--- Comments indicate the types of other variables.--function Str(s)- return escape(s)-end--function Space()- return " "-end--function LineBreak()- return "<br/>"-end--function Emph(s)- return "<em>" .. s .. "</em>"-end--function Strong(s)- return "<strong>" .. s .. "</strong>"-end--function Subscript(s)- return "<sub>" .. s .. "</sub>"-end--function Superscript(s)- return "<sup>" .. s .. "</sup>"-end--function SmallCaps(s)- return '<span style="font-variant: small-caps;">' .. s .. '</span>'-end--function Strikeout(s)- return '<del>' .. s .. '</del>'-end--function Link(s, src, tit)- return "<a href='" .. escape(src,true) .. "' title='" ..- escape(tit,true) .. "'>" .. s .. "</a>"-end--function Image(s, src, tit)- return "<img src='" .. escape(src,true) .. "' title='" ..- escape(tit,true) .. "'/>"-end--function Code(s, attr)- return "<code" .. attributes(attr) .. ">" .. escape(s) .. "</code>"-end--function InlineMath(s)- return "\\(" .. escape(s) .. "\\)"-end--function DisplayMath(s)- return "\\[" .. escape(s) .. "\\]"-end--function Note(s)- local num = #notes + 1- -- insert the back reference right before the final closing tag.- s = string.gsub(s,- '(.*)</', '%1 <a href="#fnref' .. num .. '">↩</a></')- -- add a list item with the note to the note table.- table.insert(notes, '<li id="fn' .. num .. '">' .. s .. '</li>')- -- return the footnote reference, linked to the note.- return '<a id="fnref' .. num .. '" href="#fn' .. num ..- '"><sup>' .. num .. '</sup></a>'-end--function Span(s, attr)- return "<span" .. attributes(attr) .. ">" .. s .. "</span>"-end--function Cite(s, cs)- local ids = {}- for _,cit in ipairs(cs) do- table.insert(ids, cit.citationId)- end- return "<span class=\"cite\" data-citation-ids=\"" .. table.concat(ids, ",") ..- "\">" .. s .. "</span>"-end--function Plain(s)- return s-end--function Para(s)- return "<p>" .. s .. "</p>"-end---- lev is an integer, the header level.-function Header(lev, s, attr)- return "<h" .. lev .. attributes(attr) .. ">" .. s .. "</h" .. lev .. ">"-end--function BlockQuote(s)- return "<blockquote>\n" .. s .. "\n</blockquote>"-end--function HorizontalRule()- return "<hr/>"-end--function CodeBlock(s, attr)- -- If code block has class 'dot', pipe the contents through dot- -- and base64, and include the base64-encoded png as a data: URL.- if attr.class and string.match(' ' .. attr.class .. ' ',' dot ') then- local png = pipe("base64", pipe("dot -Tpng", s))- return '<img src="data:image/png;base64,' .. png .. '"/>'- -- otherwise treat as code (one could pipe through a highlighter)- else- return "<pre><code" .. attributes(attr) .. ">" .. escape(s) ..- "</code></pre>"- end-end--function BulletList(items)- local buffer = {}- for _, item in pairs(items) do- table.insert(buffer, "<li>" .. item .. "</li>")- end- return "<ul>\n" .. table.concat(buffer, "\n") .. "\n</ul>"-end--function OrderedList(items)- local buffer = {}- for _, item in pairs(items) do- table.insert(buffer, "<li>" .. item .. "</li>")- end- return "<ol>\n" .. table.concat(buffer, "\n") .. "\n</ol>"-end---- Revisit association list STackValue instance.-function DefinitionList(items)- local buffer = {}- for _,item in pairs(items) do- for k, v in pairs(item) do- table.insert(buffer,"<dt>" .. k .. "</dt>\n<dd>" ..- table.concat(v,"</dd>\n<dd>") .. "</dd>")- end- end- return "<dl>\n" .. table.concat(buffer, "\n") .. "\n</dl>"-end---- Convert pandoc alignment to something HTML can use.--- align is AlignLeft, AlignRight, AlignCenter, or AlignDefault.-function html_align(align)- if align == 'AlignLeft' then- return 'left'- elseif align == 'AlignRight' then- return 'right'- elseif align == 'AlignCenter' then- return 'center'- else- return 'left'- end-end---- Caption is a string, aligns is an array of strings,--- widths is an array of floats, headers is an array of--- strings, rows is an array of arrays of strings.-function Table(caption, aligns, widths, headers, rows)- local buffer = {}- local function add(s)- table.insert(buffer, s)- end- add("<table>")- if caption ~= "" then- add("<caption>" .. caption .. "</caption>")- end- if widths and widths[1] ~= 0 then- for _, w in pairs(widths) do- add('<col width="' .. string.format("%d%%", w * 100) .. '" />')- end- end- local header_row = {}- local empty_header = true- for i, h in pairs(headers) do- local align = html_align(aligns[i])- table.insert(header_row,'<th align="' .. align .. '">' .. h .. '</th>')- empty_header = empty_header and h == ""- end- if empty_header then- head = ""- else- add('<tr class="header">')- for _,h in pairs(header_row) do- add(h)- end- add('</tr>')- end- local class = "even"- for _, row in pairs(rows) do- class = (class == "even" and "odd") or "even"- add('<tr class="' .. class .. '">')- for i,c in pairs(row) do- add('<td align="' .. html_align(aligns[i]) .. '">' .. c .. '</td>')- end- add('</tr>')- end- add('</table')- return table.concat(buffer,'\n')-end--function Div(s, attr)- return "<div" .. attributes(attr) .. ">\n" .. s .. "</div>"-end---- The following code will produce runtime warnings when you haven't defined--- all of the functions you need for the custom writer, so it's useful--- to include when you're working on a writer.-local meta = {}-meta.__index =- function(_, key)- io.stderr:write(string.format("WARNING: Undefined function '%s'\n",key))- return function() return "" end- end-setmetatable(_G, meta)-
@@ -0,0 +1,36 @@+$--+$-- Affiliations+$--+<aff id="aff-$it.id$">+$-- wrap affiliation if it has a known institution identifier+$if(it.group)$+<institution content-type="group">${it.group}</institution>+$endif$+$if(it.department)$+<institution content-type="dept">${it.department}</institution>+$endif$+<institution-wrap>+$if(it.organization)$+<institution>${it.organization}</institution>+$else$+<institution>${it.name}</institution>+$endif$+$if(it.isni)$+<institution-id institution-id-type="ISNI">${it.isni}</institution-id>+$endif$+$if(it.ringgold)$+<institution-id institution-id-type="Ringgold">${it.ringgold}</institution-id>+$endif$+$if(it.ror)$+<institution-id institution-id-type="ROR">${it.ror}</institution-id>+$endif$+$for(it.pid)$+<institution-id institution-id-type="${it.type}">${it.id}</institution-id>+$endfor$+</institution-wrap>$if(it.street-address)$,+$for(it.street-address)$+<addr-line>${it}</addr-line>$sep$,+$endfor$+$else$$if(it.city)$, <city>$it.city$</city>$endif$$endif$$if(it.country)$,+<country$if(it.country-code)$ country="$it.country-code$"$endif$>$it.country$</country>$endif$+</aff>
@@ -0,0 +1,10 @@+\usepackage{bookmark}+\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available+\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$}+$if(links-as-notes)$+% Make links footnotes instead of hotlinks:+\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}+$endif$+$if(verbatim-in-note)$+\VerbatimFootnotes % allow verbatim text in footnotes+$endif$
@@ -0,0 +1,252 @@+$if(article.type)$+<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="$article.type$">+$else$+<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">+$endif$+<front>+<journal-meta>+$if(journal.publisher-id)$+<journal-id journal-id-type="publisher-id">$journal.publisher-id$</journal-id>+$endif$+$if(journal.nlm-ta)$+<journal-id journal-id-type="nlm-ta">$journal.nlm-ta$</journal-id>+$endif$+$if(journal.pmc)$+<journal-id journal-id-type="pmc">$journal.pmc$</journal-id>+$endif$+$-- Fallback: an empty journal-id in case none is available.+$if(journal.publisher-id)$+$elseif(journal.nlm-ta)$+$elseif(journal.pmc)$+$else$+<journal-id></journal-id>+$endif$+<journal-title-group>+$if(journal.title)$+<journal-title>$journal.title$</journal-title>+$endif$+$if(journal.abbrev-title)$+<abbrev-journal-title>$journal.abbrev-title$</abbrev-journal-title>+$endif$+</journal-title-group>+$if(journal.pissn)$+<issn publication-format="print">$journal.pissn$</issn>+$endif$+$if(journal.eissn)$+<issn publication-format="electronic">$journal.eissn$</issn>+$endif$+$-- At least one issn element is required; use empty issn as fallback+$if(journal.pissn)$+$elseif(journal.eissn)$+$else$+<issn></issn>+$endif$+<publisher>+<publisher-name>$journal.publisher-name$</publisher-name>+$if(journal.publisher-loc)$+<publisher-loc>$journal.publisher-loc$</publisher-loc>+$endif$+</publisher>+</journal-meta>+<article-meta>+$if(article.publisher-id)$+<article-id pub-id-type="publisher-id">$article.publisher-id$</article-id>+$endif$+$if(article.doi)$+<article-id pub-id-type="doi">$article.doi$</article-id>+$endif$+$if(article.pmid)$+<article-id pub-id-type="pmid">$article.pmid$</article-id>+$endif$+$if(article.pmcid)$+<article-id pub-id-type="pmcid">$article.pmcid$</article-id>+$endif$+$if(article.art-access-id)$+<article-id pub-id-type="art-access-id">$article.art-access-id$</article-id>+$endif$+$if(article.heading)$+<article-categories>+<subj-group subj-group-type="heading">+<subject>$article.heading$</subject>+</subj-group>+$if(article.categories)$+<subj-group subj-group-type="categories">+$for(article.categories)$+<subject>$article.categories$</subject>+$endfor$+</subj-group>+$endif$+</article-categories>+$endif$+$if(title)$+<title-group>+<article-title>$title$</article-title>+$if(subtitle)$+<subtitle>${subtitle}</subtitle>+$endif$+</title-group>+$endif$+$if(author)$+<contrib-group>+$for(author)$+<contrib contrib-type="author"$if(author.equal-contrib)$ equal-contrib="yes"$endif$$if(author.cor-id)$ corresp="yes"$endif$>+$if(author.orcid)$+<contrib-id contrib-id-type="orcid">$author.orcid$</contrib-id>+$endif$+$if(author.surname)$+<name>+<surname>$if(author.non-dropping-particle)$${author.non-dropping-particle} $endif$$author.surname$</surname>+<given-names>$author.given-names$$if(author.dropping-particle)$ ${author.dropping-particle}$endif$</given-names>+$if(author.prefix)$+<prefix>${author.prefix}</prefix>+$endif$+$if(author.suffix)$+<suffix>${author.suffix}</suffix>+$endif$+</name>+$elseif(author.name)$+<string-name>$author.name$</string-name>+$else$+<string-name>$author$</string-name>+$endif$+$for(author.roles)$+$if(it.credit)$+<role vocab="credit"$if(it.degree)$ degree-contribution="$it.degree$"$endif$+ vocab-identifier="https://credit.niso.org/"+ vocab-term-identifier="https://credit.niso.org/contributor-roles/$it.credit$/"+ vocab-term="$it.credit-name$"+>$if(it.name)$$it.name$$else$$it.credit-name$$endif$</role>+$elseif(it.name)$+<role>$it.name$</role>+$endif$+$endfor$+$if(author.email)$+<email>$author.email$</email>+$endif$+$-- if affiliations are listed separately, then create links. Otherwise+$-- include them here.+$if(affiliation)$+$for(author.affiliation)$+<xref ref-type="aff" rid="aff-$author.affiliation$"/>+$endfor$+$else$+$for(author.affiliation)$+${ it:affiliations.jats() }+$endfor$+$endif$+$if(author.cor-id)$+<xref ref-type="corresp" rid="cor-$author.cor-id$"><sup>*</sup></xref>+$endif$+</contrib>+$endfor$+$for(affiliation)$+${ it:affiliations.jats() }+$endfor$+</contrib-group>+$endif$+$if(article.author-notes)$+<author-notes>+$if(article.author-notes.corresp)$+$for(article.author-notes.corresp)$+<corresp id="cor-$article.author-notes.corresp.id$">* E-mail: <email>$article.author-notes.corresp.email$</email></corresp>+$endfor$+$endif$+$if(article.author-notes.conflict)$+<fn fn-type="conflict"><p>$article.author-notes.conflict$</p></fn>+$endif$+$if(article.author-notes.con)$+<fn fn-type="con"><p>$article.author-notes.con$</p></fn>+$endif$+</author-notes>+$endif$+$if(date)$+<pub-date date-type="$if(date.type)$$date.type$$else$pub$endif$" publication-format="electronic"$if(date.iso-8601)$ iso-8601-date="$date.iso-8601$"$endif$>+$if(date.day)$+<day>$date.day$</day>+$endif$+$if(date.month)$+<month>$date.month$</month>+$endif$+<year>$date.year$</year>+</pub-date>+$endif$+$if(article.volume)$+<volume>$article.volume$</volume>+$endif$+$if(article.issue)$+<issue>$article.issue$</issue>+$endif$+$if(article.fpage)$+<fpage>$article.fpage$</fpage>+$endif$+$if(article.lpage)$+<lpage>$article.lpage$</lpage>+$endif$+$if(article.elocation-id)$+<elocation-id>$article.elocation-id$</elocation-id>+$endif$+$if(history)$+<history>+</history>+$endif$+<permissions>+$for(copyright.statement)$+<copyright-statement>$copyright.statement$</copyright-statement>+$endfor$+$for(copyright.year)$+<copyright-year>$copyright.year$</copyright-year>+$endfor$+$for(copyright.holder)$+<copyright-holder>$copyright.holder$</copyright-holder>+$endfor$+$if(copyright.text)$+<license license-type="$copyright.type$" xlink:href="$copyright.link$">+<license-p>$copyright.text$</license-p>+</license>+$endif$+$for(license)$+<license$if(it.type)$ license-type="${it.type}"$endif$>+$if(it.link)$+<ali:license_ref xmlns:ali="http://www.niso.org/schemas/ali/1.0/">${it.link}</ali:license_ref>+$endif$+<license-p>$if(it.text)$${it.text}$else$${it}$endif$</license-p>+</license>+$endfor$+</permissions>+$if(abstract)$+<abstract>+$abstract$+</abstract>+$endif$+$if(tags)$+<kwd-group kwd-group-type="author">+$for(tags)$+<kwd>$tags$</kwd>+$endfor$+</kwd-group>+$endif$+$if(article.funding-statement)$+<funding-group>+<funding-statement>$article.funding-statement$</funding-statement>+</funding-group>+$endif$+</article-meta>+$if(notes)$+<notes>$notes$</notes>+$endif$+</front>+<body>+$body$+</body>+<back>+$if(back)$+$back$+$endif$+</back>+$if(floats-group)$+<floats-group>+$floats-group$+</floats-group>+$endif$+</article>+
@@ -0,0 +1,263 @@+$if(linestretch)$+\usepackage{setspace}+$endif$+$--+$-- paragraph formatting+$--+$if(indent)$+$else$+\makeatletter+\@ifundefined{KOMAClassName}{% if non-KOMA class+ \IfFileExists{parskip.sty}{%+ \usepackage{parskip}+ }{% else+ \setlength{\parindent}{0pt}+ \setlength{\parskip}{6pt plus 2pt minus 1pt}}+}{% if KOMA class+ \KOMAoptions{parskip=half}}+\makeatother+$endif$+$if(beamer)$+$else$+$if(block-headings)$+% Make \paragraph and \subparagraph free-standing+\makeatletter+\ifx\paragraph\undefined\else+ \let\oldparagraph\paragraph+ \renewcommand{\paragraph}{+ \@ifstar+ \xxxParagraphStar+ \xxxParagraphNoStar+ }+ \newcommand{\xxxParagraphStar}[1]{\oldparagraph*{#1}\mbox{}}+ \newcommand{\xxxParagraphNoStar}[1]{\oldparagraph{#1}\mbox{}}+\fi+\ifx\subparagraph\undefined\else+ \let\oldsubparagraph\subparagraph+ \renewcommand{\subparagraph}{+ \@ifstar+ \xxxSubParagraphStar+ \xxxSubParagraphNoStar+ }+ \newcommand{\xxxSubParagraphStar}[1]{\oldsubparagraph*{#1}\mbox{}}+ \newcommand{\xxxSubParagraphNoStar}[1]{\oldsubparagraph{#1}\mbox{}}+\fi+\makeatother+$endif$+$endif$+$--+$-- verbatim in notes+$--+$if(verbatim-in-note)$+\usepackage{fancyvrb}+$endif$+$-- highlighting+$if(listings)$+\usepackage{listings}+\newcommand{\passthrough}[1]{#1}+\lstset{defaultdialect=[5.3]Lua}+\lstset{defaultdialect=[x86masm]Assembler}+$endif$+$if(lhs)$+\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}+$endif$+$if(highlighting-macros)$+$highlighting-macros$+$endif$+$--+$-- tables+$--+$if(tables)$+\usepackage{longtable,booktabs,array}+\newcounter{none} % for unnumbered tables+$if(multirow)$+\usepackage{multirow}+$endif$+\usepackage{calc} % for calculating minipage widths+$if(beamer)$+\usepackage{caption}+% Make caption package work with longtable+\makeatletter+\def\fnum@table{\tablename~\thetable}+\makeatother+$else$+% Correct order of tables after \paragraph or \subparagraph+\usepackage{etoolbox}+\makeatletter+\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}+\makeatother+% Allow footnotes in longtable head/foot+\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}+\makesavenoteenv{longtable}+$endif$+$endif$+$--+$-- graphics+$--+$if(graphics)$+\usepackage{graphicx}+\makeatletter+\newsavebox\pandoc@box+\newcommand*\pandocbounded[1]{% scales image to fit in text height/width+ \sbox\pandoc@box{#1}%+ \Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%+ \Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%+ \ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both+ \ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%+ \else\usebox{\pandoc@box}%+ \fi%+}+% Set default figure placement to htbp+\def\fps@figure{htbp}+\makeatother+$endif$+$if(svg)$+\usepackage{svg}+$endif$+$--+$-- strikeout/underline+$--+$if(strikeout)$+\ifLuaTeX+ \usepackage{luacolor}+ \usepackage[soul]{lua-ul}+\else+ \usepackage{soul}+$if(beamer)$+ \makeatletter+ \let\HL\hl+ \renewcommand\hl{% fix for beamer highlighting+ \let\set@color\beamerorig@set@color+ \let\reset@color\beamerorig@reset@color+ \HL}+ \makeatother+$endif$+$if(CJKmainfont)$+ \ifXeTeX+ % soul's \st doesn't work for CJK:+ \usepackage{xeCJKfntef}+ \renewcommand{\st}[1]{\sout{#1}}+ \fi+$endif$+\fi+$endif$+$--+$-- CSL citations+$--+$if(csl-refs)$+% definitions for citeproc citations+\NewDocumentCommand\citeproctext{}{}+\NewDocumentCommand\citeproc{mm}{%+ \begingroup\def\citeproctext{#2}\cite{#1}\endgroup}+\makeatletter+ % allow citations to break across lines+ \let\@cite@ofmt\@firstofone+ % avoid brackets around text for \cite:+ \def\@biblabel#1{}+ \def\@cite#1#2{{#1\if@tempswa , #2\fi}}+\makeatother+\newlength{\cslhangindent}+\setlength{\cslhangindent}{1.5em}+\newlength{\csllabelwidth}+\setlength{\csllabelwidth}{3em}+\newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing+ {\begin{list}{}{%+ \setlength{\itemindent}{0pt}+ \setlength{\leftmargin}{0pt}+ \setlength{\parsep}{0pt}+ % turn on hanging indent if param 1 is 1+ \ifodd #1+ \setlength{\leftmargin}{\cslhangindent}+ \setlength{\itemindent}{-1\cslhangindent}+ \fi+ % set entry spacing+ \setlength{\itemsep}{#2\baselineskip}}}+ {\end{list}}+\usepackage{calc}+\newcommand{\CSLBlock}[1]{\hfill\break\parbox[t]{\linewidth}{\strut\ignorespaces#1\strut}}+\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{\strut#1\strut}}+\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}}+\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}+$endif$+$--+$-- Babel language support+$--+$if(lang)$+\ifLuaTeX+\usepackage[bidi=basic$if(shorthands)$$else$,shorthands=off$endif$$for(babeloptions)$,$babeloptions$$endfor$]{babel}+\else+\usepackage[bidi=default$if(shorthands)$$else$,shorthands=off$endif$$for(babeloptions)$,$babeloptions$$endfor$]{babel}+\fi+$if(babel-lang)$+$if(mainfont)$+\ifPDFTeX+\else+\babelfont{rm}[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$}+\fi+$endif$+$endif$+$for(babelfonts/pairs)$+\babelfont[$babelfonts.key$]{rm}{$babelfonts.value$}+$endfor$+\ifLuaTeX+ \usepackage{selnolig} % disable illegal ligatures+\fi+$endif$+$--+$-- pagestyle+$--+$if(pagestyle)$+\pagestyle{$pagestyle$}+$endif$+$--+$-- prevent overfull lines+$--+\setlength{\emergencystretch}{3em} % prevent overfull lines+$--+$-- tight lists+$--+\providecommand{\tightlist}{%+ \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}+$--+$-- subfigure support+$--+$if(subfigure)$+\usepackage{subcaption}+$endif$+$--+$-- text direction support for pdftex+$--+$if(dir)$+\ifPDFTeX+ \TeXXeTstate=1+ \newcommand{\RL}[1]{\beginR #1\endR}+ \newcommand{\LR}[1]{\beginL #1\endL}+ \newenvironment{RTL}{\beginR}{\endR}+ \newenvironment{LTR}{\beginL}{\endL}+\fi+\ifluatex+ \newcommand{\RL}[1]{\bgroup\textdir TRT#1\egroup}+ \newcommand{\LR}[1]{\bgroup\textdir TLT#1\egroup}+ \newenvironment{RTL}{\textdir TRT\pardir TRT\bodydir TRT}{}+ \newenvironment{LTR}{\textdir TLT\pardir TLT\bodydir TLT}{}+\fi+$endif$+$--+$-- bibliography support support for natbib and biblatex+$--+$if(natbib)$+\usepackage[$natbiboptions$]{natbib}+\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}+$endif$+$if(biblatex)$+\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}+$for(bibliography)$+\addbibresource{$bibliography$}+$endfor$+$endif$+$--+$-- csquotes+$--+$if(csquotes)$+\usepackage[$for(csquotesoptions)$$csquotesoptions$$sep$,$endfor$]{csquotes}+$endif$
@@ -0,0 +1,21 @@+$if(titleblock)$+$titleblock$++$endif$+$for(header-includes)$+$header-includes$++$endfor$+$for(include-before)$+$include-before$++$endfor$+$if(toc)$+$table-of-contents$++$endif$+$body$+$for(include-after)$++$include-after$+$endfor$
@@ -1,14 +1,31 @@ $if(titleblock)$-$title$-$for(author)$-:author: $author$-$endfor$+= $title$+$if(author)$+$for(author)$$author$$sep$; $endfor$ $if(date)$-:date: $date$+$date$ $endif$+$elseif(date)$+:revdate: $date$+$endif$+$if(keywords)$+:keywords: $for(keywords)$$keywords$$sep$, $endfor$+$endif$+$if(lang)$+:lang: $lang$+$endif$ $if(toc)$ :toc: $endif$+$if(math)$+:stem: latexmath+$endif$++$endif$+$if(abstract)$+[abstract]+== Abstract+$abstract$ $endif$ $for(header-includes)$
@@ -0,0 +1,1 @@+$body$
@@ -1,172 +1,199 @@-\documentclass[$if(fontsize)$$fontsize$,$endif$$if(handout)$handout,$endif$$if(beamer)$ignorenonframetext,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}-$if(theme)$-\usetheme{$theme$}-$endif$-$if(colortheme)$-\usecolortheme{$colortheme$}-$endif$-$if(fonttheme)$-\usefonttheme{$fonttheme$}-$endif$-\setbeamertemplate{caption}[numbered]-\setbeamertemplate{caption label separator}{:}-\setbeamercolor{caption name}{fg=normal text.fg}-\usepackage{amssymb,amsmath}-\usepackage{ifxetex,ifluatex}-\usepackage{fixltx2e} % provides \textsubscript-\usepackage{lmodern}-\ifxetex- \usepackage{fontspec,xltxtra,xunicode}- \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}- \newcommand{\euro}{€}-\else- \ifluatex- \usepackage{fontspec}- \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}- \newcommand{\euro}{€}- \else- \usepackage[T1]{fontenc}- \usepackage[utf8]{inputenc}- $if(euro)$- \usepackage{eurosym}- $endif$- \fi-\fi-% use upquote if available, for straight quotes in verbatim environments-\IfFileExists{upquote.sty}{\usepackage{upquote}}{}-% use microtype if available-\IfFileExists{microtype.sty}{\usepackage{microtype}}{}-$if(natbib)$-\usepackage{natbib}-\bibliographystyle{plainnat}-$endif$-$if(biblatex)$-\usepackage{biblatex}-$if(biblio-files)$-\bibliography{$biblio-files$}-$endif$-$endif$-$if(listings)$-\usepackage{listings}+$passoptions.latex()$+\documentclass[+$if(fontsize)$+ $fontsize$, $endif$-$if(lhs)$-\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}+ ignorenonframetext,+$if(handout)$+ handout, $endif$-$if(highlighting-macros)$-$highlighting-macros$+$if(aspectratio)$+ aspectratio=$aspectratio$, $endif$-$if(verbatim-in-note)$-\usepackage{fancyvrb}+$if(babel-lang)$+ $babel-lang$, $endif$-$if(tables)$-\usepackage{longtable,booktabs}-\usepackage{caption}-% These lines are needed to make table captions work with longtable:-\makeatletter-\def\fnum@table{\tablename~\thetable}-\makeatother+$for(classoption)$+ $classoption$$sep$,+$endfor$+]{$documentclass$}+$if(geometry)$+\geometry{$for(geometry)$$geometry$$sep$,$endfor$} $endif$-$if(url)$-\usepackage{url}+\newif\ifbibliography+$if(background-image)$+\usebackgroundtemplate{%+ \includegraphics[width=\paperwidth]{$background-image$}%+}+% In beamer background-image does not work well when other images are used, so this is the workaround+\pgfdeclareimage[width=\paperwidth,height=\paperheight]{background}{$background-image$}+\usebackgroundtemplate{\pgfuseimage{background}} $endif$-$if(graphics)$-\usepackage{graphicx}-\makeatletter-\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}-\def\maxheight{\ifdim\Gin@nat@height>\textheight0.8\textheight\else\Gin@nat@height\fi}-\makeatother-% Scale images if necessary, so that they will not overflow the page-% margins by default, and it is still possible to overwrite the defaults-% using explicit options in \includegraphics[width, height, ...]{}-\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}+\usepackage{pgfpages}+\setbeamertemplate{caption}[numbered]+\setbeamertemplate{caption label separator}{: }+\setbeamercolor{caption name}{fg=normal text.fg}+\beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$+$--+$-- section numbering+$--+$if(numbersections)$+$else$+% remove section numbering+\setbeamertemplate{part page}{+ \centering+ \begin{beamercolorbox}[sep=16pt,center]{part title}+ \usebeamerfont{part title}\insertpart\par+ \end{beamercolorbox}+}+\setbeamertemplate{section page}{+ \centering+ \begin{beamercolorbox}[sep=12pt,center]{section title}+ \usebeamerfont{section title}\insertsection\par+ \end{beamercolorbox}+}+\setbeamertemplate{subsection page}{+ \centering+ \begin{beamercolorbox}[sep=8pt,center]{subsection title}+ \usebeamerfont{subsection title}\insertsubsection\par+ \end{beamercolorbox}+} $endif$--% Comment these out if you don't want a slide with just the-% part/section/subsection/subsubsection title:+$for(beameroption)$+\setbeameroption{$beameroption$}+$endfor$+% Prevent slide breaks in the middle of a paragraph+\widowpenalties 1 10000+\raggedbottom+$if(section-titles)$ \AtBeginPart{- \let\insertpartnumber\relax- \let\partname\relax \frame{\partpage} } \AtBeginSection{- \let\insertsectionnumber\relax- \let\sectionname\relax- \frame{\sectionpage}+ \ifbibliography+ \else+ \frame{\sectionpage}+ \fi } \AtBeginSubsection{- \let\insertsubsectionnumber\relax- \let\subsectionname\relax \frame{\subsectionpage} }--$if(strikeout)$-\usepackage[normalem]{ulem}-% avoid problems with \sout in headers with hyperref:-\pdfstringdefDisableCommands{\renewcommand{\sout}{}} $endif$-\setlength{\parindent}{0pt}-\setlength{\parskip}{6pt plus 2pt minus 1pt}-\setlength{\emergencystretch}{3em} % prevent overfull lines-$if(numbersections)$-$else$-\setcounter{secnumdepth}{0}+$fonts.latex()$+$-- Set Beamer theme before user font settings so they can override theme+$if(theme)$+\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$} $endif$-$if(verbatim-in-note)$-\VerbatimFootnotes % allows verbatim text in footnotes+$if(colortheme)$+\usecolortheme[$for(colorthemeoptions)$$colorthemeoptions$$sep$,$endfor$]{$colortheme$} $endif$-$if(lang)$-\usepackage[$lang$]{babel}+$if(fonttheme)$+\usefonttheme[$for(fontthemeoptions)$$fontthemeoptions$$sep$,$endfor$]{$fonttheme$} $endif$+$if(mainfont)$+\usefonttheme{serif} % use mainfont rather than sansfont for slide text+$endif$+$if(innertheme)$+\useinnertheme[$for(innerthemeoptions)$$innerthemeoptions$$sep$,$endfor$]{$innertheme$}+$endif$+$if(outertheme)$+\useoutertheme[$for(outerthemeoptions)$$outerthemeoptions$$sep$,$endfor$]{$outertheme$}+$endif$+$font-settings.latex()$+$common.latex()$ $for(header-includes)$ $header-includes$ $endfor$+$after-header-includes.latex()$+$hypersetup.latex()$ $if(title)$-\title{$title$}+\title$if(shorttitle)$[$shorttitle$]$endif${\texorpdfstring{$title$}{$title-meta$}$if(thanks)$\thanks{$thanks$}$endif$} $endif$ $if(subtitle)$-\subtitle{$subtitle$}+\subtitle$if(shortsubtitle)$[$shortsubtitle$]$endif${\texorpdfstring{$subtitle$}{$subtitle-meta$}} $endif$-$if(author)$-\author{$for(author)$$author$$sep$ \and $endfor$}+\author$if(shortauthor)$[$shortauthor$]$endif${\texorpdfstring{$for(author)$$author$$sep$ \and $endfor$}{$author-meta$}}+\date$if(shortdate)$[$shortdate$]$endif${$date$}+$if(institute)$+\institute$if(shortinstitute)$[$shortinstitute$]$endif${$for(institute)$$institute$$sep$ \and $endfor$} $endif$-\date{$date$}+$if(titlegraphic)$+\titlegraphic{+$for(titlegraphic)$+ \includegraphics$if(titlegraphicoptions)$[$for(titlegraphicoptions)$$titlegraphicoptions$$sep$, $endfor$]$endif${$titlegraphic$}$sep$\enspace+$endfor$}+$endif$+$if(logo)$+\logo{\includegraphics$if(logooptions)$[$for(logooptions)$$logooptions$$sep$, $endfor$]$endif${$logo$}}+$endif$ \begin{document} $if(title)$ \frame{\titlepage}+$if(abstract)$+\begin{abstract}+$abstract$+\end{abstract} $endif$+$endif$ $for(include-before)$ $include-before$ $endfor$ $if(toc)$-\begin{frame}-\tableofcontents[hideallsubsections]+$if(toc-title)$+\renewcommand*\contentsname{$toc-title$}+$endif$+\begin{frame}[allowframebreaks]+$if(toc-title)$+ \frametitle{$toc-title$}+$endif$+ \setcounter{tocdepth}{$toc-depth$}+ \tableofcontents \end{frame}-+\setcounter{tocdepth}{$toc-depth$}+\tableofcontents+} $endif$+$if(lof)$+\listoffigures+$endif$+$if(lot)$+\listoftables+$endif$+$if(linestretch)$+\setstretch{$linestretch$}+$endif$ $body$ $if(natbib)$-$if(biblio-files)$+$if(bibliography)$ $if(biblio-title)$-$if(book-class)$+$if(has-chapters)$ \renewcommand\bibname{$biblio-title$} $else$ \renewcommand\refname{$biblio-title$} $endif$ $endif$ \begin{frame}[allowframebreaks]{$biblio-title$}-\bibliography{$biblio-files$}+$if(nocite-ids)$+ \nocite{$for(nocite-ids)$$it$$sep$, $endfor$}+$endif$+ \bibliographytrue+ \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} \end{frame} $endif$ $endif$ $if(biblatex)$ \begin{frame}[allowframebreaks]{$biblio-title$}-\printbibliography[heading=none]+$if(nocite-ids)$+ \nocite{$for(nocite-ids)$$it$$sep$, $endfor$}+$endif$+ \bibliographytrue+ \printbibliography[heading=none] \end{frame} $endif$
@@ -0,0 +1,10 @@+$for(header-includes)$+$header-includes$+$endfor$+$for(include-before)$+$include-before$+$endfor$+$body$+$for(include-after)$+$include-after$+$endfor$
@@ -0,0 +1,10 @@+$for(header-includes)$+$header-includes$+$endfor$+$for(include-before)$+$include-before$+$endfor$+$body$+$for(include-after)$+$include-after$+$endfor$
@@ -0,0 +1,103 @@+<!DOCTYPE html>+<html xmlns="http://www.w3.org/1999/xhtml" lang="$lang$" xml:lang="$lang$"$if(dir)$ dir="$dir$"$endif$>+<head>+ <meta charset="utf-8" />+ <meta name="generator" content="pandoc" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />+$for(author-meta)$+ <meta name="author" content="$author-meta$" />+$endfor$+$if(date-meta)$+ <meta name="dcterms.date" content="$date-meta$" />+$endif$+$if(keywords)$+ <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />+$endif$+$if(description-meta)$+ <meta name="description" content="$description-meta$" />+$endif$+ <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>+ <style>+ div.sitenav { display: flex; flex-direction: row; flex-wrap: wrap; }+ span.navlink { flex: 1; }+ span.navlink-label { display: inline-block; min-width: 4em; }+ $styles.html()$+ </style>+$for(css)$+ <link rel="stylesheet" href="$css$" />+$endfor$+$for(header-includes)$+ $header-includes$+$endfor$+$if(math)$+ $math$+$endif$+</head>+<body>+$for(include-before)$+$include-before$+$endfor$+<nav id="sitenav">+<div class="sitenav">+<span class="navlink">+$if(up.url)$+<span class="navlink-label">Up:</span> <a href="$up.url$" accesskey="u" rel="up">$up.title$</a>+$endif$+</span>+<span class="navlink">+$if(top)$+<span class="navlink-label">Top:</span> <a href="$top.url$" accesskey="t" rel="top">$top.title$</a>+$endif$+</span>+</div>+<div class="sitenav">+<span class="navlink">+$if(next.url)$+<span class="navlink-label">Next:</span> <a href="$next.url$" accesskey="n" rel="next">$next.title$</a>+$endif$+</span>+<span class="navlink">+$if(previous.url)$+<span class="navlink-label">Previous:</span> <a href="$previous.url$" accesskey="p" rel="previous">$previous.title$</a>+$endif$+</span>+</div>+</nav>+$if(top)$+$-- only print title block if this is NOT the top page+$else$+$if(title)$+<header id="title-block-header">+<h1 class="title">$title$</h1>+$if(subtitle)$+<p class="subtitle">$subtitle$</p>+$endif$+$for(author)$+<p class="author">$author$</p>+$endfor$+$if(date)$+<p class="date">$date$</p>+$endif$+$if(abstract)$+<div class="abstract">+<div class="abstract-title">$abstract-title$</div>+$abstract$+</div>+$endif$+$endif$+</header>+$endif$+$if(toc)$+<nav id="$idprefix$TOC" role="doc-toc">+$if(toc-title)$+<h2 id="$idprefix$toc-title">$toc-title$</h2>+$endif$+$table-of-contents$+</nav>+$endif$+$body$+$for(include-after)$+$include-after$+$endfor$+</body>+</html>
@@ -0,0 +1,21 @@+$if(titleblock)$+$titleblock$++$endif$+$for(header-includes)$+$header-includes$++$endfor$+$for(include-before)$+$include-before$++$endfor$+$if(toc)$+$table-of-contents$++$endif$+$body$+$for(include-after)$++$include-after$+$endfor$
@@ -1,82 +1,200 @@-\startmode[*mkii]- \enableregime[utf-8] - \setupcolors[state=start]-\stopmode-$if(mainlang)$-\mainlanguage[$mainlang$]+$if(tagging)$+\setupbackend[format=pdf/ua-2]+\enabledirectives[backend.usetags=mkiv]+\setuptagging[state=start] $endif$-+$if(context-lang)$+\mainlanguage[$context-lang$]+$endif$+$if(context-dir)$+\setupalign[$context-dir$]+\setupdirections[bidi=on,method=two]+$endif$ % Enable hyperlinks-\setupinteraction[state=start, color=middleblue]+\setupinteraction+ [state=start,+$if(title)$+ title={$title$},+$endif$+$if(subtitle)$+ subtitle={$subtitle$},+$endif$+$if(author)$+ author={$for(author)$$author$$sep$; $endfor$},+$endif$+$if(keywords)$+ keyword={$for(keywords)$$keywords$$sep$; $endfor$},+$endif$+ style=$linkstyle$,+ color=$linkcolor$,+ contrastcolor=$linkcontrastcolor$]+\setupurl[style=$urlstyle$] -\setuppapersize [$if(papersize)$$papersize$$else$letter$endif$][$if(papersize)$$papersize$$else$letter$endif$]-\setuplayout [width=middle, backspace=1.5in, cutspace=1.5in,- height=middle, topspace=0.75in, bottomspace=0.75in]+% make chapter, section bookmarks visible when opening document+\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]+\setupinteractionscreen[option={bookmark,title}] -\setuppagenumbering[location={footer,center}]+$if(papersize)$+\setuppapersize[$for(papersize)$$papersize$$sep$,$endfor$]+$endif$+$if(layout)$+\setuplayout[$for(layout)$$layout$$sep$,$endfor$]+$endif$+$if(pagenumbering)$+\setuppagenumbering[$for(pagenumbering)$$pagenumbering$$sep$,$endfor$]+$else$+\setuppagenumbering[location={footer,middle}]+$endif$+$if(pdfa)$+% attempt to generate PDF/A+\setupbackend+ [format=PDF/A-$pdfa$,+ profile={$if(pdfaiccprofile)$$for(pdfaiccprofile)$$pdfaiccprofile$$sep$,$endfor$$else$sRGB.icc$endif$},+ intent=$if(pdfaintent)$$pdfaintent$$else$sRGB IEC61966-2.1$endif$]+$endif$+\setupstructure[state=start,method=auto] -\setupbodyfont[11pt]+% use microtypography+\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]+\definefontfeature[default:tnum][default][tnum=yes, pnum=no]+\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]+\setupalign[hz,hanging]+\setupitaliccorrection[global, always] -\setupwhitespace[medium]+\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted -\setuphead[chapter] [style=\tfd]-\setuphead[section] [style=\tfc]-\setuphead[subsection] [style=\tfb]-\setuphead[subsubsection][style=\bf]+$-- set up font fallbacks+$for(mainfontfallback)$+\definefallbackfamily[mainface][rm][$mainfontfallback/nowrap$][range=0x0000-0xFFFF, check=yes, force=no]+$endfor$+$for(sansfontfallback)$+\definefallbackfamily[mainface][ss][$sansfontfallback/nowrap$][range=0x0000-0xFFFF, check=yes, force=no]+$endfor$+$for(monofontfallback)$+\definefallbackfamily[mainface][tt][$monofontfallback/nowrap$][range=0x0000-0xFFFF, check=yes, force=no]+$endfor$+\definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]+\definefontfamily[mainface][rm][$if(mainfont)$$mainfont/nowrap$$else$Latin Modern Roman$endif$]+\definefontfamily[mainface][mm][$if(mathfont)$$mathfont/nowrap$$else$Latin Modern Math$endif$]+\definefontfamily[mainface][ss][$if(sansfont)$$sansfont/nowrap$$else$Latin Modern Sans$endif$]+\definefontfamily[mainface][tt][$if(monofont)$$monofont/nowrap$$else$Latin Modern Typewriter$endif$][features=none]+\setupbodyfont[mainface$if(fontsize)$,$fontsize$$endif$] +\setupwhitespace[$if(whitespace)$$whitespace$$else$medium$endif$]+$if(indenting)$+\setupindenting[$for(indenting)$$indenting$$sep$,$endfor$]+$endif$+$if(interlinespace)$+\setupinterlinespace[$for(interlinespace)$$interlinespace$$sep$,$endfor$]+$endif$++\setuphead[chapter] [style=\tfd\setupinterlinespace,header=empty]+\setuphead[section] [style=\tfc\setupinterlinespace]+\setuphead[subsection] [style=\tfb\setupinterlinespace]+\setuphead[subsubsection] [style=\bf]+\setuphead[subsubsubsection] [style=\sc]+\setuphead[subsubsubsubsection][style=\it]++\definesectionlevels+ [default]+ [section, subsection, subsubsection, subsubsubsection, subsubsubsubsection]++$if(headertext)$+\setupheadertexts$for(headertext)$[$headertext$]$endfor$+$endif$+$if(footertext)$+\setupfootertexts$for(footertext)$[$footertext$]$endfor$+$endif$ $if(number-sections)$ $else$-\setuphead[chapter, section, subsection, subsubsection][number=no]+\setuphead[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no] $endif$ \definedescription [description]- [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm]+ [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging] \setupitemize[autointro] % prevent orphan list intro \setupitemize[indentnext=no] +\defineitemgroup[enumerate]+\setupenumerate[each][fit][itemalign=left,distance=.5em,style={\feature[+][default:tnum]}]+ \setupfloat[figure][default={here,nonumber}] \setupfloat[table][default={here,nonumber}] -\setupthinrules[width=15em] % width of horizontal rules--\setupdelimitedtext- [blockquote]- [before={\blank[medium]},- after={\blank[medium]},- indentnext=no,- ]--$if(toc)$-\setupcombinedlist[content][list={$placelist$}]+\setupxtable[frame=off]+\setupxtable[head][topframe=on]+\setupxtable[body][]+\setupxtable[foot][]+\setupxtable[lastrow][bottomframe=on] +$if(emphasis-commands)$+$emphasis-commands$ $endif$+$if(highlighting-commands)$+$highlighting-commands$+$endif$+$if(csl-refs)$+\definemeasure[cslhangindent][1.5em]+\definenarrower[hangingreferences][left=\measure{cslhangindent}]+\definestartstop [cslreferences] [+ $if(csl-hanging-indent)$+ before={%+ \starthangingreferences[left]+ \setupindenting[-\leftskip,yes,first]+ \doindentation+ },+ after=\stophangingreferences,+ $endif$+]+$endif$+$if(includesource)$+$for(sourcefile)$+\attachment[file=$curdir$/$sourcefile$,method=hidden]+$endfor$+$endif$ $for(header-includes)$ $header-includes$ $endfor$ \starttext $if(title)$-\startalignment[center]- \blank[2*big]- {\tfd $title$}+\startalignment[middle]+ {\tfd\setupinterlinespace $title$}+$if(subtitle)$+ \smallskip+ {\tfa\setupinterlinespace $subtitle$}+$endif$ $if(author)$- \blank[3*medium]- {\tfa $for(author)$$author$$sep$\crlf $endfor$}+ \smallskip+ {\tfa\setupinterlinespace $for(author)$$author$$sep$\crlf $endfor$} $endif$ $if(date)$- \blank[2*medium]- {\tfa $date$}+ \smallskip+ {\tfa\setupinterlinespace $date$} $endif$- \blank[3*medium]+ \bigskip \stopalignment $endif$+$if(abstract)$+\midaligned{\it Abstract}+\startnarrower[2*middle]+$abstract$+\stopnarrower+\blank[big]+$endif$ $for(include-before)$ $include-before$ $endfor$ $if(toc)$-\placecontent+\completecontent+$endif$+$if(lof)$+\completelistoffigures+$endif$+$if(lot)$+\completelistoftables $endif$ $body$
@@ -0,0 +1,27 @@+$if(title)$+# $title$++$endif$+$if(author)$+$for(author)$+$author$+$endfor$++$endif$+$if(date)$+$date$++$endif$+$for(header-includes)$+$header-includes$++$endfor$+$for(include-before)$+$include-before$++$endfor$+$body$+$for(include-after)$+$include-after$++$endfor$
@@ -1,32 +0,0 @@-<?xml version="1.0" encoding="utf-8" ?>-$if(mathml)$-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook EBNF Module V1.1CR1//EN"- "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">-$else$-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">-$endif$-<article>- <articleinfo>- <title>$title$</title>-$if(author)$- <authorgroup>-$for(author)$- <author>- $author$- </author>-$endfor$- </authorgroup>-$endif$-$if(date)$- <date>$date$</date>-$endif$- </articleinfo>-$for(include-before)$-$include-before$-$endfor$-$body$-$for(include-after)$-$include-after$-$endfor$-</article>
@@ -0,0 +1,32 @@+<?xml version="1.0" encoding="utf-8" ?>+$if(mathml)$+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook EBNF Module V1.1CR1//EN"+ "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">+$else$+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">+$endif$+<article>+ <articleinfo>+ <title>$title$</title>+$if(author)$+ <authorgroup>+$for(author)$+ <author>+ $author$+ </author>+$endfor$+ </authorgroup>+$endif$+$if(date)$+ <date>$date$</date>+$endif$+ </articleinfo>+$for(include-before)$+ $include-before$+$endfor$+ $body$+$for(include-after)$+ $include-after$+$endfor$+</article>
@@ -0,0 +1,37 @@+<?xml version="1.0" encoding="utf-8" ?>+<!DOCTYPE article>+<article+$if(lang)$+ xml:lang="$lang$"+$endif$+ xmlns="http://docbook.org/ns/docbook" version="5.0"+$if(mathml)$+ xmlns:mml="http://www.w3.org/1998/Math/MathML"+$endif$+ xmlns:xlink="http://www.w3.org/1999/xlink" >+ <info>+ <title>$title$</title>+$if(subtitle)$+ <subtitle>$subtitle$</subtitle>+$endif$+$if(author)$+ <authorgroup>+$for(author)$+ <author>+ $author$+ </author>+$endfor$+ </authorgroup>+$endif$+$if(date)$+ <date>$date$</date>+$endif$+ </info>+$for(include-before)$+ $include-before$+$endfor$+ $body$+$for(include-after)$+ $include-after$+$endfor$+</article>
@@ -1,55 +1,103 @@ <!DOCTYPE html>-<head>-<meta charset="utf-8">+<head$if(lang)$ lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$>+ <meta charset="utf-8">+ <meta name="generator" content="pandoc"> $for(author-meta)$- <meta name="author" content="$author-meta$" />+ <meta name="author" content="$author-meta$"> $endfor$ $if(date-meta)$- <meta name="dcterms.date" content="$date-meta$" />+ <meta name="dcterms.date" content="$date-meta$"> $endif$- <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>- <style type="text/css">code{white-space: pre;}</style>-$if(highlighting-css)$- <style type="text/css">-$highlighting-css$- </style>+$if(keywords)$+ <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$"> $endif$+ <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>+ <style>+ $styles.html()$+ </style> $if(css)$ $for(css)$- <link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>+ <link rel="stylesheet" href="$css$"> $endfor$ $else$+<link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet'>+ <style>- html { background-color: black; }- body { background-color: white; border-radius: 12px}+ html, .view body { background-color: black; counter-reset: slideidx; }+ body, .view section { background-color: white; border-radius: 12px } /* A section is a slide. It's size is 800x600, and this will never change */- section {- font-family: Arial, serif;- font-size: 20pt;- }- address, blockquote, dl, fieldset, form, h1, h2, h3, h4, h5, h6, hr, ol, p, pre, table, ul, dl { padding: 10px 20px 10px 20px; }- h1, h2, h3 {+ section, .view head > title {+ /* The font from Google */+ font-family: 'Oswald', arial, serif;+ font-size: 30px;+ }++ .view section:after {+ counter-increment: slideidx;+ content: counter(slideidx, decimal-leading-zero);+ position: absolute; bottom: -80px; right: 100px;+ color: white;+ }++ .view head > title {+ color: white; text-align: center;- margin: 10pt 10pt 20pt 10pt;+ margin: 1em 0 1em 0; }- ul, ol {- margin: 10px 10px 10px 50px;++ h1, h2 {+ margin-top: 200px;+ text-align: center;+ font-size: 80px; }- section.titleslide h1 { margin-top: 200px; }- h1.title { margin-top: 150px; }- h1 { font-size: 180%; }- h2 { font-size: 120%; }- h3 { font-size: 100%; }- q { quotes: "“" "”" "‘" "’"; }- blockquote { font-style: italic }- /* Figures are displayed full-page, with the caption on- top of the image/video */+ h3 {+ margin: 100px 0 50px 100px;+ }++ ul {+ margin: 50px 200px;+ }+ li > ul {+ margin: 15px 50px;+ }++ p {+ margin: 75px;+ font-size: 50px;+ }++ blockquote {+ height: 100%;+ background-color: black;+ color: white;+ font-size: 60px;+ padding: 50px;+ }+ blockquote:before {+ content: open-quote;+ }+ blockquote:after {+ content: close-quote;+ }++ /* Figures are displayed full-page, with the caption+ on top of the image/video */ figure { background-color: black;+ width: 100%;+ height: 100%; }+ figure > * {+ position: absolute;+ }+ figure > img, figure > video {+ width: 100%; height: 100%;+ } figcaption { margin: 70px;+ font-size: 50px; }+ footer { position: absolute; bottom: 0;@@ -66,12 +114,22 @@ https://developer.mozilla.org/en/CSS/CSS_transitions How to use CSS3 Transitions: */ section {- -moz-transition: left 400ms linear 0s;- -webkit-transition: left 400ms linear 0s;- -ms-transition: left 400ms linear 0s;- transition: left 400ms linear 0s;+ -moz-transition: left 400ms linear 0s;+ -webkit-transition: left 400ms linear 0s;+ -ms-transition: left 400ms linear 0s;+ transition: left 400ms linear 0s; }+ .view section {+ -moz-transition: none;+ -webkit-transition: none;+ -ms-transition: none;+ transition: none;+ } + .view section[aria-selected] {+ border: 5px red solid;+ }+ /* Before */ section { left: -150%; } /* Now */@@ -85,10 +143,17 @@ .incremental > * { opacity: 1; } /* The current item */- .incremental > *[aria-selected] { color: red; opacity: 1; }+ .incremental > *[aria-selected] { opacity: 1; } /* The items to-be-selected */- .incremental > *[aria-selected] ~ * { opacity: 0.2; }+ .incremental > *[aria-selected] ~ * { opacity: 0; }++ /* The progressbar, at the bottom of the slides, show the global+ progress of the presentation. */+ #progress-bar {+ height: 2px;+ background: #AAA;+ } </style> $endif$ $if(math)$@@ -105,10 +170,14 @@ $if(subtitle)$ <h1 class="subtitle">$subtitle$</h1> $endif$-$for(author)$- <h2 class="author">$author$</h2>-$endfor$- <h3 class="date">$date$</h3>+ <footer>+ $if(author)$<span class="author">$for(author)$$author$$sep$, $endfor$</span> · $endif$$if(institute)$<span class="institute">$for(institute)$$institute$$sep$, $endfor$</span> · $endif$$if(date)$<span class="date">$date$</span>$endif$+ </footer>+</section>+$endif$+$if(toc)$+<section id="$idprefix$TOC">+$table-of-contents$ </section> $endif$ $for(include-before)$
@@ -1,35 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">-<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ xml:lang="$lang$"$endif$>-<head>- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />- <meta http-equiv="Content-Style-Type" content="text/css" />- <meta name="generator" content="pandoc" />- <title>$pagetitle$</title>-$if(highlighting-css)$- <style type="text/css">-$highlighting-css$- </style>-$endif$-$for(css)$- <link rel="stylesheet" type="text/css" href="$css$" />-$endfor$-</head>-<body>-$if(titlepage)$- <h1 class="title">$title$</h1>-$if(subtitle)$- <h1 class="subtitle">$subtitle$</h1>-$endif$-$for(author)$- <h2 class="author">$author$</h2>-$endfor$-$if(date)$- <h3 class="date">$date$</h3>-$endif$-$else$-$body$-$endif$-</body>-</html>-
@@ -0,0 +1,77 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">+<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$>+<head>+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />+ <meta http-equiv="Content-Style-Type" content="text/css" />+ <meta name="generator" content="pandoc" />+ <title>$pagetitle$</title>+ <style type="text/css">+$if(csl-css)$+ $styles.citations.html()$+$endif$+$if(highlighting-css)$+ /* CSS for syntax highlighting */+ $highlighting-css$+$endif$+ </style>+$for(css)$+ <link rel="stylesheet" type="text/css" href="$css$" />+$endfor$+$for(header-includes)$+ $header-includes$+$endfor$+</head>+<body$if(coverpage)$ id="cover"$endif$>+$if(titlepage)$+$for(title)$+$if(title.text)$+ <h1 class="$title.type$">$title.text$</h1>+$else$+ <h1 class="title">$title$</h1>+$endif$+$endfor$+$if(subtitle)$+ <p class="subtitle">$subtitle$</p>+$endif$+$for(author)$+ <p class="author">$author$</p>+$endfor$+$for(creator)$+ <p class="$creator.role$">$creator.text$</p>+$endfor$+$if(publisher)$+ <p class="publisher">$publisher$</p>+$endif$+$if(date)$+ <p class="date">$date$</p>+$endif$+$if(rights)$+ <div class="rights">$rights$</div>+$endif$+$if(abstract)$+<div class="abstract">+<div class="abstract-title">$abstract-title$</div>+$abstract$+</div>+$endif$+$else$+$if(coverpage)$+<div id="cover-image">+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 $cover-image-width$ $cover-image-height$" preserveAspectRatio="xMidYMid">+<image width="$cover-image-width$" height="$cover-image-height$" xlink:href="../media/$cover-image$" />+</svg>+</div>+$else$+$for(include-before)$+$include-before$+$endfor$+$body$+$for(include-after)$+$include-after$+$endfor$+$endif$+$endif$+</body>+</html>+
@@ -1,40 +1,77 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html>-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"$if(lang)$ xml:lang="$lang$"$endif$>+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$> <head> <meta charset="utf-8" /> <meta name="generator" content="pandoc" /> <title>$pagetitle$</title>-$if(quotes)$- <style type="text/css">- q { quotes: "“" "”" "‘" "’"; }- </style>+ <style>+$if(csl-css)$+ $styles.citations.html()$ $endif$ $if(highlighting-css)$- <style type="text/css">-$highlighting-css$- </style>+ /* CSS for syntax highlighting */+ $highlighting-css$ $endif$+ </style> $for(css)$ <link rel="stylesheet" type="text/css" href="$css$" /> $endfor$+$for(header-includes)$+ $header-includes$+$endfor$ </head>-<body>+<body$if(coverpage)$ id="cover"$endif$$if(body-type)$ epub:type="$body-type$"$endif$> $if(titlepage)$- <section epub:type="titlepage">- <h1 class="title">$title$</h1>+<section epub:type="titlepage" class="titlepage">+$for(title)$+$if(title.type)$+ <h1 class="$title.type$">$title.text$</h1>+$else$+ <h1 class="title">$title$</h1>+$endif$+$endfor$ $if(subtitle)$- <h1 class="subtitle">$subtitle$</h1>+ <p class="subtitle">$subtitle$</p> $endif$ $for(author)$- <h2 class="author">$author$</h2>+ <p class="author">$author$</p> $endfor$+$for(creator)$+ <p class="$creator.role$">$creator.text$</p>+$endfor$+$if(publisher)$+ <p class="publisher">$publisher$</p>+$endif$ $if(date)$- <h3 class="date">$date$</h3>+ <p class="date">$date$</p> $endif$- </section>+$if(rights)$+ <div class="rights">$rights$</div>+$endif$+$if(abstract)$+<div class="abstract">+<div class="abstract-title">$abstract-title$</div>+$abstract$+</div>+$endif$+</section> $else$+$if(coverpage)$+<div id="cover-image">+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 $cover-image-width$ $cover-image-height$" preserveAspectRatio="xMidYMid">+<image width="$cover-image-width$" height="$cover-image-height$" xlink:href="../media/$cover-image$" />+</svg>+</div>+$else$+$for(include-before)$+$include-before$+$endfor$ $body$+$for(include-after)$+$include-after$+$endfor$+$endif$ $endif$ </body> </html>
@@ -1,61 +0,0 @@-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">-<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$>-<head>- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />- <meta http-equiv="Content-Style-Type" content="text/css" />- <meta name="generator" content="pandoc" />-$for(author-meta)$- <meta name="author" content="$author-meta$" />-$endfor$-$if(date-meta)$- <meta name="date" content="$date-meta$" />-$endif$- <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>- <style type="text/css">code{white-space: pre;}</style>-$if(quotes)$- <style type="text/css">q { quotes: "“" "”" "‘" "’"; }</style>-$endif$-$if(highlighting-css)$- <style type="text/css">-$highlighting-css$- </style>-$endif$-$for(css)$- <link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>-$endfor$-$if(math)$- $math$-$endif$-$for(header-includes)$- $header-includes$-$endfor$-</head>-<body>-$for(include-before)$-$include-before$-$endfor$-$if(title)$-<div id="$idprefix$header">-<h1 class="title">$title$</h1>-$if(subtitle)$-<h1 class="subtitle">$subtitle$</h1>-$endif$-$for(author)$-<h2 class="author">$author$</h2>-$endfor$-$if(date)$-<h3 class="date">$date$</h3>-$endif$-</div>-$endif$-$if(toc)$-<div id="$idprefix$TOC">-$toc$-</div>-$endif$-$body$-$for(include-after)$-$include-after$-$endfor$-</body>-</html>
@@ -0,0 +1,70 @@+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">+<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$>+<head>+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />+ <meta http-equiv="Content-Style-Type" content="text/css" />+ <meta name="generator" content="pandoc $pandoc-version$" />+$for(author-meta)$+ <meta name="author" content="$author-meta$" />+$endfor$+$if(date-meta)$+ <meta name="date" content="$date-meta$" />+$endif$+$if(keywords)$+ <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />+$endif$+$if(description-meta)$+ <meta name="description" content="$description-meta$" />+$endif$+ <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>+ <style type="text/css">+ $styles.html()$+ </style>+$for(css)$+ <link rel="stylesheet" href="$css$" type="text/css" />+$endfor$+$for(header-includes)$+ $header-includes$+$endfor$+$if(math)$+ $math$+$endif$+</head>+<body>+$for(include-before)$+$include-before$+$endfor$+$if(title)$+<div id="$idprefix$header">+<h1 class="title">$title$</h1>+$if(subtitle)$+<h1 class="subtitle">$subtitle$</h1>+$endif$+$for(author)$+<h2 class="author">$author$</h2>+$endfor$+$if(date)$+<h3 class="date">$date$</h3>+$endif$+$if(abstract)$+<div class="abstract">+<div class="abstract-title">$abstract-title$</div>+$abstract$+</div>+$endif$+</div>+$endif$+$if(toc)$+<div id="$idprefix$TOC">+$if(toc-title)$+<h2 id="$idprefix$toc-title">$toc-title$</h2>+$endif$+$table-of-contents$+</div>+$endif$+$body$+$for(include-after)$+$include-after$+$endfor$+</body>+</html>
@@ -1,59 +1,65 @@ <!DOCTYPE html>-<html$if(lang)$ lang="$lang$"$endif$>+<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$> <head>- <meta charset="utf-8">- <meta name="generator" content="pandoc">- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">+ <meta charset="utf-8" />+ <meta name="generator" content="pandoc $pandoc-version$" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> $for(author-meta)$- <meta name="author" content="$author-meta$">+ <meta name="author" content="$author-meta$" /> $endfor$ $if(date-meta)$- <meta name="dcterms.date" content="$date-meta$">+ <meta name="dcterms.date" content="$date-meta$" /> $endif$- <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>- <style type="text/css">code{white-space: pre;}</style>- <!--[if lt IE 9]>- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>- <![endif]-->-$if(quotes)$- <style type="text/css">q { quotes: "“" "”" "‘" "’"; }</style>+$if(keywords)$+ <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" /> $endif$-$if(highlighting-css)$- <style type="text/css">-$highlighting-css$- </style>+$if(description-meta)$+ <meta name="description" content="$description-meta$" /> $endif$+ <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>+ <style>+ $styles.html()$+ </style> $for(css)$- <link rel="stylesheet" href="$css$">+ <link rel="stylesheet" href="$css$" /> $endfor$-$if(math)$- $math$-$endif$ $for(header-includes)$ $header-includes$ $endfor$+$if(math)$+ $math$+$endif$ </head> <body> $for(include-before)$ $include-before$ $endfor$ $if(title)$-<header>+<header id="title-block-header"> <h1 class="title">$title$</h1> $if(subtitle)$-<h1 class="subtitle">$subtitle$</h1>+<p class="subtitle">$subtitle$</p> $endif$ $for(author)$-<h2 class="author">$author$</h2>+<p class="author">$author$</p> $endfor$ $if(date)$-<h3 class="date">$date$</h3>+<p class="date">$date$</p> $endif$+$if(abstract)$+<div class="abstract">+<div class="abstract-title">$abstract-title$</div>+$abstract$+</div>+$endif$ </header> $endif$ $if(toc)$-<nav id="$idprefix$TOC">-$toc$+<nav id="$idprefix$TOC" role="doc-toc">+$if(toc-title)$+<h2 id="$idprefix$toc-title">$toc-title$</h2>+$endif$+$table-of-contents$ </nav> $endif$ $body$
@@ -4,7 +4,7 @@ <Document DOMVersion="8.0" Self="pandoc_doc"> <RootCharacterStyleGroup Self="pandoc_character_styles"> <CharacterStyle Self="$$ID/NormalCharacterStyle" Name="Default" />- $charStyles$ + $charStyles$ </RootCharacterStyleGroup> <RootParagraphStyleGroup Self="pandoc_paragraph_styles"> <ParagraphStyle Self="$$ID/NormalParagraphStyle" Name="$$ID/NormalParagraphStyle"@@ -20,7 +20,7 @@ </TabList> </Properties> </ParagraphStyle>- $parStyles$ + $parStyles$ </RootParagraphStyleGroup> <RootTableStyleGroup Self="pandoc_table_styles"> <TableStyle Self="TableStyle/Table" Name="Table" />@@ -28,9 +28,14 @@ <RootCellStyleGroup Self="pandoc_cell_styles"> <CellStyle Self="CellStyle/Cell" AppliedParagraphStyle="ParagraphStyle/$$ID/[No paragraph style]" Name="Cell" /> </RootCellStyleGroup>+$if(objectStyles)$+ <RootObjectStyleGroup Self="pandoc_object_styles">+ $objectStyles$+ </RootObjectStyleGroup>+$endif$ <Story Self="pandoc_story" TrackChanges="false"- StoryTitle="$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$"+ StoryTitle="$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$" AppliedTOCStyle="n" AppliedNamedGrid="n" > <StoryPreference OpticalMarginAlignment="true" OpticalMarginSize="12" />
@@ -0,0 +1,7 @@+<?xml version="1.0" encoding="utf-8" ?>+$if(xml-stylesheet)$+<?xml-stylesheet type="text/xsl" href="$xml-stylesheet$"?>+$endif$+<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN"+ "JATS-archivearticle1.dtd">+${ article.jats_publishing() }
@@ -0,0 +1,109 @@+<?xml version="1.0" encoding="utf-8" ?>+$if(xml-stylesheet)$+<?xml-stylesheet type="text/xsl" href="$xml-stylesheet$"?>+$endif$+<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Article Authoring DTD v1.2 20190208//EN"+ "JATS-articleauthoring1.dtd">+$if(article.type)$+<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="$article.type$">+$else$+<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">+$endif$+<front>+<article-meta>+$if(title)$+<title-group>+<article-title>$title$</article-title>+$if(subtitle)$+<subtitle>${subtitle}</subtitle>+$endif$+</title-group>+$endif$+$if(author)$+<contrib-group>+$for(author)$+<contrib contrib-type="author"$if(author.equal-contrib)$ equal-contrib="yes"$endif$$if(author.cor-id)$ corresp="yes"$endif$>+$if(author.orcid)$+<contrib-id contrib-id-type="orcid">$author.orcid$</contrib-id>+$endif$+$if(author.surname)$+<name>+<surname>$if(author.non-dropping-particle)$${author.non-dropping-particle} $endif$${author.surname}</surname>+<given-names>${author.given-names}$if(author.dropping-particle)$ ${author.dropping-particle}$endif$</given-names>+$if(author.prefix)$+<prefix>${author.prefix}</prefix>+$endif$+$if(author.suffix)$+<suffix>${author.suffix}</suffix>+$endif$+</name>+$elseif(author.name)$+<string-name>$author.name$</string-name>+$else$+<string-name>$author$</string-name>+$endif$+$for(author.affiliation)$+${ it:affiliations.jats() }+$endfor$+$if(author.email)$+<email>$author.email$</email>+$endif$+$if(author.cor-id)$+<xref ref-type="corresp" rid="cor-$author.cor-id$"><sup>*</sup></xref>+$endif$+</contrib>+$endfor$+</contrib-group>+$endif$+<permissions>+$for(copyright.statement)$+<copyright-statement>$copyright.statement$</copyright-statement>+$endfor$+$for(copyright.year)$+<copyright-year>$copyright.year$</copyright-year>+$endfor$+$for(copyright.holder)$+<copyright-holder>$copyright.holder$</copyright-holder>+$endfor$+$if(copyright.text)$+<license license-type="$copyright.type$" xlink:href="$copyright.link$">+<license-p>$copyright.text$</license-p>+</license>+$endif$+$for(license)$+<license$if(it.type)$ license-type="${it.type}"$endif$$if(it.link)$ xlink:href="${it.link}"$endif$>+<license-p>$if(it.text)$${it.text}$else$${it}$endif$</license-p>+</license>+$endfor$+</permissions>+<abstract>+$abstract$+</abstract>+$if(tags)$+<kwd-group kwd-group-type="author">+$for(tags)$+<kwd>$tags$</kwd>+$endfor$+</kwd-group>+$endif$+$if(article.funding-statement)$+<funding-group>+<funding-statement>$article.funding-statement$</funding-statement>+</funding-group>+$endif$+$if(supplementary-material)$+<supplementary-material>+$supplementary-material$+</supplementary-material>+$endif$+</article-meta>+</front>+<body>+$body$+</body>+<back>+$if(back)$+$back$+$endif$+</back>+</article>
@@ -0,0 +1,7 @@+<?xml version="1.0" encoding="utf-8" ?>+$if(xml-stylesheet)$+<?xml-stylesheet type="text/xsl" href="$xml-stylesheet$"?>+$endif$+<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN"+ "JATS-publishing1.dtd">+${ article.jats_publishing() }
@@ -0,0 +1,9 @@+$for(include-before)$+$include-before$++$endfor$+$body$+$for(include-after)$++$include-after$+$endfor$
@@ -1,186 +1,139 @@-\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}-$if(fontfamily)$-\usepackage{$fontfamily$}-$else$-\usepackage{lmodern}-$endif$-$if(linestretch)$-\usepackage{setspace}-\setstretch{$linestretch$}-$endif$-\usepackage{amssymb,amsmath}-\usepackage{ifxetex,ifluatex}-\usepackage{fixltx2e} % provides \textsubscript-\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex- \usepackage[T1]{fontenc}- \usepackage[utf8]{inputenc}-$if(euro)$- \usepackage{eurosym}-$endif$-\else % if luatex or xelatex- \ifxetex- \usepackage{mathspec}- \usepackage{xltxtra,xunicode}- \else- \usepackage{fontspec}- \fi- \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}- \newcommand{\euro}{€}-$if(mainfont)$- \setmainfont{$mainfont$}+$document-metadata.latex()$+$passoptions.latex()$+\documentclass[+$for(babel-otherlangs)$+ $babel-otherlangs$,+$endfor$+$if(babel-lang)$+ $babel-lang$, $endif$-$if(sansfont)$- \setsansfont{$sansfont$}+$if(fontsize)$+ $fontsize$, $endif$-$if(monofont)$- \setmonofont[Mapping=tex-ansi]{$monofont$}+$if(papersize)$+ $papersize$paper, $endif$-$if(mathfont)$- \setmathfont(Digits,Latin,Greek){$mathfont$}+$for(classoption)$+ $classoption$$sep$,+$endfor$+]{$documentclass$}+$if(beamerarticle)$+\usepackage{beamerarticle} % needs to be loaded first $endif$-\fi-% use upquote if available, for straight quotes in verbatim environments-\IfFileExists{upquote.sty}{\usepackage{upquote}}{}-% use microtype if available-\IfFileExists{microtype.sty}{%-\usepackage{microtype}-\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts-}{}+\usepackage{xcolor} $if(geometry)$ \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} $endif$-$if(natbib)$-\usepackage{natbib}-\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}-$endif$-$if(biblatex)$-\usepackage{biblatex}-$if(biblio-files)$-\bibliography{$biblio-files$}-$endif$-$endif$-$if(listings)$-\usepackage{listings}-$endif$-$if(lhs)$-\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}-$endif$-$if(highlighting-macros)$-$highlighting-macros$-$endif$-$if(verbatim-in-note)$-\usepackage{fancyvrb}-$endif$-$if(tables)$-\usepackage{longtable,booktabs}-$endif$-$if(graphics)$-\usepackage{graphicx}-\makeatletter-\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}-\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}-\makeatother-% Scale images if necessary, so that they will not overflow the page-% margins by default, and it is still possible to overwrite the defaults-% using explicit options in \includegraphics[width, height, ...]{}-\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}-$endif$-\ifxetex- \usepackage[setpagesize=false, % page size defined by xetex- unicode=false, % unicode breaks when used with xetex- xetex]{hyperref}-\else- \usepackage[unicode=true]{hyperref}-\fi-\hypersetup{breaklinks=true,- bookmarks=true,- pdfauthor={$author-meta$},- pdftitle={$title-meta$},- colorlinks=true,- citecolor=$if(citecolor)$$citecolor$$else$blue$endif$,- urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,- linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,- pdfborder={0 0 0}}-\urlstyle{same} % don't use monospace font for urls-$if(links-as-notes)$-% Make links footnotes instead of hotlinks:-\renewcommand{\href}[2]{#2\footnote{\url{#1}}}-$endif$-$if(strikeout)$-\usepackage[normalem]{ulem}-% avoid problems with \sout in headers with hyperref:-\pdfstringdefDisableCommands{\renewcommand{\sout}{}}+\usepackage{amsmath,amssymb}+$if(cancel)$+\usepackage{cancel} $endif$-\setlength{\parindent}{0pt}-\setlength{\parskip}{6pt plus 2pt minus 1pt}-\setlength{\emergencystretch}{3em} % prevent overfull lines+$--+$-- section numbering+$-- $if(numbersections)$-\setcounter{secnumdepth}{5}+\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$} $else$-\setcounter{secnumdepth}{0}-$endif$-$if(verbatim-in-note)$-\VerbatimFootnotes % allows verbatim text in footnotes+\setcounter{secnumdepth}{-\maxdimen} % remove section numbering $endif$-$if(lang)$-\ifxetex- \usepackage{polyglossia}- \setmainlanguage{$mainlang$}-\else- \usepackage[$lang$]{babel}+$fonts.latex()$+$font-settings.latex()$+$common.latex()$+$for(header-includes)$+$header-includes$+$endfor$+$after-header-includes.latex()$+$hypersetup.latex()$+$if(pdf-trailer-id)$++\ifXeTeX+\special{pdf:trailerid [ $pdf-trailer-id$ ]} \fi+\ifPDFTeX+\pdftrailerid{}+\pdftrailer{/ID [ $pdf-trailer-id$ ]}+\fi+\ifLuaTeX+\pdfvariable trailerid {[ $pdf-trailer-id$ ]}+\fi $endif$ $if(title)$-\title{$title$$if(subtitle)$\\\vspace{0.5em}{\large $subtitle$}$endif$}+\title{$title$$if(thanks)$\thanks{$thanks$}$endif$} $endif$-$if(author)$-\author{$for(author)$$author$$sep$ \and $endfor$}+$if(subtitle)$+\usepackage{etoolbox}+\makeatletter+\providecommand{\subtitle}[1]{% add subtitle to \maketitle+ \apptocmd{\@title}{\par {\large #1 \par}}{}{}+}+\makeatother+\subtitle{$subtitle$} $endif$+\author{$for(author)$$author$$sep$ \and $endfor$} \date{$date$}-$for(header-includes)$-$header-includes$-$endfor$ \begin{document}+$if(has-frontmatter)$+\frontmatter+$endif$ $if(title)$ \maketitle-$endif$ $if(abstract)$ \begin{abstract} $abstract$ \end{abstract} $endif$+$endif$ $for(include-before)$ $include-before$ $endfor$ $if(toc)$+$if(toc-title)$+\renewcommand*\contentsname{$toc-title$}+$endif$ {-\hypersetup{linkcolor=black}+$if(colorlinks)$+$if(toccolor)$+\hypersetup{linkcolor=$toccolor$}+$endif$+$endif$ \setcounter{tocdepth}{$toc-depth$} \tableofcontents } $endif$+$if(lof)$+\listoffigures+$endif$ $if(lot)$ \listoftables $endif$-$if(lof)$-\listoffigures+$if(linestretch)$+\setstretch{$linestretch$} $endif$+$if(has-frontmatter)$+\mainmatter+$endif$ $body$ +$if(has-frontmatter)$+\backmatter+$endif$+$if(nocite-ids)$+\nocite{$for(nocite-ids)$$it$$sep$, $endfor$}+$endif$ $if(natbib)$-$if(biblio-files)$+$if(bibliography)$ $if(biblio-title)$-$if(book-class)$+$if(has-chapters)$ \renewcommand\bibname{$biblio-title$} $else$ \renewcommand\refname{$biblio-title$} $endif$ $endif$-\bibliography{$biblio-files$}+\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} $endif$ $endif$
@@ -1,7 +1,14 @@ $if(has-tables)$-.\"t+'\" t $endif$-.TH "$title$" "$section$" "$date$" "$footer$" "$header$"+$if(pandoc-version)$+.\" Automatically generated by Pandoc $pandoc-version$+.\"+$endif$+$if(adjusting)$+.ad $adjusting$+$endif$+.TH "$title/nowrap$" "$section/nowrap$" "$date/nowrap$" "$footer/nowrap$"$if(header)$ "$header/nowrap$"$endif$ $for(header-includes)$ $header-includes$ $endfor$
@@ -11,7 +11,7 @@ $endfor$ $if(toc)$-$toc$+$table-of-contents$ $endif$ $body$
@@ -0,0 +1,21 @@+$if(titleblock)$+$titleblock$++$endif$+$for(header-includes)$+$header-includes$++$endfor$+$for(include-before)$+$include-before$++$endfor$+$if(toc)$+$table-of-contents$++$endif$+$body$+$for(include-after)$++$include-after$+$endfor$
@@ -0,0 +1,124 @@+$if(pandoc-version)$+.\" Automatically generated by Pandoc $pandoc-version$+.\"+$endif$+.\" **** Custom macro definitions *********************************+.\" * Super/subscript+.\" (https://lists.gnu.org/archive/html/groff/2012-07/msg00046.html)+.ds { \v'-0.3m'\\s[\\n[.s]*9u/12u]+.ds } \s0\v'0.3m'+.ds < \v'0.3m'\s[\\n[.s]*9u/12u]+.ds > \s0\v'-0.3m'+.\" * Horizontal line+.de HLINE+.LP+.ce+\l'20'+..+$if(highlighting-macros)$+.\" * Syntax highlighting macros+$highlighting-macros$+$endif$+.\" **** Settings *************************************************+.\" text width+.nr LL 5.5i+.\" left margin+.nr PO 1.25i+.\" top margin+.nr HM 1.25i+.\" bottom margin+.nr FM 1.25i+.\" header/footer width+.nr LT \n[LL]+.\" point size+.nr PS $if(pointsize)$$pointsize$$else$10p$endif$+.\" line height+.nr VS $if(lineheight)$$lineheight$$else$12p$endif$+.\" font family: A, BM, H, HN, N, P, T, ZCM+.fam $if(fontfamily)$$fontfamily$$else$T$endif$+.\" paragraph indent+.nr PI $if(indent)$$indent$$else$0m$endif$+.\" interparagraph space+.nr PD 0.4v+.\" footnote width+.nr FL \n[LL]+.\" footnote point size+.nr FPS (\n[PS] - 2000)+$if(papersize)$+.\" paper size+.ds paper $papersize$+$endif$+.\" color used for strikeout+.defcolor strikecolor rgb 0.7 0.7 0.7+.\" point size difference between heading levels+.nr PSINCR 1p+.\" heading level above which point size no longer changes+.nr GROWPS 2+.\" comment these out if you want a dot after section numbers:+.als SN SN-NO-DOT+.als SN-STYLE SN-NO-DOT+.\" page numbers in footer, centered+.ds CH+.ds CF %+$if(adjusting)$+.ad $adjusting$+$endif$+$if(hyphenate)$+.hy+$else$+.nh+$endif$+$if(has-inline-math)$+.EQ+delim @@+.EN+$endif$+$if(pdf-engine)$+.\" color for links (rgb)+.ds PDFHREF.COLOUR 0.35 0.00 0.60+.\" border for links (default none)+.ds PDFHREF.BORDER 0 0 0+.\" pdf outline fold level+.nr PDFOUTLINE.FOLDLEVEL 3+.\" start out in outline view+.pdfview /PageMode /UseOutlines+.\" ***************************************************************+.\" PDF metadata+.pdfinfo /Title "$title-meta$"+.pdfinfo /Author "$author-meta$"+$endif$+$for(header-includes)$+$header-includes$+$endfor$+$if(title)$+.TL+$title$+$endif$+$for(author)$+.AU+$author$+$endfor$+$if(date)$+.AU+.sp 0.5+.ft R+$date$+$endif$+$if(abstract)$+.AB+$abstract$+.AE+$endif$+.\" 1 column (use .2C for two column)+.1C+$for(include-before)$+$include-before$+$endfor$+$body$+$if(toc)$+.TC+$endif$+$for(include-after)$+$include-after$+$endfor$+.pdfsync
@@ -0,0 +1,44 @@+$if(author)$+#author $for(author)$$author$$sep$; $endfor$+$endif$+$if(title)$+#title $title$+$endif$+$if(lang)$+#lang $lang$+$endif$+$if(LISTtitle)$+#LISTtitle $LISTtitle$+$endif$+$if(subtitle)$+#subtitle $subtitle$+$endif$+$if(SORTauthors)$+#SORTauthors $SORTauthors$+$endif$+$if(SORTtopics)$+#SORTtopics $SORTtopics$+$endif$+$if(date)$+#date $date$+$endif$+$if(notes)$+#notes $notes$+$endif$+$if(source)$+#source $source$+$endif$++$for(header-includes)$+$header-includes$++$endfor$+$for(include-before)$+$include-before$++$endfor$+$body$+$for(include-after)$++$include-after$+$endfor$
@@ -1,26 +1,161 @@ <?xml version="1.0" encoding="utf-8" ?>-<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.2">+<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.3"> <office:font-face-decls> <style:font-face style:name="Courier New" style:font-family-generic="modern" style:font-pitch="fixed" svg:font-family="'Courier New'" /> </office:font-face-decls>- $automatic-styles$+ <office:automatic-styles>+ $automatic-styles$+ </office:automatic-styles> $for(header-includes)$ $header-includes$ $endfor$ <office:body> <office:text> $if(title)$-<text:h text:style-name="Title">$title$</text:h>+<text:p text:style-name="Title">$title$</text:p> $endif$+$if(subtitle)$+<text:p text:style-name="Subtitle">$subtitle$</text:p>+$endif$ $for(author)$ <text:p text:style-name="Author">$author$</text:p> $endfor$ $if(date)$ <text:p text:style-name="Date">$date$</text:p> $endif$+$if(abstract)$+$abstract$+$endif$ $for(include-before)$ $include-before$ $endfor$+$if(toc)$+<text:table-of-content>+ <text:table-of-content-source text:outline-level="$toc-depth$">+ <text:index-title-template text:style-name="Contents_20_Heading">$toc-title$</text:index-title-template>+ <text:table-of-content-entry-template text:outline-level="1"+ text:style-name="Contents_20_1">+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-chapter />+ <text:index-entry-text />+ <text:index-entry-link-end />+ <text:index-entry-tab-stop style:type="right"+ style:leader-char="." />+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-page-number />+ <text:index-entry-link-end />+ </text:table-of-content-entry-template>+ <text:table-of-content-entry-template text:outline-level="2"+ text:style-name="Contents_20_2">+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-chapter />+ <text:index-entry-text />+ <text:index-entry-link-end />+ <text:index-entry-tab-stop style:type="right"+ style:leader-char="." />+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-page-number />+ <text:index-entry-link-end />+ </text:table-of-content-entry-template>+ <text:table-of-content-entry-template text:outline-level="3"+ text:style-name="Contents_20_3">+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-chapter />+ <text:index-entry-text />+ <text:index-entry-link-end />+ <text:index-entry-tab-stop style:type="right"+ style:leader-char="." />+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-page-number />+ <text:index-entry-link-end />+ </text:table-of-content-entry-template>+ <text:table-of-content-entry-template text:outline-level="4"+ text:style-name="Contents_20_4">+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-chapter />+ <text:index-entry-text />+ <text:index-entry-link-end />+ <text:index-entry-tab-stop style:type="right"+ style:leader-char="." />+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-page-number />+ <text:index-entry-link-end />+ </text:table-of-content-entry-template>+ <text:table-of-content-entry-template text:outline-level="5"+ text:style-name="Contents_20_5">+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-chapter />+ <text:index-entry-text />+ <text:index-entry-link-end />+ <text:index-entry-tab-stop style:type="right"+ style:leader-char="." />+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-page-number />+ <text:index-entry-link-end />+ </text:table-of-content-entry-template>+ <text:table-of-content-entry-template text:outline-level="6"+ text:style-name="Contents_20_6">+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-chapter />+ <text:index-entry-text />+ <text:index-entry-link-end />+ <text:index-entry-tab-stop style:type="right"+ style:leader-char="." />+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-page-number />+ <text:index-entry-link-end />+ </text:table-of-content-entry-template>+ <text:table-of-content-entry-template text:outline-level="7"+ text:style-name="Contents_20_7">+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-chapter />+ <text:index-entry-text />+ <text:index-entry-link-end />+ <text:index-entry-tab-stop style:type="right"+ style:leader-char="." />+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-page-number />+ <text:index-entry-link-end />+ </text:table-of-content-entry-template>+ <text:table-of-content-entry-template text:outline-level="8"+ text:style-name="Contents_20_8">+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-chapter />+ <text:index-entry-text />+ <text:index-entry-link-end />+ <text:index-entry-tab-stop style:type="right"+ style:leader-char="." />+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-page-number />+ <text:index-entry-link-end />+ </text:table-of-content-entry-template>+ <text:table-of-content-entry-template text:outline-level="9"+ text:style-name="Contents_20_9">+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-chapter />+ <text:index-entry-text />+ <text:index-entry-link-end />+ <text:index-entry-tab-stop style:type="right"+ style:leader-char="." />+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-page-number />+ <text:index-entry-link-end />+ </text:table-of-content-entry-template>+ <text:table-of-content-entry-template text:outline-level="10"+ text:style-name="Contents_20_10">+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-chapter />+ <text:index-entry-text />+ <text:index-entry-link-end />+ <text:index-entry-tab-stop style:type="right"+ style:leader-char="." />+ <text:index-entry-link-start text:style-name="Internet_20_link" />+ <text:index-entry-page-number />+ <text:index-entry-link-end />+ </text:table-of-content-entry-template>+ </text:table-of-content-source>+</text:table-of-content>+$endif$ $body$ $for(include-after)$ $include-after$
@@ -0,0 +1,65 @@+<?xml version="1.0" encoding="UTF-8"?>+<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing">+<w:body>+$if(title)$+ <w:p>+ <w:pPr>+ <w:pStyle w:val="$title-style-id$" />+ </w:pPr>+ $title$+ </w:p>+$endif$+$if(subtitle)$+ <w:p>+ <w:pPr>+ <w:pStyle w:val="$subtitle-style-id$" />+ </w:pPr>+ $subtitle$+ </w:p>+$endif$+$for(author)$+ <w:p>+ <w:pPr>+ <w:pStyle w:val="$author-style-id$" />+ </w:pPr>+ $author$+ </w:p>+$endfor$+$if(date)$+ <w:p>+ <w:pPr>+ <w:pStyle w:val="$date-style-id$" />+ </w:pPr>+ $date$+ </w:p>+$endif$+$if(abstract)$+$if(abstract-title)$+ <w:p>+ <w:pPr>+ <w:pStyle w:val="$abstract-title-style-id$" />+ </w:pPr>+ <w:r><w:t xml:space="preserve">$abstract-title$</w:t></w:r>+ </w:p>+$endif$+ $abstract$+$endif$+$for(include-before)$+ $include-before$+$endfor$+$if(toc)$+ $toc$+$endif$+$if(lof)$+ $lof$+$endif$+$if(lot)$+ $lot$+$endif$+ $body$+$for(include-after)$+ $include-after$+$endfor$+ $sectpr$+ </w:body>+</w:document>
@@ -1,18 +1,29 @@ $if(title)$-#+TITLE: $title$+#+title: $title$ $endif$ $if(author)$-#+AUTHOR: $for(author)$$author$$sep$; $endfor$+#+author: $for(author)$$author$$sep$; $endfor$ $endif$ $if(date)$-#+DATE: $date$+#+date: $date$ $endif$+$if(options/pairs)$+$for(options/pairs)$+#+options: ${it.key}:${it.value}+$endfor$++$endif$ $for(header-includes)$ $header-includes$ $endfor$+$if(abstract)$+#+begin_abstract+$abstract$+#+end_abstract+$endif$ $for(include-before)$ $include-before$
@@ -11,7 +11,7 @@ $endfor$ $if(toc)$-$toc$+$table-of-contents$ $endif$ $body$
@@ -1,50 +1,45 @@ <!DOCTYPE html>-<html$if(lang)$ lang="$lang$"$endif$>+<html$if(lang)$ lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$> <head> <meta charset="utf-8"> <meta name="generator" content="pandoc"> $for(author-meta)$- <meta name="author" content="$author-meta$" />+ <meta name="author" content="$author-meta$"> $endfor$ $if(date-meta)$- <meta name="dcterms.date" content="$date-meta$" />+ <meta name="dcterms.date" content="$date-meta$"> $endif$- <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>- <meta name="apple-mobile-web-app-capable" content="yes" />- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">- <link rel="stylesheet" href="$revealjs-url$/css/reveal.min.css"/>- <style type="text/css">code{white-space: pre;}</style>-$if(highlighting-css)$- <style type="text/css">-$highlighting-css$- </style>+$if(keywords)$+ <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$"> $endif$-$if(css)$-$for(css)$- <link rel="stylesheet" href="$css$"/>-$endfor$+ <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>+ <meta name="apple-mobile-web-app-capable" content="yes">+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">+ <link rel="stylesheet" href="$revealjs-url$/dist/reset.css">+ <link rel="stylesheet" href="$revealjs-url$/dist/reveal.css">+ <style>+ .reveal .sourceCode { /* see #7635 */+ overflow: visible;+ }+ $styles.html()$+ </style>+$if(theme)$+ <link rel="stylesheet" href="$revealjs-url$/dist/theme/$theme$.css" id="theme"> $else$- <link rel="stylesheet" href="$revealjs-url$/css/theme/simple.css" id="theme">+ <link rel="stylesheet" href="$revealjs-url$/dist/theme/black.css" id="theme"> $endif$- <!-- If the query includes 'print-pdf', include the PDF print sheet -->- <script>- if( window.location.search.match( /print-pdf/gi ) ) {- var link = document.createElement( 'link' );- link.rel = 'stylesheet';- link.type = 'text/css';- link.href = '$revealjs-url$/css/print/pdf.css';- document.getElementsByTagName( 'head' )[0].appendChild( link );- }- </script>- <!--[if lt IE 9]>- <script src="$revealjs-url$/lib/js/html5shiv.js"></script>- <![endif]-->+$if(highlight-js)$+ <link rel="stylesheet" href="$revealjs-url$/plugin/highlight/$highlightjs-theme$.css">+$endif$+$for(css)$+ <link rel="stylesheet" href="$css$"/>+$endfor$ $if(math)$- $math$+ $math$ $endif$ $for(header-includes)$- $header-includes$+ $header-includes$ $endfor$ </head> <body>@@ -55,20 +50,30 @@ <div class="slides"> $if(title)$-<section>- <h1 class="title">$title$</h1>+<section id="$idprefix$title-slide"$for(title-slide-attributes/pairs)$ $it.key$="$it.value$"$endfor$>+ <h1 class="title">$title$</h1> $if(subtitle)$- <h1 class="subtitle">$subtitle$</h1>+ <p class="subtitle">$subtitle$</p> $endif$ $for(author)$- <h2 class="author">$author$</h2>+ <p class="author">$author$</p> $endfor$- <h3 class="date">$date$</h3>+$for(institute)$+ <p class="institute">$institute$</p>+$endfor$+$if(date)$+ <p class="date">$date$</p>+$endif$ </section> $endif$ $if(toc)$ <section id="$idprefix$TOC">-$toc$+<nav role="doc-toc"> +$if(toc-title)$+<h2 id="$idprefix$toc-title">$toc-title$</h2>+$endif$+$table-of-contents$+</nav> </section> $endif$ @@ -76,30 +81,270 @@ </div> </div> + <script src="$revealjs-url$/dist/reveal.js"></script> - <script src="$revealjs-url$/lib/js/head.min.js"></script>- <script src="$revealjs-url$/js/reveal.min.js"></script>+ <!-- reveal.js plugins -->+ <script src="$revealjs-url$/plugin/notes/notes.js"></script>+ <script src="$revealjs-url$/plugin/search/search.js"></script>+ <script src="$revealjs-url$/plugin/zoom/zoom.js"></script>+$if(mathjax)$+ <script src="$revealjs-url$/plugin/math/math.js"></script>+$endif$+$if(highlight-js)$+ <script src="$revealjs-url$/plugin/highlight/highlight.js"></script>+$endif$ <script> - // Full list of configuration options available here:- // https://github.com/hakimel/reveal.js#configuration+ // Full list of configuration options available at:+ // https://revealjs.com/config/ Reveal.initialize({- controls: true,- progress: true,- history: true,- center: true,- theme: $if(theme)$'$theme$'$else$Reveal.getQueryHash().theme$endif$, // available themes are in /css/theme- transition: $if(transition)$'$transition$'$else$Reveal.getQueryHash().transition || 'default'$endif$, // default/cube/page/concave/zoom/linear/fade/none+ // Display controls in the bottom right corner+ controls: $controls$, - // Optional libraries used to extend on reveal.js- dependencies: [- { src: '$revealjs-url$/lib/js/classList.js', condition: function() { return !document.body.classList; } },- { src: '$revealjs-url$/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },- { src: '$revealjs-url$/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },-// { src: '$revealjs-url$/plugin/search/search.js', async: true, condition: function() { return !!document.body.classList; }, }-// { src: '$revealjs-url$/plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }-]});+ // Help the user learn the controls by providing hints, for example by+ // bouncing the down arrow when they first encounter a vertical slide+ controlsTutorial: $controlsTutorial$,++ // Determines where controls appear, "edges" or "bottom-right"+ controlsLayout: '$controlsLayout$',++ // Visibility rule for backwards navigation arrows; "faded", "hidden"+ // or "visible"+ controlsBackArrows: '$controlsBackArrows$',++ // Display a presentation progress bar+ progress: $progress$,++ // Display the page number of the current slide+ slideNumber: $slideNumber$,++ // 'all', 'print', or 'speaker'+ showSlideNumber: '$showSlideNumber$',++ // Add the current slide number to the URL hash so that reloading the+ // page/copying the URL will return you to the same slide+ hash: $hash$,++ // Start with 1 for the hash rather than 0+ hashOneBasedIndex: $hashOneBasedIndex$,++ // Flags if we should monitor the hash and change slides accordingly+ respondToHashChanges: $respondToHashChanges$,++ // Push each slide change to the browser history+ history: $history$,++ // Enable keyboard shortcuts for navigation+ keyboard: $keyboard$,++ // Enable the slide overview mode+ overview: $overview$,++ // Disables the default reveal.js slide layout (scaling and centering)+ // so that you can use custom CSS layout+ disableLayout: $disableLayout$,++ // Vertical centering of slides+ center: $center$,++ // Enables touch navigation on devices with touch input+ touch: $touch$,++ // Loop the presentation+ loop: $loop$,++ // Change the presentation direction to be RTL+ rtl: $rtl$,++ // see https://revealjs.com/vertical-slides/#navigation-mode+ navigationMode: '$navigationMode$',++ // Randomizes the order of slides each time the presentation loads+ shuffle: $shuffle$,++ // Turns fragments on and off globally+ fragments: $fragments$,++ // Flags whether to include the current fragment in the URL,+ // so that reloading brings you to the same fragment position+ fragmentInURL: $fragmentInURL$,++ // Flags if the presentation is running in an embedded mode,+ // i.e. contained within a limited portion of the screen+ embedded: $embedded$,++ // Flags if we should show a help overlay when the questionmark+ // key is pressed+ help: $help$,++ // Flags if it should be possible to pause the presentation (blackout)+ pause: $pause$,++ // Flags if speaker notes should be visible to all viewers+ showNotes: $showNotes$,++ // Global override for autoplaying embedded media (null/true/false)+ autoPlayMedia: $autoPlayMedia$,++ // Global override for preloading lazy-loaded iframes (null/true/false)+ preloadIframes: $preloadIframes$,++ // Number of milliseconds between automatically proceeding to the+ // next slide, disabled when set to 0, this value can be overwritten+ // by using a data-autoslide attribute on your slides+ autoSlide: $autoSlide$,++ // Stop auto-sliding after user input+ autoSlideStoppable: $autoSlideStoppable$,++ // Use this method for navigation when auto-sliding+ autoSlideMethod: $autoSlideMethod$,++ // Specify the average time in seconds that you think you will spend+ // presenting each slide. This is used to show a pacing timer in the+ // speaker view+ defaultTiming: $defaultTiming$,++ // Enable slide navigation via mouse wheel+ mouseWheel: $mouseWheel$,++ // The display mode that will be used to show slides+ display: '$display$',++ // Hide cursor if inactive+ hideInactiveCursor: $hideInactiveCursor$,++ // Time before the cursor is hidden (in ms)+ hideCursorTime: $hideCursorTime$,++ // Opens links in an iframe preview overlay+ previewLinks: $previewLinks$,++ // Transition style (none/fade/slide/convex/concave/zoom)+ transition: '$transition$',++ // Transition speed (default/fast/slow)+ transitionSpeed: '$transitionSpeed$',++ // Transition style for full page slide backgrounds+ // (none/fade/slide/convex/concave/zoom)+ backgroundTransition: '$backgroundTransition$',++ // Number of slides away from the current that are visible+ viewDistance: $viewDistance$,++ // Number of slides away from the current that are visible on mobile+ // devices. It is advisable to set this to a lower number than+ // viewDistance in order to save resources.+ mobileViewDistance: $mobileViewDistance$,+$if(view)$++ // Enable scroll view+ view: '$view/nowrap$',+ // see https://revealjs.com/scroll-view/#scrollbar+$if(scrollProgressAuto)$+ scrollProgress: 'auto',+$elseif(scrollProgress)$+ scrollProgress: $scrollProgress$,+$else$+ scrollProgress: false,+$endif$+ // see https://revealjs.com/scroll-view/#url-activation+ scrollActivationWidth: $scrollActivationWidth$,+ // see https://revealjs.com/scroll-view/#scroll-snapping+$if(scrollSnap)$+ scrollSnap: '$scrollSnap/nowrap$',+$else$+ scrollSnap: false,+$endif$+ // Experimental. see https://revealjs.com/scroll-view/#scroll-snapping+ scrollLayout: '$scrollLayout/nowrap$',+$endif$+$if(parallaxBackgroundImage)$++ // Parallax background image+ parallaxBackgroundImage: '$parallaxBackgroundImage/nowrap$', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"+$else$+$if(background-image)$++ // Parallax background image+ parallaxBackgroundImage: '$background-image/nowrap$', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"+$endif$+$endif$+$if(parallaxBackgroundSize)$++ // Parallax background size+ parallaxBackgroundSize: '$parallaxBackgroundSize/nowrap$', // CSS syntax, e.g. "2100px 900px"+$endif$+$if(parallaxBackgroundHorizontal)$++ // Amount to move parallax background (horizontal and vertical) on slide change+ // Number, e.g. 100+ parallaxBackgroundHorizontal: $parallaxBackgroundHorizontal/nowrap$,+$endif$+$if(parallaxBackgroundVertical)$++ parallaxBackgroundVertical: $parallaxBackgroundVertical/nowrap$,+$endif$+$if(width)$++ // The "normal" size of the presentation, aspect ratio will be preserved+ // when the presentation is scaled to fit different resolutions. Can be+ // specified using percentage units.+ width: $width$,+$endif$+$if(height)$++ height: $height$,+$endif$+$if(margin)$++ // Factor of the display size that should remain empty around the content+ margin: $margin$,+$endif$+$if(minScale)$++ // Bounds for smallest/largest possible scale to apply to content+ minScale: $minScale$,+$endif$+$if(maxScale)$++ maxScale: $maxScale$,+$endif$+$if(mathjax)$++ math: {+ mathjax: '$mathjaxurl$',+ config: 'TeX-AMS_HTML-full',+ tex2jax: {+ inlineMath: [['\\(','\\)']],+ displayMath: [['\\[','\\]']],+ balanceBraces: true,+ processEscapes: false,+ processRefs: true,+ processEnvironments: true,+ preview: 'TeX',+ skipTags: ['script','noscript','style','textarea','pre','code'],+ ignoreClass: 'tex2jax_ignore',+ processClass: 'tex2jax_process'+ },+ },+$endif$++ // reveal.js plugins+ plugins: [+$if(mathjax)$+ RevealMath,+$endif$+$if(highlight-js)$+ RevealHighlight,+$endif$+ RevealNotes,+ RevealSearch,+ RevealZoom+ ]+ }); </script> $for(include-after)$ $include-after$
@@ -1,23 +1,49 @@-$if(title)$-$title$+$if(titleblock)$+$titleblock$ -$endif$ $for(author)$-:Author: $author$+:Author: $^$$author$ $endfor$-$if(date)$-:Date: $date$+$if(authors)$+:Authors:+ $author$ $endif$-$if(author)$--$else$ $if(date)$-+:Date: $^$$date$ $endif$+$if(address)$+:Address: $^$$address$ $endif$-$if(math)$-.. role:: math(raw)- :format: html latex+$if(contact)$+:Contact: $^$$contact$+$endif$+$if(copyright)$+:Copyright: $^$$copyright$+$endif$+$if(dedication)$+:Dedication: $^$$dedication$+$endif$+$if(organization)$+:Organization: $^$$organization$+$endif$+$if(revision)$+:Revision: $^$$revision$+$endif$+$if(status)$+:Status: $^$$status$+$endif$+$if(version)$+:Version: $^$$version$+$endif$+$if(abstract)$+:Abstract:+ $abstract$+$endif$++$endif$+$if(rawtex)$+.. role:: raw-latex(raw)+ :format: latex .. $endif$@@ -29,6 +55,10 @@ .. contents:: :depth: $toc-depth$ ..++$endif$+$if(number-sections)$+.. section-numbering:: $endif$ $for(header-includes)$
@@ -1,4 +1,4 @@-{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 Courier;}}+{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 \fmodern Courier;}} {\colortbl;\red255\green0\blue0;\red0\green0\blue255;} \widowctrl\hyphauto $for(header-includes)$@@ -18,7 +18,7 @@ {\pard \ql \f0 \sa180 \li0 \fi0 \par} $endif$ $if(toc)$-$toc$+$table-of-contents$ $endif$ $for(include-before)$ $include-before$
@@ -1,25 +1,26 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">-<html xmlns="http://www.w3.org/1999/xhtml">+<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta name="generator" content="pandoc" /> $for(author-meta)$+ <meta name="version" content="S5 1.1" /> <meta name="author" content="$author-meta$" /> $endfor$ $if(date-meta)$ <meta name="date" content="$date-meta$" /> $endif$- <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>- <style type="text/css">code{white-space: pre;}</style>+$if(keywords)$+ <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />+$endif$+ <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>+ <style type="text/css">+ $styles.html()$+ </style> <!-- configuration parameters --> <meta name="defaultView" content="slideshow" /> <meta name="controlVis" content="hidden" />-$if(highlighting-css)$- <style type="text/css">-$highlighting-css$- </style>-$endif$ $for(css)$ <link rel="stylesheet" href="$css$" type="text/css" /> $endfor$@@ -52,13 +53,25 @@ </div> <div class="presentation"> $if(title)$-<div class="titleslide slide">- <h1>$title$</h1>+<div class="title-slide slide">+ <h1 class="title">$title$</h1> $if(subtitle)$- <h1 class="subtitle">$subtitle$</h1>+ <h2 class="subtitle">$subtitle$</h2> $endif$- <h2>$for(author)$$author$$sep$<br/>$endfor$</h2>- <h3>$date$</h3>+$if(author)$+ <h3 class="author">$for(author)$$author$$sep$<br/>$endfor$</h3>+$endif$+$if(institute)$+ <h3 class="institute">$for(institute)$$institute$$sep$<br/>$endfor$</h3>+$endif$+$if(date)$+ <h4 class="date">$date$</h4>+$endif$+</div>+$endif$+$if(toc)$+<div class="slide" id="$idprefix$TOC">+$table-of-contents$ </div> $endif$ $body$
@@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">-<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$>+<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" />@@ -12,13 +12,13 @@ $if(date-meta)$ <meta name="date" content="$date-meta$" /> $endif$- <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>- <style type="text/css">code{white-space: pre;}</style>-$if(highlighting-css)$+$if(keywords)$+ <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />+$endif$+ <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title> <style type="text/css">-$highlighting-css$+ $styles.html()$ </style>-$endif$ <link rel="stylesheet" type="text/css" media="screen, projection, print" href="$slideous-url$/slideous.css" /> $for(css)$@@ -63,12 +63,24 @@ $if(subtitle)$ <h1 class="subtitle">$subtitle$</h1> $endif$+$if(author)$ <p class="author"> $for(author)$$author$$sep$<br/>$endfor$ </p>+$endif$+$if(institute)$+ <p class="institute">+$for(institute)$$institute$$sep$<br/>$endfor$+ </p>+$endif$ $if(date)$ <p class="date">$date$</p> $endif$+</div>+$endif$+$if(toc)$+<div class="slide" id="$idprefix$TOC">+$table-of-contents$ </div> $endif$ $body$
@@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">-<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$>+<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" />@@ -12,13 +12,13 @@ $if(date-meta)$ <meta name="date" content="$date-meta$" /> $endif$- <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>- <style type="text/css">code{white-space: pre;}</style>-$if(highlighting-css)$+$if(keywords)$+ <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />+$endif$+ <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title> <style type="text/css">-$highlighting-css$+ $styles.html()$ </style>-$endif$ <link rel="stylesheet" type="text/css" media="screen, projection, print" href="$slidy-url$/styles/slidy.css" /> $for(css)$@@ -45,14 +45,26 @@ <div class="slide titlepage"> <h1 class="title">$title$</h1> $if(subtitle)$- <h1 class="subtitle">$subtitle$</h1>+ <p class="subtitle">$subtitle$</p> $endif$+$if(author)$ <p class="author"> $for(author)$$author$$sep$<br/>$endfor$ </p>+$endif$+$if(institute)$+ <p class="institute">+$for(institute)$$institute$$sep$<br/>$endfor$+ </p>+$endif$ $if(date)$ <p class="date">$date$</p> $endif$+</div>+$endif$+$if(toc)$+<div class="slide" id="$idprefix$TOC">+$table-of-contents$ </div> $endif$ $body$
@@ -0,0 +1,51 @@+<?xml version="1.0" encoding="utf-8"?>+<TEI xmlns="http://www.tei-c.org/ns/1.0"$if(lang)$ xml:lang="$lang$"$endif$>+<teiHeader>+ <fileDesc>+ <titleStmt>+ <title>$title$</title>+$for(author)$+ <author>$author$</author>+$endfor$+ </titleStmt>+ <publicationStmt>+$if(publicationStmt)$+ <p>$if(publicationStmt)$$publicationStmt$$endif$</p>+$endif$+$if(license)$+ <availability><licence>$license$</licence></availability>+$endif$+$if(publisher)$+ <publisher>$publisher$</publisher>+$endif$+$if(pubPlace)$+ <pubPlace>$pubPlace$</pubPlace>+$endif$+$if(address)$+ <address>$address$</address>+$endif$+$if(date)$+ <date>$date$</date>+$endif$+ </publicationStmt>+ <sourceDesc>+$if(sourceDesc)$+ $sourceDesc$+$else$+ <p>Produced by pandoc.</p>+$endif$+ </sourceDesc>+ </fileDesc>+</teiHeader>+<text>+$for(include-before)$+$include-before$+$endfor$+<body>+$body$+</body>+$for(include-after)$+$include-after$+$endfor$+</text>+</TEI>
@@ -1,4 +1,11 @@-\input texinfo+\input texinfo @c -*-texinfo-*-+$if(filename)$+@setfilename $filename$+$endif$+$if(title)$+@settitle $title$$if(version)$ $version$$endif$+$endif$+ @documentencoding UTF-8 $for(header-includes)$ $header-includes$@@ -10,34 +17,15 @@ @end macro $endif$-$if(subscript)$-@macro textsubscript{text}-@iftex-@textsubscript{\text\}-@end iftex @ifnottex-_@{\text\@}-@end ifnottex-@end macro--$endif$-$if(superscript)$-@macro textsuperscript{text}-@iftex-@textsuperscript{\text\}-@end iftex-@ifnottex-^@{\text\@}-@end ifnottex-@end macro--$endif$-@ifnottex @paragraphindent 0 @end ifnottex $if(titlepage)$ @titlepage @title $title$+$if(version)$+@subtitle $version$+$endif$ $for(author)$ @author $author$ $endfor$
@@ -0,0 +1,154 @@+#let horizontalrule = line(start: (25%,0%), end: (75%,0%))++#show terms.item: it => block(breakable: false)[+ #text(weight: "bold")[#it.term]+ #block(inset: (left: 1.5em, top: -0.4em))[#it.description]+]++#set table(+ inset: 6pt,+ stroke: none+)++#show figure.where(+ kind: table+): set figure.caption(position: $if(table-caption-position)$$table-caption-position$$else$top$endif$)++#show figure.where(+ kind: image+): set figure.caption(position: $if(figure-caption-position)$$figure-caption-position$$else$bottom$endif$)++$if(highlighting-definitions)$+// syntax highlighting functions from skylighting:+$highlighting-definitions$++$endif$+$if(template)$+#import "$template$": conf+$else$+$template.typst()$+$endif$++$if(smart)$+$else$+#set smartquote(enabled: false)++$endif$+$for(header-includes)$+$header-includes$++$endfor$+#show: doc => conf(+$if(title)$+ title: [$title$],+$endif$+$if(subtitle)$+ subtitle: [$subtitle$],+$endif$+$if(author)$+ authors: (+$for(author)$+$if(author.name)$+ ( name: [$author.name$],+ affiliation: [$author.affiliation$],+ email: [$author.email$] ),+$else$+ ( name: [$author$],+ affiliation: "",+ email: "" ),+$endif$+$endfor$+ ),+$endif$+$if(keywords)$+ keywords: ($for(keywords)$$keywords$$sep$,$endfor$),+$endif$+$if(date)$+ date: [$date$],+$endif$+$if(lang)$+ lang: "$lang$",+$endif$+$if(region)$+ region: "$region$",+$endif$+$if(abstract-title)$+ abstract-title: [$abstract-title$],+$endif$+$if(abstract)$+ abstract: [$abstract$],+$endif$+$if(thanks)$+ thanks: [$thanks$],+$endif$+$if(margin)$+ margin: ($for(margin/pairs)$$margin.key$: $margin.value$,$endfor$),+$endif$+$if(papersize)$+ paper: "$papersize$",+$endif$+$if(mainfont)$+ font: ("$mainfont$",),+$endif$+$if(fontsize)$+ fontsize: $fontsize$,+$endif$+$if(mathfont)$+ mathfont: ($for(mathfont)$"$mathfont$",$endfor$),+$endif$+$if(codefont)$+ codefont: ($for(codefont)$"$codefont$",$endfor$),+$endif$+$if(linestretch)$+ linestretch: $linestretch$,+$endif$+$if(section-numbering)$+ sectionnumbering: "$section-numbering$",+$endif$+ pagenumbering: $if(page-numbering)$"$page-numbering$"$else$none$endif$,+$if(linkcolor)$+ linkcolor: [$linkcolor$],+$endif$+$if(citecolor)$+ citecolor: [$citecolor$],+$endif$+$if(filecolor)$+ filecolor: [$filecolor$],+$endif$+ cols: $if(columns)$$columns$$else$1$endif$,+ doc,+)++$for(include-before)$+$include-before$++$endfor$+$if(toc)$+#outline(+ title: auto,+ depth: $toc-depth$+);+$endif$++$body$++$if(citations)$+$for(nocite-ids)$+#cite(label("${it}"), form: none)+$endfor$+$if(csl)$++#set bibliography(style: "$csl$")+$elseif(bibliographystyle)$++#set bibliography(style: "$bibliographystyle$")+$endif$+$if(bibliography)$++#bibliography(($for(bibliography)$"$bibliography$"$sep$,$endfor$)$if(full-bibliography)$, full: true$endif$)+$endif$+$endif$+$for(include-after)$++$include-after$+$endfor$
@@ -0,0 +1,16 @@+$if(filename)$*${filename}* $endif$$if(abstract)$${abstract}$endif$$if(filename)$+++$endif$$if(combined-title)$${combined-title}+++$endif$$toc-reminder$++$if(toc)$+$toc$++$endif$++$body$++ $modeline$
@@ -0,0 +1,13 @@+$for(include-before)$+$include-before$++$endfor$+$if(toc)$+{{toc /}}++$endif$+$body$+$for(include-after)$++$include-after$+$endfor$
@@ -0,0 +1,16 @@+Content-Type: text/x-zim-wiki+Wiki-Format: zim 0.4++$for(include-before)$+$include-before$++$endfor$+$if(toc)$+__TOC__++$endif$+$body$+$for(include-after)$++$include-after$+$endfor$
@@ -0,0 +1,20 @@+$--+$-- PDF standard support (PDF/A, PDF/UA, PDF/X)+$-- Requires LuaLaTeX and recent LaTeX (2023+)+$--+$if(pdfstandard)$+\DocumentMetadata{+$if(pdfstandard.version)$+ pdfversion=$pdfstandard.version$,+$endif$+$if(pdfstandard.standards)$+ pdfstandard={$for(pdfstandard.standards)$$it$$sep$,$endfor$},+$endif$+$if(pdfstandard.tagging)$+ tagging=on,+$endif$+$if(lang)$+ lang=$lang$,+$endif$+ xmp=true}+$endif$
@@ -0,0 +1,103 @@+$-- User font settings (must come after default font and Beamer theme)+$if(fontfamily)$+\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}+$endif$+\ifPDFTeX\else+ % xetex/luatex font selection+$if(mainfont)$+$if(mainfontfallback)$+ \ifLuaTeX+ \usepackage{luaotfload}+ \directlua{luaotfload.add_fallback("mainfontfallback",{+ $for(mainfontfallback)$"$mainfontfallback$"$sep$,$endfor$+ })}+ \fi+$endif$+ \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$}+$endif$+$if(sansfont)$+$if(sansfontfallback)$+ \ifLuaTeX+ \usepackage{luaotfload}+ \directlua{luaotfload.add_fallback("sansfontfallback",{+ $for(sansfontfallback)$"$sansfontfallback$"$sep$,$endfor$+ })}+ \fi+$endif$+ \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$$if(sansfontfallback)$,RawFeature={fallback=sansfontfallback}$endif$]{$sansfont$}+$endif$+$if(monofont)$+$if(monofontfallback)$+ \ifLuaTeX+ \usepackage{luaotfload}+ \directlua{luaotfload.add_fallback("monofontfallback",{+ $for(monofontfallback)$"$monofontfallback$"$sep$,$endfor$+ })}+ \fi+$endif$+ \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$if(monofontfallback)$,RawFeature={fallback=monofontfallback}$endif$]{$monofont$}+$endif$+$for(fontfamilies)$+ \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}+$endfor$+$if(mathfont)$+$if(mathspec)$+ \ifXeTeX+ \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}+ \else+ \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}+ \fi+$else$+ \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}+$endif$+$endif$+$if(CJKmainfont)$+ \ifXeTeX+ \usepackage{xeCJK}+ \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}+$if(CJKsansfont)$+ \setCJKsansfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKsansfont$}+$endif$+$if(CJKmonofont)$+ \setCJKmonofont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmonofont$}+$endif$+ \fi+$endif$+$if(luatexjapresetoptions)$+ \ifLuaTeX+ \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}+ \fi+$endif$+$if(CJKmainfont)$+ \ifLuaTeX+ \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}+ \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}+ \fi+$endif$+\fi+$if(zero-width-non-joiner)$+%% Support for zero-width non-joiner characters.+\makeatletter+\def\zerowidthnonjoiner{%+ % Prevent ligatures and adjust kerning, but still support hyphenating.+ \texorpdfstring{%+ \TextOrMath{\nobreak\discretionary{-}{}{\kern.03em}%+ \ifvmode\else\nobreak\hskip\z@skip\fi}{}%+ }{}%+}+\makeatother+\ifPDFTeX+ \DeclareUnicodeCharacter{200C}{\zerowidthnonjoiner}+\else+ \catcode`^^^^200c=\active+ \protected\def ^^^^200c{\zerowidthnonjoiner}+\fi+%% End of ZWNJ support+$endif$+% Use upquote if available, for straight quotes in verbatim environments+\IfFileExists{upquote.sty}{\usepackage{upquote}}{}+\IfFileExists{microtype.sty}{% use microtype if available+ \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}+ \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts+}{}+
@@ -0,0 +1,23 @@+\usepackage{iftex}+\ifPDFTeX+ \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}+ \usepackage[utf8]{inputenc}+ \usepackage{textcomp} % provide euro and other symbols+\else % if luatex or xetex+$if(mathspec)$+ \ifXeTeX+ \usepackage{mathspec} % this also loads fontspec+ \else+ \usepackage{unicode-math} % this also loads fontspec+ \fi+$else$+ \usepackage{unicode-math} % this also loads fontspec+$endif$+ \defaultfontfeatures{Scale=MatchLowercase}$-- must come before Beamer theme+ \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}+\fi+$if(fontfamily)$+$else$+$-- Set default font before Beamer theme so the theme can override it+\usepackage{lmodern}+$endif$
@@ -0,0 +1,34 @@+% fallback for those not using the hyperref driver hyperxmp:+\makeatletter+\@ifundefined{xmpquote}{\newcommand{\xmpquote}[1]{#1}}{}+\makeatother+\hypersetup{+$if(title-meta)$+ pdftitle={$title-meta$},+$endif$+$if(author-meta)$+ pdfauthor={$author-meta$},+$endif$+$if(lang)$+ pdflang={$lang$},+$endif$+$if(subject)$+ pdfsubject={$subject$},+$endif$+$if(keywords)$+ pdfkeywords={$for(keywords)$\xmpquote{$keywords$}$sep$, $endfor$},+$endif$+$if(colorlinks)$+ colorlinks=true,+ linkcolor={$if(linkcolor)$$linkcolor$$else$Maroon$endif$},+ filecolor={$if(filecolor)$$filecolor$$else$Maroon$endif$},+ citecolor={$if(citecolor)$$citecolor$$else$Blue$endif$},+ urlcolor={$if(urlcolor)$$urlcolor$$else$Blue$endif$},+$else$+$if(boxlinks)$+$else$+ hidelinks,+$endif$+$endif$+ pdfcreator={LaTeX via pandoc}}+
@@ -0,0 +1,9 @@+% Options for packages loaded elsewhere+\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}+\PassOptionsToPackage{hyphens}{url}+$if(colorlinks)$+\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}+$endif$+$if(CJKmainfont)$+\PassOptionsToPackage{space}{xeCJK}+$endif$
@@ -0,0 +1,23 @@+/* CSS for citations */+div.csl-bib-body { }+div.csl-entry {+ clear: both;+$if(csl-entry-spacing)$+ margin-bottom: $csl-entry-spacing$;+$endif$+}+.hanging-indent div.csl-entry {+ margin-left:2em;+ text-indent:-2em;+}+div.csl-left-margin {+ min-width:2em;+ float:left;+}+div.csl-right-inline {+ margin-left:2em;+ padding-left:1em;+}+div.csl-indent {+ margin-left: 2em;+}
@@ -0,0 +1,216 @@+/* Default styles provided by pandoc.+** See https://pandoc.org/MANUAL.html#variables-for-html for config info.+*/+$if(document-css)$+html {+$if(mainfont)$+ font-family: $mainfont$;+$endif$+$if(fontsize)$+ font-size: $fontsize$;+$endif$+$if(linestretch)$+ line-height: $linestretch$;+$endif$+ color: $if(fontcolor)$$fontcolor$$else$#1a1a1a$endif$;+ background-color: $if(backgroundcolor)$$backgroundcolor$$else$#fdfdfd$endif$;+}+body {+ margin: 0 auto;+ max-width: $if(maxwidth)$$maxwidth$$else$36em$endif$;+ padding-left: $if(margin-left)$$margin-left$$else$50px$endif$;+ padding-right: $if(margin-right)$$margin-right$$else$50px$endif$;+ padding-top: $if(margin-top)$$margin-top$$else$50px$endif$;+ padding-bottom: $if(margin-bottom)$$margin-bottom$$else$50px$endif$;+ hyphens: auto;+ overflow-wrap: break-word;+ text-rendering: optimizeLegibility;+ font-kerning: normal;+}+@media (max-width: 600px) {+ body {+ font-size: 0.9em;+ padding: 12px;+ }+ h1 {+ font-size: 1.8em;+ }+}+@media print {+ html {+ background-color: $if(backgroundcolor)$$backgroundcolor$$else$white$endif$;+ }+ body {+ background-color: transparent;+ color: black;+ font-size: 12pt;+ }+ p, h2, h3 {+ orphans: 3;+ widows: 3;+ }+ h2, h3, h4 {+ page-break-after: avoid;+ }+}+p {+ margin: 1em 0;+}+a {+ color: $if(linkcolor)$$linkcolor$$else$#1a1a1a$endif$;+}+a:visited {+ color: $if(linkcolor)$$linkcolor$$else$#1a1a1a$endif$;+}+img {+ max-width: 100%;+}+svg {+ height: auto;+ max-width: 100%;+}+h1, h2, h3, h4, h5, h6 {+ margin-top: 1.4em;+}+h5, h6 {+ font-size: 1em;+ font-style: italic;+}+h6 {+ font-weight: normal;+}+ol, ul {+ padding-left: 1.7em;+ margin-top: 1em;+}+li > ol, li > ul {+ margin-top: 0;+}+blockquote {+ margin: 1em 0 1em 1.7em;+ padding-left: 1em;+ border-left: 2px solid #e6e6e6;+ color: #606060;+}+$if(abstract)$+div.abstract {+ margin: 2em 2em 2em 2em;+ text-align: left;+ font-size: 85%;+}+div.abstract-title {+ font-weight: bold;+ text-align: center;+ padding: 0;+ margin-bottom: 0.5em;+}+$endif$+code {+ white-space: pre-wrap;+ font-family: $if(monofont)$$monofont$$else$Menlo, Monaco, Consolas, 'Lucida Console', monospace$endif$;+$if(monobackgroundcolor)$+ background-color: $monobackgroundcolor$;+ padding: .2em .4em;+$endif$+ font-size: 85%;+ margin: 0;+ hyphens: manual;+}+pre {+ margin: 1em 0;+$if(monobackgroundcolor)$+ background-color: $monobackgroundcolor$;+ padding: 1em;+$endif$+ overflow: auto;+}+pre code {+ padding: 0;+ overflow: visible;+ overflow-wrap: normal;+}+.sourceCode {+ background-color: transparent;+ overflow: visible;+}+hr {+ border: none;+ border-top: 1px solid #1a1a1a;+ height: 1px;+ margin: 1em 0;+}+table {+ margin: 1em 0;+ border-collapse: collapse;+ width: 100%;+ overflow-x: auto;+ display: block;+ font-variant-numeric: lining-nums tabular-nums;+}+table caption {+$if(table-caption-below)$+ caption-side: bottom;+ margin-top: 0.75em;+$else$+ margin-bottom: 0.75em;+$endif$+}+tbody {+ margin-top: 0.5em;+ border-top: 1px solid $if(fontcolor)$$fontcolor$$else$#1a1a1a$endif$;+ border-bottom: 1px solid $if(fontcolor)$$fontcolor$$else$#1a1a1a$endif$;+}+th {+ border-top: 1px solid $if(fontcolor)$$fontcolor$$else$#1a1a1a$endif$;+ padding: 0.25em 0.5em 0.25em 0.5em;+}+td {+ padding: 0.125em 0.5em 0.25em 0.5em;+}+header {+ margin-bottom: 4em;+ text-align: center;+}+#TOC li {+ list-style: none;+}+#TOC ul {+ padding-left: 1.3em;+}+#TOC > ul {+ padding-left: 0;+}+#TOC a:not(:hover) {+ text-decoration: none;+}+$endif$+span.smallcaps{font-variant: small-caps;}+div.columns{display: flex; gap: 1.5em;}+div.column{flex: auto;}+@media screen {+div.columns{gap: min(4vw, 1.5em);}+div.column{overflow-x: auto;}+}+div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}+/* The extra [class] is a hack that increases specificity enough to+ override a similar rule in reveal.js */+ul.task-list[class]{list-style: none;}+ul.task-list li input[type="checkbox"] {+ font-size: inherit;+ width: 0.8em;+ margin: 0 0.8em 0.2em -1.6em;+ vertical-align: middle;+}+$if(quotes)$+q { quotes: "“" "”" "‘" "’"; }+$endif$+$if(displaymath-css)$+.display.math{display: block; text-align: center; margin: 0.5rem auto;}+$endif$+$if(highlighting-css)$+/* CSS for syntax highlighting */+$highlighting-css$+$endif$+$if(csl-css)$+$styles.citations.html()$+$endif$
@@ -0,0 +1,120 @@+#let content-to-string(content) = {+ if content.has("text") {+ content.text+ } else if content.has("children") {+ content.children.map(content-to-string).join("")+ } else if content.has("body") {+ content-to-string(content.body)+ } else if content == [ ] {+ " "+ }+}+#let conf(+ title: none,+ subtitle: none,+ authors: (),+ keywords: (),+ date: none,+ abstract-title: none,+ abstract: none,+ thanks: none,+ cols: 1,+ margin: (x: 1.25in, y: 1.25in),+ paper: "us-letter",+ lang: "en",+ region: "US",+ font: none,+ fontsize: 11pt,+ mathfont: none,+ codefont: none,+ linestretch: 1,+ sectionnumbering: none,+ linkcolor: none,+ citecolor: none,+ filecolor: none,+ pagenumbering: "1",+ doc,+) = {+ set document(+ title: title,+ keywords: keywords,+ )+ set document(+ author: authors.map(author => content-to-string(author.name)).join(", ", last: " & "),+ ) if authors != none and authors != ()+ set page(+ paper: paper,+ margin: margin,+ numbering: pagenumbering,+ columns: cols+ )++ set par(+ justify: true,+ leading: linestretch * 0.65em+ )+ set text(lang: lang,+ region: region,+ size: fontsize)++ set text(font: font) if font != none+ show math.equation: set text(font: mathfont) if mathfont != none+ show raw: set text(font: codefont) if codefont != none++ set heading(numbering: sectionnumbering)++ show link: set text(fill: rgb(content-to-string(linkcolor))) if linkcolor != none+ show ref: set text(fill: rgb(content-to-string(citecolor))) if citecolor != none+ show link: this => {+ if filecolor != none and type(this.dest) == label {+ text(this, fill: rgb(content-to-string(filecolor)))+ } else {+ text(this)+ }+ }++ if title != none {+ place(top, float: true, scope: "parent", clearance: 4mm, block(below: 1em, width: 100%)[+ #if title != none {+ align(center, block[+ #text(weight: "bold", size: 1.5em, hyphenate: false)[#title #if thanks != none {+ footnote(thanks, numbering: "*")+ counter(footnote).update(n => n - 1)+ }]+ #(+ if subtitle != none {+ parbreak()+ text(weight: "bold", size: 1.25em, hyphenate: false)[#subtitle]+ }+ )])+ }++ #if authors != none and authors != [] {+ let count = authors.len()+ let ncols = calc.min(count, 3)+ grid(+ columns: (1fr,) * ncols,+ row-gutter: 1.5em,+ ..authors.map(author => align(center)[+ #author.name \+ #author.affiliation \+ #author.email+ ])+ )+ }++ #if date != none {+ align(center)[#block(inset: 1em)[+ #date+ ]]+ }++ #if abstract != none {+ block(inset: 2em)[+ #text(weight: "semibold")[#abstract-title] #h(1em) #abstract+ ]+ }+ ])+ }+ doc+}
@@ -0,0 +1,20 @@+Abstract: Samevatting+Appendix: Bylae+Bibliography: Bibliografie+Cc: a.a.+Chapter: Hoofstuk+Contents: Inhoudsopgawe+Encl: Bylae(n)+Figure: Figuur+Index: Inhoud+ListOfFigures: Lys van figure+ListOfTables: Lys van tabelle+Page: Bladsy+Part: Deel+Preface: Voorwoord+Proof: Bewys+References: Verwysings+See: sien+SeeAlso: sien ook+Table: Tabel+To: Aan
@@ -0,0 +1,5 @@+Chapter: Бажалык+Contents: Бажалыктар+Figure: Јурук+Glossary: Сӧзлик+Preface: Сӧс бажы
@@ -0,0 +1,20 @@+Abstract: አኅጽተሮ ጽሁፍ+Appendix: መድበል+Bibliography: ቢዋ መጽሃፍት+Cc: ግልባጭ+Chapter: ክፍል+Contents: ይዘት+Encl: አባሪዎች+Figure: ሥዕል+Index: ምህጻር ቃል+ListOfFigures: የሥዕችሎ ማውጫ+ListOfTables: የሰንጠዥረ ማውጫ+Page: ገጽ+Part: ንዑስ ክፍል+Preface: መቅድም+Proof: ማረጋገጫ+References: የነሥ ጹሁፍ ምንጭ+See: ይመልከቱ+SeeAlso: ይህምን ይመልከቱ+Table: ሰንጠረዥ+To: ለ
@@ -0,0 +1,21 @@+Abstract: ملخص+Appendix: الملاحق+Bibliography: المصادر+Cc: نسخة ل+Chapter: باب+Contents: المحتويات+Encl: المرفقات+Figure: شكل+Glossary: قاموس+Index: الفهرس+ListOfFigures: قائمة الأشكال+ListOfTables: قائمة الجداول+Page: صفحة+Part: القسم+Preface: مدخل+Proof: برهان+References: المراجع+See: راجع+SeeAlso: راجع أيضًا+Table: جدول+To: إلى
@@ -0,0 +1,21 @@+Abstract: মূলভাৱ+Appendix: পৰিশিষ্ট+Bibliography: তথ্যসূত্ৰ+Cc: প্ৰতিলিপি+Chapter: অধ্যায়+Contents: সমল+Encl: সংযোজিত+Figure: চিত্ৰ+Glossary: অৰ্থকোষ+Index: বিষয়সূচী+ListOfFigures: চিত্ৰসূচী+ListOfTables: তালিকাসূচী+Page: পৃষ্ঠা+Part: অংশ+Preface: পাতনি+Proof: প্ৰমাণ+References: প্ৰসংগ+See: চাওক+SeeAlso: ও+Table: তালিকা+To: মুখে
@@ -0,0 +1,21 @@+Abstract: Sumariu+Appendix: Apéndiz+Bibliography: Bibliografía+Cc: cc+Chapter: Capítulu+Contents: Conteníu+Encl: incl.+Figure: Figura+Glossary: Glosariu+Index: Índiz+ListOfFigures: Llista de figures+ListOfTables: Llista de tables+Page: Páxina+Part: Parte+Preface: Entamu+Proof: Demostración+References: Referencies+See: ver+SeeAlso: ver tamién+Table: Tabla+To: Pa
@@ -0,0 +1,21 @@+Abstract: Annotasiya+Appendix: Əlavə+Bibliography: Ədəbiyyat+Cc: cc+Chapter: Fəsil+Contents: Mündəricat+Encl: encl+Figure: Şəkil+Glossary: Terminlər lüğəti+Index: Mövzu göstəricisi+ListOfFigures: Şəkillərin siyahısı+ListOfTables: Cədvəllərin siyahısı+Page: səh.+Part: Hissə+Preface: Ön söz+Proof: İsbatı+References: Ədəbiyyat+See: baxın+SeeAlso: həmçinin baxın+Table: Cədvəl+To: To
@@ -0,0 +1,21 @@+Abstract: Анатацыя+Appendix: Дадатак+Bibliography: Літаратура+Cc: зых.+Chapter: Глава+Contents: Зьмест+Encl: укл.+Figure: Рыс.+Glossary: Слоўнік тэрмінаў+Index: Прадметны паказальнік+ListOfFigures: Сьпіс ілюстрацый+ListOfTables: Сьпіс табліц+Page: с.+Part: Частка+Preface: Прадмова+Proof: Доказ+References: Сьпіс літаратуры+See: гл.+SeeAlso: гл. таксама+Table: Табліца+To: вх.
@@ -0,0 +1,21 @@+Abstract: Абстракт+Appendix: Приложение+Bibliography: Библиография+Cc: копия+Chapter: Глава+Contents: Съдържание+Encl: Приложения+Figure: Фигура+Glossary: Притурка+Index: Азбучен указател+ListOfFigures: Списък на фигурите+ListOfTables: Списък на таблиците+Page: Стр.+Part: Част+Preface: Предговор+Proof: Доказателство+References: Литература+See: вж.+SeeAlso: вж. също и+Table: Таблица+To: За
@@ -0,0 +1,21 @@+Abstract: সারসংক্ষেপ+Appendix: পরিশিষ্ট+Bibliography: তথ্যবিবরণ+Cc: অনুলিপি+Chapter: অধ্যায়+Contents: সূচীপত্র+Encl: সংযুক্তি+Figure: ছবি/নকশা+Glossary: পরিভাষার শব্দসম্ভার+Index: সূচক/নির্দেশক+ListOfFigures: ছবি/নকশা সমূহের তালিকা+ListOfTables: তালিকাসারণী+Page: পৃষ্ঠা+Part: খন্ড+Preface: পূর্বকথা+Proof: প্রমাণ+References: তথ্যসুত্রসমূহ+See: দেখুন+SeeAlso: আরও দেখুন+Table: সারনী+To: প্রতি
@@ -0,0 +1,14 @@+Abstract: གནད་བསྡུས།+Appendix: ཞར་བྱུང་།+Bibliography: དཔེ་ཆའི་ཐོ་གཞུང་།+Cc: འདྲ་བཤུས་ལེན་མཁན་+Chapter: ལེའུ་+Contents: དཀར་ཆག།+Figure: པར་རིས་+Glossary: མིང་ཚིག་རེའུ་མིག།+Index: གསུལ་བྱང་།+Page: ཤོག་+Part: ཆ་ཤས་+Preface: དཔེ་དེབ་ཀྱི་གླེང་བརྗོད།+Proof: བདེན་དཔང་།+Table: རེའུ་མིག་
@@ -0,0 +1,21 @@+Abstract: Dvierrañ+Appendix: Stagadenn+Bibliography: Lennadurezh+Cc: Eilskrid da+Chapter: Pennad+Contents: Taolenn+Encl: Dielloù kevret+Figure: Figurenn+Glossary: Glossary+Index: Meneger+ListOfFigures: Listenn ar Figurennoù+ListOfTables: Listenn an taolennoù+Page: Pajenn+Part: Lodenn+Preface: Rakskrid+Proof: Proof+References: Daveennoù+See: Gwelout+SeeAlso: Gwelout ivez+Table: Taolenn+To: evit
@@ -0,0 +1,21 @@+Abstract: Sažetak+Appendix: Dodatak+Bibliography: Bibliografija+Cc: Kopija+Chapter: Poglavlje+Contents: Sadržaj+Encl: Prilozi+Figure: Slika+Glossary: Rječnik+Index: Indeks+ListOfFigures: Popis slika+ListOfTables: Popis tabela+Page: Stranica+Part: Dio+Preface: Predgovor+Proof: Dokaz+References: Literatura+See: Vidjeti+SeeAlso: Također vidjeti+Table: Tabela+To: Prima
@@ -0,0 +1,17 @@+Abstract: Тобшолол+Appendix: Хабсаралта+Bibliography: Ном зүй+Chapter: Бүлэг+Contents: Гаршаг+Encl: Оруулаха+Figure: Зураг+Index: Бүгэд хэлхээс+ListOfFigures: Зурагай жагсаалт+ListOfTables: Хүснэгэтэй жагсаалт+Page: Хуудаһан+Part: Бүлэг+Preface: Оршол+References: Ашаглаһан ном+See: Үз+SeeAlso: Mүн үз+Table: Хүсэнэгт
@@ -0,0 +1,21 @@+Abstract: Resum+Appendix: Apèndix+Bibliography: Bibliografia+Cc: Còpies a+Chapter: Capítol+Contents: Índex+Encl: Adjunt+Figure: Figura+Glossary: Glossari+Index: Índex alfabètic+ListOfFigures: Índex de figures+ListOfTables: Índex de taules+Page: Pàgina+Part: Part+Preface: Pròleg+Proof: Demostració+References: Referències+See: Vegeu+SeeAlso: Vegeu també+Table: Taula+To: A
@@ -0,0 +1,21 @@+Abstract: پوختە+Appendix: پاشکۆ+Bibliography: کتێبنامە+Cc: ڕوونووس+Chapter: بەندی+Contents: نێوەڕۆک+Encl: هاوپێچ+Figure: وێنەی+Glossary: فەرهەنگۆک+Index: پێنوێن+ListOfFigures: لیستی وێنەکان+ListOfTables: لیستی خشتەکان+Page: لاپەڕە+Part: بەشی+Preface: پێشەكی+Proof: سەلماندن+References: سەرچاوەکان+See: چاو لێکەن+SeeAlso: هەروەها چاو لێکەن+Table: خشتەی+To: بۆ
@@ -0,0 +1,21 @@+Abstract: Puxte+Appendix: Paşko+Bibliography: Kitêbname+Cc: Rûnûs+Chapter: Bendî+Contents: Nêwerrok+Encl: Hawpêç+Figure: Wêney+Glossary: Ferhengok+Index: Pêrrist+ListOfFigures: Lîstî Wênekan+ListOfTables: Lîstî Xiştekan+Page: Laperre+Part: Beşî+Preface: Pêşekî+Proof: Selmandin+References: Serçawekan+See: Çaw lêken+SeeAlso: Herweha çaw lêken+Table: Xiştey+To: Bo
@@ -0,0 +1,21 @@+Abstract: Abstrakt+Appendix: Příloha+Bibliography: Literatura+Cc: Na vědomí+Chapter: Kapitola+Contents: Obsah+Encl: Příloha+Figure: Obrázek+Glossary: Slovník+Index: Rejstřík+ListOfFigures: Seznam obrázků+ListOfTables: Seznam tabulek+Page: Strana+Part: Část+Preface: Předmluva+Proof: Důkaz+References: Reference+See: viz+SeeAlso: viz také+Table: Tabulka+To: Komu
@@ -0,0 +1,21 @@+Abstract: Аннотация+Appendix: Приложение+Bibliography: Литература+Cc: исх.+Chapter: Глава+Contents: Содержание+Encl: вкл.+Figure: Рис.+Glossary: Словарь терминов+Index: Предметный указатель+ListOfFigures: Список иллюстраций+ListOfTables: Список таблиц+Page: с.+Part: Часть+Preface: Предисловие+Proof: Доказательство+References: Список литературы+See: см.+SeeAlso: см. также+Table: Таблица+To: вх.
@@ -0,0 +1,21 @@+Abstract: Crynodeb+Appendix: Atodiad+Bibliography: Llyfryddiaeth+Cc: copïau+Chapter: Pennod+Contents: Cynnwys+Encl: amgaeëdig+Figure: Darlun+Glossary: Rhestr termau+Index: Mynegai+ListOfFigures: Rhestr Ddarluniau+ListOfTables: Rhestr Dablau+Page: tudalen+Part: Rhan+Preface: Rhagair+Proof: Prawf+References: Cyfeiriadau+See: gweler+SeeAlso: gweler hefyd+Table: Taflen+To: At
@@ -0,0 +1,21 @@+Abstract: Abstrakt+Appendix: Dodatek+Bibliography: Literatura+Cc: Na vědomí+Chapter: Kapitola+Contents: Obsah+Encl: Příloha+Figure: Obrázek+Glossary: Slovník+Index: Index+ListOfFigures: Seznam obrázků+ListOfTables: Seznam tabulek+Page: Strana+Part: Část+Preface: Předmluva+Proof: Důkaz+References: Reference+See: viz+SeeAlso: viz+Table: Tabulka+To: Komu
@@ -0,0 +1,21 @@+Abstract: Resumé+Appendix: Bilag+Bibliography: Litteratur+Cc: Kopi til+Chapter: Kapitel+Contents: Indhold+Encl: Vedlagt+Figure: Figur+Glossary: Gloseliste+Index: Indeks+ListOfFigures: Figurer+ListOfTables: Tabeller+Page: Side+Part: Del+Preface: Forord+Proof: Bevis+References: Litteratur+See: Se+SeeAlso: Se også+Table: Tabel+To: Til
@@ -0,0 +1,22 @@+Abstract: Zusammenfassung+Appendix: Anhang+Bibliography: Literaturverzeichnis+Cc: Verteiler+Chapter: Kapitel+Contents: Inhaltsverzeichnis+Encl: Anlage(n)+Figure: Abbildung+Glossary: Glossar+Index: Index+Listing: Auflistung+ListOfFigures: Abbildungsverzeichnis+ListOfTables: Tabellenverzeichnis+Page: Seite+Part: Teil+Preface: Vorwort+Proof: Beweis+References: Literatur+See: siehe+SeeAlso: siehe auch+Table: Tabelle+To: An
@@ -0,0 +1,21 @@+Abstract: Abstrakt+Appendix: Dodawki+Bibliography: Literatura+Cc: CC+Chapter: Kapitl+Contents: Wopśimjeśe+Encl: Pśiłoga+Figure: Wobraz+Glossary: Glossary+Index: Indeks+ListOfFigures: Zapis wobrazow+ListOfTables: Zapis tabulkow+Page: Strona+Part: Źěl+Preface: Zawod+Proof: Proof+References: Referency+See: gl.+SeeAlso: gl.~teke+Table: Tabulka+To: Komu
@@ -0,0 +1,21 @@+Abstract: Περίληψη+Appendix: Παράρτημα+Bibliography: Βιβλιογραφία+Cc: Κοινοποίηση+Chapter: Κεφάλαιο+Contents: Περιεχόμενα+Encl: Συνημμένα+Figure: Σχήμα+Glossary: Γλωσσάρι+Index: Ευρετήριο+ListOfFigures: Κατάλογος Σχημάτων+ListOfTables: Κατάλογος Πινάκων+Page: Σελίδα+Part: Μέρος+Preface: Πρόλογος+Proof: Απόδειξη+References: Αναφορές+See: βλέπε+SeeAlso: βλέπε επίσης+Table: Πίνακας+To: Προς
@@ -0,0 +1,22 @@+Abstract: Abstract+Appendix: Appendix+Bibliography: Bibliography+Cc: cc+Chapter: Chapter+Contents: Contents+Encl: encl+Figure: Figure+Glossary: Glossary+Index: Index+Listing: Listing+ListOfFigures: List of Figures+ListOfTables: List of Tables+Page: page+Part: Part+Preface: Preface+Proof: Proof+References: References+See: see+SeeAlso: see also+Table: Table+To: To
@@ -0,0 +1,21 @@+Abstract: Resumo+Appendix: Apendico+Bibliography: Bibliografio+Cc: Kopie al+Chapter: Ĉapitro+Contents: Enhavo+Encl: Aldono(j)+Figure: Figuro+Glossary: Glosaro+Index: Indekso+ListOfFigures: Listo de figuroj+ListOfTables: Listo de tabeloj+Page: Paĝo+Part: Parto+Preface: Antaŭparolo+Proof: Pruvo+References: Citaĵoj+See: vidu+SeeAlso: vidu ankaŭ+Table: Tabelo+To: Al
@@ -0,0 +1,21 @@+Abstract: Resumen+Appendix: Apéndice+Bibliography: Bibliografía+Cc: Copia a+Chapter: Capítulo+Contents: Índice general+Encl: Adjunto(s)+Figure: Figura+Glossary: Glosario+Index: Índice alfabético+ListOfFigures: Índice de figuras+ListOfTables: Índice de cuadros+Page: Página+Part: Parte+Preface: Prefacio+Proof: Prueba+References: Referencias+See: véase+SeeAlso: véase también+Table: Cuadro+To: A
@@ -0,0 +1,21 @@+Abstract: Resumen+Appendix: Apéndice+Bibliography: Bibliografía+Cc: Copia a+Chapter: Capítulo+Contents: Índice+Encl: Anexo+Figure: Figura+Glossary: Glosario+Index: Índice Alfabético+ListOfFigures: Índice de Figuras+ListOfTables: Índice de Cuadros+Page: Página+Part: Parte+Preface: Prefacio+Proof: Demostración+References: Referencias+See: véase+SeeAlso: véase también+Table: Cuadro+To: A
@@ -0,0 +1,21 @@+Abstract: Resumen+Appendix: Apéndice+Bibliography: Bibliografía+Cc: Copia a+Chapter: Capítulo+Contents: Índice+Encl: Adjunto+Figure: Figura+Glossary: Glosario+Index: Índice alfabético+ListOfFigures: Índice de figuras+ListOfTables: Índice de cuadros+Page: página+Part: Parte+Preface: Prefacio+Proof: Demostración+References: Referencias+See: véase+SeeAlso: véase también+Table: Cuadro+To: A
@@ -0,0 +1,22 @@+Abstract: Kokkuvõte+Appendix: Lisa+Bibliography: Kirjandus+Cc: Koopia(d)+Chapter: Peatükk+Contents: Sisukord+Encl: Lisa(d)+Figure: Joonis+Glossary: Sõnastik+Index: Indeks+Listing: Kood+ListOfFigures: Joonised+ListOfTables: Tabelid+Page: Lk.+Part: Osa+Preface: Sissejuhatus+Proof: Korrektuur+References: Viited+See: vt.+SeeAlso: vt. ka+Table: Tabel+To: Saaja
@@ -0,0 +1,21 @@+Abstract: Laburpena+Appendix: Eranskina+Bibliography: Bibliografia+Cc: Kopia+Chapter: Kapitulua+Contents: Gaien Aurkibidea+Encl: Erantsia+Figure: Irudia+Glossary: Glosarioa+Index: Kontzeptuen Aurkibidea+ListOfFigures: Irudien Zerrenda+ListOfTables: Taulen Zerrenda+Page: Orria+Part: Atala+Preface: Hitzaurrea+Proof: Frogapena+References: Erreferentziak+See: Ikusi+SeeAlso: Ikusi, halaber+Table: Taula+To: Nori
@@ -0,0 +1,21 @@+Abstract: چکیده+Appendix: پیوست+Bibliography: کتابنامه+Cc: رونوشت+Chapter: فصل+Contents: فهرست+Encl: پیوست+Figure: شكل+Glossary: فرهنگنامه+Index: نمایه+ListOfFigures: فهرست شکلها+ListOfTables: فهرست جدولها+Page: صفحه+Part: بخش+Preface: پیشگفتار+Proof: اثبات+References: مرجعها+See: ببینید+SeeAlso: نیز ببینید+Table: جدول+To: به
@@ -0,0 +1,21 @@+Abstract: Tiivistelmä+Appendix: Liite+Bibliography: Kirjallisuutta+Cc: Jakelu+Chapter: Luku+Contents: Sisällys+Encl: Liitteet+Figure: Kuva+Glossary: Sanasto+Index: Hakemisto+ListOfFigures: Kuvat+ListOfTables: Taulukot+Page: Sivu+Part: Osa+Preface: Esipuhe+Proof: Todistus+References: Viitteet+See: katso+SeeAlso: katso myös+Table: Taulukko+To: Vastaanottaja
@@ -0,0 +1,18 @@+Abstract: Abstrak+Appendix: Hugpong+Bibliography: Talaaklatan+Chapter: Kabanata+Contents: Talalamanan+Figure: Laraw+Glossary: Glosaryo+Index: Talatuntunan+ListOfFigures: Talalarawan+ListOfTables: Talatalayan+Page: Pahina+Part: Bahagi+Preface: Paunang Salita+Proof: Patunay+References: Talasanggunian+See: tignan ang+SeeAlso: tignan din+Table: Talay
@@ -0,0 +1,20 @@+Abstract: Résumé+Appendix: Annexe+Bibliography: Bibliographie+Cc: Cc+Chapter: Chapitre+Contents: Table des matières+Figure: Figure+Glossary: Glossaire+Index: Index+ListOfFigures: Table des figures+ListOfTables: Liste des tableaux+Page: Page+Part: Partie+Preface: Préface+Proof: Démonstration+References: Références+See: Voir+SeeAlso: Voir aussi+Table: Tableau+To: À
@@ -0,0 +1,21 @@+Abstract: Somari+Appendix: Zonte+Bibliography: Bibliografie+Cc: Cun copie a+Chapter: Cjapitul+Contents: Tabele gjenerâl+Encl: Zonte(is)+Figure: Figure+Glossary: Glossari+Index: Tabele analitiche+ListOfFigures: Liste des figuris+ListOfTables: Liste des tabelis+Page: Pagjine+Part: Part+Preface: Prefazion+Proof: Dimostrazion+References: Riferiments+See: cjale+SeeAlso: cjale ancje+Table: Tabele+To: Par
@@ -0,0 +1,21 @@+Abstract: Achoimre+Appendix: Aguisín+Bibliography: Leabharliosta+Cc: cc+Chapter: Caibidil+Contents: Clár Ábhair+Encl: faoi iamh+Figure: Léaráid+Glossary: Glossary+Index: Innéacs+ListOfFigures: Léaráidí+ListOfTables: Táblaí+Page: Leathanach+Part: Cuid+Preface: Réamhrá+Proof: Cruthúnas+References: Tagairtí+See: féach+SeeAlso: féach freisin+Table: Tábla+To: Go
@@ -0,0 +1,21 @@+Abstract: Brìgh+Appendix: Ath-sgr`ıobhadh+Bibliography: Leabhraichean+Cc: lethbhreac gu+Chapter: Caibideil+Contents: Clàr-obrach+Encl: a-staigh+Figure: Dealbh+Glossary: Glossary+Index: Clàr-innse+ListOfFigures: Liosta Dhealbh+ListOfTables: Liosta Chlàr+Page: t.d.+Part: Cuid+Preface: Preface+Proof: Proof+References: Iomraidh+See: see+SeeAlso: see also+Table: Clàr+To: gu
@@ -0,0 +1,21 @@+Abstract: Resumo+Appendix: Apéndice+Bibliography: Bibliografía+Cc: Copia a+Chapter: Capítulo+Contents: Índice+Encl: Adxunto+Figure: Figura+Glossary: Glosario+Index: Índice alfabético+ListOfFigures: Índice de figuras+ListOfTables: Índice de cadros+Page: Páxina+Part: Parte+Preface: Prefacio+Proof: Demostración+References: Referencias+See: véxase+SeeAlso: véxase tamén+Table: Cadro+To: A
@@ -0,0 +1,21 @@+Abstract: Περίληψις+Appendix: Παράρτημα+Bibliography: Βιβλιογραφία+Cc: Κοινοποίησις+Chapter: Κεφάλαιον+Contents: Περιεχόμενα+Encl: Συνημμένως+Figure: Σχῆμα+Glossary: Γλωσσάριον+Index: Εὑρετήριον+ListOfFigures: Κατάλογος σχημάτων+ListOfTables: Κατάλογος πινάκων+Page: Σελὶς+Part: Μέρος+Preface: Προοίμιον+Proof: Ἀπόδειξις+References: Ἀναφοραὶ+See: ὃρα+SeeAlso: ὃρα ὡσαύτως+Table: Πίναξ+To: Πρὸς
@@ -0,0 +1,9 @@+Appendix: અનુસૂચિ+Chapter: પ્રકરણ+Index: અનુક્રમણિકા+Page: પાનુ+Part: ભાગ+Proof: પુરાવો+See: જુવો+SeeAlso: ઉપરાંત+Table: ટેબલ
@@ -0,0 +1,21 @@+Abstract: Taƙaitawa+Appendix: Ƙarin bayani+Bibliography: Fahirinsa+Cc: cc+Chapter: Babi+Contents: Abin da ke ciki+Encl: saƙe+Figure: Addadi+Glossary: Ƙamus+Index: Fihirinsa+ListOfFigures: Tsarin Addadi+ListOfTables: Tsarin tabili+Page: Shafi+Part: Kashi+Preface: Gabatarwa+Proof: Shaida+References: Nassoshi+See: duba+SeeAlso: kuma+Table: tabili+To: je
@@ -0,0 +1,21 @@+Abstract: תקציר+Appendix: נספח+Bibliography: ביבליוגרפיה+Cc: העתקים+Chapter: פרק+Contents: תוכן העניינים+Encl: רצ"ב+Figure: איור+Glossary: מילון מונחים+Index: מפתח+ListOfFigures: רשימת האיורים+ListOfTables: רשימת הטבלאות+Page: עמוד+Part: חלק+Preface: מבוא+Proof: הוכחה+References: מקורות+See: ראה+SeeAlso: ראה גם+Table: טבלה+To: אל
@@ -0,0 +1,18 @@+Abstract: सारांश+Appendix: परिशिष्ट+Bibliography: संदर्भ-ग्रन्थ+Chapter: अध्याय+Contents: अनुक्रम+Figure: चित्र+Glossary: शब्दार्थ सूची+Index: सूची+ListOfFigures: चित्रों की सूची+ListOfTables: तालिकाओं की सूची+Page: पृष्ठ+Part: खण्ड+Preface: प्रस्तावना+Proof: प्रमाण+References: हवाले+See: देखिए+SeeAlso: और देखिए+Table: तालिका
@@ -0,0 +1,21 @@+Abstract: Sažetak+Appendix: Dodatak+Bibliography: Bibliografija+Cc: Kopija+Chapter: Poglavlje+Contents: Sadržaj+Encl: Prilozi+Figure: Slika+Glossary: Pojmovnik+Index: Kazalo+ListOfFigures: Popis slika+ListOfTables: Popis tablica+Page: Stranica+Part: Dio+Preface: Predgovor+Proof: Dokaz+References: Literatura+See: Vidjeti+SeeAlso: Također vidjeti+Table: Tablica+To: Prima
@@ -0,0 +1,21 @@+Abstract: Abstrakt+Appendix: Dodawki+Bibliography: Literatura+Cc: CC+Chapter: Kapitl+Contents: Wobsah+Encl: Přłoha+Figure: Wobraz+Glossary: Glossary+Index: Indeks+ListOfFigures: Zapis wobrazow+ListOfTables: Zapis tabulkow+Page: Strona+Part: Dźěl+Preface: Zawod+Proof: Proof+References: Referency+See: hl.+SeeAlso: hl.~tež+Table: Tabulka+To: Komu
@@ -0,0 +1,21 @@+Abstract: Kivonat+Appendix: függelék+Bibliography: Irodalomjegyzék+Cc: Körlevél–címzettek+Chapter: fejezet+Contents: Tartalomjegyzék+Encl: Melléklet+Figure: ábra+Glossary: Szójegyzék+Index: Tárgymutató+ListOfFigures: Ábrák jegyzéke+ListOfTables: Táblázatok jegyzéke+Page: oldal+Part: rész+Preface: Előszó+Proof: Bizonyítás+References: Hivatkozások+See: lásd+SeeAlso: lásd még+Table: táblázat+To: Címzett
@@ -0,0 +1,20 @@+Abstract: Սեղմագիր+Appendix: Հավելված+Bibliography: Գրականություն+Cc: Կրկնօրինակը՝+Chapter: Գլուխ+Contents: Բովանդակություն+Encl: Կից՝+Figure: Նկար+Glossary: Տերմինների ցանկ+Index: Առարկայական ցանկ+ListOfFigures: Նկարների ցանկ+ListOfTables: Աղյուսակների ցանկ+Page: էջ+Part: Մաս+Preface: Նախաբան+Proof: Ապացույց+References: Հղումներ+See: տե՛ս+SeeAlso: տե՛ս նաև+Table: Աղյուսակ
@@ -0,0 +1,21 @@+Abstract: Summario+Appendix: Appendice+Bibliography: Bibliographia+Cc: Copia+Chapter: Capitulo+Contents: Contento+Encl: Incluso+Figure: Figura+Glossary: Glossario+Index: Indice+ListOfFigures: Lista de figuras+ListOfTables: Lista de tabellas+Page: Pagina+Part: Parte+Preface: Prefacio+Proof: Prova+References: Referentias+See: vide+SeeAlso: vide etiam+Table: Tabella+To: A
@@ -0,0 +1,21 @@+Abstract: Ringkasan+Appendix: Lampiran+Bibliography: Bibliografi+Cc: cc+Chapter: Bab+Contents: Daftar Isi+Encl: Lampiran+Figure: Gambar+Glossary: Daftar Istilah+Index: Indeks+ListOfFigures: Daftar Gambar+ListOfTables: Daftar Tabel+Page: Halaman+Part: Bagian+Preface: Pendahuluan+Proof: Bukti+References: Pustaka+See: lihat+SeeAlso: lihat juga+Table: Tabel+To: Kepada
@@ -0,0 +1,21 @@+Abstract: Útdráttur+Appendix: Viðauki+Bibliography: Heimildir+Cc: Samrit+Chapter: Kafli+Contents: Efnisyfirlit+Encl: Hjálagt+Figure: Mynd+Glossary: Orðalisti+Index: Atriðisorðaskrá+ListOfFigures: Myndaskrá+ListOfTables: Töfluskrá+Page: Blaðsíða+Part: Hluti+Preface: Formáli+Proof: Sönnun+References: Heimildir+See: Sjá+SeeAlso: Sjá einnig+Table: Tafla+To: Til
@@ -0,0 +1,21 @@+Abstract: Sommario+Appendix: Appendice+Bibliography: Bibliografia+Cc: e~p.~c.+Chapter: Capitolo+Contents: Indice+Encl: Allegati+Figure: Figura+Glossary: Glossario+Index: Indice analitico+ListOfFigures: Elenco delle figure+ListOfTables: Elenco delle tabelle+Page: Pag.+Part: Parte+Preface: Prefazione+Proof: Dimostrazione+References: Riferimenti bibliografici+See: vedi+SeeAlso: vedi anche+Table: Tabella+To: Per
@@ -0,0 +1,21 @@+Abstract: 概要+Appendix: 付録+Bibliography: 文献目録+Cc: 同報+Chapter: 章+Contents: 目次+Encl: 添付+Figure: 図+Glossary: 用語集+Index: 索引+ListOfFigures: 図目次+ListOfTables: 表目次+Page: 頁+Part: 部+Preface: 端書き+Proof: 証明+References: 参考文献+See: 参照+SeeAlso: 参照+Table: 表+To: 宛先
@@ -0,0 +1,21 @@+Abstract: ანოტაცია+Appendix: დანართი+Bibliography: ლიტერატურა+Cc: წყარ.+Chapter: თავი+Contents: შინაარსი+Encl: ჩათვ.+Figure: სურ.+Glossary: ტერმინები+Index: საძიებელი+ListOfFigures: სურათი+ListOfTables: ცხრილი+Page: გვ.+Part: ნაწილი+Preface: წინასიტყვაობა+Proof: დამტკიცება+References: ლიტერატურა+See: იხ.+SeeAlso: იხ. ასევე+Table: ცხრ.+To: შ.
@@ -0,0 +1,21 @@+Abstract: សង្ខេប+Appendix: សេចក្ដីបន្ថែម+Bibliography: គន្ថនិទ្ទេស+Cc: ចម្លងជួន+Chapter: ជំពូក+Contents: មាតិការ+Encl: ឯកសារភ្ជាប់+Figure: រូប+Glossary: សទានុក្រម+Index: សន្ទស្សន៍+ListOfFigures: បញ្ជីរូបភាព+ListOfTables: បញ្ជីតារាង+Page: ទំព័រ+Part: ផ្នែក+Preface: អារម្ភកថា+Proof: សម្រាយ+References: ឯកសារយោង+See: មើល+SeeAlso: មើលបន្ថែម+Table: តារាង+To: ផ្ញើរទៅ
@@ -0,0 +1,21 @@+Abstract: کورتەبیر+Appendix: پاشکۆ+Bibliography: چاڤکانییا پرتووکان+Cc: بەلاڤکەر+Chapter: سەرێ+Contents: ناڤێرۆک+Encl: دوماهک+Figure: دیمەنێ+Glossary: چاڤکانییا لێکۆلینێ+Index: پێرست+ListOfFigures: هەژمارا دیمەنا+ListOfTables: هەژمارا کەڤالێن+Page: رووپەلێ+Part: بەشا+Preface: پێشگۆتن+Proof: دەلیل+References: پرتووکێن بژارتی+See: بنێرا+SeeAlso: لە ڤێیا ژ بنێرا+Table: کەڤالا+To: ژ بۆ
@@ -0,0 +1,21 @@+Abstract: Kurtebîr+Appendix: Tebînîya+Bibliography: Çavkanîya Pirtukan+Cc: Belavker+Chapter: Serê+Contents: Navêrok+Encl: Dumahik+Figure: Dimenê+Glossary: Çavkanîya lêkolînê+Index: Endeks+ListOfFigures: Hejmara Dimena+ListOfTables: Hejmara Kevalen+Page: Rûpelê+Part: Bêşa+Preface: Peşgotin+Proof: Delîl+References: Pirtuken bijartî+See: binêra+SeeAlso: le vêya ji binêra+Table: Kevala+To: Ji bo
@@ -0,0 +1,20 @@+Abstract: ಸಾರಾಂಶ+Appendix: ಅನುಬಂಧ+Bibliography: ಗ್ರಂಥಸೂಚಿ+Cc: cc+Chapter: ಅಧ್ಯಾಯ+Contents: ವಿಷಯಗಳು+Encl: encl+Figure: ಚಿತ್ರ+Index: ಸೂಚಿ+ListOfFigures: ಚಿತ್ರಗಳ ಪಟ್ಟಿ+ListOfTables: ಕೋಷ್ಟಕಗಳ ಪಟ್ಟಿ+Page: ಪುಟ+Part: ಭಾಗ+Preface: ಮುನ್ನುಡಿ+Proof: ಕರಡುಪ್ರತಿ+References: ಉಲ್ಲೇಖಗಳು+See: ನೋಡು+SeeAlso: ಇದನ್ನೂ ಸಹ ನೋಡು+Table: ಕೋಷ್ಟಕ+To: ಗೆ
@@ -0,0 +1,17 @@+Abstract: 요약+Appendix: 부록+Bibliography: 참고문헌+Cc: 사본+Chapter: 장+Contents: 차례+Encl: 동봉+Figure: 그림+Index: 찾아보기+ListOfFigures: 그림 차례+ListOfTables: 표 차례+Page: 페이지+Preface: 서문+Proof: 증명+References: 참고문헌+Table: 표+To: 수신
@@ -0,0 +1,20 @@+Abstract: Summarium+Appendix: Additamentum+Bibliography: Conspectus librorum+Cc: Exemplar+Chapter: Caput+Contents: Index+Encl: Additur+Figure: Descriptio+Glossary: Glossarium+Index: Index rerum notabilium+ListOfFigures: Conspectus descriptionum+ListOfTables: Conspectus tabularum+Page: charta+Part: Pars+Preface: Praefatio+Proof: Demonstratio+References: Conspectus librorum+See: cfr.+SeeAlso: cfr.+Table: Tabula
@@ -0,0 +1,21 @@+Abstract: Resümee+Appendix: Annex+Bibliography: Bibliographie+Cc: Distributeur+Chapter: Kapitel+Contents: Contenue+Encl: Annex(en)+Figure: Bild+Glossary: Glossär+Index: Index+ListOfFigures: Lëscht vun de Biller+ListOfTables: Lëscht vun den Tabellen+Page: Säit+Part: Deel+Preface: Virwuert+Proof: Beweis+References: Literatur+See: kuck+SeeAlso: kuck och+Table: Tabell+To: Un
@@ -0,0 +1,21 @@+Abstract: ບົດຫຍໍ້ຄວາມ+Appendix: ພາກຄັດຕິດ+Bibliography: ເອກະສານອ້າງອີງ+Cc: ສໍາເນົາເຖິງ+Chapter: ບົດທີ+Contents: ສາລະບານ+Encl: ເອກະສານປະກອບ+Figure: ຮູບທີ+Glossary: ປະມວນສັບ+Index: ດັດຊະນີ+ListOfFigures: ສາລະບານຮູບ+ListOfTables: ສາລະບານຕາຕະລາງ+Page: ໜ້າ+Part: ພາກ+Preface: ຄໍານໍາ+Proof: ຂໍ້ພິສູດ+References: ໜັງສືອ້າງອີງ+See: ອ່ານ+SeeAlso: ອ່ານເພີ່ມ+Table: ຕາຕະລາງທີ+To: ຮຽນ
@@ -0,0 +1,21 @@+Abstract: Santrauka+Appendix: Priedas+Bibliography: Literatūra+Cc: Kopijos+Chapter: Skyrius+Contents: Turinys+Encl: Įdėta+Figure: pav.+Glossary: Terminų žodynas+Index: Rodyklė+ListOfFigures: Iliustracijų sąrašas+ListOfTables: Lentelių sąrašas+Page: puslapis+Part: Dalis+Preface: Pratarmė+Proof: Įrodymas+References: Literatūra+See: žiūrėk+SeeAlso: taip pat+Table: lentelė+To: Kam
@@ -0,0 +1,20 @@+Abstract: Anotācija+Appendix: Pielikums+Bibliography: Literatūra+Cc: Kopija(s)+Chapter: Nodaļa+Contents: Saturs+Encl: Pielikumā+Figure: Att.+Index: Priekšmetu rādītājs+ListOfFigures: Attēlu saraksts+ListOfTables: Tabulu saraksts+Page: lpp.+Part: Daļa+Preface: Priekšvārds+Proof: Pierādījums+References: Literatūras saraksts+See: sk.+SeeAlso: sk. arī+Table: Tabula+To: To
@@ -0,0 +1,21 @@+Abstract: Апстракт+Appendix: Прилог+Bibliography: Библиографиjа+Cc: копиjа+Chapter: Глава+Contents: Содржина+Encl: Прилози+Figure: Слика+Glossary: Речник+Index: Индекс на термини+ListOfFigures: Листа на слики+ListOfTables: Листа на табели+Page: стр.+Part: Дел+Preface: Предговор+Proof: доказ+References: Литература+See: види+SeeAlso: види исто така+Table: Табела+To: За
@@ -0,0 +1,12 @@+Abstract: സാരാംശം+Appendix: ശിഷ്ടം+Chapter: അദ്ധ്യായം+Contents: ഉള്ളടക്കം+Figure: ചിത്രം+Index: സൂചിക+ListOfFigures: ചിത്രസൂചിക+ListOfTables: പട്ടികകളുടെ സൂചിക+Part: ഭാഗം+See: കാണുക+SeeAlso: ഇതും കാണുക+Table: പട്ടിക
@@ -0,0 +1,19 @@+Abstract: Удиртгал+Appendix: Хавсралт+Bibliography: Номзүй+Cc: э.с.+Chapter: Бүлэг+Contents: Гарчиг+Encl: Ишлэл+Figure: Зураг+Index: Товъёг+ListOfFigures: Зургийн жагсаалт+ListOfTables: Хүснэгтийн жагсаалт+Page: тал+Part: Хэсэг+Preface: Өмнөх үг+Proof: Баталгаа+References: Ашигласан ном+See: талд үз+SeeAlso: мөн талд үз+Table: Хүснэгт
@@ -0,0 +1,21 @@+Abstract: सारांश+Appendix: परिशिष्ट+Bibliography: संदर्भसूची+Cc: प्रत+Chapter: प्रकरण+Contents: अनुक्रमणिका+Encl: समाविष्ट+Figure: आकृती+Glossary: संज्ञासूची+Index: सूची+ListOfFigures: आकृत्यांची सूची+ListOfTables: कोष्टकसूची+Page: पृष्ठ+Part: खंड+Preface: प्रस्तावना+Proof: सिद्धता+References: संदर्भ+See: पाहा+SeeAlso: हेदेखील पाहा+Table: कोष्टक+To: प्रति
@@ -0,0 +1,21 @@+Abstract: Abstrak+Appendix: Lampiran+Bibliography: Bibliografi+Cc: sk+Chapter: Bab+Contents: Kandungan+Encl: Lampiran+Figure: Gambar+Glossary: Istilah+Index: Indeks+ListOfFigures: Senarai Gambar+ListOfTables: Senarai Jadual+Page: Halaman+Part: Bahagian+Preface: Prakata+Proof: Bukti+References: Rujukan+See: sila rujuk+SeeAlso: rujuk juga+Table: Jadual+To: Kepada
@@ -0,0 +1,21 @@+Abstract: Sammendrag+Appendix: Tillegg+Bibliography: Bibliografi+Cc: Kopi sendt+Chapter: Kapittel+Contents: Innhold+Encl: Vedlegg+Figure: Figur+Glossary: Ordliste+Index: Register+ListOfFigures: Figurer+ListOfTables: Tabeller+Page: Side+Part: Del+Preface: Forord+Proof: Bevis+References: Referanser+See: Se+SeeAlso: Se også+Table: Tabell+To: Til
@@ -0,0 +1,21 @@+Abstract: ߓߊߕߐߡߐ߲+Appendix: ߘߋ߬ߙߋ+Bibliography: ߟߍߙߊߥߙߍߟߐ߲߲+Cc: ߓߊ ߘߏ߫ ߘߌ߫+Chapter: ߛߌ߰ߘߊ+Contents: ߞߣߐߘߐ+Encl: ߝߍ߬ߕߊ+Figure: ߢߊ+Glossary: ߞߘߐߝߐߟߊ߲+Index: ߛߙߍߘߍ+ListOfFigures: ߢߊ ߟߎ߬ ߛߙߍߘߍ+ListOfTables: ߦߌ߬ߘߊ߬ߥߟߊ ߟߎ߬ ߛߙߍߘߍ+Page: ߞߐߜߍ+Part: ߛߌ߰ߘߊ߬ߙߋ߲+Preface: ߢߍߛߓߍ+Proof: ߦߌ߬ߘߊ߬ߞߏ+References: ߞߐߡߊߛߙߋ+See: ߡߊߝߟߍ߫+SeeAlso: ߝߟߍߡߊߛߊ߬ߦߌ߬+Table: ߦߌ߬ߘߊ߬ߥߟߊ+To: ߞߊߕߙߍ߬
@@ -0,0 +1,21 @@+Abstract: Samenvatting+Appendix: Bijlage+Bibliography: Bibliografie+Cc: cc+Chapter: Hoofdstuk+Contents: Inhoudsopgave+Encl: Bijlage(n)+Figure: Figuur+Glossary: Verklarende Woordenlijst+Index: Index+ListOfFigures: Lijst van figuren+ListOfTables: Lijst van tabellen+Page: Pagina+Part: Deel+Preface: Voorwoord+Proof: Bewijs+References: Referenties+See: zie+SeeAlso: zie ook+Table: Tabel+To: Aan
@@ -0,0 +1,21 @@+Abstract: Samandrag+Appendix: Tillegg+Bibliography: Litteratur+Cc: Kopi til+Chapter: Kapittel+Contents: Innhald+Encl: Vedlegg+Figure: Figur+Glossary: Ordliste+Index: Register+ListOfFigures: Figurar+ListOfTables: Tabellar+Page: Side+Part: Del+Preface: Forord+Proof: Bevis+References: Referansar+See: Sjå+SeeAlso: Sjå òg+Table: Tabell+To: Til
@@ -0,0 +1,21 @@+Abstract: Sammendrag+Appendix: Tillegg+Bibliography: Bibliografi+Cc: Kopi sendt+Chapter: Kapittel+Contents: Innhold+Encl: Vedlegg+Figure: Figur+Glossary: Ordliste+Index: Register+ListOfFigures: Figurer+ListOfTables: Tabeller+Page: Side+Part: Del+Preface: Forord+Proof: Bevis+References: Referanser+See: Se+SeeAlso: Se også+Table: Tabell+To: Til
@@ -0,0 +1,21 @@+Abstract: Resumit+Appendix: Annèx+Bibliography: Bibliografia+Cc: còpia a+Chapter: Capítol+Contents: Ensenhador+Encl: Pèça junta+Figure: Figura+Glossary: Glossari+Index: Indèx+ListOfFigures: Taula de las figuras+ListOfTables: Taula dels tablèus+Page: Pagina+Part: Partida+Preface: Prefàcia+Proof: Demostracion+References: Referéncias+See: vejatz+SeeAlso: vejatz tanben+Table: Tablèu+To: A
@@ -0,0 +1,21 @@+Abstract: ସାରାଂଶ+Appendix: ପରିଶିଷ୍ଟ+Bibliography: ସୂଚନା+Cc: କପି କରନ୍ତୁ+Chapter: ଅଧ୍ୟାୟ+Contents: ସୁଚୀ ପତ୍ର+Encl: ସଂଲଗ୍ନ+Figure: ପ୍ରତିଛବି+Glossary: ଶବ୍ଦର ଶବ୍ଦକୋଷ+Index: ସୂଚକାଙ୍କ+ListOfFigures: ପ୍ରତିଛବି ତାଲିକା+ListOfTables: ଟେବୁଲ ତାଲିକା+Page: ପୃଷ୍ଠା+Part: ବିଭାଗ+Preface: ପ୍ରାରମ୍ଭ+Proof: ପ୍ରମାଣ+References: ସନ୍ଦର୍ଭ+See: ଦେଖନ୍ତୁ+SeeAlso: ଅଧିକ ଦେଖନ୍ତୁ+Table: ଟେବୁଲ୍+To: ପ୍ରତି
@@ -0,0 +1,20 @@+Abstract: ਨਿਚੋੜ+Appendix: ਲੜੀਵਾਰ+Bibliography: ਸੰਬੰਧਤ ਹਵਾਲੇ+Cc: ਕਾਪੀ+Chapter: ਪਾਠ+Contents: ਸਮਗਰੀ+Encl: ਨੱਥੀ+Figure: ਸ਼ਕਲ+Glossary: ਕੁੰਜੀ+Index: ਸੂਚੀ+ListOfFigures: ਸ਼ਕਲਾਂ ਦੀ ਲੜੀ+ListOfTables: ਲੜੀਆਂ ਦਾ ਲੇਖਾ+Page: ਵਰਕਾ+Part: ਹਿੱਸਾ+Preface: ਮੁੱਖਬੰਦ+Proof: ਪਰਮਾਣ+References: ਹਵਾਲਾ+See: ਵੇਖੋ+SeeAlso: ਹੋਰ+Table: ਲੇਖਾ
@@ -0,0 +1,21 @@+Abstract: Streszczenie+Appendix: Dodatek+Bibliography: Bibliografia+Cc: Kopie+Chapter: Rozdział+Contents: Spis treści+Encl: Załącznik+Figure: Rysunek+Glossary: Glossary+Index: Indeks+ListOfFigures: Spis rysunków+ListOfTables: Spis tabel+Page: Strona+Part: Część+Preface: Przedmowa+Proof: Dowód+References: Literatura+See: Zobacz+SeeAlso: Zobacz też+Table: Tabela+To: Do
@@ -0,0 +1,21 @@+Abstract: Somari+Appendix: Gionta+Bibliography: Bibliografìa+Cc: Con còpia a+Chapter: Capìtol+Contents: Tàula+Encl: Gionta/e+Figure: Figura+Glossary: Glossari+Index: Tàula analìtica+ListOfFigures: Lista dle figure+ListOfTables: Lista dle tabele+Page: Pàgina+Part: Part+Preface: Prefassion+Proof: Dimostrassion+References: Riferiment+See: vëd+SeeAlso: vëd anche+Table: Tabela+To: Për
@@ -0,0 +1,21 @@+Abstract: Resumo+Appendix: Apêndice+Bibliography: Referências Bibliográficas+Cc: Cópia para+Chapter: Capítulo+Contents: Sumário+Encl: Anexo+Figure: Figura+Glossary: Glossário+Index: Índice Remissivo+ListOfFigures: Lista de Figuras+ListOfTables: Lista de Tabelas+Page: Página+Part: Parte+Preface: Prefácio+Proof: Demonstração+References: Referências+See: veja+SeeAlso: veja também+Table: Tabela+To: Para
@@ -0,0 +1,21 @@+Abstract: Resumo+Appendix: Apêndice+Bibliography: Bibliografia+Cc: Com cópia a+Chapter: Capítulo+Contents: Conteúdo+Encl: Anexo+Figure: Figura+Glossary: Glossário+Index: Índice+ListOfFigures: Lista de Figuras+ListOfTables: Lista de Tabelas+Page: Página+Part: Parte+Preface: Prefácio+Proof: Demonstração+References: Referências+See: ver+SeeAlso: ver também+Table: Tabela+To: Para
@@ -0,0 +1,21 @@+Abstract: Resumo+Appendix: Apêndice+Bibliography: Bibliografia+Cc: Com cópia a+Chapter: Capítulo+Contents: Conteúdo+Encl: Anexo+Figure: Figura+Glossary: Glossário+Index: Índice+ListOfFigures: Lista de Figuras+ListOfTables: Lista de Tabelas+Page: Página+Part: Parte+Preface: Prefácio+Proof: Demonstração+References: Referências+See: ver+SeeAlso: ver também+Table: Tabela+To: Para
@@ -0,0 +1,21 @@+Abstract: Recapitulaziun+Appendix: Appendix+Bibliography: Index bibliografic+Cc: Copia a+Chapter: Chapitel+Contents: Tavla dal cuntegn+Encl: Agiunta(s)+Figure: Figura+Glossary: Glossari+Index: Register da materias+ListOfFigures: Tavla da las figuras+ListOfTables: Tavla da las tabellas+Page: pagina+Part: Part+Preface: Prefaziun+Proof: Demonstraziun+References: Bibliografia+See: vesair+SeeAlso: vesair era+Table: Tabella+To: A
@@ -0,0 +1,21 @@+Abstract: Rezumat+Appendix: Anexa+Bibliography: Bibliografie+Cc: Copie+Chapter: Capitolul+Contents: Cuprins+Encl: Anexă+Figure: Figura+Glossary: Glosar+Index: Glosar+ListOfFigures: Listă de figuri+ListOfTables: Listă de tabele+Page: Pagina+Part: Partea+Preface: Prefaţă+Proof: Demonstraţie+References: Bibliografie+See: Vezi+SeeAlso: Vezi de asemenea+Table: Tabela+To: Pentru
@@ -0,0 +1,21 @@+Abstract: Аннотация+Appendix: Приложение+Bibliography: Литература+Cc: исх.+Chapter: Глава+Contents: Содержание+Encl: вкл.+Figure: Рис.+Glossary: Словарь терминов+Index: Предметный указатель+ListOfFigures: Список иллюстраций+ListOfTables: Список таблиц+Page: с.+Part: Часть+Preface: Предисловие+Proof: Доказательство+References: Список литературы+See: см.+SeeAlso: см. также+Table: Таблица+To: вх.
@@ -0,0 +1,21 @@+Abstract: Čoahkkáigeassu+Appendix: Čuovus+Bibliography: Girjjálašvuohta+Cc: Kopia sáddejuvvon+Chapter: Kapihttal+Contents: Sisdoallu+Encl: Mielddus+Figure: Govus+Glossary: Sátnelistu+Index: Registtar+ListOfFigures: Govvosat+ListOfTables: Tabeallat+Page: Siidu+Part: Oassi+Preface: Ovdasátni+Proof: Duođaštus+References: Čujuhusat+See: geahča+SeeAlso: geahča maiddái+Table: Tabealla+To: Vuostáiváldi
@@ -0,0 +1,21 @@+Abstract: සංක්ෂෙපය+Appendix: උපග්රන්ථය+Bibliography: ග්රන්ථ නාමාවලිය+Cc: පිටපත්+Chapter: පරිච්ඡේදය+Contents: පටුන+Encl: ඇමුණුම+Figure: සටහන+Glossary: පදමාලාව+Index: සූචිය+ListOfFigures: සටහන් ලේඛනය+ListOfTables: වගු ලේඛනය+Page: පිට+Part: කොටස+Preface: පෙරවදන+Proof: සාධනය+References: යොමුව+See: බලනු+SeeAlso: තවද+Table: වගුව+To: වෙත
@@ -0,0 +1,21 @@+Abstract: Abstrakt+Appendix: Dodatok+Bibliography: Literatúra+Cc: cc.+Chapter: Kapitola+Contents: Obsah+Encl: Príloha+Figure: Obr.+Glossary: Slovník+Index: Register+ListOfFigures: Zoznam obrázkov+ListOfTables: Zoznam tabuliek+Page: Str.+Part: Časť+Preface: Predhovor+Proof: Dôkaz+References: Literatúra+See: viď+SeeAlso: viď tiež+Table: Tabuľka+To: Pre
@@ -0,0 +1,21 @@+Abstract: Povzetek+Appendix: Dodatek+Bibliography: Literatura+Cc: Kopije+Chapter: Poglavje+Contents: Kazalo+Encl: Priloge+Figure: Slika+Glossary: Slovar+Index: Stvarno kazalo+ListOfFigures: Slike+ListOfTables: Tabele+Page: Stran+Part: Del+Preface: Predgovor+Proof: Dokaz+References: Literatura+See: glej+SeeAlso: glej tudi+Table: Tabela+To: Prejme
@@ -0,0 +1,21 @@+Abstract: Përmbledhja+Appendix: Shtesa+Bibliography: Bibliografia+Cc: Kopja+Chapter: Kapitulli+Contents: Përmbajtja+Encl: Lidhja+Figure: Figura+Glossary: Përhasja e Fjalëve+Index: Indeksi+ListOfFigures: Figurat+ListOfTables: Tabelat+Page: Faqe+Part: Pjesa+Preface: Parathenia+Proof: Vërtetim+References: Referencat+See: shiko+SeeAlso: shiko dhe+Table: Tabela+To: Për
@@ -0,0 +1,21 @@+Abstract: Сажетак+Appendix: Додатак+Bibliography: Библиографиjа+Cc: Копиjе+Chapter: Глава+Contents: Садржаj+Encl: Прилози+Figure: Слика+Glossary: Речник+Index: Индекс+ListOfFigures: Списак слика+ListOfTables: Списак табела+Page: страна+Part: Део+Preface: Предговор+Proof: Доказ+References: Литература+See: види+SeeAlso: видитакође+Table: Табела+To: Прима
@@ -0,0 +1,21 @@+Abstract: Sažetak+Appendix: Dodatak+Bibliography: Bibliografija+Cc: Kopije+Chapter: Glava+Contents: Sadržaj+Encl: Prilozi+Figure: Slika+Glossary: Rečnik+Index: Indeks+ListOfFigures: Spisak slika+ListOfTables: Spisak tabela+Page: strana+Part: Deo+Preface: Predgovor+Proof: Dokaz+References: Literatura+See: vidi+SeeAlso: vidi takođe+Table: Tabela+To: Prima
@@ -0,0 +1,21 @@+Abstract: Сажетак+Appendix: Додатак+Bibliography: Библиографиjа+Cc: Копиjе+Chapter: Глава+Contents: Садржаj+Encl: Прилози+Figure: Слика+Glossary: Речник+Index: Индекс+ListOfFigures: Списак слика+ListOfTables: Списак табела+Page: страна+Part: Део+Preface: Предговор+Proof: Доказ+References: Литература+See: види+SeeAlso: видитакође+Table: Табела+To: Прима
@@ -0,0 +1,21 @@+Abstract: Sammanfattning+Appendix: Bilaga+Bibliography: Litteraturförteckning+Cc: Kopia för kännedom+Chapter: Kapitel+Contents: Innehåll+Encl: Bil.+Figure: Figur+Glossary: Ordlista+Index: Sakregister+ListOfFigures: Figurer+ListOfTables: Tabeller+Page: Sida+Part: Del+Preface: Förord+Proof: Bevis+References: Referenser+See: se+SeeAlso: se även+Table: Tabell+To: Till
@@ -0,0 +1,11 @@+Abstract: சாராம்சம்+Appendix: பிற்சேர்க்கை+Chapter: அத்தியாயம்+Contents: உள்ளே+Figure: படம்+Index: சுட்டி+ListOfFigures: படங்களின் பட்டியல்+ListOfTables: அட்டவணை பட்டியல்+Part: பகுதி+See: பார்க்க+Table: அட்டவணை
@@ -0,0 +1,21 @@+Abstract: సారాంశం+Appendix: అదనంగా+Bibliography: గ్రంథాల జాబితా+Cc: సిసి+Chapter: అధ్యాయము+Contents: విషయాలు+Encl: ఎంక్లోజర్*+Figure: ఆకృతి+Glossary: నిఘంటువు+Index: విషయ సూచిక+ListOfFigures: ఆకృతుల జాబితా+ListOfTables: పట్టికల జాబితా+Page: పేజి+Part: భాగం+Preface: ముందుమాట+Proof: రుజువు+References: ఆధారాలు+See: చూడండి+SeeAlso: కూడా చూడండి+Table: పట్టిక+To: కి
@@ -0,0 +1,20 @@+Abstract: บทคัดย่อ+Appendix: ภาคผนวก+Bibliography: บรรณานุกรม+Cc: สำเนาถึง+Chapter: บทที่+Contents: สารบัญ+Encl: สิ่งที่แนบมาด้วย+Figure: รูปที่+Index: ดรรชนี+ListOfFigures: สารบัญรูป+ListOfTables: สารบัญตาราง+Page: หน้า+Part: ภาค+Preface: บทนำ+Proof: พิสูจน์+References: หนังสืออ้างอิง+See: ดู+SeeAlso: ดูเพิ่มเติม+Table: ตารางที่+To: เรียน
@@ -0,0 +1,21 @@+Abstract: Gysgaça manysy+Appendix: Goşmaça+Bibliography: Çeşmeler+Cc: Iberilenler+Chapter: Bap+Contents: Mazmuny+Encl: Goşmaça+Figure: Surat+Glossary: Sözlük+Index: Indeks+ListOfFigures: Suratlaryň sanawy+ListOfTables: Tablisalaryň sanawy+Page: Sahypa+Part: Bölüm+Preface: Sözbaşy+Proof: Delil+References: Çeşmeler+See: ser.+SeeAlso: şuňa-da ser.+Table: Tablisa+To: Kime
@@ -0,0 +1,21 @@+Abstract: Özet+Appendix: Ek+Bibliography: Kaynakça+Cc: Diğer Alıcılar+Chapter: Bölüm+Contents: İçindekiler+Encl: İlişik+Figure: Şekil+Glossary: Lügatçe+Index: Dizin+ListOfFigures: Şekil Listesi+ListOfTables: Tablo Listesi+Page: Sayfa+Part: Kısım+Preface: Önsöz+Proof: Kanıt+References: Kaynaklar+See: bkz.+SeeAlso: ayrıca bkz.+Table: Tablo+To: Alıcı
@@ -0,0 +1,22 @@+Abstract: Резюме+Appendix: Додаток+Bibliography: Бібліографія+Cc: Розповсюджувач+Chapter: Розділ+Contents: Зміст+Encl: Додаток(и)+Figure: Ілюстрація+Glossary: Глосарій+Index: Індекс+Listing: Список+ListOfFigures: Список рисунків+ListOfTables: Список таблиць+Page: Сторінка+Part: Частина+Preface: Передмова+Proof: Докази+References: Література+See: див.+SeeAlso: див. також+Table: Таблиця+To: До
@@ -0,0 +1,21 @@+Abstract: ئابستراكت+Appendix: قوشۇمچە+Bibliography: پايدىلانما+Cc: باشقا تاپشۇرۇۋالغۇچى+Chapter: باب+Contents: مۇندەرىجە+Encl: قوشۇمچە ھۆججەت+Figure: رەسىم+Glossary: لۇغەت+Index: ئىندېكىس+ListOfFigures: رەسىملەر+ListOfTables: جەدۋەللەر+Page: بەت+Part: قىسىم+Preface: كىرىش سۆز+Proof: ئىسپات+References: پايدىلانما+See: قاراڭ+SeeAlso: ئايرىم قاراڭ+Table: جەدۋەل+To: تاپشۇرۇۋالغۇچى
@@ -0,0 +1,21 @@+Abstract: Анотація+Appendix: Додаток+Bibliography: Бібліоґрафія+Cc: копія+Chapter: Розділ+Contents: Зміст+Encl: вкладка+Figure: Рис.+Glossary: Словник термінів+Index: Покажчик+ListOfFigures: Перелік ілюстрацій+ListOfTables: Перелік таблиць+Page: с.+Part: Частина+Preface: Вступ+Proof: Доведення+References: Література+See: див.+SeeAlso: див. також+Table: Табл.+To: До
@@ -0,0 +1,21 @@+Abstract: ملخّص+Appendix: ضمیمہ+Bibliography: کتابیات+Cc: نقل+Chapter: باب+Contents: فہرست عنوانات+Encl: منسلک+Figure: شكل+Glossary: لغت+Index: اشاریہ+ListOfFigures: فہرست اشکال+ListOfTables: فہرست جداول+Page: صفحہ+Part: حصّہ+Preface: دیباچہ+Proof: ثبوت+References: حوالہ جات+See: ملاحظہ ہو+SeeAlso: ایضاً+Table: جدول+To: بملاحظہ
@@ -0,0 +1,21 @@+Abstract: Tóm tắt nội dung+Appendix: Phụ lục+Bibliography: Tài liệu tham khảo+Cc: Cùng gửi+Chapter: Chương+Contents: Mục lục+Encl: Kèm theo+Figure: Hình+Glossary: Từ điển chú giải+Index: Chỉ mục+ListOfFigures: Danh sách hình vẽ+ListOfTables: Danh sách bảng+Page: Trang+Part: Phần+Preface: Lời nói đầu+Proof: Chứng minh+References: Tài liệu+See: Xem+SeeAlso: Xem thêm+Table: Bảng+To: Gửi
@@ -0,0 +1,22 @@+Abstract: 摘要+Appendix: 附录+Bibliography: 文献目录+Cc: 副本+Chapter: 章+Contents: 目录+Encl: 附件+Figure: 图+Glossary: 术语+Index: 索引+Listing: 列表+ListOfFigures: 附图目录+ListOfTables: 表格索引+Page: 页+Part: 段+Preface: 序+Proof: 校对+References: 参考文献+See: 见+SeeAlso: 参见+Table: 表+To: 到
@@ -0,0 +1,22 @@+Abstract: 摘要+Appendix: 附錄+Bibliography: 文獻目錄+Cc: 副本+Chapter: 章+Contents: 目錄+Encl: 附件+Figure: 圖+Glossary: 術語+Index: 索引+Listing: 列表+ListOfFigures: 附圖目錄+ListOfTables: 表格索引+Page: 頁+Part: 段+Preface: 序+Proof: 校對+References: 參考文獻+See: 見+SeeAlso: 參見+Table: 表+To: 到
@@ -1,104 +0,0 @@-{-# LANGUAGE CPP #-}--- Create pandoc.1 man and pandoc_markdown.5 man pages from README-import Text.Pandoc-import qualified Text.Pandoc.UTF8 as UTF8-import Data.Char (toUpper)-import Control.Monad-import System.FilePath-import System.Environment (getArgs)-import Text.Pandoc.Shared (normalize)-import Data.Maybe ( catMaybes )-import Prelude hiding (catch)-import Control.Exception ( catch )-import System.IO.Error ( isDoesNotExistError )-#if MIN_VERSION_directory(1,2,0)-import Data.Time.Clock (UTCTime(..))-#else-import System.Time (ClockTime(..))-#endif-import System.Directory--main :: IO ()-main = do- ds1 <- modifiedDependencies ("man" </> "man1" </> "pandoc.1")- ["README", "man" </> "man1" </> "pandoc.1.template"]- ds2 <- modifiedDependencies ("man" </> "man5" </> "pandoc_markdown.5")- ["README", "man" </> "man5" </> "pandoc_markdown.5.template"]-- unless (null ds1 && null ds2) $ do- rmContents <- UTF8.readFile "README"- let (Pandoc meta blocks) = normalize $ readMarkdown def rmContents- let manBlocks = removeSect [Str "Wrappers"]- $ removeSect [Str "Pandoc's",Space,Str "markdown"] blocks- let syntaxBlocks = extractSect [Str "Pandoc's",Space,Str "markdown"] blocks- args <- getArgs- let verbose = "--verbose" `elem` args- unless (null ds1) $- makeManPage verbose ("man" </> "man1" </> "pandoc.1") meta manBlocks- unless (null ds2) $- makeManPage verbose ("man" </> "man5" </> "pandoc_markdown.5") meta syntaxBlocks--makeManPage :: Bool -> FilePath -> Meta -> [Block] -> IO ()-makeManPage verbose page meta blocks = do- let templ = page <.> "template"- manTemplate <- UTF8.readFile templ- writeManPage page manTemplate (Pandoc meta blocks)- when verbose $ putStrLn $ "Created " ++ page--writeManPage :: FilePath -> String -> Pandoc -> IO ()-writeManPage page templ doc = do- let version = pandocVersion- let opts = def{ writerStandalone = True- , writerTemplate = templ- , writerVariables = [("version",version)] }- let manPage = writeMan opts $- bottomUp (concatMap removeLinks) $- bottomUp capitalizeHeaders doc- UTF8.writeFile page manPage--removeLinks :: Inline -> [Inline]-removeLinks (Link l _) = l-removeLinks x = [x]--capitalizeHeaders :: Block -> Block-capitalizeHeaders (Header 1 attr xs) = Header 1 attr $ bottomUp capitalize xs-capitalizeHeaders x = x--capitalize :: Inline -> Inline-capitalize (Str xs) = Str $ map toUpper xs-capitalize x = x--removeSect :: [Inline] -> [Block] -> [Block]-removeSect ils (Header 1 _ x:xs) | x == ils =- dropWhile (not . isHeader1) xs-removeSect ils (x:xs) = x : removeSect ils xs-removeSect _ [] = []--extractSect :: [Inline] -> [Block] -> [Block]-extractSect ils (Header 1 _ z:xs) | z == ils =- bottomUp promoteHeader $ takeWhile (not . isHeader1) xs- where promoteHeader (Header n attr x) = Header (n-1) attr x- promoteHeader x = x-extractSect ils (x:xs) = extractSect ils xs-extractSect _ [] = []--isHeader1 :: Block -> Bool-isHeader1 (Header 1 _ _ ) = True-isHeader1 _ = False----- | Returns a list of 'dependencies' that have been modified after 'file'.-modifiedDependencies :: FilePath -> [FilePath] -> IO [FilePath]-modifiedDependencies file dependencies = do- fileModTime <- catch (getModificationTime file) $- \e -> if isDoesNotExistError e-#if MIN_VERSION_directory(1,2,0)- then return (UTCTime (toEnum 0) 0) -- the minimum ClockTime-#else- then return (TOD 0 0) -- the minimum ClockTime-#endif- else ioError e- depModTimes <- mapM getModificationTime dependencies- let modified = zipWith (\dep time -> if time > fileModTime then Just dep else Nothing) dependencies depModTimes- return $ catMaybes modified-
@@ -1,1766 +0,0 @@-.TH PANDOC 1 "August 30, 2014" "1.13.1"-.SH NAME-pandoc - general markup converter-.SH SYNOPSIS-.PP-pandoc [\f[I]options\f[]] [\f[I]input\-file\f[]]...-.SH DESCRIPTION-.PP-Pandoc is a Haskell library for converting from one markup format to-another, and a command\-line tool that uses this library.-It can read markdown and (subsets of) Textile, reStructuredText, HTML,-LaTeX, MediaWiki markup, Haddock markup, OPML, Emacs Org\-mode, DocBook,-txt2tags, EPUB and Word docx; and it can write plain text, markdown,-reStructuredText, XHTML, HTML 5, LaTeX (including beamer slide shows),-ConTeXt, RTF, OPML, DocBook, OpenDocument, ODT, Word docx, GNU 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.-.PP-Pandoc\[aq]s enhanced version of markdown includes syntax for footnotes,-tables, flexible ordered lists, definition lists, fenced code blocks,-superscript, subscript, strikeout, title blocks, automatic tables of-contents, embedded LaTeX math, citations, and markdown inside HTML block-elements.-(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-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.-.SS Using \f[C]pandoc\f[]-.PP-If no \f[I]input\-file\f[] is specified, input is read from-\f[I]stdin\f[].-Otherwise, the \f[I]input\-files\f[] are concatenated (with a blank line-between each) and used as input.-Output goes to \f[I]stdout\f[] by default (though output to-\f[I]stdout\f[] is disabled for the \f[C]odt\f[], \f[C]docx\f[],-\f[C]epub\f[], and \f[C]epub3\f[] output formats).-For output to a file, use the \f[C]\-o\f[] option:-.IP-.nf-\f[C]-pandoc\ \-o\ output.html\ input.txt-\f[]-.fi-.PP-Instead of a file, an absolute URI may be given.-In this case pandoc will fetch the content using HTTP:-.IP-.nf-\f[C]-pandoc\ \-f\ html\ \-t\ markdown\ http://www.fsf.org-\f[]-.fi-.PP-If multiple input files are given, \f[C]pandoc\f[] will concatenate them-all (with blank lines between them) before parsing.-This feature is disabled for binary input formats such as \f[C]EPUB\f[]-and \f[C]docx\f[].-.PP-The format of the input and output can be specified explicitly using-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-type:-.IP-.nf-\f[C]-pandoc\ \-f\ markdown\ \-t\ latex\ hello.txt-\f[]-.fi-.PP-To convert \f[C]hello.html\f[] from html to markdown:-.IP-.nf-\f[C]-pandoc\ \-f\ html\ \-t\ markdown\ hello.html-\f[]-.fi-.PP-Supported output formats are listed below under the \f[C]\-t/\-\-to\f[]-option.-Supported input formats are listed below under the \f[C]\-f/\-\-from\f[]-option.-Note that the \f[C]rst\f[], \f[C]textile\f[], \f[C]latex\f[], and-\f[C]html\f[] readers are not complete; there are some constructs that-they do not parse.-.PP-If the input or output format is not specified explicitly,-\f[C]pandoc\f[] will attempt to guess it from the extensions of the-input and output filenames.-Thus, for example,-.IP-.nf-\f[C]-pandoc\ \-o\ hello.tex\ hello.txt-\f[]-.fi-.PP-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.-.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-and output through \f[C]iconv\f[]:-.IP-.nf-\f[C]-iconv\ \-t\ utf\-8\ input.txt\ |\ pandoc\ |\ iconv\ \-f\ utf\-8-\f[]-.fi-.SS Creating a PDF-.PP-Earlier versions of pandoc came with a program, \f[C]markdown2pdf\f[],-that used pandoc and pdflatex to produce a PDF.-This is no longer needed, since \f[C]pandoc\f[] can now produce-\f[C]pdf\f[] output itself.-To produce a PDF, simply specify an output file with a \f[C]\&.pdf\f[]-extension.-Pandoc will create a latex file and use pdflatex (or another engine, see-\f[C]\-\-latex\-engine\f[]) to convert it to PDF:-.IP-.nf-\f[C]-pandoc\ test.txt\ \-o\ test.pdf-\f[]-.fi-.PP-Production of a PDF requires that a LaTeX engine be installed (see-\f[C]\-\-latex\-engine\f[], below), and assumes that the following LaTeX-packages are available: \f[C]amssymb\f[], \f[C]amsmath\f[],-\f[C]ifxetex\f[], \f[C]ifluatex\f[], \f[C]listings\f[] (if the-\f[C]\-\-listings\f[] option is used), \f[C]fancyvrb\f[],-\f[C]longtable\f[], \f[C]booktabs\f[], \f[C]url\f[], \f[C]graphicx\f[],-\f[C]hyperref\f[], \f[C]ulem\f[], \f[C]babel\f[] (if the \f[C]lang\f[]-variable is set), \f[C]fontspec\f[] (if \f[C]xelatex\f[] or-\f[C]lualatex\f[] is used as the LaTeX engine), \f[C]xltxtra\f[] and-\f[C]xunicode\f[] (if \f[C]xelatex\f[] is used).-.SS \f[C]hsmarkdown\f[]-.PP-A user who wants a drop\-in replacement for \f[C]Markdown.pl\f[] may-create a symbolic link to the \f[C]pandoc\f[] executable called-\f[C]hsmarkdown\f[].-When invoked under the name \f[C]hsmarkdown\f[], \f[C]pandoc\f[] will-behave as if invoked with-\f[C]\-f\ markdown_strict\ \-\-email\-obfuscation=references\f[], and-all command\-line options will be treated as regular arguments.-However, this approach does not work under Cygwin, due to problems with-its simulation of symbolic links.-.SH OPTIONS-.SS General options-.TP-.B \f[C]\-f\f[] \f[I]FORMAT\f[], \f[C]\-r\f[] \f[I]FORMAT\f[], \f[C]\-\-from=\f[]\f[I]FORMAT\f[], \f[C]\-\-read=\f[]\f[I]FORMAT\f[]-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),-\f[C]markdown_phpextra\f[] (PHP Markdown Extra extended markdown),-\f[C]markdown_github\f[] (github extended 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]epub\f[] (EPUB), \f[C]opml\f[] (OPML), \f[C]org\f[] (Emacs-Org\-mode), \f[C]mediawiki\f[] (MediaWiki markup), \f[C]haddock\f[]-(Haddock markup), or \f[C]latex\f[] (LaTeX).-If \f[C]+lhs\f[] is appended to \f[C]markdown\f[], \f[C]rst\f[],-\f[C]latex\f[], or \f[C]html\f[], the input will be treated as literate-Haskell source: see Literate Haskell support, below.-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-without pipe tables and with hard line breaks.-See Pandoc\[aq]s markdown, below, for a list of extensions and their-names.-.RS-.RE-.TP-.B \f[C]\-t\f[] \f[I]FORMAT\f[], \f[C]\-w\f[] \f[I]FORMAT\f[], \f[C]\-\-to=\f[]\f[I]FORMAT\f[], \f[C]\-\-write=\f[]\f[I]FORMAT\f[]-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_phpextra\f[] (PHP Markdown extra extended markdown),-\f[C]markdown_github\f[] (github extended markdown), \f[C]rst\f[]-(reStructuredText), \f[C]html\f[] (XHTML 1), \f[C]html5\f[] (HTML 5),-\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[]-(MediaWiki markup), \f[C]dokuwiki\f[] (DokuWiki markup),-\f[C]textile\f[] (Textile), \f[C]org\f[] (Emacs Org\-Mode),-\f[C]texinfo\f[] (GNU Texinfo), \f[C]opml\f[] (OPML), \f[C]docbook\f[]-(DocBook), \f[C]opendocument\f[] (OpenDocument), \f[C]odt\f[]-(OpenOffice text document), \f[C]docx\f[] (Word docx), \f[C]haddock\f[]-(Haddock markup), \f[C]rtf\f[] (rich text format), \f[C]epub\f[] (EPUB-v2 book), \f[C]epub3\f[] (EPUB v3), \f[C]fb2\f[] (FictionBook2 e\-book),-\f[C]asciidoc\f[] (AsciiDoc), \f[C]icml\f[] (InDesign ICML),-\f[C]slidy\f[] (Slidy HTML and javascript slide show), \f[C]slideous\f[]-(Slideous HTML and javascript slide show), \f[C]dzslides\f[] (DZSlides-HTML5 + javascript slide show), \f[C]revealjs\f[] (reveal.js HTML5 +-javascript slide show), \f[C]s5\f[] (S5 HTML and javascript slide show),-or the path of a custom lua writer (see Custom writers, below).-Note that \f[C]odt\f[], \f[C]epub\f[], and \f[C]epub3\f[] output will-not be directed to \f[I]stdout\f[]; an output filename must be specified-using the \f[C]\-o/\-\-output\f[] option.-If \f[C]+lhs\f[] is appended to \f[C]markdown\f[], \f[C]rst\f[],-\f[C]latex\f[], \f[C]beamer\f[], \f[C]html\f[], or \f[C]html5\f[], the-output will be rendered as literate Haskell source: see Literate Haskell-support, below.-Markdown syntax extensions can be individually enabled or disabled by-appending \f[C]+EXTENSION\f[] or \f[C]\-EXTENSION\f[] to the format-name, as described above under \f[C]\-f\f[].-.RS-.RE-.TP-.B \f[C]\-o\f[] \f[I]FILE\f[], \f[C]\-\-output=\f[]\f[I]FILE\f[]-Write output to \f[I]FILE\f[] instead of \f[I]stdout\f[].-If \f[I]FILE\f[] is \f[C]\-\f[], output will go to \f[I]stdout\f[].-(Exception: if the output format is \f[C]odt\f[], \f[C]docx\f[],-\f[C]epub\f[], or \f[C]epub3\f[], output to stdout is disabled.)-.RS-.RE-.TP-.B \f[C]\-\-data\-dir=\f[]\f[I]DIRECTORY\f[]-Specify the user data directory to search for pandoc data files.-If this option is not specified, the default user data directory will be-used.-This is-.RS-.IP-.nf-\f[C]-$HOME/.pandoc-\f[]-.fi-.PP-in unix,-.IP-.nf-\f[C]-C:\\Documents\ And\ Settings\\USERNAME\\Application\ Data\\pandoc-\f[]-.fi-.PP-in Windows XP, and-.IP-.nf-\f[C]-C:\\Users\\USERNAME\\AppData\\Roaming\\pandoc-\f[]-.fi-.PP-in Windows 7.-(You can find the default user data directory on your system by looking-at the output of \f[C]pandoc\ \-\-version\f[].) A-\f[C]reference.odt\f[], \f[C]reference.docx\f[], \f[C]default.csl\f[],-\f[C]epub.css\f[], \f[C]templates\f[], \f[C]slidy\f[],-\f[C]slideous\f[], or \f[C]s5\f[] directory placed in this directory-will override pandoc\[aq]s normal defaults.-.RE-.TP-.B \f[C]\-v\f[], \f[C]\-\-version\f[]-Print version.-.RS-.RE-.TP-.B \f[C]\-h\f[], \f[C]\-\-help\f[]-Show usage message.-.RS-.RE-.SS Reader options-.TP-.B \f[C]\-R\f[], \f[C]\-\-parse\-raw\f[]-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,-Slideous, DZSlides, reveal.js, and S5 output; raw LaTeX 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-\f[I]commands\f[], even if \f[C]\-R\f[] is not specified.)-.RS-.RE-.TP-.B \f[C]\-S\f[], \f[C]\-\-smart\f[]-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[], or \f[C]textile\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-\f[C]\-\-no\-tex\-ligatures\f[] is used.)-.RS-.RE-.TP-.B \f[C]\-\-old\-dashes\f[]-Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:-\f[C]\-\f[] before a numeral is an en\-dash, and \f[C]\-\-\f[] is an-em\-dash.-This option is selected automatically for \f[C]textile\f[] input.-.RS-.RE-.TP-.B \f[C]\-\-base\-header\-level=\f[]\f[I]NUMBER\f[]-Specify the base level for headers (defaults to 1).-.RS-.RE-.TP-.B \f[C]\-\-indented\-code\-classes=\f[]\f[I]CLASSES\f[]-Specify classes to use for indented code blocks\-\-for example,-\f[C]perl,numberLines\f[] or \f[C]haskell\f[].-Multiple classes may be separated by spaces or commas.-.RS-.RE-.TP-.B \f[C]\-\-default\-image\-extension=\f[]\f[I]EXTENSION\f[]-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.-.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-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.-The name of the output format will be passed to the filter as the first-argument.-Hence,-.RS-.IP-.nf-\f[C]-pandoc\ \-\-filter\ ./caps.py\ \-t\ latex-\f[]-.fi-.PP-is equivalent to-.IP-.nf-\f[C]-pandoc\ \-t\ json\ |\ ./caps.py\ latex\ |\ pandoc\ \-f\ json\ \-t\ latex-\f[]-.fi-.PP-The latter form may be useful for debugging filters.-.PP-Filters may be written in any language.-\f[C]Text.Pandoc.JSON\f[] exports \f[C]toJSONFilter\f[] to facilitate-writing filters in Haskell.-Those who would prefer to write filters in python can use the module-\f[C]pandocfilters\f[], installable from PyPI.-See http://github.com/jgm/pandocfilters for the module and several-examples.-Note that the \f[I]EXECUTABLE\f[] will be sought in the user\[aq]s-\f[C]PATH\f[], and not in the working directory, if no directory is-provided.-If you want to run a script in the working directory, preface the-filename with \f[C]\&./\f[].-.RE-.TP-.B \f[C]\-M\f[] \f[I]KEY[=VAL]\f[], \f[C]\-\-metadata=\f[]\f[I]KEY[:VAL]\f[]-Set the metadata field \f[I]KEY\f[] to the value \f[I]VAL\f[].-A value specified on the command line overrides a value specified in the-document.-Values will be parsed as YAML boolean or string values.-If no value is specified, the value will be treated as Boolean true.-Like \f[C]\-\-variable\f[], \f[C]\-\-metadata\f[] causes template-variables to be set.-But unlike \f[C]\-\-variable\f[], \f[C]\-\-metadata\f[] affects the-metadata of the underlying document (which is accessible from filters-and may be printed in some output formats).-.RS-.RE-.TP-.B \f[C]\-\-normalize\f[]-Normalize the document after reading: merge adjacent \f[C]Str\f[] or-\f[C]Emph\f[] elements, for example, and remove repeated-\f[C]Space\f[]s.-.RS-.RE-.TP-.B \f[C]\-p\f[], \f[C]\-\-preserve\-tabs\f[]-Preserve tabs instead of converting them to spaces (the default).-Note that this will only affect tabs in literal code spans and code-blocks; tabs in regular text will be treated as spaces.-.RS-.RE-.TP-.B \f[C]\-\-tab\-stop=\f[]\f[I]NUMBER\f[]-Specify the number of spaces per tab (default is 4).-.RS-.RE-.TP-.B \f[C]\-\-track\-changes=\f[]\f[I]accept|reject|all\f[]-Specifies what to do with insertions and deletions produced by the MS-Word "track\-changes" feature.-\f[I]accept\f[] (the default), inserts all insertions, and ignores all-deletions.-\f[I]reject\f[] inserts all deletions and ignores insertions.-\f[I]all\f[] puts in both insertions and deletions, wrapped in spans-with \f[C]insertion\f[] and \f[C]deletion\f[] classes, respectively.-The author and time of change is included.-\f[I]all\f[] is useful for scripting: only accepting changes from a-certain reviewer, say, or before a certain date.-This option only affects the docx reader.-.RS-.RE-.TP-.B \f[C]\-\-extract\-media=\f[]\f[I]DIR\f[]-Extract images and other media contained in a docx or epub container to-the path \f[I]DIR\f[], creating it if necessary, and adjust the images-references in the document so they point to the extracted files.-This option only affects the docx and epub readers.-.RS-.RE-.SS General writer options-.TP-.B \f[C]\-s\f[], \f[C]\-\-standalone\f[]-Produce output with an appropriate header and footer (e.g.-a standalone HTML, LaTeX, or RTF file, not a fragment).-This option is set automatically for \f[C]pdf\f[], \f[C]epub\f[],-\f[C]epub3\f[], \f[C]fb2\f[], \f[C]docx\f[], and \f[C]odt\f[] output.-.RS-.RE-.TP-.B \f[C]\-\-template=\f[]\f[I]FILE\f[]-Use \f[I]FILE\f[] as a custom template for the generated document.-Implies \f[C]\-\-standalone\f[].-See Templates below for a description of template syntax.-If no extension is specified, an extension corresponding to the writer-will be added, so that \f[C]\-\-template=special\f[] looks for-\f[C]special.html\f[] for HTML output.-If the template is not found, pandoc will search for it in the user data-directory (see \f[C]\-\-data\-dir\f[]).-If this option is not used, a default template appropriate for the-output format will be used (see-\f[C]\-D/\-\-print\-default\-template\f[]).-.RS-.RE-.TP-.B \f[C]\-V\f[] \f[I]KEY[=VAL]\f[], \f[C]\-\-variable=\f[]\f[I]KEY[:VAL]\f[]-Set the template variable \f[I]KEY\f[] to the value \f[I]VAL\f[] when-rendering the document in standalone mode.-This is generally only useful when the \f[C]\-\-template\f[] option is-used to specify a custom template, since pandoc automatically sets the-variables used in the default templates.-If no \f[I]VAL\f[] is specified, the key will be given the value-\f[C]true\f[].-.RS-.RE-.TP-.B \f[C]\-D\f[] \f[I]FORMAT\f[], \f[C]\-\-print\-default\-template=\f[]\f[I]FORMAT\f[]-Print the default template for an output \f[I]FORMAT\f[].-(See \f[C]\-t\f[] for a list of possible \f[I]FORMAT\f[]s.)-.RS-.RE-.TP-.B \f[C]\-\-print\-default\-data\-file=\f[]\f[I]FILE\f[]-Print a default data file.-.RS-.RE-.TP-.B \f[C]\-\-no\-wrap\f[]-Disable text wrapping in output.-By default, text is wrapped appropriately for the output format.-.RS-.RE-.TP-.B \f[C]\-\-columns\f[]=\f[I]NUMBER\f[]-Specify length of lines in characters (for text wrapping).-.RS-.RE-.TP-.B \f[C]\-\-toc\f[], \f[C]\-\-table\-of\-contents\f[]-Include an automatically generated table of contents (or, in the case of-\f[C]latex\f[], \f[C]context\f[], and \f[C]rst\f[], an instruction to-create one) in the output document.-This option has no effect on \f[C]man\f[], \f[C]docbook\f[],-\f[C]slidy\f[], \f[C]slideous\f[], \f[C]s5\f[], \f[C]docx\f[], or-\f[C]odt\f[] output.-.RS-.RE-.TP-.B \f[C]\-\-toc\-depth=\f[]\f[I]NUMBER\f[]-Specify the number of section levels to include in the table of-contents.-The default is 3 (which means that level 1, 2, and 3 headers will be-listed in the contents).-.RS-.RE-.TP-.B \f[C]\-\-no\-highlight\f[]-Disables syntax highlighting for code blocks and inlines, even when a-language attribute is given.-.RS-.RE-.TP-.B \f[C]\-\-highlight\-style\f[]=\f[I]STYLE\f[]-Specifies the coloring style to be used in highlighted source code.-Options are \f[C]pygments\f[] (the default), \f[C]kate\f[],-\f[C]monochrome\f[], \f[C]espresso\f[], \f[C]zenburn\f[],-\f[C]haddock\f[], and \f[C]tango\f[].-.RS-.RE-.TP-.B \f[C]\-H\f[] \f[I]FILE\f[], \f[C]\-\-include\-in\-header=\f[]\f[I]FILE\f[]-Include contents of \f[I]FILE\f[], verbatim, at the end of the header.-This can be used, for example, to include special CSS or javascript in-HTML documents.-This option can be used repeatedly to include multiple files in the-header.-They will be included in the order specified.-Implies \f[C]\-\-standalone\f[].-.RS-.RE-.TP-.B \f[C]\-B\f[] \f[I]FILE\f[], \f[C]\-\-include\-before\-body=\f[]\f[I]FILE\f[]-Include contents of \f[I]FILE\f[], verbatim, at the beginning of the-document body (e.g.-after the \f[C]<body>\f[] tag in HTML, or the \f[C]\\begin{document}\f[]-command in LaTeX).-This can be used to include navigation bars or banners in HTML-documents.-This option can be used repeatedly to include multiple files.-They will be included in the order specified.-Implies \f[C]\-\-standalone\f[].-.RS-.RE-.TP-.B \f[C]\-A\f[] \f[I]FILE\f[], \f[C]\-\-include\-after\-body=\f[]\f[I]FILE\f[]-Include contents of \f[I]FILE\f[], verbatim, at the end of the document-body (before the \f[C]</body>\f[] tag in HTML, or the-\f[C]\\end{document}\f[] command in LaTeX).-This option can be be used repeatedly to include multiple files.-They will be included in the order specified.-Implies \f[C]\-\-standalone\f[].-.RS-.RE-.SS Options affecting specific writers-.TP-.B \f[C]\-\-self\-contained\f[]-Produce a standalone HTML file with no external dependencies, using-\f[C]data:\f[] URIs to incorporate the contents of linked scripts,-stylesheets, images, and videos.-The resulting file should be "self\-contained," in the sense that it-needs no external files and no net access to be displayed properly by a-browser.-This option works only with HTML output formats, including-\f[C]html\f[], \f[C]html5\f[], \f[C]html+lhs\f[], \f[C]html5+lhs\f[],-\f[C]s5\f[], \f[C]slidy\f[], \f[C]slideous\f[], \f[C]dzslides\f[], and-\f[C]revealjs\f[].-Scripts, images, and stylesheets at absolute URLs will be downloaded;-those at relative URLs will be sought relative to the working directory-(if the first source file is local) or relative to the base URL (if the-first source file is remote).-\f[C]\-\-self\-contained\f[] does not work with \f[C]\-\-mathjax\f[].-.RS-.RE-.TP-.B \f[C]\-\-offline\f[]-Deprecated synonym for \f[C]\-\-self\-contained\f[].-.RS-.RE-.TP-.B \f[C]\-5\f[], \f[C]\-\-html5\f[]-Produce HTML5 instead of HTML4.-This option has no effect for writers other than \f[C]html\f[].-(\f[I]Deprecated:\f[] Use the \f[C]html5\f[] output format instead.)-.RS-.RE-.TP-.B \f[C]\-\-html\-q\-tags\f[]-Use \f[C]<q>\f[] tags for quotes in HTML.-.RS-.RE-.TP-.B \f[C]\-\-ascii\f[]-Use only ascii characters in output.-Currently supported only for HTML output (which uses numerical entities-instead of UTF\-8 when this option is selected).-.RS-.RE-.TP-.B \f[C]\-\-reference\-links\f[]-Use reference\-style links, rather than inline links, in writing-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.-The default is to use setext\-style headers for levels 1\-2, and then-ATX headers.-.RS-.RE-.TP-.B \f[C]\-\-chapters\f[]-Treat top\-level headers as chapters in LaTeX, ConTeXt, and DocBook-output.-When the LaTeX template uses the report, book, or memoir class, this-option is implied.-If \f[C]beamer\f[] is the output format, top\-level headers will become-\f[C]\\part{..}\f[].-.RS-.RE-.TP-.B \f[C]\-N\f[], \f[C]\-\-number\-sections\f[]-Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.-By default, sections are not numbered.-Sections with class \f[C]unnumbered\f[] will never be numbered, even if-\f[C]\-\-number\-sections\f[] is specified.-.RS-.RE-.TP-.B \f[C]\-\-number\-offset\f[]=\f[I]NUMBER[,NUMBER,...]\f[],-Offset for section headings in HTML output (ignored in other output-formats).-The first number is added to the section number for top\-level headers,-the second for second\-level headers, and so on.-So, for example, if you want the first top\-level header in your-document to be numbered "6", specify \f[C]\-\-number\-offset=5\f[].-If your document starts with a level\-2 header which you want to be-numbered "1.5", specify \f[C]\-\-number\-offset=1,4\f[].-Offsets are 0 by default.-Implies \f[C]\-\-number\-sections\f[].-.RS-.RE-.TP-.B \f[C]\-\-no\-tex\-ligatures\f[]-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 \f[C]\-\-smart\f[] is selected automatically for LaTeX-and ConTeXt output, but it must be specified explicitly if-\f[C]\-\-no\-tex\-ligatures\f[] is selected.-If you use literal curly quotes, dashes, and ellipses in your source,-then you may want to use \f[C]\-\-no\-tex\-ligatures\f[] without-\f[C]\-\-smart\f[].-.RS-.RE-.TP-.B \f[C]\-\-listings\f[]-Use listings package for LaTeX code blocks-.RS-.RE-.TP-.B \f[C]\-i\f[], \f[C]\-\-incremental\f[]-Make list items in slide shows display incrementally (one by one).-The default is for lists to be displayed all at once.-.RS-.RE-.TP-.B \f[C]\-\-slide\-level\f[]=\f[I]NUMBER\f[]-Specifies that headers with the specified level create slides (for-\f[C]beamer\f[], \f[C]s5\f[], \f[C]slidy\f[], \f[C]slideous\f[],-\f[C]dzslides\f[]).-Headers above this level in the hierarchy are used to divide the slide-show into sections; headers below this level create subheads within a-slide.-The default is to set the slide level based on the contents of the-document; see Structuring the slide show, below.-.RS-.RE-.TP-.B \f[C]\-\-section\-divs\f[]-Wrap sections in \f[C]<div>\f[] tags (or \f[C]<section>\f[] tags in-HTML5), and attach identifiers to the enclosing \f[C]<div>\f[] (or-\f[C]<section>\f[]) rather than the header itself.-See Section identifiers, below.-.RS-.RE-.TP-.B \f[C]\-\-email\-obfuscation=\f[]\f[I]none|javascript|references\f[]-Specify a method for obfuscating \f[C]mailto:\f[] links in HTML-documents.-\f[I]none\f[] leaves \f[C]mailto:\f[] links as they are.-\f[I]javascript\f[] obfuscates them using javascript.-\f[I]references\f[] obfuscates them by printing their letters as decimal-or hexadecimal character references.-.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.-This is useful for preventing duplicate identifiers when generating-fragments to be included in other pages.-.RS-.RE-.TP-.B \f[C]\-T\f[] \f[I]STRING\f[], \f[C]\-\-title\-prefix=\f[]\f[I]STRING\f[]-Specify \f[I]STRING\f[] as a prefix at the beginning of the title that-appears in the HTML header (but not in the title as it appears at the-beginning of the HTML body).-Implies \f[C]\-\-standalone\f[].-.RS-.RE-.TP-.B \f[C]\-c\f[] \f[I]URL\f[], \f[C]\-\-css=\f[]\f[I]URL\f[]-Link to a CSS style sheet.-This option can be be used repeatedly to include multiple files.-They will be included in the order specified.-.RS-.RE-.TP-.B \f[C]\-\-reference\-odt=\f[]\f[I]FILE\f[]-Use the specified file as a style reference in producing an ODT.-For best results, the reference ODT should be a modified version of an-ODT produced using pandoc.-The contents of the reference ODT are ignored, but its stylesheets are-used in the new ODT.-If no reference ODT is specified on the command line, pandoc will look-for a file \f[C]reference.odt\f[] in the user data directory (see-\f[C]\-\-data\-dir\f[]).-If this is not found either, sensible defaults will be used.-.RS-.RE-.TP-.B \f[C]\-\-reference\-docx=\f[]\f[I]FILE\f[]-Use the specified file as a style reference in producing a docx file.-For best results, the reference docx should be a modified version of a-docx file produced using pandoc.-The contents of the reference docx are ignored, but its stylesheets and-document properties (including margins, page size, header, and footer)-are used in the new docx.-If no reference docx is specified on the command line, pandoc will look-for a file \f[C]reference.docx\f[] in the user data directory (see-\f[C]\-\-data\-dir\f[]).-If this is not found either, sensible defaults will be used.-The following styles are used by pandoc: [paragraph] Normal, Compact,-Title, Subtitle, Authors, Date, Abstract, Heading 1, Heading 2, Heading-3, Heading 4, Heading 5, Block Quote, Definition Term, Definition,-Bibliography, Body Text, Table Caption, Image Caption; [character]-Default Paragraph Font, Body Text Char, Verbatim Char, Footnote Ref,-Link.-.RS-.RE-.TP-.B \f[C]\-\-epub\-stylesheet=\f[]\f[I]FILE\f[]-Use the specified CSS file to style the EPUB.-If no stylesheet is specified, pandoc will look for a file-\f[C]epub.css\f[] in the user data directory (see-\f[C]\-\-data\-dir\f[]).-If it is not found there, sensible defaults will be used.-.RS-.RE-.TP-.B \f[C]\-\-epub\-cover\-image=\f[]\f[I]FILE\f[]-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-\f[C]cover\-image\f[] in a YAML metadata block (see EPUB Metadata,-below).-.RS-.RE-.TP-.B \f[C]\-\-epub\-metadata=\f[]\f[I]FILE\f[]-Look in the specified XML file for metadata for the EPUB.-The file should contain a series of Dublin Core elements, as documented-at http://dublincore.org/documents/dces/.-For example:-.RS-.IP-.nf-\f[C]-\ <dc:rights>Creative\ Commons</dc:rights>-\ <dc:language>es\-AR</dc:language>-\f[]-.fi-.PP-By default, pandoc will include the following metadata elements:-\f[C]<dc:title>\f[] (from the document title), \f[C]<dc:creator>\f[]-(from the document authors), \f[C]<dc:date>\f[] (from the document date,-which should be in ISO 8601 format), \f[C]<dc:language>\f[] (from the-\f[C]lang\f[] variable, or, if is not set, the locale), and-\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-document can be used instead.-See below under EPUB Metadata.-.RE-.TP-.B \f[C]\-\-epub\-embed\-font=\f[]\f[I]FILE\f[]-Embed the specified font in the EPUB.-This option can be repeated to embed multiple fonts.-To use embedded fonts, you will need to add declarations like the-following to your CSS (see \f[C]\-\-epub\-stylesheet\f[]):-.RS-.IP-.nf-\f[C]-\@font\-face\ {-font\-family:\ DejaVuSans;-font\-style:\ normal;-font\-weight:\ normal;-src:url("DejaVuSans\-Regular.ttf");-}-\@font\-face\ {-font\-family:\ DejaVuSans;-font\-style:\ normal;-font\-weight:\ bold;-src:url("DejaVuSans\-Bold.ttf");-}-\@font\-face\ {-font\-family:\ DejaVuSans;-font\-style:\ italic;-font\-weight:\ normal;-src:url("DejaVuSans\-Oblique.ttf");-}-\@font\-face\ {-font\-family:\ DejaVuSans;-font\-style:\ italic;-font\-weight:\ bold;-src:url("DejaVuSans\-BoldOblique.ttf");-}-body\ {\ font\-family:\ "DejaVuSans";\ }-\f[]-.fi-.RE-.TP-.B \f[C]\-\-epub\-chapter\-level=\f[]\f[I]NUMBER\f[]-Specify the header level at which to split the EPUB into separate-"chapter" files.-The default is to split into chapters at level 1 headers.-This option only affects the internal composition of the EPUB, not the-way chapters and sections are displayed to users.-Some readers may be slow if the chapter files are too large, so for-large documents with few level 1 headers, one might want to use a-chapter level of 2 or 3.-.RS-.RE-.TP-.B \f[C]\-\-latex\-engine=\f[]\f[I]pdflatex|lualatex|xelatex\f[]-Use the specified LaTeX engine when producing PDF output.-The default is \f[C]pdflatex\f[].-If the engine is not in your PATH, the full path of the engine may be-specified here.-.RS-.RE-.SS Citation rendering-.TP-.B \f[C]\-\-bibliography=\f[]\f[I]FILE\f[]-Set the \f[C]bibliography\f[] field in the document\[aq]s metadata to-\f[I]FILE\f[], overriding any value set in the metadata, and process-citations using \f[C]pandoc\-citeproc\f[].-(This is equivalent to-\f[C]\-\-metadata\ bibliography=FILE\ \-\-filter\ pandoc\-citeproc\f[].)-.RS-.RE-.TP-.B \f[C]\-\-csl=\f[]\f[I]FILE\f[]-Set the \f[C]csl\f[] field in the document\[aq]s metadata to-\f[I]FILE\f[], overriding any value set in the metadata.-(This is equivalent to \f[C]\-\-metadata\ csl=FILE\f[].)-.RS-.RE-.TP-.B \f[C]\-\-citation\-abbreviations=\f[]\f[I]FILE\f[]-Set the \f[C]citation\-abbreviations\f[] field in the document\[aq]s-metadata to \f[I]FILE\f[], overriding any value set in the metadata.-(This is equivalent to-\f[C]\-\-metadata\ citation\-abbreviations=FILE\f[].)-.RS-.RE-.TP-.B \f[C]\-\-natbib\f[]-Use natbib for citations in LaTeX output.-This option is not for use with the \f[C]pandoc\-citeproc\f[] filter or-with PDF output.-It is intended for use in producing a LaTeX file that can be processed-with pdflatex and bibtex.-.RS-.RE-.TP-.B \f[C]\-\-biblatex\f[]-Use biblatex for citations in LaTeX output.-This option is not for use with the \f[C]pandoc\-citeproc\f[] filter or-with PDF output.-It is intended for use in producing a LaTeX file that can be processed-with pdflatex and bibtex or biber.-.RS-.RE-.SS Math rendering in HTML-.TP-.B \f[C]\-m\f[] [\f[I]URL\f[]], \f[C]\-\-latexmathml\f[][=\f[I]URL\f[]]-Use the LaTeXMathML script to display embedded TeX math in HTML output.-To insert a link to a local copy of the \f[C]LaTeXMathML.js\f[] script,-provide a \f[I]URL\f[].-If no \f[I]URL\f[] is provided, the contents of the script will be-inserted directly into the HTML header, preserving portability at the-price of efficiency.-If you plan to use math on several pages, it is much better to link to a-copy of the script, so it can be cached.-.RS-.RE-.TP-.B \f[C]\-\-mathml\f[][=\f[I]URL\f[]]-Convert TeX math to MathML (in \f[C]docbook\f[] as well as \f[C]html\f[]-and \f[C]html5\f[]).-In standalone \f[C]html\f[] output, a small javascript (or a link to-such a script if a \f[I]URL\f[] is supplied) will be inserted that-allows the MathML to be viewed on some browsers.-.RS-.RE-.TP-.B \f[C]\-\-jsmath\f[][=\f[I]URL\f[]]-Use jsMath to display embedded TeX math in HTML output.-The \f[I]URL\f[] should point to the jsMath load script (e.g.-\f[C]jsMath/easy/load.js\f[]); if provided, it will be linked to in the-header of standalone HTML documents.-If a \f[I]URL\f[] is not provided, no link to the jsMath load script-will be inserted; it is then up to the author to provide such a link in-the HTML template.-.RS-.RE-.TP-.B \f[C]\-\-mathjax\f[][=\f[I]URL\f[]]-Use MathJax to display embedded TeX math in HTML output.-The \f[I]URL\f[] should point to the \f[C]MathJax.js\f[] load script.-If a \f[I]URL\f[] is not provided, a link to the MathJax CDN will be-inserted.-.RS-.RE-.TP-.B \f[C]\-\-gladtex\f[]-Enclose TeX math in \f[C]<eq>\f[] tags in HTML output.-These can then be processed by gladTeX to produce links to images of the-typeset formulas.-.RS-.RE-.TP-.B \f[C]\-\-mimetex\f[][=\f[I]URL\f[]]-Render TeX math using the mimeTeX CGI script.-If \f[I]URL\f[] is not specified, it is assumed that the script is at-\f[C]/cgi\-bin/mimetex.cgi\f[].-.RS-.RE-.TP-.B \f[C]\-\-webtex\f[][=\f[I]URL\f[]]-Render TeX formulas using an external script that converts TeX formulas-to images.-The formula will be concatenated with the URL provided.-If \f[I]URL\f[] is not specified, the Google Chart API will be used.-.RS-.RE-.SS Options for wrapper scripts-.TP-.B \f[C]\-\-dump\-args\f[]-Print information about command\-line arguments to \f[I]stdout\f[], then-exit.-This option is intended primarily for use in wrapper scripts.-The first line of output contains the name of the output file specified-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-include any options appearing after a \f[C]\-\-\f[] separator at the end-of the line.-.RS-.RE-.TP-.B \f[C]\-\-ignore\-args\f[]-Ignore command\-line arguments (for use in wrapper scripts).-Regular Pandoc options are not ignored.-Thus, for example,-.RS-.IP-.nf-\f[C]-pandoc\ \-\-ignore\-args\ \-o\ foo.html\ \-s\ foo.txt\ \-\-\ \-e\ latin1-\f[]-.fi-.PP-is equivalent to-.IP-.nf-\f[C]-pandoc\ \-o\ foo.html\ \-s-\f[]-.fi-.RE-.SH TEMPLATES-.PP-When the \f[C]\-s/\-\-standalone\f[] option is used, pandoc uses a-template to add header and footer material that is needed for a-self\-standing document.-To see the default template that is used, just type-.IP-.nf-\f[C]-pandoc\ \-D\ FORMAT-\f[]-.fi-.PP-where \f[C]FORMAT\f[] is the name of the output format.-A custom template can be specified using the \f[C]\-\-template\f[]-option.-You can also override the system default templates for a given output-format \f[C]FORMAT\f[] by putting a file-\f[C]templates/default.FORMAT\f[] in the user data directory (see-\f[C]\-\-data\-dir\f[], above).-\f[I]Exceptions:\f[] For \f[C]odt\f[] output, customize the-\f[C]default.opendocument\f[] template.-For \f[C]pdf\f[] output, customize the \f[C]default.latex\f[] template.-.PP-Templates may contain \f[I]variables\f[].-Variable names are sequences of alphanumerics, \f[C]\-\f[], and-\f[C]_\f[], starting with a letter.-A variable name surrounded by \f[C]$\f[] signs will be replaced by its-value.-For example, the string \f[C]$title$\f[] in-.IP-.nf-\f[C]-<title>$title$</title>-\f[]-.fi-.PP-will be replaced by the document title.-.PP-To write a literal \f[C]$\f[] in a template, use \f[C]$$\f[].-.PP-Some variables are set automatically by pandoc.-These vary somewhat depending on the output format, but include metadata-fields (such as \f[C]title\f[], \f[C]author\f[], and \f[C]date\f[]) as-well as the following:-.TP-.B \f[C]header\-includes\f[]-contents specified by \f[C]\-H/\-\-include\-in\-header\f[] (may have-multiple values)-.RS-.RE-.TP-.B \f[C]toc\f[]-non\-null value if \f[C]\-\-toc/\-\-table\-of\-contents\f[] was-specified-.RS-.RE-.TP-.B \f[C]include\-before\f[]-contents specified by \f[C]\-B/\-\-include\-before\-body\f[] (may have-multiple values)-.RS-.RE-.TP-.B \f[C]include\-after\f[]-contents specified by \f[C]\-A/\-\-include\-after\-body\f[] (may have-multiple values)-.RS-.RE-.TP-.B \f[C]body\f[]-body of document-.RS-.RE-.TP-.B \f[C]lang\f[]-language code for HTML or LaTeX documents-.RS-.RE-.TP-.B \f[C]slidy\-url\f[]-base URL for Slidy documents (defaults to-\f[C]http://www.w3.org/Talks/Tools/Slidy2\f[])-.RS-.RE-.TP-.B \f[C]slideous\-url\f[]-base URL for Slideous documents (defaults to \f[C]slideous\f[])-.RS-.RE-.TP-.B \f[C]s5\-url\f[]-base URL for S5 documents (defaults to \f[C]s5/default\f[])-.RS-.RE-.TP-.B \f[C]revealjs\-url\f[]-base URL for reveal.js documents (defaults to \f[C]reveal.js\f[])-.RS-.RE-.TP-.B \f[C]theme\f[]-reveal.js or LaTeX beamer theme-.RS-.RE-.TP-.B \f[C]transition\f[]-reveal.js transition-.RS-.RE-.TP-.B \f[C]fontsize\f[]-font size (10pt, 11pt, 12pt) for LaTeX documents-.RS-.RE-.TP-.B \f[C]documentclass\f[]-document class for LaTeX documents-.RS-.RE-.TP-.B \f[C]classoption\f[]-option for LaTeX documentclass, e.g.-\f[C]oneside\f[]; may be repeated for multiple options-.RS-.RE-.TP-.B \f[C]geometry\f[]-options for LaTeX \f[C]geometry\f[] class, e.g.-\f[C]margin=1in\f[]; may be repeated for multiple options-.RS-.RE-.TP-.B \f[C]linestretch\f[]-adjusts line spacing (requires the \f[C]setspace\f[] package)-.RS-.RE-.TP-.B \f[C]fontfamily\f[]-font package to use for LaTeX documents (with pdflatex): TeXLive has-\f[C]bookman\f[] (Bookman), \f[C]utopia\f[] or \f[C]fourier\f[]-(Utopia), \f[C]fouriernc\f[] (New Century Schoolbook), \f[C]times\f[] or-\f[C]txfonts\f[] (Times), \f[C]mathpazo\f[] or \f[C]pxfonts\f[] or-\f[C]mathpple\f[] (Palatino), \f[C]libertine\f[] (Linux Libertine),-\f[C]arev\f[] (Arev Sans), and the default \f[C]lmodern\f[], among-others.-.RS-.RE-.TP-.B \f[C]mainfont\f[], \f[C]sansfont\f[], \f[C]monofont\f[], \f[C]mathfont\f[]-fonts for LaTeX documents (works only with xelatex and lualatex)-.RS-.RE-.TP-.B \f[C]colortheme\f[]-colortheme for LaTeX beamer documents-.RS-.RE-.TP-.B \f[C]fonttheme\f[]-fonttheme for LaTeX beamer documents-.RS-.RE-.TP-.B \f[C]linkcolor\f[]-color for internal links in LaTeX documents (\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-.RE-.TP-.B \f[C]urlcolor\f[]-color for external links in LaTeX documents-.RS-.RE-.TP-.B \f[C]citecolor\f[]-color for citation links in LaTeX documents-.RS-.RE-.TP-.B \f[C]links\-as\-notes\f[]-causes links to be printed as footnotes in LaTeX documents-.RS-.RE-.TP-.B \f[C]toc\f[]-include table of contents in LaTeX documents-.RS-.RE-.TP-.B \f[C]toc\-depth\f[]-level of section to include in table of contents in LaTeX documents-.RS-.RE-.TP-.B \f[C]lof\f[]-include list of figures in LaTeX documents-.RS-.RE-.TP-.B \f[C]lot\f[]-include list of tables in LaTeX documents-.RS-.RE-.TP-.B \f[C]biblio\-style\f[]-bibliography style in LaTeX, when used with \f[C]\-\-natbib\f[]-.RS-.RE-.TP-.B \f[C]biblio\-files\f[]-bibliography files to use in LaTeX, with \f[C]\-\-natbib\f[] or-\f[C]\-\-biblatex\f[]-.RS-.RE-.TP-.B \f[C]section\f[]-section number in man pages-.RS-.RE-.TP-.B \f[C]header\f[]-header in man pages-.RS-.RE-.TP-.B \f[C]footer\f[]-footer in man pages-.RS-.RE-.PP-Variables may be set at the command line using the-\f[C]\-V/\-\-variable\f[] option.-Variables set in this way override metadata fields with the same name.-.PP-Templates may contain conditionals.-The syntax is as follows:-.IP-.nf-\f[C]-$if(variable)$-X-$else$-Y-$endif$-\f[]-.fi-.PP-This will include \f[C]X\f[] in the template if \f[C]variable\f[] has a-non\-null value; otherwise it will include \f[C]Y\f[].-\f[C]X\f[] and \f[C]Y\f[] are placeholders for any valid template text,-and may include interpolated variables or other conditionals.-The \f[C]$else$\f[] section may be omitted.-.PP-When variables can have multiple values (for example, \f[C]author\f[] in-a multi\-author document), you can use the \f[C]$for$\f[] keyword:-.IP-.nf-\f[C]-$for(author)$-<meta\ name="author"\ content="$author$"\ />-$endfor$-\f[]-.fi-.PP-You can optionally specify a separator to be used between consecutive-items:-.IP-.nf-\f[C]-$for(author)$$author$$sep$,\ $endfor$-\f[]-.fi-.PP-A dot can be used to select a field of a variable that takes an object-as its value.-So, for example:-.IP-.nf-\f[C]-$author.name$\ ($author.affiliation$)-\f[]-.fi-.PP-If you use custom templates, you may need to revise them as pandoc-changes.-We recommend tracking the changes in the default templates, and-modifying your custom templates accordingly.-An easy way to do this is to fork the pandoc\-templates repository-(http://github.com/jgm/pandoc\-templates) and merge in changes after-each pandoc release.-.SH PRODUCING SLIDE SHOWS WITH PANDOC-.PP-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.-.PP-Here\[aq]s the markdown source for a simple slide show,-\f[C]habits.txt\f[]:-.IP-.nf-\f[C]-%\ Habits-%\ John\ Doe-%\ March\ 22,\ 2005--#\ In\ the\ morning--##\ Getting\ up--\-\ Turn\ off\ alarm-\-\ Get\ out\ of\ bed--##\ Breakfast--\-\ Eat\ eggs-\-\ Drink\ coffee--#\ In\ the\ evening--##\ Dinner--\-\ Eat\ spaghetti-\-\ Drink\ wine--\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-----##\ Going\ to\ sleep--\-\ Get\ in\ bed-\-\ Count\ sheep-\f[]-.fi-.PP-To produce an HTML/javascript slide show, simply type-.IP-.nf-\f[C]-pandoc\ \-t\ FORMAT\ \-s\ habits.txt\ \-o\ habits.html-\f[]-.fi-.PP-where \f[C]FORMAT\f[] is either \f[C]s5\f[], \f[C]slidy\f[],-\f[C]slideous\f[], \f[C]dzslides\f[], or \f[C]revealjs\f[].-.PP-For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with-the \f[C]\-s/\-\-standalone\f[] option embeds a link to javascripts and-CSS files, which are assumed to be available at the relative path-\f[C]s5/default\f[] (for S5), \f[C]slideous\f[] (for Slideous),-\f[C]reveal.js\f[] (for reveal.js), or at the Slidy website at-\f[C]w3.org\f[] (for Slidy).-(These paths can be changed by setting the \f[C]slidy\-url\f[],-\f[C]slideous\-url\f[], \f[C]revealjs\-url\f[], or \f[C]s5\-url\f[]-variables; see \f[C]\-\-variable\f[], above.) For DZSlides, the-(relatively short) javascript and css are included in the file by-default.-.PP-With all HTML slide formats, the \f[C]\-\-self\-contained\f[] option can-be used to produce a single file that contains all of the data necessary-to display the slide show, including linked scripts, stylesheets,-images, and videos.-.PP-To produce a PDF slide show using beamer, type-.IP-.nf-\f[C]-pandoc\ \-t\ beamer\ habits.txt\ \-o\ habits.pdf-\f[]-.fi-.PP-Note that a reveal.js slide show can also be converted to a PDF by-printing it to a file from the browser.-.SS Structuring the slide show-.PP-By default, the \f[I]slide level\f[] is the highest header level in the-hierarchy that is followed immediately by content, and not another-header, somewhere in the document.-In the example above, level 1 headers are always followed by level 2-headers, which are followed by content, so 2 is the slide level.-This default can be overridden using the \f[C]\-\-slide\-level\f[]-option.-.PP-The document is carved up into slides according to the following rules:-.IP \[bu] 2-A horizontal rule always starts a new slide.-.IP \[bu] 2-A header at the slide level always starts a new slide.-.IP \[bu] 2-Headers \f[I]below\f[] the slide level in the hierarchy create headers-\f[I]within\f[] a slide.-.IP \[bu] 2-Headers \f[I]above\f[] the slide level in the hierarchy create "title-slides," which just contain the section title and help to break the-slide show into sections.-.IP \[bu] 2-A title page is constructed automatically from the document\[aq]s title-block, if present.-(In the case of beamer, this can be disabled by commenting out some-lines in the default template.)-.PP-These rules are designed to support many different styles of slide show.-If you don\[aq]t care about structuring your slides into sections and-subsections, you can just use level 1 headers for all each slide.-(In that case, level 1 will be the slide level.) But you can also-structure the slide show into sections, as in the example above.-.PP-Note: in reveal.js slide shows, if slide level is 2, a two\-dimensional-layout will be produced, with level 1 headers building horizontally and-level 2 headers building vertically.-It is not recommended that you use deeper nesting of section levels with-reveal.js.-.SS Incremental lists-.PP-By default, these writers produces lists that display "all at once." If-you want your lists to display incrementally (one item at a time), use-the \f[C]\-i\f[] option.-If you want a particular list to depart from the default (that is, to-display incrementally without the \f[C]\-i\f[] option and all at once-with the \f[C]\-i\f[] option), put it in a block quote:-.IP-.nf-\f[C]->\ \-\ Eat\ spaghetti->\ \-\ Drink\ wine-\f[]-.fi-.PP-In this way incremental and nonincremental lists can be mixed in a-single document.-.SS Inserting pauses-.PP-You can add "pauses" within a slide by including a paragraph containing-three dots, separated by spaces:-.IP-.nf-\f[C]-#\ Slide\ with\ a\ pause--content\ before\ the\ pause--\&.\ .\ .--content\ after\ the\ pause-\f[]-.fi-.SS Styling the slides-.PP-You can change the style of HTML slides by putting customized CSS files-in \f[C]$DATADIR/s5/default\f[] (for S5), \f[C]$DATADIR/slidy\f[] (for-Slidy), or \f[C]$DATADIR/slideous\f[] (for Slideous), where-\f[C]$DATADIR\f[] is the user data directory (see-\f[C]\-\-data\-dir\f[], above).-The originals may be found in pandoc\[aq]s system data directory-(generally \f[C]$CABALDIR/pandoc\-VERSION/s5/default\f[]).-Pandoc will look there for any files it does not find in the user data-directory.-.PP-For dzslides, the CSS is included in the HTML file itself, and may be-modified there.-.PP-For reveal.js, themes can be used by setting the \f[C]theme\f[]-variable, for example:-.IP-.nf-\f[C]-\-V\ theme=moon-\f[]-.fi-.PP-Or you can specify a custom stylesheet using the \f[C]\-\-css\f[]-option.-.PP-To style beamer slides, you can specify a beamer "theme" or "colortheme"-using the \f[C]\-V\f[] option:-.IP-.nf-\f[C]-pandoc\ \-t\ beamer\ habits.txt\ \-V\ theme:Warsaw\ \-o\ habits.pdf-\f[]-.fi-.PP-Note that header attributes will turn into slide attributes (on a-\f[C]<div>\f[] or \f[C]<section>\f[]) in HTML slide formats, allowing-you to style individual slides.-In Beamer, the only header attribute that affects slides is the-\f[C]allowframebreaks\f[] class, which sets the-\f[C]allowframebreaks\f[] option, causing multiple slides to be created-if the content overfills the frame.-This is recommended especially for bibliographies:-.IP-.nf-\f[C]-#\ References\ {.allowframebreaks}-\f[]-.fi-.SS Speaker notes-.PP-reveal.js has good support for speaker notes.-You can add notes to your markdown document thus:-.IP-.nf-\f[C]-<div\ class="notes">-This\ is\ my\ note.--\-\ It\ can\ contain\ markdown-\-\ like\ this\ list--</div>-\f[]-.fi-.PP-To show the notes window, press \f[C]s\f[] while viewing the-presentation.-Notes are not yet supported for other slide formats, but the notes will-not appear on the slides themselves.-.SH 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-YAML metadata block.-Here is an example:-.IP-.nf-\f[C]-\-\-\--title:-\-\ type:\ main-\ \ text:\ My\ Book-\-\ type:\ subtitle-\ \ text:\ An\ investigation\ of\ metadata-creator:-\-\ role:\ author-\ \ text:\ John\ Smith-\-\ role:\ editor-\ \ text:\ Sarah\ Jones-identifier:-\-\ scheme:\ DOI-\ \ text:\ doi:10.234234.234/33-publisher:\ \ My\ Press-rights:\ \ (c)\ 2007\ John\ Smith,\ CC\ BY\-NC-\&...-\f[]-.fi-.PP-The following fields are recognized:-.TP-.B \f[C]identifier\f[]-Either a string value or an object with fields \f[C]text\f[] and-\f[C]scheme\f[].-Valid values for \f[C]scheme\f[] are \f[C]ISBN\-10\f[],-\f[C]GTIN\-13\f[], \f[C]UPC\f[], \f[C]ISMN\-10\f[], \f[C]DOI\f[],-\f[C]LCCN\f[], \f[C]GTIN\-14\f[], \f[C]ISBN\-13\f[],-\f[C]Legal\ deposit\ number\f[], \f[C]URN\f[], \f[C]OCLC\f[],-\f[C]ISMN\-13\f[], \f[C]ISBN\-A\f[], \f[C]JP\f[], \f[C]OLCC\f[].-.RS-.RE-.TP-.B \f[C]title\f[]-Either a string value, or an object with fields \f[C]file\-as\f[] and-\f[C]type\f[], or a list of such objects.-Valid values for \f[C]type\f[] are \f[C]main\f[], \f[C]subtitle\f[],-\f[C]short\f[], \f[C]collection\f[], \f[C]edition\f[],-\f[C]extended\f[].-.RS-.RE-.TP-.B \f[C]creator\f[]-Either a string value, or an object with fields \f[C]role\f[],-\f[C]file\-as\f[], and \f[C]text\f[], or a list of such objects.-Valid values for \f[C]role\f[] are marc relators, but pandoc will-attempt to translate the human\-readable versions (like "author" and-"editor") to the appropriate marc relators.-.RS-.RE-.TP-.B \f[C]contributor\f[]-Same format as \f[C]creator\f[].-.RS-.RE-.TP-.B \f[C]date\f[]-A string value in \f[C]YYYY\-MM\-DD\f[] format.-(Only the year is necessary.) Pandoc will attempt to convert other-common date formats.-.RS-.RE-.TP-.B \f[C]language\f[]-A string value in RFC5646 format.-Pandoc will default to the local language if nothing is specified.-.RS-.RE-.TP-.B \f[C]subject\f[]-A string value or a list of such values.-.RS-.RE-.TP-.B \f[C]description\f[]-A string value.-.RS-.RE-.TP-.B \f[C]type\f[]-A string value.-.RS-.RE-.TP-.B \f[C]format\f[]-A string value.-.RS-.RE-.TP-.B \f[C]relation\f[]-A string value.-.RS-.RE-.TP-.B \f[C]coverage\f[]-A string value.-.RS-.RE-.TP-.B \f[C]rights\f[]-A string value.-.RS-.RE-.TP-.B \f[C]cover\-image\f[]-A string value (path to cover image).-.RS-.RE-.TP-.B \f[C]stylesheet\f[]-A string value (path to CSS stylesheet).-.RS-.RE-.TP-.B \f[C]page\-progression\-direction\f[]-Either \f[C]ltr\f[] or \f[C]rtl\f[].-Specifies the \f[C]page\-progression\-direction\f[] spine attribute.-.RS-.RE-.SH LITERATE HASKELL SUPPORT-.PP-If you append \f[C]+lhs\f[] (or \f[C]+literate_haskell\f[]) to an-appropriate input or output format (\f[C]markdown\f[],-\f[C]markdown_strict\f[], \f[C]rst\f[], or \f[C]latex\f[] for input or-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-rather than block quotations.-Text between \f[C]\\begin{code}\f[] and \f[C]\\end{code}\f[] will also-be treated as Haskell code.-.IP \[bu] 2-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.-In addition, headers will be rendered setext\-style (with underlines)-rather than atx\-style (with \[aq]#\[aq] characters).-(This is because ghc treats \[aq]#\[aq] characters in column 1 as-introducing line numbers.)-.IP \[bu] 2-In restructured text input, "bird track" sections will be parsed as-Haskell code.-.IP \[bu] 2-In restructured text output, code blocks with class \f[C]haskell\f[]-will be rendered using bird tracks.-.IP \[bu] 2-In LaTeX input, text in \f[C]code\f[] environments will be parsed as-Haskell code.-.IP \[bu] 2-In LaTeX output, code blocks with class \f[C]haskell\f[] will be-rendered inside \f[C]code\f[] environments.-.IP \[bu] 2-In HTML output, code blocks with class \f[C]haskell\f[] will be rendered-with class \f[C]literatehaskell\f[] and bird tracks.-.PP-Examples:-.IP-.nf-\f[C]-pandoc\ \-f\ markdown+lhs\ \-t\ html-\f[]-.fi-.PP-reads literate Haskell source formatted with markdown conventions and-writes ordinary HTML (without bird tracks).-.IP-.nf-\f[C]-pandoc\ \-f\ markdown+lhs\ \-t\ html+lhs-\f[]-.fi-.PP-writes HTML with the Haskell code in bird tracks, so it can be copied-and pasted as literate Haskell source.-.SH CUSTOM WRITERS-.PP-Pandoc can be extended with custom writers written in lua.-(Pandoc includes a lua interpreter, so lua need not be installed-separately.)-.PP-To use a custom writer, simply specify the path to the lua script in-place of the output format.-For example:-.IP-.nf-\f[C]-pandoc\ \-t\ data/sample.lua-\f[]-.fi-.PP-Creating a custom writer requires writing a lua function for each-possible element in a pandoc document.-To get a documented example which you can modify according to your-needs, do-.IP-.nf-\f[C]-pandoc\ \-\-print\-default\-data\-file\ sample.lua-\f[]-.fi-.SH AUTHORS-.PP-© 2006\-2013 John MacFarlane (jgm at berkeley dot edu).-Released under the GPL, version 2 or greater.-This software carries no warranty of any kind.-(See COPYRIGHT for full copyright and warranty notices.) Other-contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang, Andrea-Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public, Puneeth-Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton, Nathan-Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,-Christopher Sawicki, Kelsey Hightower, Masayoshi Takahashi, Antoine-Latter, Ralf Stephan, Eric Seidel, B.-Scott Michel, Gavin Beatty, Sergey Astanin, Arlo O\[aq]Keeffe, Denis-Laxalde, Brent Yorgey, David Lazar, Jamie F.-Olson, Matthew Pickering, Albert Krewinkel, mb21, Jesse Rosenthal.-.SH PANDOC'S MARKDOWN-For a complete description of pandoc's extensions to standard markdown,-see \f[C]pandoc_markdown\f[] (5).-.SH SEE ALSO-.PP-\f[C]pandoc_markdown\f[] (5).-.PP-The Pandoc source code and all documentation may be downloaded-from <http://johnmacfarlane.net/pandoc/>.
@@ -1,16 +0,0 @@-$if(has-tables)$-.\"t-$endif$-.TH PANDOC 1 "$date$" "$version$"-.SH NAME-pandoc - general markup converter-$body$-.SH PANDOC'S MARKDOWN-For a complete description of pandoc's extensions to standard markdown,-see \f[C]pandoc_markdown\f[] (5).-.SH SEE ALSO-.PP-\f[C]pandoc_markdown\f[] (5).-.PP-The Pandoc source code and all documentation may be downloaded-from <http://johnmacfarlane.net/pandoc/>.
@@ -1,2420 +0,0 @@-.\"t-.TH PANDOC_MARKDOWN 5 "August 30, 2014" "1.13.1"-.SH NAME-pandoc_markdown - markdown syntax for pandoc(1)-.SH DESCRIPTION-.PP-Pandoc understands an extended and slightly revised version of John-Gruber\[aq]s markdown syntax.-This document explains the syntax, noting differences from standard-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-footnotes enabled, while \f[C]markdown\-footnotes\-pipe_tables\f[] is-pandoc\[aq]s markdown without footnotes or pipe tables.-.SH PHILOSOPHY-.PP-Markdown is designed to be easy to write, and, even more importantly,-easy to read:-.RS-.PP-A Markdown\-formatted document should be publishable as\-is, as plain-text, without looking like it\[aq]s been marked up with tags or-formatting instructions.-\-\- John Gruber-.RE-.PP-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,-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-elements like definition lists, tables, mathematics, and footnotes.-.SH PARAGRAPHS-.PP-A paragraph is one or more lines of text followed by one or more blank-line.-Newlines are treated as spaces, so you can reflow your paragraphs as you-like.-If you need a hard line break, put two or more spaces at the end of a-line.-.SS Extension: \f[C]escaped_line_breaks\f[]-.PP-A backslash followed by a newline is also a hard line break.-Note: in multiline and grid table cells, this is the only way to create-a hard line break, since trailing spaces in the cells are ignored.-.SH HEADERS-.PP-There are two kinds of headers, Setext and atx.-.SS Setext\-style headers-.PP-A setext\-style header is a line of text "underlined" with a row of-\f[C]=\f[] signs (for a level one header) or \f[C]\-\f[] signs (for a-level two header):-.IP-.nf-\f[C]-A\ level\-one\ header-==================--A\ level\-two\ header-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\f[]-.fi-.PP-The header text can contain inline formatting, such as emphasis (see-Inline formatting, below).-.SS Atx\-style headers-.PP-An Atx\-style header consists of one to six \f[C]#\f[] signs and a line-of text, optionally followed by any number of \f[C]#\f[] signs.-The number of \f[C]#\f[] signs at the beginning of the line is the-header level:-.IP-.nf-\f[C]-##\ A\ level\-two\ header--###\ A\ level\-three\ header\ ###-\f[]-.fi-.PP-As with setext\-style headers, the header text can contain formatting:-.IP-.nf-\f[C]-#\ A\ level\-one\ header\ with\ a\ [link](/url)\ and\ *emphasis*-\f[]-.fi-.SS Extension: \f[C]blank_before_header\f[]-.PP-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-\f[C]#\f[] to end up at the beginning of a line by accident (perhaps-through line wrapping).-Consider, for example:-.IP-.nf-\f[C]-I\ like\ several\ of\ their\ flavors\ of\ ice\ cream:-#22,\ for\ example,\ and\ #5.-\f[]-.fi-.SS Header identifiers in HTML, LaTeX, and ConTeXt-.SS Extension: \f[C]header_attributes\f[]-.PP-Headers can be assigned attributes using this syntax at the end of the-line containing the header text:-.IP-.nf-\f[C]-{#identifier\ .class\ .class\ key=value\ key=value}-\f[]-.fi-.PP-Thus, for example, the following headers will all be assigned the-identifier \f[C]foo\f[]:-.IP-.nf-\f[C]-#\ My\ header\ {#foo}--##\ My\ header\ ##\ \ \ \ {#foo}--My\ other\ header\ \ \ {#foo}-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\f[]-.fi-.PP-(This syntax is compatible with PHP Markdown Extra.)-.PP-Note that although this syntax allows assignment of classes and-key/value attributes, writers generally don\[aq]t use all of this-information.-Identifiers, classes, and key/value attributes are used in HTML and-HTML\-based formats such as EPUB and slidy.-Identifiers are used for labels and link anchors in the LaTeX, ConTeXt,-Textile, and AsciiDoc writers.-.PP-Headers with the class \f[C]unnumbered\f[] will not be numbered, even if-\f[C]\-\-number\-sections\f[] is specified.-A single hyphen (\f[C]\-\f[]) in an attribute context is equivalent to-\f[C]\&.unnumbered\f[], and preferable in non\-English documents.-So,-.IP-.nf-\f[C]-#\ My\ header\ {\-}-\f[]-.fi-.PP-is just the same as-.IP-.nf-\f[C]-#\ My\ header\ {.unnumbered}-\f[]-.fi-.SS Extension: \f[C]auto_identifiers\f[]-.PP-A header without an explicitly specified identifier will be-automatically assigned a unique identifier based on the header text.-To derive the identifier from the header text,-.IP \[bu] 2-Remove all formatting, links, etc.-.IP \[bu] 2-Remove all footnotes.-.IP \[bu] 2-Remove all punctuation, except underscores, hyphens, and periods.-.IP \[bu] 2-Replace all spaces and newlines with hyphens.-.IP \[bu] 2-Convert all alphabetic characters to lowercase.-.IP \[bu] 2-Remove everything up to the first letter (identifiers may not begin with-a number or punctuation mark).-.IP \[bu] 2-If nothing is left after this, use the identifier \f[C]section\f[].-.PP-Thus, for example,-.PP-.TS-tab(@);-l l.-T{-Header-T}@T{-Identifier-T}-_-T{-Header identifiers in HTML-T}@T{-\f[C]header\-identifiers\-in\-html\f[]-T}-T{-\f[I]Dogs\f[]?\-\-in \f[I]my\f[] house?-T}@T{-\f[C]dogs\-\-in\-my\-house\f[]-T}-T{-HTML, S5, or RTF?-T}@T{-\f[C]html\-s5\-or\-rtf\f[]-T}-T{-3.-Applications-T}@T{-\f[C]applications\f[]-T}-T{-33-T}@T{-\f[C]section\f[]-T}-.TE-.PP-These rules should, in most cases, allow one to determine the identifier-from the header text.-The exception is when several headers have the same text; in this case,-the first will get an identifier as described above; the second will get-the same identifier with \f[C]\-1\f[] appended; the third with-\f[C]\-2\f[]; and so on.-.PP-These identifiers are used to provide link targets in the table of-contents generated by the \f[C]\-\-toc|\-\-table\-of\-contents\f[]-option.-They also make it easy to provide links from one section of a document-to another.-A link to this section, for example, might look like this:-.IP-.nf-\f[C]-See\ the\ section\ on-[header\ identifiers](#header\-identifiers\-in\-html\-latex\-and\-context).-\f[]-.fi-.PP-Note, however, that this method of providing links to sections works-only in HTML, LaTeX, and ConTeXt formats.-.PP-If the \f[C]\-\-section\-divs\f[] option is specified, then each section-will be wrapped in a \f[C]div\f[] (or a \f[C]section\f[], if-\f[C]\-\-html5\f[] was specified), and the identifier will be attached-to the enclosing \f[C]<div>\f[] (or \f[C]<section>\f[]) tag rather than-the header itself.-This allows entire sections to be manipulated using javascript or-treated differently in CSS.-.SS Extension: \f[C]implicit_header_references\f[]-.PP-Pandoc behaves as if reference links have been defined for each header.-So, instead of-.IP-.nf-\f[C]-[header\ identifiers](#header\-identifiers\-in\-html)-\f[]-.fi-.PP-you can simply write-.IP-.nf-\f[C]-[header\ identifiers]-\f[]-.fi-.PP-or-.IP-.nf-\f[C]-[header\ identifiers][]-\f[]-.fi-.PP-or-.IP-.nf-\f[C]-[the\ section\ on\ header\ identifiers][header\ identifiers]-\f[]-.fi-.PP-If there are multiple headers with identical text, the corresponding-reference will link to the first one only, and you will need to use-explicit links to link to the others, as described above.-.PP-Unlike regular reference links, these references are case\-sensitive.-.PP-Note: if you have defined an explicit identifier for a header, then-implicit references to it will not work.-.SH BLOCK QUOTATIONS-.PP-Markdown uses email conventions for quoting blocks of text.-A block quotation is one or more paragraphs or other block elements-(such as lists or headers), with each line preceded by a \f[C]>\f[]-character and a space.-(The \f[C]>\f[] need not start at the left margin, but it should not be-indented more than three spaces.)-.IP-.nf-\f[C]->\ This\ is\ a\ block\ quote.\ This->\ paragraph\ has\ two\ lines.->->\ 1.\ This\ is\ a\ list\ inside\ a\ block\ quote.->\ 2.\ Second\ item.-\f[]-.fi-.PP-A "lazy" form, which requires the \f[C]>\f[] character only on the first-line of each block, is also allowed:-.IP-.nf-\f[C]->\ This\ is\ a\ block\ quote.\ This-paragraph\ has\ two\ lines.-->\ 1.\ This\ is\ a\ list\ inside\ a\ block\ quote.-2.\ Second\ item.-\f[]-.fi-.PP-Among the block elements that can be contained in a block quote are-other block quotes.-That is, block quotes can be nested:-.IP-.nf-\f[C]->\ This\ is\ a\ block\ quote.->->\ >\ A\ block\ quote\ within\ a\ block\ quote.-\f[]-.fi-.SS Extension: \f[C]blank_before_blockquote\f[]-.PP-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-\f[C]>\f[] to end up at the beginning of a line by accident (perhaps-through line wrapping).-So, unless the \f[C]markdown_strict\f[] format is used, the following-does not produce a nested block quote in pandoc:-.IP-.nf-\f[C]->\ This\ is\ a\ block\ quote.->>\ Nested.-\f[]-.fi-.SH VERBATIM (CODE) BLOCKS-.SS Indented code blocks-.PP-A block of text indented four spaces (or one tab) is treated as verbatim-text: that is, special characters do not trigger special formatting, and-all spaces and line breaks are preserved.-For example,-.IP-.nf-\f[C]-\ \ \ \ if\ (a\ >\ 3)\ {-\ \ \ \ \ \ moveShip(5\ *\ gravity,\ DOWN);-\ \ \ \ }-\f[]-.fi-.PP-The initial (four space or one tab) indentation is not considered part-of the verbatim text, and is removed in the output.-.PP-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-\f[I]fenced\f[] code blocks.-These begin with a row of three or more tildes (\f[C]~\f[]) or backticks-(\f[C]`\f[]) and end with a row of tildes or backticks that must be at-least as long as the starting row.-Everything between these lines is treated as code.-No indentation is necessary:-.IP-.nf-\f[C]-~~~~~~~-if\ (a\ >\ 3)\ {-\ \ moveShip(5\ *\ gravity,\ DOWN);-}-~~~~~~~-\f[]-.fi-.PP-Like regular code blocks, fenced code blocks must be separated from-surrounding text by blank lines.-.PP-If the code itself contains a row of tildes or backticks, just use a-longer row of tildes or backticks at the start and end:-.IP-.nf-\f[C]-~~~~~~~~~~~~~~~~-~~~~~~~~~~-code\ including\ tildes-~~~~~~~~~~-~~~~~~~~~~~~~~~~-\f[]-.fi-.SS Extension: \f[C]fenced_code_attributes\f[]-.PP-Optionally, you may attach attributes to the code block using this-syntax:-.IP-.nf-\f[C]-~~~~\ {#mycode\ .haskell\ .numberLines\ startFrom="100"}-qsort\ []\ \ \ \ \ =\ []-qsort\ (x:xs)\ =\ qsort\ (filter\ (<\ x)\ xs)\ ++\ [x]\ ++-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ qsort\ (filter\ (>=\ x)\ xs)-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-\f[]-.fi-.PP-Here \f[C]mycode\f[] is an identifier, \f[C]haskell\f[] and-\f[C]numberLines\f[] are classes, and \f[C]startFrom\f[] is an attribute-with value \f[C]100\f[].-Some output formats can use this information to do syntax highlighting.-Currently, the only output formats that uses this information are HTML-and LaTeX.-If highlighting is supported for your output format and language, then-the code block above will appear highlighted, with numbered lines.-(To see which languages are supported, do \f[C]pandoc\ \-\-version\f[].)-Otherwise, the code block above will appear as follows:-.IP-.nf-\f[C]-<pre\ id="mycode"\ class="haskell\ numberLines"\ startFrom="100">-\ \ <code>-\ \ ...-\ \ </code>-</pre>-\f[]-.fi-.PP-A shortcut form can also be used for specifying the language of the code-block:-.IP-.nf-\f[C]-```haskell-qsort\ []\ =\ []-```-\f[]-.fi-.PP-This is equivalent to:-.IP-.nf-\f[C]-```\ {.haskell}-qsort\ []\ =\ []-```-\f[]-.fi-.PP-If the \f[C]fenced_code_attributes\f[] extension is disabled, but input-contains class attribute(s) for the codeblock, the first class attribute-will be printed after the opening fence as a bare word.-.PP-To prevent all highlighting, use the \f[C]\-\-no\-highlight\f[] flag.-To set the highlighting style, use \f[C]\-\-highlight\-style\f[].-.SH LINE BLOCKS-.SS Extension: \f[C]line_blocks\f[]-.PP-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.-This is useful for verse and addresses:-.IP-.nf-\f[C]-|\ The\ limerick\ packs\ laughs\ anatomical-|\ In\ space\ that\ is\ quite\ economical.-|\ \ \ \ But\ the\ good\ ones\ I\[aq]ve\ seen-|\ \ \ \ So\ seldom\ are\ clean-|\ And\ the\ clean\ ones\ so\ seldom\ are\ comical--|\ 200\ Main\ St.-|\ Berkeley,\ CA\ 94718-\f[]-.fi-.PP-The lines can be hard\-wrapped if needed, but the continuation line must-begin with a space.-.IP-.nf-\f[C]-|\ The\ Right\ Honorable\ Most\ Venerable\ and\ Righteous\ Samuel\ L.-\ \ Constable,\ Jr.-|\ 200\ Main\ St.-|\ Berkeley,\ CA\ 94718-\f[]-.fi-.PP-This syntax is borrowed from reStructuredText.-.SH LISTS-.SS Bullet lists-.PP-A bullet list is a list of bulleted list items.-A bulleted list item begins with a bullet (\f[C]*\f[], \f[C]+\f[], or-\f[C]\-\f[]).-Here is a simple example:-.IP-.nf-\f[C]-*\ one-*\ two-*\ three-\f[]-.fi-.PP-This will produce a "compact" list.-If you want a "loose" list, in which each item is formatted as a-paragraph, put spaces between the items:-.IP-.nf-\f[C]-*\ one--*\ two--*\ three-\f[]-.fi-.PP-The bullets need not be flush with the left margin; they may be indented-one, two, or three spaces.-The bullet must be followed by whitespace.-.PP-List items look best if subsequent lines are flush with the first line-(after the bullet):-.IP-.nf-\f[C]-*\ here\ is\ my\ first-\ \ list\ item.-*\ and\ my\ second.-\f[]-.fi-.PP-But markdown also allows a "lazy" format:-.IP-.nf-\f[C]-*\ here\ is\ my\ first-list\ item.-*\ and\ my\ second.-\f[]-.fi-.SS The four\-space rule-.PP-A list item may contain multiple paragraphs and other block\-level-content.-However, subsequent paragraphs must be preceded by a blank line and-indented four spaces or a tab.-The list will look better if the first paragraph is aligned with the-rest:-.IP-.nf-\f[C]-\ \ *\ First\ paragraph.--\ \ \ \ Continued.--\ \ *\ Second\ paragraph.\ With\ a\ code\ block,\ which\ must\ be\ indented-\ \ \ \ eight\ spaces:--\ \ \ \ \ \ \ \ {\ code\ }-\f[]-.fi-.PP-List items may include other lists.-In this case the preceding blank line is optional.-The nested list must be indented four spaces or one tab:-.IP-.nf-\f[C]-*\ fruits-\ \ \ \ +\ apples-\ \ \ \ \ \ \ \ \-\ macintosh-\ \ \ \ \ \ \ \ \-\ red\ delicious-\ \ \ \ +\ pears-\ \ \ \ +\ peaches-*\ vegetables-\ \ \ \ +\ broccoli-\ \ \ \ +\ chard-\f[]-.fi-.PP-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.-.IP-.nf-\f[C]-+\ A\ lazy,\ lazy,\ list-item.--+\ Another\ one;\ this\ looks-bad\ but\ is\ legal.--\ \ \ \ Second\ paragraph\ of\ second-list\ item.-\f[]-.fi-.PP-\f[B]Note:\f[] Although the four\-space rule for continuation paragraphs-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-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-(including nested lists), and pandoc interprets it that way.-.SS Ordered lists-.PP-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-period and a space.-The numbers themselves are ignored, so there is no difference between-this list:-.IP-.nf-\f[C]-1.\ \ one-2.\ \ two-3.\ \ three-\f[]-.fi-.PP-and this one:-.IP-.nf-\f[C]-5.\ \ one-7.\ \ two-1.\ \ three-\f[]-.fi-.SS Extension: \f[C]fancy_lists\f[]-.PP-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 text that follows by at least one space,-and, if the list marker is a capital letter with a period, by at least-two spaces.[1]-.PP-The \f[C]fancy_lists\f[] extension also allows \[aq]\f[C]#\f[]\[aq] to-be used as an ordered list marker in place of a numeral:-.IP-.nf-\f[C]-#.\ one-#.\ two-\f[]-.fi-.SS Extension: \f[C]startnum\f[]-.PP-Pandoc also pays attention to the type of list marker used, and to the-starting number, and both of these are preserved where possible in the-output format.-Thus, the following yields a list with numbers followed by a single-parenthesis, starting with 9, and a sublist with lowercase roman-numerals:-.IP-.nf-\f[C]-\ 9)\ \ Ninth-10)\ \ Tenth-11)\ \ Eleventh-\ \ \ \ \ \ \ i.\ subone-\ \ \ \ \ \ ii.\ subtwo-\ \ \ \ \ iii.\ subthree-\f[]-.fi-.PP-Pandoc will start a new list each time a different type of list marker-is used.-So, the following will create three lists:-.IP-.nf-\f[C]-(2)\ Two-(5)\ Three-1.\ \ Four-*\ \ \ Five-\f[]-.fi-.PP-If default list markers are desired, use \f[C]#.\f[]:-.IP-.nf-\f[C]-#.\ \ one-#.\ \ two-#.\ \ three-\f[]-.fi-.SS Definition lists-.SS Extension: \f[C]definition_lists\f[]-.PP-Pandoc supports definition lists, using the syntax of PHP Markdown Extra-with some extensions.[2]-.IP-.nf-\f[C]-Term\ 1--:\ \ \ Definition\ 1--Term\ 2\ with\ *inline\ markup*--:\ \ \ Definition\ 2--\ \ \ \ \ \ \ \ {\ some\ code,\ part\ of\ Definition\ 2\ }--\ \ \ \ Third\ paragraph\ of\ definition\ 2.-\f[]-.fi-.PP-Each term must fit on one line, which may optionally be followed by a-blank line, and must be followed by one or more definitions.-A definition begins with a colon or tilde, which may be indented one or-two spaces.-.PP-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 at the beginning of a paragraph or other block element:-.IP-.nf-\f[C]-Term\ 1--:\ \ \ Definition-with\ lazy\ continuation.--\ \ \ \ Second\ paragraph\ of\ the\ definition.-\f[]-.fi-.PP-If you leave space before the definition (as in the example above), the-text of the definition will be treated as a paragraph.-In some output formats, this will mean greater spacing between-term/definition pairs.-For a more compact definition list, omit the space before the-definition:-.IP-.nf-\f[C]-Term\ 1-\ \ ~\ Definition\ 1--Term\ 2-\ \ ~\ Definition\ 2a-\ \ ~\ Definition\ 2b-\f[]-.fi-.PP-Note that space between items in a definition list is required.-(A variant that loosens this requirement, but disallows "lazy" hard-wrapping, can be activated with \f[C]compact_definition_lists\f[]: see-Non\-pandoc extensions, below.)-.SS Numbered example lists-.SS Extension: \f[C]example_lists\f[]-.PP-The special list marker \f[C]\@\f[] can be used for sequentially-numbered examples.-The first list item with a \f[C]\@\f[] marker will be numbered-\[aq]1\[aq], the next \[aq]2\[aq], and so on, throughout the document.-The numbered examples need not occur in a single list; each new list-using \f[C]\@\f[] will take up where the last stopped.-So, for example:-.IP-.nf-\f[C]-(\@)\ \ My\ first\ example\ will\ be\ numbered\ (1).-(\@)\ \ My\ second\ example\ will\ be\ numbered\ (2).--Explanation\ of\ examples.--(\@)\ \ My\ third\ example\ will\ be\ numbered\ (3).-\f[]-.fi-.PP-Numbered examples can be labeled and referred to elsewhere in the-document:-.IP-.nf-\f[C]-(\@good)\ \ This\ is\ a\ good\ example.--As\ (\@good)\ illustrates,\ ...-\f[]-.fi-.PP-The label can be any string of alphanumeric characters, underscores, or-hyphens.-.SS Compact and loose lists-.PP-Pandoc behaves differently from \f[C]Markdown.pl\f[] on some "edge-cases" involving lists.-Consider this source:-.IP-.nf-\f[C]-+\ \ \ First-+\ \ \ Second:-\ \-\ \ \ Fee-\ \-\ \ \ Fie-\ \-\ \ \ Foe--+\ \ \ Third-\f[]-.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[]-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\[aq]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 \f[C]markdown_strict\f[]-format is specified.-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-.PP-What if you want to put an indented code block after a list?-.IP-.nf-\f[C]-\-\ \ \ item\ one-\-\ \ \ item\ two--\ \ \ \ {\ my\ code\ block\ }-\f[]-.fi-.PP-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-To "cut off" the list after item two, you can insert some non\-indented-content, like an HTML comment, which won\[aq]t produce visible output in-any format:-.IP-.nf-\f[C]-\-\ \ \ item\ one-\-\ \ \ item\ two--<!\-\-\ end\ of\ list\ \-\->--\ \ \ \ {\ my\ code\ block\ }-\f[]-.fi-.PP-You can use the same trick if you want two consecutive lists instead of-one big list:-.IP-.nf-\f[C]-1.\ \ one-2.\ \ two-3.\ \ three--<!\-\-\ \-\->--1.\ \ uno-2.\ \ dos-3.\ \ tres-\f[]-.fi-.SH HORIZONTAL RULES-.PP-A line containing a row of three or more \f[C]*\f[], \f[C]\-\f[], or-\f[C]_\f[] characters (optionally separated by spaces) produces a-horizontal rule:-.IP-.nf-\f[C]-*\ \ *\ \ *\ \ *--\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\f[]-.fi-.SH TABLES-.PP-Four kinds of tables may be used.-The first three kinds presuppose the use of a fixed\-width font, such as-Courier.-The fourth kind can be used with proportionally spaced fonts, as it does-not require lining up columns.-.SS Extension: \f[C]table_captions\f[]-.PP-A caption may optionally be provided with all 4 kinds of tables (as-illustrated in the examples below).-A caption is a paragraph beginning with the string \f[C]Table:\f[] (or-just \f[C]:\f[]), which will be stripped off.-It may appear either before or after the table.-.SS Extension: \f[C]simple_tables\f[]-.PP-Simple tables look like this:-.IP-.nf-\f[C]-\ \ Right\ \ \ \ \ Left\ \ \ \ \ Center\ \ \ \ \ Default-\-\-\-\-\-\-\-\ \ \ \ \ \-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\ \ \ \-\-\-\-\-\-\--\ \ \ \ \ 12\ \ \ \ \ 12\ \ \ \ \ \ \ \ 12\ \ \ \ \ \ \ \ \ \ \ \ 12-\ \ \ \ 123\ \ \ \ \ 123\ \ \ \ \ \ \ 123\ \ \ \ \ \ \ \ \ \ 123-\ \ \ \ \ \ 1\ \ \ \ \ 1\ \ \ \ \ \ \ \ \ \ 1\ \ \ \ \ \ \ \ \ \ \ \ \ 1--Table:\ \ Demonstration\ of\ simple\ table\ syntax.-\f[]-.fi-.PP-The headers and table rows must each fit on one line.-Column alignments are determined by the position of the header text-relative to the dashed line below it:[3]-.IP \[bu] 2-If the dashed line is flush with the header text on the right side but-extends beyond it on the left, the column is right\-aligned.-.IP \[bu] 2-If the dashed line is flush with the header text on the left side but-extends beyond it on the right, the column is left\-aligned.-.IP \[bu] 2-If the dashed line extends beyond the header text on both sides, the-column is centered.-.IP \[bu] 2-If the dashed line is flush with the header text on both sides, the-default alignment is used (in most cases, this will be left).-.PP-The table must end with a blank line, or a line of dashes followed by a-blank line.-.PP-The column headers may be omitted, provided a dashed line is used to end-the table.-For example:-.IP-.nf-\f[C]-\-\-\-\-\-\-\-\ \ \ \ \ \-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\ \ \ \-\-\-\-\-\-\--\ \ \ \ \ 12\ \ \ \ \ 12\ \ \ \ \ \ \ \ 12\ \ \ \ \ \ \ \ \ \ \ \ \ 12-\ \ \ \ 123\ \ \ \ \ 123\ \ \ \ \ \ \ 123\ \ \ \ \ \ \ \ \ \ \ 123-\ \ \ \ \ \ 1\ \ \ \ \ 1\ \ \ \ \ \ \ \ \ \ 1\ \ \ \ \ \ \ \ \ \ \ \ \ \ 1-\-\-\-\-\-\-\-\ \ \ \ \ \-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\ \ \ \-\-\-\-\-\-\--\f[]-.fi-.PP-When headers are omitted, column alignments are determined on the basis-of the first line of the table body.-So, in the tables above, the columns would be right, left, center, and-right aligned, respectively.-.SS Extension: \f[C]multiline_tables\f[]-.PP-Multiline tables allow headers and table rows to span multiple lines of-text (but cells that span multiple columns or rows of the table are not-supported).-Here is an example:-.IP-.nf-\f[C]-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\ Centered\ \ \ Default\ \ \ \ \ \ \ \ \ \ \ Right\ Left-\ \ Header\ \ \ \ Aligned\ \ \ \ \ \ \ \ \ Aligned\ Aligned-\-\-\-\-\-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\ \ \ First\ \ \ \ row\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 12.0\ Example\ of\ a\ row\ that-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ spans\ multiple\ lines.--\ \ Second\ \ \ \ row\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 5.0\ Here\[aq]s\ another\ one.\ Note-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ the\ blank\ line\ between-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rows.-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\---Table:\ Here\[aq]s\ the\ caption.\ It,\ too,\ may\ span-multiple\ lines.-\f[]-.fi-.PP-These work like simple tables, but with the following differences:-.IP \[bu] 2-They must begin with a row of dashes, before the header text (unless the-headers are omitted).-.IP \[bu] 2-They must end with a row of dashes, then a blank line.-.IP \[bu] 2-The rows must be separated by blank lines.-.PP-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.-.PP-Headers may be omitted in multiline tables as well as simple tables:-.IP-.nf-\f[C]-\-\-\-\-\-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\ \ \ First\ \ \ \ row\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 12.0\ Example\ of\ a\ row\ that-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ spans\ multiple\ lines.--\ \ Second\ \ \ \ row\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 5.0\ Here\[aq]s\ another\ one.\ Note-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ the\ blank\ line\ between-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rows.-\-\-\-\-\-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\---:\ Here\[aq]s\ a\ multiline\ table\ without\ headers.-\f[]-.fi-.PP-It is possible for a multiline table to have just one row, but the row-should be followed by a blank line (and then the row of dashes that ends-the table), or the table may be interpreted as a simple table.-.SS Extension: \f[C]grid_tables\f[]-.PP-Grid tables look like this:-.IP-.nf-\f[C]-:\ Sample\ grid\ table.--+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+-|\ Fruit\ \ \ \ \ \ \ \ \ |\ Price\ \ \ \ \ \ \ \ \ |\ Advantages\ \ \ \ \ \ \ \ \ |-+===============+===============+====================+-|\ Bananas\ \ \ \ \ \ \ |\ $1.34\ \ \ \ \ \ \ \ \ |\ \-\ built\-in\ wrapper\ |-|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \-\ bright\ color\ \ \ \ \ |-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+-|\ Oranges\ \ \ \ \ \ \ |\ $2.10\ \ \ \ \ \ \ \ \ |\ \-\ cures\ scurvy\ \ \ \ \ |-|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \-\ tasty\ \ \ \ \ \ \ \ \ \ \ \ |-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+-\f[]-.fi-.PP-The row of \f[C]=\f[]s separates the header from the table body, and can-be omitted for a headerless table.-The cells of grid tables may contain arbitrary block elements (multiple-paragraphs, code blocks, lists, etc.).-Alignments are not supported, nor are cells that span multiple columns-or rows.-Grid tables can be created easily using Emacs table mode.-.SS Extension: \f[C]pipe_tables\f[]-.PP-Pipe tables look like this:-.IP-.nf-\f[C]-|\ Right\ |\ Left\ |\ Default\ |\ Center\ |-|\-\-\-\-\-\-:|:\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|:\-\-\-\-\-\-:|-|\ \ \ 12\ \ |\ \ 12\ \ |\ \ \ \ 12\ \ \ |\ \ \ \ 12\ \ |-|\ \ 123\ \ |\ \ 123\ |\ \ \ 123\ \ \ |\ \ \ 123\ \ |-|\ \ \ \ 1\ \ |\ \ \ \ 1\ |\ \ \ \ \ 1\ \ \ |\ \ \ \ \ 1\ \ |--\ \ :\ Demonstration\ of\ pipe\ table\ syntax.-\f[]-.fi-.PP-The syntax is the same as in PHP markdown extra.-The beginning and ending pipe characters are optional, but pipes are-required between all columns.-The colons indicate column alignment as shown.-The header can be omitted, but the horizontal line must still be-included, as it defines column alignments.-.PP-Since the pipes indicate column boundaries, columns need not be-vertically aligned, as they are in the above example.-So, this is a perfectly legal (though ugly) pipe table:-.IP-.nf-\f[C]-fruit|\ price-\-\-\-\-\-|\-\-\-\-\-:-apple|2.05-pear|1.37-orange|3.09-\f[]-.fi-.PP-The cells of pipe tables cannot contain block elements like paragraphs-and lists, and cannot span multiple lines.-Note also that in LaTeX/PDF 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.-.PP-Note: Pandoc also recognizes pipe tables of the following form, as can-produced by Emacs\[aq] orgtbl\-mode:-.IP-.nf-\f[C]-|\ One\ |\ Two\ \ \ |-|\-\-\-\-\-+\-\-\-\-\-\-\-|-|\ my\ \ |\ table\ |-|\ is\ \ |\ nice\ \ |-\f[]-.fi-.PP-The difference is that \f[C]+\f[] is used instead of \f[C]|\f[].-Other orgtbl features are not supported.-In particular, to get non\-default column alignment, you\[aq]ll need to-add colons as above.-.SH METADATA BLOCKS-.SS Extension: \f[C]pandoc_title_block\f[]-.PP-If the file begins with a title block-.IP-.nf-\f[C]-%\ title-%\ author(s)\ (separated\ by\ semicolons)-%\ date-\f[]-.fi-.PP-it will be parsed as bibliographic information, not regular text.-(It will be used, for example, in the title of standalone LaTeX or HTML-output.) The block may contain just a title, a title and an author, or-all three elements.-If you want to include an author but no title, or a title and a date but-no author, you need a blank line:-.IP-.nf-\f[C]-%-%\ Author--%\ My\ title-%-%\ June\ 15,\ 2006-\f[]-.fi-.PP-The title may occupy multiple lines, but continuation lines must begin-with leading space, thus:-.IP-.nf-\f[C]-%\ My\ title-\ \ on\ multiple\ lines-\f[]-.fi-.PP-If a document has multiple authors, the authors may be put on separate-lines with leading space, or separated by semicolons, or both.-So, all of the following are equivalent:-.IP-.nf-\f[C]-%\ Author\ One-\ \ Author\ Two--%\ Author\ One;\ Author\ Two--%\ Author\ One;-\ \ Author\ Two-\f[]-.fi-.PP-The date must fit on one line.-.PP-All three metadata fields may contain standard inline formatting-(italics, links, footnotes, etc.).-.PP-Title blocks will always be parsed, but they will affect the output only-when the \f[C]\-\-standalone\f[] (\f[C]\-s\f[]) option is chosen.-In HTML output, titles will appear twice: once in the document head \-\--this is the title that will appear at the top of the window in a browser-\-\- and once at the beginning of the document body.-The title in the document head can have an optional prefix attached-(\f[C]\-\-title\-prefix\f[] or \f[C]\-T\f[] option).-The title in the body appears as an H1 element with class "title", so it-can be suppressed or reformatted with CSS.-If a title prefix is specified with \f[C]\-T\f[] and no title block-appears in the document, the title prefix will be used by itself as the-HTML title.-.PP-The man page writer extracts a title, man page section number, and other-header and footer information from the title line.-The title is assumed to be the first word on the title line, which may-optionally end with a (single\-digit) section number in parentheses.-(There should be no space between the title and the parentheses.)-Anything after this is assumed to be additional footer and header text.-A single pipe character (\f[C]|\f[]) should be used to separate the-footer text from the header text.-Thus,-.IP-.nf-\f[C]-%\ PANDOC(1)-\f[]-.fi-.PP-will yield a man page with the title \f[C]PANDOC\f[] and section 1.-.IP-.nf-\f[C]-%\ PANDOC(1)\ Pandoc\ User\ Manuals-\f[]-.fi-.PP-will also have "Pandoc User Manuals" in the footer.-.IP-.nf-\f[C]-%\ PANDOC(1)\ Pandoc\ User\ Manuals\ |\ Version\ 4.0-\f[]-.fi-.PP-will also have "Version 4.0" in the header.-.SS Extension: \f[C]yaml_metadata_block\f[]-.PP-A YAML metadata block is a valid YAML object, delimited by a line of-three hyphens (\f[C]\-\-\-\f[]) at the top and a line of three hyphens-(\f[C]\-\-\-\f[]) or three dots (\f[C]\&...\f[]) at the bottom.-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-files:-.IP-.nf-\f[C]-pandoc\ chap1.md\ chap2.md\ chap3.md\ metadata.yaml\ \-s\ \-o\ book.html-\f[]-.fi-.PP-Just be sure that the YAML file begins with \f[C]\-\-\-\f[] and ends-with \f[C]\-\-\-\f[] or \f[C]\&...\f[].)-.PP-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 with names ending in an underscore will be ignored by pandoc.-(They may be given a role by external processors.)-.PP-A document may contain multiple metadata blocks.-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-Note that YAML escaping rules must be followed.-Thus, for example, if a title contains a colon, it must be quoted.-The pipe character (\f[C]|\f[]) can be used to begin an indented block-that will be interpreted literally, without need for escaping.-This form is necessary when the field contains blank lines:-.IP-.nf-\f[C]-\-\-\--title:\ \ \[aq]This\ is\ the\ title:\ it\ contains\ a\ colon\[aq]-author:-\-\ name:\ Author\ One-\ \ affiliation:\ University\ of\ Somewhere-\-\ name:\ Author\ Two-\ \ affiliation:\ University\ of\ Nowhere-tags:\ [nothing,\ nothingness]-abstract:\ |-\ \ This\ is\ the\ abstract.--\ \ It\ consists\ of\ two\ paragraphs.-\&...-\f[]-.fi-.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[]-field:-.IP-.nf-\f[C]-<p>This\ is\ the\ abstract.</p>-<p>It\ consists\ of\ two\ paragraphs.</p>-\f[]-.fi-.PP-Note: The \f[C]author\f[] variable in the default templates expects a-simple list or string.-To use the structured authors in the example, you would need a custom-template.-For example:-.IP-.nf-\f[C]-$for(author)$-$if(author.name)$-$author.name$$if(author.affiliation)$\ ($author.affiliation$)$endif$-$else$-$author$-$endif$-$endfor$-\f[]-.fi-.SH BACKSLASH ESCAPES-.SS Extension: \f[C]all_symbols_escapable\f[]-.PP-Except inside a code block or inline code, any punctuation or space-character preceded by a backslash will be treated literally, even if it-would normally indicate formatting.-Thus, for example, if one writes-.IP-.nf-\f[C]-*\\*hello\\**-\f[]-.fi-.PP-one will get-.IP-.nf-\f[C]-<em>*hello*</em>-\f[]-.fi-.PP-instead of-.IP-.nf-\f[C]-<strong>hello</strong>-\f[]-.fi-.PP-This rule is easier to remember than standard markdown\[aq]s rule, which-allows only the following characters to be backslash\-escaped:-.IP-.nf-\f[C]-\\`*_{}[]()>#+\-.!-\f[]-.fi-.PP-(However, if the \f[C]markdown_strict\f[] format is used, the standard-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-\f[C]\\ \f[] or \f[C]\\ \f[].-.PP-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 \f[C]\\\\\f[] and in HTML as-\f[C]<br\ />\f[].-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.-.SH SMART PUNCTUATION-.SS Extension-.PP-If the \f[C]\-\-smart\f[] option is specified, pandoc will 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."-.PP-Note: if your LaTeX template uses the \f[C]csquotes\f[] package, pandoc-will detect automatically this and use \f[C]\\enquote{...}\f[] for-quoted text.-.SH INLINE FORMATTING-.SS Emphasis-.PP-To \f[I]emphasize\f[] some text, surround it with \f[C]*\f[]s or-\f[C]_\f[], like this:-.IP-.nf-\f[C]-This\ text\ is\ _emphasized\ with\ underscores_,\ and\ this-is\ *emphasized\ with\ asterisks*.-\f[]-.fi-.PP-Double \f[C]*\f[] or \f[C]_\f[] produces \f[B]strong emphasis\f[]:-.IP-.nf-\f[C]-This\ is\ **strong\ emphasis**\ and\ __with\ underscores__.-\f[]-.fi-.PP-A \f[C]*\f[] or \f[C]_\f[] character surrounded by spaces, or-backslash\-escaped, will not trigger emphasis:-.IP-.nf-\f[C]-This\ is\ *\ not\ emphasized\ *,\ and\ \\*neither\ is\ this\\*.-\f[]-.fi-.SS Extension: \f[C]intraword_underscores\f[]-.PP-Because \f[C]_\f[] is sometimes used inside words and identifiers,-pandoc does not interpret a \f[C]_\f[] surrounded by alphanumeric-characters as an emphasis marker.-If you want to emphasize just part of a word, use \f[C]*\f[]:-.IP-.nf-\f[C]-feas*ible*,\ not\ feas*able*.-\f[]-.fi-.SS Strikeout-.SS Extension: \f[C]strikeout\f[]-.PP-To strikeout a section of text with a horizontal line, begin and end it-with \f[C]~~\f[].-Thus, for example,-.IP-.nf-\f[C]-This\ ~~is\ deleted\ text.~~-\f[]-.fi-.SS Superscripts and subscripts-.SS Extension: \f[C]superscript\f[], \f[C]subscript\f[]-.PP-Superscripts may be written by surrounding the superscripted text by-\f[C]^\f[] characters; subscripts may be written by surrounding the-subscripted text by \f[C]~\f[] characters.-Thus, for example,-.IP-.nf-\f[C]-H~2~O\ is\ a\ liquid.\ \ 2^10^\ is\ 1024.-\f[]-.fi-.PP-If the superscripted or subscripted text contains spaces, these spaces-must be escaped with backslashes.-(This is to prevent accidental superscripting and subscripting through-the ordinary use of \f[C]~\f[] and \f[C]^\f[].) Thus, if you want the-letter P with \[aq]a cat\[aq] in subscripts, use \f[C]P~a\\\ cat~\f[],-not \f[C]P~a\ cat~\f[].-.SS Verbatim-.PP-To make a short span of text verbatim, put it inside backticks:-.IP-.nf-\f[C]-What\ is\ the\ difference\ between\ `>>=`\ and\ `>>`?-\f[]-.fi-.PP-If the verbatim text includes a backtick, use double backticks:-.IP-.nf-\f[C]-Here\ is\ a\ literal\ backtick\ ``\ `\ ``.-\f[]-.fi-.PP-(The spaces after the opening backticks and before the closing backticks-will be ignored.)-.PP-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-in verbatim contexts:-.IP-.nf-\f[C]-This\ is\ a\ backslash\ followed\ by\ an\ asterisk:\ `\\*`.-\f[]-.fi-.SS Extension: \f[C]inline_code_attributes\f[]-.PP-Attributes can be attached to verbatim text, just as with fenced code-blocks:-.IP-.nf-\f[C]-`<$>`{.haskell}-\f[]-.fi-.SS Small caps-.PP-To write small caps, you can use an HTML span tag:-.IP-.nf-\f[C]-<span\ style="font\-variant:small\-caps;">Small\ caps</span>-\f[]-.fi-.PP-(The semicolon is optional and there may be space after the colon.) This-will work in all output formats that support small caps.-.SH MATH-.SS Extension: \f[C]tex_math_dollars\f[]-.PP-Anything between two \f[C]$\f[] characters will be treated as TeX math.-The opening \f[C]$\f[] must have a character immediately to its right,-while the closing \f[C]$\f[] must have a character immediately to its-left.-Thus, \f[C]$20,000\ and\ $30,000\f[] won\[aq]t parse as math.-If for some reason you need to enclose text in literal \f[C]$\f[]-characters, backslash\-escape them and they won\[aq]t be treated as math-delimiters.-.PP-TeX math will be printed in all output formats.-How it is rendered depends on the output format:-.TP-.B Markdown, LaTeX, Org\-Mode, ConTeXt-It will appear verbatim between \f[C]$\f[] characters.-.RS-.RE-.TP-.B reStructuredText-It will be rendered using an interpreted text role \f[C]:math:\f[], as-described here.-.RS-.RE-.TP-.B AsciiDoc-It will be rendered as \f[C]latexmath:[...]\f[].-.RS-.RE-.TP-.B Texinfo-It will be rendered inside a \f[C]\@math\f[] command.-.RS-.RE-.TP-.B groff man-It will be rendered verbatim without \f[C]$\f[]\[aq]s.-.RS-.RE-.TP-.B MediaWiki, DokuWiki-It will be rendered inside \f[C]<math>\f[] tags.-.RS-.RE-.TP-.B Textile-It will be rendered inside \f[C]<span\ class="math">\f[] tags.-.RS-.RE-.TP-.B RTF, OpenDocument, ODT-It will be rendered, if possible, using unicode characters, and will-otherwise appear verbatim.-.RS-.RE-.TP-.B Docbook-If the \f[C]\-\-mathml\f[] flag is used, it will be rendered using-mathml in an \f[C]inlineequation\f[] or \f[C]informalequation\f[] tag.-Otherwise it will be rendered, if possible, using unicode characters.-.RS-.RE-.TP-.B Docx-It will be rendered using OMML math markup.-.RS-.RE-.TP-.B FictionBook2-If the \f[C]\-\-webtex\f[] option is used, formulas are rendered as-images using Google Charts or other compatible web service, downloaded-and embedded in the e\-book.-Otherwise, they will appear verbatim.-.RS-.RE-.TP-.B HTML, Slidy, DZSlides, S5, EPUB-The way math is rendered in HTML will depend on the command\-line-options selected:-.RS-.IP "1." 3-The default is to render TeX math as far as possible using unicode-characters, as with RTF, DocBook, and OpenDocument output.-Formulas are put inside a \f[C]span\f[] with \f[C]class="math"\f[], so-that they may be styled differently from the surrounding text if needed.-.IP "2." 3-If the \f[C]\-\-latexmathml\f[] option is used, TeX math will be-displayed between \f[C]$\f[] or \f[C]$$\f[] characters and put in-\f[C]<span>\f[] tags with class \f[C]LaTeX\f[].-The LaTeXMathML script will be used to render it as formulas.-(This trick does not work in all browsers, but it works in Firefox.-In browsers that do not support LaTeXMathML, TeX math will appear-verbatim between \f[C]$\f[] characters.)-.IP "3." 3-If the \f[C]\-\-jsmath\f[] option is used, TeX math will be put inside-\f[C]<span>\f[] tags (for inline math) or \f[C]<div>\f[] tags (for-display math) with class \f[C]math\f[].-The jsMath script will be used to render it.-.IP "4." 3-If the \f[C]\-\-mimetex\f[] option is used, the mimeTeX CGI script will-be called to generate images for each TeX formula.-This should work in all browsers.-The \f[C]\-\-mimetex\f[] option takes an optional URL as argument.-If no URL is specified, it will be assumed that the mimeTeX CGI script-is at \f[C]/cgi\-bin/mimetex.cgi\f[].-.IP "5." 3-If the \f[C]\-\-gladtex\f[] option is used, TeX formulas will be-enclosed in \f[C]<eq>\f[] tags in the HTML output.-The resulting \f[C]htex\f[] file may then be processed by gladTeX, which-will produce image files for each formula and an \f[C]html\f[] file with-links to these images.-So, the procedure is:-.RS 4-.IP-.nf-\f[C]-pandoc\ \-s\ \-\-gladtex\ myfile.txt\ \-o\ myfile.htex-gladtex\ \-d\ myfile\-images\ myfile.htex-#\ produces\ myfile.html\ and\ images\ in\ myfile\-images-\f[]-.fi-.RE-.IP "6." 3-If the \f[C]\-\-webtex\f[] option is used, TeX formulas will be-converted to \f[C]<img>\f[] tags that link to an external script that-converts formulas to images.-The formula will be URL\-encoded and concatenated with the URL provided.-If no URL is specified, the Google Chart API will be used-(\f[C]http://chart.apis.google.com/chart?cht=tx&chl=\f[]).-.IP "7." 3-If the \f[C]\-\-mathjax\f[] option is used, TeX math will be displayed-between \f[C]\\(...\\)\f[] (for inline math) or \f[C]\\[...\\]\f[] (for-display math) and put in \f[C]<span>\f[] tags with class \f[C]math\f[].-The MathJax script will be used to render it as formulas.-.RE-.SH RAW HTML-.SS Extension: \f[C]raw_html\f[]-.PP-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-it, but it has been made an extension so that it can be disabled if-desired.)-.PP-The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,-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-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-(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-.IP-.nf-\f[C]-<table>-\ <tr>-\ \ <td>*one*</td>-\ \ <td>[a\ link](http://google.com)</td>-\ </tr>-</table>-\f[]-.fi-.PP-into-.IP-.nf-\f[C]-<table>-\ <tr>-\ \ <td><em>one</em></td>-\ \ <td><a\ href="http://google.com">a\ link</a></td>-\ </tr>-</table>-\f[]-.fi-.PP-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.-.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-\f[C]<div>\f[] tags without preventing it from being interpreted as-markdown.-.SS Extension: \f[C]native_divs\f[]-.PP-Use native pandoc \f[C]Div\f[] blocks for content inside \f[C]<div>\f[]-tags.-For the most part this should give the same output as-\f[C]markdown_in_html_blocks\f[], but it makes it easier to write pandoc-filters to manipulate groups of blocks.-.SS Extension: \f[C]native_spans\f[]-.PP-Use native pandoc \f[C]Span\f[] blocks for content inside-\f[C]<span>\f[] tags.-For the most part this should give the same output as \f[C]raw_html\f[],-but it makes it easier to write pandoc filters to manipulate groups of-inlines.-.SH RAW TEX-.SS Extension: \f[C]raw_tex\f[]-.PP-In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be-included in a document.-Inline TeX commands will be preserved and passed unchanged to the LaTeX-and ConTeXt writers.-Thus, for example, you can use LaTeX to include BibTeX citations:-.IP-.nf-\f[C]-This\ result\ was\ proved\ in\ \\cite{jones.1967}.-\f[]-.fi-.PP-Note that in LaTeX environments, like-.IP-.nf-\f[C]-\\begin{tabular}{|l|l|}\\hline-Age\ &\ Frequency\ \\\\\ \\hline-18\-\-25\ \ &\ 15\ \\\\-26\-\-35\ \ &\ 33\ \\\\-36\-\-45\ \ &\ 22\ \\\\\ \\hline-\\end{tabular}-\f[]-.fi-.PP-the material between the begin and end tags will be interpreted as raw-LaTeX, not as markdown.-.PP-Inline LaTeX is ignored in output formats other than Markdown, LaTeX,-and ConTeXt.-.SH LATEX MACROS-.SS Extension: \f[C]latex_macros\f[]-.PP-For output formats other than LaTeX, pandoc will parse LaTeX-\f[C]\\newcommand\f[] and \f[C]\\renewcommand\f[] definitions and apply-the resulting macros to all LaTeX math.-So, for example, the following will work in all output formats, not just-LaTeX:-.PP-⟨\f[I]a\f[], \f[I]b\f[], \f[I]c\f[]⟩-.PP-In LaTeX output, the \f[C]\\newcommand\f[] definition will simply be-passed unchanged to the output.-.SH LINKS-.PP-Markdown allows links to be specified in several ways.-.SS Automatic links-.PP-If you enclose a URL or email address in pointy brackets, it will become-a link:-.IP-.nf-\f[C]-<http://google.com>-<sam\@green.eggs.ham>-\f[]-.fi-.SS Inline links-.PP-An inline link consists of the link text in square brackets, followed by-the URL in parentheses.-(Optionally, the URL can be followed by a link title, in quotes.)-.IP-.nf-\f[C]-This\ is\ an\ [inline\ link](/url),\ and\ here\[aq]s\ [one\ with-a\ title](http://fsf.org\ "click\ here\ for\ a\ good\ time!").-\f[]-.fi-.PP-There can be no space between the bracketed part and the parenthesized-part.-The link text can contain formatting (such as emphasis), but the title-cannot.-.SS Reference links-.PP-An \f[I]explicit\f[] reference link has two parts, the link itself and-the link definition, which may occur elsewhere in the document (either-before or after the link).-.PP-The link consists of link text in square brackets, followed by a label-in square brackets.-(There can be space between the two.) The link definition consists of-the bracketed label, followed by a colon and a space, followed by the-URL, and optionally (after a space) a link title either in quotes or in-parentheses.-.PP-Here are some examples:-.IP-.nf-\f[C]-[my\ label\ 1]:\ /foo/bar.html\ \ "My\ title,\ optional"-[my\ label\ 2]:\ /foo-[my\ label\ 3]:\ http://fsf.org\ (The\ free\ software\ foundation)-[my\ label\ 4]:\ /bar#special\ \ \[aq]A\ title\ in\ single\ quotes\[aq]-\f[]-.fi-.PP-The URL may optionally be surrounded by angle brackets:-.IP-.nf-\f[C]-[my\ label\ 5]:\ <http://foo.bar.baz>-\f[]-.fi-.PP-The title may go on the next line:-.IP-.nf-\f[C]-[my\ label\ 3]:\ http://fsf.org-\ \ "The\ free\ software\ foundation"-\f[]-.fi-.PP-Note that link labels are not case sensitive.-So, this will work:-.IP-.nf-\f[C]-Here\ is\ [my\ link][FOO]--[Foo]:\ /bar/baz-\f[]-.fi-.PP-In an \f[I]implicit\f[] reference link, the second pair of brackets is-empty, or omitted entirely:-.IP-.nf-\f[C]-See\ [my\ website][],\ or\ [my\ website].--[my\ website]:\ http://foo.bar.baz-\f[]-.fi-.PP-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.-So the following is fine in pandoc, though not in most other-implementations:-.IP-.nf-\f[C]->\ My\ block\ [quote].->->\ [quote]:\ /foo-\f[]-.fi-.SS Internal links-.PP-To link to another section of the same document, use the automatically-generated identifier (see Header identifiers in HTML, LaTeX, and-ConTeXt, below).-For example:-.IP-.nf-\f[C]-See\ the\ [Introduction](#introduction).-\f[]-.fi-.PP-or-.IP-.nf-\f[C]-See\ the\ [Introduction].--[Introduction]:\ #introduction-\f[]-.fi-.PP-Internal links are currently supported for HTML formats (including HTML-slide shows and EPUB), LaTeX, and ConTeXt.-.SH IMAGES-.PP-A link immediately preceded by a \f[C]!\f[] will be treated as an image.-The link text will be used as the image\[aq]s alt text:-.IP-.nf-\f[C]---![movie\ reel]--[movie\ reel]:\ movie.gif-\f[]-.fi-.SS Extension: \f[C]implicit_figures\f[]-.PP-An image occurring by itself in a paragraph will be rendered as a figure-with a caption.[4] (In LaTeX, a figure environment will be used; in-HTML, the image will be placed in a \f[C]div\f[] with class-\f[C]figure\f[], together with a caption in a \f[C]p\f[] with class-\f[C]caption\f[].) The image\[aq]s alt text will be used as the caption.-.IP-.nf-\f[C]--\f[]-.fi-.PP-If you just want a regular inline image, just make sure it is not the-only thing in the paragraph.-One way to do this is to insert a nonbreaking space after the image:-.IP-.nf-\f[C]-![This\ image\ won\[aq]t\ be\ a\ figure](/url/of/image.png)\\-\f[]-.fi-.SH FOOTNOTES-.SS Extension: \f[C]footnotes\f[]-.PP-Pandoc\[aq]s markdown allows footnotes, using the following syntax:-.IP-.nf-\f[C]-Here\ is\ a\ footnote\ reference,[^1]\ and\ another.[^longnote]--[^1]:\ Here\ is\ the\ footnote.--[^longnote]:\ Here\[aq]s\ one\ with\ multiple\ blocks.--\ \ \ \ Subsequent\ paragraphs\ are\ indented\ to\ show\ that\ they-belong\ to\ the\ previous\ footnote.--\ \ \ \ \ \ \ \ {\ some.code\ }--\ \ \ \ The\ whole\ paragraph\ can\ be\ indented,\ or\ just\ the\ first-\ \ \ \ line.\ \ In\ this\ way,\ multi\-paragraph\ footnotes\ work\ like-\ \ \ \ multi\-paragraph\ list\ items.--This\ paragraph\ won\[aq]t\ be\ part\ of\ the\ note,\ because\ it-isn\[aq]t\ indented.-\f[]-.fi-.PP-The identifiers in footnote references may not contain spaces, tabs, or-newlines.-These identifiers are used only to correlate the footnote reference with-the note itself; in the output, footnotes will be numbered sequentially.-.PP-The footnotes themselves need not be placed at the end of the document.-They may appear anywhere except inside other block elements (lists,-block quotes, tables, etc.).-.SS Extension: \f[C]inline_notes\f[]-.PP-Inline footnotes are also allowed (though, unlike regular notes, they-cannot contain multiple paragraphs).-The syntax is as follows:-.IP-.nf-\f[C]-Here\ is\ an\ inline\ note.^[Inlines\ notes\ are\ easier\ to\ write,\ since-you\ don\[aq]t\ have\ to\ pick\ an\ identifier\ and\ move\ down\ to\ type\ the-note.]-\f[]-.fi-.PP-Inline and regular footnotes may be mixed freely.-.SH CITATIONS-.SS Extension: \f[C]citations\f[]-.PP-Using an external filter, \f[C]pandoc\-citeproc\f[], pandoc can-automatically generate citations and a bibliography in a number of-styles.-Basic usage is-.IP-.nf-\f[C]-pandoc\ \-\-filter\ pandoc\-citeproc\ myinput.txt-\f[]-.fi-.PP-In order to use this feature, you will need to specify a bibliography-file using the \f[C]bibliography\f[] metadata field in a YAML metadata-section.-The bibliography may have any of these formats:-.PP-.TS-tab(@);-l l.-T{-Format-T}@T{-File extension-T}-_-T{-MODS-T}@T{-\&.mods-T}-T{-BibLaTeX-T}@T{-\&.bib-T}-T{-BibTeX-T}@T{-\&.bibtex-T}-T{-RIS-T}@T{-\&.ris-T}-T{-EndNote-T}@T{-\&.enl-T}-T{-EndNote XML-T}@T{-\&.xml-T}-T{-ISI-T}@T{-\&.wos-T}-T{-MEDLINE-T}@T{-\&.medline-T}-T{-Copac-T}@T{-\&.copac-T}-T{-JSON citeproc-T}@T{-\&.json-T}-.TE-.PP-Note that \f[C]\&.bib\f[] can generally be used with both BibTeX and-BibLaTeX files, but you can use \f[C]\&.bibtex\f[] to force BibTeX.-.PP-Alternatively you can use a \f[C]references\f[] field in the-document\[aq]s YAML metadata.-This should include an array of YAML\-encoded references, for example:-.IP-.nf-\f[C]-\-\-\--references:-\-\ id:\ fenner2012a-\ \ title:\ One\-click\ science\ marketing-\ \ author:-\ \ \-\ family:\ Fenner-\ \ \ \ given:\ Martin-\ \ container\-title:\ Nature\ Materials-\ \ volume:\ 11-\ \ URL:\ \[aq]http://dx.doi.org/10.1038/nmat3283\[aq]-\ \ DOI:\ 10.1038/nmat3283-\ \ issue:\ 4-\ \ publisher:\ Nature\ Publishing\ Group-\ \ page:\ 261\-263-\ \ type:\ article\-journal-\ \ issued:-\ \ \ \ year:\ 2012-\ \ \ \ month:\ 3-\&...-\f[]-.fi-.PP-(The program \f[C]mods2yaml\f[], which comes with-\f[C]pandoc\-citeproc\f[], can help produce these from a MODS reference-collection.)-.PP-By default, \f[C]pandoc\-citeproc\f[] will use a Chicago author\-date-format for citations and references.-To use another style, you will need to specify a CSL 1.0 style file in-the \f[C]csl\f[] metadata field.-A primer on creating and modifying CSL styles can be found at-http://citationstyles.org/downloads/primer.html.-A repository of CSL styles can be found at-https://github.com/citation\-style\-language/styles.-See also http://zotero.org/styles for easy browsing.-.PP-Citations go inside square brackets and are separated by semicolons.-Each citation must have a key, composed of \[aq]\@\[aq] + the citation-identifier from the database, and may optionally have a prefix, a-locator, and a suffix.-The citation key must begin with a letter or \f[C]_\f[], and may contain-alphanumerics, \f[C]_\f[], and internal punctuation characters-(\f[C]:.#$%&\-+?<>~/\f[]).-Here are some examples:-.IP-.nf-\f[C]-Blah\ blah\ [see\ \@doe99,\ pp.\ 33\-35;\ also\ \@smith04,\ ch.\ 1].--Blah\ blah\ [\@doe99,\ pp.\ 33\-35,\ 38\-39\ and\ *passim*].--Blah\ blah\ [\@smith04;\ \@doe99].-\f[]-.fi-.PP-A minus sign (\f[C]\-\f[]) before the \f[C]\@\f[] will suppress mention-of the author in the citation.-This can be useful when the author is already mentioned in the text:-.IP-.nf-\f[C]-Smith\ says\ blah\ [\-\@smith04].-\f[]-.fi-.PP-You can also write an in\-text citation, as follows:-.IP-.nf-\f[C]-\@smith04\ says\ blah.--\@smith04\ [p.\ 33]\ says\ blah.-\f[]-.fi-.PP-If the style calls for a list of works cited, it will be placed at the-end of the document.-Normally, you will want to end your document with an appropriate header:-.IP-.nf-\f[C]-last\ paragraph...--#\ References-\f[]-.fi-.PP-The bibliography will be inserted after this header.-Note that the \f[C]unnumbered\f[] class will be added to this header, so-that the section will not be numbered.-.PP-If you want to include items in the bibliography without actually citing-them in the body text, you can define a dummy \f[C]nocite\f[] metadata-field and put the citations there:-.IP-.nf-\f[C]-\-\-\--nocite:\ |-\ \ \@item1,\ \@item2-\&...--\@item3-\f[]-.fi-.PP-In this example, the document will contain a citation for \f[C]item3\f[]-only, but the bibliography will contain entries for \f[C]item1\f[],-\f[C]item2\f[], and \f[C]item3\f[].-.SH NON\-PANDOC EXTENSIONS-.PP-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-hard line breaks.-.SS Extension: \f[C]lists_without_preceding_blankline\f[]-.PP-Allow a list to occur right after a paragraph, with no intervening blank-space.-.SS Extension: \f[C]hard_line_breaks\f[]-.PP-Causes all newlines within a paragraph to be interpreted as hard line-breaks instead of spaces.-.SS Extension: \f[C]ignore_line_breaks\f[]-.PP-Causes newlines within a paragraph to be ignored, rather than being-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]tex_math_single_backslash\f[]-.PP-Causes anything between \f[C]\\(\f[] and \f[C]\\)\f[] to be interpreted-as inline TeX math, and anything between \f[C]\\[\f[] and \f[C]\\]\f[]-to be interpreted as display TeX math.-Note: a drawback of this extension is that it precludes escaping-\f[C](\f[] and \f[C][\f[].-.SS Extension: \f[C]tex_math_double_backslash\f[]-.PP-Causes anything between \f[C]\\\\(\f[] and \f[C]\\\\)\f[] to be-interpreted as inline TeX math, and anything between \f[C]\\\\[\f[] and-\f[C]\\\\]\f[] to be interpreted as display TeX math.-.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-inside block\-level tags if the tags have the attribute-\f[C]markdown=1\f[].-.SS Extension: \f[C]mmd_title_block\f[]-.PP-Enables a MultiMarkdown style title block at the top of the document,-for example:-.IP-.nf-\f[C]-Title:\ \ \ My\ title-Author:\ \ John\ Doe-Date:\ \ \ \ September\ 1,\ 2008-Comment:\ This\ is\ a\ sample\ mmd\ title\ block,\ with-\ \ \ \ \ \ \ \ \ a\ field\ spanning\ multiple\ lines.-\f[]-.fi-.PP-See the MultiMarkdown documentation for details.-If \f[C]pandoc_title_block\f[] or \f[C]yaml_metadata_block\f[] is-enabled, it will take precedence over \f[C]mmd_title_block\f[].-.SS Extension: \f[C]abbreviations\f[]-.PP-Parses PHP Markdown Extra abbreviation keys, like-.IP-.nf-\f[C]-*[HTML]:\ Hyper\ Text\ Markup\ Language-\f[]-.fi-.PP-Note that the pandoc document model does not support abbreviations, so-if this extension is enabled, abbreviation keys are simply skipped (as-opposed to being parsed as paragraphs).-.SS Extension: \f[C]autolink_bare_uris\f[]-.PP-Makes all absolute URIs into links, even when not surrounded by pointy-braces \f[C]<...>\f[].-.SS Extension: \f[C]ascii_identifiers\f[]-.PP-Causes the identifiers produced by \f[C]auto_identifiers\f[] to be pure-ASCII.-Accents are stripped off of accented latin letters, and non\-latin-letters are omitted.-.SS Extension: \f[C]link_attributes\f[]-.PP-Parses multimarkdown style key\-value attributes on link and image-references.-Note that pandoc\[aq]s internal document model provides nowhere to put-these, so they are presently just ignored.-.SS Extension: \f[C]mmd_header_identifiers\f[]-.PP-Parses multimarkdown style header identifiers (in square brackets, after-the header but before any trailing \f[C]#\f[]s in an ATX header).-.SS Extension: \f[C]compact_definition_lists\f[]-.PP-Activates the definition list syntax of pandoc 1.12.x and earlier.-This syntax differs from the one described above in several respects:-.IP \[bu] 2-No blank line is required between consecutive items of the definition-list.-.IP \[bu] 2-To get a "tight" or "compact" list, omit space between consecutive-items; the space between a term and its definition does not affect-anything.-.IP \[bu] 2-Lazy wrapping of paragraphs is not allowed: the entire definition must-be indented four spaces.[5]-.SH MARKDOWN VARIANTS-.PP-In addition to pandoc\[aq]s extended markdown, the following markdown-variants are supported:-.TP-.B \f[C]markdown_phpextra\f[] (PHP Markdown Extra)-\f[C]footnotes\f[], \f[C]pipe_tables\f[], \f[C]raw_html\f[],-\f[C]markdown_attribute\f[], \f[C]fenced_code_blocks\f[],-\f[C]definition_lists\f[], \f[C]intraword_underscores\f[],-\f[C]header_attributes\f[], \f[C]abbreviations\f[].-.RS-.RE-.TP-.B \f[C]markdown_github\f[] (Github\-flavored Markdown)-\f[C]pipe_tables\f[], \f[C]raw_html\f[],-\f[C]tex_math_single_backslash\f[], \f[C]fenced_code_blocks\f[],-\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[]-.RS-.RE-.TP-.B \f[C]markdown_mmd\f[] (MultiMarkdown)-\f[C]pipe_tables\f[] \f[C]raw_html\f[], \f[C]markdown_attribute\f[],-\f[C]link_attributes\f[], \f[C]raw_tex\f[],-\f[C]tex_math_double_backslash\f[], \f[C]intraword_underscores\f[],-\f[C]mmd_title_block\f[], \f[C]footnotes\f[], \f[C]definition_lists\f[],-\f[C]all_symbols_escapable\f[], \f[C]implicit_header_references\f[],-\f[C]auto_identifiers\f[], \f[C]mmd_header_identifiers\f[]-.RS-.RE-.TP-.B \f[C]markdown_strict\f[] (Markdown.pl)-\f[C]raw_html\f[]-.RS-.RE-.SH EXTENSIONS WITH FORMATS OTHER THAN MARKDOWN-.PP-Some of the extensions discussed above can be used with formats other-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).-.IP \[bu] 2-\f[C]tex_math_dollars\f[], \f[C]tex_math_single_backslash\f[], and-\f[C]tex_math_double_backslash\f[] can be used with \f[C]html\f[] input.-(This is handy for reading web pages formatted using MathJax, for-example.)-.SH NOTES-.SS [1]-.PP-The point of this rule is to ensure that normal paragraphs starting with-people\[aq]s initials, like-.IP-.nf-\f[C]-B.\ Russell\ was\ an\ English\ philosopher.-\f[]-.fi-.PP-do not get treated as list items.-.PP-This rule will not prevent-.IP-.nf-\f[C]-(C)\ 2007\ Joe\ Smith-\f[]-.fi-.PP-from being interpreted as a list item.-In this case, a backslash escape can be used:-.IP-.nf-\f[C]-(C\\)\ 2007\ Joe\ Smith-\f[]-.fi-.SS [2]-.PP-I have been influenced by the suggestions of David Wheeler.-.SS [3]-.PP-This scheme is due to Michel Fortin, who proposed it on the Markdown-discussion list.-.SS [4]-.PP-This feature is not yet implemented for RTF, OpenDocument, or ODT.-In those formats, you\[aq]ll just get an image in a paragraph by itself,-with no caption.-.SS [5]-.PP-To see why laziness is incompatible with relaxing the requirement of a-blank line between items, consider the following example:-.IP-.nf-\f[C]-bar-:\ \ \ \ definition-foo-:\ \ \ \ definition-\f[]-.fi-.PP-Is this a single list item with two definitions of "bar," the first of-which is lazily wrapped, or two list items?-To remove the ambiguity we must either disallow lazy wrapping or require-a blank line between list items.-.SH SEE ALSO-.PP-\f[C]pandoc\f[] (1).
@@ -1,11 +0,0 @@-$if(has-tables)$-.\"t-$endif$-.TH PANDOC_MARKDOWN 5 "$date$" "$version$"-.SH NAME-pandoc_markdown - markdown syntax for pandoc(1)-.SH DESCRIPTION-$body$-.SH SEE ALSO-.PP-\f[C]pandoc\f[] (1).
@@ -1,459 +1,933 @@-Name: pandoc-Version: 1.13.1-Cabal-Version: >= 1.10-Build-Type: Custom-License: GPL-License-File: COPYING-Copyright: (c) 2006-2014 John MacFarlane-Author: John MacFarlane <jgm@berkeley.edu>-Maintainer: John MacFarlane <jgm@berkeley.edu>-Bug-Reports: https://github.com/jgm/pandoc/issues-Stability: alpha-Homepage: http://johnmacfarlane.net/pandoc-Category: Text-Tested-With: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.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- this library. It can read markdown and (subsets of) HTML,- reStructuredText, LaTeX, DocBook, MediaWiki markup, Haddock- markup, OPML, Emacs Org-Mode, txt2tags and Textile, and it can write- markdown, reStructuredText, HTML, LaTeX, ConTeXt, Docbook,- OPML, OpenDocument, ODT, Word docx, RTF, MediaWiki, DokuWiki,- Textile, groff man pages, plain text, Emacs Org-Mode, AsciiDoc,- Haddock markup, EPUB (v2 and v3), FictionBook2,- InDesign ICML, and several kinds of HTML/javascript- slide shows (S5, Slidy, Slideous, DZSlides, reveal.js).- .- Pandoc extends standard markdown syntax with footnotes,- embedded LaTeX, definition lists, tables, and other- features. A compatibility mode is provided for those- who need a drop-in replacement for Markdown.pl.- .- In contrast to 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.-Data-Files:- -- templates- data/templates/default.html- data/templates/default.html5- data/templates/default.docbook- data/templates/default.beamer- data/templates/default.opendocument- data/templates/default.icml- data/templates/default.opml- data/templates/default.latex- data/templates/default.context- data/templates/default.texinfo- data/templates/default.man- data/templates/default.markdown- data/templates/default.rst- data/templates/default.plain- data/templates/default.mediawiki- data/templates/default.dokuwiki- data/templates/default.rtf- data/templates/default.s5- data/templates/default.slidy- data/templates/default.slideous- data/templates/default.revealjs- data/templates/default.dzslides- data/templates/default.asciidoc- data/templates/default.haddock- data/templates/default.textile- data/templates/default.org- data/templates/default.epub- data/templates/default.epub3- -- data for ODT writer- data/reference.odt- -- data for docx writer- data/reference.docx- -- stylesheet for EPUB writer- data/epub.css- -- data for LaTeXMathML writer- data/LaTeXMathML.js- data/MathMLinHTML.js- -- data for dzslides writer- data/dzslides/template.html- -- sample lua custom writer- data/sample.lua- -- documentation- README, COPYRIGHT-Extra-Source-Files:- -- documentation- INSTALL, BUGS, CONTRIBUTING.md, changelog- -- code to create pandoc.1 man page- Makefile- man/man1/pandoc.1.template- man/man5/pandoc_markdown.5.template- -- generated man pages (produced post-build)- man/man1/pandoc.1- man/man5/pandoc_markdown.5- -- trypandoc- trypandoc/Makefile- trypandoc/index.html- -- tests- tests/bodybg.gif- tests/*.native- tests/docbook-reader.docbook- tests/html-reader.html- tests/opml-reader.opml- tests/haddock-reader.haddock- tests/insert- tests/lalune.jpg- tests/movie.jpg- tests/latex-reader.latex- tests/textile-reader.textile- tests/markdown-reader-more.txt- tests/markdown-citations.txt- tests/textile-reader.textile- tests/mediawiki-reader.wiki- tests/rst-reader.rst- tests/s5-basic.html- tests/s5-fancy.html- tests/s5-fragment.html- tests/s5-inserts.html- tests/tables.context- tests/tables.docbook- tests/tables.dokuwiki- tests/tables.icml- tests/tables.html- tests/tables.latex- tests/tables.man- tests/tables.plain- tests/tables.markdown- tests/tables.mediawiki- tests/tables.textile- tests/tables.opendocument- tests/tables.org- tests/tables.asciidoc- tests/tables.haddock- tests/tables.texinfo- tests/tables.rst- tests/tables.rtf- tests/tables.txt- tests/tables.fb2- tests/testsuite.txt- tests/writer.latex- tests/writer.context- tests/writer.docbook- tests/writer.html- tests/writer.man- tests/writer.markdown- tests/writer.plain- tests/writer.mediawiki- tests/writer.textile- tests/writer.opendocument- tests/writer.org- tests/writer.asciidoc- tests/writer.haddock- tests/writer.rst- tests/writer.icml- tests/writer.rtf- tests/writer.texinfo- tests/writer.fb2- tests/writer.opml- tests/writer.dokuwiki- tests/dokuwiki_inline_formatting.dokuwiki- tests/lhs-test.markdown- tests/lhs-test.markdown+lhs- tests/lhs-test.rst- tests/lhs-test.rst+lhs- tests/lhs-test.latex- tests/lhs-test.latex+lhs- tests/lhs-test.html- tests/lhs-test.html+lhs- tests/lhs-test.fragment.html+lhs- tests/pipe-tables.txt- tests/dokuwiki_multiblock_table.dokuwiki- tests/dokuwiki_multiblock_table.native- tests/fb2/*.markdown- tests/fb2/*.fb2- tests/fb2/images-embedded.html- tests/fb2/images-embedded.fb2- tests/fb2/test-small.png- tests/fb2/test.jpg- tests/docx/*.docx- tests/docx/*.native- tests/epub/*.epub- tests/epub/*.native- tests/txt2tags.t2t--Source-repository head- type: git- location: git://github.com/jgm/pandoc.git--Flag embed_data_files- Description: Embed data files in binary for relocatable executable.- Default: False--Flag trypandoc- Description: Build trypandoc cgi executable.- Default: False--Flag https- Description: Enable support for downloading of resources over https.- Default: True--Flag make-pandoc-man-pages- Description: Build program to regenerate pandoc man pages from README.- Default: False--Flag network-uri- Description: Get Network.URI from the network-uri package- Default: True--Library- Build-Depends: base >= 4.2 && <5,- syb >= 0.1 && < 0.5,- containers >= 0.1 && < 0.6,- unordered-containers >= 0.2 && < 0.3,- array >= 0.3 && < 0.6,- parsec >= 3.1 && < 3.2,- mtl >= 1.1 && < 2.3,- filepath >= 1.1 && < 1.4,- process >= 1 && < 1.3,- directory >= 1 && < 1.3,- bytestring >= 0.9 && < 0.11,- text >= 0.11 && < 1.2,- zip-archive >= 0.2.3.4 && < 0.3,- old-locale >= 1 && < 1.1,- time >= 1.2 && < 1.5,- HTTP >= 4000.0.5 && < 4000.3,- texmath >= 0.8 && < 0.9,- xml >= 1.3.12 && < 1.4,- random >= 1 && < 1.1,- extensible-exceptions >= 0.1 && < 0.2,- pandoc-types >= 1.12.4 && < 1.13,- aeson >= 0.7 && < 0.9,- tagsoup >= 0.13.1 && < 0.14,- base64-bytestring >= 0.1 && < 1.1,- zlib >= 0.5 && < 0.6,- highlighting-kate >= 0.5.8.5 && < 0.6,- data-default >= 0.4 && < 0.6,- temporary >= 1.1 && < 1.3,- blaze-html >= 0.5 && < 0.8,- blaze-markup >= 0.5.1 && < 0.7,- yaml >= 0.8.8.2 && < 0.9,- scientific >= 0.2 && < 0.4,- vector >= 0.10 && < 0.11,- hslua >= 0.3 && < 0.4,- binary >= 0.5 && < 0.8,- SHA >= 1.6 && < 1.7,- haddock-library >= 1.1 && < 1.2,- old-time,- deepseq-generics >= 0.1 && < 0.2,- JuicyPixels >= 3.1.6.1 && < 3.2- if flag(network-uri)- Build-Depends: network-uri >= 2.6 && < 2.7, network >= 2.6- else- Build-Depends: network >= 2 && < 2.6- if flag(https)- Build-Depends: http-client >= 0.3.2 && < 0.4,- http-client-tls >= 0.2 && < 0.3,- http-types >= 0.8 && < 0.9- cpp-options: -DHTTP_CLIENT- if flag(embed_data_files)- cpp-options: -DEMBED_DATA_FILES- -- Build-Tools: hsb2hs -- not yet recognized by cabal- other-modules: Text.Pandoc.Data- if os(windows)- Cpp-options: -D_WINDOWS- Ghc-Options: -rtsopts -Wall -fno-warn-unused-do-bind- Ghc-Prof-Options: -auto-all -caf-all -rtsopts- Default-Language: Haskell98- Other-Extensions: PatternGuards, OverloadedStrings,- ScopedTypeVariables, GeneralizedNewtypeDeriving,- RelaxedPolyRec, DeriveDataTypeable, TypeSynonymInstances,- FlexibleInstances- Hs-Source-Dirs: src-- Exposed-Modules: Text.Pandoc,- Text.Pandoc.Options,- Text.Pandoc.Pretty,- Text.Pandoc.Shared,- Text.Pandoc.MediaBag,- Text.Pandoc.Readers.HTML,- Text.Pandoc.Readers.LaTeX,- Text.Pandoc.Readers.Markdown,- Text.Pandoc.Readers.MediaWiki,- Text.Pandoc.Readers.RST,- Text.Pandoc.Readers.Org,- Text.Pandoc.Readers.DocBook,- Text.Pandoc.Readers.OPML,- Text.Pandoc.Readers.TeXMath,- Text.Pandoc.Readers.Textile,- Text.Pandoc.Readers.Native,- Text.Pandoc.Readers.Haddock,- Text.Pandoc.Readers.Docx,- Text.Pandoc.Readers.EPUB,- Text.Pandoc.Writers.Native,- Text.Pandoc.Writers.Docbook,- Text.Pandoc.Writers.OPML,- Text.Pandoc.Writers.HTML,- Text.Pandoc.Writers.ICML,- Text.Pandoc.Writers.LaTeX,- Text.Pandoc.Writers.ConTeXt,- Text.Pandoc.Writers.OpenDocument,- Text.Pandoc.Writers.Texinfo,- Text.Pandoc.Writers.Man,- Text.Pandoc.Writers.Markdown,- Text.Pandoc.Writers.Haddock,- Text.Pandoc.Writers.RST,- Text.Pandoc.Writers.Org,- Text.Pandoc.Writers.AsciiDoc,- Text.Pandoc.Writers.Custom,- Text.Pandoc.Writers.Textile,- Text.Pandoc.Writers.MediaWiki,- Text.Pandoc.Writers.DokuWiki,- Text.Pandoc.Writers.RTF,- Text.Pandoc.Writers.ODT,- Text.Pandoc.Writers.Docx,- Text.Pandoc.Writers.EPUB,- Text.Pandoc.Writers.FB2,- Text.Pandoc.PDF,- Text.Pandoc.UTF8,- Text.Pandoc.Templates,- Text.Pandoc.XML,- Text.Pandoc.SelfContained,- Text.Pandoc.Process,- Text.Pandoc.Readers.Txt2Tags- Other-Modules: Text.Pandoc.Readers.Docx.Lists,- Text.Pandoc.Readers.Docx.Reducible,- Text.Pandoc.Readers.Docx.Parse,- Text.Pandoc.Readers.Docx.Fonts- Text.Pandoc.Writers.Shared,- Text.Pandoc.Asciify,- Text.Pandoc.MIME,- Text.Pandoc.Parsing,- Text.Pandoc.UUID,- Text.Pandoc.ImageSize,- Text.Pandoc.Slides,- Text.Pandoc.Highlighting,- Text.Pandoc.Compat.Monoid,- Text.Pandoc.Compat.Except,- Text.Pandoc.Compat.TagSoupEntity,- Text.Pandoc.Compat.Directory- Paths_pandoc-- Buildable: True--Executable pandoc- Build-Depends: pandoc,- pandoc-types >= 1.12.4 && < 1.13,- base >= 4.2 && <5,- directory >= 1 && < 1.3,- filepath >= 1.1 && < 1.4,- text >= 0.11 && < 1.2,- bytestring >= 0.9 && < 0.11,- extensible-exceptions >= 0.1 && < 0.2,- highlighting-kate >= 0.5.8.5 && < 0.6,- aeson >= 0.7.0.5 && < 0.9,- yaml >= 0.8.8.2 && < 0.9,- containers >= 0.1 && < 0.6,- HTTP >= 4000.0.5 && < 4000.3- if flag(network-uri)- Build-Depends: network-uri >= 2.6 && < 2.7- else- Build-Depends: network >= 2 && < 2.6- Ghc-Options: -rtsopts -with-rtsopts=-K16m -Wall -fno-warn-unused-do-bind- Ghc-Prof-Options: -auto-all -caf-all -rtsopts -with-rtsopts=-K16m- if os(windows)- Cpp-options: -D_WINDOWS- Default-Language: Haskell98- Other-Extensions: PatternGuards, OverloadedStrings,- ScopedTypeVariables, GeneralizedNewtypeDeriving,- RelaxedPolyRec, DeriveDataTypeable, TypeSynonymInstances,- FlexibleInstances- Hs-Source-Dirs: .- Main-Is: pandoc.hs- Buildable: True--Executable trypandoc- Main-Is: trypandoc.hs- Hs-Source-Dirs: trypandoc- default-language: Haskell2010- if flag(trypandoc)- Build-Depends: base, aeson, pandoc, highlighting-kate,- text, wai-extra, wai >= 0.3, http-types- Buildable: True- else- Buildable: False---- NOTE: A trick in Setup.hs makes sure this won't be installed:-Executable make-pandoc-man-pages- Main-Is: make-pandoc-man-pages.hs- Hs-Source-Dirs: man- Build-Depends: pandoc,- base >= 4.2 && < 5,- directory >= 1 && < 1.3,- filepath >= 1.1 && < 1.4,- old-time >= 1.0 && < 1.2,- time >= 1.2 && < 1.5- Default-Language: Haskell98- if flag(make-pandoc-man-pages)- Buildable: True- else- Buildable: False--Test-Suite test-pandoc- Type: exitcode-stdio-1.0- Main-Is: test-pandoc.hs- Hs-Source-Dirs: tests- Build-Depends: base >= 4.2 && < 5,- syb >= 0.1 && < 0.5,- pandoc,- pandoc-types >= 1.12.4 && < 1.13,- bytestring >= 0.9 && < 0.11,- text >= 0.11 && < 1.2,- directory >= 1 && < 1.3,- filepath >= 1.1 && < 1.4,- process >= 1 && < 1.3,- highlighting-kate >= 0.5.8.5 && < 0.6,- Diff >= 0.2 && < 0.4,- test-framework >= 0.3 && < 0.9,- test-framework-hunit >= 0.2 && < 0.4,- test-framework-quickcheck2 >= 0.2.9 && < 0.4,- QuickCheck >= 2.4 && < 2.8,- HUnit >= 1.2 && < 1.3,- containers >= 0.1 && < 0.6,- ansi-terminal >= 0.5 && < 0.7,- executable-path >= 0.0 && < 0.1,- zip-archive >= 0.2.3.4 && < 0.3- Other-Modules: Tests.Old- Tests.Helpers- Tests.Arbitrary- Tests.Shared- Tests.Walk- Tests.Readers.LaTeX- Tests.Readers.Markdown- Tests.Readers.Org- Tests.Readers.RST- Tests.Readers.Docx- Tests.Readers.Txt2Tags- Tests.Readers.EPUB- Tests.Writers.Native- Tests.Writers.ConTeXt- Tests.Writers.Docbook- Tests.Writers.HTML- Tests.Writers.Markdown- Tests.Writers.Plain- Tests.Writers.AsciiDoc- Tests.Writers.LaTeX- Ghc-Options: -rtsopts -Wall -fno-warn-unused-do-bind- Default-Language: Haskell98--benchmark benchmark-pandoc- Type: exitcode-stdio-1.0- Main-Is: benchmark-pandoc.hs- Hs-Source-Dirs: benchmark- Build-Depends: pandoc,- base >= 4.2 && < 5,- syb >= 0.1 && < 0.5,- criterion >= 0.5 && < 0.9- Ghc-Options: -rtsopts -Wall -fno-warn-unused-do-bind- Default-Language: Haskell98+cabal-version: 2.4+name: pandoc+version: 3.10+build-type: Simple+license: GPL-2.0-or-later+license-file: COPYING.md+copyright: (c) 2006-2024 John MacFarlane+author: John MacFarlane <jgm@berkeley.edu>+maintainer: John MacFarlane <jgm@berkeley.edu>+bug-reports: https://github.com/jgm/pandoc/issues+stability: alpha+homepage: https://pandoc.org+category: Text+tested-with: GHC == 9.6.7, GHC == 9.8.4, GHC == 9.10.3, GHC == 9.12.2+synopsis: Conversion between markup formats+description: Pandoc is a Haskell library for converting from one markup+ format to another. The formats it can handle include+ .+ - light markup formats (many variants of Markdown,+ reStructuredText, AsciiDoc, Org-mode, Muse, Textile,+ txt2tags, djot)+ - HTML formats (HTML 4 and 5)+ - Ebook formats (EPUB v2 and v3, FB2)+ - Documentation formats (GNU TexInfo, Haddock, Vimdoc)+ - Roff formats (man, ms)+ - TeX formats (LaTeX, ConTeXt)+ - Typst+ - XML formats (DocBook 4 and 5, JATS, TEI Simple, OpenDocument)+ - Outline formats (OPML)+ - Bibliography formats (BibTeX, BibLaTeX, CSL JSON, CSL YAML,+ RIS)+ - Word processor formats (Docx, RTF, ODT)+ - Interactive notebook formats (Jupyter notebook ipynb)+ - Page layout formats (InDesign ICML)+ - Wiki markup formats (MediaWiki, DokuWiki, TikiWiki, TWiki,+ Vimwiki, XWiki, ZimWiki, Jira wiki, Creole)+ - Slide show formats (LaTeX Beamer, PowerPoint, Slidy,+ reveal.js, Slideous, S5, DZSlides)+ - Data formats (CSV and TSV tables, Excel spreadsheets)+ - PDF (via external programs such as pdflatex or wkhtmltopdf)+ .+ Pandoc can convert mathematical content in documents+ between TeX, MathML, Word equations, roff eqn, typst,+ and plain text. It includes a powerful system for automatic+ citations and bibliographies, and it can be customized+ extensively using templates, filters, and custom readers+ and writers written in Lua.+ .+ For the pandoc command-line program, see the+ @pandoc-cli@ package.+data-files:+ -- templates+ data/templates/styles.html+ data/templates/styles.citations.html+ data/templates/default.html4+ data/templates/default.html5+ data/templates/default.chunkedhtml+ data/templates/default.djot+ data/templates/default.docbook4+ data/templates/default.docbook5+ data/templates/default.jats_archiving+ data/templates/default.jats_articleauthoring+ data/templates/default.jats_publishing+ data/templates/default.tei+ data/templates/default.opendocument+ data/templates/default.openxml+ data/templates/default.icml+ data/templates/default.opml+ data/templates/default.beamer+ data/templates/default.latex+ data/templates/default.bibtex+ data/templates/default.biblatex+ data/templates/default.context+ data/templates/default.texinfo+ data/templates/default.jira+ data/templates/default.man+ data/templates/default.ms+ data/templates/default.markdown+ data/templates/default.muse+ data/templates/default.commonmark+ data/templates/default.rst+ data/templates/default.plain+ data/templates/default.mediawiki+ data/templates/default.dokuwiki+ data/templates/default.xwiki+ data/templates/default.zimwiki+ data/templates/default.rtf+ data/templates/default.s5+ data/templates/default.slidy+ data/templates/default.slideous+ data/templates/default.revealjs+ data/templates/default.dzslides+ data/templates/default.asciidoc+ data/templates/default.haddock+ data/templates/default.textile+ data/templates/default.org+ data/templates/default.epub2+ data/templates/default.epub3+ data/templates/default.ansi+ data/templates/article.jats_publishing+ data/templates/affiliations.jats+ data/templates/default.markua+ data/templates/default.typst+ data/templates/document-metadata.latex+ data/templates/template.typst+ data/templates/common.latex+ data/templates/hypersetup.latex+ data/templates/passoptions.latex+ data/templates/fonts.latex+ data/templates/font-settings.latex+ data/templates/after-header-includes.latex+ data/templates/default.vimdoc+ data/templates/default.bbcode++ -- translations+ data/translations/*.yaml+ -- entities+ data/docbook-entities.txt+ -- source files for reference.docx+ data/docx/[Content_Types].xml+ data/docx/_rels/.rels+ data/docx/docProps/app.xml+ data/docx/docProps/core.xml+ data/docx/docProps/custom.xml+ data/docx/word/document.xml+ data/docx/word/fontTable.xml+ data/docx/word/comments.xml+ data/docx/word/footnotes.xml+ data/docx/word/numbering.xml+ data/docx/word/settings.xml+ data/docx/word/webSettings.xml+ data/docx/word/styles.xml+ data/docx/word/_rels/document.xml.rels+ data/docx/word/_rels/footnotes.xml.rels+ data/docx/word/theme/theme1.xml+ -- source files for reference.odt+ data/odt/mimetype+ data/odt/manifest.rdf+ data/odt/styles.xml+ data/odt/content.xml+ data/odt/meta.xml+ data/odt/META-INF/manifest.xml+ -- source files for reference.pptx+ data/pptx/_rels/.rels+ data/pptx/docProps/app.xml+ data/pptx/docProps/core.xml+ data/pptx/ppt/slideLayouts/_rels/slideLayout1.xml.rels+ data/pptx/ppt/slideLayouts/_rels/slideLayout2.xml.rels+ data/pptx/ppt/slideLayouts/_rels/slideLayout3.xml.rels+ data/pptx/ppt/slideLayouts/_rels/slideLayout4.xml.rels+ data/pptx/ppt/slideLayouts/_rels/slideLayout5.xml.rels+ data/pptx/ppt/slideLayouts/_rels/slideLayout6.xml.rels+ data/pptx/ppt/slideLayouts/_rels/slideLayout7.xml.rels+ data/pptx/ppt/slideLayouts/_rels/slideLayout8.xml.rels+ data/pptx/ppt/slideLayouts/_rels/slideLayout9.xml.rels+ data/pptx/ppt/slideLayouts/_rels/slideLayout10.xml.rels+ data/pptx/ppt/slideLayouts/_rels/slideLayout11.xml.rels+ data/pptx/ppt/slideLayouts/slideLayout1.xml+ data/pptx/ppt/slideLayouts/slideLayout2.xml+ data/pptx/ppt/slideLayouts/slideLayout3.xml+ data/pptx/ppt/slideLayouts/slideLayout4.xml+ data/pptx/ppt/slideLayouts/slideLayout5.xml+ data/pptx/ppt/slideLayouts/slideLayout6.xml+ data/pptx/ppt/slideLayouts/slideLayout7.xml+ data/pptx/ppt/slideLayouts/slideLayout8.xml+ data/pptx/ppt/slideLayouts/slideLayout9.xml+ data/pptx/ppt/slideLayouts/slideLayout10.xml+ data/pptx/ppt/slideLayouts/slideLayout11.xml+ data/pptx/ppt/_rels/presentation.xml.rels+ data/pptx/ppt/theme/theme1.xml+ data/pptx/ppt/presProps.xml+ data/pptx/ppt/slides/_rels/slide1.xml.rels+ data/pptx/ppt/slides/_rels/slide2.xml.rels+ data/pptx/ppt/slides/slide2.xml+ data/pptx/ppt/slides/slide1.xml+ data/pptx/ppt/slides/_rels/slide3.xml.rels+ data/pptx/ppt/slides/_rels/slide4.xml.rels+ data/pptx/ppt/slides/slide3.xml+ data/pptx/ppt/slides/slide4.xml+ data/pptx/ppt/viewProps.xml+ data/pptx/ppt/tableStyles.xml+ data/pptx/ppt/slideMasters/_rels/slideMaster1.xml.rels+ data/pptx/ppt/slideMasters/slideMaster1.xml+ data/pptx/ppt/presentation.xml+ data/pptx/ppt/notesMasters/_rels/notesMaster1.xml.rels+ data/pptx/ppt/notesMasters/notesMaster1.xml+ data/pptx/ppt/notesSlides/_rels/notesSlide1.xml.rels+ data/pptx/ppt/notesSlides/notesSlide1.xml+ data/pptx/ppt/notesSlides/_rels/notesSlide2.xml.rels+ data/pptx/ppt/notesSlides/notesSlide2.xml+ data/pptx/ppt/theme/theme2.xml+ data/pptx/[Content_Types].xml+ -- stylesheet for EPUB writer+ data/epub.css+ -- data for dzslides writer+ data/dzslides/template.html+ -- default abbreviations file+ data/abbreviations+ -- sample lua custom reader+ data/creole.lua+ -- lua init script+ data/init.lua+ -- bash completion template+ data/bash_completion.tpl+ -- citeproc+ data/default.csl+ citeproc/biblatex-localization/*.lbx.strings+ -- documentation+ MANUAL.txt, COPYRIGHT+extra-doc-files: changelog.md,+ AUTHORS.md,+ INSTALL.md,+ README.md,+ CONTRIBUTING.md,+ BUGS+extra-source-files:+ -- tests+ test/bodybg.gif+ test/*.native+ test/command/*.md+ test/command/*.csl+ test/command/*.svg+ test/command/7691.docx+ test/command/9391.docx+ test/command/9358.docx+ test/command/9002.docx+ test/command/9603.docx+ test/command/11113.docx+ test/command/biblio.bib+ test/command/averroes.bib+ test/command/A.txt+ test/command/B.txt+ test/command/C.txt+ test/command/D.txt+ test/command/file1.txt+ test/command/file2.txt+ test/command/three.txt+ test/command/11090/ch1.typ+ test/command/01.csv+ test/command/chap1/spider.png+ test/command/chap2/spider.png+ test/command/chap1/text.md+ test/command/chap2/text.md+ test/command/defaults1.yaml+ test/command/defaults2.yaml+ test/command/defaults3.yaml+ test/command/defaults4.yaml+ test/command/defaults5.yaml+ test/command/defaults6.yaml+ test/command/defaults7.yaml+ test/command/defaults8.yaml+ test/command/defaults9.yaml+ test/command/8024a.yaml+ test/command/8024b.yaml+ test/command/3533-rst-csv-tables.csv+ test/command/3880.txt+ test/command/5182.txt+ test/command/5700-metadata-file-1.yml+ test/command/5700-metadata-file-2.yml+ test/command/abbrevs+ test/command/sub-file-chapter-1.tex+ test/command/sub-file-chapter-2.tex+ test/command/bar.tex+ test/command/bar-endinput.tex+ test/command/yaml-metadata.yaml+ test/command/7813-meta.yaml+ test/command/3510-subdoc.org+ test/command/3510-export.latex+ test/command/3510-src.hs+ test/command/3971b.tex+ test/command/5876.yaml+ test/command/5876/metadata/5876.yaml+ test/command/5876/metadata/command/5876.yaml+ test/command/6466-beg.hs+ test/command/6466-end.hs+ test/command/6466-mid.hs+ test/command/6466-whole.hs+ test/command/7861.yaml+ test/command/7861/metadata/placeholder+ test/command/11486/scroll.revealjs+ test/command/11498.png+ test/asciidoc-reader.adoc+ test/asciidoc-reader.native+ test/asciidoc-reader-include.rb+ test/asciidoc-reader-include.adoc+ test/docbook-chapter.docbook+ test/docbook-reader.docbook+ test/docbook-xref.docbook+ test/endnotexml-reader.xml+ test/html-reader.html+ test/opml-reader.opml+ test/org-select-tags.org+ test/haddock-reader.haddock+ test/insert+ test/lalune.jpg+ test/man-reader.man+ test/movie.jpg+ test/media/rId25.jpg+ test/media/rId26.jpg+ test/media/rId27.jpg+ test/typst-reader.typ+ test/undergradmath.typ+ test/djot-reader.djot+ test/latex-reader.latex+ test/textile-reader.textile+ test/markdown-reader-more.txt+ test/markdown-citations.txt+ test/textile-reader.textile+ test/mediawiki-reader.wiki+ test/vimwiki-reader.wiki+ test/creole-reader.txt+ test/rst-reader.rst+ test/jats-reader.xml+ test/jira-reader.jira+ test/s5-basic.html+ test/s5-fancy.html+ test/s5-fragment.html+ test/s5-inserts.html+ test/tables.context+ test/tables.docbook4+ test/tables.docbook5+ test/tables.jats_archiving+ test/tables.jats_articleauthoring+ test/tables.jats_publishing+ test/tables.jira+ test/tables.djot+ test/tables.dokuwiki+ test/tables.zimwiki+ test/tables.icml+ test/tables.html4+ test/tables.html5+ test/tables.latex+ test/tables.man+ test/tables.ms+ test/tables.plain+ test/tables.markdown+ test/tables.markua+ test/tables.mediawiki+ test/tables.tei+ test/tables.textile+ test/tables.opendocument+ test/tables.org+ test/tables.asciidoc+ test/tables.asciidoc_legacy+ test/tables.haddock+ test/tables.texinfo+ test/tables.typst+ test/tables.rst+ test/tables.rtf+ test/tables.txt+ test/tables.fb2+ test/tables.muse+ test/tables.vimdoc+ test/tables.bbcode+ test/tables.xwiki+ test/tables/*.html4+ test/tables/*.html5+ test/tables/*.latex+ test/tables/*.typst+ test/tables/*.native+ test/tables/*.mediawiki+ test/tables/*.jats_archiving+ test/tables/*.markdown+ test/testsuite.txt+ test/ansi-test.txt+ test/writer.latex+ test/writer.context+ test/writer.djot+ test/writer.docbook4+ test/writer.docbook5+ test/writer.jats_archiving+ test/writer.jats_articleauthoring+ test/writer.jats_publishing+ test/writer.jira+ test/writer.html4+ test/writer.html5+ test/writer.man+ test/writer.ms+ test/writer.markdown+ test/writer.markua+ test/writer.plain+ test/writer.mediawiki+ test/writer.textile+ test/writer.typst+ test/writer.opendocument+ test/writer.org+ test/writer.asciidoc+ test/writer.asciidoc_legacy+ test/writer.haddock+ test/writer.rst+ test/writer.icml+ test/writer.rtf+ test/writer.tei+ test/writer.texinfo+ test/writer.fb2+ test/writer.opml+ test/writer.dokuwiki+ test/writer.zimwiki+ test/writer.xwiki+ test/writer.muse+ test/writer.vimdoc+ test/writer.bbcode+ test/ansi-test.ansi+ test/writers-lang-and-dir.latex+ test/writers-lang-and-dir.context+ test/dokuwiki_inline_formatting.dokuwiki+ test/lhs-test.markdown+ test/lhs-test.markdown+lhs+ test/lhs-test.rst+ test/lhs-test.rst+lhs+ test/lhs-test.latex+ test/lhs-test.latex+lhs+ test/lhs-test.html+ test/lhs-test.html+lhs+ test/lhs-test.fragment.html+lhs+ test/pipe-tables.txt+ test/dokuwiki_external_images.dokuwiki+ test/dokuwiki_multiblock_table.dokuwiki+ test/fb2/*.markdown+ test/fb2/*.fb2+ test/fb2/images-embedded.html+ test/fb2/images-embedded.fb2+ test/fb2/test-small.png+ test/fb2/reader/*.fb2+ test/fb2/reader/*.native+ test/fb2/test.jpg+ test/docx/*.docx+ test/docx/golden/*.docx+ test/docx/*.native+ test/epub/*.epub+ test/epub/*.native+ test/rtf/*.native+ test/rtf/*.rtf+ test/pptx/*.pptx+ test/pptx/**/*.pptx+ test/pptx/**/*.native+ test/pptx-reader/basic.pptx+ test/pptx-reader/basic.native+ test/ipynb/*.native+ test/ipynb/*.in.native+ test/ipynb/*.out.native+ test/ipynb/*.ipynb+ test/ipynb/*.out.ipynb+ test/ipynb/*.out.html+ test/txt2tags.t2t+ test/twiki-reader.twiki+ test/tikiwiki-reader.tikiwiki+ test/odt/odt/*.odt+ test/odt/markdown/*.md+ test/odt/native/*.native+ test/xlsx-reader/*.xlsx+ test/xlsx-reader/*.native+ test/pod-reader.pod+ test/vimdoc/*.markdown+ test/vimdoc/*.vimdoc+source-repository head+ type: git+ location: https://github.com/jgm/pandoc.git++flag embed_data_files+ Description: Embed data files in binary for relocatable executable.+ Default: False++flag http+ Description: Support for fetching resources using HTTP.+ Default: True++common common-options+ default-language: Haskell2010+ build-depends: base >= 4.18 && < 5+ ghc-options: -Wall -fno-warn-unused-do-bind+ -Wincomplete-record-updates+ -Wnoncanonical-monad-instances+ -Wcpp-undef+ -Wincomplete-uni-patterns+ -Widentities+ -Wpartial-fields+ -Wmissing-signatures+ -fhide-source-paths+ -Wmissing-export-lists+ -Wunused-packages+ -Winvalid-haddock++ if impl(ghc >= 9.12)+ ghc-options: -Wno-deriving-typeable++ if os(windows)+ cpp-options: -D_WINDOWS++common common-executable+ import: common-options+ build-depends: pandoc+ ghc-options: -rtsopts -with-rtsopts=-A8m -threaded++library xml-light+ import: common-options+ build-depends: xml >= 1.3.12 && < 1.4,+ xml-conduit >= 1.9.1.1 && < 1.11,+ xml-types >= 0.3 && < 0.4,+ containers >= 0.6.0.1 && < 0.9,+ text >= 1.1.1.0 && < 2.2++ hs-source-dirs: xml-light+ exposed-modules: Text.Pandoc.XML.Light,+ Text.Pandoc.XML.Light.Types,+ Text.Pandoc.XML.Light.Proc,+ Text.Pandoc.XML.Light.Output++library+ import: common-options+ build-depends: xml-light,+ Glob >= 0.7 && < 0.11,+ JuicyPixels >= 3.1.6.1 && < 3.4,+ aeson >= 2.0.1.0 && < 2.4,+ aeson-pretty >= 0.8.9 && < 0.9,+ array >= 0.5 && < 0.6,+ attoparsec >= 0.12 && < 0.15,+ base64-bytestring >= 0.1 && < 1.3,+ binary >= 0.7 && < 0.11,+ blaze-html >= 0.9 && < 0.10,+ blaze-markup >= 0.8 && < 0.9,+ bytestring >= 0.9 && < 0.13,+ case-insensitive >= 1.2 && < 1.3,+ citeproc >= 0.13.0.1 && < 0.14,+ commonmark >= 0.3 && < 0.4,+ commonmark-extensions >= 0.2.7 && < 0.3,+ commonmark-pandoc >= 0.3 && < 0.4,+ containers >= 0.6.0.1 && < 0.9,+ crypton >= 0.30 && < 1.2,+ data-default >= 0.4 && < 0.9,+ deepseq >= 1.3 && < 1.6,+ directory >= 1.2.3 && < 1.4,+ doclayout >= 0.5.0.1 && < 0.6,+ doctemplates >= 0.11 && < 0.12,+ emojis >= 0.1.4.1 && < 0.2,+ exceptions >= 0.8 && < 0.11,+ file-embed >= 0.0 && < 0.1,+ filepath >= 1.1 && < 1.6,+ gridtables >= 0.1 && < 0.2,+ haddock-library >= 1.10 && < 1.12,+ http-types >= 0.8 && < 0.13,+ ipynb >= 0.2 && < 0.3,+ jira-wiki-markup >= 1.5.1 && < 1.6,+ mime-types >= 0.1.1 && < 0.2,+ mtl >= 2.2 && < 2.4,+ network-uri >= 2.6 && < 2.8,+ pandoc-types >= 1.23.1 && < 1.24,+ parsec >= 3.1 && < 3.2,+ pretty >= 1.1 && < 1.2,+ pretty-show >= 1.10 && < 1.11,+ process >= 1.2.3 && < 1.7,+ random >= 1.2 && < 1.4,+ safe >= 0.3.18 && < 0.4,+ scientific >= 0.3 && < 0.4,+ skylighting >= 0.14.7 && < 0.15,+ skylighting-core >= 0.14.7 && < 0.15,+ split >= 0.2 && < 0.3,+ syb >= 0.1 && < 0.8,+ tagsoup >= 0.14.6 && < 0.15,+ temporary >= 1.1 && < 1.4,+ texmath >= 0.13.1.2 && < 0.14,+ text >= 1.1.1.0 && < 2.2,+ text-conversions >= 0.3 && < 0.4,+ time >= 1.5 && < 1.17,+ unicode-collation >= 0.1.1 && < 0.2,+ unicode-data >= 0.6 && < 0.9,+ unicode-transforms >= 0.3 && < 0.5,+ yaml >= 0.11 && < 0.12,+ libyaml >= 0.1.4 && < 0.2,+ zip-archive >= 0.4.3.1 && < 0.5,+ zlib >= 0.5 && < 0.8,+ xml >= 1.3.12 && < 1.4,+ typst >= 0.10 && < 0.11,+ vector >= 0.12 && < 0.14,+ djot >= 0.1.4 && < 0.2,+ asciidoc >= 0.1.0.3 && < 0.2++ if !os(windows)+ build-depends: unix >= 2.4 && < 2.9+ if flag(embed_data_files)+ cpp-options: -DEMBED_DATA_FILES+ other-modules: Text.Pandoc.Data.BakedIn+ if flag(http)+ cpp-options: -DPANDOC_HTTP_SUPPORT+ build-depends:+ crypton-connection >= 0.3.1 && < 0.5,+ crypton-x509-system >= 1.6.7 && < 1.10,+ http-client >= 0.4.30 && < 0.8,+ http-client-tls >= 0.2.4 && < 0.5,+ network >= 2.6 && < 3.3,+ tls >= 2.0.1 && < 2.5+ hs-source-dirs: src++ exposed-modules: Text.Pandoc,+ Text.Pandoc.App,+ Text.Pandoc.Data,+ Text.Pandoc.Options,+ Text.Pandoc.Extensions,+ Text.Pandoc.Format,+ Text.Pandoc.Shared,+ Text.Pandoc.Sources,+ Text.Pandoc.MediaBag,+ Text.Pandoc.Error,+ Text.Pandoc.Filter,+ Text.Pandoc.Translations,+ Text.Pandoc.Translations.Types,+ Text.Pandoc.Readers,+ Text.Pandoc.Readers.AsciiDoc,+ Text.Pandoc.Readers.HTML,+ Text.Pandoc.Readers.LaTeX,+ Text.Pandoc.Readers.Markdown,+ Text.Pandoc.Readers.CommonMark,+ Text.Pandoc.Readers.Creole,+ Text.Pandoc.Readers.BibTeX,+ Text.Pandoc.Readers.EndNote,+ Text.Pandoc.Readers.RIS,+ Text.Pandoc.Readers.CslJson,+ Text.Pandoc.Readers.MediaWiki,+ Text.Pandoc.Readers.Vimwiki,+ Text.Pandoc.Readers.RST,+ Text.Pandoc.Readers.Org,+ Text.Pandoc.Readers.DocBook,+ Text.Pandoc.Readers.JATS,+ Text.Pandoc.Readers.Jira,+ Text.Pandoc.Readers.OPML,+ Text.Pandoc.Readers.Textile,+ Text.Pandoc.Readers.Native,+ Text.Pandoc.Readers.Haddock,+ Text.Pandoc.Readers.TWiki,+ Text.Pandoc.Readers.TikiWiki,+ Text.Pandoc.Readers.Txt2Tags,+ Text.Pandoc.Readers.Docx,+ Text.Pandoc.Readers.Pptx,+ Text.Pandoc.Readers.Xlsx,+ Text.Pandoc.Readers.ODT,+ Text.Pandoc.Readers.EPUB,+ Text.Pandoc.Readers.Muse,+ Text.Pandoc.Readers.Man,+ Text.Pandoc.Readers.Mdoc,+ Text.Pandoc.Readers.FB2,+ Text.Pandoc.Readers.DokuWiki,+ Text.Pandoc.Readers.Ipynb,+ Text.Pandoc.Readers.CSV,+ Text.Pandoc.Readers.RTF,+ Text.Pandoc.Readers.Typst,+ Text.Pandoc.Readers.Djot,+ Text.Pandoc.Readers.Pod,+ Text.Pandoc.Writers,+ Text.Pandoc.Writers.Native,+ Text.Pandoc.Writers.XML,+ Text.Pandoc.Writers.DocBook,+ Text.Pandoc.Writers.JATS,+ Text.Pandoc.Writers.OPML,+ Text.Pandoc.Writers.HTML,+ Text.Pandoc.Writers.ChunkedHTML,+ Text.Pandoc.Writers.Ipynb,+ Text.Pandoc.Writers.ICML,+ Text.Pandoc.Writers.Jira,+ Text.Pandoc.Writers.LaTeX,+ Text.Pandoc.Writers.ConTeXt,+ Text.Pandoc.Writers.Djot,+ Text.Pandoc.Writers.Typst,+ Text.Pandoc.Writers.OpenDocument,+ Text.Pandoc.Writers.Texinfo,+ Text.Pandoc.Writers.Man,+ Text.Pandoc.Writers.Ms,+ Text.Pandoc.Writers.Markdown,+ Text.Pandoc.Writers.CommonMark,+ Text.Pandoc.Writers.Haddock,+ Text.Pandoc.Writers.RST,+ Text.Pandoc.Writers.Org,+ Text.Pandoc.Writers.AsciiDoc,+ Text.Pandoc.Writers.Textile,+ Text.Pandoc.Writers.MediaWiki,+ Text.Pandoc.Writers.DokuWiki,+ Text.Pandoc.Writers.XWiki,+ Text.Pandoc.Writers.ZimWiki,+ Text.Pandoc.Writers.RTF,+ Text.Pandoc.Writers.ODT,+ Text.Pandoc.Writers.Docx,+ Text.Pandoc.Writers.Powerpoint,+ Text.Pandoc.Writers.EPUB,+ Text.Pandoc.Writers.FB2,+ Text.Pandoc.Writers.TEI,+ Text.Pandoc.Writers.Muse,+ Text.Pandoc.Writers.CslJson,+ Text.Pandoc.Writers.Math,+ Text.Pandoc.Writers.Shared,+ Text.Pandoc.Writers.OOXML,+ Text.Pandoc.Writers.AnnotatedTable,+ Text.Pandoc.Writers.BibTeX,+ Text.Pandoc.Writers.ANSI,+ Text.Pandoc.Writers.Vimdoc,+ Text.Pandoc.Writers.BBCode,+ Text.Pandoc.PDF,+ Text.Pandoc.UTF8,+ Text.Pandoc.Scripting,+ Text.Pandoc.Slides,+ Text.Pandoc.Templates,+ Text.Pandoc.XML,+ Text.Pandoc.SelfContained,+ Text.Pandoc.Highlighting,+ Text.Pandoc.Logging,+ Text.Pandoc.Process,+ Text.Pandoc.MIME,+ Text.Pandoc.Parsing,+ Text.Pandoc.Asciify,+ Text.Pandoc.Emoji,+ Text.Pandoc.ImageSize,+ Text.Pandoc.Class,+ Text.Pandoc.Class.IO,+ Text.Pandoc.Citeproc,+ Text.Pandoc.Chunks,+ Text.Pandoc.Transforms,+ Text.Pandoc.Version+ other-modules: Text.Pandoc.App.CommandLineOptions,+ Text.Pandoc.App.Input,+ Text.Pandoc.App.Opt,+ Text.Pandoc.App.OutputSettings,+ Text.Pandoc.Class.CommonState,+ Text.Pandoc.Class.PandocMonad,+ Text.Pandoc.Class.PandocIO,+ Text.Pandoc.Class.PandocPure,+ Text.Pandoc.Class.Sandbox,+ Text.Pandoc.Filter.Environment,+ Text.Pandoc.Filter.JSON,+ Text.Pandoc.Parsing.Capabilities,+ Text.Pandoc.Parsing.Citations,+ Text.Pandoc.Parsing.General,+ Text.Pandoc.Parsing.GridTable,+ Text.Pandoc.Parsing.Lists,+ Text.Pandoc.Parsing.Math,+ Text.Pandoc.Parsing.Smart,+ Text.Pandoc.Parsing.State,+ Text.Pandoc.Parsing.Future,+ Text.Pandoc.Readers.Docx.Lists,+ Text.Pandoc.Readers.Docx.Combine,+ Text.Pandoc.Readers.Docx.Parse,+ Text.Pandoc.Readers.Docx.Parse.Styles,+ Text.Pandoc.Readers.Docx.Util,+ Text.Pandoc.Readers.Docx.Symbols,+ Text.Pandoc.Readers.Docx.Fields,+ Text.Pandoc.Readers.OOXML.Shared,+ Text.Pandoc.Readers.Pptx.Parse,+ Text.Pandoc.Readers.Pptx.Shapes,+ Text.Pandoc.Readers.Pptx.Slides,+ Text.Pandoc.Readers.Pptx.SmartArt,+ Text.Pandoc.Readers.Xlsx.Parse,+ Text.Pandoc.Readers.Xlsx.Cells,+ Text.Pandoc.Readers.Xlsx.Sheets,+ Text.Pandoc.Readers.HTML.Parsing,+ Text.Pandoc.Readers.HTML.Table,+ Text.Pandoc.Readers.HTML.TagCategories,+ Text.Pandoc.Readers.HTML.Types,+ Text.Pandoc.Readers.LaTeX.Inline,+ Text.Pandoc.Readers.LaTeX.Citation,+ Text.Pandoc.Readers.LaTeX.Lang,+ Text.Pandoc.Readers.LaTeX.Macro,+ Text.Pandoc.Readers.LaTeX.Math,+ Text.Pandoc.Readers.LaTeX.Parsing,+ Text.Pandoc.Readers.LaTeX.SIunitx,+ Text.Pandoc.Readers.LaTeX.Table,+ Text.Pandoc.Readers.Mdoc.Lex,+ Text.Pandoc.Readers.Mdoc.Macros,+ Text.Pandoc.Readers.Mdoc.Standards,+ Text.Pandoc.Readers.Typst.Parsing,+ Text.Pandoc.Readers.Typst.Math,+ Text.Pandoc.Readers.ODT.Base,+ Text.Pandoc.Readers.ODT.Namespaces,+ Text.Pandoc.Readers.ODT.StyleReader,+ Text.Pandoc.Readers.ODT.ContentReader,+ Text.Pandoc.Readers.ODT.Generic.Fallible,+ Text.Pandoc.Readers.ODT.Generic.SetMap,+ Text.Pandoc.Readers.ODT.Generic.Utils,+ Text.Pandoc.Readers.ODT.Generic.Namespaces,+ Text.Pandoc.Readers.ODT.Generic.XMLConverter,+ Text.Pandoc.Readers.ODT.Arrows.State,+ Text.Pandoc.Readers.ODT.Arrows.Utils,+ Text.Pandoc.Readers.Org.BlockStarts,+ Text.Pandoc.Readers.Org.Blocks,+ Text.Pandoc.Readers.Org.DocumentTree,+ Text.Pandoc.Readers.Org.ExportSettings,+ Text.Pandoc.Readers.Org.Inlines,+ Text.Pandoc.Readers.Org.Meta,+ Text.Pandoc.Readers.Org.ParserState,+ Text.Pandoc.Readers.Org.Parsing,+ Text.Pandoc.Readers.Org.Shared,+ Text.Pandoc.Readers.Metadata,+ Text.Pandoc.Readers.Roff,+ Text.Pandoc.Readers.Roff.Escape,+ Text.Pandoc.Readers.XML,+ Text.Pandoc.Writers.Docx.OpenXML,+ Text.Pandoc.Writers.Docx.StyleMap,+ Text.Pandoc.Writers.Docx.Table,+ Text.Pandoc.Writers.Docx.Types,+ Text.Pandoc.Writers.GridTable+ Text.Pandoc.Writers.JATS.References,+ Text.Pandoc.Writers.JATS.Table,+ Text.Pandoc.Writers.JATS.Types,+ Text.Pandoc.Writers.LaTeX.Caption,+ Text.Pandoc.Writers.LaTeX.Notes,+ Text.Pandoc.Writers.LaTeX.Table,+ Text.Pandoc.Writers.LaTeX.Lang,+ Text.Pandoc.Writers.LaTeX.Types,+ Text.Pandoc.Writers.LaTeX.Citation,+ Text.Pandoc.Writers.LaTeX.Util,+ Text.Pandoc.Writers.Markdown.Table,+ Text.Pandoc.Writers.Markdown.Types,+ Text.Pandoc.Writers.Markdown.Inline,+ Text.Pandoc.Writers.Roff,+ Text.Pandoc.Writers.Blaze,+ Text.Pandoc.Writers.Powerpoint.Presentation,+ Text.Pandoc.Writers.Powerpoint.Output,+ Text.Pandoc.Char,+ Text.Pandoc.TeX,+ Text.Pandoc.URI,+ Text.Pandoc.XMLFormat,+ Text.Pandoc.CSS,+ Text.Pandoc.CSV,+ Text.Pandoc.RoffChar,+ Text.Pandoc.UUID,+ Text.Pandoc.Image,+ Text.Pandoc.Citeproc.BibTeX,+ Text.Pandoc.Citeproc.Name,+ Text.Pandoc.Citeproc.CslJson,+ Text.Pandoc.Citeproc.Data,+ Text.Pandoc.Citeproc.Locator,+ Text.Pandoc.Citeproc.MetaValue,+ Text.Pandoc.Citeproc.Util,+ Paths_pandoc+ autogen-modules: Paths_pandoc+ buildable: True++test-suite test-pandoc+ import: common-executable+ type: exitcode-stdio-1.0+ main-is: test-pandoc.hs+ hs-source-dirs: test+ build-depends: pandoc,+ Diff >= 0.2 && < 1.1,+ Glob >= 0.7 && < 0.11,+ bytestring >= 0.9 && < 0.13,+ containers >= 0.4.2.1 && < 0.9,+ directory >= 1.2.3 && < 1.4,+ doctemplates >= 0.11 && < 0.12,+ filepath >= 1.1 && < 1.6,+ mtl >= 2.2 && < 2.4,+ pandoc-types >= 1.23.1 && < 1.24,+ process >= 1.2.3 && < 1.7,+ tasty >= 0.11 && < 1.6,+ tasty-golden >= 2.3 && < 2.4,+ tasty-hunit >= 0.9 && < 0.11,+ tasty-quickcheck >= 0.8 && < 0.12,+ text >= 1.1.1.0 && < 2.2,+ temporary >= 1.1 && < 1.4,+ time >= 1.5 && < 1.17,+ xml >= 1.3.12 && < 1.4,+ zip-archive >= 0.4.3 && < 0.5+ other-modules: Tests.Old+ Tests.Command+ Tests.Helpers+ Tests.Shared+ Tests.MediaBag+ Tests.XML+ Tests.Readers.LaTeX+ Tests.Readers.HTML+ Tests.Readers.JATS+ Tests.Readers.Jira+ Tests.Readers.Markdown+ Tests.Readers.Org+ Tests.Readers.Org.Block+ Tests.Readers.Org.Block.CodeBlock+ Tests.Readers.Org.Block.Figure+ Tests.Readers.Org.Block.Header+ Tests.Readers.Org.Block.List+ Tests.Readers.Org.Block.Table+ Tests.Readers.Org.Directive+ Tests.Readers.Org.Inline+ Tests.Readers.Org.Inline.Citation+ Tests.Readers.Org.Inline.Note+ Tests.Readers.Org.Inline.Smart+ Tests.Readers.Org.Meta+ Tests.Readers.Org.Shared+ Tests.Readers.RST+ Tests.Readers.RTF+ Tests.Readers.Docx+ Tests.Readers.Pptx+ Tests.Readers.Xlsx+ Tests.Readers.ODT+ Tests.Readers.Txt2Tags+ Tests.Readers.EPUB+ Tests.Readers.Muse+ Tests.Readers.Creole+ Tests.Readers.Man+ Tests.Readers.Mdoc+ Tests.Readers.FB2+ Tests.Readers.Pod+ Tests.Readers.DokuWiki+ Tests.Writers.Native+ Tests.Writers.ConTeXt+ Tests.Writers.DocBook+ Tests.Writers.HTML+ Tests.Writers.JATS+ Tests.Writers.Jira+ Tests.Writers.Markdown+ Tests.Writers.Org+ Tests.Writers.Plain+ Tests.Writers.AsciiDoc+ Tests.Writers.LaTeX+ Tests.Writers.Docx+ Tests.Writers.RST+ Tests.Writers.TEI+ Tests.Writers.Markua+ Tests.Writers.Muse+ Tests.Writers.FB2+ Tests.Writers.Powerpoint+ Tests.Writers.OOXML+ Tests.Writers.Ms+ Tests.Writers.AnnotatedTable+ Tests.Writers.BBCode++benchmark benchmark-pandoc+ import: common-executable+ type: exitcode-stdio-1.0+ main-is: benchmark-pandoc.hs+ hs-source-dirs: benchmark+ build-depends: bytestring,+ tasty-bench >= 0.4 && <= 0.5,+ mtl >= 2.2 && < 2.4,+ text >= 1.1.1.0 && < 2.2,+ deepseq+ -- we increase heap size to avoid benchmarking garbage collection:+ ghc-options: -rtsopts -with-rtsopts=-A8m -threaded
@@ -1,1314 +0,0 @@-{-# LANGUAGE CPP, TupleSections #-}-{--Copyright (C) 2006-2014 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 : Main- Copyright : Copyright (C) 2006-2014 John MacFarlane- License : GNU GPL, version 2 or above-- Maintainer : John MacFarlane <jgm@berkeley@edu>- Stability : alpha- Portability : portable--Parses command-line options and calls the appropriate readers and-writers.--}-module Main where-import Text.Pandoc-import Text.Pandoc.Builder (setMeta)-import Text.Pandoc.PDF (makePDF)-import Text.Pandoc.Walk (walk)-import Text.Pandoc.Readers.LaTeX (handleIncludes)-import Text.Pandoc.Shared ( tabFilter, readDataFileUTF8, readDataFile,- safeRead, headerShift, normalize, err, warn,- openURL )-import Text.Pandoc.MediaBag ( mediaDirectory, extractMediaBag, MediaBag )-import Text.Pandoc.XML ( toEntities )-import Text.Pandoc.SelfContained ( makeSelfContained )-import Text.Pandoc.Process (pipeProcess)-import Text.Highlighting.Kate ( languages, Style, tango, pygments,- espresso, zenburn, kate, haddock, monochrome )-import System.Environment ( getArgs, getProgName )-import System.Exit ( exitWith, ExitCode (..) )-import System.FilePath-import System.Console.GetOpt-import Data.Char ( toLower )-import Data.List ( intercalate, isPrefixOf, isSuffixOf, sort )-import System.Directory ( getAppUserDataDirectory, findExecutable,- doesFileExist, Permissions(..), getPermissions )-import System.IO ( stdout, stderr )-import System.IO.Error ( isDoesNotExistError )-import qualified Control.Exception as E-import Control.Exception.Extensible ( throwIO )-import qualified Text.Pandoc.UTF8 as UTF8-import Control.Monad (when, unless, (>=>))-import Data.Maybe (isJust)-import Data.Foldable (foldrM)-import Network.URI (parseURI, isURI, URI(..))-import qualified Data.ByteString.Lazy as B-import qualified Data.ByteString as BS-import Data.Aeson (eitherDecode', encode)-import qualified Data.Map as M-import Data.Yaml (decode)-import qualified Data.Yaml as Yaml-import qualified Data.Text as T-import Control.Applicative ((<$>))-import Text.Pandoc.Readers.Txt2Tags (getT2TMeta)-import Data.Monoid--type Transform = Pandoc -> Pandoc--copyrightMessage :: String-copyrightMessage = intercalate "\n" [- "",- "Copyright (C) 2006-2014 John MacFarlane",- "Web: http://johnmacfarlane.net/pandoc",- "This is free software; see the source for copying conditions.",- "There is no warranty, not even for merchantability or fitness",- "for a particular purpose." ]--compileInfo :: String-compileInfo =- "\nCompiled with texmath " ++- VERSION_texmath ++ ", highlighting-kate " ++ VERSION_highlighting_kate ++- ".\nSyntax highlighting is supported for the following languages:\n " ++- wrapWords 4 78- [map toLower l | l <- languages, l /= "Alert" && l /= "Alert_indent"]---- | Converts a list of strings into a single string with the items printed as--- comma separated words in lines with a maximum line length.-wrapWords :: Int -> Int -> [String] -> String-wrapWords indent c = wrap' (c - indent) (c - indent)- where- wrap' _ _ [] = ""- wrap' cols remaining (x:xs)- | remaining == cols =- x ++ wrap' cols (remaining - length x) xs- | (length x + 1) > remaining =- ",\n" ++ replicate indent ' ' ++ x ++- wrap' cols (cols - length x) xs- | otherwise =- ", " ++ x ++- wrap' cols (remaining - length x - 2) xs--isTextFormat :: String -> Bool-isTextFormat s = takeWhile (`notElem` "+-") s `notElem` binaries- where binaries = ["odt","docx","epub","epub3"]--externalFilter :: FilePath -> [String] -> Pandoc -> IO Pandoc-externalFilter f args' d = do- mbexe <- if '/' `elem` f- -- don't check PATH if filter name has a path- then return Nothing- -- we catch isDoesNotExistError because this will- -- be triggered if PATH not set:- else E.catch (findExecutable f)- (\e -> if isDoesNotExistError e- then return Nothing- else throwIO e)- (f', args'') <- case mbexe of- Just x -> return (x, args')- Nothing -> do- exists <- doesFileExist f- if exists- then do- isExecutable <- executable `fmap`- getPermissions f- return $- case map toLower $ takeExtension f of- _ | isExecutable -> (f, args')- ".py" -> ("python", f:args')- ".hs" -> ("runhaskell", f:args')- ".pl" -> ("perl", f:args')- ".rb" -> ("ruby", f:args')- ".php" -> ("php", f:args')- _ -> (f, args')- else err 85 $ "Filter " ++ f ++ " not found"- (exitcode, outbs, errbs) <- E.handle filterException $- pipeProcess Nothing f' args'' $ encode d- when (not $ B.null errbs) $ B.hPutStr stderr errbs- case exitcode of- ExitSuccess -> return $ either error id $ eitherDecode' outbs- ExitFailure _ -> err 83 $ "Error running filter " ++ f- where filterException :: E.SomeException -> IO a- filterException e = err 83 $ "Error running filter " ++ f ++ "\n" ++- show e---- | Data structure for command line options.-data Opt = Opt- { optTabStop :: Int -- ^ Number of spaces per tab- , optPreserveTabs :: Bool -- ^ Preserve tabs instead of converting to spaces- , optStandalone :: Bool -- ^ Include header, footer- , optReader :: String -- ^ Reader format- , optWriter :: String -- ^ Writer format- , optParseRaw :: Bool -- ^ Parse unconvertable HTML and TeX- , optTableOfContents :: Bool -- ^ Include table of contents- , optTransforms :: [Transform] -- ^ Doc transforms to apply- , optTemplate :: Maybe FilePath -- ^ Custom template- , optVariables :: [(String,String)] -- ^ Template variables to set- , optMetadata :: M.Map String MetaValue -- ^ Metadata fields to set- , optOutputFile :: String -- ^ Name of output file- , optNumberSections :: Bool -- ^ Number sections in LaTeX- , optNumberOffset :: [Int] -- ^ Starting number for sections- , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML- , optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5- , optSelfContained :: Bool -- ^ Make HTML accessible offline- , optSmart :: Bool -- ^ Use smart typography- , optOldDashes :: Bool -- ^ Parse dashes like pandoc <=1.8.2.1- , optHtml5 :: Bool -- ^ Produce HTML5 in HTML- , optHtmlQTags :: Bool -- ^ Use <q> tags in HTML- , optHighlight :: Bool -- ^ Highlight source code- , optHighlightStyle :: Style -- ^ Style to use for highlighted code- , optChapters :: Bool -- ^ Use chapter for top-level sects- , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math- , optReferenceODT :: Maybe FilePath -- ^ Path of reference.odt- , optReferenceDocx :: Maybe FilePath -- ^ Path of reference.docx- , optEpubStylesheet :: Maybe String -- ^ EPUB stylesheet- , optEpubMetadata :: String -- ^ EPUB metadata- , optEpubFonts :: [FilePath] -- ^ EPUB fonts to embed- , optEpubChapterLevel :: Int -- ^ Header level at which to split chapters- , optTOCDepth :: Int -- ^ Number of levels to include in TOC- , optDumpArgs :: Bool -- ^ Output command-line arguments- , optIgnoreArgs :: Bool -- ^ Ignore command-line arguments- , optReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst- , optWrapText :: Bool -- ^ Wrap text- , optColumns :: Int -- ^ Line length in characters- , optFilters :: [FilePath] -- ^ Filters to apply- , optEmailObfuscation :: ObfuscationMethod- , optIdentifierPrefix :: String- , optIndentedCodeClasses :: [String] -- ^ Default classes for indented code blocks- , optDataDir :: Maybe FilePath- , optCiteMethod :: CiteMethod -- ^ Method to output cites- , optListings :: Bool -- ^ Use listings package for code blocks- , optLaTeXEngine :: String -- ^ Program to use for latex -> pdf- , optSlideLevel :: Maybe Int -- ^ Header level that creates slides- , optSetextHeaders :: Bool -- ^ Use atx headers for markdown level 1-2- , optAscii :: Bool -- ^ Use ascii characters only in html- , optTeXLigatures :: Bool -- ^ Use TeX ligatures for quotes/dashes- , optDefaultImageExtension :: String -- ^ Default image extension- , optExtractMedia :: Maybe FilePath -- ^ Path to extract embedded media- , optTrace :: Bool -- ^ Print debug information- , optTrackChanges :: TrackChanges -- ^ Accept or reject MS Word track-changes.- }---- | Defaults for command-line options.-defaultOpts :: Opt-defaultOpts = Opt- { optTabStop = 4- , optPreserveTabs = False- , optStandalone = False- , optReader = "" -- null for default reader- , optWriter = "" -- null for default writer- , optParseRaw = False- , optTableOfContents = False- , optTransforms = []- , optTemplate = Nothing- , optVariables = []- , optMetadata = M.empty- , optOutputFile = "-" -- "-" means stdout- , optNumberSections = False- , optNumberOffset = [0,0,0,0,0,0]- , optSectionDivs = False- , optIncremental = False- , optSelfContained = False- , optSmart = False- , optOldDashes = False- , optHtml5 = False- , optHtmlQTags = False- , optHighlight = True- , optHighlightStyle = pygments- , optChapters = False- , optHTMLMathMethod = PlainMath- , optReferenceODT = Nothing- , optReferenceDocx = Nothing- , optEpubStylesheet = Nothing- , optEpubMetadata = ""- , optEpubFonts = []- , optEpubChapterLevel = 1- , optTOCDepth = 3- , optDumpArgs = False- , optIgnoreArgs = False- , optReferenceLinks = False- , optWrapText = True- , optColumns = 72- , optFilters = []- , optEmailObfuscation = JavascriptObfuscation- , optIdentifierPrefix = ""- , optIndentedCodeClasses = []- , optDataDir = Nothing- , optCiteMethod = Citeproc- , optListings = False- , optLaTeXEngine = "pdflatex"- , optSlideLevel = Nothing- , optSetextHeaders = True- , optAscii = False- , optTeXLigatures = True- , optDefaultImageExtension = ""- , optExtractMedia = Nothing- , optTrace = False- , optTrackChanges = AcceptChanges- }---- | A list of functions, each transforming the options data structure--- in response to a command-line option.-options :: [OptDescr (Opt -> IO Opt)]-options =- [ Option "fr" ["from","read"]- (ReqArg- (\arg opt -> return opt { optReader = arg })- "FORMAT")- ""-- , Option "tw" ["to","write"]- (ReqArg- (\arg opt -> return opt { optWriter = arg })- "FORMAT")- ""-- , Option "o" ["output"]- (ReqArg- (\arg opt -> return opt { optOutputFile = arg })- "FILENAME")- "" -- "Name of output file"-- , Option "" ["data-dir"]- (ReqArg- (\arg opt -> return opt { optDataDir = Just arg })- "DIRECTORY") -- "Directory containing pandoc data files."- ""-- , Option "" ["strict"]- (NoArg- (\opt -> do- err 59 $ "The --strict option has been removed.\n" ++- "Use `markdown_strict' input or output format instead."- return opt ))- "" -- "Disable markdown syntax extensions"-- , Option "R" ["parse-raw"]- (NoArg- (\opt -> return opt { optParseRaw = True }))- "" -- "Parse untranslatable HTML codes and LaTeX environments as raw"-- , Option "S" ["smart"]- (NoArg- (\opt -> return opt { optSmart = True }))- "" -- "Use smart quotes, dashes, and ellipses"-- , Option "" ["old-dashes"]- (NoArg- (\opt -> return opt { optSmart = True- , optOldDashes = True }))- "" -- "Use smart quotes, dashes, and ellipses"-- , Option "" ["base-header-level"]- (ReqArg- (\arg opt ->- case safeRead arg of- Just t | t > 0 -> do- let oldTransforms = optTransforms opt- let shift = t - 1- return opt{ optTransforms =- headerShift shift : oldTransforms }- _ -> err 19- "base-header-level must be a number > 0")- "NUMBER")- "" -- "Headers base level"-- , Option "" ["indented-code-classes"]- (ReqArg- (\arg opt -> return opt { optIndentedCodeClasses = words $- map (\c -> if c == ',' then ' ' else c) arg })- "STRING")- "" -- "Classes (whitespace- or comma-separated) to use for indented code-blocks"-- , Option "F" ["filter"]- (ReqArg- (\arg opt -> return opt { optFilters = arg : optFilters opt })- "PROGRAM")- "" -- "External JSON filter"-- , Option "" ["normalize"]- (NoArg- (\opt -> return opt { optTransforms =- normalize : optTransforms opt } ))- "" -- "Normalize the Pandoc AST"-- , Option "p" ["preserve-tabs"]- (NoArg- (\opt -> return opt { optPreserveTabs = True }))- "" -- "Preserve tabs instead of converting to spaces"-- , Option "" ["tab-stop"]- (ReqArg- (\arg opt ->- case safeRead arg of- Just t | t > 0 -> return opt { optTabStop = t }- _ -> err 31- "tab-stop must be a number greater than 0")- "NUMBER")- "" -- "Tab stop (default 4)"-- , Option "" ["track-changes"]- (ReqArg- (\arg opt -> do- action <- case arg of- "accept" -> return AcceptChanges- "reject" -> return RejectChanges- "all" -> return AllChanges- _ -> err 6- ("Unknown option for track-changes: " ++ arg)- return opt { optTrackChanges = action })- "accept|reject|all")- "" -- "Accepting or reject MS Word track-changes.""-- , Option "" ["extract-media"]- (ReqArg- (\arg opt -> do- return opt { optExtractMedia = Just arg })- "PATH")- "" -- "Directory to which to extract embedded media"-- , Option "s" ["standalone"]- (NoArg- (\opt -> return opt { optStandalone = True }))- "" -- "Include needed header and footer on output"-- , Option "" ["template"]- (ReqArg- (\arg opt -> do- return opt{ optTemplate = Just arg,- optStandalone = True })- "FILENAME")- "" -- "Use custom template"-- , Option "M" ["metadata"]- (ReqArg- (\arg opt -> do- let (key,val) = case break (`elem` ":=") arg of- (k,_:v) -> (k, readMetaValue v)- (k,_) -> (k, MetaBool True)- return opt{ optMetadata = addMetadata key val- $ optMetadata opt })- "KEY[:VALUE]")- ""-- , Option "V" ["variable"]- (ReqArg- (\arg opt -> do- let (key,val) = case break (`elem` ":=") arg of- (k,_:v) -> (k,v)- (k,_) -> (k,"true")- return opt{ optVariables = (key,val) : optVariables opt })- "KEY[:VALUE]")- ""-- , Option "D" ["print-default-template"]- (ReqArg- (\arg _ -> do- templ <- getDefaultTemplate Nothing arg- case templ of- Right t -> UTF8.hPutStr stdout t- Left e -> error $ show e- exitWith ExitSuccess)- "FORMAT")- "" -- "Print default template for FORMAT"-- , Option "" ["print-default-data-file"]- (ReqArg- (\arg _ -> do- readDataFile Nothing arg >>= BS.hPutStr stdout- exitWith ExitSuccess)- "FILE")- "" -- "Print default data file"-- , Option "" ["no-wrap"]- (NoArg- (\opt -> return opt { optWrapText = False }))- "" -- "Do not wrap text in output"-- , Option "" ["columns"]- (ReqArg- (\arg opt ->- case safeRead arg of- Just t | t > 0 -> return opt { optColumns = t }- _ -> err 33 $- "columns must be a number greater than 0")- "NUMBER")- "" -- "Length of line in characters"-- , Option "" ["toc", "table-of-contents"]- (NoArg- (\opt -> return opt { optTableOfContents = True }))- "" -- "Include table of contents"-- , Option "" ["toc-depth"]- (ReqArg- (\arg opt -> do- case safeRead arg of- Just t | t >= 1 && t <= 6 ->- return opt { optTOCDepth = t }- _ -> err 57 $- "TOC level must be a number between 1 and 6")- "NUMBER")- "" -- "Number of levels to include in TOC"-- , Option "" ["no-highlight"]- (NoArg- (\opt -> return opt { optHighlight = False }))- "" -- "Don't highlight source code"-- , Option "" ["highlight-style"]- (ReqArg- (\arg opt -> do- newStyle <- case map toLower arg of- "pygments" -> return pygments- "tango" -> return tango- "espresso" -> return espresso- "zenburn" -> return zenburn- "kate" -> return kate- "monochrome" -> return monochrome- "haddock" -> return haddock- _ -> err 39 $- "Unknown style :" ++ arg- return opt{ optHighlightStyle = newStyle })- "STYLE")- "" -- "Style for highlighted code"-- , Option "H" ["include-in-header"]- (ReqArg- (\arg opt -> do- text <- UTF8.readFile arg- -- add new ones to end, so they're included in order specified- let newvars = optVariables opt ++ [("header-includes",text)]- return opt { optVariables = newvars,- optStandalone = True })- "FILENAME")- "" -- "File to include at end of header (implies -s)"-- , Option "B" ["include-before-body"]- (ReqArg- (\arg opt -> do- text <- UTF8.readFile arg- -- add new ones to end, so they're included in order specified- let newvars = optVariables opt ++ [("include-before",text)]- return opt { optVariables = newvars,- optStandalone = True })- "FILENAME")- "" -- "File to include before document body"-- , Option "A" ["include-after-body"]- (ReqArg- (\arg opt -> do- text <- UTF8.readFile arg- -- add new ones to end, so they're included in order specified- let newvars = optVariables opt ++ [("include-after",text)]- return opt { optVariables = newvars,- optStandalone = True })- "FILENAME")- "" -- "File to include after document body"-- , Option "" ["self-contained"]- (NoArg- (\opt -> return opt { optSelfContained = True,- optStandalone = True }))- "" -- "Make slide shows include all the needed js and css"-- , Option "" ["offline"]- (NoArg- (\opt -> do warn $ "--offline is deprecated. Use --self-contained instead."- return opt { optSelfContained = True,- optStandalone = True }))- "" -- "Make slide shows include all the needed js and css"- -- deprecated synonym for --self-contained-- , Option "5" ["html5"]- (NoArg- (\opt -> do- warn $ "--html5 is deprecated. "- ++ "Use the html5 output format instead."- return opt { optHtml5 = True }))- "" -- "Produce HTML5 in HTML output"-- , Option "" ["html-q-tags"]- (NoArg- (\opt -> do- return opt { optHtmlQTags = True }))- "" -- "Use <q> tags for quotes in HTML"-- , Option "" ["ascii"]- (NoArg- (\opt -> return opt { optAscii = True }))- "" -- "Use ascii characters only in HTML output"-- , Option "" ["reference-links"]- (NoArg- (\opt -> return opt { optReferenceLinks = True } ))- "" -- "Use reference links in parsing HTML"-- , Option "" ["atx-headers"]- (NoArg- (\opt -> return opt { optSetextHeaders = False } ))- "" -- "Use atx-style headers for markdown"-- , Option "" ["chapters"]- (NoArg- (\opt -> return opt { optChapters = True }))- "" -- "Use chapter for top-level sections in LaTeX, DocBook"-- , Option "N" ["number-sections"]- (NoArg- (\opt -> return opt { optNumberSections = True }))- "" -- "Number sections in LaTeX"-- , Option "" ["number-offset"]- (ReqArg- (\arg opt ->- case safeRead ('[':arg ++ "]") of- Just ns -> return opt { optNumberOffset = ns,- optNumberSections = True }- _ -> err 57 "could not parse number-offset")- "NUMBERS")- "" -- "Starting number for sections, subsections, etc."-- , Option "" ["no-tex-ligatures"]- (NoArg- (\opt -> return opt { optTeXLigatures = False }))- "" -- "Don't use tex ligatures for quotes, dashes"-- , Option "" ["listings"]- (NoArg- (\opt -> return opt { optListings = True }))- "" -- "Use listings package for LaTeX code blocks"-- , Option "i" ["incremental"]- (NoArg- (\opt -> return opt { optIncremental = True }))- "" -- "Make list items display incrementally in Slidy/Slideous/S5"-- , Option "" ["slide-level"]- (ReqArg- (\arg opt -> do- case safeRead arg of- Just t | t >= 1 && t <= 6 ->- return opt { optSlideLevel = Just t }- _ -> err 39 $- "slide level must be a number between 1 and 6")- "NUMBER")- "" -- "Force header level for slides"-- , Option "" ["section-divs"]- (NoArg- (\opt -> return opt { optSectionDivs = True }))- "" -- "Put sections in div tags in HTML"-- , Option "" ["default-image-extension"]- (ReqArg- (\arg opt -> return opt { optDefaultImageExtension = arg })- "extension")- "" -- "Default extension for extensionless images"-- , Option "" ["email-obfuscation"]- (ReqArg- (\arg opt -> do- method <- case arg of- "references" -> return ReferenceObfuscation- "javascript" -> return JavascriptObfuscation- "none" -> return NoObfuscation- _ -> err 6- ("Unknown obfuscation method: " ++ arg)- return opt { optEmailObfuscation = method })- "none|javascript|references")- "" -- "Method for obfuscating email in HTML"-- , Option "" ["id-prefix"]- (ReqArg- (\arg opt -> return opt { optIdentifierPrefix = arg })- "STRING")- "" -- "Prefix to add to automatically generated HTML identifiers"-- , Option "T" ["title-prefix"]- (ReqArg- (\arg opt -> do- let newvars = ("title-prefix", arg) : optVariables opt- return opt { optVariables = newvars,- optStandalone = True })- "STRING")- "" -- "String to prefix to HTML window title"-- , Option "c" ["css"]- (ReqArg- (\arg opt -> do- -- add new link to end, so it is included in proper order- let newvars = optVariables opt ++ [("css",arg)]- return opt { optVariables = newvars,- optStandalone = True })- "URL")- "" -- "Link to CSS style sheet"-- , Option "" ["reference-odt"]- (ReqArg- (\arg opt -> do- return opt { optReferenceODT = Just arg })- "FILENAME")- "" -- "Path of custom reference.odt"-- , Option "" ["reference-docx"]- (ReqArg- (\arg opt -> do- return opt { optReferenceDocx = Just arg })- "FILENAME")- "" -- "Path of custom reference.docx"-- , Option "" ["epub-stylesheet"]- (ReqArg- (\arg opt -> do- text <- UTF8.readFile arg- return opt { optEpubStylesheet = Just text })- "FILENAME")- "" -- "Path of epub.css"-- , Option "" ["epub-cover-image"]- (ReqArg- (\arg opt ->- return opt { optVariables =- ("epub-cover-image", arg) : optVariables opt })- "FILENAME")- "" -- "Path of epub cover image"-- , Option "" ["epub-metadata"]- (ReqArg- (\arg opt -> do- text <- UTF8.readFile arg- return opt { optEpubMetadata = text })- "FILENAME")- "" -- "Path of epub metadata file"-- , Option "" ["epub-embed-font"]- (ReqArg- (\arg opt -> do- return opt{ optEpubFonts = arg : optEpubFonts opt })- "FILE")- "" -- "Directory of fonts to embed"-- , Option "" ["epub-chapter-level"]- (ReqArg- (\arg opt -> do- case safeRead arg of- Just t | t >= 1 && t <= 6 ->- return opt { optEpubChapterLevel = t }- _ -> err 59 $- "chapter level must be a number between 1 and 6")- "NUMBER")- "" -- "Header level at which to split chapters in EPUB"-- , Option "" ["latex-engine"]- (ReqArg- (\arg opt -> do- let b = takeBaseName arg- if b `elem` ["pdflatex", "lualatex", "xelatex"]- then return opt { optLaTeXEngine = arg }- else err 45 "latex-engine must be pdflatex, lualatex, or xelatex.")- "PROGRAM")- "" -- "Name of latex program to use in generating PDF"-- , Option "" ["bibliography"]- (ReqArg- (\arg opt -> return opt{ optMetadata = addMetadata- "bibliography" (readMetaValue arg)- $ optMetadata opt- , optVariables =- ("biblio-files", dropExtension arg) :- optVariables opt- })- "FILE")- ""-- , Option "" ["csl"]- (ReqArg- (\arg opt ->- return opt{ optMetadata = addMetadata "csl"- (readMetaValue arg)- $ optMetadata opt })- "FILE")- ""-- , Option "" ["citation-abbreviations"]- (ReqArg- (\arg opt ->- return opt{ optMetadata = addMetadata- "citation-abbreviations"- (readMetaValue arg)- $ optMetadata opt })- "FILE")- ""-- , Option "" ["natbib"]- (NoArg- (\opt -> return opt { optCiteMethod = Natbib }))- "" -- "Use natbib cite commands in LaTeX output"-- , Option "" ["biblatex"]- (NoArg- (\opt -> return opt { optCiteMethod = Biblatex }))- "" -- "Use biblatex cite commands in LaTeX output"-- , Option "m" ["latexmathml", "asciimathml"]- (OptArg- (\arg opt ->- return opt { optHTMLMathMethod = LaTeXMathML arg })- "URL")- "" -- "Use LaTeXMathML script in html output"-- , Option "" ["mathml"]- (OptArg- (\arg opt ->- return opt { optHTMLMathMethod = MathML arg })- "URL")- "" -- "Use mathml for HTML math"-- , Option "" ["mimetex"]- (OptArg- (\arg opt -> do- let url' = case arg of- Just u -> u ++ "?"- Nothing -> "/cgi-bin/mimetex.cgi?"- return opt { optHTMLMathMethod = WebTeX url' })- "URL")- "" -- "Use mimetex for HTML math"-- , Option "" ["webtex"]- (OptArg- (\arg opt -> do- let url' = case arg of- Just u -> u- Nothing -> "http://chart.apis.google.com/chart?cht=tx&chl="- return opt { optHTMLMathMethod = WebTeX url' })- "URL")- "" -- "Use web service for HTML math"-- , Option "" ["jsmath"]- (OptArg- (\arg opt -> return opt { optHTMLMathMethod = JsMath arg})- "URL")- "" -- "Use jsMath for HTML math"-- , Option "" ["mathjax"]- (OptArg- (\arg opt -> do- let url' = case arg of- Just u -> u- Nothing -> "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"- return opt { optHTMLMathMethod = MathJax url'})- "URL")- "" -- "Use MathJax for HTML math"-- , Option "" ["gladtex"]- (NoArg- (\opt -> return opt { optHTMLMathMethod = GladTeX }))- "" -- "Use gladtex for HTML math"-- , Option "" ["trace"]- (NoArg- (\opt -> return opt { optTrace = True }))- "" -- "Turn on diagnostic tracing in readers."-- , Option "" ["dump-args"]- (NoArg- (\opt -> return opt { optDumpArgs = True }))- "" -- "Print output filename and arguments to stdout."-- , Option "" ["ignore-args"]- (NoArg- (\opt -> return opt { optIgnoreArgs = True }))- "" -- "Ignore command-line arguments."-- , Option "v" ["version"]- (NoArg- (\_ -> do- prg <- getProgName- defaultDatadir <- getAppUserDataDirectory "pandoc"- UTF8.hPutStrLn stdout (prg ++ " " ++ pandocVersion ++- compileInfo ++ "\nDefault user data directory: " ++- defaultDatadir ++ copyrightMessage)- exitWith ExitSuccess ))- "" -- "Print version"-- , Option "h" ["help"]- (NoArg- (\_ -> do- prg <- getProgName- UTF8.hPutStr stdout (usageMessage prg options)- exitWith ExitSuccess ))- "" -- "Show help"-- ]--addMetadata :: String -> MetaValue -> M.Map String MetaValue- -> M.Map String MetaValue-addMetadata k v m = case M.lookup k m of- Nothing -> M.insert k v m- Just (MetaList xs) -> M.insert k- (MetaList (xs ++ [v])) m- Just x -> M.insert k (MetaList [v, x]) m--readMetaValue :: String -> MetaValue-readMetaValue s = case decode (UTF8.fromString s) of- Just (Yaml.String t) -> MetaString $ T.unpack t- Just (Yaml.Bool b) -> MetaBool b- _ -> MetaString s---- Returns usage message-usageMessage :: String -> [OptDescr (Opt -> IO Opt)] -> String-usageMessage programName = usageInfo- (programName ++ " [OPTIONS] [FILES]" ++ "\nInput formats: " ++- (wrapWords 16 78 $ readers'names) ++ "\nOutput formats: " ++- (wrapWords 16 78 $ writers'names) ++- '\n' : replicate 16 ' ' ++- "[*for pdf output, use latex or beamer and -o FILENAME.pdf]\nOptions:")- where- writers'names = sort $ "pdf*" : map fst writers- readers'names = sort $ map fst readers---- Determine default reader based on source file extensions-defaultReaderName :: String -> [FilePath] -> String-defaultReaderName fallback [] = fallback-defaultReaderName fallback (x:xs) =- case takeExtension (map toLower x) of- ".xhtml" -> "html"- ".html" -> "html"- ".htm" -> "html"- ".tex" -> "latex"- ".latex" -> "latex"- ".ltx" -> "latex"- ".rst" -> "rst"- ".org" -> "org"- ".lhs" -> "markdown+lhs"- ".db" -> "docbook"- ".opml" -> "opml"- ".wiki" -> "mediawiki"- ".dokuwiki" -> "dokuwiki"- ".textile" -> "textile"- ".native" -> "native"- ".json" -> "json"- ".docx" -> "docx"- ".t2t" -> "t2t"- ".epub" -> "epub"- _ -> defaultReaderName fallback xs---- Returns True if extension of first source is .lhs-lhsExtension :: [FilePath] -> Bool-lhsExtension (x:_) = takeExtension x == ".lhs"-lhsExtension _ = False---- Determine default writer based on output file extension-defaultWriterName :: FilePath -> String-defaultWriterName "-" = "html" -- no output file-defaultWriterName x =- case takeExtension (map toLower x) of- "" -> "markdown" -- empty extension- ".tex" -> "latex"- ".latex" -> "latex"- ".ltx" -> "latex"- ".context" -> "context"- ".ctx" -> "context"- ".rtf" -> "rtf"- ".rst" -> "rst"- ".s5" -> "s5"- ".native" -> "native"- ".json" -> "json"- ".txt" -> "markdown"- ".text" -> "markdown"- ".md" -> "markdown"- ".markdown" -> "markdown"- ".textile" -> "textile"- ".lhs" -> "markdown+lhs"- ".texi" -> "texinfo"- ".texinfo" -> "texinfo"- ".db" -> "docbook"- ".odt" -> "odt"- ".docx" -> "docx"- ".epub" -> "epub"- ".org" -> "org"- ".asciidoc" -> "asciidoc"- ".pdf" -> "latex"- ".fb2" -> "fb2"- ".opml" -> "opml"- ['.',y] | y `elem` ['1'..'9'] -> "man"- _ -> "html"---- Transformations of a Pandoc document post-parsing:--extractMedia :: MediaBag -> FilePath -> Pandoc -> IO Pandoc-extractMedia media dir d =- case [fp | (fp, _, _) <- mediaDirectory media] of- [] -> return d- fps -> do- extractMediaBag True dir media- return $ walk (adjustImagePath dir fps) d--adjustImagePath :: FilePath -> [FilePath] -> Inline -> Inline-adjustImagePath dir paths (Image lab (src, tit))- | src `elem` paths = Image lab (dir ++ "/" ++ src, tit)-adjustImagePath _ _ x = x--adjustMetadata :: M.Map String MetaValue -> Pandoc -> IO Pandoc-adjustMetadata metadata d = return $ M.foldWithKey setMeta d metadata--applyTransforms :: [Transform] -> Pandoc -> IO Pandoc-applyTransforms transforms d = return $ foldr ($) d transforms--applyFilters :: [FilePath] -> [String] -> Pandoc -> IO Pandoc-applyFilters filters args d =- foldrM ($) d $ map (flip externalFilter args) filters--main :: IO ()-main = do-- rawArgs <- map UTF8.decodeArg <$> getArgs- prg <- getProgName- let compatMode = (prg == "hsmarkdown")-- let (actions, args, errors) = if compatMode- then ([], rawArgs, [])- else getOpt Permute options rawArgs-- unless (null errors) $- err 2 $ concat $ errors ++- ["Try " ++ prg ++ " --help for more information."]-- let defaultOpts' = if compatMode- then defaultOpts { optReader = "markdown_strict"- , optWriter = "html"- , optEmailObfuscation =- ReferenceObfuscation }- else defaultOpts-- -- thread option data structure through all supplied option actions- opts <- foldl (>>=) (return defaultOpts') actions-- let Opt { optTabStop = tabStop- , optPreserveTabs = preserveTabs- , optStandalone = standalone- , optReader = readerName- , optWriter = writerName- , optParseRaw = parseRaw- , optVariables = variables- , optMetadata = metadata- , optTableOfContents = toc- , optTransforms = transforms- , optTemplate = templatePath- , optOutputFile = outputFile- , optNumberSections = numberSections- , optNumberOffset = numberFrom- , optSectionDivs = sectionDivs- , optIncremental = incremental- , optSelfContained = selfContained- , optSmart = smart- , optOldDashes = oldDashes- , optHtml5 = html5- , optHtmlQTags = htmlQTags- , optHighlight = highlight- , optHighlightStyle = highlightStyle- , optChapters = chapters- , optHTMLMathMethod = mathMethod- , optReferenceODT = referenceODT- , optReferenceDocx = referenceDocx- , optEpubStylesheet = epubStylesheet- , optEpubMetadata = epubMetadata- , optEpubFonts = epubFonts- , optEpubChapterLevel = epubChapterLevel- , optTOCDepth = epubTOCDepth- , optDumpArgs = dumpArgs- , optIgnoreArgs = ignoreArgs- , optReferenceLinks = referenceLinks- , optWrapText = wrap- , optColumns = columns- , optFilters = filters- , optEmailObfuscation = obfuscationMethod- , optIdentifierPrefix = idPrefix- , optIndentedCodeClasses = codeBlockClasses- , optDataDir = mbDataDir- , optCiteMethod = citeMethod- , optListings = listings- , optLaTeXEngine = latexEngine- , optSlideLevel = slideLevel- , optSetextHeaders = setextHeaders- , optAscii = ascii- , optTeXLigatures = texLigatures- , optDefaultImageExtension = defaultImageExtension- , optExtractMedia = mbExtractMedia- , optTrace = trace- , optTrackChanges = trackChanges- } = opts-- when dumpArgs $- do UTF8.hPutStrLn stdout outputFile- mapM_ (\arg -> UTF8.hPutStrLn stdout arg) args- exitWith ExitSuccess-- -- --bibliography implies -F pandoc-citeproc for backwards compatibility:- let needsCiteproc = isJust (M.lookup "bibliography" metadata) &&- optCiteMethod opts `notElem` [Natbib, Biblatex] &&- "pandoc-citeproc" `notElem` map takeBaseName filters- let filters' = if needsCiteproc then "pandoc-citeproc" : filters- else filters-- let sources = if ignoreArgs then [] else args-- datadir <- case mbDataDir of- Nothing -> E.catch- (Just <$> getAppUserDataDirectory "pandoc")- (\e -> let _ = (e :: E.SomeException)- in return Nothing)- Just _ -> return mbDataDir-- -- assign reader and writer based on options and filenames- let readerName' = case map toLower readerName of- [] -> defaultReaderName- (if any isURI sources- then "html"- else "markdown") sources- "html4" -> "html"- x -> x-- let writerName' = case map toLower writerName of- [] -> defaultWriterName outputFile- "epub2" -> "epub"- "html4" -> "html"- x -> x-- let pdfOutput = map toLower (takeExtension outputFile) == ".pdf"-- let laTeXOutput = "latex" `isPrefixOf` writerName' ||- "beamer" `isPrefixOf` writerName'-- writer <- if ".lua" `isSuffixOf` writerName'- -- note: use non-lowercased version writerName- then return $ IOStringWriter $ writeCustom writerName- else case getWriter writerName' of- Left e -> err 9 $- if writerName' == "pdf"- then e ++- "\nTo create a pdf with pandoc, use " ++- "the latex or beamer writer and specify\n" ++- "an output file with .pdf extension " ++- "(pandoc -t latex -o filename.pdf)."- else e- Right w -> return w-- reader <- if "t2t" == readerName'- then (mkStringReader .- readTxt2Tags) <$>- (getT2TMeta sources outputFile)- else case getReader readerName' of- Right r -> return r- Left e -> err 7 e-- let standalone' = standalone || not (isTextFormat writerName') || pdfOutput-- templ <- case templatePath of- _ | not standalone' -> return ""- Nothing -> do- deftemp <- getDefaultTemplate datadir writerName'- case deftemp of- Left e -> throwIO e- Right t -> return t- Just tp -> do- -- strip off extensions- let format = takeWhile (`notElem` "+-") writerName'- let tp' = case takeExtension tp of- "" -> tp <.> format- _ -> tp- E.catch (UTF8.readFile tp')- (\e -> if isDoesNotExistError e- then E.catch- (readDataFileUTF8 datadir- ("templates" </> tp'))- (\e' -> let _ = (e' :: E.SomeException)- in throwIO e')- else throwIO e)-- variables' <- case mathMethod of- LaTeXMathML Nothing -> do- s <- readDataFileUTF8 datadir "LaTeXMathML.js"- return $ ("mathml-script", s) : variables- MathML Nothing -> do- s <- readDataFileUTF8 datadir "MathMLinHTML.js"- return $ ("mathml-script", s) : variables- _ -> return variables-- variables'' <- if "dzslides" `isPrefixOf` writerName'- then do- dztempl <- readDataFileUTF8 datadir- ("dzslides" </> "template.html")- let dzline = "<!-- {{{{ dzslides core"- let dzcore = unlines- $ dropWhile (not . (dzline `isPrefixOf`))- $ lines dztempl- return $ ("dzslides-core", dzcore) : variables'- else return variables'-- let sourceURL = case sources of- [] -> Nothing- (x:_) -> case parseURI x of- Just u- | uriScheme u `elem` ["http:","https:"] ->- Just $ show u{ uriQuery = "",- uriFragment = "" }- _ -> Nothing-- let readerOpts = def{ readerSmart = smart || (texLigatures &&- (laTeXOutput || "context" `isPrefixOf` writerName'))- , readerStandalone = standalone'- , readerParseRaw = parseRaw- , readerColumns = columns- , readerTabStop = tabStop- , readerOldDashes = oldDashes- , readerIndentedCodeClasses = codeBlockClasses- , readerApplyMacros = not laTeXOutput- , readerDefaultImageExtension = defaultImageExtension- , readerTrace = trace- , readerTrackChanges = trackChanges- }-- when (not (isTextFormat writerName') && outputFile == "-") $- err 5 $ "Cannot write " ++ writerName' ++ " output to stdout.\n" ++- "Specify an output file using the -o option."-- let readSources [] = mapM readSource ["-"]- readSources srcs = mapM readSource srcs- readSource "-" = UTF8.getContents- readSource src = case parseURI src of- Just u | uriScheme u `elem` ["http:","https:"] ->- readURI src- _ -> UTF8.readFile src- readURI src = do- res <- openURL src- case res of- Left e -> throwIO e- Right (bs,_) -> return $ UTF8.toString bs-- let readFiles [] = error "Cannot read archive from stdin"- readFiles (x:_) = B.readFile x-- let convertTabs = tabFilter (if preserveTabs || readerName' == "t2t"- then 0- else tabStop)-- let handleIncludes' = if readerName' == "latex" ||- readerName' == "latex+lhs"- then handleIncludes- else return-- (doc, media) <-- case reader of- StringReader r-> (, mempty) <$>- ( readSources >=>- handleIncludes' . convertTabs . intercalate "\n" >=>- r readerOpts ) sources- ByteStringReader r -> readFiles sources >>= r readerOpts-- let writerOptions = def { writerStandalone = standalone',- writerTemplate = templ,- writerVariables = variables'',- writerTabStop = tabStop,- writerTableOfContents = toc,- writerHTMLMathMethod = mathMethod,- writerIncremental = incremental,- writerCiteMethod = citeMethod,- writerIgnoreNotes = False,- writerNumberSections = numberSections,- writerNumberOffset = numberFrom,- writerSectionDivs = sectionDivs,- writerReferenceLinks = referenceLinks,- writerWrapText = wrap,- writerColumns = columns,- writerEmailObfuscation = obfuscationMethod,- writerIdentifierPrefix = idPrefix,- writerSourceURL = sourceURL,- writerUserDataDir = datadir,- writerHtml5 = html5,- writerHtmlQTags = htmlQTags,- writerChapters = chapters,- writerListings = listings,- writerBeamer = False,- writerSlideLevel = slideLevel,- writerHighlight = highlight,- writerHighlightStyle = highlightStyle,- writerSetextHeaders = setextHeaders,- writerTeXLigatures = texLigatures,- writerEpubMetadata = epubMetadata,- writerEpubStylesheet = epubStylesheet,- writerEpubFonts = epubFonts,- writerEpubChapterLevel = epubChapterLevel,- writerTOCDepth = epubTOCDepth,- writerReferenceODT = referenceODT,- writerReferenceDocx = referenceDocx,- writerMediaBag = media- }--- doc' <- (maybe return (extractMedia media) mbExtractMedia >=>- adjustMetadata metadata >=>- applyTransforms transforms >=>- applyFilters filters' [writerName']) doc-- let writeBinary :: B.ByteString -> IO ()- writeBinary = B.writeFile (UTF8.encodePath outputFile)-- let writerFn :: FilePath -> String -> IO ()- writerFn "-" = UTF8.putStr- writerFn f = UTF8.writeFile f-- case writer of- IOStringWriter f -> f writerOptions doc' >>= writerFn outputFile- IOByteStringWriter f -> f writerOptions doc' >>= writeBinary- PureStringWriter f- | pdfOutput -> do- -- make sure writer is latex or beamer- unless laTeXOutput $- err 47 $ "cannot produce pdf output with " ++ writerName' ++- " writer"-- -- check for latex program- mbLatex <- findExecutable latexEngine- when (mbLatex == Nothing) $- err 41 $ latexEngine ++ " not found. " ++- latexEngine ++ " is needed for pdf output."-- res <- makePDF latexEngine f writerOptions doc'- case res of- Right pdf -> writeBinary pdf- Left err' -> do- B.hPutStr stderr $ err'- B.hPut stderr $ B.pack [10]- err 43 "Error producing PDF from TeX source"- | otherwise -> selfcontain (f writerOptions doc' ++- ['\n' | not standalone'])- >>= writerFn outputFile . handleEntities- where htmlFormat = writerName' `elem`- ["html","html+lhs","html5","html5+lhs",- "s5","slidy","slideous","dzslides","revealjs"]- selfcontain = if selfContained && htmlFormat- then makeSelfContained writerOptions- else return- handleEntities = if htmlFormat && ascii- then toEntities- else id
@@ -1,25 +1,9 @@-{-# LANGUAGE ScopedTypeVariables, FlexibleInstances #-}-{--Copyright (C) 2006-2014 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--}-+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE ScopedTypeVariables #-} {- | Module : Text.Pandoc- Copyright : Copyright (C) 2006-2014 John MacFarlane+ Copyright : Copyright (C) 2006-2024 John MacFarlane License : GNU GPL, version 2 or above Maintainer : John MacFarlane <jgm@berkeley.edu>@@ -37,16 +21,17 @@ > module Main where > import Text.Pandoc+> import Data.Text (Text)+> import qualified Data.Text.IO as T >-> markdownToRST :: String -> String-> markdownToRST =-> (writeRST def {writerReferenceLinks = True}) . readMarkdown def+> mdToRST :: Text -> IO Text+> mdToRST txt = runIOorExplode $+> readMarkdown def txt+> >>= writeRST def{ writerReferenceLinks = True } >-> main = getContents >>= putStrLn . markdownToRST--Note: all of the readers assume that the input text has @'\n'@-line endings. So if you get your input text from a web form,-you should remove @'\r'@ characters using @filter (/='\r')@.+> main :: IO ()+> main = do+> T.getContents >>= mdToRST >>= T.putStrLn -} @@ -58,305 +43,37 @@ , module Text.Pandoc.Generic -- * Options , module Text.Pandoc.Options- -- * Lists of readers and writers- , readers- , writers+ -- * Logging+ , module Text.Pandoc.Logging+ -- * Typeclass+ , module Text.Pandoc.Class+ -- * Internal data files+ , module Text.Pandoc.Data+ -- * Error handling+ , module Text.Pandoc.Error -- * Readers: converting /to/ Pandoc format- , Reader (..)- , mkStringReader- , readDocx- , readMarkdown- , readMediaWiki- , readRST- , readOrg- , readLaTeX- , readHtml- , readTextile- , readDocBook- , readOPML- , readHaddock- , readNative- , readJSON- , readTxt2Tags- , readTxt2TagsNoMacros- , readEPUB+ , module Text.Pandoc.Readers -- * Writers: converting /from/ Pandoc format- , Writer (..)- , writeNative- , writeJSON- , writeMarkdown- , writePlain- , writeRST- , writeLaTeX- , writeConTeXt- , writeTexinfo- , writeHtml- , writeHtmlString- , writeICML- , writeDocbook- , writeOPML- , writeOpenDocument- , writeMan- , writeMediaWiki- , writeDokuWiki- , writeTextile- , writeRTF- , writeODT- , writeDocx- , writeEPUB- , writeFB2- , writeOrg- , writeAsciiDoc- , writeHaddock- , writeCustom+ , module Text.Pandoc.Writers -- * Rendering templates and default templates , module Text.Pandoc.Templates- -- * Version+ -- * Localization+ , setTranslations+ , translateTerm+ -- * Version information , pandocVersion- -- * Miscellaneous- , getReader- , getWriter- , ToJsonFilter(..)+ , pandocVersionText ) where +import Text.Pandoc.Class import Text.Pandoc.Definition+import Text.Pandoc.Data+import Text.Pandoc.Error import Text.Pandoc.Generic-import Text.Pandoc.JSON-import Text.Pandoc.Readers.Markdown-import Text.Pandoc.Readers.MediaWiki-import Text.Pandoc.Readers.RST-import Text.Pandoc.Readers.Org-import Text.Pandoc.Readers.DocBook-import Text.Pandoc.Readers.OPML-import Text.Pandoc.Readers.LaTeX-import Text.Pandoc.Readers.HTML-import Text.Pandoc.Readers.Textile-import Text.Pandoc.Readers.Native-import Text.Pandoc.Readers.Haddock-import Text.Pandoc.Readers.Docx-import Text.Pandoc.Readers.Txt2Tags-import Text.Pandoc.Readers.EPUB-import Text.Pandoc.Writers.Native-import Text.Pandoc.Writers.Markdown-import Text.Pandoc.Writers.RST-import Text.Pandoc.Writers.LaTeX-import Text.Pandoc.Writers.ConTeXt-import Text.Pandoc.Writers.Texinfo-import Text.Pandoc.Writers.HTML-import Text.Pandoc.Writers.ODT-import Text.Pandoc.Writers.Docx-import Text.Pandoc.Writers.EPUB-import Text.Pandoc.Writers.FB2-import Text.Pandoc.Writers.ICML-import Text.Pandoc.Writers.Docbook-import Text.Pandoc.Writers.OPML-import Text.Pandoc.Writers.OpenDocument-import Text.Pandoc.Writers.Man-import Text.Pandoc.Writers.RTF-import Text.Pandoc.Writers.MediaWiki-import Text.Pandoc.Writers.DokuWiki-import Text.Pandoc.Writers.Textile-import Text.Pandoc.Writers.Org-import Text.Pandoc.Writers.AsciiDoc-import Text.Pandoc.Writers.Haddock-import Text.Pandoc.Writers.Custom-import Text.Pandoc.Templates+import Text.Pandoc.Logging import Text.Pandoc.Options-import Text.Pandoc.Shared (safeRead, warn)-import Text.Pandoc.MediaBag (MediaBag)-import Data.Aeson-import qualified Data.ByteString.Lazy as BL-import Data.List (intercalate)-import Data.Version (showVersion)-import Data.Set (Set)-import qualified Data.Set as Set-import Text.Parsec-import Text.Parsec.Error-import qualified Text.Pandoc.UTF8 as UTF8-import Paths_pandoc (version)---- | Version number of pandoc library.-pandocVersion :: String-pandocVersion = showVersion version--parseFormatSpec :: String- -> Either ParseError (String, Set Extension -> Set Extension)-parseFormatSpec = parse formatSpec ""- where formatSpec = do- name <- formatName- extMods <- many extMod- return (name, foldl (.) id extMods)- formatName = many1 $ noneOf "-+"- extMod = do- polarity <- oneOf "-+"- name <- many $ noneOf "-+"- ext <- case safeRead ("Ext_" ++ name) of- Just n -> return n- Nothing- | name == "lhs" -> return Ext_literate_haskell- | otherwise -> fail $ "Unknown extension: " ++ name- return $ case polarity of- '-' -> Set.delete ext- _ -> Set.insert ext---- auxiliary function for readers:-markdown :: ReaderOptions -> String -> IO Pandoc-markdown o s = do- let (doc, warnings) = readMarkdownWithWarnings o s- mapM_ warn warnings- return doc--data Reader = StringReader (ReaderOptions -> String -> IO Pandoc)- | ByteStringReader (ReaderOptions -> BL.ByteString -> IO (Pandoc, MediaBag))--mkStringReader :: (ReaderOptions -> String -> Pandoc) -> Reader-mkStringReader r = StringReader (\o s -> return $ r o s)--mkBSReader :: (ReaderOptions -> BL.ByteString -> (Pandoc, MediaBag)) -> Reader-mkBSReader r = ByteStringReader (\o s -> return $ r o s)---- | Association list of formats and readers.-readers :: [(String, Reader)]-readers = [ ("native" , StringReader $ \_ s -> return $ readNative s)- ,("json" , mkStringReader readJSON )- ,("markdown" , StringReader markdown)- ,("markdown_strict" , StringReader markdown)- ,("markdown_phpextra" , StringReader markdown)- ,("markdown_github" , StringReader markdown)- ,("markdown_mmd", StringReader markdown)- ,("rst" , mkStringReader readRST )- ,("mediawiki" , mkStringReader readMediaWiki)- ,("docbook" , mkStringReader readDocBook)- ,("opml" , mkStringReader readOPML)- ,("org" , mkStringReader readOrg)- ,("textile" , mkStringReader readTextile) -- TODO : textile+lhs- ,("html" , mkStringReader readHtml)- ,("latex" , mkStringReader readLaTeX)- ,("haddock" , mkStringReader readHaddock)- ,("docx" , mkBSReader readDocx)- ,("t2t" , mkStringReader readTxt2TagsNoMacros)- ,("epub" , mkBSReader readEPUB)- ]--data Writer = PureStringWriter (WriterOptions -> Pandoc -> String)- | IOStringWriter (WriterOptions -> Pandoc -> IO String)- | IOByteStringWriter (WriterOptions -> Pandoc -> IO BL.ByteString)---- | Association list of formats and writers.-writers :: [ ( String, Writer ) ]-writers = [- ("native" , PureStringWriter writeNative)- ,("json" , PureStringWriter writeJSON)- ,("docx" , IOByteStringWriter writeDocx)- ,("odt" , IOByteStringWriter writeODT)- ,("epub" , IOByteStringWriter $ \o ->- writeEPUB o{ writerEpubVersion = Just EPUB2 })- ,("epub3" , IOByteStringWriter $ \o ->- writeEPUB o{ writerEpubVersion = Just EPUB3 })- ,("fb2" , IOStringWriter writeFB2)- ,("html" , PureStringWriter writeHtmlString)- ,("html5" , PureStringWriter $ \o ->- writeHtmlString o{ writerHtml5 = True })- ,("icml" , PureStringWriter writeICML)- ,("s5" , PureStringWriter $ \o ->- writeHtmlString o{ writerSlideVariant = S5Slides- , writerTableOfContents = False })- ,("slidy" , PureStringWriter $ \o ->- writeHtmlString o{ writerSlideVariant = SlidySlides })- ,("slideous" , PureStringWriter $ \o ->- writeHtmlString o{ writerSlideVariant = SlideousSlides })- ,("dzslides" , PureStringWriter $ \o ->- writeHtmlString o{ writerSlideVariant = DZSlides- , writerHtml5 = True })- ,("revealjs" , PureStringWriter $ \o ->- writeHtmlString o{ writerSlideVariant = RevealJsSlides- , writerHtml5 = True })- ,("docbook" , PureStringWriter writeDocbook)- ,("opml" , PureStringWriter writeOPML)- ,("opendocument" , PureStringWriter writeOpenDocument)- ,("latex" , PureStringWriter writeLaTeX)- ,("beamer" , PureStringWriter $ \o ->- writeLaTeX o{ writerBeamer = True })- ,("context" , PureStringWriter writeConTeXt)- ,("texinfo" , PureStringWriter writeTexinfo)- ,("man" , PureStringWriter writeMan)- ,("markdown" , PureStringWriter writeMarkdown)- ,("markdown_strict" , PureStringWriter writeMarkdown)- ,("markdown_phpextra" , PureStringWriter writeMarkdown)- ,("markdown_github" , PureStringWriter writeMarkdown)- ,("markdown_mmd" , PureStringWriter writeMarkdown)- ,("plain" , PureStringWriter writePlain)- ,("rst" , PureStringWriter writeRST)- ,("mediawiki" , PureStringWriter writeMediaWiki)- ,("dokuwiki" , PureStringWriter writeDokuWiki)- ,("textile" , PureStringWriter writeTextile)- ,("rtf" , IOStringWriter writeRTFWithEmbeddedImages)- ,("org" , PureStringWriter writeOrg)- ,("asciidoc" , PureStringWriter writeAsciiDoc)- ,("haddock" , PureStringWriter writeHaddock)- ]--getDefaultExtensions :: String -> Set Extension-getDefaultExtensions "markdown_strict" = strictExtensions-getDefaultExtensions "markdown_phpextra" = phpMarkdownExtraExtensions-getDefaultExtensions "markdown_mmd" = multimarkdownExtensions-getDefaultExtensions "markdown_github" = githubMarkdownExtensions-getDefaultExtensions "markdown" = pandocExtensions-getDefaultExtensions "plain" = pandocExtensions-getDefaultExtensions "org" = Set.fromList [Ext_citations]-getDefaultExtensions "textile" = Set.fromList [Ext_auto_identifiers]-getDefaultExtensions "html" = Set.fromList [Ext_auto_identifiers,- Ext_native_divs,- Ext_native_spans]-getDefaultExtensions "html5" = getDefaultExtensions "html"-getDefaultExtensions "epub" = Set.fromList [Ext_auto_identifiers,- Ext_raw_html,- Ext_native_divs,- Ext_native_spans,- Ext_epub_html_exts]-getDefaultExtensions _ = Set.fromList [Ext_auto_identifiers]---- | Retrieve reader based on formatSpec (format+extensions).-getReader :: String -> Either String Reader-getReader s =- case parseFormatSpec s of- Left e -> Left $ intercalate "\n" $ [m | Message m <- errorMessages e]- Right (readerName, setExts) ->- case lookup readerName readers of- Nothing -> Left $ "Unknown reader: " ++ readerName- Just (StringReader r) -> Right $ StringReader $ \o ->- r o{ readerExtensions = setExts $- getDefaultExtensions readerName }- Just (ByteStringReader r) -> Right $ ByteStringReader $ \o ->- r o{ readerExtensions = setExts $- getDefaultExtensions readerName }---- | Retrieve writer based on formatSpec (format+extensions).-getWriter :: String -> Either String Writer-getWriter s- = case parseFormatSpec s of- Left e -> Left $ intercalate "\n" $ [m | Message m <- errorMessages e]- Right (writerName, setExts) ->- case lookup writerName writers of- Nothing -> Left $ "Unknown writer: " ++ writerName- Just (PureStringWriter r) -> Right $ PureStringWriter $- \o -> r o{ writerExtensions = setExts $- getDefaultExtensions writerName }- Just (IOStringWriter r) -> Right $ IOStringWriter $- \o -> r o{ writerExtensions = setExts $- getDefaultExtensions writerName }- Just (IOByteStringWriter r) -> Right $ IOByteStringWriter $- \o -> r o{ writerExtensions = setExts $- getDefaultExtensions writerName }--{-# DEPRECATED toJsonFilter "Use 'toJSONFilter' from 'Text.Pandoc.JSON' instead" #-}--- | Deprecated. Use @toJSONFilter@ from @Text.Pandoc.JSON@ instead.-class ToJSONFilter a => ToJsonFilter a- where toJsonFilter :: a -> IO ()- toJsonFilter = toJSONFilter--readJSON :: ReaderOptions -> String -> Pandoc-readJSON _ = either error id . eitherDecode' . UTF8.fromStringLazy--writeJSON :: WriterOptions -> Pandoc -> String-writeJSON _ = UTF8.toStringLazy . encode+import Text.Pandoc.Readers+import Text.Pandoc.Version (pandocVersion, pandocVersionText)+import Text.Pandoc.Templates+import Text.Pandoc.Translations (setTranslations, translateTerm)+import Text.Pandoc.Writers
@@ -0,0 +1,427 @@+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE ScopedTypeVariables #-}+{- |+ Module : Text.Pandoc.App+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley@edu>+ Stability : alpha+ Portability : portable++Does a pandoc conversion based on command-line options.+-}+module Text.Pandoc.App (+ convertWithOpts+ , handleOptInfo+ , Opt(..)+ , OptInfo(..)+ , LineEnding(..)+ , IpynbOutput (..)+ , Filter(..)+ , defaultOpts+ , parseOptions+ , parseOptionsFromArgs+ , options+ , applyFilters+ , versionInfo+ ) where+import qualified Control.Exception as E+import Control.Monad ( (>=>), when, forM, forM_ )+import Control.Monad.Trans ( MonadIO(..) )+import Control.Monad.Catch ( MonadMask )+import Control.Monad.Except (throwError)+import qualified Data.ByteString.Lazy as BL+import Data.Maybe (fromMaybe, isJust, isNothing)+import qualified Data.Set as Set+import Data.Text (Text)+import qualified Data.Text as T+import qualified Data.Text.Lazy as TL+import qualified Data.Text.Lazy.Encoding as TE+import qualified Data.Text.Encoding.Error as TE+import Data.Char (toLower)+import System.Directory (doesDirectoryExist, createDirectory,+ createDirectoryIfMissing)+import Codec.Archive.Zip (toArchiveOrFail,+ extractFilesFromArchive, ZipOption(..))+import System.Exit (exitSuccess)+import System.FilePath ( takeBaseName, takeExtension, takeDirectory)+import System.IO (nativeNewline, stdout)+import qualified System.IO as IO (Newline (..))+import Data.Version (showVersion)+import Text.Pandoc+import Text.Pandoc.Builder (setMeta)+import Text.Pandoc.MediaBag (mediaItems)+import Text.Pandoc.Image (svgToPng)+import Text.Pandoc.App.Opt (Opt (..), LineEnding (..), defaultOpts,+ IpynbOutput (..), OptInfo(..))+import Text.Pandoc.App.CommandLineOptions (parseOptions, parseOptionsFromArgs,+ options, handleOptInfo, versionInfo)+import Text.Pandoc.App.Input (InputParameters (..), readInput)+import Text.Pandoc.App.OutputSettings (OutputSettings (..), optToOutputSettings,+ sandbox')+import Text.Pandoc.Transforms (applyTransforms, filterIpynbOutput,+ headerShift, eastAsianLineBreakFilter)+import Text.Collate.Lang (Lang (..), parseLang)+import Text.Pandoc.Filter (Filter (JSONFilter, LuaFilter), Environment (..),+ applyFilters)+import qualified Text.Pandoc.Format as Format+import Text.Pandoc.PDF (makePDF)+import Text.Pandoc.Scripting (ScriptingEngine (..), CustomComponents(..))+import Text.Pandoc.SelfContained (makeSelfContained)+import Text.Pandoc.Shared (tshow)+import Text.Pandoc.Writers.Shared (lookupMetaString)+import Text.Pandoc.Readers.Markdown (yamlToMeta)+import qualified Text.Pandoc.UTF8 as UTF8+#ifndef _WINDOWS+import System.Posix.IO (stdOutput)+import System.Posix.Terminal (queryTerminal)+#endif++convertWithOpts :: ScriptingEngine -> Opt -> IO ()+convertWithOpts scriptingEngine opts = do+ let outputFile = fromMaybe "-" (optOutputFile opts)+ datadir <- case optDataDir opts of+ Nothing -> do+ d <- defaultUserDataDir+ exists <- doesDirectoryExist d+ return $ if exists+ then Just d+ else Nothing+ mdatadir -> return mdatadir++ when (optDumpArgs opts) $+ do UTF8.hPutStrLn stdout (T.pack outputFile)+ mapM_ (UTF8.hPutStrLn stdout . T.pack)+ (fromMaybe ["-"] $ optInputFiles opts)+ exitSuccess++#ifdef _WINDOWS+ let istty = True+#else+ istty <- liftIO $ queryTerminal stdOutput+#endif++ res <- runIO $ convertWithOpts' scriptingEngine istty datadir opts+ case res of+ Left e -> E.throwIO e+ Right (output, reports) -> do+ case optLogFile opts of+ Nothing -> return ()+ Just logfile -> BL.writeFile logfile (encodeLogMessages reports)+ let isWarning msg = messageVerbosity msg == WARNING+ when (optFailIfWarnings opts && any isWarning reports) $+ E.throwIO PandocFailOnWarningError+ let eol = case optEol opts of+ CRLF -> IO.CRLF+ LF -> IO.LF+ Native -> nativeNewline+ let outputFileDir = takeDirectory outputFile+ createDirectoryIfMissing True outputFileDir+ case output of+ TextOutput t -> writerFn eol outputFile t+ BinaryOutput bs -> writeFnBinary outputFile bs+ ZipOutput bs+ | null (takeExtension outputFile)+ , outputFile /= "-" -> do+ -- create directory and unzip+ createDirectory outputFile -- will fail if directory exists+ let zipopts = [OptRecursive, OptDestination outputFile] +++ [OptVerbose | optVerbosity opts == INFO]+ case toArchiveOrFail bs of+ Right archive -> extractFilesFromArchive zipopts archive+ Left e -> E.throwIO $ PandocShouldNeverHappenError $ T.pack e+ | otherwise -> writeFnBinary outputFile bs++convertWithOpts' :: (PandocMonad m, MonadIO m, MonadMask m)+ => ScriptingEngine+ -> Bool+ -> Maybe FilePath+ -> Opt+ -> m (PandocOutput, [LogMessage])+convertWithOpts' scriptingEngine istty datadir opts = do+ configureCommonState datadir opts+ let outputFile = fromMaybe "-" (optOutputFile opts)+ let filters = optFilters opts+ let sources = case optInputFiles opts of+ Just xs | not (optIgnoreArgs opts) -> xs+ _ -> ["-"]++ let defFlavor fmt = Format.FlavoredFormat fmt mempty+ -- assign reader and writer based on options and filenames+ flvrd@(Format.FlavoredFormat readerNameBase _extsDiff) <-+ case optFrom opts of+ Just f -> Format.parseFlavoredFormat f+ Nothing -> case Format.formatFromFilePaths sources of+ Just f' -> return f'+ Nothing | sources == ["-"] -> return $ defFlavor "markdown"+ | otherwise -> do+ report $ CouldNotDeduceFormat+ (map (T.pack . takeExtension) sources) "markdown"+ return $ defFlavor "markdown"++ let makeSandboxed pureReader =+ case pureReader of+ TextReader r+ -> TextReader $ \o t -> sandbox' opts (r o t)+ ByteStringReader r+ -> ByteStringReader $ \o t -> sandbox' opts (r o t)++ (reader, readerExts) <-+ if ".lua" `T.isSuffixOf` readerNameBase+ then do+ let scriptPath = T.unpack readerNameBase+ components <- engineLoadCustom scriptingEngine scriptPath+ r <- case customReader components of+ Nothing -> throwError $ PandocAppError $+ readerNameBase <> " does not contain a custom reader"+ Just r -> return r+ let extsConf = fromMaybe mempty (customExtensions components)+ rexts <- Format.applyExtensionsDiff extsConf flvrd+ return (r, rexts)+ else if optSandbox opts+ then case runPure (getReader flvrd) of+ Left e -> throwError e+ Right (r, rexts) -> return (makeSandboxed r, rexts)+ else getReader flvrd++ outputSettings <- optToOutputSettings scriptingEngine opts+ let format = outputFormat outputSettings+ let writer = outputWriter outputSettings+ let writerOptions = outputWriterOptions outputSettings++ -- whether we are targeting PDF.+ let pdfOutput = map toLower (takeExtension outputFile) == ".pdf" ||+ optTo opts == Just "pdf"+ -- whether standalone output should be produced.+ let bibOutput = format `elem` ["bibtex", "biblatex", "csljson"]+ let standalone = isJust (writerTemplate writerOptions) || bibOutput++ --+ -- Sanity checks+ --+ when (pdfOutput && readerNameBase == "latex") $+ case optInputFiles opts of+ Just (inputFile:_) -> report $ UnusualConversion $ T.pack $+ "to convert a .tex file to PDF, you get better results by using pdflatex "+ <> "(or lualatex or xelatex) directly, try `pdflatex " <> inputFile+ <> "` instead of `pandoc " <> inputFile <> " -o " <> outputFile <> "`."+ _ -> return ()++ -- We don't want to send output to the terminal if the user+ -- does 'pandoc -t docx input.txt'; though we allow them to+ -- force this with '-o -'. On posix systems, we detect+ -- when stdout is being piped and allow output to stdout+ -- in that case, but on Windows we can't.+ when ((pdfOutput || not (isTextFormat format)) &&+ istty && isNothing ( optOutputFile opts)) $+ throwError $ PandocAppError $+ "Cannot write " <> (if pdfOutput then "pdf" else format) <>+ " output to terminal.\n" <>+ "Specify an output file using the -o option, or " <>+ "use '-o -' to force output to stdout."++ when (readerNameBase == "markdown_github" ||+ format == "markdown_github") $+ report $ Deprecated "markdown_github" "Use gfm instead."++ abbrevs <- readAbbreviations (optAbbreviations opts)+ let readerOpts = def{+ readerStandalone = standalone+ , readerColumns = optColumns opts+ , readerTabStop = optTabStop opts+ , readerIndentedCodeClasses = optIndentedCodeClasses opts+ , readerDefaultImageExtension = optDefaultImageExtension opts+ , readerTrackChanges = optTrackChanges opts+ , readerAbbreviations = abbrevs+ , readerExtensions = readerExts+ , readerStripComments = optStripComments opts+ , readerTypstInputs = optTypstInputs opts+ }++ metadataFromFile <- getMetadataFromFiles readerNameBase readerOpts+ (optMetadataFiles opts)++ let transforms = (case optShiftHeadingLevelBy opts of+ 0 -> id+ x -> (headerShift x :)) .+ (if extensionEnabled Ext_east_asian_line_breaks+ readerExts &&+ not (extensionEnabled Ext_east_asian_line_breaks+ (writerExtensions writerOptions) &&+ writerWrapText writerOptions == WrapPreserve)+ then (eastAsianLineBreakFilter :)+ else id) .+ (case optIpynbOutput opts of+ _ | readerNameBase /= "ipynb" -> id+ IpynbOutputAll -> id+ IpynbOutputNone -> (filterIpynbOutput Nothing :)+ IpynbOutputBest -> (filterIpynbOutput (Just $+ if htmlFormat format+ then Format "html"+ else+ case format of+ "latex" -> Format "latex"+ "beamer" -> Format "latex"+ _ -> Format format) :))+ $ []++ let isPandocCiteproc (JSONFilter f) = takeBaseName f == "pandoc-citeproc"+ isPandocCiteproc _ = False++ when (any isPandocCiteproc filters) $+ report $ Deprecated "pandoc-citeproc filter"+ "Use --citeproc instead."++ let cslMetadata =+ maybe id (setMeta "csl") (optCSL opts) .+ (case optBibliography opts of+ [] -> id+ xs -> setMeta "bibliography" xs) .+ maybe id (setMeta "citation-abbreviations")+ (optCitationAbbreviations opts) $ mempty++ let filterEnv = Environment readerOpts writerOptions++ let inputParams = InputParameters+ { inputReader = reader+ , inputReaderName = readerNameBase+ , inputReaderOptions = readerOpts+ , inputSources = sources+ , inputFileScope = optFileScope opts+ , inputSpacesPerTab = if optPreserveTabs opts+ then Nothing+ else Just (optTabStop opts)+ }++ doc <- readInput inputParams+ >>= ( return . adjustMetadata (metadataFromFile <>)+ >=> return . adjustMetadata (<> optMetadata opts)+ >=> return . adjustMetadata (<> cslMetadata)+ >=> applyFilters scriptingEngine filterEnv filters [T.unpack format]+ >=> applyTransforms transforms+ >=> (if not (optSandbox opts) &&+ (isJust (optExtractMedia opts)+ || format == "docx") -- for fallback pngs+ then fillMediaBag+ else return)+ >=> maybe return extractMedia (optExtractMedia opts)+ )++ when (format == "docx" && not (optSandbox opts)) $ do+ createPngFallbacks (writerDpi writerOptions)++ output <- case writer of+ ByteStringWriter f+ | format == "chunkedhtml" -> ZipOutput <$> f writerOptions doc+ | otherwise -> BinaryOutput <$> f writerOptions doc+ TextWriter f -> case outputPdfProgram outputSettings of+ Just pdfProg | pdfOutput -> do+ res <- makePDF pdfProg (optPdfEngineOpts opts) f+ writerOptions doc+ case res of+ Right pdf -> return $ BinaryOutput pdf+ Left err' -> throwError $ PandocPDFError $+ TL.toStrict (TE.decodeUtf8With TE.lenientDecode err')++ _ -> do+ let ensureNl t+ | standalone = t+ | T.null t || T.last t /= '\n' = t <> T.singleton '\n'+ | otherwise = t+ textOutput <- ensureNl <$> f writerOptions doc+ if htmlFormat format &&+ (optSelfContained opts || optEmbedResources opts)+ then if optSandbox opts+ then sandbox' opts $+ TextOutput <$> makeSelfContained textOutput+ else TextOutput <$> makeSelfContained textOutput+ else return $ TextOutput textOutput+ reports <- getLog+ return (output, reports)++data PandocOutput =+ TextOutput Text+ | BinaryOutput BL.ByteString+ | ZipOutput BL.ByteString+ deriving (Show)++-- | Configure the common state+configureCommonState :: PandocMonad m => Maybe FilePath -> Opt -> m ()+configureCommonState datadir opts = do+ setUserDataDir datadir+ setTrace (optTrace opts)+ setVerbosity (optVerbosity opts)+ setResourcePath (optResourcePath opts)+ setInputFiles (fromMaybe ["-"] (optInputFiles opts))+ setOutputFile (optOutputFile opts)+ setNoCheckCertificate (optNoCheckCertificate opts)++ setRequestHeader "User-Agent" ("pandoc/" <> T.pack (showVersion pandocVersion))+ mapM_ (uncurry setRequestHeader) (optRequestHeaders opts)++ case lookupMetaString "lang" (optMetadata opts) of+ "" -> setTranslations $ Lang "en" Nothing (Just "US") [] [] []+ l -> case parseLang l of+ Left _ -> report $ InvalidLang l+ Right l' -> setTranslations l'++-- | Retrieves the set of abbreviations to be used by pandoc. These currently+-- only affect the Markdown reader.+readAbbreviations :: PandocMonad m => Maybe FilePath -> m (Set.Set Text)+readAbbreviations mbfilepath =+ (case mbfilepath of+ Nothing -> readDataFile "abbreviations"+ Just f -> readFileStrict f)+ >>= fmap (Set.fromList . filter (not . T.null) . T.lines) .+ toTextM (fromMaybe mempty mbfilepath)++createPngFallbacks :: (PandocMonad m, MonadIO m) => Int -> m ()+createPngFallbacks dpi = do+ -- create fallback pngs for svgs+ items <- mediaItems <$> getMediaBag+ forM_ items $ \(fp, mt, bs) ->+ case T.takeWhile (/=';') mt of+ "image/svg+xml" -> do+ res <- svgToPng dpi bs+ case res of+ Right bs' -> do+ let fp' = fp <> ".png"+ insertMedia fp' (Just "image/png") bs'+ Left e -> report $ CouldNotConvertImage (T.pack fp) (tshow e)+ _ -> return ()++getMetadataFromFiles :: PandocMonad m+ => Text -> ReaderOptions -> [FilePath] -> m Meta+getMetadataFromFiles readerFormat readerOpts = \case+ [] -> return mempty+ paths -> mconcat <$> do+ -- If format is markdown or commonmark, use the enabled extensions,+ -- otherwise treat metadata as pandoc markdown (see #7926, #6832)+ let readerOptsMeta =+ if readerFormat `elem` ["markdown", "commonmark"]+ then readerOpts+ else readerOpts{ readerExtensions = pandocExtensions }+ forM paths $ \path -> do+ raw <- readMetadataFile path+ yamlToMeta readerOptsMeta (Just path) raw++htmlFormat :: Text -> Bool+htmlFormat = (`elem` ["html","html4","html5","s5","slidy",+ "slideous","dzslides","revealjs"])++isTextFormat :: Text -> Bool+isTextFormat s = s `notElem` ["odt","docx","epub2","epub3","epub","pptx"]++adjustMetadata :: (Meta -> Meta) -> Pandoc -> Pandoc+adjustMetadata f (Pandoc meta bs) = Pandoc (f meta) bs++writeFnBinary :: FilePath -> BL.ByteString -> IO ()+writeFnBinary "-" = BL.putStr+writeFnBinary f = BL.writeFile (UTF8.encodePath f)++writerFn :: IO.Newline -> FilePath -> Text -> IO ()+writerFn eol "-" = UTF8.putStrWith eol+writerFn eol f = UTF8.writeFileWith eol f
@@ -0,0 +1,1315 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TupleSections #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE FlexibleContexts #-}+{- |+ Module : Text.Pandoc.App.CommandLineOptions+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley@edu>+ Stability : alpha+ Portability : portable++Does a pandoc conversion based on command-line options.+-}+module Text.Pandoc.App.CommandLineOptions (+ parseOptions+ , parseOptionsFromArgs+ , handleOptInfo+ , options+ , engines+ , setVariable+ , versionInfo+ ) where+import Control.Monad.Trans+import Control.Monad.State.Strict+import Data.Containers.ListUtils (nubOrd)+import Data.Aeson (eitherDecode)+import Data.Aeson.Encode.Pretty (encodePretty', Config(..), keyOrder,+ defConfig, Indent(..), NumberFormat(..))+import Data.Bifunctor (second)+import Data.Char (toLower)+import Data.List (intercalate, sort)+import qualified Data.List as L+#ifdef _WINDOWS+import Data.List (isPrefixOf)+#endif+import Data.Maybe (fromMaybe, isJust)+import Data.Text (Text)+import Safe (tailDef)+import Skylighting (Syntax (..), defaultSyntaxMap)+import System.Console.GetOpt+import System.Environment (getArgs, getProgName)+import System.Exit (exitSuccess)+import System.FilePath+import System.IO (stdout)+import Text.DocTemplates (Context (..), ToContext (toVal), Val (..))+import Text.Pandoc+import Text.Pandoc.Builder (setMeta)+import Data.Version (showVersion)+import Text.Pandoc.App.Opt (Opt (..), LineEnding (..), IpynbOutput (..),+ DefaultsState (..), applyDefaults,+ fullDefaultsPath, OptInfo(..))+import Text.Pandoc.Filter (Filter (..))+import Text.Pandoc.Highlighting (highlightingStyles, lookupHighlightingStyle)+import Text.Pandoc.Scripting (ScriptingEngine (..), customTemplate)+import Text.Pandoc.Shared (safeStrRead)+import Text.Printf+import qualified Control.Exception as E+import Control.Monad.Except (ExceptT(..), runExceptT, throwError)+import qualified Data.ByteString as BS+import qualified Data.ByteString.Lazy as B+import qualified Data.Map as M+import qualified Data.Set as Set+import qualified Data.Text as T+import qualified Text.Pandoc.UTF8 as UTF8++parseOptions :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)]+ -> Opt -> IO (Either OptInfo Opt)+parseOptions options' defaults = do+ rawArgs <- liftIO getArgs+ prg <- liftIO getProgName+ parseOptionsFromArgs options' defaults prg rawArgs++parseOptionsFromArgs+ :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)]+ -> Opt -> String -> [String] -> IO (Either OptInfo Opt)+parseOptionsFromArgs options' defaults prg rawArgs = do+ let (actions, args, unrecognizedOpts, errors) =+ getOpt' Permute options' (preprocessArgs rawArgs)++ let unknownOptionErrors =+ foldr (handleUnrecognizedOption . takeWhile (/= '=')) []+ unrecognizedOpts++ let mbArgs = case args of+ [] -> Nothing+ xs -> Just xs++ let adjustOpts opts =+ opts{ optInputFiles =+ map normalizePath <$> (optInputFiles opts <> mbArgs)+ , optStandalone = -- certain other options imply standalone+ optStandalone opts ||+ isJust (optTemplate opts) ||+ optSelfContained opts ||+ not (null (optIncludeInHeader opts)) ||+ not (null (optIncludeBeforeBody opts)) ||+ not (null (optIncludeAfterBody opts)) }++ if (null errors && null unknownOptionErrors)+ then -- thread option data structure through all supplied option actions+ runExceptT $ adjustOpts <$> (L.foldl' (>>=) (return defaults) actions)+ else return $ Left $ OptError $ PandocOptionError $ T.pack $+ concat errors ++ unlines unknownOptionErrors +++ ("Try " ++ prg ++ " --help for more information.")++-- | React to an 'OptInfo' by printing the requested information+-- and exiting or (if there was a parsing error) raising an error.+handleOptInfo :: ScriptingEngine -> OptInfo -> IO ()+handleOptInfo engine info = E.handle (handleError . Left) $ do+ case info of+ BashCompletion -> do+ datafiles <- getDataFileNames+ tpl <- runIOorExplode $+ UTF8.toString <$>+ readDefaultDataFile "bash_completion.tpl"+ let optnames (Option shorts longs _ _) =+ map (\c -> ['-',c]) shorts +++ map ("--" ++) longs+ let allopts = unwords (concatMap optnames options)+ UTF8.hPutStrLn stdout $ T.pack $ printf tpl allopts+ (T.unpack $ T.unwords readersNames)+ (T.unpack $ T.unwords writersNames)+ (T.unpack $ T.unwords $ map fst highlightingStyles)+ (unwords datafiles)+ ListInputFormats -> mapM_ (UTF8.hPutStrLn stdout) readersNames+ ListOutputFormats -> mapM_ (UTF8.hPutStrLn stdout) writersNames+ ListExtensions mbfmt -> do+ let formatName = fromMaybe "markdown" mbfmt+ let allExts = getAllExtensions formatName+ if formatName `notElem`+ (map fst (readers :: [(Text, Reader PandocPure)]) +++ map fst (writers :: [(Text, Writer PandocPure)]))+ then E.throwIO $ PandocOptionError $ formatName <>+ " is not a recognized reader or writer format"+ else do+ let defExts = getDefaultExtensions formatName+ let showExt x =+ (if extensionEnabled x defExts+ then '+'+ else if extensionEnabled x allExts+ then '-'+ else ' ') : drop 4 (show x)+ mapM_ (UTF8.hPutStrLn stdout . T.pack . showExt)+ (extensionsToList allExts)+ ListHighlightLanguages -> do+ let langs = [ T.unpack (T.toLower (sShortname s))+ | s <- M.elems defaultSyntaxMap+ , sShortname s `notElem`+ [T.pack "Alert", T.pack "Alert_indent"]+ ]+ mapM_ (UTF8.hPutStrLn stdout . T.pack) (sort langs)+ ListHighlightStyles -> do+ mapM_ (UTF8.hPutStrLn stdout . fst) highlightingStyles+ PrintDefaultTemplate mbout fmt -> do+ let write = maybe (UTF8.hPutStr stdout) (UTF8.writeFile) mbout++ templ <- runIO $+ case splitExtension (T.unpack fmt) of+ (_, "") -> do+ -- built-in format+ setUserDataDir Nothing+ getDefaultTemplate fmt+ _ -> do+ -- format looks like a filepath => custom writer+ components <- engineLoadCustom engine (T.unpack fmt)+ case customTemplate components of+ Just t -> pure t+ Nothing -> E.throw $ PandocNoTemplateError fmt+ case templ of+ Right t+ | T.null t -> -- e.g. for docx, odt, json:+ E.throwIO $ PandocCouldNotFindDataFileError $ T.pack+ ("templates/default." ++ T.unpack fmt)+ | otherwise -> write t+ Left e -> E.throwIO e+ PrintDefaultDataFile mbout f -> do+ let write = maybe BS.putStr BS.writeFile mbout+ runIOorExplode $ readDefaultDataFile (T.unpack f) >>= liftIO . write+ PrintHighlightStyle mbout styleName -> do+ let write = maybe B.putStr B.writeFile mbout+ sty <- runIOorExplode $ lookupHighlightingStyle (T.unpack styleName)+ write $ encodePretty'+ defConfig{confIndent = Spaces 4+ ,confCompare = keyOrder+ (map T.pack+ ["text-color"+ ,"background-color"+ ,"line-number-color"+ ,"line-number-background-color"+ ,"bold"+ ,"italic"+ ,"underline"+ ,"text-styles"])+ ,confNumFormat = Generic+ ,confTrailingNewline = True} sty+ VersionInfo -> versionInfo [] Nothing ""+ Help -> do+ prg <- getProgName+ mapM_ (UTF8.hPutStrLn stdout . T.stripEnd . T.pack) $+ lines $ usageMessage prg options+ OptError e -> E.throwIO e+ exitSuccess++-- | Supported LaTeX engines; the first item is used as default engine+-- when going through LaTeX.+latexEngines :: [String]+latexEngines = [ "pdflatex", "lualatex", "xelatex", "latexmk", "tectonic"+ , "pdflatex-dev", "lualatex-dev" ]++-- | Supported HTML PDF engines; the first item is used as default+-- engine when going through HTML.+htmlEngines :: [String]+htmlEngines = ["weasyprint", "wkhtmltopdf", "pagedjs-cli", "prince"]++engines :: [(Text, String)]+engines = map ("html",) htmlEngines +++ map ("html5",) htmlEngines +++ map ("latex",) latexEngines +++ map ("beamer",) latexEngines +++ [ ("ms", "groff")+ , ("ms", "pdfroff")+ , ("typst", "typst")+ , ("context", "context")+ ]++pdfEngines :: [String]+pdfEngines = nubOrd $ map snd engines++-- For motivation see #8956. We want to allow things like `-si` without+-- causing the `i` to be parsed as an optional boolean argument of `-s`.+-- This is for backwards compatibility given the addition of optional+-- boolean arguments in #8879.+preprocessArgs :: [String] -> [String]+preprocessArgs [] = []+preprocessArgs ("--":xs) = "--" : xs -- a bare '--' ends option parsing+-- note that -strue is interpreted as -strue while+-- -stmarkdown is interpreted as -s -tmarkdown+preprocessArgs (('-':c:d:cs):xs)+ | isShortBooleanOpt c+ , case toLower <$> (d:cs) of+ "true" -> True+ "false" -> True+ _ -> False+ = ('-':c:d:cs) : preprocessArgs xs+ | isShortBooleanOpt c+ , isShortOpt d = splitArg (c:d:cs) ++ preprocessArgs xs+preprocessArgs (x:xs) = x : preprocessArgs xs++isShortBooleanOpt :: Char -> Bool+isShortBooleanOpt = (`Set.member` shortBooleanOpts)+ where+ shortBooleanOpts =+ Set.fromList [c | Option [c] _ (OptArg _ "true|false") _ <- options]++isShortOpt :: Char -> Bool+isShortOpt = (`Set.member` shortOpts)+ where+ shortOpts = Set.fromList $ concat [cs | Option cs _ _ _ <- options]++splitArg :: String -> [String]+splitArg (c:d:cs)+ | isShortBooleanOpt c+ , isShortOpt d+ = ['-',c] : splitArg (d:cs)+splitArg (c:cs) = ['-':c:cs]+splitArg [] = []++-- | A list of functions, each transforming the options data structure+-- in response to a command-line option.+options :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)]+options =+ [ Option "fr" ["from","read"]+ (ReqArg+ (\arg opt -> return opt { optFrom = Just $ T.pack arg })+ "FORMAT")+ ""++ , Option "tw" ["to","write"]+ (ReqArg+ (\arg opt -> return opt { optTo = Just $ T.pack arg })+ "FORMAT")+ ""++ , Option "o" ["output"]+ (ReqArg+ (\arg opt -> return opt { optOutputFile =+ Just (normalizePath arg) })+ "FILE")+ "" -- "Name of output file"++ , Option "" ["data-dir"]+ (ReqArg+ (\arg opt -> return opt { optDataDir =+ Just (normalizePath arg) })+ "DIRECTORY") -- "Directory containing pandoc data files."+ ""++ , Option "M" ["metadata"]+ (ReqArg+ (\arg opt -> do+ let (key, val) = splitField arg+ return opt{ optMetadata = addMeta key val $+ optMetadata opt })+ "KEY[=VALUE]")+ ""++ , Option "" ["metadata-file"]+ (ReqArg+ (\arg opt -> return opt{ optMetadataFiles =+ optMetadataFiles opt ++ [normalizePath arg] })+ "FILE")+ ""++ , Option "d" ["defaults"]+ (ReqArg+ (\arg opt -> do+ res <- liftIO $ runIO $ do+ let defsState =+ DefaultsState { curDefaults = Nothing,+ inheritanceGraph = [] }+ fp <- fullDefaultsPath (optDataDir opt) arg+ evalStateT (applyDefaults opt fp) defsState+ case res of+ Left e -> optError e+ Right x -> return x+ )+ "FILE")+ ""++ , Option "" ["file-scope"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--file-scope" arg+ return opt { optFileScope = boolValue })+ "true|false")+ "" -- "Parse input files before combining"++ , Option "" ["sandbox"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--sandbox" arg+ return opt { optSandbox = boolValue })+ "true|false")+ ""++ , Option "s" ["standalone"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--standalone/-s" arg+ return opt { optStandalone = boolValue })+ "true|false")+ "" -- "Include needed header and footer on output"++ , Option "" ["template"]+ (ReqArg+ (\arg opt ->+ return opt{ optTemplate = Just (normalizePath arg) })+ "FILE")+ "" -- "Use custom template"++ , Option "V" ["variable"]+ (ReqArg+ (\arg opt -> do+ let (key, val) = splitField arg+ return opt{ optVariables =+ setVariable (T.pack key) (T.pack val) $+ optVariables opt })+ "KEY[=VALUE]")+ ""++ , Option "" ["variable-json"]+ (ReqArg+ (\arg opt -> do+ let (key, json) = splitField arg+ case eitherDecode (B.fromStrict . UTF8.fromString $ json) of+ Right (val :: Val Text) ->+ return opt{ optVariables =+ let Context m = optVariables opt+ in Context $ M.insert (T.pack key) val m }+ -- note that this replaces any existing value, which+ -- is different from what --variable does+ Left err' -> optError $ PandocOptionError $+ "Could not parse '" <> T.pack json <> "' as JSON:\n" <>+ T.pack err')+ "KEY[:JSON]")+ ""++ , Option "" ["wrap"]+ (ReqArg+ (\arg opt ->+ case arg of+ "auto" -> return opt{ optWrap = WrapAuto }+ "none" -> return opt{ optWrap = WrapNone }+ "preserve" -> return opt{ optWrap = WrapPreserve }+ _ -> optError $ PandocOptionError+ "--wrap must be auto, none, or preserve")+ "auto|none|preserve")+ "" -- "Option for wrapping text in output"++ , Option "" ["ascii"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--ascii" arg+ return opt { optAscii = boolValue })+ "true|false")+ "" -- "Prefer ASCII output"++ , Option "" ["toc", "table-of-contents"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--toc/--table-of-contents" arg+ return opt { optTableOfContents = boolValue })+ "true|false")+ "" -- "Include table of contents"++ , Option "" ["toc-depth"]+ (ReqArg+ (\arg opt ->+ case safeStrRead arg of+ Just t | t >= 1 && t <= 6 ->+ return opt { optTOCDepth = t }+ _ -> optError $ PandocOptionError+ "Argument of --toc-depth must be a number 1-6")+ "NUMBER")+ "" -- "Number of levels to include in TOC"++ , Option "" ["lof", "list-of-figures"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--lof/--list-of-figures" arg+ return opt { optListOfFigures = boolValue })+ "true|false")+ "" -- "Include list of figures"++ , Option "" ["lot", "list-of-tables"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--lot/--list-of-tables" arg+ return opt { optListOfTables = boolValue })+ "true|false")+ "" -- "Include list of tables"++ , Option "N" ["number-sections"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--number-sections/-N" arg+ return opt { optNumberSections = boolValue })+ "true|false")+ "" -- "Number sections"++ , Option "" ["number-offset"]+ (ReqArg+ (\arg opt ->+ case safeStrRead ("[" <> arg <> "]") of+ Just ns -> return opt { optNumberOffset = ns,+ optNumberSections = True }+ _ -> optError $ PandocOptionError+ "could not parse argument of --number-offset")+ "NUMBERS")+ "" -- "Starting number for sections, subsections, etc."++ , Option "" ["top-level-division"]+ (ReqArg+ (\arg opt ->+ case arg of+ "section" -> return opt{ optTopLevelDivision =+ TopLevelSection }+ "chapter" -> return opt{ optTopLevelDivision =+ TopLevelChapter }+ "part" -> return opt{ optTopLevelDivision =+ TopLevelPart }+ "default" -> return opt{ optTopLevelDivision =+ TopLevelDefault }+ _ -> optError $ PandocOptionError $+ "Argument of --top-level division must be " <>+ "section, chapter, part, or default" )+ "section|chapter|part")+ "" -- "Use top-level division type in LaTeX, ConTeXt, DocBook"++ , Option "" ["extract-media"]+ (ReqArg+ (\arg opt ->+ return opt { optExtractMedia =+ Just (normalizePath arg) })+ "PATH")+ "" -- "Directory to which to extract embedded media"++ , Option "" ["resource-path"]+ (ReqArg+ (\arg opt -> return opt { optResourcePath =+ splitSearchPath arg +++ optResourcePath opt })+ "SEARCHPATH")+ "" -- "Paths to search for images and other resources"++ , Option "H" ["include-in-header"]+ (ReqArg+ (\arg opt -> return opt{ optIncludeInHeader =+ optIncludeInHeader opt +++ [normalizePath arg] })+ "FILE")+ "" -- "File to include at end of header (implies -s)"++ , Option "B" ["include-before-body"]+ (ReqArg+ (\arg opt -> return opt{ optIncludeBeforeBody =+ optIncludeBeforeBody opt +++ [normalizePath arg] })+ "FILE")+ "" -- "File to include before document body"++ , Option "A" ["include-after-body"]+ (ReqArg+ (\arg opt -> return opt{ optIncludeAfterBody =+ optIncludeAfterBody opt +++ [normalizePath arg] })+ "FILE")+ "" -- "File to include after document body"++ , Option "" ["no-highlight"]+ (NoArg+ (\opt -> do+ deprecatedOption "--no-highlight"+ "Use --syntax-highlighting=none instead."+ return opt { optSyntaxHighlighting = NoHighlightingString }))+ "" -- "Don't highlight source code"++ , Option "" ["highlight-style"]+ (ReqArg+ (\arg opt -> do+ deprecatedOption "--highlight-style"+ "Use --syntax-highlighting instead."+ return opt{ optSyntaxHighlighting =+ T.pack $ normalizePath arg })+ "STYLE|FILE")+ "" -- "Style for highlighted code"++ , Option "" ["syntax-definition"]+ (ReqArg+ (\arg opt ->+ return opt{ optSyntaxDefinitions = normalizePath arg :+ optSyntaxDefinitions opt })+ "FILE")+ "" -- "Syntax definition (xml) file"++ , Option "" ["syntax-highlighting"]+ (ReqArg+ (\arg opt -> return opt{ optSyntaxHighlighting =+ T.pack $ normalizePath arg })+ "none|default|idiomatic|<stylename>|<themepath>")+ "" -- "syntax highlighting method for code"+++ , Option "" ["dpi"]+ (ReqArg+ (\arg opt ->+ case safeStrRead arg of+ Just t | t > 0 -> return opt { optDpi = t }+ _ -> optError $ PandocOptionError+ "Argument of --dpi must be a number greater than 0")+ "NUMBER")+ "" -- "Dpi (default 96)"++ , Option "" ["eol"]+ (ReqArg+ (\arg opt ->+ case toLower <$> arg of+ "crlf" -> return opt { optEol = CRLF }+ "lf" -> return opt { optEol = LF }+ "native" -> return opt { optEol = Native }+ -- mac-syntax (cr) is not supported in ghc-base.+ _ -> optError $ PandocOptionError+ "Argument of --eol must be crlf, lf, or native")+ "crlf|lf|native")+ "" -- "EOL (default OS-dependent)"++ , Option "" ["columns"]+ (ReqArg+ (\arg opt ->+ case safeStrRead arg of+ Just t | t > 0 -> return opt { optColumns = t }+ _ -> optError $ PandocOptionError+ "Argument of --columns must be a number greater than 0")+ "NUMBER")+ "" -- "Length of line in characters"++ , Option "p" ["preserve-tabs"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--preserve-tabs/-p" arg+ return opt { optPreserveTabs = boolValue })+ "true|false")+ "" -- "Preserve tabs instead of converting to spaces"++ , Option "" ["tab-stop"]+ (ReqArg+ (\arg opt ->+ case safeStrRead arg of+ Just t | t > 0 -> return opt { optTabStop = t }+ _ -> optError $ PandocOptionError+ "Argument of --tab-stop must be a number greater than 0")+ "NUMBER")+ "" -- "Tab stop (default 4)"++ , Option "" ["pdf-engine"]+ (ReqArg+ (\arg opt -> do+ let b = takeBaseName arg+ if b `elem` pdfEngines+ then return opt { optPdfEngine = Just arg }+ else optError $+ PandocOptionError $ T.pack $+ "Argument of --pdf-engine must be one of\n"+ ++ concatMap (\e -> "\t" <> e <> "\n") pdfEngines)+ "PROGRAM")+ "" -- "Name of program to use in generating PDF"++ , Option "" ["pdf-engine-opt"]+ (ReqArg+ (\arg opt -> do+ let oldArgs = optPdfEngineOpts opt+ return opt { optPdfEngineOpts = oldArgs ++ [arg]})+ "STRING")+ "" -- "Flags to pass to the PDF-engine, all instances of this option are accumulated and used"++ , Option "" ["reference-doc"]+ (ReqArg+ (\arg opt ->+ return opt { optReferenceDoc = Just $ normalizePath arg })+ "FILE")+ "" -- "Path of custom reference doc"++ , Option "" ["self-contained"]+ (OptArg+ (\arg opt -> do+ deprecatedOption "--self-contained" "use --embed-resources --standalone"+ boolValue <- readBoolFromOptArg "--self-contained" arg+ return opt { optSelfContained = boolValue })+ "true|false")+ "" -- "Make slide shows include all the needed js and css (deprecated)"++ , Option "" ["embed-resources"] -- maybe True (\argStr -> argStr == "true") arg+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--embed-resources" arg+ return opt { optEmbedResources = boolValue })+ "true|false")+ "" -- "Make slide shows include all the needed js and css"++ , Option "" ["link-images"] -- maybe True (\argStr -> argStr == "true") arg+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--link-images" arg+ return opt { optLinkImages = boolValue })+ "true|false")+ "" -- "Link images in ODT rather than embedding them"++ , Option "" ["request-header"]+ (ReqArg+ (\arg opt -> do+ let (key, val) = splitField arg+ return opt{ optRequestHeaders =+ (T.pack key, T.pack val) : optRequestHeaders opt })+ "NAME=VALUE")+ ""++ , Option "" ["no-check-certificate"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--no-check-certificate" arg+ return opt { optNoCheckCertificate = boolValue })+ "true|false")+ "" -- "Disable certificate validation"++ , Option "" ["abbreviations"]+ (ReqArg+ (\arg opt -> return opt { optAbbreviations =+ Just $ normalizePath arg })+ "FILE")+ "" -- "Specify file for custom abbreviations"++ , Option "" ["typst-input"]+ (ReqArg+ (\arg opt -> do+ let (key, val) = splitField arg+ return opt{ optTypstInputs = (T.pack key, T.pack val) : optTypstInputs opt })+ "KEY=VALUE")+ ""++ , Option "" ["indented-code-classes"]+ (ReqArg+ (\arg opt -> return opt { optIndentedCodeClasses = T.words $+ T.map (\c -> if c == ',' then ' ' else c) $+ T.pack arg })+ "STRING")+ "" -- "Classes (whitespace- or comma-separated) to use for indented code-blocks"++ , Option "" ["default-image-extension"]+ (ReqArg+ (\arg opt -> return opt { optDefaultImageExtension = T.pack arg })+ "extension")+ "" -- "Default extension for extensionless images"++ , Option "F" ["filter"]+ (ReqArg+ (\arg opt -> return opt { optFilters =+ optFilters opt ++ [JSONFilter (normalizePath arg)] })+ "PROGRAM")+ "" -- "External JSON filter"++ , Option "L" ["lua-filter"]+ (ReqArg+ (\arg opt -> return opt { optFilters =+ optFilters opt ++ [LuaFilter (normalizePath arg)] })+ "SCRIPTPATH")+ "" -- "Lua filter"++ , Option "" ["shift-heading-level-by"]+ (ReqArg+ (\arg opt ->+ case safeStrRead arg of+ Just t ->+ return opt{ optShiftHeadingLevelBy = t }+ _ -> optError $ PandocOptionError+ "Argument of --shift-heading-level-by must be an integer")+ "NUMBER")+ "" -- "Shift heading level"++ , Option "" ["base-header-level"]+ (ReqArg+ (\arg opt -> do+ deprecatedOption "--base-header-level"+ "Use --shift-heading-level-by instead."+ case safeStrRead arg of+ Just t | t > 0 && t < 6 ->+ return opt{ optShiftHeadingLevelBy = t - 1 }+ _ -> optError $ PandocOptionError+ "Argument of --base-header-level must be 1-5")+ "NUMBER")+ "" -- "Headers base level"++ , Option "" ["track-changes"]+ (ReqArg+ (\arg opt -> do+ action <- case arg of+ "accept" -> return AcceptChanges+ "reject" -> return RejectChanges+ "all" -> return AllChanges+ _ -> optError $ PandocOptionError $ T.pack+ "Argument of --track-changes must be accept, reject, or all"+ return opt { optTrackChanges = action })+ "accept|reject|all")+ "" -- "Accepting or reject MS Word track-changes.""++ , Option "" ["strip-comments"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--strip-comments" arg+ return opt { optStripComments = boolValue })+ "true|false")+ "" -- "Strip HTML comments"++ , Option "" ["reference-links"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--reference-links" arg+ return opt { optReferenceLinks = boolValue })+ "true|false")+ "" -- "Use reference links in parsing HTML"++ , Option "" ["reference-location"]+ (ReqArg+ (\arg opt -> do+ action <- case arg of+ "block" -> return EndOfBlock+ "section" -> return EndOfSection+ "document" -> return EndOfDocument+ _ -> optError $ PandocOptionError $ T.pack+ "Argument of --reference-location must be block, section, or document"+ return opt { optReferenceLocation = action })+ "block|section|document")+ "" -- "Specify where reference links and footnotes go"++ , Option "" ["figure-caption-position"]+ (ReqArg+ (\arg opt -> do+ pos <- case arg of+ "above" -> return CaptionAbove+ "below" -> return CaptionBelow+ _ -> optError $ PandocOptionError $ T.pack+ "Argument of --figure-caption-position must be above or below"+ return opt { optFigureCaptionPosition = pos })+ "above|below")+ "" -- "Specify where figure captions go"++ , Option "" ["table-caption-position"]+ (ReqArg+ (\arg opt -> do+ pos <- case arg of+ "above" -> return CaptionAbove+ "below" -> return CaptionBelow+ _ -> optError $ PandocOptionError $ T.pack+ "Argument of --table-caption-position must be above or below"+ return opt { optTableCaptionPosition = pos })+ "above|below")+ "" -- "Specify where table captions go"++ , Option "" ["markdown-headings"]+ (ReqArg+ (\arg opt -> do+ headingFormat <- case arg of+ "setext" -> pure True+ "atx" -> pure False+ _ -> optError $ PandocOptionError $ T.pack+ "Argument of --markdown-headings must be setext or atx"+ pure opt { optSetextHeaders = headingFormat }+ )+ "setext|atx")+ ""++ , Option "" ["list-tables"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--list-tables" arg+ return opt { optListTables = boolValue })+ "true|false")+ "" -- "Use list tables for RST"++ , Option "" ["listings"]+ (OptArg+ (\arg opt -> do+ deprecatedOption "--listings"+ "Use --syntax-highlighting=idiomatic instead."+ boolValue <- readBoolFromOptArg "--listings" arg+ return $+ if boolValue+ then opt { optSyntaxHighlighting =+ IdiomaticHighlightingString }+ else opt)+ "true|false")+ "" -- "Use listings package for LaTeX code blocks"++ , Option "i" ["incremental"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--incremental/-i" arg+ return opt { optIncremental = boolValue })+ "true|false")+ "" -- "Make list items display incrementally in Slidy/Slideous/S5"++ , Option "" ["slide-level"]+ (ReqArg+ (\arg opt ->+ case safeStrRead arg of+ Just t | t >= 0 && t <= 6 ->+ return opt { optSlideLevel = Just t }+ _ -> optError $ PandocOptionError+ "Argument of --slide-level must be a number between 0 and 6")+ "NUMBER")+ "" -- "Force header level for slides"++ , Option "" ["section-divs"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--section-divs" arg+ return opt { optSectionDivs = boolValue })+ "true|false")+ "" -- "Put sections in div tags in HTML"++ , Option "" ["html-q-tags"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--html-q-tags" arg+ return opt { optHtmlQTags = boolValue })+ "true|false")+ "" -- "Use <q> tags for quotes in HTML"++ , Option "" ["email-obfuscation"]+ (ReqArg+ (\arg opt -> do+ method <- case arg of+ "references" -> return ReferenceObfuscation+ "javascript" -> return JavascriptObfuscation+ "none" -> return NoObfuscation+ _ -> optError $ PandocOptionError $ T.pack+ "Argument of --email-obfuscation must be references, javascript, or none"+ return opt { optEmailObfuscation = method })+ "none|javascript|references")+ "" -- "Method for obfuscating email in HTML"++ , Option "" ["id-prefix"]+ (ReqArg+ (\arg opt -> return opt { optIdentifierPrefix = T.pack arg })+ "STRING")+ "" -- "Prefix to add to automatically generated HTML identifiers"++ , Option "T" ["title-prefix"]+ (ReqArg+ (\arg opt ->+ return opt {+ optVariables =+ setVariable "title-prefix" (T.pack arg) $+ optVariables opt,+ optStandalone = True })+ "STRING")+ "" -- "String to prefix to HTML window title"++ , Option "c" ["css"]+ (ReqArg+ (\arg opt -> return opt{ optCss = optCss opt ++ [arg] })+ -- add new link to end, so it is included in proper order+ "URL")+ "" -- "Link to CSS style sheet"++ , Option "" ["epub-subdirectory"]+ (ReqArg+ (\arg opt ->+ return opt { optEpubSubdirectory = arg })+ "DIRNAME")+ "" -- "Name of subdirectory for epub content in OCF container"++ , Option "" ["epub-cover-image"]+ (ReqArg+ (\arg opt ->+ return opt { optVariables =+ setVariable "epub-cover-image"+ (T.pack $ normalizePath arg) $+ optVariables opt })+ "FILE")+ "" -- "Path of epub cover image"++ , Option "" ["epub-title-page"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--epub-title-page" arg+ return opt{ optEpubTitlePage = boolValue })+ "true|false")+ ""++ , Option "" ["epub-metadata"]+ (ReqArg+ (\arg opt -> return opt { optEpubMetadata = Just $+ normalizePath arg })+ "FILE")+ "" -- "Path of epub metadata file"++ , Option "" ["epub-embed-font"]+ (ReqArg+ (\arg opt ->+ return opt{ optEpubFonts = normalizePath arg :+ optEpubFonts opt })+ "FILE")+ "" -- "Directory of fonts to embed"++ , Option "" ["split-level"]+ (ReqArg+ (\arg opt ->+ case safeStrRead arg of+ Just t | t >= 1 && t <= 6 ->+ return opt { optSplitLevel = t }+ _ -> optError $ PandocOptionError+ "Argument of --split-level must be a number between 1 and 6")+ "NUMBER")+ "" -- "Header level at which to split documents in chunked HTML or EPUB"++ , Option "" ["chunk-template"]+ (ReqArg+ (\arg opt ->+ return opt{ optChunkTemplate = Just (T.pack arg) })+ "PATHTEMPLATE")+ "" -- "Template for file paths in chunkedhtml"++ , Option "" ["epub-chapter-level"]+ (ReqArg+ (\arg opt -> do+ deprecatedOption "--epub-chapter-level"+ "use --split-level"+ case safeStrRead arg of+ Just t | t >= 1 && t <= 6 ->+ return opt { optSplitLevel = t }+ _ -> optError $ PandocOptionError+ "Argument of --epub-chapter-level must be a number between 1 and 6")+ "NUMBER")+ "" -- "Header level at which to split documents in chunked HTML or EPUB"++ , Option "" ["ipynb-output"]+ (ReqArg+ (\arg opt ->+ case arg of+ "all" -> return opt{ optIpynbOutput = IpynbOutputAll }+ "best" -> return opt{ optIpynbOutput = IpynbOutputBest }+ "none" -> return opt{ optIpynbOutput = IpynbOutputNone }+ _ -> optError $ PandocOptionError+ "Argument of --ipynb-output must be all, none, or best")+ "all|none|best")+ "" -- "Starting number for sections, subsections, etc."++ , Option "C" ["citeproc"]+ (NoArg+ (\opt -> return opt { optFilters =+ optFilters opt ++ [CiteprocFilter] }))+ "" -- "Process citations"++ , Option "" ["bibliography"]+ (ReqArg+ (\arg opt -> return opt{ optMetadata =+ addMeta "bibliography"+ (normalizePath arg) $+ optMetadata opt })+ "FILE")+ ""++ , Option "" ["csl"]+ (ReqArg+ (\arg opt -> do+ case lookupMeta (T.pack "csl") $ optMetadata opt of+ Just _ -> optError $ PandocOptionError+ "--csl option can only be used once"+ Nothing -> return opt{ optMetadata = addMeta "csl" (normalizePath arg) $+ optMetadata opt })+ "FILE")+ ""++ , Option "" ["citation-abbreviations"]+ (ReqArg+ (\arg opt ->+ return opt{ optMetadata =+ addMeta "citation-abbreviations"+ (normalizePath arg) $ optMetadata opt })+ "FILE")+ ""++ , Option "" ["natbib"]+ (NoArg+ (\opt -> return opt { optCiteMethod = Natbib }))+ "" -- "Use natbib cite commands in LaTeX output"++ , Option "" ["biblatex"]+ (NoArg+ (\opt -> return opt { optCiteMethod = Biblatex }))+ "" -- "Use biblatex cite commands in LaTeX output"++ , Option "" ["mathml"]+ (NoArg+ (\opt ->+ return opt { optHTMLMathMethod = MathML }))+ "" -- "Use mathml for HTML math"++ , Option "" ["webtex"]+ (OptArg+ (\arg opt -> do+ let url' = maybe defaultWebTeXURL T.pack arg+ return opt { optHTMLMathMethod = WebTeX url' })+ "URL")+ "" -- "Use web service for HTML math"++ , Option "" ["mathjax"]+ (OptArg+ (\arg opt -> do+ let url' = maybe defaultMathJaxURL T.pack arg+ return opt { optHTMLMathMethod = MathJax url'})+ "URL")+ "" -- "Use MathJax for HTML math"++ , Option "" ["katex"]+ (OptArg+ (\arg opt ->+ return opt+ { optHTMLMathMethod = KaTeX $+ maybe defaultKaTeXURL T.pack arg })+ "URL")+ "" -- Use KaTeX for HTML Math++ , Option "" ["gladtex"]+ (NoArg+ (\opt ->+ return opt { optHTMLMathMethod = GladTeX }))+ "" -- "Use gladtex for HTML math"++ , Option "" ["trace"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--trace" arg+ return opt { optTrace = boolValue })+ "true|false")+ "" -- "Turn on diagnostic tracing in readers."++ , Option "" ["dump-args"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--dump-args" arg+ return opt { optDumpArgs = boolValue })+ "true|false")+ "" -- "Print output filename and arguments to stdout."++ , Option "" ["ignore-args"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--ignore-args" arg+ return opt { optIgnoreArgs = boolValue })+ "true|false")+ "" -- "Ignore command-line arguments."++ , Option "" ["verbose"]+ (NoArg+ (\opt -> return opt { optVerbosity = INFO }))+ "" -- "Verbose diagnostic output."++ , Option "" ["quiet"]+ (NoArg+ (\opt -> return opt { optVerbosity = ERROR }))+ "" -- "Suppress warnings."++ , Option "" ["fail-if-warnings"]+ (OptArg+ (\arg opt -> do+ boolValue <- readBoolFromOptArg "--fail-if-warnings" arg+ return opt { optFailIfWarnings = boolValue })+ "true|false")+ "" -- "Exit with error status if there were warnings."++ , Option "" ["log"]+ (ReqArg+ (\arg opt -> return opt{ optLogFile = Just $+ normalizePath arg })+ "FILE")+ "" -- "Log messages in JSON format to this file."++ , Option "" ["bash-completion"]+ (NoArg (\_ -> optInfo BashCompletion))+ "" -- "Print bash completion script"++ , Option "" ["list-input-formats"]+ (NoArg (\_ -> optInfo ListInputFormats))+ ""++ , Option "" ["list-output-formats"]+ (NoArg (\_ -> optInfo ListOutputFormats))+ ""++ , Option "" ["list-extensions"]+ (OptArg (\arg _ -> optInfo $ ListExtensions $ T.pack <$> arg)+ "FORMAT")+ ""++ , Option "" ["list-highlight-languages"]+ (NoArg (\_ -> optInfo ListHighlightLanguages))+ ""++ , Option "" ["list-highlight-styles"]+ (NoArg (\_ -> optInfo ListHighlightStyles))+ ""++ , Option "D" ["print-default-template"]+ (ReqArg+ (\arg opts -> optInfo $+ PrintDefaultTemplate (optOutputFile opts) (T.pack arg))+ "FORMAT")+ "" -- "Print default template for FORMAT"++ , Option "" ["print-default-data-file"]+ (ReqArg+ (\arg opts -> optInfo $+ PrintDefaultDataFile (optOutputFile opts) (T.pack arg))+ "FILE")+ "" -- "Print default data file"++ , Option "" ["print-highlight-style"]+ (ReqArg+ (\arg opts ->+ optInfo $ PrintHighlightStyle (optOutputFile opts)+ (T.pack arg))+ "STYLE|FILE")+ "" -- "Print default template for FORMAT"++ , Option "v" ["version"]+ (NoArg (\_ -> optInfo VersionInfo))+ "" -- "Print version"++ , Option "h" ["help"]+ (NoArg (\_ -> optInfo Help))+ "" -- "Show help"+ ]++optError :: PandocError -> ExceptT OptInfo IO a+optError = throwError . OptError++optInfo :: OptInfo -> ExceptT OptInfo IO a+optInfo = throwError++-- Returns usage message+usageMessage :: String -> [OptDescr (Opt -> ExceptT OptInfo IO Opt)] -> String+usageMessage programName = usageInfo (programName ++ " [OPTIONS] [FILES]")++copyrightMessage :: String+copyrightMessage = intercalate "\n" [+ "Copyright (C) 2006-2025 John MacFarlane. Web: https://pandoc.org",+ "This is free software; see the source for copying conditions. There is no",+ "warranty, not even for merchantability or fitness for a particular purpose." ]++handleUnrecognizedOption :: String -> [String] -> [String]+handleUnrecognizedOption "--smart" =+ (("--smart/-S has been removed. Use +smart or -smart extension instead.\n" +++ "For example: pandoc -f markdown+smart -t markdown-smart.") :)+handleUnrecognizedOption "--normalize" =+ ("--normalize has been removed. Normalization is now automatic." :)+handleUnrecognizedOption "-S" = handleUnrecognizedOption "--smart"+handleUnrecognizedOption "--old-dashes" =+ ("--old-dashes has been removed. Use +old_dashes extension instead." :)+handleUnrecognizedOption "--no-wrap" =+ ("--no-wrap has been removed. Use --wrap=none instead." :)+handleUnrecognizedOption "--latex-engine" =+ ("--latex-engine has been removed. Use --pdf-engine instead." :)+handleUnrecognizedOption "--latex-engine-opt" =+ ("--latex-engine-opt has been removed. Use --pdf-engine-opt instead." :)+handleUnrecognizedOption "--chapters" =+ ("--chapters has been removed. Use --top-level-division=chapter instead." :)+handleUnrecognizedOption "--reference-docx" =+ ("--reference-docx has been removed. Use --reference-doc instead." :)+handleUnrecognizedOption "--reference-odt" =+ ("--reference-odt has been removed. Use --reference-doc instead." :)+handleUnrecognizedOption "--parse-raw" =+ ("--parse-raw/-R has been removed. Use +raw_html or +raw_tex extension.\n" :)+handleUnrecognizedOption "--epub-stylesheet" =+ ("--epub-stylesheet has been removed. Use --css instead.\n" :)+handleUnrecognizedOption "-R" = handleUnrecognizedOption "--parse-raw"+handleUnrecognizedOption x =+ (("Unknown option " ++ x ++ ".") :)++readersNames :: [Text]+readersNames = sort (map fst (readers :: [(Text, Reader PandocIO)]))++writersNames :: [Text]+writersNames = sort+ ("pdf" : map fst (writers :: [(Text, Writer PandocIO)]))++splitField :: String -> (String, String)+splitField = second (tailDef "true") . break (\c -> c == ':' || c == '=')++deprecatedOption :: String -> String -> ExceptT OptInfo IO ()+deprecatedOption o msg = do+ res <- liftIO $ runIO (report $ Deprecated (T.pack o) (T.pack msg))+ case res of+ Right () -> return ()+ Left e -> optError e++-- | Set text value in text context. Create list if it has a value already,+-- or add to a list value.+setVariable :: Text -> Text -> Context Text -> Context Text+setVariable key val (Context ctx) = Context $ M.alter go key ctx+ where go Nothing = Just $ toVal val+ go (Just (ListVal xs)) = Just $ ListVal $ xs ++ [toVal val]+ go (Just x) = Just $ ListVal [x, toVal val]++addMeta :: String -> String -> Meta -> Meta+addMeta k v meta =+ case lookupMeta k' meta of+ Nothing -> setMeta k' v' meta+ Just (MetaList xs) ->+ setMeta k' (MetaList (xs ++ [v'])) meta+ Just x -> setMeta k' (MetaList [x, v']) meta+ where+ v' = readMetaValue v+ k' = T.pack k++readMetaValue :: String -> MetaValue+readMetaValue s+ | s == "true" = MetaBool True+ | s == "True" = MetaBool True+ | s == "TRUE" = MetaBool True+ | s == "false" = MetaBool False+ | s == "False" = MetaBool False+ | s == "FALSE" = MetaBool False+ | otherwise = MetaString $ T.pack s++readBoolFromOptArg :: Text -> Maybe String -> ExceptT OptInfo IO Bool+readBoolFromOptArg opt = maybe (return True) readBoolFromArg+ where readBoolFromArg arg = case toLower <$> arg of+ "true" -> return True+ "false" -> return False+ _ -> optError $ PandocOptionError $+ "Argument of " <> opt <> " must be either true or false"++-- On Windows with ghc 8.6+, we need to rewrite paths+-- beginning with \\ to \\?\UNC\. -- See #5127.+normalizePath :: FilePath -> FilePath+#ifdef _WINDOWS+normalizePath fp =+ if "\\\\" `isPrefixOf` fp && not ("\\\\?\\" `isPrefixOf` fp)+ then "\\\\?\\UNC\\" ++ drop 2 fp+ else fp+#else+normalizePath = id+#endif++-- | Print version information with customizable features and scripting engine+versionInfo :: [String] -> Maybe String -> String -> IO ()+versionInfo features mbScriptingEngineName suffix = do+ defaultDatadir <- defaultUserDataDir+ let featuresLine = if null features+ then []+ else ["Features: " ++ unwords features]+ let scriptingLine = case mbScriptingEngineName of+ Nothing -> []+ Just name -> ["Scripting engine: " ++ name]+ UTF8.putStr $ T.unlines $ map T.pack $+ ["pandoc " ++ showVersion pandocVersion ++ suffix] +++ featuresLine +++ scriptingLine +++ ["User data directory: " ++ defaultDatadir,+ copyrightMessage]+ exitSuccess
@@ -0,0 +1,138 @@+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TupleSections #-}+{- |+ Module : Text.Pandoc.App.Input+ Copyright : © 2006-2024 John MacFarlane+ License : GPL-2.0-or-later+ Maintainer : John MacFarlane <jgm@berkeley@edu>++Read from the file system into a pandoc document.+-}+module Text.Pandoc.App.Input+ ( InputParameters (..)+ , readInput+ ) where++import Control.Monad ((>=>), when)+import Control.Monad.Except (throwError, catchError)+import Data.Text (Text)+import Network.URI (URI (..), parseURI)+import Text.Pandoc.Transforms (adjustLinksAndIds)+import Text.Pandoc.Class ( PandocMonad, openURL, toTextM+ , readFileStrict, readStdinStrict, report)+import Text.Pandoc.Definition (Pandoc)+import Text.Pandoc.Error (PandocError (..))+import Text.Pandoc.Logging (LogMessage (..))+import Text.Pandoc.MIME (getCharset, MimeType)+import Text.Pandoc.Options (ReaderOptions (..))+import Text.Pandoc.Readers (Reader (..))+import Text.Pandoc.Shared (tabFilter)+import Text.Pandoc.URI (uriPathToPath)+import qualified Data.ByteString as BS+import qualified Data.ByteString.Char8 as B8+import qualified Data.ByteString.Lazy as BL+import qualified Data.Text as T++-- | Settings specifying how and which input should be processed.+data InputParameters m = InputParameters+ { inputReader :: Reader m+ , inputReaderName :: Text+ , inputReaderOptions :: ReaderOptions+ , inputSources :: [FilePath]+ , inputSpacesPerTab :: Maybe Int+ , inputFileScope :: Bool+ }++-- | Read all input into a pandoc document.+readInput :: PandocMonad m => InputParameters m -> m Pandoc+readInput params = do+ let sources = inputSources params+ let readerName = inputReaderName params+ let readerOpts = inputReaderOptions params+ let convertTabs :: Text -> Text+ convertTabs = tabFilter $ case inputSpacesPerTab params of+ Nothing -> 0+ Just ts -> if readerName `elem` ["t2t", "man", "tsv"]+ then 0+ else ts++ inputs <- readSources sources++ case inputReader params of+ TextReader r+ | readerName == "json" ->+ mconcat <$> mapM (inputToText convertTabs >=> r readerOpts . (:[]))+ inputs+ | inputFileScope params ->+ mconcat <$> mapM+ (\source -> do+ (fp, txt) <- inputToText convertTabs source+ adjustLinksAndIds (readerExtensions readerOpts)+ (T.pack fp) (map (T.pack . fst) inputs)+ <$> r readerOpts [(fp, txt)])+ inputs+ | otherwise -> mapM (inputToText convertTabs) inputs >>= r readerOpts+ ByteStringReader r ->+ mconcat <$> mapM (r readerOpts . inputToLazyByteString) inputs++readSources :: PandocMonad m+ => [FilePath] -> m [(FilePath, (BS.ByteString, Maybe MimeType))]+readSources srcs =+ mapM (\fp -> do t <- readSource fp+ return (if fp == "-" then "" else fp, t)) srcs++-- | Read input from a resource, i.e., either a file, a URL, or stdin+-- (@-@).+readSource :: PandocMonad m+ => FilePath -> m (BS.ByteString, Maybe MimeType)+readSource "-" = (,Nothing) <$> readStdinStrict+readSource src =+ case parseURI src of+ Just u | uriScheme u `elem` ["http:","https:"] -> openURL (T.pack src)+ | uriScheme u == "file:" ->+ (,Nothing) <$>+ readFileStrict (uriPathToPath $ T.pack $ uriPath u)+ _ -> (,Nothing) <$> readFileStrict src++inputToText :: PandocMonad m+ => (Text -> Text)+ -> (FilePath, (BS.ByteString, Maybe MimeType))+ -> m (FilePath, Text)+inputToText convTabs (fp, (bs,mt)) =+ (fp,) . convTabs . T.filter (/='\r') <$>+ case mt >>= getCharset of+ Just "UTF-8" -> toTextM fp bs+ Just "ISO-8859-1" -> return $ T.pack $ B8.unpack bs+ Just charset -> throwError $ PandocUnsupportedCharsetError charset+ Nothing -> catchError+ (toTextM fp bs)+ (\case+ PandocUTF8DecodingError{} -> do+ when (hasKnownSignature bs) $+ throwError $+ PandocInputNotTextError (T.pack fp)+ report $ NotUTF8Encoded+ (if null fp+ then "input"+ else fp)+ return $ T.pack $ B8.unpack bs+ e -> throwError e)+ where+ -- "50 4B 03 04" is zip file signature+ isZip bs' = "\x50\x4B\x03\x04" `BS.isPrefixOf` bs'+ -- "25 50 44 46 2D" is PDF file signature+ isPDF bs' = "\x25\x50\x44\x46\x2D" `BS.isPrefixOf` bs'+ -- "D0 CF 11 E0 A1 B1 1A E1" is Compound File Binary Format signature used in+ -- variety of old Microsoft formats (.doc and .xls among others)+ isCFBF bs' = "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" `BS.isPrefixOf` bs'+ -- "41 54 26 54 46 4F 52 4D ?? ?? ?? ?? 44 4A 56" is DjVu signature+ isDjVu bs' = case BS.stripPrefix "\x41\x54\x26\x54\x46\x4F\x52\x4D" bs' of+ Nothing -> False+ Just x -> BS.isPrefixOf "\x44\x4A\x56" $ BS.drop 4 x++ hasKnownSignature bs' = any ($ bs') [isZip, isPDF, isCFBF, isDjVu]++inputToLazyByteString :: (FilePath, (BS.ByteString, Maybe MimeType))+ -> BL.ByteString+inputToLazyByteString (_, (bs,_)) = BL.fromStrict bs
@@ -0,0 +1,921 @@+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FlexibleContexts #-}+{- |+ Module : Text.Pandoc.App.Opt+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley@edu>+ Stability : alpha+ Portability : portable++Options for pandoc when used as an app.+-}+module Text.Pandoc.App.Opt (+ Opt(..)+ , OptInfo(..)+ , LineEnding (..)+ , IpynbOutput (..)+ , DefaultsState (..)+ , defaultOpts+ , applyDefaults+ , fullDefaultsPath+ ) where+import Control.Monad.Except (throwError)+import Control.Monad.Trans (MonadIO, liftIO, lift)+import Control.Monad ((>=>), foldM)+import Control.Monad.State.Strict (StateT, modify, gets)+import System.FilePath ( addExtension, (</>), takeExtension, takeDirectory )+import System.Directory ( canonicalizePath )+import Data.Char (toLower, isSpace)+import Data.Maybe (fromMaybe)+import GHC.Generics hiding (Meta)+import Text.Pandoc.Filter (Filter (..))+import Text.Pandoc.Logging (Verbosity (WARNING), LogMessage(..))+import Text.Pandoc.Options (TopLevelDivision (TopLevelDefault),+ TrackChanges (AcceptChanges),+ WrapOption (WrapAuto), HTMLMathMethod (PlainMath),+ ReferenceLocation (EndOfDocument),+ CaptionPosition (..),+ ObfuscationMethod (NoObfuscation),+ CiteMethod (Citeproc),+ pattern DefaultHighlightingString)+import Text.Pandoc.Class (readFileStrict, fileExists, setVerbosity, report,+ PandocMonad(lookupEnv), getUserDataDir)+import Text.Pandoc.Error (PandocError (PandocParseError, PandocSomeError))+import Data.Containers.ListUtils (nubOrd)+import Text.Pandoc.Data (defaultUserDataDir)+import qualified Text.Pandoc.Parsing as P+import Text.Pandoc.Readers.Metadata (yamlMap)+import Text.Pandoc.Class.PandocPure+import Text.DocTemplates (Context(..))+import Data.Text (Text, unpack)+import Data.Default (def)+import qualified Data.Text as T+import qualified Data.Map as M+import qualified Data.ByteString.Char8 as B8+import Text.Pandoc.Definition (Meta(..), MetaValue(..))+import Data.Aeson (defaultOptions, Options(..), Result(..),+ genericToJSON, fromJSON, camelTo2, eitherDecodeStrict)+import Data.Aeson.TH (deriveJSON)+import Control.Applicative ((<|>))+import Data.Yaml++-- | The type of line-endings to be used when writing plain-text.+data LineEnding = LF | CRLF | Native deriving (Show, Generic)++-- see https://github.com/jgm/pandoc/pull/4083+-- using generic deriving caused long compilation times+$(deriveJSON+ defaultOptions{ constructorTagModifier = map toLower } ''LineEnding)++-- | How to handle output blocks in ipynb.+data IpynbOutput =+ IpynbOutputAll+ | IpynbOutputNone+ | IpynbOutputBest+ deriving (Show, Generic)++$(deriveJSON+ defaultOptions{ fieldLabelModifier = map toLower . drop 11 } ''IpynbOutput)++-- | Option parser results requesting informational output.+data OptInfo =+ BashCompletion+ | ListInputFormats+ | ListOutputFormats+ | ListExtensions (Maybe Text)+ | ListHighlightLanguages+ | ListHighlightStyles+ | PrintDefaultTemplate (Maybe FilePath) Text+ | PrintDefaultDataFile (Maybe FilePath) Text+ | PrintHighlightStyle (Maybe FilePath) Text+ | VersionInfo+ | Help+ | OptError PandocError+ deriving (Show, Generic)++-- | Data structure for command line options.+data Opt = Opt+ { optTabStop :: Int -- ^ Number of spaces per tab+ , optPreserveTabs :: Bool -- ^ Preserve tabs instead of converting to spaces+ , optStandalone :: Bool -- ^ Include header, footer+ , optFrom :: Maybe Text -- ^ Reader format+ , optTo :: Maybe Text -- ^ Writer format+ , optTableOfContents :: Bool -- ^ Include table of contents+ , optListOfFigures :: Bool -- ^ Include list of figures+ , optListOfTables :: Bool -- ^ Include list of tables+ , optShiftHeadingLevelBy :: Int -- ^ Shift heading level by+ , optTemplate :: Maybe FilePath -- ^ Custom template+ , optVariables :: Context Text -- ^ Template variables to set+ , optMetadata :: Meta -- ^ Metadata fields to set+ , optMetadataFiles :: [FilePath] -- ^ Name of YAML metadata files+ , optOutputFile :: Maybe FilePath -- ^ Name of output file+ , optInputFiles :: Maybe [FilePath] -- ^ Names of input files+ , optNumberSections :: Bool -- ^ Number sections in LaTeX+ , optNumberOffset :: [Int] -- ^ Starting number for sections+ , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML+ , optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5+ , optSelfContained :: Bool -- ^ Make HTML accessible offline (deprecated)+ , optEmbedResources :: Bool -- ^ Make HTML accessible offline+ , optLinkImages :: Bool -- ^ Link ODT images rather than embedding+ , optHtmlQTags :: Bool -- ^ Use <q> tags in HTML+ , optSyntaxDefinitions :: [FilePath] -- ^ xml syntax defs to load+ , optSyntaxHighlighting :: Text -- ^ Syntax highlighting method for code+ , optTopLevelDivision :: TopLevelDivision -- ^ Type of the top-level divisions+ , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math+ , optAbbreviations :: Maybe FilePath -- ^ Path to abbrevs file+ , optReferenceDoc :: Maybe FilePath -- ^ Path of reference doc+ , optSplitLevel :: Int -- ^ Header level at which to split documents in epub and chunkedhtml+ , optChunkTemplate :: Maybe Text -- ^ Template to use for chunk filenames+ , optEpubSubdirectory :: String -- ^ EPUB subdir in OCF container+ , optEpubMetadata :: Maybe FilePath -- ^ EPUB metadata+ , optEpubFonts :: [FilePath] -- ^ EPUB fonts to embed+ , optEpubCoverImage :: Maybe FilePath -- ^ Cover image for epub+ , optEpubTitlePage :: Bool -- ^ INclude title page in EPUB+ , optTOCDepth :: Int -- ^ Number of levels to include in TOC+ , optDumpArgs :: Bool -- ^ Output command-line arguments+ , optIgnoreArgs :: Bool -- ^ Ignore command-line arguments+ , optVerbosity :: Verbosity -- ^ Verbosity of diagnostic output+ , optTrace :: Bool -- ^ Enable tracing+ , optLogFile :: Maybe FilePath -- ^ File to write JSON log output+ , optFailIfWarnings :: Bool -- ^ Fail on warnings+ , optReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst+ , optReferenceLocation :: ReferenceLocation -- ^ location for footnotes and link references in markdown output+ , optFigureCaptionPosition :: CaptionPosition -- ^ position for figure caption+ , optTableCaptionPosition :: CaptionPosition -- ^ position for table caption+ , optDpi :: Int -- ^ Dpi+ , optWrap :: WrapOption -- ^ Options for wrapping text+ , optColumns :: Int -- ^ Line length in characters+ , optFilters :: [Filter] -- ^ Filters to apply+ , optEmailObfuscation :: ObfuscationMethod+ , optIdentifierPrefix :: Text+ , optIndentedCodeClasses :: [Text] -- ^ Default classes for indented code blocks+ , optDataDir :: Maybe FilePath+ , optCiteMethod :: CiteMethod -- ^ Method to output cites+ , optPdfEngine :: Maybe String -- ^ Program to use for latex/html -> pdf+ , optPdfEngineOpts :: [String] -- ^ Flags to pass to the engine+ , optSlideLevel :: Maybe Int -- ^ Header level that creates slides+ , optSetextHeaders :: Bool -- ^ Use atx headers for markdown level 1-2+ , optListTables :: Bool -- ^ Use list tables for RST+ , optAscii :: Bool -- ^ Prefer ascii output+ , optDefaultImageExtension :: Text -- ^ Default image extension+ , optExtractMedia :: Maybe FilePath -- ^ Path to extract embedded media+ , optTrackChanges :: TrackChanges -- ^ Accept or reject MS Word track-changes.+ , optFileScope :: Bool -- ^ Parse input files before combining+ , optTitlePrefix :: Maybe Text -- ^ Prefix for title+ , optCss :: [FilePath] -- ^ CSS files to link to+ , optIpynbOutput :: IpynbOutput -- ^ How to treat ipynb output blocks+ , optIncludeBeforeBody :: [FilePath] -- ^ Files to include before+ , optIncludeAfterBody :: [FilePath] -- ^ Files to include after body+ , optIncludeInHeader :: [FilePath] -- ^ Files to include in header+ , optResourcePath :: [FilePath] -- ^ Path to search for images etc+ , optRequestHeaders :: [(Text, Text)] -- ^ Headers for HTTP requests+ , optNoCheckCertificate :: Bool -- ^ Disable certificate validation+ , optEol :: LineEnding -- ^ Style of line-endings to use+ , optStripComments :: Bool -- ^ Skip HTML comments+ , optCSL :: Maybe FilePath -- ^ CSL stylesheet+ , optBibliography :: [FilePath] -- ^ Bibliography files+ , optCitationAbbreviations :: Maybe FilePath -- ^ Citation abbreviations+ , optSandbox :: Bool+ , optTypstInputs :: [(Text, Text)] -- ^ List of parameter values for typst+ } deriving (Generic, Show)++instance FromJSON Opt where+ parseJSON = withObject "Opt" $ \o ->+ Opt+ <$> o .:? "tab-stop" .!= optTabStop defaultOpts+ <*> o .:? "preserve-tabs" .!= optPreserveTabs defaultOpts+ <*> o .:? "standalone" .!= optStandalone defaultOpts+ <*> o .:? "from"+ <*> o .:? "to"+ <*> o .:? "table-of-contents" .!= optTableOfContents defaultOpts+ <*> o .:? "list-of-figures" .!= optListOfFigures defaultOpts+ <*> o .:? "list-of-tables" .!= optListOfTables defaultOpts+ <*> o .:? "shift-heading-level-by" .!= optShiftHeadingLevelBy defaultOpts+ <*> o .:? "template"+ <*> o .:? "variables" .!= optVariables defaultOpts+ <*> o .:? "metadata" .!= optMetadata defaultOpts+ <*> o .:? "metadata-files" .!= optMetadataFiles defaultOpts+ <*> o .:? "output-file"+ <*> o .:? "input-files"+ <*> o .:? "number-sections" .!= optNumberSections defaultOpts+ <*> o .:? "number-offset" .!= optNumberOffset defaultOpts+ <*> o .:? "section-divs" .!= optSectionDivs defaultOpts+ <*> o .:? "incremental" .!= optIncremental defaultOpts+ <*> o .:? "self-contained" .!= optSelfContained defaultOpts+ <*> o .:? "embed-resources" .!= optEmbedResources defaultOpts+ <*> o .:? "link-images" .!= optLinkImages defaultOpts+ <*> o .:? "html-q-tags" .!= optHtmlQTags defaultOpts+ <*> o .:? "syntax-definitions" .!= optSyntaxDefinitions defaultOpts+ <*> o .:? "syntax-highlighting" .!= optSyntaxHighlighting defaultOpts+ <*> o .:? "top-level-division" .!= optTopLevelDivision defaultOpts+ <*> o .:? "html-math-method" .!= optHTMLMathMethod defaultOpts+ <*> o .:? "abbreviations"+ <*> o .:? "reference-doc"+ <*> ((o .:? "split-level") <|> (o .:? "epub-chapter-level"))+ .!= optSplitLevel defaultOpts+ <*> o .:? "chunk-template"+ <*> o .:? "epub-subdirectory" .!= optEpubSubdirectory defaultOpts+ <*> o .:? "epub-metadata"+ <*> o .:? "epub-fonts" .!= optEpubFonts defaultOpts+ <*> o .:? "epub-cover-image"+ <*> o .:? "epub-title-page" .!= optEpubTitlePage defaultOpts+ <*> o .:? "toc-depth" .!= optTOCDepth defaultOpts+ <*> o .:? "dump-args" .!= optDumpArgs defaultOpts+ <*> o .:? "ignore-args" .!= optIgnoreArgs defaultOpts+ <*> o .:? "verbosity" .!= optVerbosity defaultOpts+ <*> o .:? "trace" .!= optTrace defaultOpts+ <*> o .:? "log-file"+ <*> o .:? "fail-if-warnings" .!= optFailIfWarnings defaultOpts+ <*> o .:? "reference-links" .!= optReferenceLinks defaultOpts+ <*> o .:? "reference-location" .!= optReferenceLocation defaultOpts+ <*> o .:? "figure-caption-position" .!= optFigureCaptionPosition defaultOpts+ <*> o .:? "table-caption-position" .!= optTableCaptionPosition defaultOpts+ <*> o .:? "dpi" .!= optDpi defaultOpts+ <*> o .:? "wrap" .!= optWrap defaultOpts+ <*> o .:? "columns" .!= optColumns defaultOpts+ <*> o .:? "filters" .!= optFilters defaultOpts+ <*> o .:? "email-obfuscation" .!= optEmailObfuscation defaultOpts+ <*> o .:? "identifier-prefix" .!= optIdentifierPrefix defaultOpts+ <*> o .:? "indented-code-classes" .!= optIndentedCodeClasses defaultOpts+ <*> o .:? "data-dir"+ <*> o .:? "cite-method" .!= optCiteMethod defaultOpts+ <*> o .:? "pdf-engine"+ <*> o .:? "pdf-engine-opts" .!= optPdfEngineOpts defaultOpts+ <*> o .:? "slide-level"+ <*> o .:? "setext-headers" .!= optSetextHeaders defaultOpts+ <*> o .:? "list-tables" .!= optListTables defaultOpts+ <*> o .:? "ascii" .!= optAscii defaultOpts+ <*> o .:? "default-image-extension" .!= optDefaultImageExtension defaultOpts+ <*> o .:? "extract-media"+ <*> o .:? "track-changes" .!= optTrackChanges defaultOpts+ <*> o .:? "file-scope" .!= optFileScope defaultOpts+ <*> o .:? "title-prefix" .!= optTitlePrefix defaultOpts+ <*> o .:? "css" .!= optCss defaultOpts+ <*> o .:? "ipynb-output" .!= optIpynbOutput defaultOpts+ <*> o .:? "include-before-body" .!= optIncludeBeforeBody defaultOpts+ <*> o .:? "include-after-body" .!= optIncludeAfterBody defaultOpts+ <*> o .:? "include-in-header" .!= optIncludeInHeader defaultOpts+ <*> o .:? "resource-path" .!= optResourcePath defaultOpts+ <*> o .:? "request-headers" .!= optRequestHeaders defaultOpts+ <*> o .:? "no-check-certificate" .!= optNoCheckCertificate defaultOpts+ <*> o .:? "eol" .!= optEol defaultOpts+ <*> o .:? "strip-comments" .!= optStripComments defaultOpts+ <*> o .:? "csl"+ <*> o .:? "bibliography" .!= optBibliography defaultOpts+ <*> o .:? "citation-abbreviations"+ <*> o .:? "sandbox" .!= optSandbox defaultOpts+ <*> o .:? "typst-inputs" .!= optTypstInputs defaultOpts++instance ToJSON Opt where+ toJSON = genericToJSON defaultOptions{+ fieldLabelModifier = camelTo2 '-' . drop 3,+ omitNothingFields = True }+++instance FromJSON (Opt -> Opt) where+ parseJSON (Object m) =+ case fromJSON (Object m) of+ Error err' -> fail err'+ Success (m' :: M.Map Text Value) -> chain doOpt (M.toList m')+ parseJSON _ = fail "Expected a mapping"++data DefaultsState = DefaultsState+ {+ curDefaults :: Maybe FilePath -- currently parsed file+ , inheritanceGraph :: [[FilePath]] -- defaults file inheritance graph+ } deriving (Show)++instance (PandocMonad m, MonadIO m)+ => FromJSON (Opt -> StateT DefaultsState m Opt) where+ parseJSON (Object o) =+ case fromJSON (Object o) of+ Error err' -> fail err'+ Success (opts :: M.Map Text Value) -> do+ dataDir <- case M.lookup "data-dir" opts of+ Nothing -> return Nothing+ Just v -> Just . unpack <$> parseJSON v+ f <- parseOptions (M.toList opts)+ case M.lookup "defaults" opts of+ Just v -> do+ g <- parseDefaults v dataDir+ return $ g >=> f >=> resolveVarsInOpt+ Nothing -> return $ f >=> resolveVarsInOpt+ parseJSON _ = fail "Expected a mapping"++resolveVarsInOpt :: forall m. (PandocMonad m, MonadIO m)+ => Opt -> StateT DefaultsState m Opt+resolveVarsInOpt+ opt@Opt+ { optTo = oTo+ , optFrom = oFrom+ , optTemplate = oTemplate+ , optMetadataFiles = oMetadataFiles+ , optOutputFile = oOutputFile+ , optInputFiles = oInputFiles+ , optSyntaxDefinitions = oSyntaxDefinitions+ , optSyntaxHighlighting = oSyntaxHighlighting+ , optAbbreviations = oAbbreviations+ , optReferenceDoc = oReferenceDoc+ , optEpubMetadata = oEpubMetadata+ , optEpubFonts = oEpubFonts+ , optEpubCoverImage = oEpubCoverImage+ , optLogFile = oLogFile+ , optFilters = oFilters+ , optDataDir = oDataDir+ , optExtractMedia = oExtractMedia+ , optCss = oCss+ , optIncludeBeforeBody = oIncludeBeforeBody+ , optIncludeAfterBody = oIncludeAfterBody+ , optIncludeInHeader = oIncludeInHeader+ , optResourcePath = oResourcePath+ , optCSL = oCSL+ , optBibliography = oBibliography+ , optCitationAbbreviations = oCitationAbbreviations+ , optPdfEngine = oPdfEngine+ }+ = do+ oTo' <- mapM (fmap T.pack . resolveVars . T.unpack) oTo+ oFrom' <- mapM (fmap T.pack . resolveVars . T.unpack) oFrom+ oTemplate' <- mapM resolveVars oTemplate+ oMetadataFiles' <- mapM resolveVars oMetadataFiles+ oOutputFile' <- mapM resolveVars oOutputFile+ oInputFiles' <- mapM (mapM resolveVars) oInputFiles+ oSyntaxDefinitions' <- mapM resolveVars oSyntaxDefinitions+ oAbbreviations' <- mapM resolveVars oAbbreviations+ oReferenceDoc' <- mapM resolveVars oReferenceDoc+ oEpubMetadata' <- mapM resolveVars oEpubMetadata+ oEpubFonts' <- mapM resolveVars oEpubFonts+ oEpubCoverImage' <- mapM resolveVars oEpubCoverImage+ oLogFile' <- mapM resolveVars oLogFile+ oFilters' <- mapM resolveVarsInFilter oFilters+ oDataDir' <- mapM resolveVars oDataDir+ oExtractMedia' <- mapM resolveVars oExtractMedia+ oCss' <- mapM resolveVars oCss+ oIncludeBeforeBody' <- mapM resolveVars oIncludeBeforeBody+ oIncludeAfterBody' <- mapM resolveVars oIncludeAfterBody+ oIncludeInHeader' <- mapM resolveVars oIncludeInHeader+ oResourcePath' <- mapM resolveVars oResourcePath+ oCSL' <- mapM resolveVars oCSL+ oBibliography' <- mapM resolveVars oBibliography+ oCitationAbbreviations' <- mapM resolveVars oCitationAbbreviations+ oPdfEngine' <- mapM resolveVars oPdfEngine+ oSyntaxHighlighting' <- T.pack <$> resolveVars (T.unpack oSyntaxHighlighting)+ return opt{ optTo = oTo'+ , optFrom = oFrom'+ , optTemplate = oTemplate'+ , optMetadataFiles = oMetadataFiles'+ , optOutputFile = oOutputFile'+ , optInputFiles = oInputFiles'+ , optSyntaxDefinitions = oSyntaxDefinitions'+ , optSyntaxHighlighting = oSyntaxHighlighting'+ , optAbbreviations = oAbbreviations'+ , optReferenceDoc = oReferenceDoc'+ , optEpubMetadata = oEpubMetadata'+ , optEpubFonts = oEpubFonts'+ , optEpubCoverImage = oEpubCoverImage'+ , optLogFile = oLogFile'+ , optFilters = oFilters'+ , optDataDir = oDataDir'+ , optExtractMedia = oExtractMedia'+ , optCss = oCss'+ , optIncludeBeforeBody = oIncludeBeforeBody'+ , optIncludeAfterBody = oIncludeAfterBody'+ , optIncludeInHeader = oIncludeInHeader'+ , optResourcePath = oResourcePath'+ , optCSL = oCSL'+ , optBibliography = oBibliography'+ , optCitationAbbreviations = oCitationAbbreviations'+ , optPdfEngine = oPdfEngine'+ }++ where+ resolveVars = expandVars (optDataDir opt)+ resolveVarsInFilter (JSONFilter fp) =+ JSONFilter <$> resolveVars fp+ resolveVarsInFilter (LuaFilter fp) =+ LuaFilter <$> resolveVars fp+ resolveVarsInFilter CiteprocFilter = return CiteprocFilter+++expandVars :: (PandocMonad m, MonadIO m)+ => Maybe FilePath+ -> FilePath+ -> StateT DefaultsState m FilePath+expandVars _ [] = return []+expandVars mbDataDir ('$':'{':xs) =+ let (ys, zs) = break (=='}') xs+ in if null zs+ then return $ '$':'{':xs+ else do+ val <- expandEnv mbDataDir ys+ (val ++) <$> expandVars mbDataDir (drop 1 zs)+expandVars mbDataDir (c:cs) = (c:) <$> expandVars mbDataDir cs++expandEnv :: (PandocMonad m, MonadIO m)+ => Maybe FilePath+ -> String+ -> StateT DefaultsState m String+expandEnv _ "." = do+ mbCurDefaults <- gets curDefaults+ maybe (return "")+ (fmap takeDirectory . liftIO . canonicalizePath)+ mbCurDefaults+expandEnv mbDataDir "USERDATA" = do+ mbodatadir <- mapM (expandVars mbDataDir) mbDataDir+ mbdatadir' <- getUserDataDir+ defdatadir <- liftIO defaultUserDataDir+ return $ fromMaybe defdatadir (mbodatadir <|> mbdatadir')+expandEnv _ v = do+ mbval <- fmap T.unpack <$> lookupEnv (T.pack v)+ case mbval of+ Nothing -> do+ report $ EnvironmentVariableUndefined (T.pack v)+ return mempty+ Just x -> return x++++parseDefaults :: (PandocMonad m, MonadIO m)+ => Value+ -> Maybe FilePath+ -> Parser (Opt -> StateT DefaultsState m Opt)+parseDefaults n dataDir = parseDefsNames n >>= \ds -> return $ \o -> do+ -- get parent defaults:+ defsParent <- gets $ fromMaybe "" . curDefaults+ expandedDataDir <- mapM (expandVars dataDir) dataDir+ -- get child defaults:+ defsChildren <- mapM (\d -> expandVars expandedDataDir d >>= lift . fullDefaultsPath expandedDataDir) ds+ -- expand parent in defaults inheritance graph by children:+ defsGraph <- gets inheritanceGraph+ let defsGraphExp = expand defsGraph defsChildren defsParent+ modify $ \defsState -> defsState{ inheritanceGraph = defsGraphExp }+ -- check for cyclic inheritance:+ if cyclic defsGraphExp+ then throwError $+ PandocSomeError $ T.pack $+ "Error: Circular defaults file reference in " +++ "'" ++ defsParent ++ "'"+ else foldM applyDefaults o defsChildren+ where parseDefsNames x = (parseJSON x >>= \xs -> return $ map unpack xs)+ <|> (parseJSON x >>= \x' -> return [unpack x'])++parseOptions :: Monad m+ => [(Text, Value)]+ -> Parser (Opt -> StateT DefaultsState m Opt)+parseOptions ns = do+ f <- chain doOpt' ns+ return $ return . f++chain :: Monad m => (a -> m (b -> b)) -> [a] -> m (b -> b)+chain f = foldM g id+ where g o n = f n >>= \o' -> return $ o' . o++doOpt' :: (Text, Value) -> Parser (Opt -> Opt)+doOpt' (k,v) = do+ case k of+ "defaults" -> return id+ _ -> doOpt (k,v)++doOpt :: (Text, Value) -> Parser (Opt -> Opt)+doOpt (k,v) = do+ case k of+ "tab-stop" ->+ parseJSON v >>= \x -> return (\o -> o{ optTabStop = x })+ "preserve-tabs" ->+ parseJSON v >>= \x -> return (\o -> o{ optPreserveTabs = x })+ "standalone" ->+ parseJSON v >>= \x -> return (\o -> o{ optStandalone = x })+ "table-of-contents" ->+ parseJSON v >>= \x -> return (\o -> o{ optTableOfContents = x })+ "toc" ->+ parseJSON v >>= \x -> return (\o -> o{ optTableOfContents = x })+ "list-of-figures" ->+ parseJSON v >>= \x -> return (\o -> o{ optListOfFigures = x })+ "lof" ->+ parseJSON v >>= \x -> return (\o -> o{ optListOfFigures = x })+ "list-of-tables" ->+ parseJSON v >>= \x -> return (\o -> o{ optListOfTables = x })+ "lot" ->+ parseJSON v >>= \x -> return (\o -> o{ optListOfTables = x })+ "from" ->+ parseJSON v >>= \x -> return (\o -> o{ optFrom = x })+ "reader" ->+ parseJSON v >>= \x -> return (\o -> o{ optFrom = x })+ "to" ->+ parseJSON v >>= \x -> return (\o -> o{ optTo = x })+ "writer" ->+ parseJSON v >>= \x -> return (\o -> o{ optTo = x })+ "shift-heading-level-by" ->+ parseJSON v >>= \x -> return (\o -> o{ optShiftHeadingLevelBy = x })+ "template" ->+ parseJSON v >>= \x -> return (\o -> o{ optTemplate = unpack <$> x })+ "variables" ->+ parseJSON v >>= \x -> return (\o -> o{ optVariables =+ x <> optVariables o })+ -- Note: x comes first because <> for Context is left-biased union+ -- and we want to favor later default files. See #5988.+ "metadata" ->+ yamlToMeta v >>= \x -> return (\o -> o{ optMetadata = optMetadata o <> x })+ "metadata-files" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optMetadataFiles =+ optMetadataFiles o <>+ map unpack x })+ "metadata-file" -> -- allow either a list or a single value+ (parseJSON v >>= \x -> return (\o -> o{ optMetadataFiles =+ optMetadataFiles o <>+ map unpack x }))+ <|>+ (parseJSON v >>= \x ->+ return (\o -> o{ optMetadataFiles =+ optMetadataFiles o <>[unpack x] }))+ "output-file" ->+ parseJSON v >>= \x -> return (\o -> o{ optOutputFile = unpack <$> x })+ "input-files" ->+ parseJSON v >>= \x -> return (\o -> o{ optInputFiles =+ optInputFiles o <>+ (map unpack <$> x) })+ "input-file" -> -- allow either a list or a single value+ (parseJSON v >>= \x -> return (\o -> o{ optInputFiles =+ optInputFiles o <>+ (map unpack <$> x) }))+ <|>+ (parseJSON v >>= \x -> return (\o -> o{ optInputFiles =+ optInputFiles o <>+ ((\z -> [unpack z]) <$> x)+ }))+ "number-sections" ->+ parseJSON v >>= \x -> return (\o -> o{ optNumberSections = x })+ "number-offset" ->+ parseJSON v >>= \x -> return (\o -> o{ optNumberOffset = x })+ "section-divs" ->+ parseJSON v >>= \x -> return (\o -> o{ optSectionDivs = x })+ "incremental" ->+ parseJSON v >>= \x -> return (\o -> o{ optIncremental = x })+ "self-contained" ->+ parseJSON v >>= \x -> return (\o -> o{ optSelfContained = x })+ "embed-resources" ->+ parseJSON v >>= \x -> return (\o -> o{ optEmbedResources = x })+ "link-images" ->+ parseJSON v >>= \x -> return (\o -> o{ optLinkImages = x })+ "html-q-tags" ->+ parseJSON v >>= \x -> return (\o -> o{ optHtmlQTags = x })+ -- Deprecated+ "highlight-style" ->+ parseJSON v >>= \x -> return (\o -> o{ optSyntaxHighlighting = x })+ "syntax-definition" ->+ (parseJSON v >>= \x ->+ return (\o -> o{ optSyntaxDefinitions =+ optSyntaxDefinitions o <> map unpack x }))+ <|>+ (parseJSON v >>= \x ->+ return (\o -> o{ optSyntaxDefinitions =+ optSyntaxDefinitions o <> [unpack x] }))+ "syntax-definitions" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optSyntaxDefinitions =+ optSyntaxDefinitions o <> map unpack x })+ "syntax-highlighting" ->+ parseJSON v >>= \x -> return (\o -> o{ optSyntaxHighlighting = x })+ "top-level-division" ->+ parseJSON v >>= \x -> return (\o -> o{ optTopLevelDivision = x })+ "html-math-method" ->+ parseJSON v >>= \x -> return (\o -> o{ optHTMLMathMethod = x })+ "abbreviations" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optAbbreviations = unpack <$> x })+ "reference-doc" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optReferenceDoc = unpack <$> x })+ "epub-subdirectory" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optEpubSubdirectory = unpack x })+ "epub-metadata" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optEpubMetadata = unpack <$> x })+ "epub-fonts" ->+ parseJSON v >>= \x -> return (\o -> o{ optEpubFonts = optEpubFonts o <>+ map unpack x })+ "epub-chapter-level" ->+ parseJSON v >>= \x -> return (\o -> o{ optSplitLevel = x })+ "split-level" ->+ parseJSON v >>= \x -> return (\o -> o{ optSplitLevel = x })+ "chunk-template" ->+ parseJSON v >>= \x -> return (\o -> o{ optChunkTemplate = Just x })+ "epub-cover-image" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optEpubCoverImage = unpack <$> x })+ "epub-title-page" ->+ parseJSON v >>= \x -> return (\o -> o{ optEpubTitlePage = x })+ "toc-depth" ->+ parseJSON v >>= \x -> return (\o -> o{ optTOCDepth = x })+ "dump-args" ->+ parseJSON v >>= \x -> return (\o -> o{ optDumpArgs = x })+ "ignore-args" ->+ parseJSON v >>= \x -> return (\o -> o{ optIgnoreArgs = x })+ "verbosity" ->+ parseJSON v >>= \x -> return (\o -> o{ optVerbosity = x })+ "trace" ->+ parseJSON v >>= \x -> return (\o -> o{ optTrace = x })+ "log-file" ->+ parseJSON v >>= \x -> return (\o -> o{ optLogFile = unpack <$> x })+ "fail-if-warnings" ->+ parseJSON v >>= \x -> return (\o -> o{ optFailIfWarnings = x })+ "reference-links" ->+ parseJSON v >>= \x -> return (\o -> o{ optReferenceLinks = x })+ "reference-location" ->+ parseJSON v >>= \x -> return (\o -> o{ optReferenceLocation = x })+ "figure-caption-position" ->+ parseJSON v >>= \x -> return (\o -> o{ optFigureCaptionPosition = x })+ "table-caption-position" ->+ parseJSON v >>= \x -> return (\o -> o{ optTableCaptionPosition = x })+ "dpi" ->+ parseJSON v >>= \x -> return (\o -> o{ optDpi = x })+ "wrap" ->+ parseJSON v >>= \x -> return (\o -> o{ optWrap = x })+ "columns" ->+ parseJSON v >>= \x -> return (\o -> o{ optColumns = x })+ "filters" ->+ parseJSON v >>= \x -> return (\o -> o{ optFilters = optFilters o <> x })+ "citeproc" ->+ parseJSON v >>= \x ->+ if x+ then return (\o -> o{ optFilters = CiteprocFilter : optFilters o })+ else return id+ "email-obfuscation" ->+ parseJSON v >>= \x -> return (\o -> o{ optEmailObfuscation = x })+ "identifier-prefix" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optIdentifierPrefix = x })+ "indented-code-classes" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optIndentedCodeClasses = x })+ "data-dir" ->+ parseJSON v >>= \x -> return (\o -> o{ optDataDir = unpack <$> x })+ "cite-method" ->+ parseJSON v >>= \x -> return (\o -> o{ optCiteMethod = x })+ "listings" ->+ parseJSON v >>= \x ->+ if x+ then return (\o -> o{ optSyntaxHighlighting = "idiomatic" })+ else return id+ "pdf-engine" ->+ parseJSON v >>= \x -> return (\o -> o{ optPdfEngine = unpack <$> x })+ "pdf-engine-opts" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optPdfEngineOpts = map unpack x })+ "pdf-engine-opt" ->+ (parseJSON v >>= \x ->+ return (\o -> o{ optPdfEngineOpts = map unpack x }))+ <|>+ (parseJSON v >>= \x ->+ return (\o -> o{ optPdfEngineOpts = [unpack x] }))+ "slide-level" ->+ parseJSON v >>= \x -> return (\o -> o{ optSlideLevel = x })+ "markdown-headings" ->+ parseJSON v >>= \x -> return (\o ->+ case T.toLower x of+ "atx" -> o{ optSetextHeaders = False }+ "setext" -> o{ optSetextHeaders = True }+ _ -> o)+ "list-tables" ->+ parseJSON v >>= \x -> return (\o -> o{ optListTables = x })+ "ascii" ->+ parseJSON v >>= \x -> return (\o -> o{ optAscii = x })+ "default-image-extension" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optDefaultImageExtension = x })+ "extract-media" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optExtractMedia = unpack <$> x })+ "track-changes" ->+ parseJSON v >>= \x -> return (\o -> o{ optTrackChanges = x })+ "file-scope" ->+ parseJSON v >>= \x -> return (\o -> o{ optFileScope = x })+ "title-prefix" ->+ parseJSON v >>= \x -> return (\o -> o{ optTitlePrefix = x,+ optStandalone = True })+ "css" ->+ (parseJSON v >>= \x -> return (\o -> o{ optCss = optCss o <>+ map unpack x }))+ <|>+ (parseJSON v >>= \x -> return (\o -> o{ optCss = optCss o <>+ [unpack x] }))+ "bibliography" ->+ (parseJSON v >>= \x -> return (\o ->+ o{ optBibliography = optBibliography o <>+ map unpack x }))+ <|>+ (parseJSON v >>= \x -> return (\o ->+ o{ optBibliography = optBibliography o <>+ [unpack x] }))+ "csl" ->+ parseJSON v >>= \x -> return (\o -> o{ optCSL = unpack <$> x })+ "citation-abbreviations" ->+ parseJSON v >>= \x -> return (\o -> o{ optCitationAbbreviations =+ unpack <$> x })+ "ipynb-output" ->+ parseJSON v >>= \x -> return (\o -> o{ optIpynbOutput = x })+ "include-before-body" ->+ (parseJSON v >>= \x ->+ return (\o -> o{ optIncludeBeforeBody =+ optIncludeBeforeBody o <> map unpack x }))+ <|>+ (parseJSON v >>= \x ->+ return (\o -> o{ optIncludeBeforeBody =+ optIncludeBeforeBody o <> [unpack x] }))+ "include-after-body" ->+ (parseJSON v >>= \x ->+ return (\o -> o{ optIncludeAfterBody =+ optIncludeAfterBody o <> map unpack x }))+ <|>+ (parseJSON v >>= \x ->+ return (\o -> o{ optIncludeAfterBody =+ optIncludeAfterBody o <> [unpack x] }))+ "include-in-header" ->+ (parseJSON v >>= \x ->+ return (\o -> o{ optIncludeInHeader =+ optIncludeInHeader o <> map unpack x }))+ <|>+ (parseJSON v >>= \x ->+ return (\o -> o{ optIncludeInHeader =+ optIncludeInHeader o <> [unpack x] }))+ "resource-path" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optResourcePath = map unpack x <>+ optResourcePath o })+ "request-headers" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optRequestHeaders = x })+ "no-check-certificate" ->+ parseJSON v >>= \x ->+ return (\o -> o{ optNoCheckCertificate = x })+ "eol" ->+ parseJSON v >>= \x -> return (\o -> o{ optEol = x })+ "strip-comments" ->+ parseJSON v >>= \x -> return (\o -> o { optStripComments = x })+ "sandbox" ->+ parseJSON v >>= \x -> return (\o -> o { optSandbox = x })+ _ -> fail $ "Unknown option " ++ show k++-- | Defaults for command-line options.+defaultOpts :: Opt+defaultOpts = Opt+ { optTabStop = 4+ , optPreserveTabs = False+ , optStandalone = False+ , optFrom = Nothing+ , optTo = Nothing+ , optTableOfContents = False+ , optListOfFigures = False+ , optListOfTables = False+ , optShiftHeadingLevelBy = 0+ , optTemplate = Nothing+ , optVariables = mempty+ , optMetadata = mempty+ , optMetadataFiles = []+ , optOutputFile = Nothing+ , optInputFiles = Nothing+ , optNumberSections = False+ , optNumberOffset = []+ , optSectionDivs = False+ , optIncremental = False+ , optSelfContained = False+ , optEmbedResources = False+ , optLinkImages = False+ , optHtmlQTags = False+ , optSyntaxDefinitions = []+ , optSyntaxHighlighting = DefaultHighlightingString+ , optTopLevelDivision = TopLevelDefault+ , optHTMLMathMethod = PlainMath+ , optAbbreviations = Nothing+ , optReferenceDoc = Nothing+ , optSplitLevel = 1+ , optChunkTemplate = Nothing+ , optEpubSubdirectory = "EPUB"+ , optEpubMetadata = Nothing+ , optEpubFonts = []+ , optEpubCoverImage = Nothing+ , optEpubTitlePage = True+ , optTOCDepth = 3+ , optDumpArgs = False+ , optIgnoreArgs = False+ , optVerbosity = WARNING+ , optTrace = False+ , optLogFile = Nothing+ , optFailIfWarnings = False+ , optReferenceLinks = False+ , optReferenceLocation = EndOfDocument+ , optFigureCaptionPosition = CaptionBelow+ , optTableCaptionPosition = CaptionAbove+ , optDpi = 96+ , optWrap = WrapAuto+ , optColumns = 72+ , optFilters = []+ , optEmailObfuscation = NoObfuscation+ , optIdentifierPrefix = ""+ , optIndentedCodeClasses = []+ , optDataDir = Nothing+ , optCiteMethod = Citeproc+ , optPdfEngine = Nothing+ , optPdfEngineOpts = []+ , optSlideLevel = Nothing+ , optSetextHeaders = False+ , optListTables = False+ , optAscii = False+ , optDefaultImageExtension = ""+ , optExtractMedia = Nothing+ , optTrackChanges = AcceptChanges+ , optFileScope = False+ , optTitlePrefix = Nothing+ , optCss = []+ , optIpynbOutput = IpynbOutputBest+ , optIncludeBeforeBody = []+ , optIncludeAfterBody = []+ , optIncludeInHeader = []+ , optResourcePath = ["."]+ , optRequestHeaders = []+ , optNoCheckCertificate = False+ , optEol = Native+ , optStripComments = False+ , optCSL = Nothing+ , optBibliography = []+ , optCitationAbbreviations = Nothing+ , optSandbox = False+ , optTypstInputs = []+ }++yamlToMeta :: Value -> Parser Meta+yamlToMeta (Object o) =+ either (fail . show) return $ runEverything (yamlMap pMetaString o)+ where+ pMetaString = pure . MetaString <$> P.manyChar P.anyChar+ runEverything p =+ runPure (P.readWithM p (def :: P.ParserState) ("" :: Text))+ >>= fmap (Meta . flip P.runF def)+yamlToMeta _ = return mempty++-- | Apply defaults from --defaults file.+applyDefaults :: (PandocMonad m, MonadIO m)+ => Opt+ -> FilePath+ -> StateT DefaultsState m Opt+applyDefaults opt file = do+ setVerbosity $ optVerbosity opt+ modify $ \defsState -> defsState{ curDefaults = Just file }+ inp <- readFileStrict file+ let isJSON = B8.take 1 (B8.dropWhile isSpace inp) == "{"+ if isJSON+ then+ case eitherDecodeStrict inp of+ Right f -> f opt+ Left err' -> throwError $ PandocParseError $ T.pack $+ "Error parsing " <> file <> ":\n" <> err'+ else+ case decodeEither' (B8.unlines . takeWhile (/= "...") . B8.lines $ inp) of+ Right f -> f opt+ Left err' -> throwError $ PandocParseError $ T.pack $+ "Error parsing " <> file <> ":\n" <>+ Data.Yaml.prettyPrintParseException err'++fullDefaultsPath :: (PandocMonad m, MonadIO m)+ => Maybe FilePath+ -> FilePath+ -> m FilePath+fullDefaultsPath dataDir file = do+ let fp = if null (takeExtension file)+ then addExtension file "yaml"+ else file+ defaultDataDir <- liftIO defaultUserDataDir+ let defaultFp = fromMaybe defaultDataDir dataDir </> "defaults" </> fp+ fpExists <- fileExists fp+ if fpExists+ then return fp+ else do+ defaultFpExists <- fileExists defaultFp+ if defaultFpExists+ then return defaultFp+ else return fp++-- | In a list of lists, append another list in front of every list which+-- starts with specific element.+expand :: Ord a => [[a]] -> [a] -> a -> [[a]]+expand [] ns n = fmap (\x -> x : [n]) ns+expand ps ns n = concatMap (ext n ns) ps+ where+ ext x xs p = case p of+ (l : _) | x == l -> fmap (: p) xs+ _ -> [p]++cyclic :: Ord a => [[a]] -> Bool+cyclic = any hasDuplicate+ where+ hasDuplicate xs = length (nubOrd xs) /= length xs
@@ -0,0 +1,343 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TupleSections #-}+{- |+ Module : Text.Pandoc.App+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley@edu>+ Stability : alpha+ Portability : portable++Does a pandoc conversion based on command-line options.+-}+module Text.Pandoc.App.OutputSettings+ ( OutputSettings (..)+ , optToOutputSettings+ , sandbox'+ ) where+import qualified Data.Map as M+import qualified Data.Text as T+import Text.DocTemplates (toVal, Context(..), Val(..))+import qualified Control.Exception as E+import Control.Monad+import Control.Monad.Except (throwError, catchError)+import Control.Monad.Trans+import Data.Char (toLower)+import Data.List (find)+import Data.Maybe (catMaybes, fromMaybe)+import Skylighting (defaultSyntaxMap)+import Skylighting.Parser (addSyntaxDefinition, parseSyntaxDefinition)+import System.Directory (getCurrentDirectory)+import System.Exit (exitSuccess)+import System.FilePath+import System.IO (stdout)+import Text.Pandoc.Chunks (PathTemplate(..))+import Text.Pandoc+import Text.Pandoc.Filter (Filter(CiteprocFilter))+import Text.Pandoc.App.Opt (Opt (..))+import Text.Pandoc.App.CommandLineOptions (engines)+import Text.Pandoc.Format (FlavoredFormat (..), applyExtensionsDiff,+ parseFlavoredFormat, formatFromFilePaths)+import Text.Pandoc.Highlighting (lookupHighlightingStyle)+import Text.Pandoc.Scripting (ScriptingEngine (engineLoadCustom),+ CustomComponents(..))+import qualified Text.Pandoc.UTF8 as UTF8++readUtf8File :: PandocMonad m => FilePath -> m T.Text+readUtf8File fp = readFileStrict fp >>= toTextM fp++-- | Settings specifying how document output should be produced.+data OutputSettings m = OutputSettings+ { outputFormat :: T.Text+ , outputWriter :: Writer m+ , outputWriterOptions :: WriterOptions+ , outputPdfProgram :: Maybe String+ }++-- | Get output settings from command line options.+optToOutputSettings :: (PandocMonad m, MonadIO m)+ => ScriptingEngine -> Opt -> m (OutputSettings m)+optToOutputSettings scriptingEngine opts = do+ let outputFile = fromMaybe "-" (optOutputFile opts)++ when (optDumpArgs opts) . liftIO $ do+ UTF8.hPutStrLn stdout (T.pack outputFile)+ mapM_ (UTF8.hPutStrLn stdout . T.pack) (fromMaybe [] $ optInputFiles opts)+ exitSuccess++ epubMetadata <- traverse readUtf8File $ optEpubMetadata opts++ let pdfOutput = map toLower (takeExtension outputFile) == ".pdf" ||+ optTo opts == Just "pdf"+ let defaultOutput = "html"+ defaultOutputFlavor <- parseFlavoredFormat defaultOutput+ (flvrd@(FlavoredFormat format _extsDiff), maybePdfProg) <-+ if pdfOutput+ then do+ outflavor <- case optTo opts of+ Just x | x /= "pdf" -> Just <$> parseFlavoredFormat x+ _ -> pure Nothing+ liftIO $ pdfWriterAndProg outflavor (optPdfEngine opts)+ else case optTo opts of+ Just f -> (, optPdfEngine opts) <$> parseFlavoredFormat f+ Nothing+ | outputFile == "-" ->+ return (defaultOutputFlavor, optPdfEngine opts)+ | otherwise -> case formatFromFilePaths [outputFile] of+ Nothing -> do+ report $ CouldNotDeduceFormat+ [T.pack $ takeExtension outputFile] defaultOutput+ return (defaultOutputFlavor, optPdfEngine opts)+ Just f -> return (f, optPdfEngine opts)++ when (format == "asciidoctor") $ do+ report $ Deprecated "asciidoctor" "use asciidoc instead"++ let makeSandboxed pureWriter =+ case pureWriter of+ TextWriter w -> TextWriter $ \o d -> sandbox' opts (w o d)+ ByteStringWriter w -> ByteStringWriter $ \o d -> sandbox' opts (w o d)++ let standalone = optStandalone opts || isBinaryFormat format || pdfOutput+ let templateOrThrow = \case+ Left e -> throwError $ PandocTemplateError (T.pack e)+ Right t -> pure t+ let processCustomTemplate getDefault =+ case optTemplate opts of+ _ | not standalone -> return Nothing+ Nothing -> Just <$> getDefault+ Just tp -> do+ let getAndCompile fp =+ getTemplate fp >>= runWithPartials . compileTemplate fp >>=+ fmap Just . templateOrThrow+ catchError+ (getAndCompile tp)+ (\e ->+ if null (takeExtension tp)+ then getAndCompile (tp <.> T.unpack format)+ else throwError e)++ (writer, writerExts', mtemplate) <-+ if "lua" `T.isSuffixOf` format+ then do+ let path = T.unpack format+ components <- engineLoadCustom scriptingEngine path+ w <- case customWriter components of+ Nothing -> throwError $ PandocAppError $+ format <> " does not contain a custom writer"+ Just w -> return w+ let extsConf = fromMaybe mempty $ customExtensions components+ wexts <- applyExtensionsDiff extsConf flvrd+ templ <- processCustomTemplate $+ case customTemplate components of+ Nothing -> throwError $ PandocNoTemplateError format+ Just t -> runWithDefaultPartials (compileTemplate path t) >>=+ templateOrThrow+ return (w, wexts, templ)+ else+ if optSandbox opts+ then do+ tmpl <- processCustomTemplate (compileDefaultTemplate format)+ case runPure (getWriter flvrd) of+ Right (w, wexts) -> return (makeSandboxed w, wexts, tmpl)+ Left e -> throwError e+ else do+ (w, wexts) <- getWriter flvrd+ tmpl <- processCustomTemplate (compileDefaultTemplate format)+ return (w, wexts, tmpl)++ -- see #10662:+ let writerExts = if CiteprocFilter `elem` optFilters opts+ then disableExtension Ext_citations writerExts'+ else writerExts'++ let addSyntaxMap existingmap f = do+ res <- liftIO (parseSyntaxDefinition f)+ case res of+ Left errstr -> throwError $ PandocSyntaxMapError $ T.pack errstr+ Right syn -> return $ addSyntaxDefinition syn existingmap++ syntaxMap <- foldM addSyntaxMap defaultSyntaxMap+ (optSyntaxDefinitions opts)++ hlStyle <- case optSyntaxHighlighting opts of+ NoHighlightingString -> pure NoHighlighting+ DefaultHighlightingString -> pure DefaultHighlighting+ IdiomaticHighlightingString -> pure IdiomaticHighlighting+ style -> Skylighting <$> lookupHighlightingStyle (T.unpack style)++ let setListVariableM _ [] ctx = return ctx+ setListVariableM k vs ctx = do+ let ctxMap = unContext ctx+ return $ Context $+ case M.lookup k ctxMap of+ Just (ListVal xs) -> M.insert k+ (ListVal $ xs ++ map toVal vs) ctxMap+ Just v -> M.insert k+ (ListVal $ v : map toVal vs) ctxMap+ Nothing -> M.insert k (toVal vs) ctxMap++ let getTextContents fp = (fst <$> fetchItem (T.pack fp)) >>= toTextM fp++ let setFilesVariableM k fps ctx = do+ xs <- mapM getTextContents fps+ setListVariableM k xs ctx++ curdir <- liftIO getCurrentDirectory++ variables <-+ return (optVariables opts)+ >>=+ setListVariableM "sourcefile"+ (maybe ["-"] (fmap T.pack) (optInputFiles opts))+ >>=+ setVariableM "outputfile" (T.pack outputFile)+ >>=+ setVariableM "pandoc-version" pandocVersionText+ >>=+ maybe return (setVariableM "pdf-engine" . T.pack) maybePdfProg+ >>=+ setFilesVariableM "include-before" (optIncludeBeforeBody opts)+ >>=+ setFilesVariableM "include-after" (optIncludeAfterBody opts)+ >>=+ setFilesVariableM "header-includes" (optIncludeInHeader opts)+ >>=+ setListVariableM "css" (map T.pack $ optCss opts)+ >>=+ maybe return (setVariableM "title-prefix") (optTitlePrefix opts)+ >>=+ maybe return (setVariableM "epub-cover-image" . T.pack)+ (optEpubCoverImage opts)+ >>=+ setVariableM "curdir" (T.pack curdir)+ >>=+ (\vars -> if format == "dzslides"+ then do+ dztempl <-+ let fp = "dzslides" </> "template.html"+ in readDataFile fp >>= toTextM fp+ let dzline = "<!-- {{{{ dzslides core"+ let dzcore = T.unlines+ $ dropWhile (not . (dzline `T.isPrefixOf`))+ $ T.lines dztempl+ setVariableM "dzslides-core" dzcore vars+ else return vars)++ let writerOpts = WriterOptions+ { writerTemplate = mtemplate+ , writerVariables = variables+ , writerTabStop = optTabStop opts+ , writerTableOfContents = optTableOfContents opts+ , writerListOfFigures = optListOfFigures opts+ , writerListOfTables = optListOfTables opts+ , writerHTMLMathMethod = optHTMLMathMethod opts+ , writerIncremental = optIncremental opts+ , writerCiteMethod = optCiteMethod opts+ , writerNumberSections = optNumberSections opts+ , writerNumberOffset = optNumberOffset opts+ , writerSectionDivs = optSectionDivs opts+ , writerExtensions = writerExts+ , writerReferenceLinks = optReferenceLinks opts+ , writerReferenceLocation = optReferenceLocation opts+ , writerFigureCaptionPosition = optFigureCaptionPosition opts+ , writerTableCaptionPosition = optTableCaptionPosition opts+ , writerDpi = optDpi opts+ , writerWrapText = optWrap opts+ , writerColumns = optColumns opts+ , writerEmailObfuscation = optEmailObfuscation opts+ , writerIdentifierPrefix = optIdentifierPrefix opts+ , writerHtmlQTags = optHtmlQTags opts+ , writerTopLevelDivision = optTopLevelDivision opts+ , writerSlideLevel = optSlideLevel opts+ , writerHighlightMethod = hlStyle+ , writerSetextHeaders = optSetextHeaders opts+ , writerListTables = optListTables opts+ , writerEpubSubdirectory = T.pack $ optEpubSubdirectory opts+ , writerEpubMetadata = epubMetadata+ , writerEpubFonts = optEpubFonts opts+ , writerEpubTitlePage = optEpubTitlePage opts+ , writerSplitLevel = optSplitLevel opts+ , writerChunkTemplate = maybe (PathTemplate "%s-%i.html")+ PathTemplate+ (optChunkTemplate opts)+ , writerTOCDepth = optTOCDepth opts+ , writerReferenceDoc = optReferenceDoc opts+ , writerSyntaxMap = syntaxMap+ , writerPreferAscii = optAscii opts+ , writerLinkImages = optLinkImages opts+ }+ return $ OutputSettings+ { outputFormat = format+ , outputWriter = writer+ , outputWriterOptions = writerOpts+ , outputPdfProgram = maybePdfProg+ }++-- | Set text value in text context unless it is already set.+setVariableM :: Monad m+ => T.Text -> T.Text -> Context T.Text -> m (Context T.Text)+setVariableM key val (Context ctx) = return $ Context $ M.alter go key ctx+ where go Nothing = Just $ toVal val+ go (Just x) = Just x++pdfWriterAndProg :: Maybe FlavoredFormat -- ^ user-specified format+ -> Maybe String -- ^ user-specified pdf-engine+ -> IO (FlavoredFormat, Maybe String) -- ^ format, pdf-engine+pdfWriterAndProg mWriter mEngine =+ case go mWriter mEngine of+ Right (writ, prog) -> return (writ, Just prog)+ Left err -> liftIO $ E.throwIO $ PandocAppError err+ where+ go Nothing Nothing = Right+ (FlavoredFormat "latex" mempty, "pdflatex")+ go (Just writer) Nothing = (writer,) <$> engineForWriter writer+ go Nothing (Just engine) = (,engine) <$> writerForEngine (takeBaseName engine)+ go (Just writer) (Just engine) | isCustomWriter writer =+ -- custom writers can produce any format, so assume the user knows+ -- what they are doing.+ Right (writer, engine)+ go (Just writer) (Just engine) =+ case find (== (formatName writer, takeBaseName engine)) engines of+ Just _ -> Right (writer, engine)+ Nothing -> Left $ "pdf-engine " <> T.pack engine <>+ " is not compatible with output format " <>+ formatName writer++ writerForEngine eng = case [f | (f,e) <- engines, e == eng] of+ fmt : _ -> Right (FlavoredFormat fmt mempty)+ [] -> Left $+ "pdf-engine " <> T.pack eng <> " not known"++ engineForWriter (FlavoredFormat "pdf" _) = Left "pdf writer"+ engineForWriter w = case [e | (f,e) <- engines, f == formatName w] of+ eng : _ -> Right eng+ [] -> Left $+ "cannot produce pdf output from " <>+ formatName w++ isCustomWriter w = ".lua" `T.isSuffixOf` formatName w++isBinaryFormat :: T.Text -> Bool+isBinaryFormat s =+ s `elem` ["odt","docx","epub2","epub3","epub","pptx","pdf","chunkedhtml"]++-- Like 'sandbox', but computes the list of files to preserve from+-- 'Opt'.+sandbox' :: (PandocMonad m, MonadIO m) => Opt -> PandocPure a -> m a+sandbox' opts = sandbox sandboxedFiles+ where+ sandboxedFiles = catMaybes [ optReferenceDoc opts+ , optEpubMetadata opts+ , optEpubCoverImage opts+ , optCSL opts+ , optCitationAbbreviations opts+ ] +++ optEpubFonts opts +++ optBibliography opts
@@ -1,24 +1,6 @@-{--Copyright (C) 2013-2014 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.Asciify- Copyright : Copyright (C) 2013-2014 John MacFarlane+ Copyright : Copyright (C) 2013-2024 John MacFarlane License : GNU GPL, version 2 or above Maintainer : John MacFarlane <jgm@berkeley.edu>@@ -28,395 +10,23 @@ Function to convert accented latin letters to their unaccented ascii equivalents (used in constructing HTML identifiers). -}-module Text.Pandoc.Asciify (toAsciiChar)+module Text.Pandoc.Asciify (toAsciiChar, toAsciiText) where-import qualified Data.Map as M-import Data.Char (isAscii)+import Data.Char (isAscii, isMark)+import qualified Data.Text.Normalize as TN+import Data.Text (Text)+import qualified Data.Text as T -toAsciiChar :: Char -> Maybe Char-toAsciiChar c | isAscii c = Just c- | otherwise = M.lookup c asciiMap+toAsciiText :: Text -> Text+toAsciiText = T.filter isAscii . T.map specialCase . TN.normalize (TN.NFD)+ where+ specialCase '\x131' = 'i' -- Turkish undotted i+ specialCase c = c -asciiMap :: M.Map Char Char-asciiMap = M.fromList- [('\192','A')- ,('\193','A')- ,('\194','A')- ,('\195','A')- ,('\196','A')- ,('\197','A')- ,('\199','C')- ,('\200','E')- ,('\201','E')- ,('\202','E')- ,('\203','E')- ,('\204','I')- ,('\205','I')- ,('\206','I')- ,('\207','I')- ,('\209','N')- ,('\210','O')- ,('\211','O')- ,('\212','O')- ,('\213','O')- ,('\214','O')- ,('\217','U')- ,('\218','U')- ,('\219','U')- ,('\220','U')- ,('\221','Y')- ,('\224','a')- ,('\225','a')- ,('\226','a')- ,('\227','a')- ,('\228','a')- ,('\229','a')- ,('\231','c')- ,('\232','e')- ,('\233','e')- ,('\234','e')- ,('\235','e')- ,('\236','i')- ,('\237','i')- ,('\238','i')- ,('\239','i')- ,('\241','n')- ,('\242','o')- ,('\243','o')- ,('\244','o')- ,('\245','o')- ,('\246','o')- ,('\249','u')- ,('\250','u')- ,('\251','u')- ,('\252','u')- ,('\253','y')- ,('\255','y')- ,('\256','A')- ,('\257','a')- ,('\258','A')- ,('\259','a')- ,('\260','A')- ,('\261','a')- ,('\262','C')- ,('\263','c')- ,('\264','C')- ,('\265','c')- ,('\266','C')- ,('\267','c')- ,('\268','C')- ,('\269','c')- ,('\270','D')- ,('\271','d')- ,('\274','E')- ,('\275','e')- ,('\276','E')- ,('\277','e')- ,('\278','E')- ,('\279','e')- ,('\280','E')- ,('\281','e')- ,('\282','E')- ,('\283','e')- ,('\284','G')- ,('\285','g')- ,('\286','G')- ,('\287','g')- ,('\288','G')- ,('\289','g')- ,('\290','G')- ,('\291','g')- ,('\292','H')- ,('\293','h')- ,('\296','I')- ,('\297','i')- ,('\298','I')- ,('\299','i')- ,('\300','I')- ,('\301','i')- ,('\302','I')- ,('\303','i')- ,('\304','I')- ,('\308','J')- ,('\309','j')- ,('\310','K')- ,('\311','k')- ,('\313','L')- ,('\314','l')- ,('\315','L')- ,('\316','l')- ,('\317','L')- ,('\318','l')- ,('\323','N')- ,('\324','n')- ,('\325','N')- ,('\326','n')- ,('\327','N')- ,('\328','n')- ,('\332','O')- ,('\333','o')- ,('\334','O')- ,('\335','o')- ,('\336','O')- ,('\337','o')- ,('\340','R')- ,('\341','r')- ,('\342','R')- ,('\343','r')- ,('\344','R')- ,('\345','r')- ,('\346','S')- ,('\347','s')- ,('\348','S')- ,('\349','s')- ,('\350','S')- ,('\351','s')- ,('\352','S')- ,('\353','s')- ,('\354','T')- ,('\355','t')- ,('\356','T')- ,('\357','t')- ,('\360','U')- ,('\361','u')- ,('\362','U')- ,('\363','u')- ,('\364','U')- ,('\365','u')- ,('\366','U')- ,('\367','u')- ,('\368','U')- ,('\369','u')- ,('\370','U')- ,('\371','u')- ,('\372','W')- ,('\373','w')- ,('\374','Y')- ,('\375','y')- ,('\376','Y')- ,('\377','Z')- ,('\378','z')- ,('\379','Z')- ,('\380','z')- ,('\381','Z')- ,('\382','z')- ,('\416','O')- ,('\417','o')- ,('\431','U')- ,('\432','u')- ,('\461','A')- ,('\462','a')- ,('\463','I')- ,('\464','i')- ,('\465','O')- ,('\466','o')- ,('\467','U')- ,('\468','u')- ,('\486','G')- ,('\487','g')- ,('\488','K')- ,('\489','k')- ,('\490','O')- ,('\491','o')- ,('\496','j')- ,('\500','G')- ,('\501','g')- ,('\504','N')- ,('\505','n')- ,('\512','A')- ,('\513','a')- ,('\514','A')- ,('\515','a')- ,('\516','E')- ,('\517','e')- ,('\518','E')- ,('\519','e')- ,('\520','I')- ,('\521','i')- ,('\522','I')- ,('\523','i')- ,('\524','O')- ,('\525','o')- ,('\526','O')- ,('\527','o')- ,('\528','R')- ,('\529','r')- ,('\530','R')- ,('\531','r')- ,('\532','U')- ,('\533','u')- ,('\534','U')- ,('\535','u')- ,('\536','S')- ,('\537','s')- ,('\538','T')- ,('\539','t')- ,('\542','H')- ,('\543','h')- ,('\550','A')- ,('\551','a')- ,('\552','E')- ,('\553','e')- ,('\558','O')- ,('\559','o')- ,('\562','Y')- ,('\563','y')- ,('\894',';')- ,('\7680','A')- ,('\7681','a')- ,('\7682','B')- ,('\7683','b')- ,('\7684','B')- ,('\7685','b')- ,('\7686','B')- ,('\7687','b')- ,('\7690','D')- ,('\7691','d')- ,('\7692','D')- ,('\7693','d')- ,('\7694','D')- ,('\7695','d')- ,('\7696','D')- ,('\7697','d')- ,('\7698','D')- ,('\7699','d')- ,('\7704','E')- ,('\7705','e')- ,('\7706','E')- ,('\7707','e')- ,('\7710','F')- ,('\7711','f')- ,('\7712','G')- ,('\7713','g')- ,('\7714','H')- ,('\7715','h')- ,('\7716','H')- ,('\7717','h')- ,('\7718','H')- ,('\7719','h')- ,('\7720','H')- ,('\7721','h')- ,('\7722','H')- ,('\7723','h')- ,('\7724','I')- ,('\7725','i')- ,('\7728','K')- ,('\7729','k')- ,('\7730','K')- ,('\7731','k')- ,('\7732','K')- ,('\7733','k')- ,('\7734','L')- ,('\7735','l')- ,('\7738','L')- ,('\7739','l')- ,('\7740','L')- ,('\7741','l')- ,('\7742','M')- ,('\7743','m')- ,('\7744','M')- ,('\7745','m')- ,('\7746','M')- ,('\7747','m')- ,('\7748','N')- ,('\7749','n')- ,('\7750','N')- ,('\7751','n')- ,('\7752','N')- ,('\7753','n')- ,('\7754','N')- ,('\7755','n')- ,('\7764','P')- ,('\7765','p')- ,('\7766','P')- ,('\7767','p')- ,('\7768','R')- ,('\7769','r')- ,('\7770','R')- ,('\7771','r')- ,('\7774','R')- ,('\7775','r')- ,('\7776','S')- ,('\7777','s')- ,('\7778','S')- ,('\7779','s')- ,('\7786','T')- ,('\7787','t')- ,('\7788','T')- ,('\7789','t')- ,('\7790','T')- ,('\7791','t')- ,('\7792','T')- ,('\7793','t')- ,('\7794','U')- ,('\7795','u')- ,('\7796','U')- ,('\7797','u')- ,('\7798','U')- ,('\7799','u')- ,('\7804','V')- ,('\7805','v')- ,('\7806','V')- ,('\7807','v')- ,('\7808','W')- ,('\7809','w')- ,('\7810','W')- ,('\7811','w')- ,('\7812','W')- ,('\7813','w')- ,('\7814','W')- ,('\7815','w')- ,('\7816','W')- ,('\7817','w')- ,('\7818','X')- ,('\7819','x')- ,('\7820','X')- ,('\7821','x')- ,('\7822','Y')- ,('\7823','y')- ,('\7824','Z')- ,('\7825','z')- ,('\7826','Z')- ,('\7827','z')- ,('\7828','Z')- ,('\7829','z')- ,('\7830','h')- ,('\7831','t')- ,('\7832','w')- ,('\7833','y')- ,('\7840','A')- ,('\7841','a')- ,('\7842','A')- ,('\7843','a')- ,('\7864','E')- ,('\7865','e')- ,('\7866','E')- ,('\7867','e')- ,('\7868','E')- ,('\7869','e')- ,('\7880','I')- ,('\7881','i')- ,('\7882','I')- ,('\7883','i')- ,('\7884','O')- ,('\7885','o')- ,('\7886','O')- ,('\7887','o')- ,('\7908','U')- ,('\7909','u')- ,('\7910','U')- ,('\7911','u')- ,('\7922','Y')- ,('\7923','y')- ,('\7924','Y')- ,('\7925','y')- ,('\7926','Y')- ,('\7927','y')- ,('\7928','Y')- ,('\7929','y')- ,('\8175','`')- ,('\8490','K')- ,('\8800','=')- ,('\8814','<')- ,('\8815','>')- ]+toAsciiChar :: Char -> Maybe Char+toAsciiChar c = case T.unpack (TN.normalize TN.NFD (T.singleton c)) of+ (x:xs) | isAscii x+ , all isMark xs+ -> Just x+ ['\x131'] -> Just 'i' -- Turkish undotted i+ _ -> Nothing
@@ -0,0 +1,55 @@+{- |+Module : Text.Pandoc.CSS+Copyright : © 2006-2024 John MacFarlane <jgm@berkeley.edu>,+ 2015-2016 Mauro Bieg,+ 2015 Ophir Lifshitz <hangfromthefloor@gmail.com>+License : GNU GPL, version 2 or above++Maintainer : John MacFarlane <jgm@berkeley@edu>+Stability : alpha+Portability : portable++Tools for working with CSS.+-}+module Text.Pandoc.CSS+ ( cssAttributes+ , pickStyleAttrProps+ , pickStylesToKVs+ )+where++import Data.Either (fromRight)+import Data.Maybe (mapMaybe, listToMaybe)+import Data.Text (Text, pack)+import Text.Pandoc.Shared (trim)+import Text.Pandoc.Parsing++type Parser = Parsec Text ()++ruleParser :: Parser (Text, Text)+ruleParser = do+ p <- many1 (noneOf ":") <* char ':'+ v <- many1 (noneOf ":;") <* optional (char ';') <* spaces+ return (trim $ pack p, trim $ pack v)++styleAttrParser :: Parser [(Text, Text)]+styleAttrParser = many1 ruleParser++-- | Parses a style string, returning the CSS attributes.+-- Returns an empty list on failure.+cssAttributes :: Text -> [(Text, Text)]+cssAttributes styleString =+ fromRight [] $ parse styleAttrParser "" styleString++-- | takes a list of keys/properties and a CSS string and+-- returns the corresponding key-value-pairs.+pickStylesToKVs :: [Text] -> Text -> [(Text, Text)]+pickStylesToKVs props styleAttr =+ filter (\s -> fst s `elem` props) $ cssAttributes styleAttr++-- | takes a list of key/property synonyms and a CSS string and maybe+-- returns the value of the first match (in order of the supplied list)+pickStyleAttrProps :: [Text] -> Text -> Maybe Text+pickStyleAttrProps lookupProps styleAttr = do+ styles <- either (const Nothing) Just $ parse styleAttrParser "" styleAttr+ listToMaybe $ mapMaybe (`lookup` styles) lookupProps
@@ -0,0 +1,91 @@+{- |+ Module : Text.Pandoc.CSV+ Copyright : Copyright (C) 2017-2024 John MacFarlane <jgm@berkeley.edu>+ License : GNU GPL, version 2 or above+ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++Simple CSV parser.+-}++module Text.Pandoc.CSV (+ CSVOptions(..),+ defaultCSVOptions,+ parseCSV,+ ParseError+) where++import Control.Monad (unless, void, mzero)+import Data.Text (Text)+import qualified Data.Text as T+import Text.Pandoc.Parsing hiding (escaped)++type Parser = Parsec Text ()++data CSVOptions = CSVOptions{+ csvDelim :: Char+ , csvQuote :: Maybe Char+ , csvKeepSpace :: Bool -- treat whitespace following delim as significant+ , csvEscape :: Maybe Char -- default is to double up quote+} deriving (Read, Show)++defaultCSVOptions :: CSVOptions+defaultCSVOptions = CSVOptions{+ csvDelim = ','+ , csvQuote = Just '"'+ , csvKeepSpace = False+ , csvEscape = Nothing }++parseCSV :: CSVOptions -> Text -> Either ParseError [[Text]]+parseCSV opts t = parse (pCSV opts) "csv" t++pCSV :: CSVOptions -> Parser [[Text]]+pCSV opts =+ (pCSVRow opts `sepEndBy` endline) <* (spaces *> eof)++pCSVRow :: CSVOptions -> Parser [Text]+pCSVRow opts = do+ x <- pCSVCell opts+ xs <- (if T.null x then many1 else many) $ pCSVDelim opts *> pCSVCell opts+ return (x:xs)++pCSVCell :: CSVOptions -> Parser Text+pCSVCell opts = pCSVQuotedCell opts <|> pCSVUnquotedCell opts++pCSVQuotedCell :: CSVOptions -> Parser Text+pCSVQuotedCell opts =+ case csvQuote opts of+ Nothing -> mzero+ Just quotechar -> do+ char quotechar+ res <- many (satisfy (\c -> c /= quotechar &&+ Just c /= csvEscape opts) <|> escaped opts)+ char quotechar+ return $ T.pack res++escaped :: CSVOptions -> Parser Char+escaped opts =+ case csvEscape opts of+ Nothing ->+ case csvQuote opts of+ Nothing -> mzero+ Just q -> try $ char q >> char q+ Just c -> try $ char c >> noneOf "\r\n"++pCSVUnquotedCell :: CSVOptions -> Parser Text+pCSVUnquotedCell opts = T.pack <$>+ many (satisfy (\c -> c /= csvDelim opts && c /= '\r' && c /= '\n'))++pCSVDelim :: CSVOptions -> Parser ()+pCSVDelim opts = do+ char (csvDelim opts)+ let sp = case csvDelim opts of+ '\t' -> char ' '+ _ -> oneOf " \t"+ unless (csvKeepSpace opts) $ skipMany sp++endline :: Parser ()+endline = do+ optional (void $ char '\r')+ void $ char '\n'
@@ -0,0 +1,59 @@+{- |+ Module : Text.Pandoc.Char+ Copyright : Copyright (C) 2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++Character functions not defined in Data.Char.+-}+module Text.Pandoc.Char ( isCJK )+where++-- | Returns True if character is CJK. Matches anything in:+--+-- * CJK Unified Ideographs Basic Block: U+4E00 - U+9FFF+-- * CJK Unified Ideographs Extension A: U+3400 - U+4DBF+-- * CJK Unified Ideographs Extension B: U+20000 - U+2A6DF+-- * CJK Unified Ideographs Extension C: U+2A700 - U+2B73F+-- * CJK Unified Ideographs Extension D: U+2B740 - U+2B81F+-- * CJK Compatibility Ideographs: U+F900 - U+FAFF+-- * CJK Compatibility Ideographs Supplement: U+2F800 - U+2FA1F+isCJK :: Char -> Bool+isCJK c =+ c >= '\x4e00' &&+ ( (c >= '\x2e80' && c <= '\x2eff') -- CJK Radicals Supplement+ || (c >= '\x2f00' && c <= '\x2fdf') -- Kangxi Radicals+ || (c >= '\x2ff0' && c <= '\x2fff') -- Ideographic Description Characters+ || (c >= '\x3000' && c <= '\x303f') -- JK Symbols and Punctuation+ || (c >= '\x3040' && c <= '\x309f') -- Hiragana+ || (c >= '\x30a0' && c <= '\x30ff') -- Katakana+ || (c >= '\x3100' && c <= '\x312f') -- Bopomofo+ || (c >= '\x3130' && c <= '\x318f') -- Kanbun+ || (c >= '\x3190' && c <= '\x319f') -- Kanbun+ || (c >= '\x31c0' && c <= '\x31ef') -- CJK Strokes+ || (c >= '\x31f0' && c <= '\x31ff') -- Katakana Phonetic Extensions+ || (c >= '\x3200' && c <= '\x32ff') -- Enclosed CJK Letters & Months+ || (c >= '\x3300' && c <= '\x33ff') -- CJK Compatibility+ || (c >= '\x3400' && c <= '\x4dbf') -- CJK Unified Ideographs Extension A+ || (c >= '\x4e00' && c <= '\x9fff') -- CJK Unified Ideographs+ || (c >= '\xa000' && c <= '\xa48f') -- Yi Syllables+ || (c >= '\xa490' && c <= '\xa4cf') -- Yi Radicals+ || (c >= '\xf900' && c <= '\xfaff') -- CJK Compatibility Ideographs+ || (c >= '\xfe10' && c <= '\xfe1f') -- Vertical forms+ || (c >= '\xfe30' && c <= '\xfe4f') -- CJK Compatibility Forms+ || (c >= '\xFE50' && c <= '\xFE6F') -- Small Form Variants+ || (c >= '\xFF00' && c <= '\xFFEE') -- Halfwidth and Fullwidth Forms+ || (c >= '\x1B000' && c <= '\x1B0FF') -- Kana Supplement+ || (c >= '\x1B100' && c <= '\x1B12F') -- Kana Extended-A+ || (c >= '\x1B130' && c <= '\x1B16F') -- Small Kana Extension+ || (c >= '\x20000' && c <= '\x2A6DF') -- CJK Unified Ideographs Extension B+ || (c >= '\x2A700' && c <= '\x2B73F') -- CJK Unified Ideographs Extension C+ || (c >= '\x2B740' && c <= '\x2B81F') -- CJK Unified Ideographs Extension D+ || (c >= '\x2B820' && c <= '\x2CEAF') -- CJK Unified Ideographs Extension E+ || (c >= '\x2CEB0' && c <= '\x2EBEF') -- CJK Unified Ideographs Extension F+ || (c >= '\x2F800' && c <= '\x2FA1F') -- CJK Compatibility Ideographs Supp+ || (c >= '\x30000' && c <= '\x3134F') -- CJK Unified Ideographs Exten+ )
@@ -0,0 +1,444 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{- |+ Module : Text.Pandoc.Chunks+ Copyright : Copyright (C) 2022-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++Functions and types for splitting a Pandoc into subdocuments,+e.g. for conversion into a set of HTML pages.+-}+module Text.Pandoc.Chunks+ ( Chunk(..)+ , ChunkedDoc(..)+ , PathTemplate(..)+ , splitIntoChunks+ , toTOCTree+ , tocToList+ , SecInfo(..)+ ) where++import Text.Pandoc.Definition+import Text.Pandoc.Shared (makeSections, stringify, inlineListToIdentifier,+ tshow, uniqueIdent)+import Text.Pandoc.Walk (Walkable(..), query)+import Data.Aeson (FromJSON, ToJSON)+import Data.Text (Text)+import Text.Printf (printf)+import Data.Maybe (fromMaybe, isNothing)+import qualified Data.Map as M+import qualified Data.Text as T+import Data.String (IsString)+import GHC.Generics (Generic)+import Text.HTML.TagSoup (Tag (TagOpen), fromAttrib, parseTags)+import Data.Tree (Tree(..))+import Data.Data (Data)+import Data.Typeable (Typeable)+import qualified Data.Set as Set+import Control.Monad.State++-- | Split 'Pandoc' into 'Chunk's, e.g. for conversion into+-- a set of HTML pages or EPUB chapters.+splitIntoChunks :: PathTemplate -- ^ Template for filepath+ -> Bool -- ^ Number sections+ -> Maybe Int -- ^ Base heading level+ -> Int -- ^ Chunk level -- level of section to split at+ -> Pandoc+ -> ChunkedDoc+splitIntoChunks pathTemplate numberSections mbBaseLevel+ chunklev (Pandoc meta blocks) =+ addNav .+ fixInternalReferences .+ walk rmNavAttrs $+ ChunkedDoc{ chunkedMeta = meta+ , chunkedChunks = chunks+ , chunkedTOC = tocTree }+ where+ tocTree = fixTOCTreePaths chunks $ toTOCTree sections+ chunks = makeChunks chunklev pathTemplate meta $ sections+ sections = ensureIds $ makeSections numberSections mbBaseLevel blocks++-- The TOC won't work if we don't have unique identifiers for all sections.+ensureIds :: [Block] -> [Block]+ensureIds bs = evalState (walkM go bs) mempty+ where+ go :: Block -> State (Set.Set Text) Block+ go b@(Div (ident,"section":cls,kvs) bs'@(Header _ _ ils : _))+ | T.null ident+ = do ids <- get+ let newid = uniqueIdent mempty ils ids+ modify $ Set.insert newid+ pure $ Div (newid,"section":cls,kvs) bs'+ | otherwise+ = do modify $ Set.insert ident+ pure b+ go b = pure b++-- | Add chunkNext, chunkPrev, chunkUp+addNav :: ChunkedDoc -> ChunkedDoc+addNav chunkedDoc =+ chunkedDoc{ chunkedChunks =+ addNext . addPrev . addUp $ chunkedChunks chunkedDoc }++addUp :: [Chunk] -> [Chunk]+addUp (c : d : ds)+ | chunkLevel c < chunkLevel d+ = c : addUp (d{ chunkUp = Just c } : ds)+ | chunkLevel c == chunkLevel d+ = c : addUp (d{ chunkUp = chunkUp c} : ds)+addUp (c:cs) = c : addUp cs+addUp [] = []++addNext :: [Chunk] -> [Chunk]+addNext cs = zipWith go cs (map Just (drop 1 cs) ++ [Nothing])+ where+ go c nxt = c{ chunkNext = nxt }++addPrev :: [Chunk] -> [Chunk]+addPrev cs = zipWith go cs (Nothing : map Just cs)+ where+ go c prev = c{ chunkPrev = prev }++-- | Fix internal references so they point to the path of the chunk.+fixInternalReferences :: ChunkedDoc -> ChunkedDoc+fixInternalReferences chunkedDoc = walk fixInternalRefs chunkedDoc+ where+ fixInternalRefs :: Inline -> Inline+ fixInternalRefs il@(Link attr ils (src,tit))+ = case T.uncons src of+ Just ('#', ident) -> Link attr ils (src', tit)+ where src' = case M.lookup ident refMap of+ Just chunk -> T.pack (chunkPath chunk) <> src+ Nothing -> src+ _ -> il+ fixInternalRefs il = il++ refMap = foldr chunkToRefs mempty (chunkedChunks chunkedDoc)++ chunkToRefs chunk m =+ let idents = chunkId chunk : getIdents (chunkContents chunk)+ in foldr (\ident -> M.insert ident chunk) m idents++ getIdents bs = query getBlockIdent bs ++ query getInlineIdent bs++ getBlockIdent :: Block -> [Text]+ getBlockIdent (Div (ident, _, _) _)+ | not (T.null ident) = [ident]+ getBlockIdent (Header _ (ident, _, _) _)+ | not (T.null ident) = [ident]+ getBlockIdent (Table (ident,_,_) _ _ _ _ _)+ | not (T.null ident) = [ident]+ getBlockIdent (RawBlock fmt raw)+ | isHtmlFormat fmt+ = foldr (\tag ->+ case tag of+ TagOpen{} ->+ case fromAttrib "id" tag of+ "" -> id+ x -> (x:)+ _ -> id)+ [] (parseTags raw)+ getBlockIdent _ = []++ getInlineIdent :: Inline -> [Text]+ getInlineIdent (Span (ident, _, _) _)+ | not (T.null ident) = [ident]+ getInlineIdent (Link (ident, _, _) _ _)+ | not (T.null ident) = [ident]+ getInlineIdent (Image (ident, _, _) _ _)+ | not (T.null ident) = [ident]+ getInlineIdent (RawInline fmt raw)+ | isHtmlFormat fmt+ = foldr (\tag ->+ case tag of+ TagOpen{} ->+ case fromAttrib "id" tag of+ "" -> id+ x -> (x:)+ _ -> id)+ [] (parseTags raw)+ getInlineIdent _ = []++ isHtmlFormat :: Format -> Bool+ isHtmlFormat (Format "html") = True+ isHtmlFormat (Format "html4") = True+ isHtmlFormat (Format "html5") = True+ isHtmlFormat _ = False+++makeChunks :: Int -> PathTemplate -> Meta -> [Block] -> [Chunk]+makeChunks chunklev pathTemplate meta = secsToChunks 1+ where+ isChunkHeader :: Block -> Bool+ isChunkHeader (Div (_,"section":_,_) (Header n _ _:_)) = n <= chunklev+ isChunkHeader _ = False++ secsToChunks :: Int -> [Block] -> [Chunk]+ secsToChunks chunknum bs =+ case break isChunkHeader bs of+ ([], []) -> []+ ([], (d@(Div attr@(_,"section":_,_) (h@(Header lvl _ _) : bs')) : rest))+ | chunklev == lvl ->+ -- If the header is of the same level as chunks, create a chunk+ toChunk chunknum d :+ secsToChunks (chunknum + 1) rest+ | chunklev > lvl ->+ case break isChunkHeader bs' of+ (xs, ys) -> toChunk chunknum (Div attr (h:xs)) :+ secsToChunks (chunknum + 1) (ys ++ rest)+ (xs, ys) -> toChunk chunknum+ (Div ("",["preamble"],[]) xs) :+ secsToChunks (chunknum + 1) ys++ toChunk :: Int -> Block -> Chunk+ toChunk chunknum+ (Div (divid,"section":classes,kvs) (h@(Header lvl _ ils) : bs)) =+ Chunk+ { chunkHeading = ils+ , chunkId = divid+ , chunkLevel = lvl+ , chunkNumber = chunknum+ , chunkSectionNumber = secnum+ , chunkPath = chunkpath+ , chunkUp = Nothing+ , chunkNext = Nothing+ , chunkPrev = Nothing+ , chunkUnlisted = "unlisted" `elem` classes+ , chunkContents =+ [Div (divid,"section":classes,kvs') (h : bs)]+ }+ where kvs' = kvs ++ [("nav-path", T.pack chunkpath)]+ secnum = lookup "number" kvs+ chunkpath = resolvePathTemplate pathTemplate chunknum+ (stringify ils)+ divid+ (fromMaybe "" secnum)+ toChunk chunknum (Div ("",["preamble"],[]) bs) =+ Chunk+ { chunkHeading = docTitle meta+ , chunkId = chunkid+ , chunkLevel = 0+ , chunkNumber = chunknum+ , chunkSectionNumber = Nothing+ , chunkPath = chunkpath+ , chunkUp = Nothing+ , chunkPrev = Nothing+ , chunkNext = Nothing+ , chunkUnlisted = False+ , chunkContents = bs+ }+ where+ chunkpath = resolvePathTemplate pathTemplate chunknum+ (stringify (docTitle meta))+ chunkid+ "0"+ chunkid = inlineListToIdentifier mempty (docTitle meta) <>+ "-" <> tshow chunknum+ toChunk _ b = error $ "toChunk called on inappropriate block " <> show b+ -- should not happen+++-- Remove some attributes we added just to construct chunkNext etc.+rmNavAttrs :: Block -> Block+rmNavAttrs (Div (ident,classes,kvs) bs) =+ Div (ident,classes,filter (not . isNavAttr) kvs) bs+ where+ isNavAttr (k,_) = "nav-" `T.isPrefixOf` k+rmNavAttrs b = b++resolvePathTemplate :: PathTemplate+ -> Int -- ^ Chunk number+ -> Text -- ^ Stringified heading text+ -> Text -- ^ Section identifier+ -> Text -- ^ Section number+ -> FilePath+resolvePathTemplate (PathTemplate templ) chunknum headingText ident secnum =+ T.unpack .+ T.filter (\c -> c /= '/' && c /= '\\') .+ T.replace "%n" (T.pack $ printf "%03d" chunknum) .+ T.replace "%s" secnum .+ T.replace "%h" headingText .+ T.replace "%i" ident $+ templ++-- | A 'PathTemplate' is a FilePath in which certain codes+-- will be substituted with information from a 'Chunk'.+-- @%n@ will be replaced with the chunk number+-- (padded with leading 0s to 3 digits),+-- @%s@ with the section number of the heading,+-- @%h@ with the (stringified) heading text,+-- @%i@ with the section identifier.+-- For example, @"section-%s-%i.html"@ might be resolved to+-- @"section-1.2-introduction.html"@.+newtype PathTemplate =+ PathTemplate { unPathTemplate :: Text }+ deriving (Show, IsString, Data, Typeable, Generic, ToJSON, FromJSON)++-- | A part of a document (typically a chapter or section, or+-- the part of a section before its subsections).+data Chunk =+ Chunk+ { chunkHeading :: [Inline]+ , chunkId :: Text+ , chunkLevel :: Int+ , chunkNumber :: Int+ , chunkSectionNumber :: Maybe Text+ , chunkPath :: FilePath+ , chunkUp :: Maybe Chunk+ , chunkPrev :: Maybe Chunk+ , chunkNext :: Maybe Chunk+ , chunkUnlisted :: Bool+ , chunkContents :: [Block]+ }+ deriving (Show, Eq, Generic)++instance Walkable Inline Chunk where+ query f chunk = query f (chunkContents chunk)+ walk f chunk = chunk{ chunkContents = walk f (chunkContents chunk) }+ walkM f chunk = do+ contents <- walkM f (chunkContents chunk)+ return chunk{ chunkContents = contents }++instance Walkable Block Chunk where+ query f chunk = query f (chunkContents chunk)+ walk f chunk = chunk{ chunkContents = walk f (chunkContents chunk) }+ walkM f chunk = do+ contents <- walkM f (chunkContents chunk)+ return chunk{ chunkContents = contents }++-- | A 'Pandoc' broken into 'Chunk's for writing to separate files.+data ChunkedDoc =+ ChunkedDoc+ { chunkedMeta :: Meta+ , chunkedTOC :: Tree SecInfo+ , chunkedChunks :: [Chunk]+ } deriving (Show, Eq, Generic)++instance Walkable Inline ChunkedDoc where+ query f doc = query f (chunkedChunks doc) <> query f (chunkedMeta doc)+ walk f doc = doc{ chunkedMeta = walk f (chunkedMeta doc)+ , chunkedChunks = walk f (chunkedChunks doc)+ }+ walkM f doc = do+ meta' <- walkM f (chunkedMeta doc)+ chunks' <- walkM f (chunkedChunks doc)+ return $ doc{ chunkedMeta = meta'+ , chunkedChunks = chunks' }++instance Walkable Block ChunkedDoc where+ query f doc = query f (chunkedChunks doc) <> query f (chunkedMeta doc)+ walk f doc = doc{ chunkedMeta = walk f (chunkedMeta doc)+ , chunkedChunks = walk f (chunkedChunks doc)+ }+ walkM f doc = do+ meta' <- walkM f (chunkedMeta doc)+ chunks' <- walkM f (chunkedChunks doc)+ return $ doc{ chunkedMeta = meta'+ , chunkedChunks = chunks' }++-- | Data for a section in a hierarchical document.+data SecInfo =+ SecInfo+ { secTitle :: [Inline]+ , secNumber :: Maybe Text+ , secId :: Text+ , secPath :: Text -- including fragment, e.g. chunk001.html#section-one+ , secLevel :: Int+ } deriving (Show, Eq, Generic)++instance Walkable Inline SecInfo where+ query f sec = query f (secTitle sec)+ walk f sec = sec{ secTitle = walk f (secTitle sec) }+ walkM f sec = do+ st <- walkM f (secTitle sec)+ return sec{ secTitle = st }++-- | Create tree of sections with titles, links, and numbers,+-- in a form that can be turned into a table of contents.+-- Presupposes that the '[Block]' is the output of 'makeSections'.+toTOCTree :: [Block] -> Tree SecInfo+toTOCTree =+ Node SecInfo{ secTitle = []+ , secNumber = Nothing+ , secId = ""+ , secPath = ""+ , secLevel = 0 } . foldr go []+ where+ go :: Block -> [Tree SecInfo] -> [Tree SecInfo]+ go (Div (ident,_,_) (Header lev (_,classes,kvs) ils : subsecs))+ | not (isNothing (lookup "number" kvs) && "unlisted" `elem` classes)+ = ((Node SecInfo{ secTitle = ils+ , secNumber = lookup "number" kvs+ , secId = ident+ , secPath = ""+ , secLevel = lev } (foldr go [] subsecs)) :)+ go (Div _ [d@Div{}]) = go d -- #8402+ go _ = id++-- | Adjusts paths in the TOC tree generated by 'toTOCTree'+-- to reflect division into Chunks.+fixTOCTreePaths :: [Chunk] -> Tree SecInfo -> Tree SecInfo+fixTOCTreePaths chunks = go ""+ where+ idMap = foldr (\chunk m ->+ let ids = filter (not . T.null)+ (chunkId chunk :+ query getIds (chunkContents chunk))+ in foldr (\i -> M.insert i (chunkPath chunk)) m ids)+ mempty chunks+ getIds :: Block -> [Text]+ getIds (Div (i,"section":_,_) _) = [i]+ getIds _ = []+ go :: FilePath -> Tree SecInfo -> Tree SecInfo+ go fp (Node secinfo subtrees) =+ let newpath = M.lookup (secId secinfo) idMap+ fp' = fromMaybe fp newpath+ fragment = "#" <> secId secinfo+ in Node secinfo{ secPath = T.pack fp' <> fragment }+ (map (go fp') subtrees)++-- | Creates a TOC link to the respective document section.+tocEntryToLink :: Bool -> SecInfo -> [Inline]+tocEntryToLink includeNumbers secinfo = headerLink+ where+ addNumber = case secNumber secinfo of+ Just num | includeNumbers+ -> (Span ("",["toc-section-number"],[])+ [Str num] :) . (Space :)+ _ -> id+ clean (Link _ xs _) = xs+ clean (Note _) = []+ clean x = [x]+ anchor = if T.null (secPath secinfo)+ then if T.null (secId secinfo)+ then ""+ else "#" <> secId secinfo+ else secPath secinfo+ headerText = addNumber $ walk (concatMap clean) (secTitle secinfo)+ headerLink = if T.null anchor+ then headerText+ else [Link ((if T.null (secId secinfo)+ then ""+ else "toc-" <> secId secinfo), [], [])+ headerText (anchor, "")]++-- | Generate a table of contents of the given depth.+tocToList :: Bool -> Int -> Tree SecInfo -> Block+tocToList includeNumbers tocDepth (Node _ subtrees) = BulletList (toItems subtrees)+ where+ toItems = map go . filter isBelowTocDepth+ isBelowTocDepth (Node sec _) = secLevel sec <= tocDepth+ go (Node secinfo xs) =+ Plain (tocEntryToLink includeNumbers secinfo) :+ case toItems xs of+ [] -> []+ ys -> [BulletList ys]
@@ -0,0 +1,667 @@+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE OverloadedStrings #-}+module Text.Pandoc.Citeproc+ ( processCitations,+ getReferences,+ )+where++import Citeproc+import Citeproc.Pandoc ()+import Text.Pandoc.Citeproc.Locator (parseLocator, toLocatorMap,+ LocatorInfo(..))+import Text.Pandoc.Citeproc.CslJson (cslJsonToReferences)+import Text.Pandoc.Citeproc.BibTeX (readBibtexString, Variant(..))+import Text.Pandoc.MIME (MimeType)+import Text.Pandoc.Readers.RIS (readRIS)+import Text.Pandoc.Citeproc.MetaValue (metaValueToReference, metaValueToText)+import Text.Pandoc.Readers.Markdown (yamlToRefs)+import Text.Pandoc.Builder (Inlines, Many(..), deleteMeta, setMeta)+import qualified Text.Pandoc.Builder as B+import Text.Pandoc.Definition as Pandoc+import Text.Pandoc.Class (PandocMonad(..), getResourcePath, getUserDataDir,+ fetchItem, report, setResourcePath, toTextM)+import Text.Pandoc.Data (readDataFile)+import Text.Pandoc.Error (PandocError(..))+import Text.Pandoc.Extensions (pandocExtensions)+import Text.Pandoc.Logging (LogMessage(..))+import Text.Pandoc.Options (ReaderOptions(..))+import Text.Pandoc.Shared (stringify, tshow, makeSections)+import Data.Containers.ListUtils (nubOrd)+import Text.Pandoc.Walk (query, walk, walkM)+import Control.Applicative ((<|>))+import Control.Monad.Except (catchError, throwError)+import Control.Monad.State (State, evalState, get, put, runState)+import Data.Aeson (eitherDecode)+import Data.ByteString (ByteString)+import qualified Data.ByteString.Lazy as L+import Data.Char (isPunctuation, isUpper)+import Data.Default (Default(def))+import qualified Data.Foldable as Foldable+import qualified Data.Map as M+import Data.Maybe (mapMaybe, fromMaybe)+import Data.Ord ()+import qualified Data.Sequence as Seq+import qualified Data.Set as Set+import Data.Text (Text)+import qualified Data.Text as T+import System.FilePath (takeExtension)+import Safe (lastMay, initSafe)++processCitations :: PandocMonad m => Pandoc -> m Pandoc+processCitations (Pandoc meta bs) = do+ style <- getStyle (Pandoc meta bs)+ mblang <- getCiteprocLang meta+ let locale = Citeproc.mergeLocales mblang style++ let addQuoteSpan (Quoted _ xs) = Span ("",["csl-quoted"],[]) xs+ addQuoteSpan x = x+ refs <- map (walk addQuoteSpan) <$>+ getReferences (Just locale) (Pandoc meta bs)++ let otherIdsMap = foldr (\ref m ->+ case T.words . extractText <$>+ M.lookup "other-ids"+ (referenceVariables ref) of+ Nothing -> m+ Just ids -> foldr+ (\id' ->+ M.insert id' (referenceId ref)) m ids)+ M.empty refs+ let meta' = deleteMeta "nocite" meta+ let citations = getCitations locale otherIdsMap $ Pandoc meta' bs+++ let linkCites = maybe False truish (lookupMeta "link-citations" meta) &&+ -- don't link citations if no bibliography to link to:+ not (maybe False truish (lookupMeta "suppress-bibliography" meta))+ let linkBib = maybe True truish $ lookupMeta "link-bibliography" meta+ let opts = defaultCiteprocOptions{ linkCitations = linkCites+ , linkBibliography = linkBib }+ let result = Citeproc.citeproc opts style mblang refs citations+ mapM_ (report . CiteprocWarning) (resultWarnings result)+ let sopts = styleOptions style+ let classes = "references" : -- TODO remove this or keep for compatibility?+ "csl-bib-body" :+ ["hanging-indent" | styleHangingIndent sopts]+ let refkvs = (case styleEntrySpacing sopts of+ Just es -> (("entry-spacing",T.pack $ show es):)+ _ -> id) .+ (case styleLineSpacing sopts of+ Just ls | ls > 1 -> (("line-spacing",T.pack $ show ls):)+ _ -> id) $ []+ let bibs = mconcat $ map (\(ident, out) ->+ B.divWith ("ref-" <> ident,["csl-entry"],[]) . B.para .+ insertSpace $ out)+ (resultBibliography result)+ let moveNotes = maybe (styleIsNoteStyle sopts) truish+ (lookupMeta "notes-after-punctuation" meta)+ let cits = resultCitations result++ let metanocites = lookupMeta "nocite" meta+ let Pandoc meta'' bs' =+ maybe id (setMeta "nocite") metanocites .+ walk (mvPunct moveNotes locale) .+ (if styleIsNoteStyle sopts+ then walk addNote . walk deNote+ else id) .+ evalState (walkM insertResolvedCitations $ Pandoc meta' bs)+ $ cits+ return $ walk removeQuoteSpan+ $ insertRefs refkvs classes (B.toList bibs)+ $ Pandoc meta'' bs'++removeQuoteSpan :: Inline -> Inline+removeQuoteSpan (Span ("",["csl-quoted"],[]) xs) = Span nullAttr xs+removeQuoteSpan x = x++-- | Retrieve the CSL style specified by the csl or citation-style+-- metadata field in a pandoc document, or the default CSL style+-- if none is specified. Retrieve the parent style+-- if the style is a dependent style. Add abbreviations defined+-- in an abbreviation file if one has been specified.+getStyle :: PandocMonad m => Pandoc -> m (Style Inlines)+getStyle (Pandoc meta _) = do+ let cslfile = (lookupMeta "csl" meta <|> lookupMeta "citation-style" meta)+ >>= metaValueToText++ let getFile defaultExtension fp = do+ oldRp <- getResourcePath+ mbUdd <- getUserDataDir+ setResourcePath $ oldRp ++ maybe []+ (\u -> [u <> "/csl",+ u <> "/csl/dependent"]) mbUdd+ let fp' = if T.any (=='.') fp || "data:" `T.isPrefixOf` fp+ then fp+ else fp <> defaultExtension+ (result, _) <- fetchItem fp'+ setResourcePath oldRp+ return result++ let getCslDefault = readDataFile "default.csl"++ cslContents <- maybe getCslDefault (getFile ".csl") cslfile >>=+ toTextM (maybe mempty T.unpack cslfile)++ let abbrevFile = lookupMeta "citation-abbreviations" meta >>= metaValueToText++ mbAbbrevs <- case abbrevFile of+ Nothing -> return Nothing+ Just fp -> do+ rawAbbr <- getFile ".json" fp+ case eitherDecode (L.fromStrict rawAbbr) of+ Left err -> throwError $ PandocCiteprocError $+ CiteprocParseError $+ "Could not parse abbreviations file " <> fp+ <> "\n" <> T.pack err+ Right abbr -> return $ Just abbr++ let getParentStyle url = do+ -- first, try to retrieve the style locally, then use HTTP.+ let basename = T.takeWhileEnd (/='/') url+ catchError (getFile ".csl" basename) (\_ -> fst <$> fetchItem url)+ >>= toTextM (T.unpack url)++ styleRes <- Citeproc.parseStyle getParentStyle cslContents+ case styleRes of+ Left err -> throwError $ PandocAppError $ prettyCiteprocError err+ Right style -> return style{ styleAbbreviations = mbAbbrevs }+++-- Retrieve citeproc lang based on metadata.+getCiteprocLang :: PandocMonad m => Meta -> m (Maybe Lang)+getCiteprocLang meta = maybe (return Nothing) bcp47LangToIETF+ ((lookupMeta "lang" meta <|> lookupMeta "locale" meta) >>= metaValueToText)++-- | Get references defined inline in the metadata and via an external+-- bibliography. Only references that are actually cited in the document+-- (either with a genuine citation or with `nocite`) are returned.+-- URL variables are converted to links.+getReferences :: PandocMonad m+ => Maybe Locale -> Pandoc -> m [Reference Inlines]+getReferences mblocale (Pandoc meta bs) = do+ locale <- case mblocale of+ Just l -> return l+ Nothing -> do+ mblang <- getCiteprocLang meta+ case mblang of+ Just lang -> return $ either mempty id $ getLocale lang+ Nothing -> return mempty++ let getCiteId (Cite cs _) = Set.fromList $ map B.citationId cs+ getCiteId _ = mempty+ let metanocites = lookupMeta "nocite" meta+ let nocites = maybe mempty (query getCiteId) metanocites+ let citeIds = query getCiteId (Pandoc meta bs)+ let idpred = if "*" `Set.member` nocites+ then const True+ else (`Set.member` citeIds)+ let inlineRefs = case lookupMeta "references" meta of+ Just (MetaList rs) ->+ filter (idpred . unItemId . referenceId)+ $ mapMaybe metaValueToReference rs+ _ -> []+ externalRefs <- case lookupMeta "bibliography" meta of+ Just (MetaList xs) ->+ mconcat <$>+ mapM (getRefsFromBib locale idpred)+ (mapMaybe metaValueToText xs)+ Just x ->+ case metaValueToText x of+ Just fp -> getRefsFromBib locale idpred fp+ Nothing -> return []+ Nothing -> return []+ return $ map legacyDateRanges (externalRefs ++ inlineRefs)+ -- note that inlineRefs can override externalRefs++++-- If we have a span.csl-left-margin followed by span.csl-right-inline,+-- we insert a space. This ensures that they will be separated by a space,+-- even in formats that don't have special handling for the display spans.+insertSpace :: Inlines -> Inlines+insertSpace ils =+ case Seq.viewl (unMany ils) of+ (Span ("",["csl-left-margin"],[]) xs) Seq.:< rest ->+ case Seq.lookup 0 rest of+ Just (Span ("",["csl-right-inline"],[]) _) ->+ Many $+ Span ("",["csl-left-margin"],[]) (xs ++ case lastMay xs of+ Just Space -> []+ _ -> [Space])+ Seq.<| rest+ _ -> ils+ _ -> ils++getRefsFromBib :: PandocMonad m+ => Locale -> (Text -> Bool) -> Text -> m [Reference Inlines]+getRefsFromBib locale idpred fp = do+ (raw, mt) <- fetchItem fp+ case getBibliographyFormat (T.unpack fp) mt of+ Just f -> getRefs locale f idpred (Just fp) raw+ Nothing -> throwError $ PandocAppError $+ "Could not determine bibliography format for " <> fp++getRefs :: PandocMonad m+ => Locale+ -> BibFormat+ -> (Text -> Bool)+ -> Maybe Text+ -> ByteString+ -> m [Reference Inlines]+getRefs locale format idpred mbfp raw = do+ let err' = throwError .+ PandocBibliographyError (fromMaybe mempty mbfp)+ let fp = maybe mempty T.unpack mbfp+ case format of+ Format_bibtex ->+ toTextM fp raw >>=+ either (err' . tshow) return . readBibtexString Bibtex locale idpred+ Format_biblatex ->+ toTextM fp raw >>=+ either (err' . tshow) return . readBibtexString Biblatex locale idpred+ Format_json ->+ either (err' . T.pack)+ (return . filter (idpred . unItemId . referenceId)) .+ cslJsonToReferences $ raw+ Format_yaml -> do+ rs <- yamlToRefs idpred+ def{ readerExtensions = pandocExtensions }+ (T.unpack <$> mbfp)+ raw+ return $ mapMaybe metaValueToReference rs+ Format_ris -> do+ Pandoc meta _ <- toTextM fp raw >>= readRIS def+ case lookupMeta "references" meta of+ Just (MetaList rs) -> return $ mapMaybe metaValueToReference rs+ _ -> return []++-- assumes we walk in same order as query+insertResolvedCitations :: Inline -> State [Inlines] Inline+insertResolvedCitations (Cite cs ils) = do+ resolved <- get+ case resolved of+ [] -> return (Cite cs ils)+ (x:xs) -> do+ put xs+ return $ Cite cs (B.toList x)+insertResolvedCitations x = return x++getCitations :: Locale+ -> M.Map Text ItemId+ -> Pandoc+ -> [Citeproc.Citation Inlines]+getCitations locale otherIdsMap (Pandoc meta blocks) =+ Foldable.toList (query getCitation meta <>+ foldMap handleBlock (makeSections False Nothing blocks))+ where+ handleBlock :: Block -> Seq.Seq (Citeproc.Citation Inlines)+ handleBlock b@(Div (_,cls,_) _)+ | "section" `elem` cls+ , "reset-citation-positions" `elem` cls =+ case Seq.viewl (query getCitation b) of+ x Seq.:< xs -> addResetTo x Seq.<| xs+ Seq.EmptyL -> mempty+ handleBlock b = query getCitation b+ addResetTo citation = citation{ Citeproc.citationResetPosition = True }+ getCitation (Cite cs _fallback) = Seq.singleton $+ Citeproc.Citation { Citeproc.citationId = Nothing+ , Citeproc.citationResetPosition = False+ , Citeproc.citationPrefix = Nothing+ , Citeproc.citationSuffix = Nothing+ , Citeproc.citationNoteNumber =+ case cs of+ [] -> Nothing+ (Pandoc.Citation{ Pandoc.citationNoteNum = n }:+ _) | n > 0 -> Just n+ | otherwise -> Nothing+ , Citeproc.citationItems =+ fromPandocCitations locale otherIdsMap cs+ }+ getCitation _ = mempty++fromPandocCitations :: Locale+ -> M.Map Text ItemId+ -> [Pandoc.Citation]+ -> [CitationItem Inlines]+fromPandocCitations locale otherIdsMap = concatMap go+ where+ locmap = toLocatorMap locale+ go c =+ let (mblocinfo, suffix) = parseLocator locmap (Pandoc.citationSuffix c)+ cit = CitationItem+ { citationItemId = fromMaybe+ (ItemId $ Pandoc.citationId c)+ (M.lookup (Pandoc.citationId c) otherIdsMap)+ , citationItemLabel = locatorLabel <$> mblocinfo+ , citationItemLocator = locatorLoc <$> mblocinfo+ , citationItemType = NormalCite+ , citationItemPrefix = case Pandoc.citationPrefix c of+ [] -> Nothing+ ils -> Just $ B.fromList ils <>+ B.space+ , citationItemSuffix = case suffix of+ [] -> Nothing+ ils -> Just $ B.fromList ils+ , citationItemData = Nothing }+ in if Pandoc.citationId c == "*"+ then []+ else+ case citationMode c of+ AuthorInText -> [ cit{ citationItemType = AuthorOnly+ , citationItemSuffix = Nothing }+ , cit{ citationItemType =+ Citeproc.SuppressAuthor+ , citationItemPrefix = Nothing } ]+ NormalCitation -> [ cit ]+ Pandoc.SuppressAuthor+ -> [ cit{ citationItemType =+ Citeproc.SuppressAuthor } ]++++data BibFormat =+ Format_biblatex+ | Format_bibtex+ | Format_json+ | Format_yaml+ | Format_ris+ deriving (Show, Eq, Ord)++getBibliographyFormat :: FilePath -> Maybe MimeType -> Maybe BibFormat+getBibliographyFormat fp mbmime = do+ let ext = takeExtension fp+ case ext of+ ".biblatex" -> pure Format_biblatex+ ".bibtex" -> pure Format_bibtex+ ".bib" -> pure Format_biblatex+ ".json" -> pure Format_json+ ".yaml" -> pure Format_yaml+ ".yml" -> pure Format_yaml+ ".ris" -> pure Format_ris+ _ -> do+ mime <- mbmime+ case T.takeWhile (/= ';') mime of+ "application/x-bibtex" -> pure Format_biblatex+ "application/x-reseach-info-systems" -> pure Format_ris+ "application/vnd.citationstyles.csl+json" -> pure Format_json+ "application/json" -> pure Format_json+ "application/x-yaml" -> pure Format_yaml+ "text/x-yaml" -> pure Format_yaml+ "text/yaml" -> pure Format_yaml+ _ -> Nothing++isNote :: Inline -> Bool+isNote (Note _) = True+-- the following allows citation styles that are "in-text" but use superscript+-- references to be treated as if they are "notes" for the purposes of moving+-- the citations after trailing punctuation (see <https://github.com/jgm/pandoc-citeproc/issues/382>):+isNote (Superscript _) = True+isNote _ = False++isSpacy :: Inline -> Bool+isSpacy Space = True+isSpacy SoftBreak = True+isSpacy _ = False++movePunctInsideQuotes :: Locale -> [Inline] -> [Inline]+movePunctInsideQuotes locale+ | localePunctuationInQuote locale == Just True+ = B.toList . movePunctuationInsideQuotes . B.fromList+ | otherwise+ = id++mvPunct :: Bool -> Locale -> [Inline] -> [Inline]+mvPunct moveNotes locale (x : xs)+ | isSpacy x = x : mvPunct moveNotes locale xs+-- 'x [^1],' -> 'x,[^1]'+mvPunct moveNotes locale (q : s : x@(Cite _ [il]) : ys)+ | isSpacy s+ , isNote il+ = let spunct = T.takeWhile isPunct $ stringify ys+ in if moveNotes+ then if T.null spunct+ then q : x : mvPunct moveNotes locale ys+ else movePunctInsideQuotes locale+ [q , Str spunct , x] ++ mvPunct moveNotes locale+ (B.toList+ (dropTextWhile isPunct (B.fromList ys)))+ else q : x : mvPunct moveNotes locale ys+-- 'x[^1],' -> 'x,[^1]'+mvPunct moveNotes locale (Cite cs ils@(_:_) : ys)+ | isNote (last ils)+ , startWithPunct ys+ , moveNotes+ = let s = stringify ys+ spunct = T.takeWhile isPunct s+ in Cite cs (movePunctInsideQuotes locale $+ init ils+ ++ [Str spunct | not (endWithPunct False (init ils))]+ ++ [last ils]) :+ mvPunct moveNotes locale+ (B.toList (dropTextWhile isPunct (B.fromList ys)))+mvPunct moveNotes locale (s : x@(Cite _ [il]) : ys)+ | isSpacy s+ , isNote il+ = x : mvPunct moveNotes locale ys+mvPunct moveNotes locale (s : x@(Cite _ (Superscript _ : _)) : ys)+ | isSpacy s = x : mvPunct moveNotes locale ys+mvPunct moveNotes locale (Cite cs ils : Str "." : ys)+ | "." `T.isSuffixOf` (stringify ils)+ = Cite cs ils : mvPunct moveNotes locale ys+mvPunct moveNotes locale (x:xs) = x : mvPunct moveNotes locale xs+mvPunct _ _ [] = []++-- We don't treat an em-dash or en-dash as punctuation here, because we don't+-- want notes and quotes to move around them.+isPunct :: Char -> Bool+isPunct c = isPunctuation c && c /= '\x2014' && c /= '\x2013'++endWithPunct :: Bool -> [Inline] -> Bool+endWithPunct _ [] = False+endWithPunct onlyFinal xs@(_:_) =+ case reverse (T.unpack $ stringify xs) of+ [] -> True+ -- covers .), .", etc.:+ (d:c:_) | isPunct d+ && not onlyFinal+ && isEndPunct c -> True+ (c:_) | isEndPunct c -> True+ | otherwise -> False+ where isEndPunct c = c `elem` (".,;:!?" :: String)++++startWithPunct :: [Inline] -> Bool+startWithPunct ils =+ case T.uncons (stringify ils) of+ Just (c,_) -> c `elem` (".,;:!?" :: [Char])+ Nothing -> False++truish :: MetaValue -> Bool+truish (MetaBool t) = t+truish (MetaString s) = isYesValue (T.toLower s)+truish (MetaInlines ils) = isYesValue (T.toLower (stringify ils))+truish (MetaBlocks [Plain ils]) = isYesValue (T.toLower (stringify ils))+truish _ = False++isYesValue :: Text -> Bool+isYesValue "t" = True+isYesValue "true" = True+isYesValue "yes" = True+isYesValue _ = False++-- if document contains a Div with id="refs", insert+-- references as its contents. Otherwise, insert references+-- at the end of the document in a Div with id="refs" or+-- id=".*__refs" (where .* stands for any string -- this is+-- because --file-scope will add such a prefix based on the filename,+-- see #11072.)+insertRefs :: [(Text,Text)] -> [Text] -> [Block] -> Pandoc -> Pandoc+insertRefs _ _ [] d = d+insertRefs refkvs refclasses refs (Pandoc meta bs) =+ case lookupMeta "suppress-bibliography" meta of+ Just x | truish x -> Pandoc meta bs+ _ -> case runState (walkM go (Pandoc meta bs)) False of+ (d', True) -> d'+ (Pandoc meta' bs', False)+ -> Pandoc meta' $+ case refTitle meta of+ Nothing ->+ case reverse bs' of+ Header lev (id',classes,kvs) ys : xs ->+ reverse xs +++ [Header lev (id',addUnNumbered classes,kvs) ys,+ Div ("refs",refclasses,refkvs) refs]+ _ -> bs' ++ [refDiv]+ Just ils -> bs' +++ [Header 1 ("bibliography", ["unnumbered"], []) ils,+ refDiv]+ where+ refDiv = Div ("refs", refclasses, refkvs) refs+ addUnNumbered cs = "unnumbered" : [c | c <- cs, c /= "unnumbered"]+ go :: Block -> State Bool Block+ go (Div (ident,cs,kvs) xs)+ | ident == "refs" || "__refs" `T.isSuffixOf` ident = do+ put True+ -- refHeader isn't used if you have an explicit references div+ let cs' = nubOrd $ cs ++ refclasses+ let kvs' = nubOrd $ kvs ++ refkvs+ return $ Div (ident,cs',kvs') (xs ++ refs)+ go x = return x++refTitle :: Meta -> Maybe [Inline]+refTitle meta =+ case lookupMeta "reference-section-title" meta of+ Just (MetaString s) -> Just [Str s]+ Just (MetaInlines ils) -> Just ils+ Just (MetaBlocks [Plain ils]) -> Just ils+ Just (MetaBlocks [Para ils]) -> Just ils+ _ -> Nothing++legacyDateRanges :: Reference Inlines -> Reference Inlines+legacyDateRanges ref =+ ref{ referenceVariables = M.map go $ referenceVariables ref }+ where+ go (DateVal d)+ | null (dateParts d)+ , Just lit <- dateLiteral d+ = case T.splitOn "_" lit of+ [x,y] -> case Citeproc.rawDateEDTF (x <> "/" <> y) of+ Just d' -> DateVal d'+ Nothing -> DateVal d+ _ -> DateVal d+ go x = x++extractText :: Val Inlines -> Text+extractText (TextVal x) = x+extractText (FancyVal x) = toText x+extractText (NumVal n) = T.pack (show n)+extractText _ = mempty++-- Here we take the Spans with class csl-note that are left+-- after deNote has removed nested ones, and convert them+-- into real notes.+addNote :: Inline -> Inline+addNote (Span ("",["csl-note"],[]) ils) =+ Note [Para $+ B.toList . addTextCase Nothing CapitalizeFirst . B.fromList $ ils]+addNote x = x++-- Here we handle citation notes that occur inside footnotes+-- or other citation notes, in a note style. We don't want+-- notes inside notes, so we convert these to parenthesized+-- or comma-separated citations.+deNote :: Inline -> Inline+deNote (Note bs) =+ case bs of+ [Para (cit@(Cite (c:_) _) : ils)]+ | citationMode c /= AuthorInText ->+ -- if citation is first in note, no need to parenthesize.+ Note [Para (walk removeNotes $ cit : walk addParens ils)]+ _ -> Note (walk removeNotes . walk addParens $ bs)++ where+ addParens [] = []+ addParens (Cite (c:cs) ils : zs)+ | citationMode c == AuthorInText+ = Cite (c:cs) (addCommas (needsPeriod zs) ils) :+ addParens zs+ | otherwise+ = Cite (c:cs) (dropWhile (== Space) (concatMap noteInParens ils))+ : addParens zs+ addParens (x:xs) = x : addParens xs++ removeNotes (Span ("",["csl-note"],[]) ils) = Span ("",[],[]) ils+ removeNotes x = x++ needsPeriod [] = True+ needsPeriod (Str t:_) = case T.uncons t of+ Nothing -> False+ Just (c,_) -> isUpper c+ needsPeriod (Space:zs) = needsPeriod zs+ needsPeriod _ = False++ noteInParens (Span ("",["csl-note"],[]) ils)+ = Space : Str "(" :+ removeFinalPeriod ils ++ [Str ")"]+ noteInParens x = [x]++ -- We want to add a comma before a CSL note citation, but not+ -- before the author name, and not before the first citation+ -- if it doesn't begin with an author name.+ addCommas = addCommas' True -- boolean == "at beginning"++ addCommas' _ _ [] = []+ addCommas' atBeginning needsPer+ (Span ("",["csl-note"],[]) ils : rest)+ | not (null ils)+ = (if atBeginning then id else ([Str "," , Space] ++)) $+ (if needsPer then ils else removeFinalPeriod ils) +++ addCommas' False needsPer rest+ addCommas' _ needsPer (il : rest) = il : addCommas' False needsPer rest++deNote x = x++-- Note: we can't use dropTextWhileEnd indiscriminately,+-- because this would remove the final period on abbreviations like Ibid.+-- But it turns out that when the note citation ends with Ibid.+-- (or Ed. etc.), the last inline will be Str "" as a result of+-- the punctuation-fixing mechanism that removes the double '.'.+removeFinalPeriod :: [Inline] -> [Inline]+removeFinalPeriod ils =+ case lastMay ils of+ Just (Span attr ils')+ -> initSafe ils ++ [Span attr (removeFinalPeriod ils')]+ Just (Emph ils')+ -> initSafe ils ++ [Emph (removeFinalPeriod ils')]+ Just (Strong ils')+ -> initSafe ils ++ [Strong (removeFinalPeriod ils')]+ Just (SmallCaps ils')+ -> initSafe ils ++ [SmallCaps (removeFinalPeriod ils')]+ Just (Str t)+ | T.takeEnd 1 t == "." -> initSafe ils ++ [Str (T.dropEnd 1 t)]+ | isRightQuote (T.takeEnd 1 t)+ -> removeFinalPeriod+ (initSafe ils ++ [Str tInit | not (T.null tInit)]) ++ [Str tEnd]+ where+ tEnd = T.takeEnd 1 t+ tInit = T.dropEnd 1 t+ _ -> ils+ where+ isRightQuote "\8221" = True+ isRightQuote "\8217" = True+ isRightQuote "\187" = True+ isRightQuote _ = False++bcp47LangToIETF :: PandocMonad m => Text -> m (Maybe Lang)+bcp47LangToIETF bcplang =+ case parseLang bcplang of+ Left _ -> do+ report $ InvalidLang bcplang+ return Nothing+ Right lang -> return $ Just lang
@@ -0,0 +1,1374 @@+{-# LANGUAGE ViewPatterns #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE FlexibleContexts #-}+{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}+-----------------------------------------------------------------------------+-- |+-- Module : Text.CSL.Input.Bibtex+-- Copyright : (c) John MacFarlane+-- License : BSD-style (see LICENSE)+--+-- Maintainer : John MacFarlane <fiddlosopher@gmail.com>+-- Stability : unstable+-- Portability : portable+--+-----------------------------------------------------------------------------++module Text.Pandoc.Citeproc.BibTeX+ ( Variant(..)+ , readBibtexString+ , writeBibtexString+ )+ where++import Text.Pandoc.Definition+import Text.Pandoc.Builder as B+import Text.Pandoc.Readers.LaTeX (readLaTeX)+import Text.Pandoc.Extensions (Extension(..), extensionsFromList)+import Text.Pandoc.Options (ReaderOptions(..), WriterOptions)+import Text.Pandoc.Error (PandocError)+import Text.Pandoc.Shared (stringify)+import Text.Pandoc.Writers.LaTeX (writeLaTeX)+import Text.Pandoc.Class (runPure)+import qualified Text.Pandoc.Walk as Walk+import Citeproc.Types+import Citeproc.Pandoc ()+import Data.List.Split (splitOn)+import Text.Pandoc.Citeproc.Util (toIETF, splitStrWhen)+import Text.Pandoc.Citeproc.Data (biblatexStringMap)+import Text.Pandoc.Citeproc.Name (toName, NameOpts(..), emptyName)+import Data.Default+import Data.Text (Text)+import qualified Data.Text as T+import qualified Data.Map as Map+import Data.Maybe+import Text.Pandoc.Parsing hiding ((<|>), many)+import Control.Applicative+import Control.Monad ( guard, MonadPlus(..), void )+import Control.Monad.RWS ( asks, RWST, gets, modify, evalRWST )+import qualified Data.Sequence as Seq+import Data.Char (isAlphaNum, isDigit, isLetter,+ isUpper, toLower, toUpper,+ isLower, isPunctuation, isSpace)+import Data.List (intercalate, intersperse)+import qualified Data.List as L+import Safe (readMay)+import Text.Printf (printf)+import Text.DocLayout (literal, hsep, nest, hang, Doc(..),+ braces, ($$), cr)++data Variant = Bibtex | Biblatex+ deriving (Show, Eq, Ord)++-- | Parse BibTeX or BibLaTeX into a list of 'Reference's.+readBibtexString :: ToSources a+ => Variant -- ^ bibtex or biblatex+ -> Locale -- ^ Locale+ -> (Text -> Bool) -- ^ Filter on citation ids+ -> a -- ^ bibtex/biblatex text+ -> Either ParseError [Reference Inlines]+readBibtexString variant locale idpred contents = do+ case runParser (((resolveCrossRefs variant <$> bibEntries) <* eof) >>=+ mapM (itemToReference locale variant) .+ filter (\item -> idpred (identifier item) &&+ entryType item /= "xdata"))+ (fromMaybe defaultLang $ localeLanguage locale, Map.empty)+ (initialSourceName sources) sources of+ Left err -> Left err+ Right xs -> return xs+ where+ sources = toSources contents++-- | Write BibTeX or BibLaTeX given given a 'Reference'.+writeBibtexString :: WriterOptions -- ^ options (for writing LaTex)+ -> Variant -- ^ bibtex or biblatex+ -> Maybe Lang -- ^ Language+ -> Reference Inlines -- ^ Reference to write+ -> Doc Text+writeBibtexString opts variant mblang ref =+ "@" <> bibtexType <> "{" <> literal (unItemId (referenceId ref)) <> ","+ $$ nest 2 (renderFields fs)+ $$ "}" <> cr++ where+ bibtexType =+ case referenceType ref of+ "article-magazine" -> "article"+ "article-newspaper" -> "article"+ "article-journal" -> "article"+ "book" -> "book"+ "pamphlet" -> "booklet"+ "dataset" | variant == Biblatex -> "dataset"+ "webpage" | variant == Biblatex -> "online"+ "chapter" -> case getVariable "editor" of+ Just _ -> "incollection"+ Nothing -> "inbook"+ "entry-encyclopedia" | variant == Biblatex -> "inreference"+ | otherwise -> "inbook"+ "paper-conference" -> "inproceedings"+ "thesis" -> case getVariableAsText "genre" of+ Just "mathesis" -> "mastersthesis"+ _ -> "phdthesis"+ "patent" | variant == Biblatex -> "patent"+ "report" | variant == Biblatex -> "report"+ | otherwise -> "techreport"+ "speech" -> "unpublished"+ "manuscript" -> "unpublished"+ "graphic" | variant == Biblatex -> "artwork"+ "song" | variant == Biblatex -> "music"+ "legal_case" | variant == Biblatex -> "jurisdiction"+ "legislation" | variant == Biblatex -> "legislation"+ "treaty" | variant == Biblatex -> "legal"+ "personal_communication" | variant == Biblatex -> "letter"+ "motion_picture" | variant == Biblatex -> "movie"+ "review" | variant == Biblatex -> "review"+ "software" | variant == Biblatex -> "software"+ _ -> "misc"++ mbSubtype =+ case referenceType ref of+ "article-magazine" -> Just "magazine"+ "article-newspaper" -> Just "newspaper"+ _ -> Nothing++ fs =+ case variant of+ Biblatex ->+ [ "author"+ , "editor"+ , "translator"+ , "publisher"+ , "title"+ , "booktitle"+ , "journal"+ , "series"+ , "edition"+ , "volume"+ , "volumes"+ , "number"+ , "pages"+ , "pagetotal"+ , "version"+ , "date"+ , "eventdate"+ , "urldate"+ , "address"+ , "url"+ , "doi"+ , "isbn"+ , "issn"+ , "type"+ , "entrysubtype"+ , "note"+ , "langid"+ , "abstract"+ , "keywords"+ , "annote"+ ]+ Bibtex ->+ [ "author"+ , "editor"+ , "translator"+ , "publisher"+ , "title"+ , "booktitle"+ , "journal"+ , "series"+ , "edition"+ , "volume"+ , "number"+ , "pages"+ , "year"+ , "month"+ , "address"+ , "type"+ , "note"+ , "annote"+ , "url" -- not officially supported, but supported by+ -- some styles (#8287)+ , "doi"+ ]++ valToInlines (TextVal t) = B.text t+ valToInlines (FancyVal ils) = ils+ valToInlines (NumVal n) = B.text (T.pack $ show n)+ valToInlines (NamesVal names) =+ mconcat $ intersperse (B.space <> B.text "and" <> B.space)+ $ map renderName names+ valToInlines (DateVal date) = B.text $+ case dateLiteral date of+ Just t -> t+ Nothing -> T.intercalate "/" (map renderDatePart (dateParts date)) <>+ (if dateCirca date then "~" else mempty)+ valToInlines SubstitutedVal = mempty++ renderDatePart (DateParts xs) = T.intercalate "-" $+ map (T.pack . printf "%02d") xs++ renderName name =+ case nameLiteral name of+ Just t -> B.spanWith ("",[],[]) $ B.text t+ Nothing -> spacedMaybes+ [ nameNonDroppingParticle name+ , nameFamily name+ , if nameCommaSuffix name+ then (", " <>) <$> nameSuffix name+ else nameSuffix name ]+ <>+ spacedMaybes+ [ (", " <>) <$> nameGiven name,+ nameDroppingParticle name ]++ mblang' = case getVariableAsText "language" of+ Just l -> either (const Nothing) Just $ parseLang l+ Nothing -> mblang++ titlecase = case mblang' of+ Just lang | langLanguage lang == "en"+ -> titlecase'+ Nothing -> titlecase'+ _ ->+ case variant of+ Bibtex -> B.spanWith nullAttr+ -- BibTex lacks a language field, so we wrap non-English+ -- titles in {} to protect case.+ Biblatex -> id++ titlecase' = addTextCase mblang' TitleCase .+ (\ils -> B.fromList+ (case B.toList ils of+ Str t : xs -> Str t : Walk.walk spanAroundCapitalizedWords xs+ xs -> Walk.walk spanAroundCapitalizedWords xs))++ -- protect capitalized words when we titlecase+ spanAroundCapitalizedWords (Str t)+ | not (T.all (\c -> isLower c || not (isLetter c)) t) =+ Span ("",["nocase"],[]) [Str t]+ spanAroundCapitalizedWords x = x++ spacedMaybes = mconcat . intersperse B.space . mapMaybe (fmap B.text)++ toLaTeX x =+ case runPure (writeLaTeX opts $ doc (B.plain x)) of+ Left _ -> Nothing+ Right t -> Just $ hsep . map literal $ T.words t++ renderField :: Text -> Maybe (Doc Text)+ renderField name =+ (((literal name) <>) . hang 2 " = " . braces)+ <$> getContentsFor name++ getVariable v = lookupVariable (toVariable v) ref++ getVariableAsText v = (stringify . valToInlines) <$> getVariable v++ getYear val =+ case val of+ DateVal date ->+ case dateLiteral date of+ Just t -> toLaTeX (B.text t)+ Nothing ->+ case dateParts date of+ [DateParts (y1:_), DateParts (y2:_)] ->+ Just $ literal (T.pack (printf "%04d" y1) <> "--" <>+ T.pack (printf "%04d" y2))+ [DateParts (y1:_)] ->+ Just $ literal (T.pack (printf "%04d" y1))+ _ -> Nothing+ _ -> Nothing++ toMonth 1 = "jan"+ toMonth 2 = "feb"+ toMonth 3 = "mar"+ toMonth 4 = "apr"+ toMonth 5 = "may"+ toMonth 6 = "jun"+ toMonth 7 = "jul"+ toMonth 8 = "aug"+ toMonth 9 = "sep"+ toMonth 10 = "oct"+ toMonth 11 = "nov"+ toMonth 12 = "dec"+ toMonth x = T.pack $ show x++ getMonth val =+ case val of+ DateVal date ->+ case dateParts date of+ [DateParts (_:m1:_), DateParts (_:m2:_)] ->+ Just $ literal (toMonth m1 <> "--" <> toMonth m2)+ [DateParts (_:m1:_)] -> Just $ literal (toMonth m1)+ _ -> Nothing+ _ -> Nothing++ getContentsFor :: Text -> Maybe (Doc Text)+ getContentsFor "type" =+ getVariableAsText "genre" >>=+ \case+ "mathesis" -> Just "mastersthesis"+ "phdthesis" -> Just "phdthesis"+ _ -> Nothing+ getContentsFor "entrysubtype" = literal <$> mbSubtype+ getContentsFor "journal"+ | bibtexType `elem` ["article", "periodical", "suppperiodical", "review"]+ = getVariable "container-title" >>= toLaTeX . valToInlines+ | otherwise = Nothing+ getContentsFor "booktitle"+ | bibtexType `elem`+ ["inbook","incollection","inproceedings","inreference","bookinbook"]+ = (getVariable "volume-title" <|> getVariable "container-title")+ >>= toLaTeX . valToInlines+ | otherwise = Nothing+ getContentsFor "series" = getVariable "collection-title"+ >>= toLaTeX . valToInlines+ getContentsFor "address" = getVariable "publisher-place"+ >>= toLaTeX . valToInlines+ getContentsFor "date" = getVariable "issued" >>= toLaTeX . valToInlines+ getContentsFor "eventdate" = getVariable "event-date" >>= toLaTeX . valToInlines+ getContentsFor "urldate" = getVariable "accessed" >>= toLaTeX . valToInlines+ getContentsFor "year" = getVariable "issued" >>= getYear+ getContentsFor "month" = getVariable "issued" >>= getMonth+ getContentsFor "pages" = getVariable "page" >>= toLaTeX . valToInlines+ getContentsFor "pagetotal" = getVariable "number-of-pages"+ >>= toLaTeX . valToInlines+ getContentsFor "langid" = getVariable "language" >>= toLaTeX . valToInlines+ getContentsFor "number" = (getVariable "number"+ <|> getVariable "collection-number"+ <|> getVariable "issue") >>= toLaTeX . valToInlines++ getContentsFor x = getVariable x >>=+ if isURL x+ then Just . literal . stringify . valToInlines+ else toLaTeX .+ (if x == "title"+ then titlecase+ else id) .+ valToInlines++ isURL x = x `elem` ["url","doi","issn","isbn"]++ renderFields = mconcat . intersperse ("," <> cr) . mapMaybe renderField++defaultLang :: Lang+defaultLang = Lang "en" Nothing (Just "US") [] [] []++-- a map of bibtex "string" macros+type StringMap = Map.Map Text Text++type BibParser = Parsec Sources (Lang, StringMap)++data Item = Item{ identifier :: Text+ , sourcePos :: SourcePos+ , entryType :: Text+ , fields :: Map.Map Text Text+ }+ deriving (Show, Ord, Eq)++itemToReference :: Locale -> Variant -> Item -> BibParser (Reference Inlines)+itemToReference locale variant item = do+ setPosition (sourcePos item)+ bib item $ do+ let lang = fromMaybe defaultLang $ localeLanguage locale+ modify $ \st -> st{ localeLang = lang,+ untitlecase = langLanguage lang == "en" }++ id' <- asks identifier+ otherIds <- (Just <$> getRawField "ids")+ <|> return Nothing+ (reftype, genre) <- getTypeAndGenre+ -- hyphenation:+ let getLangId = do+ langid <- T.strip . T.toLower <$> getRawField "langid"+ idopts <- T.strip . T.toLower . stringify <$>+ getField "langidopts" <|> return ""+ case (langid, idopts) of+ ("english","variant=british") -> return "british"+ ("english","variant=american") -> return "american"+ ("english","variant=us") -> return "american"+ ("english","variant=usmax") -> return "american"+ ("english","variant=uk") -> return "british"+ ("english","variant=australian") -> return "australian"+ ("english","variant=newzealand") -> return "newzealand"+ (x,_) -> return x+ hyphenation <- (Just . toIETF . T.toLower <$>+ (getLangId <|> getRawField "hyphenation"))+ <|> return Nothing+ modify $ \s -> s{ untitlecase = untitlecase s &&+ case hyphenation of+ Just x ->+ "en-" `T.isPrefixOf` x || x == "en"+ _ -> True }+++ opts <- (parseOptions <$> getRawField "options") <|> return []++ et <- asks entryType++ -- titles+ let isArticle = et `elem`+ ["article", "periodical", "suppperiodical", "review"]+ let isPeriodical = et == "periodical"+ let isChapterlike = et `elem`+ ["inbook","incollection","inproceedings","inreference","bookinbook"]++ let getFieldMaybe f = (Just <$> getField f) <|> return Nothing++ -- names+ let getNameList' f = Just <$>+ getNameList opts f++ author' <- getNameList' "author" <|> return Nothing+ containerAuthor' <- getNameList' "bookauthor" <|> return Nothing+ translator' <- getNameList' "translator" <|> return Nothing+ editortype <- getRawField "editortype" <|> return mempty+ editor'' <- getNameList' "editor" <|> return Nothing+ director'' <- getNameList' "director" <|> return Nothing+ let (editor', director') = case editortype of+ "director" -> (Nothing, editor'')+ _ -> (editor'', director'')+ -- FIXME: add same for editora, editorb, editorc++ -- dates+ issued' <- (Just <$> (getDate "date" <|> getOldDate mempty)) <|>+ return Nothing+ eventDate' <- (Just <$> (getDate "eventdate" <|> getOldDate "event")) <|>+ return Nothing+ origDate' <- (Just <$> (getDate "origdate" <|> getOldDate "orig")) <|>+ return Nothing+ accessed' <- (Just <$> (getDate "urldate" <|> getOldDate "url")) <|>+ return Nothing++ -- locators+ pages' <- getFieldMaybe "pages"+ volume' <- getFieldMaybe "volume"+ part' <- getFieldMaybe "part"+ volumes' <- getFieldMaybe "volumes"+ pagetotal' <- getFieldMaybe "pagetotal"+ chapter' <- getFieldMaybe "chapter"+ edition' <- getFieldMaybe "edition"+ version' <- getFieldMaybe "version"+ (number', collectionNumber', issue') <-+ (getField "number" >>= \x ->+ if et `elem` ["book","collection","proceedings","reference",+ "mvbook","mvcollection","mvproceedings", "mvreference",+ "bookinbook","inbook", "incollection","inproceedings",+ "inreference", "suppbook","suppcollection"]+ then return (Nothing, Just x, Nothing)+ else if isArticle+ then (getField "issue" >>= \y ->+ return (Nothing, Nothing, Just $ concatWith ',' [x,y]))+ <|> return (Nothing, Nothing, Just x)+ else return (Just x, Nothing, Nothing))+ <|> return (Nothing, Nothing, Nothing)++ -- titles+ hasMaintitle <- (True <$ getRawField "maintitle") <|> return False++ title' <- Just <$>+ ((guard isPeriodical >> getTitle "issuetitle")+ <|> (guard hasMaintitle >>+ guard (not isChapterlike) >>+ getTitle "maintitle")+ <|> getTitle "title")+ <|> return Nothing++ subtitle' <- (guard isPeriodical >> getTitle "issuesubtitle")+ <|> (guard hasMaintitle >>+ guard (not isChapterlike) >>+ getTitle "mainsubtitle" <|> return mempty)+ <|> getTitle "subtitle"+ <|> return mempty+ titleaddon' <- (guard hasMaintitle >>+ guard (not isChapterlike) >>+ getTitle "maintitleaddon" <|> return mempty)+ <|> getTitle "titleaddon"+ <|> return mempty++ volumeTitle' <- Just <$>+ ((guard hasMaintitle >>+ guard (not isChapterlike) >>+ getTitle "title")+ <|> (guard hasMaintitle >>+ guard isChapterlike >>+ getTitle "booktitle"))+ <|> return Nothing+ volumeSubtitle' <- (guard hasMaintitle >>+ guard (not isChapterlike) >>+ getTitle "subtitle")+ <|> (guard hasMaintitle >>+ guard isChapterlike >>+ getTitle "booksubtitle")+ <|> return mempty+ volumeTitleAddon' <- (guard hasMaintitle >>+ guard (not isChapterlike) >>+ getTitle "titleaddon")+ <|> (guard hasMaintitle >>+ guard isChapterlike >>+ getTitle "booktitleaddon")+ <|> return mempty++ containerTitle' <- Just <$>+ ((guard isPeriodical >> getPeriodicalTitle "title")+ <|> (guard isChapterlike >> getTitle "maintitle")+ <|> (guard isChapterlike >> getTitle "booktitle")+ <|> getPeriodicalTitle "journaltitle"+ <|> getPeriodicalTitle "journal")+ <|> return Nothing+ containerSubtitle' <- (guard isPeriodical >> getPeriodicalTitle "subtitle")+ <|> (guard isChapterlike >> getTitle "mainsubtitle")+ <|> (guard isChapterlike >> getTitle "booksubtitle")+ <|> getPeriodicalTitle "journalsubtitle"+ <|> return mempty+ containerTitleAddon' <- (guard isPeriodical >>+ getPeriodicalTitle "titleaddon")+ <|> (guard isChapterlike >>+ getTitle "maintitleaddon")+ <|> (guard isChapterlike >>+ getTitle "booktitleaddon")+ <|> return mempty+ containerTitleShort' <- Just <$>+ ((guard isPeriodical >>+ guard (not hasMaintitle) >>+ getField "shorttitle")+ <|> getPeriodicalTitle "shortjournal")+ <|> return Nothing++ -- change numerical series title to e.g. 'series 3'+ let fixSeriesTitle [Str xs] | isNumber xs =+ [Str (ordinalize locale xs), Space, Str (resolveKey' lang "jourser")]+ fixSeriesTitle xs = xs++ seriesTitle' <- (Just . B.fromList . fixSeriesTitle . B.toList+ <$> getTitle "series") <|>+ return Nothing+ shortTitle' <- (Just <$> (guard (not hasMaintitle || isChapterlike) >>+ getTitle "shorttitle"))+ <|> (if (subtitle' /= mempty || titleaddon' /= mempty) &&+ not hasMaintitle+ then getShortTitle False "title"+ else getShortTitle True "title")+ <|> return Nothing++ eventTitle' <- Just <$> getTitle "eventtitle" <|> return Nothing+ origTitle' <- Just <$> getTitle "origtitle" <|> return Nothing++ -- publisher+ pubfields <- mapM (\f -> Just `fmap`+ (if variant == Bibtex || f == "howpublished"+ then getField f+ else getLiteralList' f)+ <|> return Nothing)+ ["school","institution","organization", "howpublished","publisher"]+ let publisher' = case catMaybes pubfields of+ [] -> Nothing+ xs -> Just $ concatWith ';' xs+ origpublisher' <- (Just <$> getField "origpublisher") <|> return Nothing++ -- places+ venue' <- (Just <$> getField "venue") <|> return Nothing+ address' <- Just <$>+ (if variant == Bibtex+ then getField "address"+ else getLiteralList' "address"+ <|> (guard (et /= "patent") >>+ getLiteralList' "location"))+ <|> return Nothing+ origLocation' <- Just <$>+ (if variant == Bibtex+ then getField "origlocation"+ else getLiteralList' "origlocation")+ <|> return Nothing+ jurisdiction' <- if reftype == "patent"+ then Just <$>+ (concatWith ';' . map (resolveKey lang) <$>+ getLiteralList "location") <|> return Nothing+ else return Nothing++ -- url, doi, isbn, etc.:+ -- note that with eprinttype = arxiv, we take eprint to be a partial url+ -- archivePrefix is an alias for eprinttype+ url' <- (guard (et == "online" || lookup "url" opts /= Just "false")+ >> Just <$> getRawField "url")+ <|> (do etype <- getRawField "eprinttype"+ eprint <- getRawField "eprint"+ let baseUrl =+ case T.toLower etype of+ "arxiv" -> "https://arxiv.org/abs/"+ "jstor" -> "https://www.jstor.org/stable/"+ "pubmed" -> "https://www.ncbi.nlm.nih.gov/pubmed/"+ "googlebooks" -> "https://books.google.com?id="+ _ -> ""+ if T.null baseUrl+ then mzero+ else return $ Just $ baseUrl <> eprint)+ <|> return Nothing+ doi' <- (guard (lookup "doi" opts /= Just "false") >>+ Just <$> getRawField "doi")+ <|> return Nothing+ isbn' <- Just <$> getRawField "isbn" <|> return Nothing+ issn' <- Just <$> getRawField "issn" <|> return Nothing+ pmid' <- Just <$> getRawField "pmid" <|> return Nothing+ pmcid' <- Just <$> getRawField "pmcid" <|> return Nothing+ callNumber' <- Just <$> getRawField "library" <|> return Nothing++ -- notes+ annotation' <- Just <$>+ (getField "annotation" <|> getField "annote")+ <|> return Nothing+ abstract' <- Just <$> getField "abstract" <|> return Nothing+ keywords' <- Just <$> getField "keywords" <|> return Nothing+ note' <- if et == "periodical"+ then return Nothing+ else Just <$> getField "note" <|> return Nothing+ addendum' <- if variant == Bibtex+ then return Nothing+ else Just <$> getField "addendum"+ <|> return Nothing+ pubstate' <- ( (Just . resolveKey lang <$> getField "pubstate")+ <|> case dateLiteral <$> issued' of+ Just (Just "forthcoming") ->+ return $ Just $ B.str "forthcoming"+ _ -> return Nothing+ )+++++ let addField (_, Nothing) = id+ addField (f, Just x) = Map.insert f x+ let vars = foldr addField mempty+ [ ("other-ids", TextVal <$> otherIds)+ , ("genre", TextVal <$> genre)+ , ("language", TextVal <$> hyphenation)+ -- dates+ , ("accessed", DateVal <$> accessed')+ , ("event-date", DateVal <$> eventDate')+ , ("issued", DateVal <$> issued')+ , ("original-date", DateVal <$> origDate')+ -- names+ , ("author", NamesVal <$> author')+ , ("editor", NamesVal <$> editor')+ , ("translator", NamesVal <$> translator')+ , ("director", NamesVal <$> director')+ , ("container-author", NamesVal <$> containerAuthor')+ -- locators+ , ("page", FancyVal . Walk.walk convertEnDash <$> pages')+ , ("number-of-pages", FancyVal <$> pagetotal')+ , ("volume", case (volume', part') of+ (Nothing, Nothing) -> Nothing+ (Just v, Nothing) -> Just $ FancyVal v+ (Nothing, Just p) -> Just $ FancyVal p+ (Just v, Just p) ->+ Just $ FancyVal $ v <> B.str "." <> p)+ , ("number-of-volumes", FancyVal <$> volumes')+ , ("chapter-number", FancyVal <$> chapter')+ , ("edition", FancyVal <$> edition')+ , ("version", FancyVal <$> version')+ , ("number", FancyVal <$> number')+ , ("collection-number", FancyVal <$> collectionNumber')+ , ("issue", FancyVal <$> issue')+ -- title+ , ("original-title", FancyVal <$> origTitle')+ , ("event", FancyVal <$> eventTitle')+ , ("title", case title' of+ Just t -> Just $ FancyVal $+ concatWith '.' [+ concatWith ':' [t, subtitle']+ , titleaddon' ]+ Nothing -> Nothing)+ , ("volume-title",+ case volumeTitle' of+ Just t -> Just $ FancyVal $+ concatWith '.' [+ concatWith ':' [t, volumeSubtitle']+ , volumeTitleAddon' ]+ Nothing -> Nothing)+ , ("container-title",+ case containerTitle' of+ Just t -> Just $ FancyVal $+ concatWith '.' [+ concatWith ':' [t,+ containerSubtitle']+ , containerTitleAddon' ]+ Nothing -> Nothing)+ , ("container-title-short", FancyVal <$> containerTitleShort')+ , ("collection-title", FancyVal <$> seriesTitle')+ , ("title-short", FancyVal <$> shortTitle')+ -- publisher+ , ("publisher", FancyVal <$> publisher')+ , ("original-publisher", FancyVal <$> origpublisher')+ -- places+ , ("jurisdiction", FancyVal <$> jurisdiction')+ , ("event-place", FancyVal <$> venue')+ , ("publisher-place", FancyVal <$> address')+ , ("original-publisher-place", FancyVal <$> origLocation')+ -- urls+ , ("url", TextVal <$> url')+ , ("doi", TextVal <$> doi')+ , ("isbn", TextVal <$> isbn')+ , ("issn", TextVal <$> issn')+ , ("pmcid", TextVal <$> pmcid')+ , ("pmid", TextVal <$> pmid')+ , ("call-number", TextVal <$> callNumber')+ -- notes+ , ("note", case catMaybes [note', addendum'] of+ [] -> Nothing+ xs -> return $ FancyVal $ concatWith '.' xs)+ , ("annote", FancyVal <$> annotation')+ , ("abstract", FancyVal <$> abstract')+ , ("keyword", FancyVal <$> keywords')+ , ("status", FancyVal <$> pubstate')+ ]+ return $ Reference+ { referenceId = ItemId id'+ , referenceType = reftype+ , referenceDisambiguation = Nothing+ , referenceVariables = vars }+++bib :: Item -> Bib a -> BibParser a+bib entry m = fst <$> evalRWST m entry (BibState True defaultLang)++resolveCrossRefs :: Variant -> [Item] -> [Item]+resolveCrossRefs variant entries =+ map (resolveCrossRef variant entries) entries++resolveCrossRef :: Variant -> [Item] -> Item -> Item+resolveCrossRef variant entries entry =+ Map.foldrWithKey go entry (fields entry)+ where go key val entry' =+ if key == "crossref" || key == "xdata"+ then entry'{ fields = fields entry' <>+ Map.fromList (getXrefFields variant+ entry entries val) }+ else entry'++getXrefFields :: Variant -> Item -> [Item] -> Text -> [(Text, Text)]+getXrefFields variant baseEntry entries keys = do+ let keys' = splitKeys keys+ xrefEntry <- [e | e <- entries, identifier e `elem` keys']+ (k, v) <- Map.toList $ fields xrefEntry+ if k == "crossref" || k == "xdata"+ then do+ xs <- mapM (getXrefFields variant baseEntry entries)+ (splitKeys v)+ (x, y) <- xs+ guard $ isNothing $ Map.lookup x $ fields xrefEntry+ return (x, y)+ else do+ k' <- case variant of+ Bibtex -> return k+ Biblatex -> transformKey+ (entryType xrefEntry) (entryType baseEntry) k+ guard $ isNothing $ Map.lookup k' $ fields baseEntry+ return (k',v)++++data BibState = BibState{+ untitlecase :: Bool+ , localeLang :: Lang+ }++type Bib = RWST Item () BibState BibParser++blocksToInlines :: [Block] -> Inlines+blocksToInlines bs =+ case bs of+ [Plain xs] -> B.fromList xs+ [Para xs] -> B.fromList xs+ _ -> B.fromList $ Walk.query (:[]) bs++adjustSpans :: Lang -> Inline -> Inline+adjustSpans lang (Span ("",[],[("bibstring",s)]) _) = Str $ resolveKey' lang s+adjustSpans _ SoftBreak = Space+adjustSpans _ x = x++latex' :: Text -> Bib [Block]+latex' t = do+ lang <- gets localeLang+ case parseLaTeX lang t of+ Left _ -> mzero+ Right bs -> return bs++parseLaTeX :: Lang -> Text -> Either PandocError [Block]+parseLaTeX lang t =+ case runPure (readLaTeX+ def{ readerExtensions =+ extensionsFromList [Ext_raw_tex, Ext_smart] } t) of+ Left e -> Left e+ Right (Pandoc _ bs) -> Right $ Walk.walk (adjustSpans lang) bs++latex :: Text -> Bib Inlines+latex = fmap blocksToInlines . latex' . T.strip++bibEntries :: BibParser [Item]+bibEntries = do+ skipMany nonEntry+ many (bibItem <* skipMany nonEntry)+ where nonEntry = bibSkip <|>+ comment <|>+ try (char '@' >>+ (bibComment <|> bibPreamble <|> bibString))++bibSkip :: BibParser ()+bibSkip = skipMany1 (satisfy (\c -> c /='@' && c /='%'))++comment :: BibParser ()+comment = char '%' *> void anyLine++bibComment :: BibParser ()+bibComment = do+ cistring "comment"+ spaces'+ void inBraces++bibPreamble :: BibParser ()+bibPreamble = do+ cistring "preamble"+ spaces'+ void inBraces++bibString :: BibParser ()+bibString = do+ cistring "string"+ spaces'+ char '{'+ spaces'+ (k,v) <- entField+ char '}'+ updateState (\(l,m) -> (l, Map.insert k v m))+ return ()++take1WhileP :: Monad m => (Char -> Bool) -> ParsecT Sources u m Text+take1WhileP f = T.pack <$> many1 (satisfy f)++inBraces :: BibParser Text+inBraces = do+ char '{'+ res <- manyTill+ ( take1WhileP (\c -> c /= '{' && c /= '}' && c /= '\\')+ <|> (char '\\' >> T.cons '\\' . T.singleton <$> anyChar)+ <|> (braced <$> inBraces)+ ) (char '}')+ return $ T.concat res++braced :: Text -> Text+braced = T.cons '{' . flip T.snoc '}'++inQuotes :: BibParser Text+inQuotes = do+ char '"'+ T.concat <$> manyTill+ ( take1WhileP (\c -> c /= '{' && c /= '"' && c /= '\\')+ <|> (char '\\' >> T.cons '\\' . T.singleton <$> anyChar)+ <|> braced <$> inBraces+ ) (char '"')++fieldName :: BibParser Text+fieldName = resolveAlias . T.toLower+ <$> take1WhileP (\c ->+ isAlphaNum c || c == '-' || c == '_' || c == ':' || c == '+')++isBibtexKeyChar :: Char -> Bool+isBibtexKeyChar c =+ isAlphaNum c || c `elem` (".:;?!`'()$/*@_+=-[]*&" :: [Char])++spaces' :: BibParser ()+spaces' = skipMany (void (satisfy isSpace) <|> comment)++bibItem :: BibParser Item+bibItem = do+ char '@'+ pos <- getPosition+ enttype <- T.toLower <$> take1WhileP isLetter+ spaces'+ char '{'+ spaces'+ entid <- take1WhileP isBibtexKeyChar+ spaces'+ char ','+ spaces'+ entfields <- entField `sepEndBy` (char ',' >> spaces')+ spaces'+ char '}'+ return $ Item entid pos enttype (Map.fromList entfields)++entField :: BibParser (Text, Text)+entField = do+ k <- fieldName+ spaces'+ char '='+ spaces'+ vs <- (expandString <|> inQuotes <|> inBraces <|> rawWord) `sepBy`+ try (spaces' >> char '#' >> spaces')+ spaces'+ return (k, T.concat vs)++resolveAlias :: Text -> Text+resolveAlias "archiveprefix" = "eprinttype"+resolveAlias "primaryclass" = "eprintclass"+resolveAlias s = s++rawWord :: BibParser Text+rawWord = take1WhileP isAlphaNum++expandString :: BibParser Text+expandString = do+ k <- fieldName+ (lang, strs) <- getState+ case Map.lookup k strs of+ Just v -> return v+ Nothing -> return $ resolveKey' lang k++cistring :: Text -> BibParser Text+cistring s = try (go s)+ where go t = case T.uncons t of+ Nothing -> return ""+ Just (c,cs) -> do+ x <- char (toLower c) <|> char (toUpper c)+ xs <- go cs+ return (T.cons x xs)++splitKeys :: Text -> [Text]+splitKeys = filter (not . T.null) . T.split (\c -> c == ' ' || c == ',')++-- Biblatex Localization Keys (see Biblatex manual)+-- Currently we only map a subset likely to be used in Biblatex *databases*+-- (in fields such as `type`, and via `\bibstring{}` commands).++parseMonth :: Text -> Maybe Int+parseMonth s =+ case T.toLower s of+ "jan" -> Just 1+ "feb" -> Just 2+ "mar" -> Just 3+ "apr" -> Just 4+ "may" -> Just 5+ "jun" -> Just 6+ "jul" -> Just 7+ "aug" -> Just 8+ "sep" -> Just 9+ "oct" -> Just 10+ "nov" -> Just 11+ "dec" -> Just 12+ _ -> readMay (T.unpack s)++notFound :: Text -> Bib a+notFound f = Prelude.fail $ T.unpack f ++ " not found"++getField :: Text -> Bib Inlines+getField f = do+ fs <- asks fields+ case Map.lookup f fs of+ Just x -> latex x+ Nothing -> notFound f+++getPeriodicalTitle :: Text -> Bib Inlines+getPeriodicalTitle f = do+ ils <- getField f+ return $ protectCase id ils++protectCase :: (Inlines -> Inlines) -> (Inlines -> Inlines)+protectCase f = Walk.walk unprotect . f . Walk.walk protect+ where+ protect (Span ("",[],[]) xs) = Span ("",["nocase"],[]) xs+ protect x = x+ unprotect (Span ("",["nocase"],[]) xs)+ | hasLowercaseWord xs = Span ("",["nocase"],[]) xs+ | otherwise = Span ("",[],[]) xs+ unprotect x = x+ hasLowercaseWord = any startsWithLowercase . splitStrWhen isPunctuation+ startsWithLowercase (Str (T.uncons -> Just (x,_))) = isLower x+ startsWithLowercase _ = False++unTitlecase :: Maybe Lang -> Inlines -> Inlines+unTitlecase mblang = protectCase (addTextCase mblang SentenceCase)++getTitle :: Text -> Bib Inlines+getTitle f = do+ ils <- getField f+ utc <- gets untitlecase+ lang <- gets localeLang+ let ils' =+ if f == "series"+ then resolveKey lang ils+ else ils+ let processTitle = if utc then unTitlecase (Just lang) else id+ return $ processTitle ils'++getShortTitle :: Bool -> Text -> Bib (Maybe Inlines)+getShortTitle requireColon f = do+ ils <- splitStrWhen (==':') . B.toList <$> getTitle f+ if not requireColon || containsColon ils+ then return $ Just $ B.fromList $ upToColon ils+ else return Nothing++containsColon :: [Inline] -> Bool+containsColon xs = Str ":" `elem` xs++upToColon :: [Inline] -> [Inline]+upToColon xs = takeWhile (/= Str ":") xs++isNumber :: Text -> Bool+isNumber t = case T.uncons t of+ Just ('-', ds) -> T.all isDigit ds+ Just _ -> T.all isDigit t+ Nothing -> False++getDate :: Text -> Bib Date+getDate f = do+ -- the ~ can used for approx dates, but the latex reader+ -- parses this as a nonbreaking space, so we need to convert it back!+ let nbspToTilde '\160' = '~'+ nbspToTilde c = c+ mbd <- rawDateEDTF . T.map nbspToTilde <$> getRawField f+ case mbd of+ Nothing -> Prelude.fail "expected date"+ Just d -> return d++-- A negative (BC) year might be written with -- or --- in bibtex:+fixLeadingDash :: Text -> Text+fixLeadingDash t = case T.uncons t of+ Just (c, ds) | (c == '–' || c == '—') && firstIsDigit ds -> T.cons '–' ds+ _ -> t+ where firstIsDigit = maybe False (isDigit . fst) . T.uncons++getOldDate :: Text -> Bib Date+getOldDate prefix = do+ year' <- (readMay . T.unpack . fixLeadingDash . stringify+ <$> getField (prefix <> "year")) <|> return Nothing+ month' <- (parseMonth <$> getRawField (prefix <> "month"))+ <|> return Nothing+ day' <- (readMay . T.unpack <$> getRawField (prefix <> "day"))+ <|> return Nothing+ endyear' <- (readMay . T.unpack . fixLeadingDash . stringify+ <$> getField (prefix <> "endyear")) <|> return Nothing+ endmonth' <- (parseMonth . stringify+ <$> getField (prefix <> "endmonth")) <|> return Nothing+ endday' <- (readMay . T.unpack . stringify <$>+ getField (prefix <> "endday")) <|> return Nothing+ let toDateParts (y', m', d') =+ DateParts $+ case y' of+ Nothing -> []+ Just y ->+ case m' of+ Nothing -> [y]+ Just m ->+ case d' of+ Nothing -> [y,m]+ Just d -> [y,m,d]+ let dateparts = filter (\x -> x /= DateParts [])+ $ map toDateParts [(year',month',day'),+ (endyear',endmonth',endday')]+ literal' <- if null dateparts+ then Just <$> getRawField (prefix <> "year")+ else return Nothing+ return $+ Date { dateParts = dateparts+ , dateCirca = False+ , dateSeason = Nothing+ , dateLiteral = literal' }++getRawField :: Text -> Bib Text+getRawField f = do+ fs <- asks fields+ case Map.lookup f fs of+ Just x -> return x+ Nothing -> notFound f++getLiteralList :: Text -> Bib [Inlines]+getLiteralList f = do+ fs <- asks fields+ case Map.lookup f fs of+ Just x -> latex' x >>= toLiteralList+ Nothing -> notFound f++-- separates items with semicolons+getLiteralList' :: Text -> Bib Inlines+getLiteralList' f = do+ fs <- asks fields+ case Map.lookup f fs of+ Just x -> do+ x' <- latex' x+ case x' of+ [Para xs] ->+ return $ B.fromList+ $ intercalate [Str ";", Space]+ $ splitByAnd xs+ [Plain xs] ->+ return $ B.fromList+ $ intercalate [Str ";", Space]+ $ splitByAnd xs+ _ -> mzero+ Nothing -> notFound f++splitByAnd :: [Inline] -> [[Inline]]+splitByAnd = splitOn [Space, Str "and", Space]++toLiteralList :: [Block] -> Bib [Inlines]+toLiteralList [Para xs] =+ return $ map B.fromList $ splitByAnd xs+toLiteralList [Plain xs] = toLiteralList [Para xs]+toLiteralList _ = mzero++concatWith :: Char -> [Inlines] -> Inlines+concatWith sep = L.foldl' go mempty+ where go :: Inlines -> Inlines -> Inlines+ go accum s+ | s == mempty = accum+ | otherwise =+ case Seq.viewr (B.unMany accum) of+ Seq.EmptyR -> s+ _ Seq.:> Str x+ | not (T.null x) &&+ T.last x `elem` ("!?.,:;" :: String)+ -> accum <> B.space <> s+ _ -> accum <> B.str (T.singleton sep) <>+ B.space <> s+++parseOptions :: Text -> [(Text, Text)]+parseOptions = map breakOpt . T.splitOn ","+ where breakOpt x = case T.break (=='=') x of+ (w,v) -> (T.toLower $ T.strip w,+ T.toLower $ T.strip $ T.drop 1 v)++optionSet :: Text -> [(Text, Text)] -> Bool+optionSet key opts = case lookup key opts of+ Just "true" -> True+ Just s -> s == mempty+ _ -> False++getNameList :: [(Text, Text)] -> Text -> Bib [Name]+getNameList opts f = do+ fs <- asks fields+ case Map.lookup f fs of+ Just x -> latexNames nameopts x+ Nothing -> notFound f+ where+ nameopts = NameOpts{+ nameOptsPrefixIsNonDroppingParticle = optionSet "useprefix" opts,+ nameOptsUseJuniorComma = optionSet "juniorcomma" opts}++toNameList :: NameOpts -> [Block] -> Bib [Name]+toNameList opts [Para xs] =+ filter (/= emptyName) <$> mapM (toName opts . addSpaceAfterPeriod)+ (splitByAnd xs)+toNameList opts [Plain xs] = toNameList opts [Para xs]+toNameList _ _ = mzero++latexNames :: NameOpts -> Text -> Bib [Name]+latexNames opts t = latex' (T.strip t) >>= toNameList opts++-- see issue 392 for motivation. We want to treat+-- "J.G. Smith" and "J. G. Smith" the same.+addSpaceAfterPeriod :: [Inline] -> [Inline]+addSpaceAfterPeriod = go . splitStrWhen (=='.')+ where+ go [] = []+ go (Str (T.unpack -> [c]):Str ".":Str (T.unpack -> [d]):xs)+ | isLetter d+ , isLetter c+ , isUpper c+ , isUpper d+ = Str (T.singleton c):Str ".":Space:go (Str (T.singleton d):xs)+ go (x:xs) = x:go xs++ordinalize :: Locale -> Text -> Text+ordinalize locale n =+ let terms = localeTerms locale+ pad0 t = case T.length t of+ 0 -> "00"+ 1 -> "0" <> t+ _ -> t+ in case Map.lookup ("ordinal-" <> pad0 n) terms <|>+ Map.lookup "ordinal" terms of+ Nothing -> n+ Just [] -> n+ Just (t:_) -> n <> snd t++getTypeAndGenre :: Bib (Text, Maybe Text)+getTypeAndGenre = do+ lang <- gets localeLang+ et <- asks entryType+ reftype' <- resolveKey' lang <$> getRawField "type"+ <|> return mempty+ st <- getRawField "entrysubtype" <|> return mempty+ isEvent <- (True <$ (getRawField "eventdate"+ <|> getRawField "eventtitle"+ <|> getRawField "venue")) <|> return False+ let reftype =+ case et of+ "article"+ | st == "magazine" -> "article-magazine"+ | st == "newspaper" -> "article-newspaper"+ | otherwise -> "article-journal"+ "book" -> "book"+ "booklet" -> "pamphlet"+ "bookinbook" -> "book"+ "collection" -> "book"+ "dataset" -> "dataset"+ "electronic" -> "webpage"+ "inbook" -> "chapter"+ "incollection" -> "chapter"+ "inreference" -> "entry-encyclopedia"+ "inproceedings" -> "paper-conference"+ "manual" -> "book"+ "mastersthesis" -> "thesis"+ "misc" -> ""+ "mvbook" -> "book"+ "mvcollection" -> "book"+ "mvproceedings" -> "book"+ "mvreference" -> "book"+ "online" -> "webpage"+ "patent" -> "patent"+ "periodical"+ | st == "magazine" -> "article-magazine"+ | st == "newspaper" -> "article-newspaper"+ | otherwise -> "article-journal"+ "phdthesis" -> "thesis"+ "proceedings" -> "book"+ "reference" -> "book"+ "report" -> "report"+ "software" -> "software"+ "suppbook" -> "chapter"+ "suppcollection" -> "chapter"+ "suppperiodical"+ | st == "magazine" -> "article-magazine"+ | st == "newspaper" -> "article-newspaper"+ | otherwise -> "article-journal"+ "techreport" -> "report"+ "thesis" -> "thesis"+ "unpublished" -> if isEvent then "speech" else "manuscript"+ "www" -> "webpage"+ -- biblatex, "unsupported"+ "artwork" -> "graphic"+ "audio" -> "song" -- for audio *recordings*+ "commentary" -> "book"+ "image" -> "graphic" -- or "figure" ?+ "jurisdiction" -> "legal_case"+ "legislation" -> "legislation" -- or "bill" ?+ "legal" -> "treaty"+ "letter" -> "personal_communication"+ "movie" -> "motion_picture"+ "music" -> "song" -- for musical *recordings*+ "performance" -> "speech"+ "review" -> "review" -- or "review-book" ?+ "standard" -> "legislation"+ "video" -> "motion_picture"+ -- biblatex-apa:+ "data" -> "dataset"+ "letters" -> "personal_communication"+ "newsarticle" -> "article-newspaper"+ _ -> ""++ let refgenre =+ case et of+ "mastersthesis" -> if T.null reftype'+ then Just $ resolveKey' lang "mathesis"+ else Just reftype'+ "phdthesis" -> if T.null reftype'+ then Just $ resolveKey' lang "phdthesis"+ else Just reftype'+ _ -> if T.null reftype'+ then Nothing+ else Just reftype'+ return (reftype, refgenre)+++-- transformKey source target key+-- derived from Appendix C of bibtex manual+transformKey :: Text -> Text -> Text -> [Text]+transformKey _ _ "ids" = []+transformKey _ _ "crossref" = []+transformKey _ _ "xref" = []+transformKey _ _ "entryset" = []+transformKey _ _ "entrysubtype" = []+transformKey _ _ "execute" = []+transformKey _ _ "label" = []+transformKey _ _ "options" = []+transformKey _ _ "presort" = []+transformKey _ _ "related" = []+transformKey _ _ "relatedoptions" = []+transformKey _ _ "relatedstring" = []+transformKey _ _ "relatedtype" = []+transformKey _ _ "shorthand" = []+transformKey _ _ "shorthandintro" = []+transformKey _ _ "sortkey" = []+transformKey x y "author"+ | x `elem` ["mvbook", "book"] &&+ y `elem` ["inbook", "bookinbook", "suppbook"] = ["bookauthor", "author"]+-- note: this next clause is not in the biblatex manual, but it makes+-- sense in the context of CSL conversion:+transformKey x y "author"+ | x == "mvbook" && y == "book" = ["bookauthor", "author"]+transformKey "mvbook" y z+ | y `elem` ["book", "inbook", "bookinbook", "suppbook"] = standardTrans z+transformKey x y z+ | x `elem` ["mvcollection", "mvreference"] &&+ y `elem` ["collection", "reference", "incollection", "inreference",+ "suppcollection"] = standardTrans z+transformKey "mvproceedings" y z+ | y `elem` ["proceedings", "inproceedings"] = standardTrans z+transformKey "book" y z+ | y `elem` ["inbook", "bookinbook", "suppbook"] = bookTrans z+transformKey x y z+ | x `elem` ["collection", "reference"] &&+ y `elem` ["incollection", "inreference", "suppcollection"] = bookTrans z+transformKey "proceedings" "inproceedings" z = bookTrans z+transformKey "periodical" y z+ | y `elem` ["article", "suppperiodical"] =+ case z of+ "title" -> ["journaltitle"]+ "subtitle" -> ["journalsubtitle"]+ "shorttitle" -> []+ "sorttitle" -> []+ "indextitle" -> []+ "indexsorttitle" -> []+ _ -> [z]+transformKey _ _ x = [x]++standardTrans :: Text -> [Text]+standardTrans z =+ case z of+ "title" -> ["maintitle"]+ "subtitle" -> ["mainsubtitle"]+ "titleaddon" -> ["maintitleaddon"]+ "shorttitle" -> []+ "sorttitle" -> []+ "indextitle" -> []+ "indexsorttitle" -> []+ _ -> [z]++bookTrans :: Text -> [Text]+bookTrans z =+ case z of+ "title" -> ["booktitle"]+ "subtitle" -> ["booksubtitle"]+ "titleaddon" -> ["booktitleaddon"]+ "shorttitle" -> []+ "sorttitle" -> []+ "indextitle" -> []+ "indexsorttitle" -> []+ _ -> [z]++resolveKey :: Lang -> Inlines -> Inlines+resolveKey lang (Many ils) = Many $ fmap go ils+ where go (Str s) = Str $ resolveKey' lang s+ go x = x++resolveKey' :: Lang -> Text -> Text+resolveKey' lang k =+ case Map.lookup (langLanguage lang) biblatexStringMap >>=+ Map.lookup k of+ Nothing -> k+ Just (x, _) -> either (const k) stringify $ parseLaTeX lang x++convertEnDash :: Inline -> Inline+convertEnDash (Str s) = Str (T.map (\c -> if c == '–' then '-' else c) s)+convertEnDash x = x
@@ -0,0 +1,42 @@+{-# LANGUAGE OverloadedStrings #-}+module Text.Pandoc.Citeproc.CslJson+ ( cslJsonToReferences )+where++import Citeproc.CslJson+import Citeproc.Types+import Control.Monad.Identity (runIdentity)+import Data.Aeson (eitherDecodeStrict', FromJSON(parseJSON), (.:), Value(..))+import Data.Aeson.Types (parseEither)+import Data.ByteString (ByteString)+import Text.Pandoc.Builder as B+import Data.Text (Text)++fromCslJson :: CslJson Text -> Inlines+fromCslJson (CslText t) = B.text t+fromCslJson CslEmpty = mempty+fromCslJson (CslConcat x y) = fromCslJson x <> fromCslJson y+fromCslJson (CslQuoted x) = B.doubleQuoted (fromCslJson x)+fromCslJson (CslItalic x) = B.emph (fromCslJson x)+fromCslJson (CslNormal x) = fromCslJson x -- TODO?+fromCslJson (CslBold x) = B.strong (fromCslJson x)+fromCslJson (CslUnderline x) = B.underline (fromCslJson x)+fromCslJson (CslNoDecoration x) =+ B.spanWith ("",["nodecoration"],[]) (fromCslJson x)+fromCslJson (CslSmallCaps x) = B.smallcaps (fromCslJson x)+fromCslJson (CslBaseline x) = fromCslJson x+fromCslJson (CslSub x) = B.subscript (fromCslJson x)+fromCslJson (CslSup x) = B.superscript (fromCslJson x)+fromCslJson (CslNoCase x) = B.spanWith ("",["nocase"],[]) (fromCslJson x)+fromCslJson (CslDiv t x) = B.spanWith ("",["csl-" <> t],[]) (fromCslJson x)+fromCslJson (CslLink u x) = B.link u "" (fromCslJson x)++cslJsonToReferences :: ByteString -> Either String [Reference Inlines]+cslJsonToReferences raw = do+ items <-+ case eitherDecodeStrict' raw of+ Left e -> Left e+ Right (Object o) -> parseEither (.: "items") o+ Right val@(Array _) -> parseEither parseJSON val+ Right _ -> Left "expecting Object or Array"+ pure $ map (runIdentity . traverse (return . fromCslJson)) items
@@ -0,0 +1,32 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TemplateHaskell #-}+module Text.Pandoc.Citeproc.Data+ (biblatexStringMap)+where+import Data.FileEmbed+import Data.ByteString (ByteString)+import qualified Data.Map as M+import qualified Data.Text.Encoding as TE+import qualified Data.Text as T+import Data.Text (Text)+import Text.Pandoc.Citeproc.Util (toIETF)+import Text.Collate.Lang (Lang(..), parseLang)++biblatexLocalizations :: [(FilePath, ByteString)]+biblatexLocalizations = $(embedDir "citeproc/biblatex-localization")++-- biblatex localization keys, from files at+-- http://github.com/plk/biblatex/tree/master/tex/latex/biblatex/lbx+biblatexStringMap :: M.Map Text (M.Map Text (Text, Text))+biblatexStringMap = foldr go mempty biblatexLocalizations+ where+ go (fp, bs) =+ let ls = T.lines $ TE.decodeUtf8 bs+ in case parseLang (toIETF $ T.takeWhile (/= '.') $ T.pack fp) of+ Right lang | length ls > 4+ -> M.insert (langLanguage lang)+ (toStringMap $ map (T.splitOn "|") ls)+ _ -> id+ toStringMap = foldr go' mempty+ go' [term, x, y] = M.insert term (x, y)+ go' _ = id
@@ -0,0 +1,334 @@+{-# LANGUAGE TupleSections #-}+{-# LANGUAGE ViewPatterns #-}+{-# LANGUAGE OverloadedStrings #-}+module Text.Pandoc.Citeproc.Locator+ ( parseLocator+ , toLocatorMap+ , LocatorInfo(..)+ , LocatorMap(..) )+where+import Citeproc.Types+import Text.Pandoc.Citeproc.Util (splitStrWhen)+import Data.Text (Text)+import qualified Data.Text as T+import qualified Data.List as L+import Text.Pandoc.Definition+import Text.Pandoc.Parsing+import Text.Pandoc.Shared (stringify)+import Control.Monad (mzero)+import qualified Data.Map as M+import Data.Char (isSpace, isPunctuation, isDigit)+++data LocatorInfo =+ LocatorInfo{ locatorRaw :: Text+ , locatorLabel :: Text+ , locatorLoc :: Text+ }+ deriving (Show)++parseLocator :: LocatorMap -> [Inline] -> (Maybe LocatorInfo, [Inline])+parseLocator locmap inp =+ case parse (pLocatorWords locmap) "suffix" $ splitInp inp of+ Right r -> r+ Left _ -> (Nothing, maybeAddComma inp)++splitInp :: [Inline] -> [Inline]+splitInp = splitStrWhen (\c -> isSpace c || (isPunctuation c && c /= ':'))++--+-- Locator parsing+--++type LocatorParser = Parsec [Inline] ()++pLocatorWords :: LocatorMap+ -> LocatorParser (Maybe LocatorInfo, [Inline])+pLocatorWords locMap = do+ optional $ pMatchChar "," (== ',')+ optional pSpace+ info <- pLocatorDelimited locMap <|> pLocatorIntegrated locMap+ s <- getInput -- rest is suffix+ return $+ if T.null (locatorLabel info) && T.null (locatorLoc info)+ then (Nothing, maybeAddComma s)+ else (Just info, s)++maybeAddComma :: [Inline] -> [Inline]+maybeAddComma [] = []+maybeAddComma ils@(Space : _) = ils+maybeAddComma ils@(Str t : _)+ | Just (c, _) <- T.uncons t+ , isPunctuation c = ils+maybeAddComma ils = Str "," : Space : ils++pLocatorDelimited :: LocatorMap -> LocatorParser LocatorInfo+pLocatorDelimited locMap = try $ do+ _ <- pMatchChar "{" (== '{')+ skipMany pSpace -- gobble pre-spaces so label doesn't try to include them+ (rawlab, la, _) <- pLocatorLabelDelimited locMap+ -- we only care about balancing {} and [] (because of the outer [] scope);+ -- the rest can be anything+ let inner = do { t <- anyToken; return (True, cslJsonify t) }+ gs <- many (pBalancedBraces [('{','}'), ('[',']')] inner)+ _ <- pMatchChar "}" (== '}')+ let lo = mconcat $ map snd gs+ return $ LocatorInfo{ locatorLoc = lo,+ locatorLabel = la,+ locatorRaw = rawlab <> "{" <> lo <> "}" }++-- a variant of stringify that preserves formatting using CSL JSON+-- conventions+cslJsonify :: Inline -> Text+cslJsonify = go+ where goMany :: [Inline] -> T.Text+ goMany = mconcat . map go+ go :: Inline -> T.Text+ go (Str t) = t+ go Space = " "+ go SoftBreak = " "+ go LineBreak = " "+ go (Emph ils) = "<i>" <> goMany ils <> "</i>"+ go (Underline ils) = "<u>" <> goMany ils <> "</u>"+ go (Strong ils) = "<b>" <> goMany ils <> "</b>"+ go (Strikeout ils) = goMany ils+ go (Superscript ils) = "<sup>" <> goMany ils <> "</sup>"+ go (Subscript ils) = "<sub>" <> goMany ils <> "</sub>"+ go (SmallCaps ils) = "<span style=\"font-variant:small-caps;\">" <>+ goMany ils <> "</span>"+ go (Quoted SingleQuote ils) = "'" <> goMany ils <> "'"+ go (Quoted DoubleQuote ils) = "\"" <> goMany ils <> "\""+ go (Cite _ ils) = goMany ils+ go (Code _ t) = t+ go (Math _ t) = t+ go (RawInline _ _) = ""+ go (Link _ ils _) = goMany ils+ go (Image _ ils _) = goMany ils+ go (Note _) = ""+ go (Span (_,cls@(_:_),_) ils) =+ "<span class=\"" <> T.unwords cls <> "\">" <> goMany ils <> "</span>"+ go (Span (_,[],[("style","baseline")]) ils) =+ "<span style=\"baseline\">" <> goMany ils <> "</span>"+ go (Span _ ils) = goMany ils++pLocatorLabelDelimited :: LocatorMap -> LocatorParser (Text, Text, Bool)+pLocatorLabelDelimited locMap+ = pLocatorLabel' locMap (stringify <$> anyToken)+ <|> (("", "page", True) <$ lookAhead (pMatchChar "digit" isDigit))+ <|> (pure ("", "", True))++pLocatorIntegrated :: LocatorMap -> LocatorParser LocatorInfo+pLocatorIntegrated locMap = try $ do+ (rawlab, la, wasImplicit) <- pLocatorLabelIntegrated locMap+ -- if we got the label implicitly, we have presupposed the first one is+ -- going to have a digit, so guarantee that. You _can_ have p. (a)+ -- because you specified it.+ let modifier = if wasImplicit+ then requireDigits+ else requireRomansOrDigits+ g <- try $ pLocatorWordIntegrated (not wasImplicit) >>= modifier+ gs <- many (try $ pLocatorWordIntegrated False >>= modifier)+ let lo = T.concat (g:gs)+ return $ LocatorInfo{ locatorLabel = la,+ locatorLoc = lo,+ locatorRaw = rawlab <> lo }++pLocatorLabelIntegrated :: LocatorMap -> LocatorParser (Text, Text, Bool)+pLocatorLabelIntegrated locMap+ = pLocatorLabel' locMap lim <|>+ (lookAhead digital >> return ("", "page", True))+ where+ lim = try $ pLocatorWordIntegrated True >>= requireRomansOrDigits+ digital = try $ pLocatorWordIntegrated True >>= requireDigits++pLocatorLabel' :: LocatorMap -> LocatorParser Text+ -> LocatorParser (Text, Text, Bool)+pLocatorLabel' locMap lim = go ""+ where+ -- grow the match string until we hit the end+ -- trying to find the largest match for a label+ go acc = try $ do+ -- advance at least one token each time+ -- the pathological case is "p.3"+ t <- anyToken+ ts <- manyTill anyToken (try $ lookAhead lim)+ let s = acc <> stringify (t:ts)+ case M.lookup (T.toCaseFold $ T.strip s) (unLocatorMap locMap) of+ -- try to find a longer one, or return this one+ Just l -> go s <|> return (s, l, False)+ Nothing -> go s++-- hard requirement for a locator to have some real digits in it+requireDigits :: (Bool, Text) -> LocatorParser Text+requireDigits (_, s) = if not (T.any isDigit s)+ then Prelude.fail "requireDigits"+ else return s++-- soft requirement for a sequence with some roman or arabic parts+-- (a)(iv) -- because iv is roman+-- 1(a) -- because 1 is an actual digit+-- NOT: a, (a)-(b), hello, (some text in brackets)+requireRomansOrDigits :: (Bool, Text) -> LocatorParser Text+requireRomansOrDigits (d, s) = if not d+ then Prelude.fail "requireRomansOrDigits"+ else return s++pLocatorWordIntegrated :: Bool -> LocatorParser (Bool, Text)+pLocatorWordIntegrated isFirst = try $ do+ punct <- if isFirst+ then return ""+ else (stringify <$> pLocatorSep) <|> return ""+ sp <- option "" (pSpace >> return " ")+ (dig, s) <- pBalancedBraces [('(',')'), ('[',']'), ('{','}')] pPageSeq+ return (dig, punct <> sp <> s)++-- we want to capture: 123, 123A, C22, XVII, 33-44, 22-33; 22-11+-- 34(1), 34A(A), 34(1)(i)(i), (1)(a)+-- [17], [17]-[18], '591 [84]'+-- (because CSL cannot pull out individual pages/sections+-- to wrap in braces on a per-style basis)+pBalancedBraces :: [(Char, Char)]+ -> LocatorParser (Bool, Text)+ -> LocatorParser (Bool, Text)+pBalancedBraces braces p = try $ do+ ss <- many1 surround+ return $ anyWereDigitLike ss+ where+ except = notFollowedBy pBraces >> p+ -- outer and inner+ surround = L.foldl' (\a (open, close) -> sur open close except <|> a)+ except+ braces++ isc c = stringify <$> pMatchChar [c] (== c)++ sur c c' m = try $ do+ (d, mid) <- isc c *> option (False, "") m <* isc c'+ return (d, T.cons c . flip T.snoc c' $ mid)++ flattened = concatMap (\(o, c) -> [o, c]) braces+ pBraces = pMatchChar "braces" (`elem` flattened)+++-- YES 1, 1.2, 1.2.3+-- NO 1., 1.2. a.6+-- can't use sepBy because we want to leave trailing .s+pPageSeq :: LocatorParser (Bool, Text)+pPageSeq = oneDotTwo <|> withPeriod+ where+ oneDotTwo = do+ u <- pPageUnit+ us <- many withPeriod+ return $ anyWereDigitLike (u:us)+ withPeriod = try $ do+ -- .2+ p <- pMatchChar "." (== '.')+ u <- try pPageUnit+ return (fst u, stringify p <> snd u)++anyWereDigitLike :: [(Bool, Text)] -> (Bool, Text)+anyWereDigitLike as = (any fst as, T.concat $ map snd as)++pPageUnit :: LocatorParser (Bool, Text)+pPageUnit = roman <|> plainUnit+ where+ -- roman is a 'digit'+ roman = (True,) <$> pRoman+ plainUnit = do+ ts <- many1 (notFollowedBy pSpace >>+ notFollowedBy pLocatorPunct >>+ notFollowedBy pMath >>+ anyToken)+ let s = stringify ts+ -- otherwise look for actual digits or -s+ return (T.any isDigit s, s)++pRoman :: LocatorParser Text+pRoman = try $ do+ tok <- anyToken+ case tok of+ Str t -> case parse (romanNumeral True *> eof)+ "roman numeral" (T.toUpper t) of+ Left _ -> mzero+ Right () -> return t+ _ -> mzero++pLocatorPunct :: LocatorParser Inline+pLocatorPunct = pMatchChar "punctuation" isLocatorPunct++pLocatorSep :: LocatorParser Inline+pLocatorSep = pMatchChar "locator separator" isLocatorSep++pMatchChar :: String -> (Char -> Bool) -> LocatorParser Inline+pMatchChar msg f = satisfyTok f' <?> msg+ where+ f' (Str (T.unpack -> [c])) = f c+ f' _ = False++pSpace :: LocatorParser Inline+pSpace = satisfyTok (\t -> isSpacey t || t == Str "\160") <?> "space"++pMath :: LocatorParser Inline+pMath = satisfyTok isMath+ where+ isMath (Math{}) = True+ isMath _ = False++satisfyTok :: (Inline -> Bool) -> LocatorParser Inline+satisfyTok f = tokenPrim show (\sp _ _ -> sp) (\tok -> if f tok+ then Just tok+ else Nothing)++isSpacey :: Inline -> Bool+isSpacey Space = True+isSpacey SoftBreak = True+isSpacey _ = False++isLocatorPunct :: Char -> Bool+isLocatorPunct '-' = False -- page range+isLocatorPunct '–' = False -- page range, en dash+isLocatorPunct ':' = False -- vol:page-range hack+isLocatorPunct c = isPunctuation c -- includes [{()}]++isLocatorSep :: Char -> Bool+isLocatorSep ',' = True+isLocatorSep ';' = True+isLocatorSep _ = False++--+-- Locator Map+--++newtype LocatorMap = LocatorMap { unLocatorMap :: M.Map Text Text }+ deriving (Show)++toLocatorMap :: Locale -> LocatorMap+toLocatorMap locale =+ LocatorMap $ foldr go mempty locatorTerms+ where+ go tname locmap =+ case M.lookup tname (localeTerms locale) of+ Nothing -> locmap+ Just ts -> foldr (\x -> M.insert (T.toCaseFold $ snd x) tname) locmap ts+-- we store keys in "case-folded" (lowercase) form, so that both+-- "Chap." and "chap." will match, for example.++locatorTerms :: [Text]+locatorTerms =+ [ "book"+ , "chapter"+ , "column"+ , "figure"+ , "folio"+ , "issue"+ , "line"+ , "note"+ , "opus"+ , "page"+ , "number-of-pages"+ , "paragraph"+ , "part"+ , "section"+ , "sub-verbo"+ , "verse"+ , "volume" ]
@@ -0,0 +1,251 @@+{-# LANGUAGE OverloadedStrings #-}+module Text.Pandoc.Citeproc.MetaValue+ ( referenceToMetaValue+ , metaValueToReference+ , metaValueToText+ )+where++import Citeproc.Types+import Text.Pandoc.Definition+import Text.Pandoc.Builder as B+import Text.Pandoc.Shared (stringify, blocksToInlines')+import Data.Maybe+import Safe+import qualified Data.Set as Set+import qualified Data.Map as M+import qualified Data.Text as T+import Data.Text (Text)+import Text.Printf (printf)+import Control.Applicative ((<|>))++metaValueToText :: MetaValue -> Maybe Text+metaValueToText (MetaString t) = Just t+metaValueToText (MetaInlines ils) = Just $ stringify ils+metaValueToText (MetaBlocks bls) = Just $ stringify bls+metaValueToText (MetaList xs) = T.unwords <$> mapM metaValueToText xs+metaValueToText _ = Nothing++metaValueToBool :: MetaValue -> Maybe Bool+metaValueToBool (MetaBool b) = Just b+metaValueToBool (MetaString "true") = Just True+metaValueToBool (MetaString "false") = Just False+metaValueToBool (MetaInlines ils) =+ metaValueToBool (MetaString (stringify ils))+metaValueToBool _ = Nothing++referenceToMetaValue :: Reference Inlines -> MetaValue+referenceToMetaValue ref =+ let ItemId id' = referenceId ref+ type' = referenceType ref+ in MetaMap $ M.insert "id" (MetaString id')+ $ M.insert "type" (MetaString type')+ $ M.map valToMetaValue+ $ M.mapKeys fromVariable+ $ referenceVariables ref+++valToMetaValue :: Val Inlines -> MetaValue+valToMetaValue (TextVal t) = MetaString t+valToMetaValue (FancyVal ils) = MetaInlines (B.toList ils)+valToMetaValue (NumVal n) = MetaString (T.pack $ show n)+valToMetaValue (NamesVal ns) = MetaList $ map nameToMetaValue ns+valToMetaValue (DateVal d) = dateToMetaValue d+valToMetaValue _ = MetaString mempty++nameToMetaValue :: Name -> MetaValue+nameToMetaValue name =+ MetaMap $+ (maybe id (M.insert "family" . MetaString) (nameFamily name)) .+ (maybe id (M.insert "given" . MetaString) (nameGiven name)) .+ (maybe id (M.insert "dropping-particle" . MetaString)+ (nameDroppingParticle name)) .+ (maybe id (M.insert "non-dropping-particle" . MetaString)+ (nameNonDroppingParticle name)) .+ (maybe id (M.insert "suffix" . MetaString) (nameSuffix name)) .+ (maybe id (M.insert "literal" . MetaString) (nameLiteral name)) .+ (if nameCommaSuffix name+ then M.insert "comma-suffix" (MetaBool True)+ else id) .+ (if nameStaticOrdering name+ then M.insert "static-ordering" (MetaBool True)+ else id)+ $ mempty++dateToMetaValue :: Date -> MetaValue+dateToMetaValue date =+ MetaString $+ (case dateLiteral date of+ Just l -> l+ Nothing -> T.intercalate "/" $ map datePartsToEDTF $ dateParts date)+ <> (if dateCirca date then "~" else "")+ where+ datePartsToEDTF (DateParts dps) =+ T.pack $+ (case dps of+ (y:_) | y > 9999 || y < -10000 -> ('y':)+ _ -> id) $+ case dps of+ (y:m:d:_)+ | y < -1 -> printf "%05d-%02d-%02d" (y+1) m d+ | otherwise -> printf "%04d-%02d-%02d" y m d+ (y:m:[])+ | y < -1 -> printf "%05d-%02d" (y+1) m+ | otherwise -> printf "%04d-%02d" y m+ (y:[])+ | y == 0 -> printf "" -- used for open range+ | y < -1 -> printf "%05d" (y+1)+ | otherwise -> printf "%04d" y+ _ -> mempty++metaValueToReference :: MetaValue+ -> Maybe (Reference Inlines)+metaValueToReference (MetaMap m) = do+ let m' = M.mapKeys normalizeKey m+ id' <- M.lookup "id" m' >>= metaValueToText+ type' <- (M.lookup "type" m' >>= metaValueToText) <|> pure ""+ let m'' = M.delete "id" $ M.delete "type" m'+ let vars = M.mapKeys toVariable $ M.mapWithKey metaValueToVal m''+ return $ Reference { referenceId = ItemId id'+ , referenceType = type'+ , referenceDisambiguation = Nothing+ , referenceVariables = vars }+metaValueToReference _ = Nothing++metaValueToVal :: Text -> MetaValue -> Val Inlines+metaValueToVal k v+ | k `Set.member` dateVariables+ = DateVal $ metaValueToDate v+ | k `Set.member` nameVariables+ = NamesVal $ metaValueToNames v+ | k == "other-ids"+ = TextVal $ fromMaybe mempty $ metaValueToText v+ -- will create space-separated list+ | otherwise =+ case v of+ MetaString t -> TextVal t+ MetaInlines ils -> FancyVal (B.fromList ils)+ MetaBlocks bs -> FancyVal (blocksToInlines' bs)+ MetaBool b -> TextVal (if b then "true" else "false")+ MetaList _ -> TextVal mempty+ MetaMap _ -> TextVal mempty++metaValueToDate :: MetaValue -> Date+metaValueToDate (MetaMap m) = fromMaybe+ (Date+ { dateParts = dateparts+ , dateCirca = circa+ , dateSeason = season+ , dateLiteral = literal })+ rawdate+ where+ dateparts = case M.lookup "date-parts" m of+ Just (MetaList xs) ->+ mapMaybe metaValueToDateParts xs+ Just _ -> []+ Nothing ->+ maybeToList $ metaValueToDateParts (MetaMap m)+ circa = fromMaybe False $+ M.lookup "circa" m >>= metaValueToBool+ season = M.lookup "season" m >>= metaValueToInt+ literal = M.lookup "literal" m >>= metaValueToText+ rawdate = M.lookup "raw" m >>= metaValueToText >>= rawDateEDTF+metaValueToDate (MetaList xs) =+ Date{ dateParts = mapMaybe metaValueToDateParts xs+ , dateCirca = False+ , dateSeason = Nothing+ , dateLiteral = Nothing }+metaValueToDate x =+ fromMaybe emptyDate $ metaValueToText x >>= rawDateEDTF+++metaValueToInt :: MetaValue -> Maybe Int+metaValueToInt x = metaValueToText x >>= readMay . T.unpack++metaValueToDateParts :: MetaValue -> Maybe DateParts+metaValueToDateParts (MetaList xs) =+ Just $ DateParts $ map (fromMaybe 0 . metaValueToInt) xs+metaValueToDateParts (MetaMap m) =+ case (M.lookup "year" m >>= metaValueToInt,+ ((M.lookup "month" m >>= metaValueToInt)+ <|>+ ((+ 20) <$> (M.lookup "season" m >>= metaValueToInt))),+ M.lookup "day" m >>= metaValueToInt) of+ (Just y, Just mo, Just d) -> Just $ DateParts [y, mo, d]+ (Just y, Just mo, Nothing) -> Just $ DateParts [y, mo]+ (Just y, Nothing, _) -> Just $ DateParts [y]+ _ -> Nothing+metaValueToDateParts _ = Nothing++emptyDate :: Date+emptyDate = Date { dateParts = []+ , dateCirca = False+ , dateSeason = Nothing+ , dateLiteral = Nothing }++metaValueToNames :: MetaValue -> [Name]+metaValueToNames (MetaList xs) = mapMaybe metaValueToName xs+metaValueToNames x = maybeToList $ metaValueToName x++metaValueToName :: MetaValue -> Maybe Name+metaValueToName (MetaMap m) = extractParticles <$>+ Just Name+ { nameFamily = family+ , nameGiven = given+ , nameDroppingParticle = dropping+ , nameNonDroppingParticle = nondropping+ , nameSuffix = suffix+ , nameCommaSuffix = commasuffix+ , nameStaticOrdering = staticordering+ , nameLiteral = literal+ }+ where+ family = M.lookup "family" m >>= metaValueToText+ given = M.lookup "given" m >>= metaValueToText+ dropping = M.lookup "dropping-particle" m+ >>= metaValueToText+ nondropping = M.lookup "non-dropping-particle" m+ >>= metaValueToText+ suffix = M.lookup "suffix" m >>= metaValueToText+ commasuffix = fromMaybe False $+ M.lookup "comma-suffix" m >>= metaValueToBool+ staticordering = fromMaybe False $+ M.lookup "static-ordering" m >>= metaValueToBool+ literal = M.lookup "literal" m >>= metaValueToText+metaValueToName x = extractParticles <$>+ case metaValueToText x of+ Nothing -> Nothing+ Just lit -> Just Name+ { nameFamily = Nothing+ , nameGiven = Nothing+ , nameDroppingParticle = Nothing+ , nameNonDroppingParticle = Nothing+ , nameSuffix = Nothing+ , nameCommaSuffix = False+ , nameStaticOrdering = False+ , nameLiteral = Just lit }++dateVariables :: Set.Set Text+dateVariables = Set.fromList+ [ "accessed", "container", "event-date", "issued",+ "original-date", "submitted" ]++nameVariables :: Set.Set Text+nameVariables = Set.fromList+ [ "author", "collection-editor", "composer",+ "container-author", "director", "editor",+ "editorial-director", "illustrator",+ "interviewer", "original-author",+ "recipient", "reviewed-author",+ "translator" ]++normalizeKey :: Text -> Text+normalizeKey k =+ case T.toLower k of+ "doi" -> "DOI"+ "isbn" -> "ISBN"+ "issn" -> "ISSN"+ "pmcid" -> "PMCID"+ "pmid" -> "PMID"+ "url" -> "URL"+ x -> x
@@ -0,0 +1,153 @@+{-# LANGUAGE ViewPatterns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE FlexibleContexts #-}+{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}+-----------------------------------------------------------------------------+-- |+-- Module : Text.CSL.Input.Name+-- Copyright : (c) John MacFarlane+-- License : BSD-style (see LICENSE)+--+-- Maintainer : John MacFarlane <fiddlosopher@gmail.com>+-- Stability : unstable+-- Portability : portable+--+-----------------------------------------------------------------------------++module Text.Pandoc.Citeproc.Name+ ( toName+ , NameOpts(..)+ , emptyName+ )+ where++import Text.Pandoc.Definition+import Text.Pandoc.Shared (stringify)+import Citeproc.Types+import Citeproc.Pandoc ()+import Text.Pandoc.Citeproc.Util (splitStrWhen)+import qualified Data.Text as T+import Data.List.Split (splitWhen, wordsBy)+import Data.Char (isUpper, isDigit)+import qualified Data.List as L++emptyName :: Name+emptyName =+ Name { nameFamily = Nothing+ , nameGiven = Nothing+ , nameDroppingParticle = Nothing+ , nameNonDroppingParticle = Nothing+ , nameSuffix = Nothing+ , nameLiteral = Nothing+ , nameCommaSuffix = False+ , nameStaticOrdering = False+ }++-- | Options for 'toName'.+data NameOpts =+ NameOpts+ { nameOptsPrefixIsNonDroppingParticle :: Bool+ -- ^ Treat a prefix on the last name as a non-dropping particle+ -- (default is to treat it as a dropping particle). This corresponds+ -- to the biblatex option @useprefix@.+ , nameOptsUseJuniorComma :: Bool+ -- ^ Put a comma before a suffix like "Jr." This corresponds to the+ -- biblatex option @juniorcomma@.+ } deriving (Show)++-- | Parse a list of 'Inline's into a citeproc 'Name', identifying+-- first and last name, particles, suffixes.+toName :: Monad m => NameOpts -> [Inline] -> m Name+toName _ [Str "others"] =+ return emptyName{ nameLiteral = Just "others" }+toName _ [Span ("",[],[]) ils] = -- corporate author+ return emptyName{ nameLiteral = Just $ stringify ils }+-- extended BibLaTeX name format - see #266+toName _ ils@(Str ys:_) | T.any (== '=') ys = do+ let commaParts = splitWhen (== Str ",")+ . splitStrWhen (\c -> c == ',' || c == '=' || c == '\160')+ $ ils+ let addPart ag (Str "given" : Str "=" : xs) =+ ag{ nameGiven = case nameGiven ag of+ Nothing -> Just $ stringify xs+ Just t -> Just $ t <> " " <> stringify xs }+ addPart ag (Str "family" : Str "=" : xs) =+ ag{ nameFamily = Just $ stringify xs }+ addPart ag (Str "prefix" : Str "=" : xs) =+ ag{ nameDroppingParticle = Just $ stringify xs }+ addPart ag (Str "useprefix" : Str "=" : Str "true" : _) =+ ag{ nameNonDroppingParticle = nameDroppingParticle ag+ , nameDroppingParticle = Nothing }+ addPart ag (Str "suffix" : Str "=" : xs) =+ ag{ nameSuffix = Just $ stringify xs }+ addPart ag (Space : xs) = addPart ag xs+ addPart ag _ = ag+ return $ L.foldl' addPart emptyName commaParts+-- First von Last+-- von Last, First+-- von Last, Jr ,First+-- NOTE: biblatex and bibtex differ on:+-- Drummond de Andrade, Carlos+-- bibtex takes "Drummond de" as the von;+-- biblatex takes the whole as a last name.+-- See https://github.com/plk/biblatex/issues/236+-- Here we implement the more sensible biblatex behavior.+toName opts ils = do+ let words' = wordsBy (\x -> x == Space || x == Str "\160")+ let commaParts = map words' $ splitWhen (== Str ",")+ $ splitStrWhen+ (\c -> c == ',' || c == '\160') ils+ let (first, vonlast, jr) =+ case commaParts of+ --- First is the longest sequence of white-space separated+ -- words starting with an uppercase and that is not the+ -- whole string. von is the longest sequence of whitespace+ -- separated words whose last word starts with lower case+ -- and that is not the whole string.+ [fvl] -> let (caps', rest') = span isCapitalized fvl+ in if null rest' && not (null caps')+ then (init caps', [last caps'], [])+ else (caps', rest', [])+ [vl,f] -> (f, vl, [])+ (vl:j:f:_) -> (f, vl, j )+ [] -> ([], [], [])++ let (von, lastname) =+ case break isCapitalized vonlast of+ (vs@(_:_), []) -> (init vs, [last vs])+ (vs, ws) -> (vs, ws)+ let prefix = T.unwords $ map stringify von+ let family = T.unwords $ map stringify lastname+ let suffix = T.unwords $ map stringify jr+ let given = T.unwords $ map stringify first+ return+ Name { nameFamily = if T.null family+ then Nothing+ else Just family+ , nameGiven = if T.null given+ then Nothing+ else Just given+ , nameDroppingParticle = if nameOptsPrefixIsNonDroppingParticle opts ||+ T.null prefix+ then Nothing+ else Just prefix+ , nameNonDroppingParticle = if nameOptsPrefixIsNonDroppingParticle opts &&+ not (T.null prefix)+ then Just prefix+ else Nothing+ , nameSuffix = if T.null suffix+ then Nothing+ else Just suffix+ , nameLiteral = Nothing+ , nameCommaSuffix = nameOptsUseJuniorComma opts+ , nameStaticOrdering = False+ }++isCapitalized :: [Inline] -> Bool+isCapitalized (Str (T.uncons -> Just (c,cs)) : rest)+ | isUpper c = True+ | isDigit c = isCapitalized (Str cs : rest)+ | otherwise = False+isCapitalized (_:rest) = isCapitalized rest+isCapitalized [] = True
@@ -0,0 +1,82 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings #-}+module Text.Pandoc.Citeproc.Util+ ( splitStrWhen+ , toIETF )+where+import qualified Data.Text as T+import Data.Text (Text)+import Text.Pandoc.Definition++-- Split Str elements so that characters satisfying the+-- predicate each have their own Str.+splitStrWhen :: (Char -> Bool) -> [Inline] -> [Inline]+splitStrWhen p = foldr go []+ where+ go (Str t) = (map Str (T.groupBy goesTogether t) ++)+ go x = (x :)+ goesTogether c d = not (p c || p d)++toIETF :: Text -> Text+toIETF "english" = "en-US" -- "en-EN" unavailable in CSL+toIETF "usenglish" = "en-US"+toIETF "american" = "en-US"+toIETF "british" = "en-GB"+toIETF "ukenglish" = "en-GB"+toIETF "canadian" = "en-US" -- "en-CA" unavailable in CSL+toIETF "australian" = "en-GB" -- "en-AU" unavailable in CSL+toIETF "newzealand" = "en-GB" -- "en-NZ" unavailable in CSL+toIETF "afrikaans" = "af-ZA"+toIETF "arabic" = "ar"+toIETF "basque" = "eu"+toIETF "bulgarian" = "bg-BG"+toIETF "catalan" = "ca-AD"+toIETF "croatian" = "hr-HR"+toIETF "czech" = "cs-CZ"+toIETF "danish" = "da-DK"+toIETF "dutch" = "nl-NL"+toIETF "estonian" = "et-EE"+toIETF "finnish" = "fi-FI"+toIETF "canadien" = "fr-CA"+toIETF "acadian" = "fr-CA"+toIETF "french" = "fr-FR"+toIETF "francais" = "fr-FR"+toIETF "austrian" = "de-AT"+toIETF "naustrian" = "de-AT"+toIETF "german" = "de-DE"+toIETF "germanb" = "de-DE"+toIETF "ngerman" = "de-DE"+toIETF "greek" = "el-GR"+toIETF "polutonikogreek" = "el-GR"+toIETF "polytonicgreek" = "el-GR"+toIETF "hebrew" = "he-IL"+toIETF "hungarian" = "hu-HU"+toIETF "icelandic" = "is-IS"+toIETF "italian" = "it-IT"+toIETF "japanese" = "ja-JP"+toIETF "latvian" = "lv-LV"+toIETF "lithuanian" = "lt-LT"+toIETF "magyar" = "hu-HU"+toIETF "mongolian" = "mn-MN"+toIETF "norsk" = "nb-NO"+toIETF "nynorsk" = "nn-NO"+toIETF "farsi" = "fa-IR"+toIETF "polish" = "pl-PL"+toIETF "brazil" = "pt-BR"+toIETF "brazilian" = "pt-BR"+toIETF "portugues" = "pt-PT"+toIETF "portuguese" = "pt-PT"+toIETF "romanian" = "ro-RO"+toIETF "russian" = "ru-RU"+toIETF "serbian" = "sr-RS"+toIETF "serbianc" = "sr-RS"+toIETF "slovak" = "sk-SK"+toIETF "slovene" = "sl-SL"+toIETF "spanish" = "es-ES"+toIETF "swedish" = "sv-SE"+toIETF "thai" = "th-TH"+toIETF "turkish" = "tr-TR"+toIETF "ukrainian" = "uk-UA"+toIETF "vietnamese" = "vi-VN"+toIETF "latin" = "la"+toIETF x = x
@@ -0,0 +1,33 @@+{- |+ Module : Text.Pandoc.Class+ Copyright : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>+ Stability : alpha+ Portability : portable++This module defines a type class, 'PandocMonad', for pandoc readers+and writers. A pure instance 'PandocPure' and an impure instance+'PandocIO' are provided. This allows users of the library to choose+whether they want conversions to perform IO operations (such as+reading include files or images).+-}++module Text.Pandoc.Class+ ( module Text.Pandoc.Class.CommonState+ , module Text.Pandoc.Class.PandocIO+ , module Text.Pandoc.Class.PandocMonad+ , module Text.Pandoc.Class.PandocPure+ , module Text.Pandoc.Class.Sandbox+ , Translations+ ) where++-- We export CommonState as an opaque object. Accessors for+-- its fields are provided in Text.Pandoc.Class.PandocMonad.+import Text.Pandoc.Class.CommonState (CommonState)+import Text.Pandoc.Class.PandocMonad+import Text.Pandoc.Class.PandocIO+import Text.Pandoc.Class.PandocPure+import Text.Pandoc.Translations.Types (Translations)+import Text.Pandoc.Class.Sandbox
@@ -0,0 +1,95 @@+{-# LANGUAGE CPP #-}+{- |+Module : Text.Pandoc.Class.CommonState+Copyright : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane+License : GNU GPL, version 2 or above++Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>+Stability : alpha+Portability : portable++Common state shared by all pandoc-specific operations, including+those in readers, writers, and Lua filters.+-}++module Text.Pandoc.Class.CommonState+ ( CommonState(..)+ , defaultCommonState+ )+where++import Data.Default (Default (def))+import Data.Text (Text)+import Text.Collate.Lang (Lang)+import Text.Pandoc.MediaBag (MediaBag)+import Text.Pandoc.Logging (LogMessage, Verbosity (WARNING))+import Text.Pandoc.Translations.Types (Translations)+#ifdef PANDOC_HTTP_SUPPORT+import Network.HTTP.Client (Manager)+#endif++-- | 'CommonState' represents state that is used by all+-- instances of 'PandocMonad'. Normally users should not+-- need to interact with it directly; instead, auxiliary+-- functions like 'setVerbosity' and 'withMediaBag' should be used.+data CommonState = CommonState+ { stLog :: [LogMessage]+ -- ^ A list of log messages in reverse order+ , stUserDataDir :: Maybe FilePath+ -- ^ Directory to search for data files+ , stSourceURL :: Maybe Text+ -- ^ Absolute URL + dir of 1st source file+ , stRequestHeaders :: [(Text, Text)]+ -- ^ Headers to add for HTTP requests+ , stNoCheckCertificate :: Bool+ -- ^ Controls whether certificate validation is disabled+ , stMediaBag :: MediaBag+ -- ^ Media parsed from binary containers+ , stTranslations :: Maybe (Lang, Maybe Translations)+ -- ^ Translations for localization+ , stInputFiles :: [FilePath]+ -- ^ List of input files from command line+ , stOutputFile :: Maybe FilePath+ -- ^ Output file from command line+ , stResourcePath :: [FilePath]+ -- ^ Path to search for resources like+ -- included images+#ifdef PANDOC_HTTP_SUPPORT+ , stManager :: Maybe Manager+ -- ^ Manager for HTTP client; this needs to persist across many requests+ -- for efficiency.+#endif+ , stVerbosity :: Verbosity+ -- ^ Verbosity level+ , stTrace :: Bool+ -- ^ Controls whether tracing messages are+ -- issued.+ }++-- | The default @'CommonState'@. All fields are initialized as the+-- monoid identity of their resprective type, except for:+--+-- * @'stResourcePath'@, which is set to @["."]@,+-- * @'stTrace'@, which is set to @'False'@, and+-- * @'stVerbosity'@, which is set to @WARNING@.+defaultCommonState :: CommonState+defaultCommonState = CommonState+ { stLog = []+ , stUserDataDir = Nothing+ , stSourceURL = Nothing+ , stRequestHeaders = []+ , stNoCheckCertificate = False+ , stMediaBag = mempty+ , stTranslations = Nothing+ , stInputFiles = []+ , stOutputFile = Nothing+ , stResourcePath = ["."]+#ifdef PANDOC_HTTP_SUPPORT+ , stManager = Nothing+#endif+ , stVerbosity = WARNING+ , stTrace = False+ }++instance Default CommonState where+ def = defaultCommonState
@@ -0,0 +1,296 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+Module : Text.Pandoc.Class.IO+Copyright : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane+License : GNU GPL, version 2 or above++Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>+Stability : alpha+Portability : portable++Default ways to perform @'PandocMonad'@ actions in a @'MonadIO'@ type.++These functions are used to make the @'PandocIO'@ type an instance of+@'PandocMonad'@, but can be reused for any other MonadIO-conforming+types.+-}+module Text.Pandoc.Class.IO+ ( fileExists+ , getCurrentTime+ , getCurrentTimeZone+ , getDataFileName+ , getModificationTime+ , glob+ , logOutput+ , logIOError+ , lookupEnv+ , newStdGen+ , newUniqueHash+ , openURL+ , readFileLazy+ , readFileStrict+ , readStdinStrict+ , extractMedia+ , writeMedia+ ) where++import Control.Monad.Except (throwError)+import Control.Monad.IO.Class (MonadIO, liftIO)+import Data.Text (Text, pack, unpack)+import Data.Time (TimeZone, UTCTime)+import Data.Unique (hashUnique)+#ifdef PANDOC_HTTP_SUPPORT+import Data.ByteString.Lazy (toChunks)+import System.Environment (getEnv)+import Data.Default (def)+import Network.Connection (TLSSettings(..))+import qualified Network.TLS as TLS+import qualified Network.TLS.Extra as TLS+import System.X509 (getSystemCertificateStore)+import Network.HTTP.Client+ (httpLbs, Manager, responseBody, responseHeaders,+ Request(port, host, requestHeaders), parseUrlThrow, newManager, HttpException)+import Network.HTTP.Client.Internal (addProxy)+import Network.HTTP.Client.TLS (mkManagerSettings)+import Network.HTTP.Types.Header ( hContentType )+import Network.Socket (withSocketsDo)+import Text.Pandoc.Class.CommonState (CommonState (..))+import Text.Pandoc.Class.PandocMonad ( getsCommonState, modifyCommonState )+import qualified Data.CaseInsensitive as CI+#endif+import Network.URI (URI(..), parseURI, unEscapeString)+import System.Directory (createDirectoryIfMissing)+import System.FilePath ((</>), takeDirectory, takeFileName, normalise, takeExtension)+import qualified System.FilePath.Posix as Posix+import System.IO (stderr)+import System.IO.Error+import System.Random (StdGen)+import Text.Pandoc.Class.PandocMonad+ (PandocMonad,+ getMediaBag, report, extractURIData)+import Text.Pandoc.Definition (Pandoc, Inline (Image))+import Text.Pandoc.Error (PandocError (..))+import Text.Pandoc.Logging (LogMessage (..), messageVerbosity, showLogMessage)+import Text.Pandoc.MIME (MimeType)+import Text.Pandoc.MediaBag (MediaBag, MediaItem(..), lookupMedia, mediaItems)+import Text.Pandoc.Walk (walk)+import qualified Control.Exception as E+import qualified Data.ByteString as B+import qualified Data.ByteString.Lazy as BL+import qualified Data.Text as T+import qualified Data.Time+import qualified Data.Time.LocalTime+import qualified Data.Unique+import qualified System.Directory+import qualified System.Environment as Env+import qualified System.FilePath.Glob+import qualified System.Random+import qualified Text.Pandoc.UTF8 as UTF8+import Codec.Archive.Zip+#ifndef EMBED_DATA_FILES+import qualified Paths_pandoc as Paths+#endif++-- | Utility function to lift IO errors into 'PandocError's.+liftIOError :: (PandocMonad m, MonadIO m) => (String -> IO a) -> String -> m a+liftIOError f u = do+ res <- liftIO $ tryIOError $ f u+ case res of+ Left e -> throwError $ PandocIOError (pack u) e+ Right r -> return r++-- | Show potential IO errors to the user continuing execution anyway+logIOError :: (PandocMonad m, MonadIO m) => IO () -> m ()+logIOError f = do+ res <- liftIO $ tryIOError f+ case res of+ Left e -> report $ IgnoredIOError $ pack $ E.displayException e+ Right _ -> pure ()++-- | Lookup an environment variable in the programs environment.+lookupEnv :: MonadIO m => Text -> m (Maybe Text)+lookupEnv = fmap (fmap pack) . liftIO . Env.lookupEnv . unpack++-- | Get the current (UTC) time.+getCurrentTime :: MonadIO m => m UTCTime+getCurrentTime = liftIO Data.Time.getCurrentTime++-- | Get the locale's time zone.+getCurrentTimeZone :: MonadIO m => m TimeZone+getCurrentTimeZone = liftIO Data.Time.LocalTime.getCurrentTimeZone++-- | Return a new generator for random numbers.+newStdGen :: MonadIO m => m StdGen+newStdGen = liftIO System.Random.newStdGen++-- | Return a new unique integer.+newUniqueHash :: MonadIO m => m Int+newUniqueHash = hashUnique <$> liftIO Data.Unique.newUnique++#ifdef PANDOC_HTTP_SUPPORT+getManager :: (PandocMonad m, MonadIO m) => m Manager+getManager = do+ mbManager <- getsCommonState stManager+ disableCertificateValidation <- getsCommonState stNoCheckCertificate+ case mbManager of+ Just manager -> pure manager+ Nothing -> do+ manager <- liftIO $ do+ certificateStore <- getSystemCertificateStore+ let tlsSettings = TLSSettings $+ (TLS.defaultParamsClient "localhost.localdomain" "80")+ { TLS.clientSupported = def{ TLS.supportedCiphers =+ TLS.ciphersuite_default+ , TLS.supportedExtendedMainSecret =+ TLS.AllowEMS }+ , TLS.clientShared = def+ { TLS.sharedCAStore = certificateStore+ , TLS.sharedValidationCache =+ if disableCertificateValidation+ then TLS.ValidationCache+ (\_ _ _ -> return TLS.ValidationCachePass)+ (\_ _ _ -> return ())+ else def+ }+ }+ let tlsManagerSettings = mkManagerSettings tlsSettings Nothing+ newManager tlsManagerSettings+ modifyCommonState $ \st -> st{ stManager = Just manager }+ pure manager+#endif++openURL :: (PandocMonad m, MonadIO m) => Text -> m (B.ByteString, Maybe MimeType)+openURL u+ | Just (URI{ uriScheme = "data:",+ uriPath = upath }) <- parseURI (T.unpack u)+ = pure $ extractURIData upath+#ifdef PANDOC_HTTP_SUPPORT+ | otherwise = do+ let toReqHeader (n, v) = (CI.mk (UTF8.fromText n), UTF8.fromText v)+ customHeaders <- map toReqHeader <$> getsCommonState stRequestHeaders+ report $ Fetching u+ manager <- getManager+ res <- liftIO $ E.try $ withSocketsDo $ do+ proxy <- tryIOError (getEnv "http_proxy")+ let addProxy' x = case proxy of+ Left _ -> return x+ Right pr -> parseUrlThrow pr >>= \r ->+ return (addProxy (host r) (port r) x)+ req <- parseUrlThrow (unpack u) >>= addProxy'+ let req' = req{requestHeaders = customHeaders ++ requestHeaders req}+ resp <- httpLbs req' manager+ return (B.concat $ toChunks $ responseBody resp,+ UTF8.toText `fmap` lookup hContentType (responseHeaders resp))++ case res of+ Right r -> return r+ Left (e :: HttpException)+ -> throwError $ PandocHttpError u (T.pack (show e))+#else+ | otherwise =+ throwError $ PandocHttpError u "pandoc was compiled without HTTP support"+#endif++-- | Read the lazy ByteString contents from a file path, raising an error on+-- failure.+readFileLazy :: (PandocMonad m, MonadIO m) => FilePath -> m BL.ByteString+readFileLazy s = liftIOError BL.readFile s++-- | Read the strict ByteString contents from a file path,+-- raising an error on failure.+readFileStrict :: (PandocMonad m, MonadIO m) => FilePath -> m B.ByteString+readFileStrict s = liftIOError B.readFile s++-- | Read the strict ByteString contents from stdin, raising+-- an error on failure.+readStdinStrict :: (PandocMonad m, MonadIO m) => m B.ByteString+readStdinStrict = liftIOError (const B.getContents) "stdin"++-- | Return a list of paths that match a glob, relative to the working+-- directory. See 'System.FilePath.Glob' for the glob syntax.+glob :: (PandocMonad m, MonadIO m) => String -> m [FilePath]+glob = liftIOError System.FilePath.Glob.glob++-- | Returns True if file exists.+fileExists :: (PandocMonad m, MonadIO m) => FilePath -> m Bool+fileExists = liftIOError System.Directory.doesFileExist++-- | Returns the path of data file.+getDataFileName :: (PandocMonad m, MonadIO m) => FilePath -> m FilePath+#ifdef EMBED_DATA_FILES+getDataFileName = return+#else+getDataFileName = liftIOError Paths.getDataFileName+#endif++-- | Return the modification time of a file.+getModificationTime :: (PandocMonad m, MonadIO m) => FilePath -> m UTCTime+getModificationTime = liftIOError System.Directory.getModificationTime++-- | Output a log message.+logOutput :: (PandocMonad m, MonadIO m) => LogMessage -> m ()+logOutput msg = liftIO $ do+ UTF8.hPutStr stderr $+ "[" <> T.pack (show (messageVerbosity msg)) <> "] "+ alertIndent $ T.lines $ showLogMessage msg++-- | Prints the list of lines to @stderr@, indenting every but the first+-- line by two spaces.+alertIndent :: [Text] -> IO ()+alertIndent [] = return ()+alertIndent (l:ls) = do+ UTF8.hPutStrLn stderr l+ mapM_ go ls+ where go l' = do UTF8.hPutStr stderr " "+ UTF8.hPutStrLn stderr l'++-- | Extract media from the mediabag into a directory (or a zip archive if the+-- path supplied ends in @.zip@.+extractMedia :: (PandocMonad m, MonadIO m) => FilePath -> Pandoc -> m Pandoc+extractMedia path d = do+ media <- getMediaBag+ let items = mediaItems media+ let (dir, mbZip) = case takeExtension path of+ ".zip" -> (takeDirectory path, Just (takeFileName path))+ _ -> (path, Nothing)+ if null items+ then return d+ else do+ let archive = foldr addEntry emptyArchive items+ case mbZip of+ Just fname -> writeMedia dir+ (fname, "application/zip", fromArchive archive)+ Nothing -> mapM_ (writeMedia dir) items+ return $ walk (adjustImagePath dir media) d+ where+ addEntry (fp, _mime, content) = addEntryToArchive (toEntry fp 0 content)++-- | Write the contents of a media bag to a path.+-- If the path contains URI escape sequences (percent-encoding),+-- these are resolved.+writeMedia :: (PandocMonad m, MonadIO m)+ => FilePath+ -> (FilePath, MimeType, BL.ByteString)+ -> m ()+writeMedia dir (fp, _mt, bs) = do+ -- we normalize to get proper path separators for the platform+ -- we unescape URI encoding, but given how insertMedia+ -- is written, we shouldn't have any % in a canonical media name...+ let fullpath = normalise $ dir </> unEscapeString fp+ liftIOError (createDirectoryIfMissing True) (takeDirectory fullpath)+ report $ Extracting (T.pack fullpath)+ logIOError $ BL.writeFile fullpath bs++-- | If the given Inline element is an image with a @src@ path equal to+-- one in the list of @paths@, then prepends @dir@ to the image source;+-- returns the element unchanged otherwise.+adjustImagePath :: FilePath -> MediaBag -> Inline -> Inline+adjustImagePath dir mediabag (Image attr lab (src, tit)) =+ case lookupMedia (T.unpack src) mediabag of+ Nothing -> Image attr lab (src, tit)+ Just item ->+ let fullpath = dir Posix.</> mediaPath item+ in Image attr lab (T.pack fullpath, tit)+adjustImagePath _ _ x = x
@@ -0,0 +1,79 @@+{-# LANGUAGE DeriveFunctor #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{- |+Module : Text.Pandoc.Class.PandocIO+Copyright : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane+License : GNU GPL, version 2 or above++Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>+Stability : alpha+Portability : portable++This module defines @'PandocIO'@, an IO-based instance of the+@'PandocMonad'@ type class. File, data, and network access all are run+using IO operators.+-}+module Text.Pandoc.Class.PandocIO+ ( PandocIO(..)+ , runIO+ , runIOorExplode+ , extractMedia+ ) where++import Control.Monad.Except (ExceptT, MonadError, runExceptT)+import Control.Monad.IO.Class (MonadIO)+import Control.Monad.State (StateT, evalStateT, lift, get, put)+import Data.Default (Default (def))+import Text.Pandoc.Class.CommonState (CommonState (..))+import Text.Pandoc.Class.PandocMonad+import Text.Pandoc.Definition+import Text.Pandoc.Error+import qualified Text.Pandoc.Class.IO as IO+import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow)++-- | Evaluate a 'PandocIO' operation.+runIO :: PandocIO a -> IO (Either PandocError a)+runIO ma = flip evalStateT def $ runExceptT $ unPandocIO ma++-- | Evaluate a 'PandocIO' operation, handling any errors+-- by exiting with an appropriate message and error status.+runIOorExplode :: PandocIO a -> IO a+runIOorExplode ma = runIO ma >>= handleError++newtype PandocIO a = PandocIO {+ unPandocIO :: ExceptT PandocError (StateT CommonState IO) a+ } deriving ( MonadIO+ , Functor+ , Applicative+ , Monad+ , MonadCatch+ , MonadMask+ , MonadThrow+ , MonadError PandocError+ )++instance PandocMonad PandocIO where+ lookupEnv = IO.lookupEnv+ getCurrentTime = IO.getCurrentTime+ getCurrentTimeZone = IO.getCurrentTimeZone+ newStdGen = IO.newStdGen+ newUniqueHash = IO.newUniqueHash++ openURL = IO.openURL+ readFileLazy = IO.readFileLazy+ readFileStrict = IO.readFileStrict+ readStdinStrict = IO.readStdinStrict++ glob = IO.glob+ fileExists = IO.fileExists+ getDataFileName = IO.getDataFileName+ getModificationTime = IO.getModificationTime++ getCommonState = PandocIO $ lift get+ putCommonState = PandocIO . lift . put++ logOutput = IO.logOutput++-- | Extract media from the mediabag into a directory.+extractMedia :: (PandocMonad m, MonadIO m) => FilePath -> Pandoc -> m Pandoc+extractMedia = IO.extractMedia
@@ -0,0 +1,603 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE TupleSections #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE ViewPatterns #-}+{- |+Module : Text.Pandoc.Class.PandocMonad+Copyright : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane+License : GNU GPL, version 2 or above++Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>+Stability : alpha+Portability : portable++This module defines a type class, 'PandocMonad', for pandoc readers+and writers.+-}++module Text.Pandoc.Class.PandocMonad+ ( PandocMonad(..)+ , getTimestamp+ , getPOSIXTime+ , getZonedTime+ , readFileFromDirs+ , report+ , runSilently+ , setRequestHeader+ , setNoCheckCertificate+ , getLog+ , setVerbosity+ , getVerbosity+ , setTrace+ , getTrace+ , getMediaBag+ , setMediaBag+ , insertMedia+ , setUserDataDir+ , getUserDataDir+ , fetchItem+ , extractURIData+ , getInputFiles+ , setInputFiles+ , getOutputFile+ , setOutputFile+ , setResourcePath+ , getResourcePath+ , setRequestHeaders+ , getRequestHeaders+ , getSourceURL+ , readMetadataFile+ , toTextM+ , fillMediaBag+ , toLang+ , makeCanonical+ , findFileWithDataFallback+ , checkUserDataDir+ ) where++import Control.Monad.Except (MonadError (catchError, throwError))+import Control.Monad.Trans (MonadTrans, lift)+import Control.Monad (when)+import Data.Time (UTCTime)+import Data.Time.Clock.POSIX (POSIXTime, utcTimeToPOSIXSeconds,+ posixSecondsToUTCTime)+import Data.Time.LocalTime (TimeZone, ZonedTime, utcToZonedTime)+import Network.URI ( escapeURIString, nonStrictRelativeTo,+ unEscapeString, parseURIReference, isAllowedInURI,+ parseURI, URI(..) )+import System.FilePath ((</>), takeExtension, dropExtension,+ isRelative, makeRelative)+import System.Random (StdGen)+import Text.Collate.Lang (Lang(..), parseLang)+import Text.Pandoc.Class.CommonState (CommonState (..))+import Text.Pandoc.Definition+import Text.Pandoc.Error+import Text.Pandoc.Logging+import Text.Pandoc.MIME (MimeType, getMimeType)+import Text.Pandoc.MediaBag (MediaBag, lookupMedia, MediaItem(..))+import Text.Pandoc.Shared (safeRead, makeCanonical, tshow)+import Text.Pandoc.URI (uriPathToPath, pBase64DataURI)+import qualified Data.Attoparsec.Text as A+import Text.Pandoc.Walk (walkM)+import qualified Text.Pandoc.UTF8 as UTF8+import Data.ByteString.Base64 (decodeLenient)+import Text.Parsec (ParsecT, getPosition, sourceLine, sourceName)+import qualified Data.ByteString as B+import qualified Data.ByteString.Lazy as BL+import qualified Data.Text as T+import qualified Debug.Trace+import qualified Text.Pandoc.MediaBag as MB+import qualified Data.Text.Encoding as TSE+import qualified Data.Text.Encoding.Error as TSE++-- | The PandocMonad typeclass contains all the potentially+-- IO-related functions used in pandoc's readers and writers.+-- Instances of this typeclass may implement these functions+-- in IO (as in 'PandocIO') or using an internal state that+-- represents a file system, time, and so on (as in 'PandocPure').+class (Functor m, Applicative m, Monad m, MonadError PandocError m)+ => PandocMonad m where+ -- | Lookup an environment variable.+ lookupEnv :: T.Text -> m (Maybe T.Text)+ -- | Get the current (UTC) time.+ getCurrentTime :: m UTCTime+ -- | Get the locale's time zone.+ getCurrentTimeZone :: m TimeZone+ -- | Return a new generator for random numbers.+ newStdGen :: m StdGen+ -- | Return a new unique integer.+ newUniqueHash :: m Int+ -- | Retrieve contents and mime type from a URL, raising+ -- an error on failure.+ openURL :: T.Text -> m (B.ByteString, Maybe MimeType)+ -- | Read the lazy ByteString contents from a file path,+ -- raising an error on failure.+ readFileLazy :: FilePath -> m BL.ByteString+ -- | Read the strict ByteString contents from a file path,+ -- raising an error on failure.+ readFileStrict :: FilePath -> m B.ByteString+ -- | Read the contents of stdin as a strict ByteString, raising+ -- an error on failure.+ readStdinStrict :: m B.ByteString+ -- | Return a list of paths that match a glob, relative to+ -- the working directory. See 'System.FilePath.Glob' for+ -- the glob syntax.+ glob :: String -> m [FilePath]+ -- | Returns True if file exists.+ fileExists :: FilePath -> m Bool+ -- | Returns the path of data file.+ getDataFileName :: FilePath -> m FilePath+ -- | Return the modification time of a file.+ getModificationTime :: FilePath -> m UTCTime+ -- | Get the value of the 'CommonState' used by all instances+ -- of 'PandocMonad'.+ getCommonState :: m CommonState+ -- | Set the value of the 'CommonState' used by all instances+ -- of 'PandocMonad'.+ -- | Get the value of a specific field of 'CommonState'.+ putCommonState :: CommonState -> m ()+ -- | Get the value of a specific field of 'CommonState'.+ getsCommonState :: (CommonState -> a) -> m a+ getsCommonState f = f <$> getCommonState+ -- | Modify the 'CommonState'.+ modifyCommonState :: (CommonState -> CommonState) -> m ()+ modifyCommonState f = getCommonState >>= putCommonState . f+ -- | Output a log message.+ logOutput :: LogMessage -> m ()+ -- | Output a debug message to sterr, using 'Debug.Trace.trace',+ -- if tracing is enabled. Note: this writes to stderr even in+ -- pure instances.+ trace :: T.Text -> m ()+ trace msg = do+ tracing <- getsCommonState stTrace+ when tracing $ Debug.Trace.trace ("[trace] " ++ T.unpack msg) (return ())++-- * Functions defined for all PandocMonad instances++-- | Set the verbosity level.+setVerbosity :: PandocMonad m => Verbosity -> m ()+setVerbosity verbosity =+ modifyCommonState $ \st -> st{ stVerbosity = verbosity }++-- | Get the verbosity level.+getVerbosity :: PandocMonad m => m Verbosity+getVerbosity = getsCommonState stVerbosity++-- | Set tracing. This affects the behavior of 'trace'. If tracing+-- is not enabled, 'trace' does nothing.+setTrace :: PandocMonad m => Bool -> m ()+setTrace enabled = modifyCommonState $ \st -> st{ stTrace = enabled }++-- | Get tracing status.+getTrace :: PandocMonad m => m Bool+getTrace = getsCommonState stTrace++-- | Get the accumulated log messages (in temporal order).+getLog :: PandocMonad m => m [LogMessage]+getLog = reverse <$> getsCommonState stLog++-- | Log a message using 'logOutput'. Note that 'logOutput' is+-- called only if the verbosity level exceeds the level of the+-- message, but the message is added to the list of log messages+-- that will be retrieved by 'getLog' regardless of its verbosity level.+report :: PandocMonad m => LogMessage -> m ()+report msg = do+ verbosity <- getsCommonState stVerbosity+ let level = messageVerbosity msg+ when (level <= verbosity) $ logOutput msg+ modifyCommonState $ \st -> st{ stLog = msg : stLog st }++-- | Run an action, but suppress the output of any log messages;+-- instead, all messages reported by @action@ are returned separately+-- and not added to the main log.+runSilently :: PandocMonad m => m a -> m (a, [LogMessage])+runSilently action = do+ -- get current settings+ origLog <- getsCommonState stLog+ origVerbosity <- getVerbosity+ -- reset log level and set verbosity to the minimum+ modifyCommonState (\st -> st { stVerbosity = ERROR, stLog = []})+ result <- action+ -- get log messages reported while running `action`+ newLog <- getsCommonState stLog+ modifyCommonState (\st -> st { stVerbosity = origVerbosity, stLog = origLog})++ return (result, newLog)++-- | Set request header to use in HTTP requests.+setRequestHeader :: PandocMonad m+ => T.Text -- ^ Header name+ -> T.Text -- ^ Value+ -> m ()+setRequestHeader name val = modifyCommonState $ \st ->+ st{ stRequestHeaders =+ (name, val) : filter (\(n,_) -> n /= name) (stRequestHeaders st) }++-- | Determine whether certificate validation is disabled+setNoCheckCertificate :: PandocMonad m => Bool -> m ()+setNoCheckCertificate noCheckCertificate = modifyCommonState $ \st -> st{stNoCheckCertificate = noCheckCertificate}++-- | Initialize the media bag.+setMediaBag :: PandocMonad m => MediaBag -> m ()+setMediaBag mb = modifyCommonState $ \st -> st{stMediaBag = mb}++-- | Retrieve the media bag.+getMediaBag :: PandocMonad m => m MediaBag+getMediaBag = getsCommonState stMediaBag++-- | Insert an item into the media bag.+insertMedia :: PandocMonad m => FilePath -> Maybe MimeType -> BL.ByteString -> m ()+insertMedia fp mime bs = do+ mb <- getMediaBag+ let mb' = MB.insertMedia fp mime bs mb+ setMediaBag mb'++-- | Retrieve the input filenames.+getInputFiles :: PandocMonad m => m [FilePath]+getInputFiles = getsCommonState stInputFiles++-- | Set the input filenames.+setInputFiles :: PandocMonad m => [FilePath] -> m ()+setInputFiles fs = do+ let sourceURL = case fs of+ [] -> Nothing+ (x:_) -> case parseURI x of+ Just u+ | uriScheme u `elem` ["http:","https:"] ->+ Just $ show u{ uriQuery = "",+ uriFragment = "" }+ _ -> Nothing++ modifyCommonState $ \st -> st{ stInputFiles = fs+ , stSourceURL = T.pack <$> sourceURL }++-- | Retrieve the output filename.+getOutputFile :: PandocMonad m => m (Maybe FilePath)+getOutputFile = getsCommonState stOutputFile++-- | Set the output filename.+setOutputFile :: PandocMonad m => Maybe FilePath -> m ()+setOutputFile mbf = modifyCommonState $ \st -> st{ stOutputFile = mbf }++-- | Retrieve the resource path searched by 'fetchItem'.+getResourcePath :: PandocMonad m => m [FilePath]+getResourcePath = getsCommonState stResourcePath++-- | Set the resource path searched by 'fetchItem'.+setResourcePath :: PandocMonad m => [FilePath] -> m ()+setResourcePath ps = modifyCommonState $ \st -> st{stResourcePath = ps}++-- | Retrieve the request headers to add for HTTP requests.+getRequestHeaders :: PandocMonad m => m [(T.Text, T.Text)]+getRequestHeaders = getsCommonState stRequestHeaders++-- | Set the request headers to add for HTTP requests.+setRequestHeaders :: PandocMonad m => [(T.Text, T.Text)] -> m ()+setRequestHeaders hs = modifyCommonState $ \st -> st{ stRequestHeaders = hs }++-- | Get the absolute UL or directory of first source file.+getSourceURL :: PandocMonad m => m (Maybe T.Text)+getSourceURL = getsCommonState stSourceURL++-- | Get the current UTC time. If the @SOURCE_DATE_EPOCH@ environment+-- variable is set to a unix time (number of seconds since midnight+-- Jan 01 1970 UTC), it is used instead of the current time, to support+-- reproducible builds.+getTimestamp :: PandocMonad m => m UTCTime+getTimestamp = do+ mbSourceDateEpoch <- lookupEnv "SOURCE_DATE_EPOCH"+ case mbSourceDateEpoch >>= safeRead of+ Just (epoch :: Integer) ->+ return $ posixSecondsToUTCTime $ fromIntegral epoch+ Nothing -> getCurrentTime++-- | Get the POSIX time. If @SOURCE_DATE_EPOCH@ is set to a unix time,+-- it is used instead of the current time.+getPOSIXTime :: PandocMonad m => m POSIXTime+getPOSIXTime = utcTimeToPOSIXSeconds <$> getTimestamp++-- | Get the zoned time. If @SOURCE_DATE_EPOCH@ is set to a unix time,+-- value (POSIX time), it is used instead of the current time.+getZonedTime :: PandocMonad m => m ZonedTime+getZonedTime = do+ t <- getTimestamp+ tz <- getCurrentTimeZone+ return $ utcToZonedTime tz t++-- | Read file, checking in any number of directories.+readFileFromDirs :: PandocMonad m => [FilePath] -> FilePath -> m (Maybe T.Text)+readFileFromDirs [] _ = return Nothing+readFileFromDirs (d:ds) f = catchError+ (Just <$> (readFileStrict (d </> f) >>= toTextM (d </> f)))+ (\_ -> readFileFromDirs ds f)++-- | Convert BCP47 string to a Lang, issuing warning+-- if there are problems.+toLang :: PandocMonad m => Maybe T.Text -> m (Maybe Lang)+toLang Nothing = return Nothing+toLang (Just s) =+ case parseLang s of+ Left _ -> do+ report $ InvalidLang s+ return Nothing+ Right l -> return (Just l)++-- | Specialized version of parseURIReference that disallows+-- single-letter schemes. Reason: these are usually windows absolute+-- paths.+parseURIReference' :: T.Text -> Maybe URI+parseURIReference' s = do+ u <- parseURIReference (T.unpack s)+ case uriScheme u of+ [_] -> Nothing+ _ -> Just u++-- | Set the user data directory in common state.+setUserDataDir :: PandocMonad m+ => Maybe FilePath+ -> m ()+setUserDataDir mbfp = modifyCommonState $ \st -> st{ stUserDataDir = mbfp }++-- | Get the user data directory from common state.+getUserDataDir :: PandocMonad m+ => m (Maybe FilePath)+getUserDataDir = getsCommonState stUserDataDir++-- | Fetch an image or other item from the local filesystem or the net.+-- Returns raw content and maybe mime type.+fetchItem :: PandocMonad m+ => T.Text+ -> m (B.ByteString, Maybe MimeType)+fetchItem s = do+ mediabag <- getMediaBag+ case lookupMedia (T.unpack s) mediabag of+ Just item -> return (BL.toStrict (mediaContents item),+ Just (mediaMimeType item))+ Nothing -> downloadOrRead s++-- | Returns the content and, if available, the MIME type of a resource.+-- If the given resource location is a valid URI, then download the+-- resource from that URI. Otherwise, treat the resource identifier as a+-- local file name.+--+-- Note that resources are treated relative to the URL of the first+-- input source, if any.+downloadOrRead :: PandocMonad m+ => T.Text+ -> m (B.ByteString, Maybe MimeType)+downloadOrRead s+ | "data:" `T.isPrefixOf` s,+ Right (bs, mt) <- A.parseOnly (pBase64DataURI <* A.endOfInput) s+ = pure (bs, Just mt)+ | otherwise = do+ sourceURL <- getsCommonState stSourceURL+ case (sourceURL >>= parseURIReference' . ensureEscaped, ensureEscaped s) of+ (Just u, s') -> -- try fetching from relative path at source+ case parseURIReference' s' of+ Just u' -> openURL $ T.pack $ show $ u' `nonStrictRelativeTo` u+ Nothing -> openURL s' -- will throw error+ (Nothing, s'@(T.unpack -> ('/':'/':c:_))) | c /= '?' -> -- protocol-relative URI+ -- we exclude //? because of //?UNC/ on Windows+ case parseURIReference' s' of+ Just u' -> openURL $ T.pack $ show $ u' `nonStrictRelativeTo` httpcolon+ Nothing -> openURL s' -- will throw error+ (Nothing, s') ->+ case parseURI (T.unpack s') of -- requires absolute URI+ Just URI{ uriScheme = "file:", uriPath = upath}+ -> readLocalFile $ uriPathToPath (T.pack upath)+ Just URI{ uriScheme = "data:", uriPath = upath}+ -> pure $ extractURIData upath+ -- We don't want to treat C:/ as a scheme:+ Just u' | length (uriScheme u') > 2 -> openURL (T.pack $ show u')+ _ -> readLocalFile fp -- get from local file system+ where readLocalFile f = do+ resourcePath <- getResourcePath+ (fp', cont) <- if isRelative f+ then withPaths resourcePath readFileStrict f+ else (f,) <$> readFileStrict f+ report $ LoadedResource f (makeRelative "." fp')+ return (cont, mime)+ httpcolon = URI{ uriScheme = "http:",+ uriAuthority = Nothing,+ uriPath = "",+ uriQuery = "",+ uriFragment = "" }+ fp = unEscapeString $ T.unpack s+ mime = getMimeType $ case takeExtension fp of+ ".gz" -> dropExtension fp+ ".svgz" -> dropExtension fp ++ ".svg"+ x -> x+ ensureEscaped = T.pack . escapeURIString isAllowedInURI . T.unpack . T.map convertSlash+ convertSlash '\\' = '/'+ convertSlash x = x++-- Extract data from a data URI's path component.+extractURIData :: String -> (B.ByteString, Maybe MimeType)+extractURIData upath =+ case break (== ';') (filter (/= ' ') mimespec) of+ (mime', ";base64") -> (decodeLenient contents, Just (T.pack mime'))+ (mime', _) -> (contents, Just (T.pack mime'))+ where+ (mimespec, rest) = break (== ',') $ unEscapeString upath+ contents = UTF8.fromString $ drop 1 rest++-- | Checks if the file path is relative to a parent directory.+isRelativeToParentDir :: FilePath -> Bool+isRelativeToParentDir fname =+ let canonical = makeCanonical fname+ in length canonical >= 2 && take 2 canonical == ".."++-- | Returns possible user data directory if the file path refers to a file or+-- subdirectory within it.+checkUserDataDir :: PandocMonad m => FilePath -> m (Maybe FilePath)+checkUserDataDir fname =+ if isRelative fname && not (isRelativeToParentDir fname)+ then getUserDataDir+ else return Nothing++-- | Read metadata file from the working directory or, if not found there, from+-- the metadata subdirectory of the user data directory.+readMetadataFile :: PandocMonad m => FilePath -> m B.ByteString+readMetadataFile fname = findFileWithDataFallback "metadata" fname >>= \case+ Nothing -> throwError $ PandocCouldNotFindMetadataFileError (T.pack fname)+ Just metadataFile -> readFileStrict metadataFile++-- | Tries to run an action on a file: for each directory given, a+-- filepath is created from the given filename, and the action is run on+-- that filepath. Returns the result of the first successful execution+-- of the action, or throws a @PandocResourceNotFound@ exception if the+-- action errors for all filepaths.+withPaths :: PandocMonad m+ => [FilePath] -> (FilePath -> m a) -> FilePath -> m (FilePath, a)+withPaths [] _ fp = throwError $ PandocResourceNotFound $ T.pack fp+withPaths (p:ps) action fp =+ catchError ((p </> fp,) <$> action (p </> fp))+ (\_ -> withPaths ps action fp)++-- | A variant of Text.Pandoc.UTF8.toText that takes a FilePath+-- as well as the file's contents as parameter, and traps UTF8+-- decoding errors so it can issue a more informative PandocUTF8DecodingError+-- with source position.+toTextM :: PandocMonad m => FilePath -> B.ByteString -> m T.Text+toTextM fp bs =+ case TSE.decodeUtf8' . filterCRs . dropBOM $ bs of+ Left (TSE.DecodeError _ (Just w)) ->+ case B.elemIndex w bs of+ Just offset ->+ throwError $ PandocUTF8DecodingError (T.pack fp) offset w+ Nothing -> throwError $ PandocUTF8DecodingError (T.pack fp) 0 w+ Left e -> throwError $ PandocAppError (tshow e)+ Right t -> return t+ where+ dropBOM bs' =+ if "\xEF\xBB\xBF" `B.isPrefixOf` bs'+ then B.drop 3 bs'+ else bs'+ filterCRs = B.filter (/=13)++-- | Returns @fp@ if the file exists in the current directory; otherwise+-- searches for the data file relative to @/subdir/@. Returns @Nothing@+-- if neither file exists.+findFileWithDataFallback :: PandocMonad m+ => FilePath -- ^ subdir+ -> FilePath -- ^ fp+ -> m (Maybe FilePath)+findFileWithDataFallback subdir fp = do+ -- First we check to see if the file is found. If not, and if it's not+ -- an absolute path, we check to see whether it's in @userdir/@. If+ -- not, we leave it unchanged.+ existsInWorkingDir <- fileExists fp+ if existsInWorkingDir+ then return $ Just fp+ else do+ mbDataDir <- checkUserDataDir fp+ case mbDataDir of+ Nothing -> return Nothing+ Just datadir -> do+ let datafp = datadir </> subdir </> fp+ existsInDataDir <- fileExists datafp+ return $ if existsInDataDir+ then Just datafp+ else Nothing++-- | Traverse tree, filling media bag for any images that+-- aren't already in the media bag.+fillMediaBag :: PandocMonad m => Pandoc -> m Pandoc+fillMediaBag d = walkM handleImage d+ where handleImage :: PandocMonad m => Inline -> m Inline+ handleImage (Image attr lab (src, tit)) = catchError+ (do mediabag <- getMediaBag+ let fp = T.unpack src+ case lookupMedia fp mediabag of+ Just _ -> return ()+ Nothing -> do+ (bs, mt) <- fetchItem src+ insertMedia fp mt (BL.fromStrict bs)+ return $ Image attr lab (src, tit))+ (\e ->+ case e of+ PandocIOError text err -> do+ report $ CouldNotFetchResource text . T.pack $+ (show err ++ "\nReplacing image with description.")+ -- emit alt text+ return $ replacementSpan attr src tit lab+ PandocResourceNotFound _ -> do+ report $ CouldNotFetchResource src+ "replacing image with description"+ -- emit alt text+ return $ replacementSpan attr src tit lab+ PandocHttpError u er -> do+ report $ CouldNotFetchResource u+ (er <> "\nReplacing image with description.")+ -- emit alt text+ return $ replacementSpan attr src tit lab+ _ -> throwError e)+ handleImage x = return x++ replacementSpan (ident, classes, attribs) src title descr =+ Span ( ident+ , "image":"placeholder":classes+ , ("original-image-src", src) :+ ("original-image-title", title) :+ attribs+ )+ descr++-- This requires UndecidableInstances. We could avoid that+-- by repeating the definitions below for every monad transformer+-- we use: ReaderT, WriterT, StateT, RWST. But this seems to+-- be harmless.+instance (MonadTrans t, PandocMonad m, Functor (t m),+ MonadError PandocError (t m), Monad (t m),+ Applicative (t m)) => PandocMonad (t m) where+ lookupEnv = lift . lookupEnv+ getCurrentTime = lift getCurrentTime+ getCurrentTimeZone = lift getCurrentTimeZone+ newStdGen = lift newStdGen+ newUniqueHash = lift newUniqueHash+ openURL = lift . openURL+ readFileLazy = lift . readFileLazy+ readFileStrict = lift . readFileStrict+ readStdinStrict = lift readStdinStrict+ glob = lift . glob+ fileExists = lift . fileExists+ getDataFileName = lift . getDataFileName+ getModificationTime = lift . getModificationTime+ getCommonState = lift getCommonState+ putCommonState = lift . putCommonState+ logOutput = lift . logOutput++instance {-# OVERLAPS #-} PandocMonad m => PandocMonad (ParsecT s st m) where+ lookupEnv = lift . lookupEnv+ getCurrentTime = lift getCurrentTime+ getCurrentTimeZone = lift getCurrentTimeZone+ newStdGen = lift newStdGen+ newUniqueHash = lift newUniqueHash+ openURL = lift . openURL+ readFileLazy = lift . readFileLazy+ readFileStrict = lift . readFileStrict+ readStdinStrict = lift readStdinStrict+ glob = lift . glob+ fileExists = lift . fileExists+ getDataFileName = lift . getDataFileName+ getModificationTime = lift . getModificationTime+ getCommonState = lift getCommonState+ putCommonState = lift . putCommonState+ trace msg = do+ tracing <- getsCommonState stTrace+ when tracing $ do+ pos <- getPosition+ Debug.Trace.trace+ ("[trace] Parsed " ++ T.unpack msg ++ " at line " +++ show (sourceLine pos) +++ if sourceName pos == "chunk"+ then " of chunk"+ else "")+ (return ())+ logOutput = lift . logOutput
@@ -0,0 +1,241 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveFunctor #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+Module : Text.Pandoc.Class.PandocPure+Copyright : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane+License : GNU GPL, version 2 or above++Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>+Stability : alpha+Portability : portable++This module defines a pure instance 'PandocPure' of the @'PandocMonad'@+typeclass. This instance is useful for testing, or when all IO access is+prohibited for security reasons.+-}+module Text.Pandoc.Class.PandocPure+ ( PureState(..)+ , getPureState+ , getsPureState+ , putPureState+ , modifyPureState+ , PandocPure(..)+ , FileTree+ , FileInfo(..)+ , addToFileTree+ , insertInFileTree+ , runPure+ ) where++import Codec.Archive.Zip+import Control.Monad.Trans ( MonadTrans(lift) )+import Control.Monad.Except+ ( ExceptT(..), MonadError(throwError), runExceptT )+import Control.Monad.State.Strict+ ( StateT(StateT),+ State,+ MonadState(put, get),+ modify,+ evalState,+ evalStateT )+import Control.Monad (foldM)+import Data.Default+import Data.Text (Text)+import Data.Time (UTCTime)+import Data.Time.Clock.POSIX ( posixSecondsToUTCTime )+import Data.Time.LocalTime (TimeZone, utc)+import Data.Word (Word8)+import System.Directory (doesDirectoryExist, getDirectoryContents)+import System.FilePath ((</>))+import System.FilePath.Glob (match, compile)+import System.Random (StdGen, mkStdGen)+import Text.Pandoc.Class.CommonState (CommonState (..))+import Text.Pandoc.Class.PandocMonad+import Text.Pandoc.Error+import qualified Data.ByteString as B+import qualified Data.ByteString.Lazy as BL+import qualified Data.Map as M+import qualified Data.Text as T+import qualified System.Directory as Directory (getModificationTime)++#if MIN_VERSION_random(1,3,0)+import System.Random (splitGen, SplitGen)++split :: SplitGen g => g -> (g, g)+split = splitGen+#else+import System.Random (split)+#endif++-- | The 'PureState' contains ersatz representations+-- of things that would normally be obtained through IO.+data PureState = PureState+ { stStdGen :: StdGen+ , stWord8Store :: [Word8] -- ^ should be infinite, i.e. [1..]+ , stUniqStore :: [Int] -- ^ should be infinite and contain every+ -- element at most once, e.g. [1..]+ , stEnv :: [(Text, Text)]+ , stTime :: UTCTime+ , stTimeZone :: TimeZone+ , stReferenceDocx :: Archive+ , stReferencePptx :: Archive+ , stReferenceODT :: Archive+ , stFiles :: FileTree+ , stStdin :: B.ByteString+ , stUserDataFiles :: FileTree+ , stCabalDataFiles :: FileTree+ }++instance Default PureState where+ def = PureState+ { stStdGen = mkStdGen 1848+ , stWord8Store = [1..]+ , stUniqStore = [1..]+ , stEnv = [("USER", "pandoc-user")]+ , stTime = posixSecondsToUTCTime 0+ , stTimeZone = utc+ , stReferenceDocx = emptyArchive+ , stReferencePptx = emptyArchive+ , stReferenceODT = emptyArchive+ , stFiles = mempty+ , stStdin = mempty+ , stUserDataFiles = mempty+ , stCabalDataFiles = mempty+ }+++-- | Retrieve the underlying state of the @'PandocPure'@ type.+getPureState :: PandocPure PureState+getPureState = PandocPure $ lift $ lift get++-- | Retrieve a value from the underlying state of the @'PandocPure'@+-- type.+getsPureState :: (PureState -> a) -> PandocPure a+getsPureState f = f <$> getPureState++-- | Set a new state for the @'PandocPure'@ type.+putPureState :: PureState -> PandocPure ()+putPureState ps= PandocPure $ lift $ lift $ put ps++-- | Modify the underlying state of the @'PandocPure'@ type.+modifyPureState :: (PureState -> PureState) -> PandocPure ()+modifyPureState f = PandocPure $ lift $ lift $ modify f++-- | Captures all file-level information necessary for a @'PandocMonad'@+-- conforming mock file system.+data FileInfo = FileInfo+ { infoFileMTime :: UTCTime+ , infoFileContents :: B.ByteString+ }++-- | Basis of the mock file system used by @'PandocPure'@.+newtype FileTree = FileTree { unFileTree :: M.Map FilePath FileInfo }+ deriving (Semigroup, Monoid)++-- | Retrieve @'FileInfo'@ of the given @'FilePath'@ from a+-- @'FileTree'@.+getFileInfo :: FilePath -> FileTree -> Maybe FileInfo+getFileInfo fp tree =+ M.lookup (makeCanonical fp) (unFileTree tree)++-- | Add the specified file to the FileTree. If file+-- is a directory, add its contents recursively.+addToFileTree :: FileTree -> FilePath -> IO FileTree+addToFileTree tree fp = do+ isdir <- doesDirectoryExist fp+ if isdir+ then do -- recursively add contents of directories+ let isSpecial ".." = True+ isSpecial "." = True+ isSpecial _ = False+ fs <- map (fp </>) . filter (not . isSpecial) <$> getDirectoryContents fp+ foldM addToFileTree tree fs+ else do+ contents <- B.readFile fp+ mtime <- Directory.getModificationTime fp+ return $ insertInFileTree fp FileInfo{ infoFileMTime = mtime+ , infoFileContents = contents } tree++-- | Insert an ersatz file into the 'FileTree'.+insertInFileTree :: FilePath -> FileInfo -> FileTree -> FileTree+insertInFileTree fp info (FileTree treemap) =+ FileTree $ M.insert (makeCanonical fp) info treemap++newtype PandocPure a = PandocPure {+ unPandocPure :: ExceptT PandocError+ (StateT CommonState (State PureState)) a+ } deriving ( Functor+ , Applicative+ , Monad+ , MonadError PandocError+ )++-- | Run a 'PandocPure' operation.+runPure :: PandocPure a -> Either PandocError a+runPure x = flip evalState def $+ flip evalStateT def $+ runExceptT $+ unPandocPure x++instance PandocMonad PandocPure where+ lookupEnv s = do+ env <- getsPureState stEnv+ return (lookup s env)++ getCurrentTime = getsPureState stTime++ getCurrentTimeZone = getsPureState stTimeZone++ newStdGen = do+ oldGen <- getsPureState stStdGen+ let (genToStore, genToReturn) = split oldGen+ modifyPureState $ \st -> st { stStdGen = genToStore }+ return genToReturn++ newUniqueHash = do+ uniqs <- getsPureState stUniqStore+ case uniqs of+ u : us -> do+ modifyPureState $ \st -> st { stUniqStore = us }+ return u+ _ -> throwError $ PandocShouldNeverHappenError+ "uniq store ran out of elements"+ openURL u = throwError $ PandocResourceNotFound u+ readFileLazy fp = do+ fps <- getsPureState stFiles+ case infoFileContents <$> getFileInfo fp fps of+ Just bs -> return (BL.fromStrict bs)+ Nothing -> throwError $ PandocResourceNotFound $ T.pack fp+ readFileStrict fp = do+ fps <- getsPureState stFiles+ case infoFileContents <$> getFileInfo fp fps of+ Just bs -> return bs+ Nothing -> throwError $ PandocResourceNotFound $ T.pack fp++ readStdinStrict = getsPureState stStdin++ glob s = do+ FileTree ftmap <- getsPureState stFiles+ return $ filter (match (compile s)) $ M.keys ftmap++ fileExists fp = do+ fps <- getsPureState stFiles+ case getFileInfo fp fps of+ Nothing -> return False+ Just _ -> return True++ getDataFileName fp = return $ "data/" ++ fp++ getModificationTime fp = do+ fps <- getsPureState stFiles+ case infoFileMTime <$> getFileInfo fp fps of+ Just tm -> return tm+ Nothing -> throwError $ PandocIOError (T.pack fp)+ (userError "Can't get modification time")++ getCommonState = PandocPure $ lift get+ putCommonState x = PandocPure $ lift $ put x++ logOutput _msg = return ()
@@ -0,0 +1,61 @@+{- |+Module : Text.Pandoc.Class.Sandbox+Copyright : Copyright (C) 2021-2024 John MacFarlane+License : GNU GPL, version 2 or above++Maintainer : John MacFarlane (<jgm@berkeley.edu>)+Stability : alpha+Portability : portable++This module provides a way to run PandocMonad actions in a sandbox+(pure context, with no IO allowed and access only to designated files).+-}++module Text.Pandoc.Class.Sandbox+ ( sandbox+ , sandboxWithFileTree+ )+where++import Control.Monad (foldM)+import Control.Monad.Except (throwError)+import Control.Monad.IO.Class (MonadIO (liftIO))+import Text.Pandoc.Class.PandocMonad+import Text.Pandoc.Class.PandocPure+import Text.Pandoc.Class.CommonState (CommonState(..))+import Text.Pandoc.Logging (messageVerbosity)++-- | Lift a PandocPure action into any instance of PandocMonad.+-- The main computation is done purely, but CommonState is preserved+-- continuously, and warnings are emitted after the action completes.+-- The parameter is a list of FilePaths which will be added to the+-- ersatz file system and be available for reading.+sandbox :: (PandocMonad m, MonadIO m) => [FilePath] -> PandocPure a -> m a+sandbox files action = do+ tree <- liftIO $ foldM addToFileTree mempty files+ sandboxWithFileTree tree action++-- | Lift a PandocPure action into any instance of PandocMonad.+-- The main computation is done purely, but CommonState is preserved+-- continuously, and warnings are emitted after the action completes.+-- The parameter is an ersatz file system which will be available for+-- reading.+sandboxWithFileTree :: (PandocMonad m, MonadIO m)+ => FileTree -> PandocPure a -> m a+sandboxWithFileTree tree action = do+ oldState <- getCommonState+ case runPure (do putCommonState oldState+ modifyPureState $ \ps -> ps{ stFiles = tree }+ result <- action+ st <- getCommonState+ return (st, result)) of+ Left e -> throwError e+ Right (st, result) -> do+ putCommonState st+ let verbosity = stVerbosity st+ -- emit warnings, since these are not printed in runPure+ let newMessages = reverse $ take+ (length (stLog st) - length (stLog oldState)) (stLog st)+ mapM_ logOutput+ (filter ((<= verbosity) . messageVerbosity) newMessages)+ return result
@@ -1,21 +0,0 @@-{-# LANGUAGE CPP #-}-module Text.Pandoc.Compat.Directory ( getModificationTime )- where--#if MIN_VERSION_directory(1,2,0)-import System.Directory---#else-import qualified System.Directory as S-import Data.Time.Clock (UTCTime)-import Data.Time.Clock.POSIX-import System.Time--getModificationTime :: FilePath -> IO UTCTime-getModificationTime fp = convert `fmap` S.getModificationTime fp- where- convert (TOD x _) = posixSecondsToUTCTime (realToFrac x)--#endif-
@@ -1,37 +0,0 @@-{-# LANGUAGE CPP #-}-module Text.Pandoc.Compat.Except ( ExceptT- , Except- , Error(..)- , runExceptT- , runExcept- , MonadError- , throwError- , catchError )- where--#if MIN_VERSION_mtl(2,2,1)-import Control.Monad.Except--class Error a where- noMsg :: a- strMsg :: String -> a-- noMsg = strMsg ""- strMsg _ = noMsg--#else-import Control.Monad.Error-import Control.Monad.Identity (Identity, runIdentity)--type ExceptT = ErrorT--type Except s a = ErrorT s Identity a--runExceptT :: ExceptT e m a -> m (Either e a)-runExceptT = runErrorT--runExcept :: ExceptT e Identity a -> Either e a-runExcept = runIdentity . runExceptT-#endif--
@@ -1,20 +0,0 @@-{-# LANGUAGE CPP #-}-module Text.Pandoc.Compat.Monoid ( Monoid(..)- , (<>)- ) where--#if MIN_VERSION_base(4,5,0)-import Data.Monoid ((<>), Monoid(..))-#else-import Data.Monoid (mappend, 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
@@ -1,15 +0,0 @@-{-# LANGUAGE CPP #-}-module Text.Pandoc.Compat.TagSoupEntity (lookupEntity- ) where--import qualified Text.HTML.TagSoup.Entity as TE--lookupEntity :: String -> Maybe Char-#if MIN_VERSION_tagsoup(0,13,0)-lookupEntity = str2chr . TE.lookupEntity- where str2chr :: Maybe String -> Maybe Char- str2chr (Just [c]) = Just c- str2chr _ = Nothing-#else-lookupEntity = TE.lookupEntity-#endif
@@ -0,0 +1,245 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE ScopedTypeVariables #-}+#ifdef EMBED_DATA_FILES+{-# LANGUAGE TemplateHaskell #-}+#endif+{- |+Module : Text.Pandoc.Data+Copyright : Copyright (C) 2013-2024 John MacFarlane+License : GNU GPL, version 2 or above++Maintainer : John MacFarlane <jgm@berkeley@edu>+Stability : alpha+Portability : portable++Access to pandoc's data files.+-}+module Text.Pandoc.Data ( readDefaultDataFile+ , readDataFile+ , getDataFileNames+ , defaultUserDataDir+ ) where+import Text.Pandoc.Class (PandocMonad(..), checkUserDataDir, getTimestamp,+ getUserDataDir, getPOSIXTime)+import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds)+import qualified Data.ByteString.Lazy as BL+import qualified Data.ByteString as B+import Codec.Archive.Zip+import qualified Data.Text as T+import Control.Monad.Except (throwError)+import Text.Pandoc.Error (PandocError(..))+import System.FilePath+import System.Directory+import qualified Control.Exception as E+#ifdef EMBED_DATA_FILES+import Text.Pandoc.Data.BakedIn (dataFiles)+import Text.Pandoc.Shared (makeCanonical)+#else+import Paths_pandoc (getDataDir)+#endif++-- | Read file from the default data files.+readDefaultDataFile :: PandocMonad m => FilePath -> m B.ByteString+readDefaultDataFile "reference.docx" =+ B.concat . BL.toChunks . fromArchive <$> getDefaultReferenceDocx+readDefaultDataFile "reference.pptx" =+ B.concat . BL.toChunks . fromArchive <$> getDefaultReferencePptx+readDefaultDataFile "reference.odt" =+ B.concat . BL.toChunks . fromArchive <$> getDefaultReferenceODT+readDefaultDataFile fname =+#ifdef EMBED_DATA_FILES+ case lookup (makeCanonical fname) dataFiles of+ Nothing -> throwError $ PandocCouldNotFindDataFileError $ T.pack fname+ Just contents -> return contents+#else+ getDataFileName fname' >>= checkExistence >>= readFileStrict+ where fname' = if fname == "MANUAL.txt" then fname else "data" </> fname++-- | Returns the input filename unchanged if the file exits, and throws+-- a `PandocCouldNotFindDataFileError` if it doesn't.+checkExistence :: PandocMonad m => FilePath -> m FilePath+checkExistence fn = do+ exists <- fileExists fn+ if exists+ then return fn+ else throwError $ PandocCouldNotFindDataFileError $ T.pack fn+#endif++--- | Read file from user data directory or,+--- if not found there, from the default data files.+readDataFile :: PandocMonad m => FilePath -> m B.ByteString+readDataFile fname = do+ datadir <- checkUserDataDir fname+ case datadir of+ Nothing -> readDefaultDataFile fname+ Just userDir -> do+ exists <- fileExists (userDir </> fname)+ if exists+ then readFileStrict (userDir </> fname)+ else readDefaultDataFile fname++-- | Retrieve default reference.docx.+getDefaultReferenceDocx :: PandocMonad m => m Archive+getDefaultReferenceDocx = do+ let paths = ["[Content_Types].xml",+ "_rels/.rels",+ "docProps/app.xml",+ "docProps/core.xml",+ "docProps/custom.xml",+ "word/document.xml",+ "word/fontTable.xml",+ "word/footnotes.xml",+ "word/comments.xml",+ "word/numbering.xml",+ "word/settings.xml",+ "word/webSettings.xml",+ "word/styles.xml",+ "word/_rels/document.xml.rels",+ "word/_rels/footnotes.xml.rels",+ "word/theme/theme1.xml"]+ let toLazy = BL.fromChunks . (:[])+ let pathToEntry path = do+ epochtime <- floor . utcTimeToPOSIXSeconds <$> getTimestamp+ contents <- toLazy <$> readDataFile ("docx/" ++ path)+ return $ toEntry path epochtime contents+ datadir <- getUserDataDir+ mbArchive <- case datadir of+ Nothing -> return Nothing+ Just d -> do+ exists <- fileExists (d </> "reference.docx")+ if exists+ then return (Just (d </> "reference.docx"))+ else return Nothing+ case mbArchive of+ Just arch -> toArchive <$> readFileLazy arch+ Nothing -> foldr addEntryToArchive emptyArchive <$>+ mapM pathToEntry paths++-- | Retrieve default reference.odt.+getDefaultReferenceODT :: PandocMonad m => m Archive+getDefaultReferenceODT = do+ let paths = ["mimetype",+ "manifest.rdf",+ "styles.xml",+ "content.xml",+ "meta.xml",+ "META-INF/manifest.xml"]+ let pathToEntry path = do epochtime <- floor `fmap` getPOSIXTime+ contents <- (BL.fromChunks . (:[])) `fmap`+ readDataFile ("odt/" ++ path)+ return $ toEntry path epochtime contents+ datadir <- getUserDataDir+ mbArchive <- case datadir of+ Nothing -> return Nothing+ Just d -> do+ exists <- fileExists (d </> "reference.odt")+ if exists+ then return (Just (d </> "reference.odt"))+ else return Nothing+ case mbArchive of+ Just arch -> toArchive <$> readFileLazy arch+ Nothing -> foldr addEntryToArchive emptyArchive <$>+ mapM pathToEntry paths++-- | Retrieve default reference.pptx.+getDefaultReferencePptx :: PandocMonad m => m Archive+getDefaultReferencePptx = do+ -- We're going to narrow this down substantially once we get it+ -- working.+ let paths = [ "[Content_Types].xml"+ , "_rels/.rels"+ , "docProps/app.xml"+ , "docProps/core.xml"+ , "ppt/_rels/presentation.xml.rels"+ , "ppt/presProps.xml"+ , "ppt/presentation.xml"+ , "ppt/slideLayouts/_rels/slideLayout1.xml.rels"+ , "ppt/slideLayouts/_rels/slideLayout2.xml.rels"+ , "ppt/slideLayouts/_rels/slideLayout3.xml.rels"+ , "ppt/slideLayouts/_rels/slideLayout4.xml.rels"+ , "ppt/slideLayouts/_rels/slideLayout5.xml.rels"+ , "ppt/slideLayouts/_rels/slideLayout6.xml.rels"+ , "ppt/slideLayouts/_rels/slideLayout7.xml.rels"+ , "ppt/slideLayouts/_rels/slideLayout8.xml.rels"+ , "ppt/slideLayouts/_rels/slideLayout9.xml.rels"+ , "ppt/slideLayouts/_rels/slideLayout10.xml.rels"+ , "ppt/slideLayouts/_rels/slideLayout11.xml.rels"+ , "ppt/slideLayouts/slideLayout1.xml"+ , "ppt/slideLayouts/slideLayout10.xml"+ , "ppt/slideLayouts/slideLayout11.xml"+ , "ppt/slideLayouts/slideLayout2.xml"+ , "ppt/slideLayouts/slideLayout3.xml"+ , "ppt/slideLayouts/slideLayout4.xml"+ , "ppt/slideLayouts/slideLayout5.xml"+ , "ppt/slideLayouts/slideLayout6.xml"+ , "ppt/slideLayouts/slideLayout7.xml"+ , "ppt/slideLayouts/slideLayout8.xml"+ , "ppt/slideLayouts/slideLayout9.xml"+ , "ppt/slideMasters/_rels/slideMaster1.xml.rels"+ , "ppt/slideMasters/slideMaster1.xml"+ , "ppt/slides/_rels/slide1.xml.rels"+ , "ppt/slides/slide1.xml"+ , "ppt/slides/_rels/slide2.xml.rels"+ , "ppt/slides/slide2.xml"+ , "ppt/slides/_rels/slide3.xml.rels"+ , "ppt/slides/slide3.xml"+ , "ppt/slides/_rels/slide4.xml.rels"+ , "ppt/slides/slide4.xml"+ , "ppt/tableStyles.xml"+ , "ppt/theme/theme1.xml"+ , "ppt/viewProps.xml"+ -- These relate to notes slides.+ , "ppt/notesMasters/notesMaster1.xml"+ , "ppt/notesMasters/_rels/notesMaster1.xml.rels"+ , "ppt/notesSlides/notesSlide1.xml"+ , "ppt/notesSlides/_rels/notesSlide1.xml.rels"+ , "ppt/notesSlides/notesSlide2.xml"+ , "ppt/notesSlides/_rels/notesSlide2.xml.rels"+ , "ppt/theme/theme2.xml"+ ]+ let toLazy = BL.fromChunks . (:[])+ let pathToEntry path = do+ epochtime <- floor <$> getPOSIXTime+ contents <- toLazy <$> readDataFile ("pptx/" ++ path)+ return $ toEntry path epochtime contents+ datadir <- getUserDataDir+ mbArchive <- case datadir of+ Nothing -> return Nothing+ Just d -> do+ exists <- fileExists (d </> "reference.pptx")+ if exists+ then return (Just (d </> "reference.pptx"))+ else return Nothing+ case mbArchive of+ Just arch -> toArchive <$> readFileLazy arch+ Nothing -> foldr addEntryToArchive emptyArchive <$>+ mapM pathToEntry paths++getDataFileNames :: IO [FilePath]+getDataFileNames = do+#ifdef EMBED_DATA_FILES+ let allDataFiles = map fst dataFiles+#else+ allDataFiles <- filter (\x -> x /= "." && x /= "..") <$>+ (getDataDir >>= getDirectoryContents)+#endif+ return $ "reference.docx" : "reference.odt" : "reference.pptx" : allDataFiles++-- | Return appropriate user data directory for platform. We use+-- XDG_DATA_HOME (or its default value), but for backwards compatibility,+-- we fall back to the legacy user data directory ($HOME/.pandoc on *nix)+-- if the XDG_DATA_HOME is missing and this exists. If neither directory+-- is present, we return the XDG data directory. If the XDG data directory+-- is not defined (e.g. because we are in an environment where $HOME is+-- not defined), we return the empty string.+defaultUserDataDir :: IO FilePath+defaultUserDataDir = do+ xdgDir <- E.catch (getXdgDirectory XdgData "pandoc")+ (\(_ :: E.SomeException) -> return mempty)+ xdgExists <- doesDirectoryExist xdgDir+ legacyDir <- E.catch (getAppUserDataDirectory "pandoc")+ (\(_ :: E.SomeException) -> return mempty)+ legacyDirExists <- doesDirectoryExist legacyDir+ if not xdgExists && legacyDirExists+ then return legacyDir+ else return xdgDir
@@ -1,7 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}--- to be processed using hsb2hs-module Text.Pandoc.Data (dataFiles) where-import qualified Data.ByteString as B--dataFiles :: [(FilePath, B.ByteString)]-dataFiles = %blobs "data"
@@ -0,0 +1,32 @@+{-# LANGUAGE TemplateHaskell #-}+{- |+Module : Text.Pandoc.Data.BakedIn+Copyright : Copyright (C) 2013-2024 John MacFarlane+License : GNU GPL, version 2 or above++Maintainer : John MacFarlane <jgm@berkeley@edu>+Stability : alpha+Portability : portable++Provide contents data files as Haskell values.+-}+module Text.Pandoc.Data.BakedIn (dataFiles) where++import qualified Data.ByteString as B+import Data.FileEmbed+import System.FilePath (splitDirectories)+import qualified System.FilePath.Posix as Posix++-- We ensure that the data files are stored using Posix+-- path separators (/), even on Windows.+dataFiles :: [(FilePath, B.ByteString)]+dataFiles = map (\(fp, contents) ->+ (Posix.joinPath (splitDirectories fp), contents)) dataFiles'++dataFiles' :: [(FilePath, B.ByteString)]+dataFiles' = ("MANUAL.txt", $(embedFile "MANUAL.txt")) :+ -- handle the hidden file separately, since embedDir doesn't+ -- include it:+ ("docx/_rels/.rels", $(embedFile "data/docx/_rels/.rels")) :+ ("pptx/_rels/.rels", $(embedFile "data/pptx/_rels/.rels")) :+ $(embedDir "data")
@@ -0,0 +1,24 @@+{-# LANGUAGE OverloadedStrings #-}+{- |+ 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, emojiToInline ) where+import qualified Text.Emoji as E+import Text.Pandoc.Definition (Inline (Span, Str))+import Data.Text (Text)+import qualified Data.Map as M++emojis :: M.Map Text Text+emojis = M.fromList E.emojis++emojiToInline :: Text -> Maybe Inline+emojiToInline emojikey = makeSpan <$> E.emojiFromAlias emojikey+ where makeSpan = Span ("", ["emoji"], [("data-emoji", emojikey)]) . (:[]) . Str
@@ -0,0 +1,208 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Error+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++This module provides a standard way to deal with possible errors+encountered during parsing.++-}+module Text.Pandoc.Error (+ PandocError(..),+ renderError,+ handleError) where++import Control.Exception (Exception, displayException)+import Data.Typeable (Typeable)+import Data.Word (Word8)+import Data.Text (Text)+import qualified Data.Text as T+import GHC.Generics (Generic)+import System.Exit (ExitCode (..), exitWith)+import System.IO (stderr)+import qualified Text.Pandoc.UTF8 as UTF8+import Text.Printf (printf)+import Text.Pandoc.Shared (tshow)+import Citeproc (CiteprocError, prettyCiteprocError)++data PandocError = PandocIOError Text IOError+ | PandocHttpError Text Text+ | PandocShouldNeverHappenError Text+ | PandocSomeError Text+ | PandocParseError Text+ | PandocMakePDFError Text+ | PandocOptionError Text+ | PandocSyntaxMapError Text+ | PandocFailOnWarningError+ | PandocPDFProgramNotFoundError Text+ | PandocPDFError Text+ | PandocXMLError Text Text+ | PandocFilterError Text Text+ | PandocLuaError Text+ | PandocNoScriptingEngine+ | PandocCouldNotFindDataFileError Text+ | PandocCouldNotFindMetadataFileError Text+ | PandocResourceNotFound Text+ | PandocTemplateError Text+ | PandocNoTemplateError Text+ | PandocAppError Text+ | PandocEpubSubdirectoryError Text+ | PandocMacroLoop Text+ | PandocUTF8DecodingError Text Int Word8+ | PandocIpynbDecodingError Text+ | PandocUnsupportedCharsetError Text+ | PandocFormatError Text Text+ | PandocUnknownReaderError Text+ | PandocUnknownWriterError Text+ | PandocUnsupportedExtensionError Text Text+ | PandocCiteprocError CiteprocError+ | PandocBibliographyError Text Text+ | PandocInputNotTextError Text+ deriving (Show, Typeable, Generic)++instance Exception PandocError+ where+ displayException = T.unpack . renderError++renderError :: PandocError -> Text+renderError e =+ case e of+ PandocIOError _ err' -> T.pack $ displayException err'+ PandocHttpError u err' -> "Could not fetch " <> u <> "\n" <> err'+ PandocShouldNeverHappenError s ->+ "Something we thought was impossible happened!\n" <>+ "Please report this to pandoc's developers: " <> s+ PandocSomeError s -> s+ PandocParseError s -> s+ PandocMakePDFError s -> s+ PandocOptionError s -> s+ PandocSyntaxMapError s -> s+ PandocFailOnWarningError -> "Failing because there were warnings."+ PandocPDFProgramNotFoundError pdfprog ->+ quote pdfprog <> " not found. Please select a different --pdf-engine or install "+ <> quote pdfprog+ PandocPDFError logmsg -> "Error producing PDF.\n" <> logmsg+ PandocXMLError fp logmsg -> "Invalid XML" <>+ (if T.null fp then "" else " in " <> quote fp) <> ":\n" <> logmsg+ PandocFilterError filtername msg -> "Error running filter " <>+ quote filtername <> ":\n" <> msg+ PandocLuaError msg -> "Error running Lua:\n" <> msg+ PandocNoScriptingEngine -> "This version of pandoc has been compiled " <>+ "without Lua support."+ PandocCouldNotFindDataFileError fn ->+ "Could not find data file " <> quote fn+ PandocCouldNotFindMetadataFileError fn ->+ "Could not find metadata file " <> quote fn+ PandocResourceNotFound fn ->+ "File " <> quote fn <> " not found in resource path"+ PandocTemplateError s -> "Error compiling template " <> quote s+ PandocNoTemplateError fp -> "No template defined in " <> quote fp+ PandocAppError s -> s+ PandocEpubSubdirectoryError s ->+ "EPUB subdirectory name " <> quote s <> " contains illegal characters"+ PandocMacroLoop s ->+ "Loop encountered in expanding macro " <> s+ PandocUTF8DecodingError f offset w ->+ "UTF-8 decoding error in " <> quote f <> " at byte offset "+ <> tshow offset <> " (" <> T.pack (printf "%2x" w) <> ").\n"+ <> "The input must be a UTF-8 encoded text."+ PandocIpynbDecodingError w ->+ "ipynb decoding error: " <> w+ PandocUnsupportedCharsetError charset ->+ "Unsupported charset " <> quote charset+ PandocFormatError format s ->+ "Error parsing format " <> quote format <> ": " <> s+ PandocUnknownReaderError r ->+ "Unknown input format " <> quote r <>+ case r of+ "doc" -> "\nPandoc can convert from DOCX, but not from DOC." <>+ "\nTry using Word to save your DOC file as DOCX," <>+ " and convert that with pandoc."+ "pdf" -> "\nPandoc can convert to PDF, but not from PDF."+ _ -> ""+ PandocUnknownWriterError w ->+ "Unknown output format " <> quote w <>+ case w of+ "pdf" -> "To create a pdf using pandoc, use" <>+ " -t latex|beamer|context|ms|html5|typst" <>+ "\nand specify an output file with " <>+ ".pdf extension (-o filename.pdf)."+ "doc" -> "\nPandoc can convert to DOCX, but not to DOC."+ _ -> ""+ PandocUnsupportedExtensionError ext f ->+ "The extension " <> quote ext <> " is not supported " <>+ "for " <> f <> ".\nUse --list-extensions=" <> f <> " to " <>+ "list supported extensions."+ PandocCiteprocError e' ->+ prettyCiteprocError e'+ PandocBibliographyError fp msg ->+ "Error reading bibliography file " <> quote fp <> ":\n" <> msg+ PandocInputNotTextError fp ->+ "Expected text as an input, but received binary data from " <>+ (if T.null fp+ then "stdin"+ else "file " <> quote fp) <>+ ".\nIf you intended to convert from binary format, verify that it's " <>+ "supported and use\nexplicit -f FORMAT."++quote :: Text -> Text+quote s = "'" <> s <> "'"++-- | Handle PandocError by exiting with an error message.+handleError :: Either PandocError a -> IO a+handleError (Right r) = return r+handleError (Left e) =+ case e of+ PandocIOError _ err' -> do+ putStrLn $ displayException err'+ exitWith (ExitFailure 1)+ _ -> err exitCode (renderError e)+ where+ exitCode =+ case e of+ PandocIOError{} -> 1+ PandocFailOnWarningError{} -> 3+ PandocAppError{} -> 4+ PandocTemplateError{} -> 5+ PandocOptionError{} -> 6+ PandocFormatError{} -> 20+ PandocUnknownReaderError{} -> 21+ PandocUnknownWriterError{} -> 22+ PandocUnsupportedExtensionError{} -> 23+ PandocCiteprocError{} -> 24+ PandocBibliographyError{} -> 25+ PandocEpubSubdirectoryError{} -> 31+ PandocPDFError{} -> 43+ PandocXMLError{} -> 44+ PandocPDFProgramNotFoundError{} -> 47+ PandocHttpError{} -> 61+ PandocShouldNeverHappenError{} -> 62+ PandocSomeError{} -> 63+ PandocParseError{} -> 64+ PandocMakePDFError{} -> 66+ PandocSyntaxMapError{} -> 67+ PandocFilterError{} -> 83+ PandocLuaError{} -> 84+ PandocNoTemplateError{} -> 87+ PandocNoScriptingEngine -> 89+ PandocMacroLoop{} -> 91+ PandocUTF8DecodingError{} -> 92+ PandocIpynbDecodingError{} -> 93+ PandocUnsupportedCharsetError{} -> 94+ PandocInputNotTextError{} -> 95+ PandocCouldNotFindDataFileError{} -> 97+ PandocCouldNotFindMetadataFileError{} -> 98+ PandocResourceNotFound{} -> 99++err :: Int -> Text -> IO a+err exitCode msg = do+ UTF8.hPutStrLn stderr msg+ exitWith $ ExitFailure exitCode+ return undefined
@@ -0,0 +1,668 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Extensions+ Copyright : Copyright (C) 2012-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++Data structures and functions for representing markup extensions.+-}+module Text.Pandoc.Extensions ( Extension(..)+ , readExtension+ , showExtension+ , Extensions+ , emptyExtensions+ , extensionsFromList+ , extensionsToList+ , extensionEnabled+ , enableExtension+ , disableExtension+ , disableExtensions+ , getDefaultExtensions+ , getAllExtensions+ , pandocExtensions+ , plainExtensions+ , strictExtensions+ , phpMarkdownExtraExtensions+ , githubMarkdownExtensions+ , multimarkdownExtensions )+where+import Data.Data (Data)+import qualified Data.Text as T+import Data.Typeable (Typeable)+import GHC.Generics (Generic)+import Text.Read (readMaybe)+import Data.Aeson+import Data.List (sort)+import qualified Data.Set as Set++-- | Individually selectable syntax extensions.+data Extension =+ Ext_abbreviations -- ^ PHP markdown extra abbreviation definitions+ | Ext_alerts -- ^ Special block quotes become alerts+ | Ext_all_symbols_escapable -- ^ Make all non-alphanumerics escapable+ | Ext_amuse -- ^ Enable Text::Amuse extensions to Emacs Muse markup+ | Ext_angle_brackets_escapable -- ^ Make < and > escapable+ | Ext_ascii_identifiers -- ^ ascii-only identifiers for headers;+ -- presupposes Ext_auto_identifiers+ | Ext_attributes -- ^ Generic attribute syntax+ | Ext_auto_identifiers -- ^ Automatic identifiers for headers+ | Ext_autolink_bare_uris -- ^ Make all absolute URIs into links+ | Ext_backtick_code_blocks -- ^ GitHub style ``` code blocks+ | Ext_blank_before_blockquote -- ^ Require blank line before a blockquote+ | Ext_blank_before_header -- ^ Require blank line before a header+ | Ext_bracketed_spans -- ^ Bracketed spans with attributes+ | Ext_citations -- ^ Pandoc/citeproc citations+ | Ext_definition_lists -- ^ Definition lists as in pandoc, mmd, php+ | Ext_east_asian_line_breaks -- ^ Newlines in paragraphs are ignored between+ -- East Asian wide characters. Note: this extension+ -- does not affect readers/writers directly; it causes+ -- the eastAsianLineBreakFilter to be applied after+ -- parsing, in Text.Pandoc.App.convertWithOpts.+ | Ext_element_citations -- ^ Use element-citation elements for JATS citations+ | Ext_emoji -- ^ Support emoji like :smile:+ | Ext_empty_paragraphs -- ^ Allow empty paragraphs+ | Ext_epub_html_exts -- ^ Recognise the EPUB extended version of HTML+ | Ext_escaped_line_breaks -- ^ Treat a backslash at EOL as linebreak+ | Ext_example_lists -- ^ Markdown-style numbered examples+ | Ext_fancy_lists -- ^ Enable fancy list numbers and delimiters+ | Ext_fenced_code_attributes -- ^ Allow attributes on fenced code blocks+ | Ext_fenced_code_blocks -- ^ Parse fenced code blocks+ | Ext_fenced_divs -- ^ Allow fenced div syntax :::+ | Ext_footnotes -- ^ Pandoc\/PHP\/MMD style footnotes+ | Ext_four_space_rule -- ^ Require 4-space indent for list contents+ | Ext_gfm_auto_identifiers -- ^ Use GitHub's method for generating+ -- header identifiers; presupposes+ -- Ext_auto_identifiers+ | Ext_grid_tables -- ^ Grid tables (pandoc, reST)+ | Ext_gutenberg -- ^ Use Project Gutenberg conventions for plain+ | Ext_hard_line_breaks -- ^ All newlines become hard line breaks+ | Ext_header_attributes -- ^ Explicit header attributes {#id .class k=v}+ | Ext_table_attributes -- ^ Explicit table attributes after caption+ | Ext_ignore_line_breaks -- ^ Newlines in paragraphs are ignored+ | Ext_implicit_figures -- ^ A paragraph with just an image is a figure+ | Ext_implicit_header_references -- ^ Implicit reference links for headers+ | Ext_inline_code_attributes -- ^ Allow attributes on inline code+ | Ext_inline_notes -- ^ Pandoc-style inline notes+ | Ext_intraword_underscores -- ^ Treat underscore inside word as literal+ | Ext_latex_macros -- ^ Parse LaTeX macro definitions (for math only)+ | Ext_line_blocks -- ^ RST style line blocks+ | Ext_link_attributes -- ^ link and image attributes+ | Ext_lists_without_preceding_blankline -- ^ Allow lists without preceding blank+ | Ext_literate_haskell -- ^ Enable literate Haskell conventions+ | Ext_mark -- ^ Enable ==mark== syntax to highlight text+ | Ext_markdown_attribute -- ^ Interpret text inside HTML as markdown iff+ -- container has attribute 'markdown'+ | Ext_markdown_in_html_blocks -- ^ Interpret as markdown inside HTML blocks+ | Ext_mmd_header_identifiers -- ^ Multimarkdown style header identifiers [myid]+ | Ext_mmd_link_attributes -- ^ MMD style reference link attributes+ | Ext_mmd_title_block -- ^ Multimarkdown metadata block+ | Ext_multiline_tables -- ^ Pandoc-style multiline tables+ | Ext_native_divs -- ^ Use Div blocks for contents of <div> tags+ | Ext_native_spans -- ^ Use Span inlines for contents of <span>+ | Ext_native_numbering -- ^ Use output format's native numbering for figures and tables+ | Ext_ntb -- ^ ConTeXt Natural Tables+ | Ext_old_dashes -- ^ -- = em, - before number = en+ | Ext_pandoc_title_block -- ^ Pandoc title block+ | Ext_pipe_tables -- ^ Pipe tables (as in PHP markdown extra)+ | Ext_raw_attribute -- ^ Allow explicit raw blocks/inlines+ | Ext_raw_html -- ^ Allow raw HTML+ | Ext_raw_tex -- ^ Allow raw TeX (other than math)+ | Ext_raw_markdown -- ^ Parse markdown in ipynb as raw markdown+ | Ext_rebase_relative_paths -- ^ Rebase relative image and link paths,+ -- relative to directory of containing file+ | Ext_short_subsuperscripts -- ^ sub-&superscripts w/o closing char (v~i)+ | Ext_shortcut_reference_links -- ^ Shortcut reference links+ | Ext_simple_tables -- ^ Pandoc-style simple tables+ | Ext_smart -- ^ "Smart" quotes, apostrophes, ellipses, dashes+ | Ext_smart_quotes -- ^ "Smart" quotes+ | Ext_special_strings -- ^ Treat certain strings like special characters+ | Ext_sourcepos -- ^ Include source position attributes+ | Ext_space_in_atx_header -- ^ Require space between # and header text+ | Ext_spaced_reference_links -- ^ Allow space between two parts of ref link+ | Ext_startnum -- ^ Make start number of ordered list significant+ | Ext_strikeout -- ^ Strikeout using ~~this~~ syntax+ | Ext_subscript -- ^ Subscript using ~this~ syntax+ | Ext_superscript -- ^ Superscript using ^this^ syntax+ | Ext_styles -- ^ Read styles that pandoc doesn't know+ | Ext_tagging -- ^ Output optimized for PDF tagging+ | Ext_task_lists -- ^ Parse certain list items as task list items+ | Ext_table_captions -- ^ Pandoc-style table captions+ | Ext_tex_math_dollars -- ^ TeX math between $..$ or $$..$$+ | Ext_tex_math_gfm -- ^ Additional TeX math style used in GFM+ | Ext_tex_math_double_backslash -- ^ TeX math btw \\(..\\) \\[..\\]+ | Ext_tex_math_single_backslash -- ^ TeX math btw \(..\) \[..\]+ | Ext_wikilinks_title_after_pipe -- ^ Support wikilinks of style+ -- [[target|title]]+ | Ext_wikilinks_title_before_pipe -- ^ Support wikilinks of style+ -- [[title|target]]+ | Ext_xrefs_name -- ^ Use xrefs with names+ | Ext_xrefs_number -- ^ Use xrefs with numbers+ | Ext_yaml_metadata_block -- ^ YAML metadata block+ | CustomExtension T.Text -- ^ Custom extension+ deriving (Show, Read, Eq, Ord, Data, Typeable, Generic)++instance FromJSON Extension where+ parseJSON = withText "Extension" (pure . readExtension . T.unpack)++instance ToJSON Extension where+ toJSON = String . showExtension++newtype Extensions = Extensions (Set.Set Extension)+ deriving (Show, Read, Eq, Ord, Data, Typeable, Generic)++instance Semigroup Extensions where+ (Extensions a) <> (Extensions b) = Extensions (a <> b)+instance Monoid Extensions where+ mempty = Extensions mempty+ mappend = (<>)++instance FromJSON Extensions where+ parseJSON = fmap extensionsFromList . parseJSON++instance ToJSON Extensions where+ toJSON (Extensions exts) = toJSON exts++-- | Reads a single extension from a string.+readExtension :: String -> Extension+readExtension "lhs" = Ext_literate_haskell+readExtension name =+ case readMaybe ("Ext_" ++ name) of+ Just ext -> ext+ Nothing -> CustomExtension (T.pack name)++-- | Show an extension in human-readable form.+showExtension :: Extension -> T.Text+showExtension ext =+ case ext of+ CustomExtension t -> t+ _ -> T.drop 4 $ T.pack $ show ext++extensionsFromList :: [Extension] -> Extensions+extensionsFromList = Extensions . Set.fromList++extensionsToList :: Extensions -> [Extension]+extensionsToList (Extensions extset) = sort $ Set.toList extset++emptyExtensions :: Extensions+emptyExtensions = Extensions mempty++extensionEnabled :: Extension -> Extensions -> Bool+extensionEnabled x (Extensions exts) = x `Set.member` exts++enableExtension :: Extension -> Extensions -> Extensions+enableExtension x (Extensions exts) = Extensions (Set.insert x exts)++disableExtension :: Extension -> Extensions -> Extensions+disableExtension x (Extensions exts) = Extensions (Set.delete x exts)++-- | Removes the extensions in the second set from those in the first.+disableExtensions :: Extensions -- ^ base set+ -> Extensions -- ^ extensions to remove+ -> Extensions+disableExtensions (Extensions base) (Extensions remove) = Extensions $+ -- keep only those extensions that are in `base` but not in `remove`.+ base `Set.difference` remove++-- | Extensions to be used with pandoc-flavored markdown.+pandocExtensions :: Extensions+pandocExtensions = extensionsFromList+ [ Ext_footnotes+ , Ext_inline_notes+ , Ext_pandoc_title_block+ , Ext_yaml_metadata_block+ , Ext_table_captions+ , Ext_implicit_figures+ , Ext_simple_tables+ , Ext_multiline_tables+ , Ext_grid_tables+ , Ext_pipe_tables+ , Ext_citations+ , Ext_raw_tex+ , Ext_raw_html+ , Ext_tex_math_dollars+ , Ext_latex_macros+ , Ext_fenced_code_blocks+ , Ext_fenced_code_attributes+ , Ext_backtick_code_blocks+ , Ext_inline_code_attributes+ , Ext_raw_attribute+ , Ext_markdown_in_html_blocks+ , Ext_native_divs+ , Ext_fenced_divs+ , Ext_native_spans+ , Ext_bracketed_spans+ , Ext_escaped_line_breaks+ , Ext_fancy_lists+ , Ext_startnum+ , Ext_definition_lists+ , Ext_example_lists+ , Ext_all_symbols_escapable+ , Ext_intraword_underscores+ , Ext_blank_before_blockquote+ , Ext_blank_before_header+ , Ext_space_in_atx_header+ , Ext_strikeout+ , Ext_superscript+ , Ext_subscript+ , Ext_task_lists+ , Ext_auto_identifiers+ , Ext_header_attributes+ , Ext_table_attributes+ , Ext_link_attributes+ , Ext_implicit_header_references+ , Ext_line_blocks+ , Ext_shortcut_reference_links+ , Ext_smart+ ]++-- | Extensions to be used with plain text output.+plainExtensions :: Extensions+plainExtensions = extensionsFromList+ [ Ext_table_captions+ , Ext_implicit_figures+ , Ext_simple_tables+ , Ext_multiline_tables+ , Ext_grid_tables+ , Ext_latex_macros+ , Ext_fancy_lists+ , Ext_startnum+ , Ext_definition_lists+ , Ext_example_lists+ , Ext_intraword_underscores+ , Ext_blank_before_blockquote+ , Ext_blank_before_header+ , Ext_strikeout+ ]++-- | Extensions to be used with PHP Markdown Extra.+phpMarkdownExtraExtensions :: Extensions+phpMarkdownExtraExtensions = extensionsFromList+ [ Ext_footnotes+ , Ext_pipe_tables+ , Ext_raw_html+ , Ext_markdown_attribute+ , Ext_fenced_code_blocks+ , Ext_definition_lists+ , Ext_intraword_underscores+ , Ext_header_attributes+ , Ext_link_attributes+ , Ext_abbreviations+ , Ext_shortcut_reference_links+ , Ext_spaced_reference_links+ ]++-- | Extensions to be used with github-flavored markdown.+githubMarkdownExtensions :: Extensions+githubMarkdownExtensions = extensionsFromList+ [ Ext_pipe_tables+ , Ext_raw_html+ , Ext_auto_identifiers+ , Ext_gfm_auto_identifiers+ , Ext_autolink_bare_uris+ , Ext_strikeout+ , Ext_task_lists+ , Ext_emoji+ , Ext_fenced_code_blocks+ , Ext_backtick_code_blocks+ , Ext_footnotes+ , Ext_alerts+ ]++-- | Extensions to be used with multimarkdown.+multimarkdownExtensions :: Extensions+multimarkdownExtensions = extensionsFromList+ [ Ext_pipe_tables+ , Ext_raw_html+ , Ext_markdown_attribute+ , Ext_mmd_link_attributes+ -- , Ext_raw_tex+ -- Note: MMD's raw TeX syntax requires raw TeX to be+ -- enclosed in HTML comment+ , Ext_tex_math_double_backslash+ , Ext_tex_math_dollars+ , Ext_intraword_underscores+ , Ext_mmd_title_block+ , Ext_footnotes+ , Ext_definition_lists+ , Ext_all_symbols_escapable+ , Ext_implicit_header_references+ , Ext_shortcut_reference_links+ , Ext_auto_identifiers+ , Ext_mmd_header_identifiers+ , Ext_implicit_figures+ , Ext_short_subsuperscripts+ , Ext_subscript+ , Ext_superscript+ , Ext_backtick_code_blocks+ , Ext_spaced_reference_links+ -- So far only in dev version of mmd:+ , Ext_raw_attribute+ ]++-- | Language extensions to be used with strict markdown.+strictExtensions :: Extensions+strictExtensions = extensionsFromList+ [ Ext_raw_html+ , Ext_shortcut_reference_links+ , Ext_spaced_reference_links+ ]++-- | Default extensions from format-describing string.+getDefaultExtensions :: T.Text -> Extensions+getDefaultExtensions "markdown_strict" = strictExtensions+getDefaultExtensions "markdown_phpextra" = phpMarkdownExtraExtensions+getDefaultExtensions "markdown_mmd" = multimarkdownExtensions+getDefaultExtensions "markdown_github" = githubMarkdownExtensions <>+ extensionsFromList+ [ Ext_all_symbols_escapable+ , Ext_backtick_code_blocks+ , Ext_fenced_code_blocks+ , Ext_space_in_atx_header+ , Ext_intraword_underscores+ , Ext_lists_without_preceding_blankline+ , Ext_shortcut_reference_links+ ]+getDefaultExtensions "markdown" = pandocExtensions+getDefaultExtensions "ipynb" =+ extensionsFromList+ [ Ext_all_symbols_escapable+ , Ext_pipe_tables+ , Ext_raw_html+ , Ext_fenced_code_blocks+ , Ext_auto_identifiers+ , Ext_gfm_auto_identifiers+ , Ext_backtick_code_blocks+ , Ext_autolink_bare_uris+ , Ext_space_in_atx_header+ , Ext_intraword_underscores+ , Ext_strikeout+ , Ext_task_lists+ , Ext_lists_without_preceding_blankline+ , Ext_shortcut_reference_links+ , Ext_tex_math_dollars+ ]+getDefaultExtensions "muse" = extensionsFromList+ [Ext_amuse,+ Ext_auto_identifiers]+getDefaultExtensions "plain" = plainExtensions+getDefaultExtensions "gfm" = extensionsFromList+ [ Ext_pipe_tables+ , Ext_raw_html+ , Ext_auto_identifiers+ , Ext_gfm_auto_identifiers+ , Ext_autolink_bare_uris+ , Ext_strikeout+ , Ext_task_lists+ , Ext_emoji+ , Ext_yaml_metadata_block+ , Ext_footnotes+ , Ext_tex_math_dollars+ , Ext_tex_math_gfm+ , Ext_alerts+ ]+getDefaultExtensions "commonmark" = extensionsFromList+ [Ext_raw_html]+getDefaultExtensions "commonmark_x" = extensionsFromList+ [ Ext_pipe_tables+ , Ext_raw_html+ , Ext_gfm_auto_identifiers+ , Ext_strikeout+ , Ext_task_lists+ , Ext_emoji+ , Ext_smart+ , Ext_tex_math_dollars+ , Ext_superscript+ , Ext_subscript+ , Ext_definition_lists+ , Ext_footnotes+ , Ext_fancy_lists+ , Ext_fenced_divs+ , Ext_bracketed_spans+ , Ext_raw_attribute+ , Ext_implicit_header_references+ , Ext_attributes+ , Ext_alerts+ , Ext_yaml_metadata_block+ ]+getDefaultExtensions "org" = extensionsFromList+ [Ext_citations,+ Ext_special_strings,+ Ext_task_lists,+ Ext_auto_identifiers]+getDefaultExtensions "html" = extensionsFromList+ [Ext_auto_identifiers,+ Ext_native_divs,+ Ext_line_blocks,+ Ext_native_spans]+getDefaultExtensions "html4" = getDefaultExtensions "html"+getDefaultExtensions "html5" = getDefaultExtensions "html"+getDefaultExtensions "epub" = extensionsFromList+ [Ext_raw_html,+ Ext_native_divs,+ Ext_native_spans,+ Ext_epub_html_exts]+getDefaultExtensions "epub2" = getDefaultExtensions "epub"+getDefaultExtensions "epub3" = getDefaultExtensions "epub"+getDefaultExtensions "latex" = extensionsFromList+ [Ext_smart,+ Ext_latex_macros,+ Ext_auto_identifiers]+getDefaultExtensions "beamer" = extensionsFromList+ [Ext_smart,+ Ext_latex_macros,+ Ext_auto_identifiers]+getDefaultExtensions "context" = extensionsFromList+ [Ext_smart,+ Ext_auto_identifiers]+getDefaultExtensions "textile" = extensionsFromList+ [Ext_old_dashes,+ Ext_smart,+ Ext_raw_html,+ Ext_auto_identifiers]+getDefaultExtensions "jats" = extensionsFromList+ [Ext_auto_identifiers]+getDefaultExtensions "jats_archiving" = getDefaultExtensions "jats"+getDefaultExtensions "jats_publishing" = getDefaultExtensions "jats"+getDefaultExtensions "jats_articleauthoring" = getDefaultExtensions "jats"+getDefaultExtensions "opml" = pandocExtensions -- affects notes+getDefaultExtensions "markua" = extensionsFromList+ []+getDefaultExtensions "typst" = extensionsFromList [Ext_citations,+ Ext_smart]+getDefaultExtensions "dokuwiki" = extensionsFromList [Ext_smart]+getDefaultExtensions _ = extensionsFromList+ [Ext_auto_identifiers]+++-- | Get all valid extensions for a format. This is used+-- mainly in checking format specifications for validity.+getAllExtensions :: T.Text -> Extensions+getAllExtensions f = universalExtensions <> getAll f+ where+ autoIdExtensions = extensionsFromList+ [ Ext_auto_identifiers+ , Ext_gfm_auto_identifiers+ , Ext_ascii_identifiers+ ]+ universalExtensions = extensionsFromList+ [ Ext_east_asian_line_breaks ]+ allMarkdownExtensions =+ pandocExtensions <> autoIdExtensions <>+ extensionsFromList+ [ Ext_old_dashes+ , Ext_angle_brackets_escapable+ , Ext_lists_without_preceding_blankline+ , Ext_four_space_rule+ , Ext_spaced_reference_links+ , Ext_hard_line_breaks+ , Ext_ignore_line_breaks+ , Ext_east_asian_line_breaks+ , Ext_emoji+ , Ext_tex_math_single_backslash+ , Ext_tex_math_double_backslash+ , Ext_markdown_attribute+ , Ext_mmd_title_block+ , Ext_abbreviations+ , Ext_autolink_bare_uris+ , Ext_mark+ , Ext_mmd_link_attributes+ , Ext_mmd_header_identifiers+ , Ext_gutenberg+ , Ext_smart+ , Ext_literate_haskell+ , Ext_short_subsuperscripts+ , Ext_rebase_relative_paths+ , Ext_wikilinks_title_after_pipe+ , Ext_wikilinks_title_before_pipe+ , Ext_alerts+ ]+ getAll "markdown_strict" = allMarkdownExtensions+ getAll "markdown_phpextra" = allMarkdownExtensions+ getAll "markdown_mmd" = allMarkdownExtensions+ getAll "markdown_github" = allMarkdownExtensions+ getAll "markdown" = allMarkdownExtensions+ getAll "ipynb" = allMarkdownExtensions <> extensionsFromList+ [ Ext_raw_markdown ]+ getAll "docx" = autoIdExtensions <> extensionsFromList+ [ Ext_empty_paragraphs+ , Ext_native_numbering+ , Ext_styles+ , Ext_citations+ ]+ getAll "opendocument" = extensionsFromList+ [ Ext_empty_paragraphs+ , Ext_native_numbering+ , Ext_xrefs_name+ , Ext_xrefs_number+ ]+ getAll "odt" = getAll "opendocument" <> autoIdExtensions+ getAll "muse" = autoIdExtensions <>+ extensionsFromList+ [ Ext_amuse ]+ getAll "asciidoc" = autoIdExtensions+ getAll "plain" = allMarkdownExtensions+ getAll "gfm" = getAll "commonmark"+ getAll "commonmark" =+ extensionsFromList+ [ Ext_gfm_auto_identifiers+ , Ext_ascii_identifiers+ , Ext_pipe_tables+ , Ext_autolink_bare_uris+ , Ext_strikeout+ , Ext_task_lists+ , Ext_emoji+ , Ext_raw_html+ , Ext_alerts+ , Ext_implicit_figures+ , Ext_hard_line_breaks+ , Ext_smart+ , Ext_tex_math_dollars+ , Ext_tex_math_gfm+ , Ext_superscript+ , Ext_subscript+ , Ext_definition_lists+ , Ext_footnotes+ , Ext_fancy_lists+ , Ext_fenced_divs+ , Ext_bracketed_spans+ , Ext_raw_attribute+ , Ext_implicit_header_references+ , Ext_attributes+ , Ext_sourcepos+ , Ext_wikilinks_title_after_pipe+ , Ext_wikilinks_title_before_pipe+ , Ext_yaml_metadata_block+ , Ext_rebase_relative_paths+ ]+ getAll "commonmark_x" = getAll "commonmark"+ getAll "org" = autoIdExtensions <>+ extensionsFromList+ [ Ext_citations+ , Ext_smart+ , Ext_smart_quotes+ , Ext_special_strings+ , Ext_fancy_lists+ , Ext_task_lists+ ]+ getAll "html" = autoIdExtensions <>+ extensionsFromList+ [ Ext_native_divs+ , Ext_line_blocks+ , Ext_native_spans+ , Ext_empty_paragraphs+ , Ext_raw_html+ , Ext_raw_tex+ , Ext_task_lists+ , Ext_tex_math_dollars+ , Ext_tex_math_single_backslash+ , Ext_tex_math_double_backslash+ , Ext_literate_haskell+ , Ext_epub_html_exts+ , Ext_smart+ ]+ getAll "html4" = getAll "html"+ getAll "html5" = getAll "html"+ getAll "epub" = getAll "html"+ getAll "epub2" = getAll "epub"+ getAll "epub3" = getAll "epub"+ getAll "latex" = autoIdExtensions <>+ extensionsFromList+ [ Ext_smart+ , Ext_latex_macros+ , Ext_raw_tex+ , Ext_task_lists+ , Ext_literate_haskell+ , Ext_empty_paragraphs+ ]+ getAll "beamer" = getAll "latex"+ getAll "context" = autoIdExtensions <>+ extensionsFromList+ [ Ext_smart+ , Ext_raw_tex+ , Ext_ntb+ , Ext_tagging+ ]+ getAll "textile" = autoIdExtensions <>+ extensionsFromList+ [ Ext_old_dashes+ , Ext_smart+ , Ext_raw_tex+ ]+ getAll "jats" =+ extensionsFromList+ [ Ext_auto_identifiers+ , Ext_element_citations+ ]+ getAll "jats_archiving" = getAll "jats"+ getAll "jats_publishing" = getAll "jats"+ getAll "jats_articleauthoring" = getAll "jats"+ getAll "opml" = allMarkdownExtensions -- affects notes+ getAll "twiki" = autoIdExtensions <>+ extensionsFromList+ [ Ext_smart ]+ getAll "vimwiki" = autoIdExtensions+ getAll "dokuwiki" = autoIdExtensions <>+ extensionsFromList+ [ Ext_tex_math_dollars+ , Ext_raw_html+ , Ext_smart ]+ getAll "tikiwiki" = autoIdExtensions+ getAll "rst" = autoIdExtensions <>+ extensionsFromList+ [ Ext_smart+ , Ext_literate_haskell+ ]+ getAll "mediawiki" = autoIdExtensions <>+ extensionsFromList+ [ Ext_smart ]+ getAll "typst" = extensionsFromList [Ext_citations, Ext_smart]+ getAll "djot" = extensionsFromList [Ext_sourcepos]+ getAll "man" = autoIdExtensions+ getAll _ = mempty
@@ -0,0 +1,118 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Filter+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley@edu>+ Stability : alpha+ Portability : portable++Programmatically modifications of pandoc documents.+-}+module Text.Pandoc.Filter+ ( Filter (..)+ , Environment (..)+ , applyFilters+ , applyJSONFilter+ ) where++import System.CPUTime (getCPUTime)+import Data.Aeson+import Data.Maybe (fromMaybe)+import GHC.Generics (Generic)+import Text.Pandoc.Class (PandocMonad, findFileWithDataFallback, getVerbosity,+ report)+import Text.Pandoc.Definition (Pandoc)+import Text.Pandoc.Filter.Environment (Environment (..))+import Text.Pandoc.Logging+import Text.Pandoc.Citeproc (processCitations)+import Text.Pandoc.Scripting (ScriptingEngine (engineApplyFilter))+import qualified Text.Pandoc.Filter.JSON as JSONFilter+import qualified Data.Text as T+import System.FilePath (takeExtension)+import Control.Applicative ((<|>))+import Control.Monad.Trans (MonadIO (liftIO))+import Control.Monad (foldM, when)++-- | Type of filter and path to filter file.+data Filter = LuaFilter FilePath+ | JSONFilter FilePath+ | CiteprocFilter -- built-in citeproc+ deriving (Show, Generic, Eq)++instance FromJSON Filter where+ parseJSON node =+ (withObject "Filter" $ \m -> do+ ty <- m .: "type"+ fp <- m .:? "path"+ let missingPath = fail $ "Expected 'path' for filter of type " ++ show ty+ let filterWithPath constr = maybe missingPath (return . constr . T.unpack)+ case ty of+ "citeproc" -> return CiteprocFilter+ "lua" -> filterWithPath LuaFilter fp+ "json" -> filterWithPath JSONFilter fp+ _ -> fail $ "Unknown filter type " ++ show (ty :: T.Text)) node+ <|>+ (withText "Filter" $ \t -> do+ let fp = T.unpack t+ if fp == "citeproc"+ then return CiteprocFilter+ else return $+ case takeExtension fp of+ ".lua" -> LuaFilter fp+ _ -> JSONFilter fp) node++instance ToJSON Filter where+ toJSON CiteprocFilter = object [ "type" .= String "citeproc" ]+ toJSON (LuaFilter fp) = object [ "type" .= String "lua",+ "path" .= String (T.pack fp) ]+ toJSON (JSONFilter fp) = object [ "type" .= String "json",+ "path" .= String (T.pack fp) ]++-- | Modify the given document using a filter.+applyFilters :: (PandocMonad m, MonadIO m)+ => ScriptingEngine+ -> Environment+ -> [Filter]+ -> [String]+ -> Pandoc+ -> m Pandoc+applyFilters scrngin fenv filters args d = do+ expandedFilters <- mapM expandFilterPath filters+ foldM applyFilter d expandedFilters+ where+ applyFilter doc (JSONFilter f) =+ withMessages f $ JSONFilter.apply fenv args f doc+ applyFilter doc (LuaFilter f) =+ withMessages f $ engineApplyFilter scrngin fenv args f doc+ applyFilter doc CiteprocFilter =+ withMessages "citeproc" $ processCitations doc+ withMessages f action = do+ verbosity <- getVerbosity+ when (verbosity == INFO) $ report $ RunningFilter f+ starttime <- liftIO getCPUTime+ res <- action+ endtime <- liftIO getCPUTime+ when (verbosity == INFO) $ report $ FilterCompleted f $ toMilliseconds $ endtime - starttime+ return res+ toMilliseconds picoseconds = picoseconds `div` 1000000000++-- | Expand paths of filters, searching the data directory.+expandFilterPath :: (PandocMonad m, MonadIO m) => Filter -> m Filter+expandFilterPath (LuaFilter fp) = LuaFilter <$> filterPath fp+expandFilterPath (JSONFilter fp) = JSONFilter <$> filterPath fp+expandFilterPath CiteprocFilter = return CiteprocFilter++filterPath :: PandocMonad m => FilePath -> m FilePath+filterPath fp = fromMaybe fp <$> findFileWithDataFallback "filters" fp++applyJSONFilter :: MonadIO m+ => Environment+ -> [String]+ -> FilePath+ -> Pandoc+ -> m Pandoc+applyJSONFilter = JSONFilter.apply
@@ -0,0 +1,27 @@+{- |+ Module : Text.Pandoc.Filter.Environment+ Copyright : ©2020-2021 Albert Krewinkel+ License : GNU GPL, version 2 or above++ Maintainer : Albert Krewinkel <albert+pandoc@tarleb.com>+ Stability : alpha+ Portability : portable++Environment for pandoc filters.+-}+module Text.Pandoc.Filter.Environment+ ( Environment (..)+ ) where++import Data.Default (Default (def))+import Text.Pandoc.Options (ReaderOptions, WriterOptions)++-- | Environment in which a filter is run. This includes reader and+-- writer options.+data Environment = Environment+ { envReaderOptions :: ReaderOptions+ , envWriterOptions :: WriterOptions+ }++instance Default Environment where+ def = Environment def def
@@ -0,0 +1,82 @@+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Filter+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley@edu>+ Stability : alpha+ Portability : portable++Programmatically modifications of pandoc documents via JSON filters.+-}+module Text.Pandoc.Filter.JSON (apply) where++import Control.Monad (unless, when)+import Control.Monad.Trans (MonadIO (liftIO))+import Data.Aeson (eitherDecode', encode)+import Data.Char (toLower)+import Data.Maybe (isNothing)+import qualified Data.Text as T+import System.Directory (executable, doesFileExist, findExecutable,+ getPermissions)+import System.Environment (getEnvironment)+import System.Exit (ExitCode (..))+import System.FilePath ((</>), takeExtension)+import Text.Pandoc.Definition (Pandoc)+import Text.Pandoc.Error (PandocError (PandocFilterError))+import Text.Pandoc.Filter.Environment (Environment (..))+import Text.Pandoc.Process (pipeProcess)+import Text.Pandoc.Version (pandocVersionText)+import Text.Pandoc.Shared (tshow)+import qualified Control.Exception as E+import qualified Text.Pandoc.UTF8 as UTF8++apply :: MonadIO m+ => Environment+ -> [String]+ -> FilePath+ -> Pandoc+ -> m Pandoc+apply ropts args f = liftIO . externalFilter ropts f args++externalFilter :: MonadIO m+ => Environment -> FilePath -> [String] -> Pandoc -> m Pandoc+externalFilter fenv f args' d = liftIO $ do+ exists <- doesFileExist f+ isExecutable <- if exists+ then executable <$> getPermissions f+ else return True+ let (f', args'') = if exists+ then case map toLower (takeExtension f) of+ _ | isExecutable -> ("." </> f, args')+ ".py" -> ("python", f:args')+ ".hs" -> ("runhaskell", f:args')+ ".pl" -> ("perl", f:args')+ ".rb" -> ("ruby", f:args')+ ".php" -> ("php", f:args')+ ".js" -> ("node", f:args')+ ".r" -> ("Rscript", f:args')+ _ -> (f, args')+ else (f, args')+ unless (exists && isExecutable) $ do+ mbExe <- findExecutable f'+ when (isNothing mbExe) $+ E.throwIO $ PandocFilterError fText (T.pack $ "Could not find executable " <> f')+ let ropts = envReaderOptions fenv+ env <- getEnvironment+ let env' = Just+ ( ("PANDOC_VERSION", T.unpack pandocVersionText)+ : ("PANDOC_READER_OPTIONS", UTF8.toStringLazy (encode ropts))+ : env )+ (exitcode, outbs) <- E.handle filterException $+ pipeProcess env' f' args'' $ encode d+ case exitcode of+ ExitSuccess -> either (E.throwIO . PandocFilterError fText . T.pack)+ return $ eitherDecode' outbs+ ExitFailure ec -> E.throwIO $ PandocFilterError fText+ ("Filter returned error status " <> tshow ec)+ where fText = T.pack f++ filterException :: E.SomeException -> IO a+ filterException e = E.throwIO $ PandocFilterError fText $ tshow e
@@ -0,0 +1,251 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Format+ Copyright : © 2022-2024 Albert Krewinkel+ License : GPL-2.0-or-later+ Maintainer : Albert Krewinkel <albert+pandoc@tarleb.com>++Handling of format specifiers for input and output.+-}+module Text.Pandoc.Format+ ( FlavoredFormat (..)+ , ExtensionsConfig (..)+ , ExtensionsDiff (..)+ , diffExtensions+ , parseFlavoredFormat+ , applyExtensionsDiff+ , getExtensionsConfig+ , formatFromFilePaths+ ) where++import Control.Monad.Except (throwError)+import Data.Char (toLower)+import Data.Foldable (asum)+import qualified Data.List as L+import System.FilePath (splitExtension, takeExtension)+import Text.Pandoc.Class (PandocMonad)+import Text.Pandoc.Error (PandocError (..))+import Text.Pandoc.Extensions+ ( Extension (Ext_literate_haskell)+ , Extensions+ , disableExtensions+ , enableExtension+ , extensionsFromList+ , extensionsToList+ , getAllExtensions+ , getDefaultExtensions+ , showExtension+ , readExtension+ )+import Network.URI (URI (..), parseURI)+import Text.Pandoc.Parsing+import qualified Data.Text as T++-- | Format specifier with the format's name and the lists of extensions+-- to be enabled or disabled.+data FlavoredFormat = FlavoredFormat+ { formatName :: T.Text+ , formatExtsDiff :: ExtensionsDiff+ } deriving (Show)++-- | Changes to a set of extensions, i.e., list of extensions to be+-- enabled or disabled.+data ExtensionsDiff = ExtensionsDiff+ { extsToEnable :: Extensions+ , extsToDisable :: Extensions+ } deriving (Show)++instance Semigroup ExtensionsDiff where+ ExtensionsDiff enA disA <> ExtensionsDiff enB disB =+ ExtensionsDiff+ ((enA `disableExtensions` disB) <> enB)+ ((disA `disableExtensions` enB) <> disB)++instance Monoid ExtensionsDiff where+ mempty = ExtensionsDiff mempty mempty+ mappend = (<>)++-- | Calculate the change set to get from one set of extensions to+-- another.+diffExtensions :: Extensions -> Extensions -> ExtensionsDiff+diffExtensions def actual = ExtensionsDiff+ { extsToEnable = actual `disableExtensions` def+ , extsToDisable = def `disableExtensions` actual+ }++-- | Describes the properties of a format.+data ExtensionsConfig = ExtensionsConfig+ { extsDefault :: Extensions -- ^ Extensions enabled by default+ , extsSupported :: Extensions -- ^ Extensions that can be enabled or disabled.+ } deriving (Show)++-- | Returns the extensions configuration of a format.+getExtensionsConfig :: T.Text -> ExtensionsConfig+getExtensionsConfig fmt = ExtensionsConfig+ { extsDefault = getDefaultExtensions fmt+ , extsSupported = getAllExtensions fmt+ }++instance Semigroup ExtensionsConfig where+ ExtensionsConfig x1 y1 <> ExtensionsConfig x2 y2 =+ ExtensionsConfig (x1 <> x2) (y1 <> y2)++instance Monoid ExtensionsConfig where+ mappend = (<>)+ mempty = ExtensionsConfig mempty mempty++-- | Apply the extension changes in the format spec to the extensions+-- given in the format's extensions configuration. Throws an error in+-- case of an unknown or unsupported extension.+applyExtensionsDiff :: PandocMonad m+ => ExtensionsConfig+ -> FlavoredFormat+ -> m Extensions+applyExtensionsDiff extConf (FlavoredFormat fname extsDiff) = do+ let extsInDiff = extsToEnable extsDiff <> extsToDisable extsDiff+ let unsupported = extsInDiff `disableExtensions` (extsSupported extConf)+ case extensionsToList unsupported of+ ext:_ -> throwError $ PandocUnsupportedExtensionError+ (showExtension ext) fname+ [] -> pure ((extsDefault extConf `disableExtensions`+ extsToDisable extsDiff) <> extsToEnable extsDiff)++-- | Parse a format-specifying string into a markup format and the+-- change set to the format's extensions. Throws an error if the spec+-- cannot be parsed or contains an unknown extension.+parseFlavoredFormat :: PandocMonad m+ => T.Text+ -> m FlavoredFormat+parseFlavoredFormat spec =+ -- Paths like `latex-foo-bar.lua` or `latex-smart-citations.lua`+ -- should be parsed as the format name. The `-` (or `+`) in the+ -- filename would confuse the extensions parser, so, if `spec` looks+ -- like a filename, the file's basename is split off into the prefix.+ -- Only the remaining part is parsed, and the prefix is appended back+ -- to the format after parsing.+ case parse (fixSourcePos *> formatSpec) "" spec' of+ Right (fname, extsDiff) -> pure (FlavoredFormat (prefix <> fname) extsDiff)+ Left err -> throwError $ PandocFormatError spec (T.pack $ show err)+ where+ fixSourcePos = do+ pos <- getPosition+ setPosition (incSourceColumn pos (T.length prefix))+ formatSpec = do+ name <- parseFormatName+ extsDiff <- pExtensionsDiff+ return ( T.pack name, extsDiff )+ parseFormatName = many1 $ noneOf "-+"+ (prefix, spec') = case splitExtension (T.unpack spec) of+ (_, "") -> ("", T.toLower spec) -- no extension+ (p,s) -> (T.pack p, T.pack s)++pExtensionsDiff :: (UpdateSourcePos s Char, Stream s m Char)+ => ParsecT s u m ExtensionsDiff+pExtensionsDiff = L.foldl' (flip ($)) mempty <$> many extMod+ where+ extMod = do+ polarity <- oneOf "-+"+ name <- many $ noneOf "-+"+ let ext = readExtension name+ return $ \extsDiff ->+ case polarity of+ '+' -> extsDiff{extsToEnable = enableExtension ext $+ extsToEnable extsDiff}+ _ -> extsDiff{extsToDisable = enableExtension ext $+ extsToDisable extsDiff}++-- | Determines default format based on file extensions; uses the format+-- of the first extension that's associated with a format.+--+-- Examples:+--+-- > formatFromFilePaths ["text.unknown", "no-extension"]+-- Nothing+--+-- > formatFromFilePaths ["my.md", "other.rst"]+-- Just "markdown"+formatFromFilePaths :: [FilePath] -> (Maybe FlavoredFormat)+formatFromFilePaths = asum . map formatFromFilePath++-- | Determines format based on file extension.+formatFromFilePath :: FilePath -> Maybe FlavoredFormat+formatFromFilePath x =+ case takeExtension (map toLower fpath) of+ ".Rmd" -> defFlavor "markdown"+ ".adoc" -> defFlavor "asciidoc"+ ".asciidoc" -> defFlavor "asciidoc"+ ".bib" -> defFlavor "biblatex"+ ".context" -> defFlavor "context"+ ".csv" -> defFlavor "csv"+ ".ctx" -> defFlavor "context"+ ".db" -> defFlavor "docbook"+ ".dj" -> defFlavor "djot"+ ".djvu" -> defFlavor "djvu" -- so we get an "unknown reader" error+ ".doc" -> defFlavor "doc" -- so we get an "unknown reader" error+ ".docx" -> defFlavor "docx"+ ".dokuwiki" -> defFlavor "dokuwiki"+ ".epub" -> defFlavor "epub"+ ".fb2" -> defFlavor "fb2"+ ".htm" -> defFlavor "html"+ ".html" -> defFlavor "html"+ ".icml" -> defFlavor "icml"+ ".ipynb" -> defFlavor "ipynb"+ ".json" -> defFlavor "json"+ ".latex" -> defFlavor "latex"+ ".lhs" -> defFlavor "markdown" `withExtension` Ext_literate_haskell+ ".ltx" -> defFlavor "latex"+ ".markdown" -> defFlavor "markdown"+ ".markua" -> defFlavor "markua"+ ".md" -> defFlavor "markdown"+ ".mdown" -> defFlavor "markdown"+ ".mdwn" -> defFlavor "markdown"+ ".mkd" -> defFlavor "markdown"+ ".mkdn" -> defFlavor "markdown"+ ".ms" -> defFlavor "ms"+ ".muse" -> defFlavor "muse"+ ".native" -> defFlavor "native"+ ".ods" -> defFlavor "ods" -- so we get an "unknown reader" error+ ".odp" -> defFlavor "odp" -- so we get an "unknown reader" error+ ".odf" -> defFlavor "odf" -- so we get an "unknown reader" error+ ".odt" -> defFlavor "odt"+ ".opml" -> defFlavor "opml"+ ".org" -> defFlavor "org"+ ".pdf" -> defFlavor "pdf" -- so we get an "unknown reader" error+ ".pl" -> defFlavor "pod"+ ".pm" -> defFlavor "pod"+ ".pod" -> defFlavor "pod"+ ".pptx" -> defFlavor "pptx"+ ".ris" -> defFlavor "ris"+ ".roff" -> defFlavor "ms"+ ".rst" -> defFlavor "rst"+ ".rtf" -> defFlavor "rtf"+ ".s5" -> defFlavor "s5"+ ".t2t" -> defFlavor "t2t"+ ".tei" -> defFlavor "tei"+ ".tex" -> defFlavor "latex"+ ".texi" -> defFlavor "texinfo"+ ".texinfo" -> defFlavor "texinfo"+ ".text" -> defFlavor "markdown"+ ".textile" -> defFlavor "textile"+ ".tsv" -> defFlavor "tsv"+ ".txt" -> defFlavor "markdown"+ ".typ" -> defFlavor "typst"+ ".wiki" -> defFlavor "mediawiki"+ ".xhtml" -> defFlavor "html"+ ".xls" -> defFlavor "xls" -- so we get an "unknown reader" error+ ".xlsx" -> defFlavor "xlsx" -- so we get an "unknown reader" error+ ".xml" -> defFlavor "xml"+ ".zip" -> defFlavor "zip" -- so we get an "unknown reader" error+ ['.',y] | y `elem` ['1'..'9'] -> defFlavor "man"+ _ -> Nothing+ where+ defFlavor f = Just (FlavoredFormat f mempty)+ withExtension Nothing _ = Nothing+ withExtension (Just (FlavoredFormat f ed)) ext = Just $+ FlavoredFormat f (ed <> ExtensionsDiff (extensionsFromList [ext]) mempty)+ fpath = case parseURI x of+ Nothing -> x+ Just URI{ uriPath = "" } -> "index.html"+ Just URI{ uriPath = "/" } -> "index.html"+ Just URI{ uriPath = up } -> up
@@ -1,24 +1,7 @@-{--Copyright (C) 2008-2014 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--}-+{-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.Highlighting- Copyright : Copyright (C) 2008-2014 John MacFarlane+ Copyright : Copyright (C) 2008-2025 John MacFarlane License : GNU GPL, version 2 or above Maintainer : John MacFarlane <jgm@berkeley.edu>@@ -28,127 +11,282 @@ Exports functions for syntax highlighting. -} -module Text.Pandoc.Highlighting ( languages+module Text.Pandoc.Highlighting ( highlightingStyles+ , languages , languagesByExtension , highlight+ -- * Formats+ -- ** LaTeX , formatLaTeXInline , formatLaTeXBlock , styleToLaTeX+ -- ** HTML , formatHtmlInline , formatHtmlBlock+ , formatHtml4Block , styleToCss+ -- ** ConTeXt+ , formatConTeXtInline+ , formatConTeXtBlock+ , styleToConTeXt+ , formatANSI+ -- ** Typst+ , formatTypstBlock+ , formatTypstInline+ , styleToTypst+ -- * Styles+ , defaultStyle , pygments , espresso , zenburn , tango , kate , monochrome+ , breezeDark , haddock , Style+ , lookupHighlightingStyle , fromListingsLanguage , toListingsLanguage ) where-import Text.Pandoc.Definition-import Text.Pandoc.Shared (safeRead)-import Text.Highlighting.Kate-import Data.List (find)-import Data.Maybe (fromMaybe)-import Data.Char (toLower)+import Control.Monad ( msum ) import qualified Data.Map as M-import Control.Applicative ((<|>))+import Data.Maybe (fromMaybe)+import qualified Data.Text as T+import Skylighting+ ( SyntaxMap,+ breezeDark,+ espresso,+ haddock,+ kate,+ monochrome,+ pygments,+ tango,+ zenburn,+ formatHtml4Block,+ formatHtmlBlock,+ formatHtmlInline,+ styleToCss,+ formatConTeXtBlock,+ formatConTeXtInline,+ styleToConTeXt,+ formatLaTeXBlock,+ formatLaTeXInline,+ styleToLaTeX,+ formatTypstBlock,+ formatTypstInline,+ styleToTypst,+ formatANSI,+ Style,+ FormatOptions(containerClasses, startNumber, lineAnchors,+ numberLines, lineIdPrefix, codeClasses),+ SourceLine,+ lookupSyntax,+ syntaxesByExtension,+ parseTheme,+ tokenize,+ defaultFormatOpts,+ TokenizerConfig(traceOutput, TokenizerConfig, syntaxMap),+ Syntax(sShortname, sName),+ TokenType(NormalTok) )+import Text.Pandoc.Definition ( Attr )+import Text.Pandoc.Class (PandocMonad, readFileLazy)+import Text.Pandoc.Error (PandocError(..))+import Control.Monad.Except (throwError)+import System.FilePath (takeExtension)+import Text.Pandoc.Shared (safeRead) -lcLanguages :: [String]-lcLanguages = map (map toLower) languages+-- | The default highlighting style used by pandoc (pygments).+defaultStyle :: Style+defaultStyle = pygments -highlight :: (FormatOptions -> [SourceLine] -> a) -- ^ Formatter+highlightingStyles :: [(T.Text, Style)]+highlightingStyles =+ [("pygments", pygments),+ ("tango", tango),+ ("espresso", espresso),+ ("zenburn", zenburn),+ ("kate", kate),+ ("monochrome", monochrome),+ ("breezedark", breezeDark),+ ("haddock", haddock)]++languages :: SyntaxMap -> [T.Text]+languages syntaxmap = [T.toLower (sName s) | s <- M.elems syntaxmap]++languagesByExtension :: SyntaxMap -> T.Text -> [T.Text]+languagesByExtension syntaxmap ext =+ [T.toLower (sName s) | s <- syntaxesByExtension syntaxmap (T.unpack ext)]++highlight :: SyntaxMap+ -> (FormatOptions -> [SourceLine] -> a) -- ^ Formatter -> Attr -- ^ Attributes of the CodeBlock- -> String -- ^ Raw contents of the CodeBlock- -> Maybe a -- ^ Maybe the formatted result-highlight formatter (_, classes, keyvals) rawCode =- let firstNum = case safeRead (fromMaybe "1" $ lookup "startFrom" keyvals) of- Just n -> n- Nothing -> 1+ -> T.Text -- ^ Raw contents of the CodeBlock+ -> Either T.Text a+highlight syntaxmap formatter (ident, classes, keyvals) rawCode =+ let firstNum = fromMaybe 1 (safeRead (fromMaybe "1" $ lookup "startFrom" keyvals)) fmtOpts = defaultFormatOpts{ startNumber = firstNum,+ lineAnchors = any (`elem`+ ["line-anchors", "lineAnchors"]) classes, numberLines = any (`elem`- ["number","numberLines", "number-lines"]) classes }- lcclasses = map (map toLower) classes- in case find (`elem` lcLanguages) lcclasses of+ ["number","numberLines", "number-lines"]) classes,+ lineIdPrefix = if T.null ident+ then mempty+ else ident <> "-" }+ tokenizeOpts = TokenizerConfig{ syntaxMap = syntaxmap+ , traceOutput = False }+ in case msum (map (`lookupSyntax` syntaxmap) classes) of Nothing- | numberLines fmtOpts -> Just+ | numberLines fmtOpts -> Right $ formatter fmtOpts{ codeClasses = [], containerClasses = classes }- $ map (\ln -> [(NormalTok, ln)]) $ lines rawCode- | otherwise -> Nothing- Just language -> Just- $ formatter fmtOpts{ codeClasses = [language],- containerClasses = classes }- $ highlightAs language rawCode+ $ map (\ln -> [(NormalTok, ln)])+ $ T.lines rawCode+ | otherwise -> Left ""+ Just syntax -> either (Left . T.pack) Right $+ formatter fmtOpts{ codeClasses =+ [T.toLower (sShortname syntax)],+ containerClasses = classes } <$>+ tokenize tokenizeOpts syntax rawCode -- Functions for correlating latex listings package's language names--- with highlighting-kate language names:+-- with skylighting language names: -langToListingsMap :: M.Map String String+langToListingsMap :: M.Map T.Text T.Text langToListingsMap = M.fromList langsList -listingsToLangMap :: M.Map String String+listingsToLangMap :: M.Map T.Text T.Text listingsToLangMap = M.fromList $ map switch langsList where switch (a,b) = (b,a) -langsList :: [(String, String)]-langsList = [("ada","Ada")- ,("java","Java")- ,("prolog","Prolog")- ,("python","Python")- ,("gnuassembler","Assembler")- ,("commonlisp","Lisp")- ,("r","R")- ,("awk","Awk")- ,("bash","bash")- ,("makefile","make")- ,("c","C")- ,("matlab","Matlab")- ,("ruby","Ruby")- ,("cpp","C++")- ,("ocaml","Caml")- ,("modula2","Modula-2")- ,("sql","SQL")- ,("eiffel","Eiffel")- ,("tcl","tcl")- ,("erlang","erlang")- ,("verilog","Verilog")- ,("fortran","Fortran")- ,("vhdl","VHDL")- ,("pascal","Pascal")- ,("perl","Perl")- ,("xml","XML")- ,("haskell","Haskell")- ,("php","PHP")- ,("xslt","XSLT")- ,("html","HTML")- ]--listingsLangs :: [String]-listingsLangs = ["Ada","Java","Prolog","Algol","JVMIS","Promela",- "Ant","ksh","Python","Assembler","Lisp","R","Awk",- "Logo","Reduce","bash","make","Rexx","Basic",- "Mathematica","RSL","C","Matlab","Ruby","C++",- "Mercury","S","Caml","MetaPost","SAS","Clean",- "Miranda","Scilab","Cobol","Mizar","sh","Comal",- "ML","SHELXL","csh","Modula-2","Simula","Delphi",- "MuPAD","SQL","Eiffel","NASTRAN","tcl","Elan",- "Oberon-2","TeX","erlang","OCL","VBScript","Euphoria",- "Octave","Verilog","Fortran","Oz","VHDL","GCL",- "Pascal","VRML","Gnuplot","Perl","XML","Haskell",- "PHP","XSLT","HTML","PL/I"]+langsList :: [(T.Text, T.Text)]+langsList =+ [("abap","ABAP"),+ ("acm","ACM"),+ ("acmscript","ACMscript"),+ ("acsl","ACSL"),+ ("ada","Ada"),+ ("algol","Algol"),+ ("ant","Ant"),+ ("assembler","Assembler"),+ ("gnuassembler","Assembler"),+ ("awk","Awk"),+ ("bash","bash"),+ ("monobasic","Basic"),+ ("purebasic","Basic"),+ ("c","C"),+ ("cs","C"),+ ("objectivec","C"),+ ("cpp","C++"),+ ("c++","C++"),+ ("ocaml","Caml"),+ ("cil","CIL"),+ ("clean","Clean"),+ ("cobol","Cobol"),+ ("comal80","Comal80"),+ ("command.com","command.com"),+ ("comsol","Comsol"),+ ("csh","csh"),+ ("delphi","Delphi"),+ ("eiffel","Eiffel"),+ ("elan","Elan"),+ ("elisp","elisp"),+ ("erlang","erlang"),+ ("euphoria","Euphoria"),+ ("fortran","Fortran"),+ ("gap","GAP"),+ ("gcl","GCL"),+ ("gnuplot","Gnuplot"),+ ("go","Go"),+ ("hansl","hansl"),+ ("haskell","Haskell"),+ ("html","HTML"),+ ("idl","IDL"),+ ("inform","inform"),+ ("java","Java"),+ ("jvmis","JVMIS"),+ ("ksh","ksh"),+ ("lingo","Lingo"),+ ("lisp","Lisp"),+ ("commonlisp","Lisp"),+ ("llvm","LLVM"),+ ("logo","Logo"),+ ("lua","Lua"),+ ("make","make"),+ ("makefile","make"),+ ("mathematica","Mathematica"),+ ("matlab","Matlab"),+ ("mercury","Mercury"),+ ("metapost","MetaPost"),+ ("miranda","Miranda"),+ ("mizar","Mizar"),+ ("ml","ML"),+ ("modula2","Modula-2"),+ ("mupad","MuPAD"),+ ("nastran","NASTRAN"),+ ("oberon2","Oberon-2"),+ ("ocl","OCL"),+ ("octave","Octave"),+ ("oorexx","OORexx"),+ ("oz","Oz"),+ ("pascal","Pascal"),+ ("perl","Perl"),+ ("php","PHP"),+ ("pli","PL/I"),+ ("plasm","Plasm"),+ ("postscript","PostScript"),+ ("pov","POV"),+ ("prolog","Prolog"),+ ("promela","Promela"),+ ("pstricks","PSTricks"),+ ("python","Python"),+ ("r","R"),+ ("reduce","Reduce"),+ ("rexx","Rexx"),+ ("rsl","RSL"),+ ("ruby","Ruby"),+ ("s","S"),+ ("sas","SAS"),+ ("scala","Scala"),+ ("scilab","Scilab"),+ ("sh","sh"),+ ("shelxl","SHELXL"),+ ("simula","Simula"),+ ("sparql","SPARQL"),+ ("sql","SQL"),+ ("swift","Swift"),+ ("tcl","tcl"),+ ("tex","TeX"),+ ("latex","TeX"),+ ("vbscript","VBScript"),+ ("verilog","Verilog"),+ ("vhdl","VHDL"),+ ("vrml","VRML"),+ ("xml","XML"),+ ("xslt","XSLT")] --- Determine listings language name from highlighting-kate language name.-toListingsLanguage :: String -> Maybe String-toListingsLanguage lang = (if lang `elem` listingsLangs- then Just lang- else Nothing) <|>- M.lookup (map toLower lang) langToListingsMap+-- | Determine listings language name from skylighting language name.+toListingsLanguage :: T.Text -> Maybe T.Text+toListingsLanguage lang = M.lookup (T.toLower lang) langToListingsMap --- Determine highlighting-kate language name from listings language name.-fromListingsLanguage :: String -> Maybe String+-- | Determine skylighting language name from listings language name.+fromListingsLanguage :: T.Text -> Maybe T.Text fromListingsLanguage lang = M.lookup lang listingsToLangMap++-- | Lookup style from a name. If the name is a standard style,+-- load it; if it ends in ".theme", attempt to load a KDE theme+-- from the file path specified.+lookupHighlightingStyle :: PandocMonad m => String -> m Style+lookupHighlightingStyle s+ | takeExtension s == ".theme" = -- attempt to load KDE theme+ do contents <- readFileLazy s+ case parseTheme contents of+ Left _ -> throwError $ PandocOptionError $ T.pack $+ "Could not read highlighting theme " ++ s+ Right sty -> return sty+ | otherwise =+ case lookup (T.toLower $ T.pack s) highlightingStyles of+ Just sty -> return sty+ Nothing -> throwError $ PandocOptionError $ T.pack $+ "Unknown highlight-style " ++ s
@@ -0,0 +1,38 @@+{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, CPP #-}+{- |+Module : Text.Pandoc.Image+Copyright : Copyright (C) 2020-2024 John MacFarlane+License : GNU GPL, version 2 or above++Maintainer : John MacFarlane <jgm@berkeley.edu>+Stability : alpha+Portability : portable++Functions for converting images.+-}+module Text.Pandoc.Image ( svgToPng ) where+import Text.Pandoc.Process (pipeProcess)+import qualified Data.ByteString.Lazy as L+import System.Exit+import Data.Text (Text)+import Text.Pandoc.Shared (tshow)+import qualified Control.Exception as E+import Control.Monad.IO.Class (MonadIO(liftIO))++-- | Convert svg image to png. rsvg-convert+-- is used and must be available on the path.+svgToPng :: MonadIO m+ => Int -- ^ DPI+ -> L.ByteString -- ^ Input image as bytestring+ -> m (Either Text L.ByteString)+svgToPng dpi bs = do+ let dpi' = show dpi+ liftIO $ E.catch+ (do (exit, out) <- pipeProcess Nothing "rsvg-convert"+ ["-f","png","-a","--dpi-x",dpi',"--dpi-y",dpi']+ bs+ return $ if exit == ExitSuccess+ then Right out+ else Left "conversion from SVG failed")+ (\(e :: E.SomeException) -> return $ Left $+ "check that rsvg-convert is in path.\n" <> tshow e)
@@ -1,25 +1,9 @@-{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-}-{-- Copyright (C) 2011-2014 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--}-+{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-}+{-# LANGUAGE ViewPatterns #-}+{-# OPTIONS_GHC -fno-warn-type-defaults #-} {- | Module : Text.Pandoc.ImageSize-Copyright : Copyright (C) 2011-2014 John MacFarlane+Copyright : Copyright (C) 2011-2024 John MacFarlane License : GNU GPL, version 2 or above Maintainer : John MacFarlane <jgm@berkeley.edu>@@ -28,63 +12,274 @@ Functions for determining the size of a PNG, JPEG, or GIF image. -}-module Text.Pandoc.ImageSize ( ImageType(..), imageType, imageSize,- sizeInPixels, sizeInPoints ) where-import Data.ByteString (ByteString, unpack)+module Text.Pandoc.ImageSize ( ImageType(..)+ , ImageSize(..)+ , imageType+ , imageSize+ , sizeInPixels+ , sizeInPoints+ , desiredSizeInPoints+ , Dimension(..)+ , Direction(..)+ , dimension+ , lengthToDim+ , scaleDimension+ , inInch+ , inPixel+ , inPoints+ , inEm+ , numUnit+ , showInInch+ , showInPixel+ , showFl+ ) where+import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy as BL-import Control.Applicative-import Control.Monad-import Data.Bits-import Data.Binary import Data.Binary.Get+import Data.Bits ((.&.), shiftR, shiftL)+import Data.Word (bitReverse32, Word32)+import Data.Maybe (isJust, fromJust)+import Data.Char (isDigit)+import Control.Monad import Text.Pandoc.Shared (safeRead)-import qualified Data.Map as M+import Data.Default (Default)+import Numeric (showFFloat)+import Text.Pandoc.Definition+import Text.Pandoc.Options+import qualified Text.Pandoc.UTF8 as UTF8+import Text.Pandoc.XML.Light hiding (Attr)+import qualified Data.Text as T+import qualified Data.Text.Lazy as TL+import qualified Data.Text.Encoding as TE+import Control.Applicative+import qualified Data.Attoparsec.ByteString as AW+import qualified Data.Attoparsec.ByteString.Char8 as A+import qualified Codec.Picture.Metadata as Metadata+import Codec.Picture (decodeImageWithMetadata)+import Codec.Compression.Zlib (decompress)+-- import Debug.Trace -- quick and dirty functions to get image sizes--- algorithms borrowed from wwwis.pl -data ImageType = Png | Gif | Jpeg | Pdf | Eps deriving Show+data ImageType = Png | Gif | Jpeg | Svg | Pdf | Eps | Emf | Tiff | Webp | Avif+ deriving Show+data Direction = Width | Height+instance Show Direction where+ show Width = "width"+ show Height = "height" +data Dimension = Pixel Integer+ | Centimeter Double+ | Millimeter Double+ | Inch Double+ | Point Double+ | Pica Double+ | Percent Double+ | Em Double+ deriving Eq++instance Show Dimension where+ show (Pixel a) = show a ++ "px"+ show (Centimeter a) = T.unpack (showFl a) ++ "cm"+ show (Millimeter a) = T.unpack (showFl a) ++ "mm"+ show (Inch a) = T.unpack (showFl a) ++ "in"+ show (Point a) = T.unpack (showFl a) ++ "pt"+ show (Pica a) = T.unpack (showFl a) ++ "pc"+ show (Percent a) = show a ++ "%"+ show (Em a) = T.unpack (showFl a) ++ "em"+ data ImageSize = ImageSize{ pxX :: Integer , pxY :: Integer , dpiX :: Integer , dpiY :: Integer } deriving (Read, Show, Eq)+instance Default ImageSize where+ def = ImageSize 300 200 72 72 +showFl :: (RealFloat a) => a -> T.Text+showFl a = removeExtra0s $ T.pack $ showFFloat (Just 5) a "" +removeExtra0s :: T.Text -> T.Text+removeExtra0s s = case T.dropWhileEnd (=='0') s of+ (T.unsnoc -> Just (xs, '.')) -> xs+ xs -> xs++dropBOM :: ByteString -> ByteString+dropBOM bs =+ if "\xEF\xBB\xBF" `B.isPrefixOf` bs+ then B.drop 3 bs+ else bs+ imageType :: ByteString -> Maybe ImageType imageType img = case B.take 4 img of "\x89\x50\x4e\x47" -> return Png "\x47\x49\x46\x38" -> return Gif- "\xff\xd8\xff\xe0" -> return Jpeg -- JFIF- "\xff\xd8\xff\xe1" -> return Jpeg -- Exif+ "\x49\x49\x2a\x00" -> return Tiff+ "\x4D\x4D\x00\x2a" -> return Tiff+ "\xff\xd8\xff\xbd" -> return Jpeg -- JPEG without application segment -- see p.32 in https://www.w3.org/Graphics/JPEG/itu-t81.pdf (and https://gist.github.com/leommoore/f9e57ba2aa4bf197ebc5?permalink_comment_id=3863054#gistcomment-3863054)+ _ | B.take 3 img == "\xff\xd8\xff"+ && (let byte4 = B.take 1 (B.drop 3 img)+ in byte4 >= "\xe0" && byte4 <= "\xef") -- JPEG with application segment+ -> return Jpeg "%PDF" -> return Pdf+ "<svg" -> return Svg+ "<?xm"+ | findSvgTag img+ -> return Svg "%!PS"- | (B.take 4 $ B.drop 1 $ B.dropWhile (/=' ') img) == "EPSF"+ | B.take 4 (B.drop 1 $ B.dropWhile (/=' ') img) == "EPSF" -> return Eps- _ -> fail "Unknown image type"+ "\x01\x00\x00\x00"+ | B.take 4 (B.drop 40 img) == " EMF"+ -> return Emf+ "\xEF\xBB\xBF<" -- BOM before svg+ -> imageType (B.drop 3 img)+ "RIFF"+ | B.take 4 (B.drop 8 img) == "WEBP"+ -> return Webp+ _ | B.take 4 (B.drop 4 img) == "ftyp" -> return Avif+ _ -> mzero -imageSize :: ByteString -> Maybe ImageSize-imageSize img = do- t <- imageType img- case t of- Png -> pngSize img- Gif -> gifSize img- Jpeg -> jpegSize img- Eps -> epsSize img- Pdf -> Nothing -- TODO+findSvgTag :: ByteString -> Bool+findSvgTag img = "<svg" `B.isInfixOf` img || "<SVG" `B.isInfixOf` img -defaultSize :: (Integer, Integer)-defaultSize = (72, 72)+imageSize :: WriterOptions -> ByteString -> Either T.Text ImageSize+imageSize opts img = checkDpi <$>+ case imageType img of+ Just Png -> getSize img+ Just Gif -> getSize img+ Just Jpeg -> getSize img+ Just Tiff -> getSize img+ Just Svg -> mbToEither "could not determine SVG size" $ svgSize opts img+ Just Eps -> mbToEither "could not determine EPS size" $ epsSize img+ Just Pdf -> mbToEither "could not determine PDF size" $ pdfSize img+ Just Emf -> mbToEither "could not determine EMF size" $ emfSize img+ Just Webp -> mbToEither "could not determine WebP size" $ webpSize opts img+ Just Avif -> mbToEither "could not determine AVIF size" $ avifSize opts img+ Nothing -> Left "could not determine image type"+ where mbToEither msg Nothing = Left msg+ mbToEither _ (Just x) = Right x+ -- see #6880, some defective JPEGs may encode dpi 0, so default to 72+ -- if that value is 0+ checkDpi size =+ size{ dpiX = if dpiX size == 0 then 72 else dpiX size+ , dpiY = if dpiY size == 0 then 72 else dpiY size } + sizeInPixels :: ImageSize -> (Integer, Integer) sizeInPixels s = (pxX s, pxY s) -sizeInPoints :: ImageSize -> (Integer, Integer)-sizeInPoints s = (pxX s * 72 `div` dpiX s, pxY s * 72 `div` dpiY s)+-- | Calculate (height, width) in points using the image file's dpi metadata,+-- using 72 Points == 1 Inch.+sizeInPoints :: ImageSize -> (Double, Double)+sizeInPoints s = (pxXf * 72 / dpiXf, pxYf * 72 / dpiYf)+ where+ pxXf = fromIntegral $ pxX s+ pxYf = fromIntegral $ pxY s+ dpiXf = fromIntegral $ dpiX s+ dpiYf = fromIntegral $ dpiY s +-- | Calculate (height, width) in points, considering the desired dimensions in the+-- attribute, while falling back on the image file's dpi metadata if no dimensions+-- are specified in the attribute (or only dimensions in percentages).+desiredSizeInPoints :: WriterOptions -> Attr -> ImageSize -> (Double, Double)+desiredSizeInPoints opts attr s =+ case (getDim Width, getDim Height) of+ (Just w, Just h) -> (w, h)+ (Just w, Nothing) -> (w, w / ratio)+ (Nothing, Just h) -> (h * ratio, h)+ (Nothing, Nothing) -> sizeInPoints s+ where+ ratio = fromIntegral (pxX s) / fromIntegral (pxY s)+ getDim dir = case dimension dir attr of+ Just (Percent _) -> Nothing+ Just dim -> Just $ inPoints opts dim+ Nothing -> Nothing++inPoints :: WriterOptions -> Dimension -> Double+inPoints opts dim = 72 * inInch opts dim++inEm :: WriterOptions -> Dimension -> Double+inEm opts dim = (64/11) * inInch opts dim++inInch :: WriterOptions -> Dimension -> Double+inInch opts dim =+ case dim of+ (Pixel a) -> fromIntegral a / fromIntegral (writerDpi opts)+ (Centimeter a) -> a * 0.3937007874+ (Millimeter a) -> a * 0.03937007874+ (Inch a) -> a+ (Point a) -> (a / 72)+ (Pica a) -> (a / 6)+ (Percent _) -> 0+ (Em a) -> a * (11/64)++inPixel :: WriterOptions -> Dimension -> Integer+inPixel opts dim =+ case dim of+ (Pixel a) -> a+ _ -> floor (dpi * inInch opts dim)+ where+ dpi = fromIntegral $ writerDpi opts++-- | Convert a Dimension to Text denoting its equivalent in inches, for example "2.00000".+-- Note: Dimensions in percentages are converted to the empty string.+showInInch :: WriterOptions -> Dimension -> T.Text+showInInch _ (Percent _) = ""+showInInch opts dim = showFl $ inInch opts dim++-- | Convert a Dimension to Text denoting its equivalent in pixels, for example "600".+-- Note: Dimensions in percentages are converted to the empty string.+showInPixel :: WriterOptions -> Dimension -> T.Text+showInPixel _ (Percent _) = ""+showInPixel opts dim = T.pack $ show $ inPixel opts dim++-- | Maybe split a string into a leading number and trailing unit, e.g. "3cm" to Just (3.0, "cm")+numUnit :: T.Text -> Maybe (Double, T.Text)+numUnit s =+ let (nums, unit) = T.span (\c -> isDigit c || ('.'==c)) s+ in (\n -> (n, unit)) <$> safeRead nums++-- | Scale a dimension by a factor.+scaleDimension :: Double -> Dimension -> Dimension+scaleDimension factor dim =+ case dim of+ Pixel x -> Pixel (round $ factor * fromIntegral x)+ Centimeter x -> Centimeter (factor * x)+ Millimeter x -> Millimeter (factor * x)+ Inch x -> Inch (factor * x)+ Point x -> Point (factor * x)+ Pica x -> Pica (factor * x)+ Percent x -> Percent (factor * x)+ Em x -> Em (factor * x)++-- | Read a Dimension from an Attr attribute.+-- `dimension Width attr` might return `Just (Pixel 3)` or for example `Just (Centimeter 2.0)`, etc.+dimension :: Direction -> Attr -> Maybe Dimension+dimension dir (_, _, kvs) =+ case dir of+ Width -> extractDim "width"+ Height -> extractDim "height"+ where+ extractDim key = lookup key kvs >>= lengthToDim++lengthToDim :: T.Text -> Maybe Dimension+lengthToDim s = numUnit s >>= uncurry toDim+ where+ toDim a "cm" = Just $ Centimeter a+ toDim a "mm" = Just $ Millimeter a+ toDim a "in" = Just $ Inch a+ toDim a "inch" = Just $ Inch a+ toDim a "%" = Just $ Percent a+ toDim a "px" = Just $ Pixel (floor a::Integer)+ toDim a "" = Just $ Pixel (floor a::Integer)+ toDim a "pt" = Just $ Point a+ toDim a "pc" = Just $ Pica a+ toDim a "em" = Just $ Em a+ toDim _ _ = Nothing+ epsSize :: ByteString -> Maybe ImageSize epsSize img = do let ls = takeWhile ("%" `B.isPrefixOf`) $ B.lines img@@ -92,9 +287,9 @@ case ls' of [] -> mzero (x:_) -> case B.words x of- (_:_:_:ux:uy:[]) -> do- ux' <- safeRead $ B.unpack ux- uy' <- safeRead $ B.unpack uy+ [_, _, _, ux, uy] -> do+ ux' <- safeRead $ TE.decodeUtf8 ux+ uy' <- safeRead $ TE.decodeUtf8 uy return ImageSize{ pxX = ux' , pxY = uy'@@ -102,298 +297,359 @@ , dpiY = 72 } _ -> mzero -pngSize :: ByteString -> Maybe ImageSize-pngSize img = do- let (h, rest) = B.splitAt 8 img- guard $ h == "\x8a\x4d\x4e\x47\x0d\x0a\x1a\x0a" ||- h == "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a"- let (i, rest') = B.splitAt 4 $ B.drop 4 rest- guard $ i == "MHDR" || i == "IHDR"- let (sizes, rest'') = B.splitAt 8 rest'- (x,y) <- case map fromIntegral $ unpack $ sizes of- ([w1,w2,w3,w4,h1,h2,h3,h4] :: [Integer]) -> return- ((shift w1 24) + (shift w2 16) + (shift w3 8) + w4,- (shift h1 24) + (shift h2 16) + (shift h3 8) + h4)- _ -> fail "PNG parse error"- let (dpix, dpiy) = findpHYs rest''- return $ ImageSize { pxX = x, pxY = y, dpiX = dpix, dpiY = dpiy }+pdfSize :: ByteString -> Maybe ImageSize+pdfSize img =+ case A.parseOnly pPdfSize img of+ Left _ -> Nothing+ Right sz -> Just sz -findpHYs :: ByteString -> (Integer, Integer)-findpHYs x =- if B.null x || "IDAT" `B.isPrefixOf` x- then (72,72) -- default, no pHYs- else if "pHYs" `B.isPrefixOf` x- then let [x1,x2,x3,x4,y1,y2,y3,y4,u] = map fromIntegral- $ unpack $ B.take 9 $ B.drop 4 x- factor = if u == 1 -- dots per meter- then \z -> z * 254 `div` 10000- else const 72- in ( factor $ (shift x1 24) + (shift x2 16) + (shift x3 8) + x4,- factor $ (shift y1 24) + (shift y2 16) + (shift y3 8) + y4 )- else findpHYs $ B.drop 1 x -- read another byte+pPdfSize :: A.Parser ImageSize+pPdfSize =+ (A.takeWhile1 (/= '/') *> pPdfSize)+ <|>+ (do A.string "/MediaBox"+ A.skipSpace+ A.char8 '['+ A.skipSpace+ [x1,y1,x2,y2] <- A.count 4 $ do+ A.skipSpace+ raw <- A.many1 $ A.satisfy (\c -> isDigit c || c == '.')+ case safeRead $ T.pack raw of+ Just (r :: Double) -> return $ floor r+ Nothing -> mzero+ A.skipSpace+ A.char8 ']'+ return $ ImageSize{+ pxX = x2 - x1+ , pxY = y2 - y1+ , dpiX = 72+ , dpiY = 72 }+ )+ <|> -- if we encounter a compressed object stream, uncompress it (#10902)+ (do A.string "/Type"+ A.skipSpace+ A.string "/ObjStm"+ _ <- A.manyTill pLine (A.string "stream" *> pEol)+ stream <- BL.pack <$> A.manyTill+ (AW.satisfy (const True))+ (pEol *> A.string "endstream" *> pEol)+ let contents = BL.toStrict (decompress stream)+ case A.parseOnly pPdfSize contents of+ Left _ -> pPdfSize+ Right is -> pure is)+ <|>+ (A.char '/' *> pPdfSize)+ where+ iseol '\r' = True+ iseol '\n' = True+ iseol _ = False+ pEol = A.satisfy iseol *> A.skipMany (A.satisfy iseol)+ pLine = A.takeWhile (not . iseol) <* pEol -gifSize :: ByteString -> Maybe ImageSize-gifSize img = do- let (h, rest) = B.splitAt 6 img- guard $ h == "GIF87a" || h == "GIF89a"- case map fromIntegral $ unpack $ B.take 4 rest of- [w2,w1,h2,h1] -> return ImageSize {- pxX = shift w1 8 + w2,- pxY = shift h1 8 + h2,- dpiX = 72,- dpiY = 72- }- _ -> fail "GIF parse error"+getSize :: ByteString -> Either T.Text ImageSize+getSize img =+ case decodeImageWithMetadata img of+ Left e -> Left (T.pack e)+ Right (_, meta) -> do+ pxx <- maybe (Left "Could not determine width") Right $+ Metadata.lookup Metadata.Width meta+ pxy <- maybe (Left "Could not determine height") Right $+ Metadata.lookup Metadata.Height meta+ dpix <- maybe (Right 72) Right $ Metadata.lookup Metadata.DpiX meta+ dpiy <- maybe (Right 72) Right $ Metadata.lookup Metadata.DpiY meta+ return $ ImageSize+ { pxX = fromIntegral pxx+ , pxY = fromIntegral pxy+ , dpiX = fromIntegral dpix+ , dpiY = fromIntegral dpiy } -jpegSize :: ByteString -> Maybe ImageSize-jpegSize img = do- let (hdr, rest) = B.splitAt 4 img- guard $ B.length rest >= 14- case hdr of- "\xff\xd8\xff\xe0" -> jfifSize rest- "\xff\xd8\xff\xe1" -> exifSize $ B.takeWhile (/= '\xff') rest- _ -> mzero+svgSize :: WriterOptions -> ByteString -> Maybe ImageSize+svgSize opts img = do+ doc <- either (const mzero) return $ parseXMLElement+ $ TL.fromStrict $ UTF8.toText $ dropBOM img+ let viewboxSize = do+ vb <- findAttrBy (== QName "viewBox" Nothing Nothing) doc+ [_,_,w,h] <- mapM safeRead (T.words vb)+ return (w,h)+ let dpi = fromIntegral $ writerDpi opts+ let dirToInt dir = do+ dim <- findAttrBy (== QName dir Nothing Nothing) doc >>= lengthToDim+ case dim of+ Percent _ -> mzero+ _ -> pure $ inPixel opts dim+ w <- dirToInt "width" <|> (fst <$> viewboxSize)+ h <- dirToInt "height" <|> (snd <$> viewboxSize)+ return ImageSize {+ pxX = w+ , pxY = h+ , dpiX = dpi+ , dpiY = dpi+ } -jfifSize :: ByteString -> Maybe ImageSize-jfifSize rest = do- let [dpiDensity,dpix1,dpix2,dpiy1,dpiy2] = map fromIntegral- $ unpack $ B.take 5 $ B.drop 9 $ rest- let factor = case dpiDensity of- 1 -> id- 2 -> \x -> (x * 254 `div` 10)- _ -> const 72- let dpix = factor (shift dpix1 8 + dpix2)- let dpiy = factor (shift dpiy1 8 + dpiy2)- (w,h) <- findJfifSize rest- return $ ImageSize { pxX = w, pxY = h, dpiX = dpix, dpiY = dpiy }+emfSize :: ByteString -> Maybe ImageSize+emfSize img =+ let+ parseheader = runGetOrFail $ do+ skip 0x18 -- 0x00+ frameL <- getWord32le -- 0x18 measured in 1/100 of a millimetre+ frameT <- getWord32le -- 0x1C+ frameR <- getWord32le -- 0x20+ frameB <- getWord32le -- 0x24+ skip 0x20 -- 0x28+ deviceX <- getWord32le -- 0x48 pixels of reference device+ deviceY <- getWord32le -- 0x4C+ mmX <- getWord32le -- 0x50 real mm of reference device (always 320*240?)+ mmY <- getWord32le -- 0x58+ -- end of header+ let+ w = (deviceX * (frameR - frameL)) `quot` (mmX * 100)+ h = (deviceY * (frameB - frameT)) `quot` (mmY * 100)+ dpiW = (deviceX * 254) `quot` (mmX * 10)+ dpiH = (deviceY * 254) `quot` (mmY * 10)+ return $ ImageSize+ { pxX = fromIntegral w+ , pxY = fromIntegral h+ , dpiX = fromIntegral dpiW+ , dpiY = fromIntegral dpiH+ }+ in+ case parseheader . BL.fromStrict $ img of+ Left _ -> Nothing+ Right (_, _, size) -> Just size -findJfifSize :: ByteString -> Maybe (Integer,Integer)-findJfifSize bs = do- let bs' = B.dropWhile (=='\xff') $ B.dropWhile (/='\xff') bs- case B.uncons bs' of- Just (c,bs'') | c >= '\xc0' && c <= '\xc3' -> do- case map fromIntegral $ unpack $ B.take 4 $ B.drop 3 bs'' of- [h1,h2,w1,w2] -> return (shift w1 8 + w2, shift h1 8 + h2)- _ -> fail "JPEG parse error"- Just (_,bs'') -> do- case map fromIntegral $ unpack $ B.take 2 bs'' of- [c1,c2] -> do- let len = shift c1 8 + c2- -- skip variables- findJfifSize $ B.drop len bs''- _ -> fail "JPEG parse error"- Nothing -> fail "Did not find length record"+-- See https://developers.google.com/speed/webp/docs/riff_container+-- and RFC 6386+pWebpSize :: AW.Parser ImageSize+pWebpSize = do+ AW.string "RIFF"+ AW.take 4+ AW.string "WEBP"+ (w, h) <- lossy <|> lossless <|> extended+ return $ def+ { pxX = w+ , pxY = h+ }+ where+ bitsToMaybe = either (const Nothing) (\((_, _, s)) -> Just s)+ decode d = bitsToMaybe . d . BL.fromStrict+ lossySize = runGetOrFail $ do+ word <- getWord16le+ return $ word .&. 0x3FFF+ lossy = do+ AW.string "VP8 "+ AW.take 4 -- length in bytes of VP8 Lossy stream size+ keyFrame <- AW.anyWord8+ guard $ keyFrame .&. 1 == 0+ AW.take 2 -- remaining bytes of frame header+ AW.word8 0x9d -- VP8 keyframe magic+ AW.word8 0x01+ AW.word8 0x2a+ width16 <- AW.take 2+ height16 <- AW.take 2+ let w = toInteger <$> decode lossySize width16+ h = toInteger <$> decode lossySize height16+ guard $ isJust w && isJust h+ return (fromJust w, fromJust h)+ losslessSizes = runGetOrFail $ do+ bitReverse32 <$> getWord32le+ losslessSize word = 1 + (word .&. 0x3FFF)+ lossless = do+ AW.string "VP8L"+ AW.take 4 -- length in bytes of VP8 Lossless chunk size+ AW.word8 0x2f -- webp lossless stream magic+ sizes <- AW.take 4+ let mbword = decode losslessSizes sizes+ guard $ isJust mbword+ let word = fromJust mbword+ let w = toInteger $ losslessSize word+ h = toInteger $ losslessSize (word `shiftR` 14)+ return (w, h)+ extendedSize = runGetOrFail $ do+ low <- toInteger <$> getWord16le+ high <- toInteger <$> getWord8+ return $ 1 + (high `shiftL` 16) + (low)+ extended = do+ AW.string "VP8X"+ AW.take 8 -- VP8X chunk length, flags and reserved area+ width24 <- AW.take 3+ height24 <- AW.take 3+ let w = decode extendedSize width24+ h = decode extendedSize height24+ guard $ isJust w && isJust h+ return (fromJust w, fromJust h) -exifSize :: ByteString -> Maybe ImageSize-exifSize bs = runGet (Just <$> exifHeader bl) bl- where bl = BL.fromChunks [bs]--- NOTE: It would be nicer to do--- runGet ((Just <$> exifHeader) <|> return Nothing)--- which would prevent pandoc from raising an error when an exif header can't--- be parsed. But we only get an Alternative instance for Get in binary 0.6,--- and binary 0.5 ships with ghc 7.6.+webpSize :: WriterOptions -> ByteString -> Maybe ImageSize+webpSize opts img =+ case AW.parseOnly pWebpSize img of+ Left _ -> Nothing+ Right sz -> Just sz { dpiX = fromIntegral $ writerDpi opts, dpiY = fromIntegral $ writerDpi opts} -exifHeader :: BL.ByteString -> Get ImageSize-exifHeader hdr = do- _app1DataSize <- getWord16be- exifHdr <- getWord32be- unless (exifHdr == 0x45786966) $ fail "Did not find exif header"- zeros <- getWord16be- unless (zeros == 0) $ fail "Expected zeros after exif header"- -- beginning of tiff header -- we read whole thing to use- -- in getting data from offsets:- let tiffHeader = BL.drop 8 hdr- byteAlign <- getWord16be- let bigEndian = byteAlign == 0x4d4d- let (getWord16, getWord32, getWord64) =- if bigEndian- then (getWord16be, getWord32be, getWord64be)- else (getWord16le, getWord32le, getWord64le)- let getRational = do- num <- getWord32- den <- getWord32- return $ fromIntegral num / fromIntegral den- tagmark <- getWord16- unless (tagmark == 0x002a) $ fail "Failed alignment sanity check"- ifdOffset <- getWord32- skip (fromIntegral ifdOffset - 8) -- skip to IDF- numentries <- getWord16- let ifdEntry = do- tag <- getWord16 >>= \t ->- maybe (return UnknownTagType) return- (M.lookup t tagTypeTable)- dataFormat <- getWord16- numComponents <- getWord32- (fmt, bytesPerComponent) <-- case dataFormat of- 1 -> return (UnsignedByte . runGet getWord8, 1)- 2 -> return (AsciiString, 1)- 3 -> return (UnsignedShort . runGet getWord16, 2)- 4 -> return (UnsignedLong . runGet getWord32, 4)- 5 -> return (UnsignedRational . runGet getRational, 8)- 6 -> return (SignedByte . runGet getWord8, 1)- 7 -> return (Undefined . runGet getWord8, 1)- 8 -> return (SignedShort . runGet getWord16, 2)- 9 -> return (SignedLong . runGet getWord32, 4)- 10 -> return (SignedRational . runGet getRational, 8)- 11 -> return (SingleFloat . runGet getWord32 {- TODO -}, 4)- 12 -> return (DoubleFloat . runGet getWord64 {- TODO -}, 8)- _ -> fail $ "Unknown data format " ++ show dataFormat- let totalBytes = fromIntegral $ numComponents * bytesPerComponent- payload <- if totalBytes <= 4 -- data is right here- then fmt <$>- (getLazyByteString (fromIntegral totalBytes) <*- skip (4 - totalBytes))- else do -- get data from offset- offs <- getWord32- return $ fmt $ BL.take (fromIntegral totalBytes) $- BL.drop (fromIntegral offs) tiffHeader- return (tag, payload)- entries <- sequence $ replicate (fromIntegral numentries) ifdEntry- subentries <- case lookup ExifOffset entries of- Just (UnsignedLong offset) -> do- pos <- bytesRead- skip (fromIntegral offset - (fromIntegral pos - 8))- numsubentries <- getWord16- sequence $- replicate (fromIntegral numsubentries) ifdEntry- _ -> return []- let allentries = entries ++ subentries- (width, height) <- case (lookup ExifImageWidth allentries,- lookup ExifImageHeight allentries) of- (Just (UnsignedLong w), Just (UnsignedLong h)) ->- return (fromIntegral w, fromIntegral h)- _ -> return defaultSize- -- we return a default width and height when- -- the exif header doesn't contain these- let resfactor = case lookup ResolutionUnit allentries of- Just (UnsignedShort 1) -> (100 / 254)- _ -> 1- let xres = maybe 72 (\(UnsignedRational x) -> floor $ x * resfactor)- $ lookup XResolution allentries- let yres = maybe 72 (\(UnsignedRational x) -> floor $ x * resfactor)- $ lookup YResolution allentries- return $ ImageSize{- pxX = width- , pxY = height- , dpiX = xres- , dpiY = yres }+avifSize :: WriterOptions -> ByteString -> Maybe ImageSize+avifSize _opts img =+ case runGetOrFail (verifyFtyp >> findAvifDimensions) (BL.fromStrict img) of+ Left (_, _, _err) -> Nothing+ Right (_, _, (width, height)) ->+ Just $ ImageSize { pxX = fromIntegral width+ , pxY = fromIntegral height+ , dpiX = 72+ , dpiY = 72 } -data DataFormat = UnsignedByte Word8- | AsciiString BL.ByteString- | UnsignedShort Word16- | UnsignedLong Word32- | UnsignedRational Rational- | SignedByte Word8- | Undefined Word8- | SignedShort Word16- | SignedLong Word32- | SignedRational Rational- | SingleFloat Word32- | DoubleFloat Word64- deriving (Show)+---- AVIF parsing: -data TagType = ImageDescription- | Make- | Model- | Orientation- | XResolution- | YResolution- | ResolutionUnit- | Software- | DateTime- | WhitePoint- | PrimaryChromaticities- | YCbCrCoefficients- | YCbCrPositioning- | ReferenceBlackWhite- | Copyright- | ExifOffset- | ExposureTime- | FNumber- | ExposureProgram- | ISOSpeedRatings- | ExifVersion- | DateTimeOriginal- | DateTimeDigitized- | ComponentConfiguration- | CompressedBitsPerPixel- | ShutterSpeedValue- | ApertureValue- | BrightnessValue- | ExposureBiasValue- | MaxApertureValue- | SubjectDistance- | MeteringMode- | LightSource- | Flash- | FocalLength- | MakerNote- | UserComment- | FlashPixVersion- | ColorSpace- | ExifImageWidth- | ExifImageHeight- | RelatedSoundFile- | ExifInteroperabilityOffset- | FocalPlaneXResolution- | FocalPlaneYResolution- | FocalPlaneResolutionUnit- | SensingMethod- | FileSource- | SceneType- | UnknownTagType- deriving (Show, Eq, Ord)+verifyFtyp :: Get ()+verifyFtyp = do+ ftypSize <- getWord32be+ when (ftypSize < 16) $ fail "Invalid ftyp size" -tagTypeTable :: M.Map Word16 TagType-tagTypeTable = M.fromList- [ (0x010e, ImageDescription)- , (0x010f, Make)- , (0x0110, Model)- , (0x0112, Orientation)- , (0x011a, XResolution)- , (0x011b, YResolution)- , (0x0128, ResolutionUnit)- , (0x0131, Software)- , (0x0132, DateTime)- , (0x013e, WhitePoint)- , (0x013f, PrimaryChromaticities)- , (0x0211, YCbCrCoefficients)- , (0x0213, YCbCrPositioning)- , (0x0214, ReferenceBlackWhite)- , (0x8298, Copyright)- , (0x8769, ExifOffset)- , (0x829a, ExposureTime)- , (0x829d, FNumber)- , (0x8822, ExposureProgram)- , (0x8827, ISOSpeedRatings)- , (0x9000, ExifVersion)- , (0x9003, DateTimeOriginal)- , (0x9004, DateTimeDigitized)- , (0x9101, ComponentConfiguration)- , (0x9102, CompressedBitsPerPixel)- , (0x9201, ShutterSpeedValue)- , (0x9202, ApertureValue)- , (0x9203, BrightnessValue)- , (0x9204, ExposureBiasValue)- , (0x9205, MaxApertureValue)- , (0x9206, SubjectDistance)- , (0x9207, MeteringMode)- , (0x9208, LightSource)- , (0x9209, Flash)- , (0x920a, FocalLength)- , (0x927c, MakerNote)- , (0x9286, UserComment)- , (0xa000, FlashPixVersion)- , (0xa001, ColorSpace)- , (0xa002, ExifImageWidth)- , (0xa003, ExifImageHeight)- , (0xa004, RelatedSoundFile)- , (0xa005, ExifInteroperabilityOffset)- , (0xa20e, FocalPlaneXResolution)- , (0xa20f, FocalPlaneYResolution)- , (0xa210, FocalPlaneResolutionUnit)- , (0xa217, SensingMethod)- , (0xa300, FileSource)- , (0xa301, SceneType)- ]+ ftyp <- getByteString 4+ unless (ftyp == "ftyp") $ fail "ftyp signature not found"++ brand <- getByteString 4+ unless (brand == "avif" || brand == "avis") $ fail "Not an AVIF file"++ -- Skip minor version and compatible brands+ -- (we've read 12 bytes: size+type+brand)+ let remaining_ftyp = fromIntegral ftypSize - 12+ when (remaining_ftyp > 0) $ skip remaining_ftyp++findAvifDimensions :: Get (Word32, Word32)+findAvifDimensions = searchAvifBoxes []++searchAvifBoxes :: [B.ByteString] -> Get (Word32, Word32)+searchAvifBoxes path = do+ isempty <- isEmpty+ if isempty+ then fail $ "No dimensions found. Searched: " ++ show (reverse path)+ else do+ boxSize <- getWord32be+ boxType <- getByteString 4++ let contentSize = fromIntegral boxSize - 8+ let newPath = boxType : path++ -- If it's a container box, search inside it+ if isContainerBox boxType+ then searchInsideBox contentSize newPath+ else do+ -- Try to parse dimensions from this box+ result <- tryParseDimensions boxType contentSize+ case result of+ Just dims -> return dims+ Nothing -> do+ -- Skip this box and continue+ when (contentSize > 0 && contentSize < 10000000) $+ skip contentSize+ searchAvifBoxes path++tryParseDimensions :: B.ByteString -> Int -> Get (Maybe (Word32, Word32))+tryParseDimensions boxType size = do+ pos <- bytesRead+ result <- case boxType of+ "ispe" -> parseIspeBox+ "tkhd" -> parseTkhdBox+ "stsd" -> parseStsdBox+ "av01" -> parseAv01Box+ _ -> return Nothing++ -- Reset position if we didn't find dimensions+ case result of+ Nothing -> do+ newPos <- bytesRead+ let consumed = fromIntegral (newPos - pos)+ case size - consumed of+ n | n > 0 -> skip n+ _ -> return ()+ Just _ -> return ()++ return result++parseIspeBox :: Get (Maybe (Word32, Word32))+parseIspeBox = do+ skip 4 -- version/flags+ width <- getWord32be+ height <- getWord32be+ return $ Just (width, height)++parseTkhdBox :: Get (Maybe (Word32, Word32))+parseTkhdBox = do+ version <- getWord8+ skip 3 -- flags++ -- Skip to width/height based on version+ let skipBytes = if version == 1 then 76 else 64+ skip skipBytes++ width <- getWord32be+ height <- getWord32be+ -- Convert from 16.16 fixed point+ return $ Just (width `shiftR` 16, height `shiftR` 16)++parseStsdBox :: Get (Maybe (Word32, Word32))+parseStsdBox = do+ skip 8 -- version, flags, entry count+ findAv01Entry++findAv01Entry :: Get (Maybe (Word32, Word32))+findAv01Entry = do+ entrySize <- getWord32be+ codec <- getByteString 4++ if codec == "av01"+ then do+ skip 6 -- reserved+ skip 2 -- data reference index+ skip 16 -- pre-defined + reserved+ width <- getWord16be+ height <- getWord16be+ return $ Just (fromIntegral width, fromIntegral height)+ else do+ let skipSize = fromIntegral entrySize - 8+ when (skipSize > 0) $ skip skipSize+ findAv01Entry++parseAv01Box :: Get (Maybe (Word32, Word32))+parseAv01Box = do+ skip 6 -- reserved+ skip 2 -- data reference index+ skip 16 -- predefined/reserved+ width <- getWord16be+ height <- getWord16be+ return $ Just (fromIntegral width, fromIntegral height)++searchInsideBox :: Int -> [B.ByteString] -> Get (Word32, Word32)+searchInsideBox size path = do+ -- For meta boxes, skip version/flags+ let isMeta = case path of+ "meta":_ -> True+ _ -> False+ when isMeta $ skip 4++ let searchSize = if isMeta then size - 4 else size+ searchAvifBoxesInRange searchSize path++searchAvifBoxesInRange :: Int -> [B.ByteString] -> Get (Word32, Word32)+searchAvifBoxesInRange remaining' path+ | remaining' < 8 = searchAvifBoxes path+ | otherwise = do+ boxSize <- getWord32be+ boxType <- getByteString 4++ let contentSize = fromIntegral boxSize - 8+ let newPath = boxType : path++ when (contentSize < 0 || fromIntegral boxSize > remaining') $ do+ fail $ "Malformed box at path: " ++ show (reverse newPath)++ if isContainerBox boxType+ then searchInsideBox contentSize newPath+ else do+ result <- tryParseDimensions boxType contentSize+ case result of+ Just dims -> return dims+ Nothing -> do+ -- Don't skip here - tryParseDimensions already handled it+ searchAvifBoxesInRange (remaining' - fromIntegral boxSize) path++isContainerBox :: B.ByteString -> Bool+isContainerBox boxType = boxType `elem`+ ["moov", "trak", "mdia", "minf", "stbl", "meta", "dinf", "ipco", "iprp"]
@@ -0,0 +1,505 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Logging+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++This module provides data types and functions for warnings+and info messages.++-}+module Text.Pandoc.Logging (+ Verbosity(..)+ , LogMessage(..)+ , encodeLogMessages+ , showLogMessage+ , messageVerbosity+ ) where++import Control.Monad (mzero)+import Data.Aeson+import Data.Aeson.Encode.Pretty (Config (..), defConfig, encodePretty',+ keyOrder)+import qualified Data.ByteString.Lazy as BL+import Data.Data (Data, toConstr)+import qualified Data.Text as Text+import Data.Text (Text)+import Data.Typeable (Typeable)+import GHC.Generics (Generic)+import Text.Pandoc.Definition+import Text.Parsec.Pos+import Text.Pandoc.Shared (tshow)++-- | Verbosity level.+data Verbosity = ERROR | WARNING | INFO+ deriving (Show, Read, Eq, Data, Enum, Ord, Bounded, Typeable, Generic)++instance ToJSON Verbosity where+ toJSON x = toJSON (show x)+instance FromJSON Verbosity where+ parseJSON (String t) =+ case t of+ "ERROR" -> return ERROR+ "WARNING" -> return WARNING+ "INFO" -> return INFO+ _ -> mzero+ parseJSON _ = mzero++data LogMessage =+ SkippedContent Text SourcePos+ | IgnoredElement Text+ | DuplicateLinkReference Text SourcePos+ | DuplicateNoteReference Text SourcePos+ | NoteDefinedButNotUsed Text SourcePos+ | DuplicateIdentifier Text SourcePos+ | ReferenceNotFound Text SourcePos+ | CircularReference Text SourcePos+ | UndefinedToggle Text SourcePos+ | ParsingUnescaped Text SourcePos+ | CouldNotLoadIncludeFile Text SourcePos+ | CouldNotParseIncludeFile Text SourcePos+ | MacroAlreadyDefined Text SourcePos+ | InlineNotRendered Inline+ | BlockNotRendered Block+ | DocxParserWarning Text+ | PowerpointTemplateWarning Text+ | IgnoredIOError Text+ | CouldNotFetchResource Text Text+ | CouldNotDetermineImageSize Text Text+ | CouldNotConvertImage Text Text+ | CouldNotDetermineMimeType Text+ | CouldNotConvertTeXMath Text Text+ | CouldNotParseCSS Text+ | Fetching Text+ | Extracting Text+ | LoadedResource FilePath FilePath+ | ScriptingInfo Text (Maybe SourcePos)+ | ScriptingWarning Text (Maybe SourcePos)+ | NoTitleElement Text+ | NoLangSpecified+ | InvalidLang Text+ | CouldNotHighlight Text+ | MissingCharacter Text+ | Deprecated Text Text+ | NoTranslation Text+ | CouldNotLoadTranslations Text Text+ | UnusualConversion Text+ | UnexpectedXmlElement Text Text+ | UnknownOrgExportOption Text+ | CouldNotDeduceFormat [Text] Text+ | RunningFilter FilePath+ | FilterCompleted FilePath Integer+ | CiteprocWarning Text+ | ATXHeadingInLHS Int Text+ | EnvironmentVariableUndefined Text+ | DuplicateAttribute Text Text+ | NotUTF8Encoded FilePath+ | MakePDFInfo Text Text+ | MakePDFWarning Text+ | UnclosedDiv SourcePos SourcePos+ | UnsupportedCodePage Int+ | YamlWarning SourcePos Text+ | UnsupportedPdfStandard Text+ deriving (Show, Eq, Data, Ord, Typeable, Generic)++instance ToJSON LogMessage where+ toJSON x = object $+ "verbosity" .= toJSON (messageVerbosity x) :+ "type" .= toJSON (show $ toConstr x) :+ "pretty" .= toJSON (showLogMessage x) :+ case x of+ SkippedContent s pos ->+ ["contents" .= s,+ "source" .= sourceName pos,+ "line" .= sourceLine pos,+ "column" .= sourceColumn pos]+ IgnoredElement s ->+ ["contents" .= s]+ DuplicateLinkReference s pos ->+ ["contents" .= s,+ "source" .= sourceName pos,+ "line" .= toJSON (sourceLine pos),+ "column" .= toJSON (sourceColumn pos)]+ NoteDefinedButNotUsed s pos ->+ ["key" .= s,+ "source" .= sourceName pos,+ "line" .= toJSON (sourceLine pos),+ "column" .= toJSON (sourceColumn pos)]+ DuplicateNoteReference s pos ->+ ["contents" .= s,+ "source" .= sourceName pos,+ "line" .= toJSON (sourceLine pos),+ "column" .= toJSON (sourceColumn pos)]+ DuplicateIdentifier s pos ->+ ["contents" .= s,+ "source" .= sourceName pos,+ "line" .= toJSON (sourceLine pos),+ "column" .= toJSON (sourceColumn pos)]+ ReferenceNotFound s pos ->+ ["contents" .= s,+ "source" .= sourceName pos,+ "line" .= toJSON (sourceLine pos),+ "column" .= toJSON (sourceColumn pos)]+ CircularReference s pos ->+ ["contents" .= s,+ "source" .= sourceName pos,+ "line" .= toJSON (sourceLine pos),+ "column" .= toJSON (sourceColumn pos)]+ UndefinedToggle s pos ->+ ["contents" .= s,+ "source" .= sourceName pos,+ "line" .= toJSON (sourceLine pos),+ "column" .= toJSON (sourceColumn pos)]+ ParsingUnescaped s pos ->+ ["contents" .= s,+ "source" .= sourceName pos,+ "line" .= toJSON (sourceLine pos),+ "column" .= toJSON (sourceColumn pos)]+ CouldNotLoadIncludeFile fp pos ->+ ["path" .= fp,+ "source" .= sourceName pos,+ "line" .= toJSON (sourceLine pos),+ "column" .= toJSON (sourceColumn pos)]+ CouldNotParseIncludeFile fp pos ->+ ["path" .= fp,+ "source" .= sourceName pos,+ "line" .= toJSON (sourceLine pos),+ "column" .= toJSON (sourceColumn pos)]+ MacroAlreadyDefined name pos ->+ ["name" .= name,+ "source" .= sourceName pos,+ "line" .= toJSON (sourceLine pos),+ "column" .= toJSON (sourceColumn pos)]+ InlineNotRendered il ->+ ["contents" .= toJSON il]+ BlockNotRendered bl ->+ ["contents" .= toJSON bl]+ DocxParserWarning s ->+ ["contents" .= s]+ PowerpointTemplateWarning s ->+ ["contents" .= s]+ IgnoredIOError s ->+ ["contents" .= s]+ CouldNotFetchResource fp s ->+ ["path" .= fp,+ "message" .= s]+ CouldNotDetermineImageSize fp s ->+ ["path" .= fp,+ "message" .= s]+ CouldNotConvertImage fp s ->+ ["path" .= fp,+ "message" .= s]+ CouldNotDetermineMimeType fp ->+ ["path" .= fp]+ CouldNotConvertTeXMath s msg ->+ ["contents" .= s,+ "message" .= msg]+ CouldNotParseCSS msg ->+ ["message" .= msg]+ Fetching fp ->+ ["path" .= fp]+ Extracting fp ->+ ["path" .= fp]+ LoadedResource orig found ->+ ["for" .= orig+ ,"from" .= found]+ ScriptingInfo msg mbpos ->+ ["message" .= msg] <>+ case mbpos of+ Nothing -> []+ Just pos -> ["source" .= sourceName pos+ ,"line" .= toJSON (sourceLine pos)+ ,"column" .= toJSON (sourceColumn pos)+ ]+ ScriptingWarning msg mbpos ->+ ["message" .= msg] <>+ case mbpos of+ Nothing -> []+ Just pos -> ["source" .= sourceName pos+ ,"line" .= toJSON (sourceLine pos)+ ,"column" .= toJSON (sourceColumn pos)+ ]+ NoTitleElement fallback ->+ ["fallback" .= fallback]+ NoLangSpecified -> []+ InvalidLang s ->+ ["lang" .= s]+ CouldNotHighlight msg ->+ ["message" .= msg]+ MissingCharacter msg ->+ ["message" .= msg]+ Deprecated thing msg ->+ ["thing" .= thing,+ "message" .= msg]+ NoTranslation term ->+ ["term" .= term]+ CouldNotLoadTranslations lang msg ->+ ["lang" .= lang,+ "message" .= msg]+ UnusualConversion msg ->+ ["message" .= msg]+ UnexpectedXmlElement element parent ->+ ["element" .= element,+ "parent" .= parent]+ UnknownOrgExportOption option ->+ ["option" .= option]+ CouldNotDeduceFormat exts format ->+ ["extensions" .= exts+ ,"format" .= format]+ RunningFilter fp ->+ ["path" .= Text.pack fp ]+ FilterCompleted fp ms ->+ ["path" .= Text.pack fp+ ,"milliseconds" .= Text.pack (show ms) ]+ CiteprocWarning msg ->+ ["message" .= msg]+ ATXHeadingInLHS lvl contents ->+ ["level" .= lvl+ ,"contents" .= contents]+ EnvironmentVariableUndefined var ->+ ["variable" .= var ]+ DuplicateAttribute attr val ->+ ["attribute" .= attr+ ,"value" .= val]+ NotUTF8Encoded src ->+ ["source" .= src]+ MakePDFInfo description contents ->+ ["description" .= description+ ,"contents" .= contents]+ MakePDFWarning message ->+ ["message" .= message]+ UnclosedDiv openpos closepos ->+ ["openpos" .= object+ [ "source" .= sourceName openpos,+ "line" .= toJSON (sourceLine openpos),+ "column" .= toJSON (sourceColumn openpos)]+ ,"closepos" .= object+ [ "source" .= sourceName closepos,+ "line" .= toJSON (sourceLine closepos),+ "column" .= toJSON (sourceColumn closepos)]+ ]+ UnsupportedCodePage cpg ->+ ["codepage" .= cpg]+ YamlWarning pos msg ->+ [ "source" .= sourceName pos+ , "line" .= toJSON (sourceLine pos)+ , "column" .= toJSON (sourceColumn pos)+ , "message" .= msg+ ]+ UnsupportedPdfStandard s ->+ ["contents" .= s]++showPos :: SourcePos -> Text+showPos pos = Text.pack $ sn ++ "line " +++ show (sourceLine pos) ++ " column " ++ show (sourceColumn pos)+ where+ sn' = sourceName pos+ sn = if sn' == "source" || sn' == "" || sn' == "-"+ then ""+ else sn' ++ " "++encodeLogMessages :: [LogMessage] -> BL.ByteString+encodeLogMessages ms =+ encodePretty' defConfig{ confCompare =+ keyOrder [ "type", "verbosity", "contents", "message", "path",+ "source", "line", "column" ] } ms++showLogMessage :: LogMessage -> Text+showLogMessage msg =+ case msg of+ SkippedContent s pos ->+ "Skipped '" <> s <> "' at " <> showPos pos+ IgnoredElement s ->+ "Ignored element " <> s+ DuplicateLinkReference s pos ->+ "Duplicate link reference '" <> s <> "' at " <> showPos pos+ DuplicateNoteReference s pos ->+ "Duplicate note reference '" <> s <> "' at " <> showPos pos+ NoteDefinedButNotUsed s pos ->+ "Note with key '" <> s <> "' defined at " <> showPos pos <>+ " but not used."+ DuplicateIdentifier s pos ->+ "Duplicate identifier '" <> s <> "' at " <> showPos pos+ ReferenceNotFound s pos ->+ "Reference not found for '" <> s <> "' at " <> showPos pos+ CircularReference s pos ->+ "Circular reference '" <> s <> "' at " <> showPos pos+ UndefinedToggle s pos ->+ "Undefined toggle '" <> s <> "' at " <> showPos pos+ ParsingUnescaped s pos ->+ "Parsing unescaped '" <> s <> "' at " <> showPos pos+ CouldNotLoadIncludeFile fp pos ->+ "Could not load include file " <> fp <> " at " <> showPos pos+ CouldNotParseIncludeFile fp pos ->+ "Parsing include file " <> fp <> " failed at " <> showPos pos+ MacroAlreadyDefined name pos ->+ "Macro '" <> name <> "' already defined, ignoring at " <> showPos pos+ InlineNotRendered il ->+ "Not rendering " <> Text.pack (show il)+ BlockNotRendered bl ->+ "Not rendering " <> Text.pack (show bl)+ DocxParserWarning s ->+ "Docx parser warning: " <> s+ PowerpointTemplateWarning s ->+ "Powerpoint template warning: " <> s+ IgnoredIOError s ->+ "IO Error (ignored): " <> s+ CouldNotFetchResource fp s ->+ "Could not fetch resource " <> fp <>+ if Text.null s then "" else ": " <> s+ CouldNotDetermineImageSize fp s ->+ "Could not determine image size for " <> fp <>+ if Text.null s then "" else ": " <> s+ CouldNotConvertImage fp s ->+ "Could not convert image " <> fp <>+ if Text.null s then "" else ": " <> s+ CouldNotDetermineMimeType fp ->+ "Could not determine mime type for " <> fp+ CouldNotConvertTeXMath s m ->+ "Could not convert TeX math " <> s <> ", rendering as TeX" <>+ if Text.null m then "" else ":\n" <> m+ CouldNotParseCSS m ->+ "Could not parse CSS" <> if Text.null m then "" else ":\n" <> m+ Fetching fp ->+ "Fetching " <> fp <> "..."+ Extracting fp ->+ "Extracting " <> fp <> "..."+ LoadedResource orig found ->+ "Loaded " <> Text.pack orig <> " from " <> Text.pack found+ ScriptingInfo s mbpos ->+ "Scripting info" <>+ maybe "" (\pos -> " at " <> showPos pos) mbpos <> ": " <> s+ ScriptingWarning s mbpos ->+ "Scripting warning" <>+ maybe "" (\pos -> " at " <> showPos pos) mbpos <> ": " <> s+ NoTitleElement fallback ->+ "This document format requires a nonempty <title> element.\n" <>+ "Defaulting to '" <> fallback <> "' as the title.\n" <>+ "To specify a title, use --variable pagetitle=\"...\"."+ NoLangSpecified ->+ "No value for 'lang' was specified in the metadata.\n" <>+ "It is recommended that lang be specified for this format."+ InvalidLang s ->+ "Invalid 'lang' value '" <> s <> "'.\n" <>+ "Use an IETF language tag like 'en-US'."+ CouldNotHighlight m ->+ "Could not highlight code block:\n" <> m+ MissingCharacter m ->+ "Missing character: " <> m+ Deprecated t m ->+ "Deprecated: " <> t <>+ if Text.null m+ then ""+ else ". " <> m+ NoTranslation t ->+ "The term " <> t <> " has no translation defined."+ CouldNotLoadTranslations lang m ->+ "Could not load translations for " <> lang <>+ if Text.null m then "" else "\n" <> m+ UnusualConversion m ->+ "Unusual conversion: " <> m+ UnexpectedXmlElement element parent ->+ "Unexpected XML element " <> element <> " in " <> parent+ UnknownOrgExportOption option ->+ "Ignoring unknown Org export option: " <> option+ CouldNotDeduceFormat exts format ->+ "Could not deduce format from file extension " <>+ Text.intercalate " or " exts <> "\n" <>+ "Defaulting to " <> format+ RunningFilter fp -> "Running filter " <> Text.pack fp+ FilterCompleted fp ms -> "Completed filter " <> Text.pack fp <>+ " in " <> Text.pack (show ms) <> " ms"+ CiteprocWarning ms -> "Citeproc: " <> ms+ ATXHeadingInLHS lvl contents ->+ "Rendering heading '" <> contents <> "' as a paragraph.\n" <>+ "ATX headings cannot be used in literate Haskell, because " <>+ "'#' is not\nallowed in column 1." <>+ if lvl < 3+ then " Consider using --markdown-headings=setext."+ else ""+ EnvironmentVariableUndefined var ->+ "Undefined environment variable " <> var <> " in defaults file."+ DuplicateAttribute attr val ->+ "Ignoring duplicate attribute " <> attr <> "=" <> tshow val <> "."+ NotUTF8Encoded src ->+ Text.pack src <>+ " is not UTF-8 encoded: falling back to latin1."+ MakePDFInfo description contents ->+ "[makePDF] " <> description <>+ if Text.null contents+ then mempty+ else "\n" <> contents+ MakePDFWarning message -> "[makePDF] " <> message+ UnclosedDiv openpos closepos -> "Div at " <> showPos openpos <>+ " unclosed at " <> showPos closepos <> ", closing implicitly."+ UnsupportedCodePage cpg -> "Unsupported code page " <> tshow cpg <>+ ". Text will likely be garbled."+ YamlWarning pos m -> "YAML warning (" <> showPos pos <> "): " <> m+ UnsupportedPdfStandard s ->+ "PDF standard '" <> s <> "' is not supported by LaTeX and will be ignored."++messageVerbosity :: LogMessage -> Verbosity+messageVerbosity msg =+ case msg of+ SkippedContent{} -> INFO+ IgnoredElement{} -> INFO+ DuplicateLinkReference{} -> WARNING+ DuplicateNoteReference{} -> WARNING+ NoteDefinedButNotUsed{} -> WARNING+ DuplicateIdentifier{} -> WARNING+ ReferenceNotFound{} -> WARNING+ CircularReference{} -> WARNING+ UndefinedToggle{} -> WARNING+ CouldNotLoadIncludeFile f _+ | ".sty" `Text.isSuffixOf` f -> INFO+ | otherwise -> WARNING+ CouldNotParseIncludeFile{} -> WARNING+ MacroAlreadyDefined{} -> WARNING+ ParsingUnescaped{} -> INFO+ InlineNotRendered{} -> INFO+ BlockNotRendered{} -> INFO+ DocxParserWarning{} -> WARNING+ PowerpointTemplateWarning{} -> WARNING+ IgnoredIOError{} -> WARNING+ CouldNotFetchResource{} -> WARNING+ CouldNotDetermineImageSize{} -> WARNING+ CouldNotConvertImage{} -> WARNING+ CouldNotDetermineMimeType{} -> WARNING+ CouldNotConvertTeXMath{} -> WARNING+ CouldNotParseCSS{} -> WARNING+ Fetching{} -> INFO+ Extracting{} -> INFO+ LoadedResource{} -> INFO+ ScriptingInfo{} -> INFO+ ScriptingWarning{} -> WARNING+ NoTitleElement{} -> INFO+ NoLangSpecified -> INFO+ InvalidLang{} -> WARNING+ CouldNotHighlight{} -> WARNING+ MissingCharacter{} -> WARNING+ Deprecated{} -> WARNING+ NoTranslation{} -> WARNING+ CouldNotLoadTranslations{} -> WARNING+ UnusualConversion {} -> WARNING+ UnexpectedXmlElement {} -> WARNING+ UnknownOrgExportOption {} -> WARNING+ CouldNotDeduceFormat{} -> WARNING+ RunningFilter{} -> INFO+ FilterCompleted{} -> INFO+ CiteprocWarning{} -> WARNING+ ATXHeadingInLHS{} -> WARNING+ EnvironmentVariableUndefined{}-> WARNING+ DuplicateAttribute{} -> WARNING+ NotUTF8Encoded{} -> WARNING+ MakePDFInfo{} -> INFO+ MakePDFWarning{} -> WARNING+ UnclosedDiv{} -> WARNING+ UnsupportedCodePage{} -> WARNING+ YamlWarning{} -> WARNING+ UnsupportedPdfStandard{} -> WARNING
@@ -1,41 +1,32 @@-{--Copyright (C) 2011-2014 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--}-+{-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.MIME- Copyright : Copyright (C) 2011-2014 John MacFarlane+ Copyright : Copyright (C) 2011-2024 John MacFarlane License : GNU GPL, version 2 or above Maintainer : John MacFarlane <jgm@berkeley.edu> Stability : alpha Portability : portable -Mime type lookup for ODT writer.+Mime type lookup. -}-module Text.Pandoc.MIME ( MimeType, getMimeType, getMimeTypeDef,- extensionFromMimeType )where-import System.FilePath-import Data.Char ( toLower )+module Text.Pandoc.MIME (+ MimeType,+ getMimeType,+ getMimeTypeDef,+ getCharset,+ extensionFromMimeType,+ mediaCategory ) where import Data.List (isPrefixOf, isSuffixOf)-import Data.Maybe (fromMaybe) import qualified Data.Map as M+import qualified Data.Text as T+import qualified Data.Text.Encoding as T+import Data.Maybe (fromMaybe, listToMaybe)+import Data.Tuple (swap)+import qualified Network.Mime+import System.FilePath -type MimeType = String+type MimeType = T.Text -- | Determine mime type appropriate for file path. getMimeType :: FilePath -> Maybe MimeType@@ -46,55 +37,67 @@ | "Formula-" `isPrefixOf` fp && "/" `isSuffixOf` fp = Just "application/vnd.oasis.opendocument.formula" -- generic- | otherwise = M.lookup (map toLower $ drop 1 $ takeExtension fp) mimeTypes+ | otherwise = M.lookup (T.toLower $ T.drop 1 $ T.pack $ takeExtension fp) mimeTypes -- | Determime mime type appropriate for file path, defaulting to -- “application/octet-stream” if nothing else fits. getMimeTypeDef :: FilePath -> MimeType getMimeTypeDef = fromMaybe "application/octet-stream" . getMimeType -extensionFromMimeType :: MimeType -> Maybe String+extensionFromMimeType :: MimeType -> Maybe T.Text extensionFromMimeType mimetype =- M.lookup (takeWhile (/=';') mimetype) reverseMimeTypes -- note: we just look up the basic mime type, dropping the content-encoding etc.+ case T.takeWhile (/=';') mimetype of+ -- handle a few special cases, where there are multiple options:+ "text/plain" -> Just "txt"+ "video/quicktime" -> Just "mov"+ "video/mpeg" -> Just "mpeg"+ "video/dv" -> Just "dv"+ "image/vnd.djvu" -> Just "djvu"+ "image/tiff" -> Just "tiff"+ "image/jpeg" -> Just "jpg"+ "application/xml" -> Just "xml"+ "application/ogg" -> Just "ogg"+ "image/svg+xml" -> Just "svg" -- avoid svgz+ mt -> M.lookup mt reverseMimeTypes -reverseMimeTypes :: M.Map MimeType String-reverseMimeTypes = M.fromList $ map (\(k,v) -> (v,k)) mimeTypesList+-- | Determine general media category for file path, e.g.+--+-- prop> mediaCategory "foo.jpg" = Just "image"+mediaCategory :: FilePath -> Maybe T.Text+mediaCategory fp = getMimeType fp >>= listToMaybe . T.splitOn "/" -mimeTypes :: M.Map String MimeType+reverseMimeTypes :: M.Map MimeType T.Text+reverseMimeTypes = M.fromList $ map swap mimeTypesList++mimeTypes :: M.Map T.Text MimeType mimeTypes = M.fromList mimeTypesList -mimeTypesList :: [(String, MimeType)]-mimeTypesList = -- List borrowed from happstack-server.- [("gz","application/x-gzip")- ,("cabal","application/x-cabal")- ,("%","application/x-trash")+-- | Get the charset from a mime type, if one is present.+getCharset :: MimeType -> Maybe T.Text+getCharset mt =+ let (_,y) = T.breakOn "charset=" mt+ in if T.null y+ then Nothing+ else Just $ T.toUpper $ T.takeWhile (/= ';') $ T.drop 8 y++-- | Collection of common mime types.+-- Except for first entry, list borrowed from+-- <https://github.com/Happstack/happstack-server/blob/master/src/Happstack/Server/FileServe/BuildingBlocks.hs happstack-server>+mimeTypesList :: [(T.Text, MimeType)]+mimeTypesList = M.toList (M.map T.decodeUtf8 Network.Mime.defaultMimeMap) +++ [("%","application/x-trash") ,("323","text/h323")- ,("3gp","video/3gpp")- ,("7z","application/x-7z-compressed")- ,("abw","application/x-abiword")- ,("ai","application/postscript")- ,("aif","audio/x-aiff")- ,("aifc","audio/x-aiff")- ,("aiff","audio/x-aiff") ,("alc","chemical/x-alchemy")+ ,("apng","image/apng") ,("art","image/x-jg")- ,("asc","text/plain")- ,("asf","video/x-ms-asf") ,("asn","chemical/x-ncbi-asn1") ,("aso","chemical/x-ncbi-asn1-binary")- ,("asx","video/x-ms-asf")- ,("atom","application/atom")- ,("atomcat","application/atomcat+xml") ,("atomsrv","application/atomserv+xml")- ,("au","audio/basic")- ,("avi","video/x-msvideo")+ ,("avif", "image/avif") ,("b","chemical/x-molconn-Z") ,("bak","application/x-trash") ,("bat","application/x-msdos-program")- ,("bcpio","application/x-bcpio")- ,("bib","text/x-bibtex")- ,("bin","application/octet-stream") ,("bmp","image/x-ms-bmp") ,("boo","text/x-boo") ,("book","application/x-maker")@@ -102,88 +105,55 @@ ,("c","text/x-csrc") ,("c++","text/x-c++src") ,("c3d","chemical/x-chem3d")- ,("cab","application/x-cab")+ ,("cabal","application/x-cabal") ,("cac","chemical/x-cache") ,("cache","chemical/x-cache")- ,("cap","application/cap") ,("cascii","chemical/x-cactvs-binary")- ,("cat","application/vnd.ms-pki.seccat") ,("cbin","chemical/x-cactvs-binary")- ,("cbr","application/x-cbr") ,("cbz","application/x-cbz") ,("cc","text/x-c++src") ,("cdf","application/x-cdf") ,("cdr","image/x-coreldraw") ,("cdt","image/x-coreldrawtemplate")- ,("cdx","chemical/x-cdx")- ,("cdy","application/vnd.cinderella") ,("cef","chemical/x-cxf") ,("cer","chemical/x-cerius") ,("chm","chemical/x-chemdraw") ,("chrt","application/x-kchart")- ,("cif","chemical/x-cif")- ,("class","application/java-vm")- ,("cls","text/x-tex")- ,("cmdf","chemical/x-cmdf")- ,("cml","chemical/x-cml")- ,("cod","application/vnd.rim.cod") ,("com","application/x-msdos-program") ,("cpa","chemical/x-compass")- ,("cpio","application/x-cpio") ,("cpp","text/x-c++src")- ,("cpt","application/mac-compactpro")+ ,("cpt","image/x-corelphotopaint") ,("crl","application/x-pkcs7-crl")- ,("crt","application/x-x509-ca-cert") ,("csf","chemical/x-cache-csf")- ,("csh","application/x-csh") ,("csm","chemical/x-csml")- ,("csml","chemical/x-csml")- ,("css","text/css")- ,("csv","text/csv") ,("ctab","chemical/x-cactvs-binary") ,("ctx","chemical/x-ctx")- ,("cu","application/cu-seeme") ,("cub","chemical/x-gaussian-cube") ,("cxf","chemical/x-cxf") ,("cxx","text/x-c++src") ,("d","text/x-dsrc") ,("dat","chemical/x-mopac-input")- ,("dcr","application/x-director")- ,("deb","application/x-debian-package") ,("dif","video/dv") ,("diff","text/x-diff")- ,("dir","application/x-director")- ,("djv","image/vnd.djvu")- ,("djvu","image/vnd.djvu") ,("dl","video/dl") ,("dll","application/x-msdos-program")- ,("dmg","application/x-apple-diskimage") ,("dms","application/x-dms")- ,("doc","application/msword")- ,("dot","application/msword")- ,("dv","video/dv")- ,("dvi","application/x-dvi") ,("dx","chemical/x-jcamp-dx")- ,("dxr","application/x-director") ,("emb","chemical/x-embl-dl-nucleotide") ,("embl","chemical/x-embl-dl-nucleotide") ,("emf","image/x-emf")- ,("eml","message/rfc822") ,("ent","chemical/x-ncbi-asn1-ascii")- ,("eot","application/vnd.ms-fontobject")- ,("eps","application/postscript")- ,("etx","text/x-setext")- ,("exe","application/x-msdos-program")- ,("ez","application/andrew-inset")++ -- The type used in mime-types is `application/postscript`,+ -- but code in Text.Pandoc.PDF relies on the type being+ -- `application/eps`. Do not remove without updating that+ -- module.+ ,("eps","application/eps")+ ,("fb","application/x-maker") ,("fbdoc","application/x-maker") ,("fch","chemical/x-gaussian-checkpoint") ,("fchk","chemical/x-gaussian-checkpoint")- ,("fig","application/x-xfig")- ,("flac","application/x-flac")- ,("fli","video/fli")- ,("fm","application/x-maker")- ,("frame","application/x-maker") ,("frm","application/x-maker") ,("fs","text/plain") ,("gal","chemical/x-gaussian-log")@@ -194,161 +164,67 @@ ,("gcf","application/x-graphing-calculator") ,("gcg","chemical/x-gcg8-sequence") ,("gen","chemical/x-genbank")- ,("gf","application/x-tex-gf")- ,("gif","image/gif") ,("gjc","chemical/x-gaussian-input") ,("gjf","chemical/x-gaussian-input") ,("gl","video/gl")- ,("gnumeric","application/x-gnumeric")+ ,("glsl","text/plain") ,("gpt","chemical/x-mopac-graph")- ,("gsf","application/x-font") ,("gsm","audio/x-gsm")- ,("gtar","application/x-gtar") ,("h","text/x-chdr") ,("h++","text/x-c++hdr")- ,("hdf","application/x-hdf") ,("hh","text/x-c++hdr") ,("hin","chemical/x-hin") ,("hpp","text/x-c++hdr")- ,("hqx","application/mac-binhex40") ,("hs","text/x-haskell") ,("hta","application/hta")- ,("htc","text/x-component")- ,("htm","text/html")- ,("html","text/html") ,("hxx","text/x-c++hdr") ,("ica","application/x-ica")- ,("ice","x-conference/x-cooltalk")- ,("ico","image/x-icon")- ,("ics","text/calendar") ,("icz","text/calendar")- ,("ief","image/ief")- ,("iges","model/iges")- ,("igs","model/iges") ,("iii","application/x-iphone") ,("inp","chemical/x-gamess-input") ,("ins","application/x-internet-signup")- ,("iso","application/x-iso9660-image") ,("isp","application/x-internet-signup") ,("ist","chemical/x-isostar") ,("istr","chemical/x-isostar")- ,("jad","text/vnd.sun.j2me.app-descriptor")- ,("jar","application/java-archive")- ,("java","text/x-java") ,("jdx","chemical/x-jcamp-dx")- ,("jmz","application/x-jmol")- ,("jng","image/x-jng")- ,("jnlp","application/x-java-jnlp-file")- ,("jpe","image/jpeg")- ,("jpeg","image/jpeg") ,("jfif","image/jpeg")- ,("jpg","image/jpeg")- ,("js","application/x-javascript")- ,("kar","audio/midi")+ ,("jxl","image/jxl")+ ,("jmz","application/x-jmol") ,("key","application/pgp-keys") ,("kil","application/x-killustrator") ,("kin","chemical/x-kinemage")- ,("kml","application/vnd.google-earth.kml+xml")- ,("kmz","application/vnd.google-earth.kmz")- ,("kpr","application/x-kpresenter")- ,("kpt","application/x-kpresenter")- ,("ksp","application/x-kspread")- ,("kwd","application/x-kword")- ,("kwt","application/x-kword")- ,("latex","application/x-latex")- ,("lha","application/x-lha") ,("lhs","text/x-literate-haskell") ,("lsf","video/x-la-asf") ,("lsx","video/x-la-asf")- ,("ltx","text/x-tex") ,("lyx","application/x-lyx") ,("lzh","application/x-lzh") ,("lzx","application/x-lzx")- ,("m3u","audio/mpegurl")- ,("m4a","audio/mpeg")- ,("m4v","video/x-m4v")- ,("maker","application/x-maker") ,("man","application/x-troff-man") ,("mcif","chemical/x-mmcif") ,("mcm","chemical/x-macmolecule") ,("mdb","application/msaccess") ,("me","application/x-troff-me")- ,("mesh","model/mesh")- ,("mid","audio/midi")- ,("midi","audio/midi")- ,("mif","application/x-mif") ,("mm","application/x-freemind") ,("mmd","chemical/x-macromodel-input")- ,("mmf","application/vnd.smaf")- ,("mml","text/mathml") ,("mmod","chemical/x-macromodel-input")- ,("mng","video/x-mng") ,("moc","text/x-moc") ,("mol","chemical/x-mdl-molfile") ,("mol2","chemical/x-mol2") ,("moo","chemical/x-mopac-out") ,("mop","chemical/x-mopac-input") ,("mopcrt","chemical/x-mopac-input")- ,("mov","video/quicktime")- ,("movie","video/x-sgi-movie")- ,("mp2","audio/mpeg")- ,("mp3","audio/mpeg")- ,("mp4","video/mp4") ,("mpc","chemical/x-mopac-input")- ,("mpe","video/mpeg")- ,("mpeg","video/mpeg") ,("mpega","audio/mpeg")- ,("mpg","video/mpeg")- ,("mpga","audio/mpeg") ,("ms","application/x-troff-ms")- ,("msh","model/mesh") ,("msi","application/x-msi") ,("mvb","chemical/x-mopac-vib")- ,("mxu","video/vnd.mpegurl")- ,("nb","application/mathematica")- ,("nc","application/x-netcdf") ,("nwc","application/x-nwc") ,("o","application/x-object")- ,("oda","application/oda")- ,("odb","application/vnd.oasis.opendocument.database")- ,("odc","application/vnd.oasis.opendocument.chart")- ,("odf","application/vnd.oasis.opendocument.formula")- ,("odg","application/vnd.oasis.opendocument.graphics")- ,("odi","application/vnd.oasis.opendocument.image")- ,("odm","application/vnd.oasis.opendocument.text-master")- ,("odp","application/vnd.oasis.opendocument.presentation")- ,("ods","application/vnd.oasis.opendocument.spreadsheet")- ,("odt","application/vnd.oasis.opendocument.text")- ,("oga","audio/ogg")- ,("ogg","application/ogg")- ,("ogv","video/ogg")- ,("ogx","application/ogg") ,("old","application/x-trash")- ,("otg","application/vnd.oasis.opendocument.graphics-template")- ,("oth","application/vnd.oasis.opendocument.text-web")- ,("otp","application/vnd.oasis.opendocument.presentation-template")- ,("ots","application/vnd.oasis.opendocument.spreadsheet-template")- ,("otf","application/x-font-opentype")- ,("ott","application/vnd.oasis.opendocument.text-template") ,("oza","application/x-oz-application")- ,("p","text/x-pascal")- ,("p7r","application/x-pkcs7-certreqresp")- ,("pac","application/x-ns-proxy-autoconfig")- ,("pas","text/x-pascal") ,("pat","image/x-coreldrawpattern") ,("patch","text/x-diff")- ,("pbm","image/x-portable-bitmap")- ,("pcap","application/cap")- ,("pcf","application/x-font")- ,("pcf.Z","application/x-font")- ,("pcx","image/pcx") ,("pdb","chemical/x-pdb")- ,("pdf","application/pdf")- ,("pfa","application/x-font")- ,("pfb","application/x-font")- ,("pgm","image/x-portable-graymap")- ,("pgn","application/x-chess-pgn")- ,("pgp","application/pgp-signature") ,("php","application/x-httpd-php") ,("php3","application/x-httpd-php3") ,("php3p","application/x-httpd-php3-preprocessed")@@ -357,167 +233,46 @@ ,("pht","application/x-httpd-php") ,("phtml","application/x-httpd-php") ,("pk","application/x-tex-pk")- ,("pl","text/x-perl") ,("pls","audio/x-scpls")- ,("pm","text/x-perl")- ,("png","image/png")- ,("pnm","image/x-portable-anymap") ,("pot","text/plain")- ,("ppm","image/x-portable-pixmap")- ,("pps","application/vnd.ms-powerpoint")- ,("ppt","application/vnd.ms-powerpoint")- ,("prf","application/pics-rules") ,("prt","chemical/x-ncbi-asn1-ascii")- ,("ps","application/postscript")- ,("psd","image/x-photoshop") ,("py","text/x-python") ,("pyc","application/x-python-code") ,("pyo","application/x-python-code")- ,("qt","video/quicktime") ,("qtl","application/x-quicktimeplayer")- ,("ra","audio/x-pn-realaudio")- ,("ram","audio/x-pn-realaudio")- ,("rar","application/rar")- ,("ras","image/x-cmu-raster") ,("rd","chemical/x-mdl-rdfile")- ,("rdf","application/rdf+xml")- ,("rgb","image/x-rgb") ,("rhtml","application/x-httpd-eruby") ,("rm","audio/x-pn-realaudio")- ,("roff","application/x-troff") ,("ros","chemical/x-rosdal")- ,("rpm","application/x-redhat-package-manager")- ,("rss","application/rss+xml")- ,("rtf","application/rtf")- ,("rtx","text/richtext") ,("rxn","chemical/x-mdl-rxnfile") ,("sct","text/scriptlet") ,("sd","chemical/x-mdl-sdfile") ,("sd2","audio/x-sd2")- ,("sda","application/vnd.stardivision.draw")- ,("sdc","application/vnd.stardivision.calc")- ,("sdd","application/vnd.stardivision.impress") ,("sdf","application/vnd.stardivision.math") ,("sds","application/vnd.stardivision.chart")- ,("sdw","application/vnd.stardivision.writer")- ,("ser","application/java-serialized-object") ,("sgf","application/x-go-sgf")- ,("sgl","application/vnd.stardivision.writer-global")- ,("sh","application/x-sh")- ,("shar","application/x-shar")- ,("shtml","text/html") ,("sid","audio/prs.sid") ,("sik","application/x-trash")- ,("silo","model/mesh")- ,("sis","application/vnd.symbian.install")- ,("sisx","x-epoc/x-sisx-app")- ,("sit","application/x-stuffit")- ,("sitx","application/x-stuffit")- ,("skd","application/x-koan")- ,("skm","application/x-koan")- ,("skp","application/x-koan")- ,("skt","application/x-koan")- ,("smi","application/smil")- ,("smil","application/smil")- ,("snd","audio/basic") ,("spc","chemical/x-galactic-spc")- ,("spl","application/futuresplash")- ,("spx","audio/ogg")- ,("src","application/x-wais-source")- ,("stc","application/vnd.sun.xml.calc.template")- ,("std","application/vnd.sun.xml.draw.template")- ,("sti","application/vnd.sun.xml.impress.template")- ,("stl","application/vnd.ms-pki.stl")- ,("stw","application/vnd.sun.xml.writer.template")- ,("sty","text/x-tex")- ,("sv4cpio","application/x-sv4cpio")- ,("sv4crc","application/x-sv4crc")- ,("svg","image/svg+xml")- ,("svgz","image/svg+xml") ,("sw","chemical/x-swissprot")- ,("swf","application/x-shockwave-flash") ,("swfl","application/x-shockwave-flash")- ,("sxc","application/vnd.sun.xml.calc")- ,("sxd","application/vnd.sun.xml.draw")- ,("sxg","application/vnd.sun.xml.writer.global")- ,("sxi","application/vnd.sun.xml.impress")- ,("sxm","application/vnd.sun.xml.math")- ,("sxw","application/vnd.sun.xml.writer")- ,("t","application/x-troff")- ,("tar","application/x-tar") ,("taz","application/x-gtar")- ,("tcl","application/x-tcl")- ,("tex","text/x-tex")- ,("texi","application/x-texinfo")- ,("texinfo","application/x-texinfo")- ,("text","text/plain") ,("tgf","chemical/x-mdl-tgf")- ,("tgz","application/x-gtar")- ,("tif","image/tiff")- ,("tiff","image/tiff")- ,("tk","text/x-tcl") ,("tm","text/texmacs")- ,("torrent","application/x-bittorrent")- ,("tr","application/x-troff") ,("ts","text/texmacs") ,("tsp","application/dsptype")- ,("tsv","text/tab-separated-values")- ,("ttf","application/x-font-truetype")- ,("txt","text/plain")- ,("udeb","application/x-debian-package")- ,("uls","text/iuls")- ,("ustar","application/x-ustar") ,("val","chemical/x-ncbi-asn1-binary")- ,("vcd","application/x-cdlink")- ,("vcf","text/x-vcard")- ,("vcs","text/x-vcalendar") ,("vmd","chemical/x-vmd") ,("vms","chemical/x-vamas-iso14976") ,("vrm","x-world/x-vrml")- ,("vrml","model/vrml") ,("vs","text/plain")- ,("vsd","application/vnd.visio")- ,("wad","application/x-doom")- ,("wav","audio/x-wav")- ,("wax","audio/x-ms-wax")- ,("wbmp","image/vnd.wap.wbmp")- ,("wbxml","application/vnd.wap.wbxml")- ,("webm","video/webm") ,("wk","application/x-123")- ,("wm","video/x-ms-wm")- ,("wma","audio/x-ms-wma")- ,("wmd","application/x-ms-wmd") ,("wmf","image/x-wmf")- ,("wml","text/vnd.wap.wml")- ,("wmlc","application/vnd.wap.wmlc")- ,("wmls","text/vnd.wap.wmlscript")- ,("wmlsc","application/vnd.wap.wmlscriptc")- ,("wmv","video/x-ms-wmv")- ,("wmx","video/x-ms-wmx") ,("wmz","application/x-ms-wmz")- ,("woff","application/x-font-woff") ,("wp5","application/wordperfect5.1")- ,("wpd","application/wordperfect")- ,("wrl","model/vrml") ,("wsc","text/scriptlet")- ,("wvx","video/x-ms-wvx") ,("wz","application/x-wingz")- ,("xbm","image/x-xbitmap")- ,("xcf","application/x-xcf")- ,("xht","application/xhtml+xml")- ,("xhtml","application/xhtml+xml") ,("xlb","application/vnd.ms-excel")- ,("xls","application/vnd.ms-excel")- ,("xlt","application/vnd.ms-excel")- ,("xml","application/xml")- ,("xpi","application/x-xpinstall")- ,("xpm","image/x-xpixmap")- ,("xsl","application/xml") ,("xtel","chemical/x-xtel")- ,("xul","application/vnd.mozilla.xul+xml")- ,("xwd","image/x-xwindowdump")- ,("xyz","chemical/x-xyz")- ,("zip","application/zip") ,("zmt","chemical/x-mopac-input") ]-
@@ -1,25 +1,10 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}-{--Copyright (C) 2014 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.MediaBag- Copyright : Copyright (C) 2014 John MacFarlane+ Copyright : Copyright (C) 2014-2015, 2017-2024 John MacFarlane License : GNU GPL, version 2 or above Maintainer : John MacFarlane <jgm@berkeley.edu>@@ -30,33 +15,63 @@ interface for interacting with it. -} module Text.Pandoc.MediaBag (+ MediaItem(..), MediaBag,+ deleteMedia, lookupMedia, insertMedia, mediaDirectory,- extractMediaBag+ mediaItems ) where-import System.FilePath-import System.Directory (createDirectoryIfMissing)-import qualified Data.Map as M+import Crypto.Hash (hashWith, SHA1(SHA1)) import qualified Data.ByteString.Lazy as BL-import Data.Monoid (Monoid)-import Control.Monad (when)-import Text.Pandoc.MIME (MimeType, getMimeTypeDef)-import qualified Text.Pandoc.UTF8 as UTF8-import Data.Maybe (fromMaybe)-import System.IO (stderr)+import Data.Data (Data)+import qualified Data.Map as M+import Data.Maybe (fromMaybe, isNothing)+import Data.Typeable (Typeable)+import System.FilePath+import qualified System.FilePath.Posix as Posix+import qualified System.FilePath.Windows as Windows+import Text.Pandoc.MIME (MimeType, getMimeTypeDef, extensionFromMimeType)+import Data.Text (Text)+import qualified Data.Text as T+import Network.URI (URI (..), isURI, parseURI, unEscapeString)+import Data.List (isInfixOf) +data MediaItem =+ MediaItem+ { mediaMimeType :: MimeType+ , mediaPath :: FilePath+ , mediaContents :: BL.ByteString+ } deriving (Eq, Ord, Show, Data, Typeable)+ -- | A container for a collection of binary resources, with names and -- mime types. Note that a 'MediaBag' is a Monoid, so 'mempty' -- can be used for an empty 'MediaBag', and '<>' can be used to append -- two 'MediaBag's.-newtype MediaBag = MediaBag (M.Map String (MimeType, BL.ByteString))- deriving (Monoid)+newtype MediaBag = MediaBag (M.Map Text MediaItem)+ deriving (Semigroup, Monoid, Data, Typeable) instance Show MediaBag where show bag = "MediaBag " ++ show (mediaDirectory bag) +-- | We represent paths with /, in normalized form. Percent-encoding+-- is not resolved.+canonicalize :: FilePath -> Text+-- avoid an expensive call to isURI for data URIs:+canonicalize fp@('d':'a':'t':'a':':':_) = T.pack fp+canonicalize fp+ | isURI fp = T.pack fp+ | otherwise = T.replace "\\" "/" . T.pack . normalise $ fp++-- | Delete a media item from a 'MediaBag', or do nothing if no item corresponds+-- to the given path.+deleteMedia :: FilePath -- ^ relative path and canonical name of resource+ -> MediaBag+ -> MediaBag+deleteMedia fp (MediaBag mediamap) =+ MediaBag $ M.delete (canonicalize fp) mediamap+ -- | Insert a media item into a 'MediaBag', replacing any existing -- value with the same name. insertMedia :: FilePath -- ^ relative path and canonical name of resource@@ -64,44 +79,54 @@ -> BL.ByteString -- ^ contents of resource -> MediaBag -> MediaBag-insertMedia fp mbMime contents (MediaBag mediamap) =- MediaBag (M.insert fp (mime, contents) mediamap)- where mime = fromMaybe fallback mbMime- fallback = case takeExtension fp of- ".gz" -> getMimeTypeDef $ dropExtension fp- _ -> getMimeTypeDef fp+insertMedia fp mbMime contents (MediaBag mediamap)+ | 'd':'a':'t':'a':':':_ <- fp+ , Just mt' <- mbMime+ = MediaBag (M.insert fp'+ MediaItem{ mediaPath = hashpath+ , mediaContents = contents+ , mediaMimeType = mt' } mediamap)+ | otherwise = MediaBag (M.insert fp' mediaItem mediamap)+ where+ mediaItem = MediaItem{ mediaPath = newpath+ , mediaContents = contents+ , mediaMimeType = mt }+ fp' = canonicalize fp+ fp'' = unEscapeString $ T.unpack fp'+ uri = parseURI fp+ hashpath = show (hashWith SHA1 (BL.toStrict contents)) <> ext+ newpath = if Posix.isRelative fp''+ && Windows.isRelative fp''+ && isNothing uri+ && not (".." `isInfixOf` fp'')+ && '%' `notElem` fp''+ then fp''+ else hashpath+ fallback = case takeExtension fp'' of+ ".gz" -> getMimeTypeDef $ dropExtension fp''+ _ -> getMimeTypeDef fp''+ mt = fromMaybe fallback mbMime+ path = maybe fp'' (unEscapeString . uriPath) uri+ ext = case extensionFromMimeType mt of+ Just e -> '.':T.unpack e+ Nothing -> case takeExtension path of+ '.':e | '%' `notElem` e -> '.':e+ _ -> "" -- | Lookup a media item in a 'MediaBag', returning mime type and contents. lookupMedia :: FilePath -> MediaBag- -> Maybe (MimeType, BL.ByteString)-lookupMedia fp (MediaBag mediamap) = M.lookup fp mediamap+ -> Maybe MediaItem+lookupMedia fp (MediaBag mediamap) = M.lookup (canonicalize fp) mediamap -- | Get a list of the file paths stored in a 'MediaBag', with -- their corresponding mime types and the lengths in bytes of the contents.-mediaDirectory :: MediaBag -> [(String, MimeType, Int)]-mediaDirectory (MediaBag mediamap) =- M.foldWithKey (\fp (mime,contents) ->- ((fp, mime, fromIntegral $ BL.length contents):)) [] mediamap---- | Extract contents of MediaBag to a given directory. Print informational--- messages if 'verbose' is true.-extractMediaBag :: Bool- -> FilePath- -> MediaBag- -> IO ()-extractMediaBag verbose dir (MediaBag mediamap) = do- sequence_ $ M.foldWithKey- (\fp (_ ,contents) ->- ((writeMedia verbose dir (fp, contents)):)) [] mediamap--writeMedia :: Bool -> FilePath -> (FilePath, BL.ByteString) -> IO ()-writeMedia verbose dir (subpath, bs) = do- -- we join and split to convert a/b/c to a\b\c on Windows;- -- in zip containers all paths use /- let fullpath = dir </> normalise subpath- createDirectoryIfMissing True $ takeDirectory fullpath- when verbose $ UTF8.hPutStrLn stderr $ "pandoc: extracting " ++ fullpath- BL.writeFile fullpath bs-+mediaDirectory :: MediaBag -> [(FilePath, MimeType, Int)]+mediaDirectory mediabag =+ map (\(fp, mt, bs) -> (fp, mt, fromIntegral (BL.length bs)))+ (mediaItems mediabag) +mediaItems :: MediaBag -> [(FilePath, MimeType, BL.ByteString)]+mediaItems (MediaBag mediamap) =+ map (\item -> (mediaPath item, mediaMimeType item, mediaContents item))+ (M.elems mediamap)
@@ -1,24 +1,13 @@-{--Copyright (C) 2012-2014 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--}-+{-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE TemplateHaskell #-} {- | Module : Text.Pandoc.Options- Copyright : Copyright (C) 2012-2014 John MacFarlane+ Copyright : Copyright (C) 2012-2024 John MacFarlane License : GNU GPL, version 2 or above Maintainer : John MacFarlane <jgm@berkeley.edu>@@ -28,242 +17,220 @@ Data structures and functions for representing parser and writer options. -}-module Text.Pandoc.Options ( Extension(..)- , pandocExtensions- , strictExtensions- , phpMarkdownExtraExtensions- , githubMarkdownExtensions- , multimarkdownExtensions+module Text.Pandoc.Options ( module Text.Pandoc.Extensions , ReaderOptions(..) , HTMLMathMethod (..) , CiteMethod (..) , ObfuscationMethod (..)+ , HighlightMethod (..)+ , pattern NoHighlightingString+ , pattern DefaultHighlightingString+ , pattern IdiomaticHighlightingString , HTMLSlideVariant (..) , EPUBVersion (..)+ , WrapOption (..)+ , TopLevelDivision (..) , WriterOptions (..) , TrackChanges (..)+ , ReferenceLocation (..)+ , CaptionPosition (..) , def , isEnabled+ , defaultMathJaxURL+ , defaultWebTeXURL+ , defaultKaTeXURL ) where-import Data.Set (Set)-import qualified Data.Set as Set+import Control.Applicative ((<|>))+import Data.Maybe (fromMaybe)+import Data.Data (Data) import Data.Default-import Text.Pandoc.Highlighting (Style, pygments)-import Text.Pandoc.MediaBag (MediaBag)-import Data.Monoid---- | Individually selectable syntax extensions.-data Extension =- Ext_footnotes -- ^ Pandoc/PHP/MMD style footnotes- | Ext_inline_notes -- ^ Pandoc-style inline notes- | Ext_pandoc_title_block -- ^ Pandoc title block- | Ext_yaml_metadata_block -- ^ YAML metadata block- | Ext_mmd_title_block -- ^ Multimarkdown metadata block- | Ext_table_captions -- ^ Pandoc-style table captions- | Ext_implicit_figures -- ^ A paragraph with just an image is a figure- | Ext_simple_tables -- ^ Pandoc-style simple tables- | Ext_multiline_tables -- ^ Pandoc-style multiline tables- | Ext_grid_tables -- ^ Grid tables (pandoc, reST)- | Ext_pipe_tables -- ^ Pipe tables (as in PHP markdown extra)- | Ext_citations -- ^ Pandoc/citeproc citations- | Ext_raw_tex -- ^ Allow raw TeX (other than math)- | Ext_raw_html -- ^ Allow raw HTML- | Ext_tex_math_dollars -- ^ TeX math between $..$ or $$..$$- | Ext_tex_math_single_backslash -- ^ TeX math btw \(..\) \[..\]- | Ext_tex_math_double_backslash -- ^ TeX math btw \\(..\\) \\[..\\]- | Ext_latex_macros -- ^ Parse LaTeX macro definitions (for math only)- | Ext_fenced_code_blocks -- ^ Parse fenced code blocks- | Ext_fenced_code_attributes -- ^ Allow attributes on fenced code blocks- | Ext_backtick_code_blocks -- ^ Github style ``` code blocks- | Ext_inline_code_attributes -- ^ Allow attributes on inline code- | Ext_markdown_in_html_blocks -- ^ Interpret as markdown inside HTML blocks- | Ext_native_divs -- ^ Use Div blocks for contents of <div> tags- | Ext_native_spans -- ^ Use Span inlines for contents of <span>- | Ext_markdown_attribute -- ^ Interpret text inside HTML as markdown- -- iff container has attribute 'markdown'- | Ext_escaped_line_breaks -- ^ Treat a backslash at EOL as linebreak- | Ext_link_attributes -- ^ MMD style reference link attributes- | Ext_autolink_bare_uris -- ^ Make all absolute URIs into links- | Ext_fancy_lists -- ^ Enable fancy list numbers and delimiters- | Ext_lists_without_preceding_blankline -- ^ Allow lists without preceding blank- | Ext_startnum -- ^ Make start number of ordered list significant- | Ext_definition_lists -- ^ Definition lists as in pandoc, mmd, php- | Ext_compact_definition_lists -- ^ Definition lists without- -- space between items, and disallow laziness- | Ext_example_lists -- ^ Markdown-style numbered examples- | Ext_all_symbols_escapable -- ^ Make all non-alphanumerics escapable- | Ext_intraword_underscores -- ^ Treat underscore inside word as literal- | Ext_blank_before_blockquote -- ^ Require blank line before a blockquote- | Ext_blank_before_header -- ^ Require blank line before a header- | Ext_strikeout -- ^ Strikeout using ~~this~~ syntax- | Ext_superscript -- ^ Superscript using ^this^ syntax- | Ext_subscript -- ^ Subscript using ~this~ syntax- | Ext_hard_line_breaks -- ^ All newlines become hard line breaks- | Ext_ignore_line_breaks -- ^ Newlines in paragraphs are ignored- | Ext_literate_haskell -- ^ Enable literate Haskell conventions- | Ext_abbreviations -- ^ PHP markdown extra abbreviation definitions- | 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}- | Ext_mmd_header_identifiers -- ^ Multimarkdown style header identifiers [myid]- | Ext_implicit_header_references -- ^ Implicit reference links for headers- | Ext_line_blocks -- ^ RST style line blocks- | Ext_epub_html_exts -- ^ Recognise the EPUB extended version of HTML- deriving (Show, Read, Enum, Eq, Ord, Bounded)--pandocExtensions :: Set Extension-pandocExtensions = Set.fromList- [ Ext_footnotes- , Ext_inline_notes- , Ext_pandoc_title_block- , Ext_yaml_metadata_block- , Ext_table_captions- , Ext_implicit_figures- , Ext_simple_tables- , Ext_multiline_tables- , Ext_grid_tables- , Ext_pipe_tables- , Ext_citations- , Ext_raw_tex- , Ext_raw_html- , Ext_tex_math_dollars- , Ext_latex_macros- , Ext_fenced_code_blocks- , Ext_fenced_code_attributes- , Ext_backtick_code_blocks- , Ext_inline_code_attributes- , Ext_markdown_in_html_blocks- , Ext_native_divs- , Ext_native_spans- , Ext_escaped_line_breaks- , Ext_fancy_lists- , Ext_startnum- , Ext_definition_lists- , Ext_example_lists- , Ext_all_symbols_escapable- , Ext_intraword_underscores- , Ext_blank_before_blockquote- , Ext_blank_before_header- , Ext_strikeout- , Ext_superscript- , Ext_subscript- , Ext_auto_identifiers- , Ext_header_attributes- , Ext_implicit_header_references- , Ext_line_blocks- ]--phpMarkdownExtraExtensions :: Set Extension-phpMarkdownExtraExtensions = Set.fromList- [ Ext_footnotes- , Ext_pipe_tables- , Ext_raw_html- , Ext_markdown_attribute- , Ext_fenced_code_blocks- , Ext_definition_lists- , Ext_intraword_underscores- , Ext_header_attributes- , Ext_abbreviations- ]--githubMarkdownExtensions :: Set Extension-githubMarkdownExtensions = Set.fromList- [ Ext_pipe_tables- , Ext_raw_html- , Ext_tex_math_single_backslash- , Ext_fenced_code_blocks- , Ext_auto_identifiers- , Ext_ascii_identifiers- , Ext_backtick_code_blocks- , Ext_autolink_bare_uris- , Ext_intraword_underscores- , Ext_strikeout- , Ext_hard_line_breaks- , Ext_lists_without_preceding_blankline- ]--multimarkdownExtensions :: Set Extension-multimarkdownExtensions = Set.fromList- [ Ext_pipe_tables- , Ext_raw_html- , Ext_markdown_attribute- , Ext_link_attributes- , Ext_raw_tex- , Ext_tex_math_double_backslash- , Ext_intraword_underscores- , Ext_mmd_title_block- , Ext_footnotes- , Ext_definition_lists- , Ext_all_symbols_escapable- , Ext_implicit_header_references- , Ext_auto_identifiers- , Ext_mmd_header_identifiers- ]+import Data.Char (toLower)+import Data.Text (Text)+import qualified Data.Set as Set+import qualified Data.Text as T+import Data.Typeable (Typeable)+import GHC.Generics (Generic)+import Skylighting (SyntaxMap, defaultSyntaxMap)+import Text.DocTemplates (Context(..), Template)+import Text.Pandoc.Extensions+import Text.Pandoc.Chunks (PathTemplate)+import Text.Pandoc.Highlighting (Style)+import Text.Pandoc.UTF8 (toStringLazy)+import Data.Aeson.TH (deriveJSON)+import Data.Aeson -strictExtensions :: Set Extension-strictExtensions = Set.fromList- [ Ext_raw_html ]+class HasSyntaxExtensions a where+ getExtensions :: a -> Extensions data ReaderOptions = ReaderOptions{- readerExtensions :: Set Extension -- ^ Syntax extensions- , readerSmart :: Bool -- ^ Smart punctuation- , readerStandalone :: Bool -- ^ Standalone document with header- , readerParseRaw :: Bool -- ^ Parse raw HTML, LaTeX- , readerColumns :: Int -- ^ Number of columns in terminal- , readerTabStop :: Int -- ^ Tab stop- , readerOldDashes :: Bool -- ^ Use pandoc <= 1.8.2.1 behavior- -- in parsing dashes; -- is em-dash;- -- - before numerial is en-dash- , readerApplyMacros :: Bool -- ^ Apply macros to TeX math- , readerIndentedCodeClasses :: [String] -- ^ Default classes for+ readerExtensions :: Extensions -- ^ Syntax extensions+ , readerStandalone :: Bool -- ^ Standalone document with header+ , readerColumns :: Int -- ^ Number of columns in terminal+ , readerTabStop :: Int -- ^ Tab stop+ , readerIndentedCodeClasses :: [Text] -- ^ Default classes for -- indented code blocks- , readerDefaultImageExtension :: String -- ^ Default extension for images- , readerTrace :: Bool -- ^ Print debugging info- , readerTrackChanges :: TrackChanges-} deriving (Show, Read)+ , readerAbbreviations :: Set.Set Text -- ^ Strings to treat as abbreviations+ , readerDefaultImageExtension :: Text -- ^ Default extension for images+ , readerTrackChanges :: TrackChanges -- ^ Track changes setting for docx+ , readerStripComments :: Bool -- ^ Strip HTML comments instead of parsing as raw HTML+ -- (only implemented in commonmark)+ , readerTypstInputs :: [(Text, Text)] -- ^ parameters specified using --typst-input+} deriving (Show, Read, Data, Typeable, Generic) +instance HasSyntaxExtensions ReaderOptions where+ getExtensions opts = readerExtensions opts+ instance Default ReaderOptions where def = ReaderOptions{- readerExtensions = pandocExtensions- , readerSmart = False+ readerExtensions = emptyExtensions , readerStandalone = False- , readerParseRaw = False , readerColumns = 80 , readerTabStop = 4- , readerOldDashes = False- , readerApplyMacros = True , readerIndentedCodeClasses = []+ , readerAbbreviations = defaultAbbrevs , readerDefaultImageExtension = ""- , readerTrace = False , readerTrackChanges = AcceptChanges+ , readerStripComments = False+ , readerTypstInputs = [] } +defaultAbbrevs :: Set.Set Text+defaultAbbrevs = Set.fromList+ [ "Mr.", "Mrs.", "Ms.", "Capt.", "Dr.", "Prof.",+ "Gen.", "Gov.", "e.g.", "i.e.", "Sgt.", "St.",+ "vol.", "vs.", "Sen.", "Rep.", "Pres.", "Hon.",+ "Rev.", "Ph.D.", "M.D.", "M.A.", "p.", "pp.",+ "ch.", "sec.", "cf.", "cp."]+ -- -- Writer options -- -data EPUBVersion = EPUB2 | EPUB3 deriving (Eq, Show, Read)+data EPUBVersion = EPUB2 | EPUB3 deriving (Eq, Show, Read, Data, Typeable, Generic) data HTMLMathMethod = PlainMath- | LaTeXMathML (Maybe String) -- url of LaTeXMathML.js- | JsMath (Maybe String) -- url of jsMath load script+ | WebTeX Text -- url of TeX->image script. | GladTeX- | WebTeX String -- url of TeX->image script.- | MathML (Maybe String) -- url of MathMLinHTML.js- | MathJax String -- url of MathJax.js- deriving (Show, Read, Eq)+ | MathML+ | MathJax Text -- url of MathJax.js+ | KaTeX Text -- url of KaTeX files+ deriving (Show, Read, Eq, Data, Typeable, Generic) +instance FromJSON HTMLMathMethod where+ parseJSON node =+ (withObject "HTMLMathMethod" $ \m -> do+ method <- m .: "method"+ mburl <- m .:? "url"+ case method :: Text of+ "plain" -> return PlainMath+ "webtex" -> return $ WebTeX $+ fromMaybe defaultWebTeXURL mburl+ "gladtex" -> return GladTeX+ "mathml" -> return MathML+ "mathjax" -> return $ MathJax $+ fromMaybe defaultMathJaxURL mburl+ "katex" -> return $ KaTeX $+ fromMaybe defaultKaTeXURL mburl+ _ -> fail $ "Unknown HTML math method " ++ show method) node+ <|> (case node of+ String "plain" -> return PlainMath+ String "webtex" -> return $ WebTeX defaultWebTeXURL+ String "gladtex" -> return GladTeX+ String "mathml" -> return MathML+ String "mathjax" -> return $ MathJax defaultMathJaxURL+ String "katex" -> return $ KaTeX defaultKaTeXURL+ _ -> fail $ "Unknown HTML math method " <>+ toStringLazy (encode node))++instance ToJSON HTMLMathMethod where+ toJSON PlainMath = String "plain"+ toJSON (WebTeX "") = String "webtex"+ toJSON (WebTeX url) = object ["method" .= String "webtex",+ "url" .= String url]+ toJSON GladTeX = String "gladtex"+ toJSON MathML = String "mathml"+ toJSON (MathJax "") = String "mathjax"+ toJSON (MathJax url) = object ["method" .= String "mathjax",+ "url" .= String url]+ toJSON (KaTeX "") = String "katex"+ toJSON (KaTeX url) = object ["method" .= String "katex",+ "url" .= String url]+ data CiteMethod = Citeproc -- use citeproc to render them | Natbib -- output natbib cite commands | Biblatex -- output biblatex cite commands- deriving (Show, Read, Eq)+ deriving (Show, Read, Eq, Data, Typeable, Generic) +instance FromJSON CiteMethod where+ parseJSON v =+ case v of+ String "citeproc" -> return Citeproc+ String "natbib" -> return Natbib+ String "biblatex" -> return Biblatex+ _ -> fail $ "Unknown citation method: " <>+ toStringLazy (encode v)++instance ToJSON CiteMethod where+ toJSON Citeproc = String "citeproc"+ toJSON Natbib = String "natbib"+ toJSON Biblatex = String "biblatex"+ -- | Methods for obfuscating email addresses in HTML. data ObfuscationMethod = NoObfuscation | ReferenceObfuscation | JavascriptObfuscation- deriving (Show, Read, Eq)+ deriving (Show, Read, Eq, Data, Typeable, Generic) +instance FromJSON ObfuscationMethod where+ parseJSON v =+ case v of+ String "none" -> return NoObfuscation+ String "references" -> return ReferenceObfuscation+ String "javascript" -> return JavascriptObfuscation+ _ -> fail $ "Unknown obfuscation method " ++ toStringLazy (encode v)++instance ToJSON ObfuscationMethod where+ toJSON NoObfuscation = String "none"+ toJSON ReferenceObfuscation = String "references"+ toJSON JavascriptObfuscation = String "javascript"++-- | Method to provide code highlighting.+data HighlightMethod =+ Skylighting Style+ | IdiomaticHighlighting+ | DefaultHighlighting+ | NoHighlighting+ deriving (Show, Read, Eq, Data, Typeable, Generic)++-- | String representation of the idiomatic highlighting option.+pattern IdiomaticHighlightingString :: Text+pattern IdiomaticHighlightingString = "idiomatic"++-- | String representation of the default highlighting option.+pattern DefaultHighlightingString :: Text+pattern DefaultHighlightingString = "default"++-- | String representation of the no highlighting option+pattern NoHighlightingString :: Text+pattern NoHighlightingString = "none"++instance ToJSON HighlightMethod where+ toJSON NoHighlighting = String NoHighlightingString+ toJSON IdiomaticHighlighting = String IdiomaticHighlightingString+ toJSON DefaultHighlighting = String DefaultHighlightingString+ toJSON (Skylighting style) = toJSON style++instance FromJSON HighlightMethod where+ parseJSON = \case+ String NoHighlightingString -> pure NoHighlighting+ String IdiomaticHighlightingString -> pure IdiomaticHighlighting+ String DefaultHighlightingString -> pure DefaultHighlighting+ String x -> fail $ "Unknown highlighting method " <> T.unpack x+ Bool True -> pure DefaultHighlighting+ Bool False -> pure NoHighlighting+ Null -> pure NoHighlighting+ v -> Skylighting <$> parseJSON v+ -- | Varieties of HTML slide shows. data HTMLSlideVariant = S5Slides | SlidySlides@@ -271,102 +238,224 @@ | DZSlides | RevealJsSlides | NoSlides- deriving (Show, Read, Eq)+ 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)+ deriving (Show, Read, Eq, Data, Typeable, Generic) +-- update in doc/filters.md if this changes:+instance FromJSON TrackChanges where+ parseJSON v =+ case v of+ String "accept" -> return AcceptChanges+ String "reject" -> return RejectChanges+ String "all" -> return AllChanges+ String "accept-changes" -> return AcceptChanges+ String "reject-changes" -> return RejectChanges+ String "all-changes" -> return AllChanges+ _ -> fail $ "Unknown track changes method " <> toStringLazy (encode v)++instance ToJSON TrackChanges where+ toJSON AcceptChanges = String "accept-changes"+ toJSON RejectChanges = String "reject-changes"+ toJSON AllChanges = String "all-changes"++-- | Options for wrapping text in the output.+data WrapOption = WrapAuto -- ^ Automatically wrap to width+ | WrapNone -- ^ No non-semantic newlines+ | WrapPreserve -- ^ Preserve wrapping of input source+ deriving (Show, Read, Eq, Data, Typeable, Generic)++instance FromJSON WrapOption where+ parseJSON v =+ case v of+ String "auto" -> return WrapAuto+ String "wrap-auto" -> return WrapAuto+ String "none" -> return WrapNone+ String "wrap-none" -> return WrapNone+ String "preserve" -> return WrapPreserve+ String "wrap-preserve" -> return WrapPreserve+ _ -> fail $ "Unknown wrap method " <> toStringLazy (encode v)++instance ToJSON WrapOption where+ toJSON WrapAuto = "wrap-auto"+ toJSON WrapNone = "wrap-none"+ toJSON WrapPreserve = "wrap-preserve"++-- | Options defining the type of top-level headers.+data TopLevelDivision = TopLevelPart -- ^ Top-level headers become parts+ | TopLevelChapter -- ^ Top-level headers become chapters+ | TopLevelSection -- ^ Top-level headers become sections+ | TopLevelDefault -- ^ Top-level type is determined via+ -- heuristics+ deriving (Show, Read, Eq, Data, Typeable, Generic)++instance FromJSON TopLevelDivision where+ parseJSON v =+ case v of+ String "part" -> return TopLevelPart+ String "top-level-part" -> return TopLevelPart+ String "chapter" -> return TopLevelChapter+ String "top-level-chapter" -> return TopLevelChapter+ String "section" -> return TopLevelSection+ String "top-level-section" -> return TopLevelSection+ String "default" -> return TopLevelDefault+ String "top-level-default" -> return TopLevelDefault+ _ -> fail $ "Unknown top level division " <> toStringLazy (encode v)++instance ToJSON TopLevelDivision where+ toJSON TopLevelPart = "top-level-part"+ toJSON TopLevelChapter = "top-level-chapter"+ toJSON TopLevelSection = "top-level-section"+ toJSON TopLevelDefault = "top-level-default"++-- | Locations for footnotes and references in markdown output+data ReferenceLocation = EndOfBlock -- ^ End of block+ | EndOfSection -- ^ prior to next section header (or end of document)+ | EndOfDocument -- ^ at end of document+ deriving (Show, Read, Eq, Data, Typeable, Generic)++instance FromJSON ReferenceLocation where+ parseJSON v =+ case v of+ String "block" -> return EndOfBlock+ String "end-of-block" -> return EndOfBlock+ String "section" -> return EndOfSection+ String "end-of-section" -> return EndOfSection+ String "document" -> return EndOfDocument+ String "end-of-document" -> return EndOfDocument+ _ -> fail $ "Unknown reference location " <> toStringLazy (encode v)++instance ToJSON ReferenceLocation where+ toJSON EndOfBlock = "end-of-block"+ toJSON EndOfSection = "end-of-section"+ toJSON EndOfDocument = "end-of-document"++-- | Positions for figure and table captions+data CaptionPosition = CaptionAbove -- ^ above figure or table+ | CaptionBelow -- ^ below figure or table+ deriving (Show, Read, Eq, Data, Typeable, Generic)++instance FromJSON CaptionPosition where+ parseJSON v =+ case v of+ String "above" -> return CaptionAbove+ String "below" -> return CaptionBelow+ _ -> fail $ "Unknown caption position " <> toStringLazy (encode v)++instance ToJSON CaptionPosition where+ toJSON CaptionAbove = "above"+ toJSON CaptionBelow = "below"+ -- | Options for writers data WriterOptions = WriterOptions- { writerStandalone :: Bool -- ^ Include header and footer- , writerTemplate :: String -- ^ Template to use in standalone mode- , writerVariables :: [(String, String)] -- ^ Variables to set in template- , writerTabStop :: Int -- ^ Tabstop for conversion btw spaces and tabs- , writerTableOfContents :: Bool -- ^ Include table of contents- , writerSlideVariant :: HTMLSlideVariant -- ^ Are we writing S5, Slidy or Slideous?- , writerIncremental :: Bool -- ^ True if lists should be incremental- , writerHTMLMathMethod :: HTMLMathMethod -- ^ How to print math in HTML- , writerIgnoreNotes :: Bool -- ^ Ignore footnotes (used in making toc)- , writerNumberSections :: Bool -- ^ Number sections in LaTeX- , writerNumberOffset :: [Int] -- ^ Starting number for section, subsection, ...- , writerSectionDivs :: Bool -- ^ Put sections in div tags in HTML- , writerExtensions :: Set Extension -- ^ Markdown extensions that can be used- , writerReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst- , writerWrapText :: Bool -- ^ Wrap text to line length- , writerColumns :: Int -- ^ Characters in a line (for text wrapping)- , writerEmailObfuscation :: ObfuscationMethod -- ^ How to obfuscate emails- , writerIdentifierPrefix :: String -- ^ Prefix for section & note ids in HTML+ { writerTemplate :: Maybe (Template Text) -- ^ Template to use+ , writerVariables :: Context Text -- ^ Variables to set in template+ , writerTabStop :: Int -- ^ Tabstop for conversion btw spaces and tabs+ , writerTableOfContents :: Bool -- ^ Include table of contents+ , writerListOfFigures :: Bool -- ^ Include list of figures+ , writerListOfTables :: Bool -- ^ Include list of tables+ , writerIncremental :: Bool -- ^ True if lists should be incremental+ , writerHTMLMathMethod :: HTMLMathMethod -- ^ How to print math in HTML+ , writerNumberSections :: Bool -- ^ Number sections in LaTeX+ , writerNumberOffset :: [Int] -- ^ Starting number for section, subsection, ...+ , writerSectionDivs :: Bool -- ^ Put sections in div tags in HTML+ , writerExtensions :: Extensions -- ^ Markdown extensions that can be used+ , writerReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst+ , writerDpi :: Int -- ^ Dpi for pixel to\/from inch\/cm conversions+ , writerWrapText :: WrapOption -- ^ Option for wrapping text+ , writerColumns :: Int -- ^ Characters in a line (for text wrapping)+ , writerEmailObfuscation :: ObfuscationMethod -- ^ How to obfuscate emails+ , writerIdentifierPrefix :: Text -- ^ Prefix for section & note ids in HTML -- and for footnote marks in markdown- , writerSourceURL :: Maybe String -- ^ Absolute URL + directory of 1st source file- , writerUserDataDir :: Maybe FilePath -- ^ Path of user data directory- , writerCiteMethod :: CiteMethod -- ^ How to print cites- , writerHtml5 :: Bool -- ^ Produce HTML5- , writerHtmlQTags :: Bool -- ^ Use @<q>@ tags for quotes in HTML- , writerBeamer :: Bool -- ^ Produce beamer LaTeX slide show- , writerSlideLevel :: Maybe Int -- ^ Force header level of slides- , writerChapters :: Bool -- ^ Use "chapter" for top-level sects- , writerListings :: Bool -- ^ Use listings package for code- , writerHighlight :: Bool -- ^ Highlight source code- , writerHighlightStyle :: Style -- ^ Style to use for highlighting- , writerSetextHeaders :: Bool -- ^ Use setext headers for levels 1-2 in markdown- , writerTeXLigatures :: Bool -- ^ Use tex ligatures quotes, dashes in latex- , writerEpubVersion :: Maybe EPUBVersion -- ^ Nothing or EPUB version- , writerEpubMetadata :: String -- ^ Metadata to include in EPUB- , writerEpubStylesheet :: Maybe String -- ^ EPUB stylesheet specified at command line- , writerEpubFonts :: [FilePath] -- ^ Paths to fonts to embed- , writerEpubChapterLevel :: Int -- ^ Header level for chapters (separate files)- , writerTOCDepth :: Int -- ^ Number of levels to include in TOC- , writerReferenceODT :: Maybe FilePath -- ^ Path to reference ODT if specified- , writerReferenceDocx :: Maybe FilePath -- ^ Path to reference DOCX if specified- , writerMediaBag :: MediaBag -- ^ Media collected by docx or epub reader- } deriving Show+ , writerCiteMethod :: CiteMethod -- ^ How to print cites+ , writerHtmlQTags :: Bool -- ^ Use @<q>@ tags for quotes in HTML+ , writerSlideLevel :: Maybe Int -- ^ Force header level of slides+ , writerTopLevelDivision :: TopLevelDivision -- ^ Type of top-level divisions+ , writerHighlightMethod :: HighlightMethod -- ^ Style to use for highlighting+ , writerSetextHeaders :: Bool -- ^ Use setext headers for levels 1-2 in markdown+ , writerListTables :: Bool -- ^ Use list tables for RST tables+ , writerEpubSubdirectory :: Text -- ^ Subdir for epub in OCF+ , writerEpubMetadata :: Maybe Text -- ^ Metadata to include in EPUB+ , writerEpubFonts :: [FilePath] -- ^ Paths to fonts to embed+ , writerEpubTitlePage :: Bool -- ^ Include title page in epub+ , writerSplitLevel :: Int -- ^ Header level at which to split EPUB or chunked HTML into separate files+ , writerChunkTemplate :: PathTemplate -- ^ Template for filenames in chunked HTML+ , writerTOCDepth :: Int -- ^ Number of levels to include in TOC+ , writerReferenceDoc :: Maybe FilePath -- ^ Path to reference document if specified+ , writerReferenceLocation :: ReferenceLocation -- ^ Location of footnotes and references for writing markdown+ , writerFigureCaptionPosition :: CaptionPosition -- ^ Position of figure caption+ , writerTableCaptionPosition :: CaptionPosition -- ^ Position of table caption+ , writerSyntaxMap :: SyntaxMap+ , writerPreferAscii :: Bool -- ^ Prefer ASCII representations of characters when possible+ , writerLinkImages :: Bool -- ^ Use links rather than embedding ODT images+ } deriving (Show, Data, Typeable, Generic) instance Default WriterOptions where- def = WriterOptions { writerStandalone = False- , writerTemplate = ""- , writerVariables = []+ def = WriterOptions { writerTemplate = Nothing+ , writerVariables = mempty , writerTabStop = 4 , writerTableOfContents = False- , writerSlideVariant = NoSlides+ , writerListOfFigures = False+ , writerListOfTables = False , writerIncremental = False , writerHTMLMathMethod = PlainMath- , writerIgnoreNotes = False , writerNumberSections = False , writerNumberOffset = [0,0,0,0,0,0] , writerSectionDivs = False- , writerExtensions = pandocExtensions+ , writerExtensions = emptyExtensions , writerReferenceLinks = False- , writerWrapText = True+ , writerDpi = 96+ , writerWrapText = WrapAuto , writerColumns = 72- , writerEmailObfuscation = JavascriptObfuscation+ , writerEmailObfuscation = NoObfuscation , writerIdentifierPrefix = ""- , writerSourceURL = Nothing- , writerUserDataDir = Nothing , writerCiteMethod = Citeproc- , writerHtml5 = False , writerHtmlQTags = False- , writerBeamer = False , writerSlideLevel = Nothing- , writerChapters = False- , writerListings = False- , writerHighlight = False- , writerHighlightStyle = pygments- , writerSetextHeaders = True- , writerTeXLigatures = True- , writerEpubVersion = Nothing- , writerEpubMetadata = ""- , writerEpubStylesheet = Nothing+ , writerTopLevelDivision = TopLevelDefault+ , writerHighlightMethod = DefaultHighlighting+ , writerSetextHeaders = False+ , writerListTables = False+ , writerEpubSubdirectory = "EPUB"+ , writerEpubMetadata = Nothing , writerEpubFonts = []- , writerEpubChapterLevel = 1+ , writerEpubTitlePage = True+ , writerSplitLevel = 1+ , writerChunkTemplate = "%s-%i.html" , writerTOCDepth = 3- , writerReferenceODT = Nothing- , writerReferenceDocx = Nothing- , writerMediaBag = mempty+ , writerReferenceDoc = Nothing+ , writerReferenceLocation = EndOfDocument+ , writerFigureCaptionPosition = CaptionBelow+ , writerTableCaptionPosition = CaptionAbove+ , writerSyntaxMap = defaultSyntaxMap+ , writerPreferAscii = False+ , writerLinkImages = False } +instance HasSyntaxExtensions WriterOptions where+ getExtensions opts = writerExtensions opts+ -- | Returns True if the given extension is enabled.-isEnabled :: Extension -> WriterOptions -> Bool-isEnabled ext opts = ext `Set.member` (writerExtensions opts)+isEnabled :: HasSyntaxExtensions a => Extension -> a -> Bool+isEnabled ext opts = ext `extensionEnabled` getExtensions opts++defaultMathJaxURL :: Text+defaultMathJaxURL = "https://cdn.jsdelivr.net/npm/mathjax@4/tex-chtml.js"++defaultWebTeXURL :: Text+defaultWebTeXURL = "https://latex.codecogs.com/png.latex?"++defaultKaTeXURL :: Text+defaultKaTeXURL = "https://cdn.jsdelivr.net/npm/katex@latest/dist/"++-- Update documentation in doc/filters.md if this is changed.+$(deriveJSON defaultOptions{ fieldLabelModifier =+ camelTo2 '-' . drop 6 }+ ''ReaderOptions)++$(deriveJSON defaultOptions{ constructorTagModifier = map toLower }+ ''HTMLSlideVariant)
@@ -1,25 +1,11 @@-{-# LANGUAGE OverloadedStrings, CPP, ScopedTypeVariables #-}-{--Copyright (C) 2012-2014 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--}-+{-# LANGUAGE CPP #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE FlexibleContexts #-} {- | Module : Text.Pandoc.PDF- Copyright : Copyright (C) 2012-2014 John MacFarlane+ Copyright : Copyright (C) 2012-2024 John MacFarlane License : GNU GPL, version 2 or above Maintainer : John MacFarlane <jgm@berkeley.edu>@@ -30,130 +16,331 @@ -} module Text.Pandoc.PDF ( makePDF ) where +import qualified Codec.Picture as JP+import qualified Control.Exception as E+import Control.Monad.Trans (MonadIO (..))+import Control.Monad (foldM_)+import Crypto.Hash (hashWith, SHA1(SHA1))+import qualified Data.ByteString as BS import Data.ByteString.Lazy (ByteString)-import qualified Data.ByteString.Lazy as B+import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy.Char8 as BC-import qualified Data.ByteString as BS-import System.Exit (ExitCode (..))-import System.FilePath+import Data.Maybe (fromMaybe)+import Data.Text (Text)+import qualified Data.Text as T+import qualified Data.Text.Lazy as TL+import Data.Text.Lazy.Encoding (decodeUtf8')+import Text.Printf (printf)+import Data.Char (ord, isAscii, isSpace) import System.Directory-import Data.Digest.Pure.SHA (showDigest, sha1) import System.Environment-import Control.Monad (unless, (<=<))-import qualified Control.Exception as E-import Control.Applicative ((<$))-import Data.List (isInfixOf)-import Data.Maybe (fromMaybe)-import qualified Text.Pandoc.UTF8 as UTF8+import System.Exit (ExitCode (..))+import System.FilePath+import System.IO (hClose)+import System.IO.Temp (withSystemTempDirectory, withTempDirectory,+ withTempFile)+import qualified System.IO.Error as IE+import Text.DocLayout (literal, render, hsep) import Text.Pandoc.Definition-import Text.Pandoc.Walk (walkM)-import Text.Pandoc.Shared (fetchItem', warn, withTempDir)-import Text.Pandoc.Options (WriterOptions(..))-import Text.Pandoc.MIME (extensionFromMimeType, getMimeType)+import Text.Pandoc.Error (PandocError (PandocPDFProgramNotFoundError))+import Text.Pandoc.SelfContained (makeSelfContained)+import Text.Pandoc.MIME (getMimeType)+import Text.Pandoc.Options (HTMLMathMethod (..), WriterOptions (..))+import Text.Pandoc.Extensions (disableExtension, Extension(Ext_smart)) import Text.Pandoc.Process (pipeProcess)-import qualified Data.ByteString.Lazy as BL-import qualified Codec.Picture as JP+import System.Process (readProcessWithExitCode)+import Text.Pandoc.Shared (inDirectory, stringify, tshow)+import qualified Text.Pandoc.UTF8 as UTF8+import Text.Pandoc.Walk (walkM)+import Text.Pandoc.Writers.Shared (getField, metaToContext)+import Control.Monad.Catch (MonadMask) #ifdef _WINDOWS import Data.List (intercalate) #endif+import Data.List (isPrefixOf, find)+import Text.Pandoc.MediaBag (mediaItems)+import Text.Pandoc.Class (fillMediaBag, getMediaBag, getVerbosity, setVerbosity,+ readFileStrict, fileExists,+ report, extractMedia, PandocMonad, runIOorExplode)+import Text.Pandoc.Logging+import Text.DocTemplates ( FromContext(lookupContext) ) #ifdef _WINDOWS changePathSeparators :: FilePath -> FilePath-changePathSeparators = intercalate "/" . splitDirectories+changePathSeparators =+ -- We filter out backslashes because an initial `C:\` gets+ -- retained by `splitDirectories`, see #6173:+ intercalate "/" . map (filter (/='\\')) . splitDirectories #endif -makePDF :: String -- ^ pdf creator (pdflatex, lualatex, xelatex)- -> (WriterOptions -> Pandoc -> String) -- ^ writer+makePDF :: (PandocMonad m, MonadIO m, MonadMask m)+ => String -- ^ pdf creator (pdflatex, lualatex, xelatex,+ -- wkhtmltopdf, weasyprint, prince, context,+ -- pdfroff, pagedjs,+ -- or path to executable)+ -> [String] -- ^ arguments to pass to pdf creator+ -> (WriterOptions -> Pandoc -> m Text) -- ^ writer -> WriterOptions -- ^ options -> Pandoc -- ^ document- -> IO (Either ByteString ByteString)-makePDF program writer opts doc = withTempDir "tex2pdf." $ \tmpdir -> do- doc' <- handleImages opts tmpdir doc- let source = writer opts doc'- tex2pdf' tmpdir program source+ -> m (Either ByteString ByteString)+makePDF program pdfargs writer opts doc = withTempDir (program == "typst") "media" $ \mediaDir -> do+#ifdef _WINDOWS+ -- note: we want / even on Windows, for TexLive+ let tmpdir = changePathSeparators mediaDir+#else+ let tmpdir = mediaDir+#endif+ let isTeXFormat "context" = True+ isTeXFormat "tectonic" = True+ isTeXFormat "latexmk" = True+ isTeXFormat "lualatex" = True+ isTeXFormat "lualatex-dev" = True+ isTeXFormat "pdflatex" = True+ isTeXFormat "pdflatex-dev" = True+ isTeXFormat "xelatex" = True+ isTeXFormat _ = False+ let opts' = if isTeXFormat program+ then -- disable quote ligatures to avoid bad ligatures like ?`+ opts{ writerExtensions = disableExtension Ext_smart+ (writerExtensions opts) }+ else opts+ source <- fillMediaBag doc+ >>= extractMedia tmpdir+ >>= (if isTeXFormat program+ then walkM (convertImages opts' tmpdir)+ else return)+ >>= writer opts' -handleImages :: WriterOptions- -> FilePath -- ^ temp dir to store images- -> Pandoc -- ^ document- -> IO Pandoc-handleImages opts tmpdir = walkM (convertImages tmpdir) <=< walkM (handleImage' opts tmpdir)+ verbosity <- getVerbosity+ let compileHTML mkOutArgs = do+ -- check to see if there is anything in mediabag, and if so,+ -- make the HTML self contained+ mediabag <- getMediaBag+ source' <- case mediaItems mediabag of+ [] -> pure source+ _ -> makeSelfContained source+ liftIO $+ toPdfViaTempFile verbosity program pdfargs mkOutArgs ".html" source'+ case takeBaseName program of+ "wkhtmltopdf" -> makeWithWkhtmltopdf program pdfargs writer opts' doc+ "pagedjs-cli" -> compileHTML (\f -> ["-o", f])+ "prince" -> compileHTML (\f -> ["-o", f])+ "weasyprint" -> compileHTML (:[])+ "typst" -> liftIO $+ toPdfViaTempFile verbosity program ("compile":pdfargs) (:[]) ".typ" source+ "pdfroff" -> do+ let paperargs =+ case lookupContext "papersize" (writerVariables opts') of+ Just s+ | T.takeEnd 1 s == "l" -> ["-P-p" <>+ T.unpack (T.dropEnd 1 s), "-P-l"]+ | otherwise -> ["-P-p" <> T.unpack s]+ Nothing -> []+ let args = ["-ms", "-mpdfmark", "-mspdf",+ "-e", "-t", "-k", "-KUTF-8", "-i"] +++ ["-U" | ".PDFPIC" `T.isInfixOf` source] +++ paperargs ++ pdfargs+ generic2pdf program args source+ "groff" -> do+ let paperargs =+ case lookupContext "papersize" (writerVariables opts') of+ Just s+ | T.takeEnd 1 s == "l" -> ["-P-p" <>+ T.unpack (T.dropEnd 1 s), "-P-l"]+ | otherwise -> ["-P-p" <> T.unpack s]+ Nothing -> []+ let args = ["-ms", "-Tpdf",+ "-e", "-t", "-k", "-KUTF-8"] +++ ["-U" | ".PDFPIC" `T.isInfixOf` source] +++ paperargs ++ pdfargs+ generic2pdf program args source+ "context" -> context2pdf program pdfargs tmpdir source+ "tectonic" -> tectonic2pdf program pdfargs tmpdir source+ "latexmk" -> tex2pdf program pdfargs tmpdir source+ "lualatex" -> tex2pdf program pdfargs tmpdir source+ "lualatex-dev" -> tex2pdf program pdfargs tmpdir source+ "pdflatex" -> tex2pdf program pdfargs tmpdir source+ "pdflatex-dev" -> tex2pdf program pdfargs tmpdir source+ "xelatex" -> tex2pdf program pdfargs tmpdir source+ _ -> return $ Left $ UTF8.fromStringLazy $ "Unknown program " ++ program -handleImage' :: WriterOptions- -> FilePath- -> Inline- -> IO Inline-handleImage' opts tmpdir (Image ils (src,tit)) = do- exists <- doesFileExist src- if exists- then return $ Image ils (src,tit)- else do- res <- fetchItem' (writerMediaBag opts) (writerSourceURL opts) src- case res of- Right (contents, Just mime) -> do- let ext = fromMaybe (takeExtension src) $- extensionFromMimeType mime- let basename = showDigest $ sha1 $ BL.fromChunks [contents]- let fname = tmpdir </> basename <.> ext- BS.writeFile fname contents- return $ Image ils (fname,tit)- _ -> do- warn $ "Could not find image `" ++ src ++ "', skipping..."- return $ Image ils (src,tit)-handleImage' _ _ x = return x+-- latex has trouble with tildes in paths, which+-- you find in Windows temp dir paths with longer+-- user names (see #777)+withTempDir :: (PandocMonad m, MonadMask m, MonadIO m)+ => Bool -> FilePath -> (FilePath -> m a) -> m a+withTempDir useWorkingDirectory templ action = do+ tmp <- liftIO getTemporaryDirectory+ uname <- liftIO $ E.catch+ (do (ec, sout, _) <- readProcessWithExitCode "uname" ["-o"] ""+ if ec == ExitSuccess+ then return $ Just $ filter (not . isSpace) sout+ else return Nothing)+ (\(_ :: E.SomeException) -> return Nothing)+ if useWorkingDirectory || '~' `elem` tmp || uname == Just "Cygwin" -- see #5451+ then withTempDirectory "." templ action+ else withSystemTempDirectory templ action -convertImages :: FilePath -> Inline -> IO Inline-convertImages tmpdir (Image ils (src, tit)) = do- img <- convertImage tmpdir src+makeWithWkhtmltopdf :: (PandocMonad m, MonadIO m)+ => String -- ^ wkhtmltopdf or path+ -> [String] -- ^ arguments+ -> (WriterOptions -> Pandoc -> m Text) -- ^ writer+ -> WriterOptions -- ^ options+ -> Pandoc -- ^ document+ -> m (Either ByteString ByteString)+makeWithWkhtmltopdf program pdfargs writer opts doc@(Pandoc meta _) = do+ let mathArgs = case writerHTMLMathMethod opts of+ -- with MathJax, wait til all math is rendered:+ MathJax _ -> ["--run-script", "MathJax.Hub.Register.StartupHook('End Typeset', function() { window.status = 'mathjax_loaded' });",+ "--window-status", "mathjax_loaded"]+ _ -> []+ meta' <- metaToContext opts+ (return . literal . stringify)+ (return . literal . stringify)+ meta+ let toArgs (f, mbd) = maybe [] (\d -> ["--" <> f, T.unpack d]) mbd+ let args = mathArgs ++ concatMap toArgs+ [("page-size", getField "papersize" meta')+ ,("title", getField "title" meta')+ ,("margin-bottom", Just $ fromMaybe "1.2in"+ (getField "margin-bottom" meta'))+ ,("margin-top", Just $ fromMaybe "1.25in"+ (getField "margin-top" meta'))+ ,("margin-right", Just $ fromMaybe "1.25in"+ (getField "margin-right" meta'))+ ,("margin-left", Just $ fromMaybe "1.25in"+ (getField "margin-left" meta'))+ ,("footer-html", getField "footer-html" meta')+ ,("header-html", getField "header-html" meta')+ ] ++ ("--enable-local-file-access" : pdfargs)+ -- see #6474+ source <- writer opts doc+ verbosity <- getVerbosity+ liftIO $ toPdfViaTempFile verbosity program args (:[]) ".html" source++-- convert SVG to PDF, and pixel formats to PNG or JPEG, for TeX formats+convertImages :: (PandocMonad m, MonadIO m)+ => WriterOptions -> FilePath -> Inline -> m Inline+convertImages opts tmpdir (Image attr ils (src, tit)) = do+ img <- liftIO $ convertImage opts tmpdir $ T.unpack src newPath <- case img of- Left e -> src <$- warn ("Unable to convert image `" ++ src ++ "':\n" ++ e)- Right fp -> return fp- return (Image ils (newPath, tit))-convertImages _ x = return x+ Left e -> do+ report $ CouldNotConvertImage src e+ return src+ Right fp -> return $ T.pack fp+ return (Image attr ils (newPath, tit))+convertImages _ _ x = return x -- Convert formats which do not work well in pdf to png-convertImage :: FilePath -> FilePath -> IO (Either String FilePath)-convertImage tmpdir fname =+convertImage :: WriterOptions -> FilePath -> FilePath+ -> IO (Either Text FilePath)+convertImage opts tmpdir fname = do+ let dpi = show $ writerDpi opts case mime of Just "image/png" -> doNothing Just "image/jpeg" -> doNothing Just "application/pdf" -> doNothing- _ -> JP.readImage fname >>= \res ->- case res of- Left msg -> return $ Left msg+ -- Note: eps is converted by pdflatex using epstopdf.pl+ Just "application/eps" -> doNothing+ Just "image/svg+xml" -> E.catch (do+ (exit, _) <- pipeProcess Nothing "rsvg-convert"+ ["-f","pdf","-a","--dpi-x",dpi,"--dpi-y",dpi,+ "-o",pdfOut,svgIn] BL.empty+ if exit == ExitSuccess+ then return $ Right pdfOut+ else return $ Left "conversion from SVG failed")+ (\(e :: E.SomeException) -> return $ Left $+ "check that rsvg-convert is in path.\n" <>+ tshow e)+ _ -> JP.readImage fname >>= \case+ Left e -> return $ Left $ T.pack e Right img ->- E.catch (Right fileOut <$ JP.savePngImage fileOut img) $- \(e :: E.SomeException) -> return (Left (show e))+ E.catch (Right pngOut <$ JP.savePngImage pngOut img) $+ \(e :: E.SomeException) -> return (Left (tshow e)) where- fileOut = replaceDirectory (replaceExtension fname (".png")) tmpdir+ sha = show (hashWith SHA1 (UTF8.fromString fname))+ pngOut = normalise $ tmpdir </> sha <.> "png"+ pdfOut = normalise $ tmpdir </> sha <.> "pdf"+ svgIn = normalise fname mime = getMimeType fname doNothing = return (Right fname) -tex2pdf' :: FilePath -- ^ temp directory for output- -> String -- ^ tex program- -> String -- ^ tex source- -> IO (Either ByteString ByteString)-tex2pdf' tmpDir program source = do- let numruns = if "\\tableofcontents" `isInfixOf` source- then 3 -- to get page numbers- else 2 -- 1 run won't give you PDF bookmarks- (exit, log', mbPdf) <- runTeXProgram program numruns tmpDir source+tectonic2pdf :: (PandocMonad m, MonadIO m)+ => String -- ^ tex program+ -> [String] -- ^ Arguments to the latex-engine+ -> FilePath -- ^ temp directory for output+ -> Text -- ^ tex source+ -> m (Either ByteString ByteString)+tectonic2pdf program args tmpDir source = do+ (exit, log', mbPdf) <- runTectonic program args tmpDir source case (exit, mbPdf) of+ (ExitFailure _, _) -> return $ Left $ extractMsg log'+ (ExitSuccess, Nothing) -> return $ Left ""+ (ExitSuccess, Just pdf) -> do+ missingCharacterWarnings log'+ return $ Right pdf++tex2pdf :: (PandocMonad m, MonadIO m)+ => String -- ^ tex program+ -> [String] -- ^ Arguments to the latex-engine+ -> FilePath -- ^ temp directory for output+ -> Text -- ^ tex source+ -> m (Either ByteString ByteString)+tex2pdf program args tmpDir source = do+ let isOutdirArg x = "-outdir=" `isPrefixOf` x ||+ "-output-directory=" `isPrefixOf` x+ let outDir =+ case find isOutdirArg args of+ Just x -> drop 1 $ dropWhile (/='=') x+ Nothing -> tmpDir+ let file = tmpDir ++ "/input.tex" -- note: tmpDir has / path separators+ liftIO $ BS.writeFile file $ UTF8.fromText source+ (exit, log', mbPdf) <- runTeXProgram program args tmpDir outDir+ case (exit, mbPdf) of (ExitFailure _, _) -> do let logmsg = extractMsg log' let extramsg = case logmsg of- x | "! Package inputenc Error" `BC.isPrefixOf` x ->- "\nTry running pandoc with --latex-engine=xelatex."+ x | "! Package inputenc Error" `BC.isPrefixOf` x+ && program /= "xelatex"+ -> "\nTry running pandoc with --pdf-engine=xelatex." _ -> "" return $ Left $ logmsg <> extramsg (ExitSuccess, Nothing) -> return $ Left ""- (ExitSuccess, Just pdf) -> return $ Right pdf+ (ExitSuccess, Just pdf) -> do+ latexWarnings log'+ missingCharacterWarnings log'+ return $ Right pdf -(<>) :: ByteString -> ByteString -> ByteString-(<>) = B.append+missingCharacterWarnings :: PandocMonad m => ByteString -> m ()+missingCharacterWarnings log' = do+ let ls = BC.lines log'+ let isMissingCharacterWarning = BC.isPrefixOf "Missing character:"+ let toCodePoint c+ | isAscii c = T.singleton c+ | otherwise = T.pack $ c : " (U+" ++ printf "%04X" (ord c) ++ ")"+ let addCodePoint = T.concatMap toCodePoint+ let warnings = [ addCodePoint (utf8ToText (BC.drop 19 l))+ | l <- ls+ , isMissingCharacterWarning l+ ]+ mapM_ (report . MissingCharacter) warnings +latexWarnings :: PandocMonad m => ByteString -> m ()+latexWarnings log' = foldM_ go Nothing (BC.lines log')+ where+ go Nothing ln+ | BC.isPrefixOf "LaTeX Warning:" ln =+ pure $ Just ln+ | otherwise = pure Nothing+ go (Just msg) ln+ | ln == "" = do -- emit report and reset accumulator+ report $ MakePDFWarning $ render (Just 60) $+ hsep $ map literal $ T.words $ utf8ToText msg+ pure Nothing+ | otherwise = pure $ Just (msg <> ln)+ -- parsing output extractMsg :: ByteString -> ByteString@@ -165,44 +352,329 @@ then log' else BC.unlines (msg'' ++ lineno) +extractConTeXtMsg :: ByteString -> ByteString+extractConTeXtMsg log' = do+ let msg' = take 1 $+ dropWhile (not . ("tex error" `BC.isPrefixOf`)) $ BC.lines log'+ if null msg'+ then log'+ else BC.unlines msg'+ -- running tex programs --- Run a TeX program on an input bytestring and return (exit code,--- contents of stdout, contents of produced PDF if any). Rerun--- a fixed number of times to resolve references.-runTeXProgram :: String -> Int -> FilePath -> String- -> IO (ExitCode, ByteString, Maybe ByteString)-runTeXProgram program runsLeft tmpDir source = do- let file = tmpDir </> "input.tex"- exists <- doesFileExist file- unless exists $ UTF8.writeFile file source-#ifdef _WINDOWS- -- note: we want / even on Windows, for TexLive- let tmpDir' = changePathSeparators tmpDir- let file' = changePathSeparators file-#else- let tmpDir' = tmpDir- let file' = file-#endif- let programArgs = ["-halt-on-error", "-interaction", "nonstopmode",- "-output-directory", tmpDir', file']- env' <- getEnvironment- let sep = searchPathSeparator:[]- let texinputs = maybe (tmpDir' ++ sep) ((tmpDir' ++ sep) ++)+runTectonic :: (PandocMonad m, MonadIO m)+ => String -> [String] -> FilePath+ -> Text -> m (ExitCode, ByteString, Maybe ByteString)+runTectonic program args' tmpDir' source = do+ let getOutDir acc (a:b:xs) = if a `elem` ["-o", "--outdir"]+ then (reverse acc ++ xs, Just b)+ else getOutDir (b:a:acc) xs+ getOutDir acc xs = (reverse acc ++ xs, Nothing)+ (args, outDir) = getOutDir [] args'+ tmpDir = fromMaybe tmpDir' outDir+ liftIO $ createDirectoryIfMissing True tmpDir+ -- run tectonic on stdin so it reads \include commands from $PWD instead of a temp directory+ let sourceBL = BL.fromStrict $ UTF8.fromText source+ let programArgs = ["--outdir", tmpDir] ++ args ++ ["-"]+ env <- liftIO getEnvironment+ showVerboseInfo (Just tmpDir) program programArgs env (utf8ToText sourceBL)+ (exit, out) <- liftIO $ E.catch+ (pipeProcess (Just env) program programArgs sourceBL)+ (handlePDFProgramNotFound program)+ report $ MakePDFInfo "tectonic output" (utf8ToText out)+ let pdfFile = tmpDir ++ "/texput.pdf"+ (_, pdf) <- getResultingPDF Nothing pdfFile+ return (exit, out, pdf)++-- read a pdf that has been written to a temporary directory, and optionally read+-- logs+getResultingPDF :: (PandocMonad m, MonadIO m)+ => Maybe String -> String+ -> m (Maybe ByteString, Maybe ByteString)+getResultingPDF logFile pdfFile = do+ pdfExists <- fileExists pdfFile+ pdf <- if pdfExists+ -- We read PDF as a strict bytestring to make sure that the+ -- temp directory is removed on Windows.+ -- See https://github.com/jgm/pandoc/issues/1192.+ then (Just . BL.fromChunks . (:[])) `fmap`+ (readFileStrict pdfFile)+ else return Nothing+ -- Note that some things like Missing character warnings+ -- appear in the log but not on stderr, so we prefer the log:+ log' <- case logFile of+ Just logFile' -> do+ logExists <- fileExists logFile'+ if logExists+ then Just . BL.fromStrict <$> readFileStrict logFile'+ else return Nothing+ Nothing -> return Nothing+ return (log', pdf)++-- Run a TeX program once in a temp directory (on input.tex) and return (exit code,+-- contents of stdout, contents of produced PDF if any).+runTeXProgram :: (PandocMonad m, MonadIO m)+ => String -> [String] -> FilePath -> FilePath+ -> m (ExitCode, ByteString, Maybe ByteString)+runTeXProgram program args tmpDir outDir = do+ let isLatexMk = takeBaseName program == "latexmk"+ programArgs | isLatexMk =+ ["-interaction=batchmode", "-halt-on-error", "-pdf",+ "-quiet", "-outdir=" ++ outDir] ++ args ++ [file]+ | otherwise =+ ["-halt-on-error", "-interaction", "nonstopmode",+ "-output-directory", outDir] ++ args ++ [file]+ env' <- liftIO getEnvironment+ let sep = [searchPathSeparator]+ let texinputs = maybe (tmpDir ++ sep) ((tmpDir ++ sep) ++) $ lookup "TEXINPUTS" env' let env'' = ("TEXINPUTS", texinputs) :- [(k,v) | (k,v) <- env', k /= "TEXINPUTS"]- (exit, out, err) <- pipeProcess (Just env'') program programArgs BL.empty- if runsLeft > 1- then runTeXProgram program (runsLeft - 1) tmpDir source+ ("TEXMFOUTPUT", outDir) :+ [(k,v) | (k,v) <- env'+ , k /= "TEXINPUTS" && k /= "TEXMFOUTPUT"]+ liftIO (UTF8.readFile file) >>=+ showVerboseInfo (Just tmpDir) program programArgs env''+ go env'' programArgs (1 :: Int)+ where+ file = tmpDir ++ "/input.tex"+ outfile = outDir ++ "/input.pdf"+ go env'' programArgs runNumber = do+ let maxruns = 4 -- stop if warnings present after 4 runs+ report $ MakePDFInfo ("LaTeX run number " <> tshow runNumber) mempty+ (exit, out) <- liftIO $ E.catch+ (pipeProcess (Just env'') program programArgs BL.empty)+ (handlePDFProgramNotFound program)+ report $ MakePDFInfo "LaTeX output" (utf8ToText out)+ -- parse log to see if we need to rerun LaTeX+ let logFile = replaceExtension outfile ".log"+ logExists <- fileExists logFile+ logContents <- if logExists+ then BL.fromStrict <$> readFileStrict logFile+ else return mempty+ let rerunWarnings = checkForRerun logContents+ tocFileExists <- fileExists (replaceExtension outfile ".toc")+ -- if we have a TOC we always need 3 runs, see #10308+ let rerunWarnings' = rerunWarnings ++ ["TOC is present" | tocFileExists]+ if not (null rerunWarnings') && runNumber < maxruns+ then do+ report $ MakePDFInfo "Rerun needed"+ (T.intercalate "\n" (map utf8ToText rerunWarnings'))+ go env'' programArgs (runNumber + 1) else do- let pdfFile = replaceDirectory (replaceExtension file ".pdf") tmpDir- pdfExists <- doesFileExist pdfFile- pdf <- if pdfExists- -- We read PDF as a strict bytestring to make sure that the- -- temp directory is removed on Windows.- -- See https://github.com/jgm/pandoc/issues/1192.- then (Just . B.fromChunks . (:[])) `fmap` BS.readFile pdfFile- else return Nothing- return (exit, out <> err, pdf)+ (log', pdf) <- getResultingPDF (Just logFile) outfile+ return (exit, fromMaybe out log', pdf) + checkForRerun log' = filter isRerunWarning $ BC.lines log'++ isRerunWarning ln =+ let ln' = BL.toStrict ln+ in BS.isInfixOf "Warning:" ln' && BS.isInfixOf "Rerun" ln'++generic2pdf :: (PandocMonad m, MonadIO m)+ => String+ -> [String]+ -> Text+ -> m (Either ByteString ByteString)+generic2pdf program args source = do+ env' <- liftIO getEnvironment+ showVerboseInfo Nothing program args env' source+ (exit, out) <- liftIO $ E.catch+ (pipeProcess (Just env') program args+ (BL.fromStrict $ UTF8.fromText source))+ (handlePDFProgramNotFound program)+ return $ case exit of+ ExitFailure _ -> Left out+ ExitSuccess -> Right out++toPdfViaTempFile ::+ Verbosity -- ^ Verbosity level+ -> String -- ^ Program (program name or path)+ -> [String] -- ^ Args to program+ -> (String -> [String]) -- ^ Construct args for output file+ -> String -- ^ extension to use for input file (e.g. '.html')+ -> Text -- ^ Source+ -> IO (Either ByteString ByteString)+toPdfViaTempFile verbosity program args mkOutArgs extension source =+ withTempFile "." ("toPdfViaTempFile" <> extension) $ \file h1 ->+ withTempFile "." "toPdfViaTempFile.pdf" $ \pdfFile h2 -> do+ hClose h1+ hClose h2+ BS.writeFile file $ UTF8.fromText source+ let programArgs = args ++ [file] ++ mkOutArgs pdfFile+ env' <- getEnvironment+ fileContents <- UTF8.readFile file+ runIOorExplode $ do+ setVerbosity verbosity+ showVerboseInfo Nothing program programArgs env' fileContents+ (exit, out) <- E.catch+ (pipeProcess (Just env') program programArgs BL.empty)+ (handlePDFProgramNotFound program)+ runIOorExplode $ do+ setVerbosity verbosity+ report $ MakePDFInfo "pdf-engine output" (utf8ToText out)+ pdfExists <- doesFileExist pdfFile+ mbPdf <- if pdfExists+ -- We read PDF as a strict bytestring to make sure that the+ -- temp directory is removed on Windows.+ -- See https://github.com/jgm/pandoc/issues/1192.+ then Just . BL.fromChunks . (:[]) <$> BS.readFile pdfFile+ else return Nothing+ return $ case (exit, mbPdf) of+ (ExitFailure _, _) -> Left out+ (ExitSuccess, Nothing) -> Left ""+ (ExitSuccess, Just pdf) -> Right pdf++context2pdf :: (PandocMonad m, MonadIO m)+ => String -- ^ "context" or path to it+ -> [String] -- ^ extra arguments+ -> FilePath -- ^ temp directory for output+ -> Text -- ^ ConTeXt source+ -> m (Either ByteString ByteString)+context2pdf program pdfargs tmpDir source = do+ let file = "input.tex"+ let programArgs = "--batchmode" : pdfargs ++ [file]+ env' <- liftIO getEnvironment+ verbosity <- getVerbosity+ liftIO $ BS.writeFile (tmpDir </> file) $ UTF8.fromText source+ liftIO (UTF8.readFile (tmpDir </> file)) >>=+ showVerboseInfo (Just tmpDir) program programArgs env'+ liftIO $ inDirectory tmpDir $ do+ (exit, out) <- E.catch+ (pipeProcess (Just env') program programArgs BL.empty)+ (handlePDFProgramNotFound program)+ runIOorExplode $ do+ setVerbosity verbosity+ report $ MakePDFInfo "ConTeXt run output" (utf8ToText out)+ let pdfFile = replaceExtension file ".pdf"+ pdfExists <- doesFileExist pdfFile+ mbPdf <- if pdfExists+ -- We read PDF as a strict bytestring to make sure that the+ -- temp directory is removed on Windows.+ -- See https://github.com/jgm/pandoc/issues/1192.+ then (Just . BL.fromChunks . (:[])) `fmap` BS.readFile pdfFile+ else return Nothing+ case (exit, mbPdf) of+ (ExitFailure _, _) -> do+ let logmsg = extractConTeXtMsg out+ return $ Left logmsg+ (ExitSuccess, Nothing) -> return $ Left ""+ (ExitSuccess, Just pdf) -> return $ Right pdf+++showVerboseInfo :: PandocMonad m+ => Maybe FilePath+ -> String+ -> [String]+ -> [(String, String)]+ -> Text+ -> m ()+showVerboseInfo mbTmpDir program programArgs env source = do+ case mbTmpDir of+ Just tmpDir -> report $ MakePDFInfo "Temp dir:" (T.pack tmpDir)+ Nothing -> return ()+ report $ MakePDFInfo "Command line:"+ (T.pack program <> " " <> T.pack (unwords (map show programArgs)))+ -- we filter out irrelevant stuff to avoid leaking passwords and keys!+ let isRelevant e = (e `elem` [ "PKFONTS"+ , "AFMFONTS"+ , "BIBINPUTS"+ , "BLTXMLINPUTS"+ , "BSTINPUTS"+ , "CLUAINPUTS"+ , "CMAPFONTS"+ , "CWEBINPUTS"+ , "DVIPSHEADERS"+ , "ENCFONTS"+ , "FONTCIDMAPS"+ , "FONTFEATURES"+ , "GFFONTS"+ , "GLYPHFONTS"+ , "HOME"+ , "INDEXSTYLE"+ , "KPATHSEA_DEBUG"+ , "KPATHSEA_WARNING"+ , "LANG"+ , "LIGFONTS"+ , "LUAINPUTS"+ , "LUA_CPATH"+ , "LUA_PATH"+ , "MFBASES"+ , "MFINPUTS"+ , "MFPOOL"+ , "MFTINPUTS"+ , "MISCFONTS"+ , "MISSFONT_LOG"+ , "MLBIBINPUTS"+ , "MLBSTINPUTS"+ , "MPINPUTS"+ , "MPMEMS"+ , "MPPOOL"+ , "MPSUPPORT"+ , "OCPINPUTS"+ , "OFMFONTS"+ , "OPENTYPEFONTS"+ , "OPLFONTS"+ , "OTPINPUTS"+ , "OVFFONTS"+ , "OVPFONTS"+ , "PATH"+ , "PDFTEXCONFIG"+ , "PROGRAMFONTS"+ , "PSHEADERS"+ , "PWD"+ , "RISINPUTS"+ , "SELFAUTODIR"+ , "SELFAUTOLOC"+ , "SELFAUTOPARENT"+ , "SFDFONTS"+ , "SHELL"+ , "SOURCE_DATE_EPOCH"+ , "T1FONTS"+ , "T1INPUTS"+ , "T42FONTS"+ , "TEXBIB"+ , "TEXCONFIG"+ , "TEXDOCS"+ , "TEXFONTMAPS"+ , "TEXFONTS"+ , "TEXFORMATS"+ , "TEXINDEXSTYLE"+ , "TEXINPUTS"+ , "TEXMFCNF"+ , "TEXMFDBS"+ , "TEXMFINI"+ , "TEXMFSCRIPTS"+ , "TEXMFVAR"+ , "TEXPICTS"+ , "TEXPKS"+ , "TEXPOOL"+ , "TEXPSHEADERS"+ , "TEXSOURCES"+ , "TEX_HUSH"+ , "TFMFONTS"+ , "TMPDIR"+ , "TRFONTS"+ , "TTFONTS"+ , "USERPROFILE"+ , "USE_TEXMFVAR"+ , "USE_VARTEXFONTS"+ , "VARTEXFONTS"+ , "VFFONTS"+ , "WEB2C"+ , "WEBINPUTS"+ ]) || "TEXMF" `isPrefixOf` e+ report $ MakePDFInfo "Relevant environment variables:"+ (T.intercalate "\n" $ map tshow $ filter (isRelevant . fst) env)+ report $ MakePDFInfo "Source:" source++handlePDFProgramNotFound :: String -> IE.IOError -> IO a+handlePDFProgramNotFound program e+ | IE.isDoesNotExistError e =+ E.throwIO $ PandocPDFProgramNotFoundError $ T.pack program+ | otherwise = E.throwIO e++utf8ToText :: ByteString -> Text+utf8ToText lbs =+ case decodeUtf8' lbs of+ Left _ -> T.pack $ BC.unpack lbs -- if decoding fails, treat as latin1+ Right t -> TL.toStrict t
@@ -1,1225 +1,355 @@-{-# LANGUAGE- FlexibleContexts-, GeneralizedNewtypeDeriving-, TypeSynonymInstances-, MultiParamTypeClasses-, FlexibleInstances #-}-{--Copyright (C) 2006-2014 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.Parsing- Copyright : Copyright (C) 2006-2014 John MacFarlane- License : GNU GPL, version 2 or above-- Maintainer : John MacFarlane <jgm@berkeley.edu>- Stability : alpha- Portability : portable--A utility library with parsers used in pandoc readers.--}-module Text.Pandoc.Parsing ( anyLine,- many1Till,- notFollowedBy',- oneOfStrings,- oneOfStringsCI,- spaceChar,- nonspaceChar,- skipSpaces,- blankline,- blanklines,- enclosed,- stringAnyCase,- parseFromString,- lineClump,- charsInBalanced,- romanNumeral,- emailAddress,- uri,- mathInline,- mathDisplay,- withHorizDisplacement,- withRaw,- escaped,- characterReference,- anyOrderedListMarker,- orderedListMarker,- charRef,- lineBlockLines,- tableWith,- widthsFromIndices,- gridTableWith,- readWith,- readWithM,- testStringWith,- guardEnabled,- guardDisabled,- updateLastStrPos,- notAfterString,- ParserState (..),- HasReaderOptions (..),- HasHeaderMap (..),- HasIdentifierList (..),- HasMacros (..),- HasLastStrPosition (..),- defaultParserState,- HeaderType (..),- ParserContext (..),- QuoteContext (..),- HasQuoteContext (..),- NoteTable,- NoteTable',- KeyTable,- SubstTable,- Key (..),- toKey,- registerHeader,- smartPunctuation,- singleQuoteStart,- singleQuoteEnd,- doubleQuoteStart,- doubleQuoteEnd,- ellipses,- apostrophe,- dash,- nested,- citeKey,- macro,- applyMacros',- Parser,- ParserT,- F(..),- runF,- askF,- asksF,- token,- -- * Re-exports from Text.Pandoc.Parsec- Stream,- runParser,- runParserT,- parse,- anyToken,- getInput,- setInput,- unexpected,- char,- letter,- digit,- alphaNum,- skipMany,- skipMany1,- spaces,- space,- anyChar,- satisfy,- newline,- string,- count,- eof,- noneOf,- oneOf,- lookAhead,- notFollowedBy,- many,- many1,- manyTill,- (<|>),- (<?>),- choice,- try,- sepBy,- sepBy1,- sepEndBy,- sepEndBy1,- endBy,- endBy1,- option,- optional,- optionMaybe,- getState,- setState,- updateState,- SourcePos,- getPosition,- setPosition,- sourceColumn,- sourceLine,- setSourceColumn,- setSourceLine,- newPos,- )-where--import Text.Pandoc.Definition-import Text.Pandoc.Options-import Text.Pandoc.Builder (Blocks, Inlines, rawBlock, HasMeta(..))-import qualified Text.Pandoc.Builder as B-import Text.Pandoc.XML (fromEntities)-import qualified Text.Pandoc.UTF8 as UTF8 (putStrLn)-import Text.Parsec hiding (token)-import Text.Parsec.Pos (newPos)-import Data.Char ( toLower, toUpper, ord, chr, isAscii, isAlphaNum,- isHexDigit, isSpace )-import Data.List ( intercalate, transpose )-import Text.Pandoc.Shared-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 Data.Default-import qualified Data.Set as Set-import Control.Monad.Reader-import Control.Monad.Identity-import Control.Applicative ((<$>), (<*>), (*>), (<*), (<$), Applicative)-import Data.Monoid-import Data.Maybe (catMaybes)--type Parser t s = Parsec t s--type ParserT = ParsecT--newtype F a = F { unF :: Reader ParserState a } deriving (Monad, Applicative, Functor)--runF :: F a -> ParserState -> a-runF = runReader . unF--askF :: F ParserState-askF = F ask--asksF :: (ParserState -> a) -> F a-asksF f = F $ asks f--instance Monoid a => Monoid (F a) where- mempty = return mempty- mappend = liftM2 mappend- mconcat = liftM mconcat . sequence---- | Parse any line of text-anyLine :: Stream [Char] m Char => ParserT [Char] st m [Char]-anyLine = do- -- This is much faster than:- -- manyTill anyChar newline- inp <- getInput- pos <- getPosition- case break (=='\n') inp of- (this, '\n':rest) -> do- -- needed to persuade parsec that this won't match an empty string:- anyChar- setInput rest- setPosition $ incSourceLine (setSourceColumn pos 1) 1- return this- _ -> mzero---- | Like @manyTill@, but reads at least one item.-many1Till :: Stream s m t- => ParserT s st m a- -> ParserT s st m end- -> ParserT s st m [a]-many1Till p end = do- first <- p- rest <- manyTill p end- return (first:rest)---- | A more general form of @notFollowedBy@. This one allows any--- type of parser to be specified, and succeeds only if that parser fails.--- It does not consume any input.-notFollowedBy' :: (Show b, Stream s m a) => ParserT s st m b -> ParserT s st m ()-notFollowedBy' p = try $ join $ do a <- try p- return (unexpected (show a))- <|>- return (return ())--- (This version due to Andrew Pimlott on the Haskell mailing list.)--oneOfStrings' :: Stream s m Char => (Char -> Char -> Bool) -> [String] -> ParserT s st m String-oneOfStrings' _ [] = fail "no strings"-oneOfStrings' matches strs = try $ do- c <- anyChar- let strs' = [xs | (x:xs) <- strs, x `matches` c]- case strs' of- [] -> fail "not found"- _ -> (c:) <$> oneOfStrings' matches strs'- <|> if "" `elem` strs'- then return [c]- else fail "not found"---- | Parses one of a list of strings. If the list contains--- two strings one of which is a prefix of the other, the longer--- string will be matched if possible.-oneOfStrings :: Stream s m Char => [String] -> ParserT s st m String-oneOfStrings = oneOfStrings' (==)---- | Parses one of a list of strings (tried in order), case insensitive.-oneOfStringsCI :: Stream s m Char => [String] -> ParserT s st m String-oneOfStringsCI = oneOfStrings' ciMatch- where ciMatch x y = toLower' x == toLower' y- -- this optimizes toLower by checking common ASCII case- -- first, before calling the expensive unicode-aware- -- function:- toLower' c | c >= 'A' && c <= 'Z' = chr (ord c + 32)- | isAscii c = c- | otherwise = toLower c---- | Parses a space or tab.-spaceChar :: Stream s m Char => ParserT s st m Char-spaceChar = satisfy $ \c -> c == ' ' || c == '\t'---- | Parses a nonspace, nonnewline character.-nonspaceChar :: Stream s m Char => ParserT s st m Char-nonspaceChar = satisfy $ flip notElem ['\t', '\n', ' ', '\r']---- | Skips zero or more spaces or tabs.-skipSpaces :: Stream s m Char => ParserT s st m ()-skipSpaces = skipMany spaceChar---- | Skips zero or more spaces or tabs, then reads a newline.-blankline :: Stream s m Char => ParserT s st m Char-blankline = try $ skipSpaces >> newline---- | Parses one or more blank lines and returns a string of newlines.-blanklines :: Stream s m Char => ParserT s st m [Char]-blanklines = many1 blankline---- | Parses material enclosed between start and end parsers.-enclosed :: Stream s m Char => ParserT s st m t -- ^ start parser- -> ParserT s st m end -- ^ end parser- -> ParserT s st m a -- ^ content parser (to be used repeatedly)- -> ParserT s st m [a]-enclosed start end parser = try $- start >> notFollowedBy space >> many1Till parser end---- | Parse string, case insensitive.-stringAnyCase :: Stream s m Char => [Char] -> ParserT s st m String-stringAnyCase [] = string ""-stringAnyCase (x:xs) = do- firstChar <- char (toUpper x) <|> char (toLower x)- rest <- stringAnyCase xs- return (firstChar:rest)---- | Parse contents of 'str' using 'parser' and return result.-parseFromString :: Stream s m t => ParserT s st m a -> s -> ParserT s st m a-parseFromString parser str = do- oldPos <- getPosition- oldInput <- getInput- setInput str- result <- parser- setInput oldInput- setPosition oldPos- return result---- | Parse raw line block up to and including blank lines.-lineClump :: Stream [Char] m Char => ParserT [Char] st m String-lineClump = blanklines- <|> (many1 (notFollowedBy blankline >> anyLine) >>= return . unlines)---- | Parse a string of characters between an open character--- and a close character, including text between balanced--- pairs of open and close, which must be different. For example,--- @charsInBalanced '(' ')' anyChar@ will parse "(hello (there))"--- and return "hello (there)".-charsInBalanced :: Stream s m Char => Char -> Char -> ParserT s st m Char- -> ParserT s st m String-charsInBalanced open close parser = try $ do- char open- let isDelim c = c == open || c == close- raw <- many $ many1 (notFollowedBy (satisfy isDelim) >> parser)- <|> (do res <- charsInBalanced open close parser- return $ [open] ++ res ++ [close])- char close- return $ concat raw---- old charsInBalanced would be:--- charsInBalanced open close (noneOf "\n" <|> char '\n' >> notFollowedBy blankline)--- old charsInBalanced' would be:--- charsInBalanced open close anyChar---- Auxiliary functions for romanNumeral:--lowercaseRomanDigits :: [Char]-lowercaseRomanDigits = ['i','v','x','l','c','d','m']--uppercaseRomanDigits :: [Char]-uppercaseRomanDigits = map toUpper lowercaseRomanDigits---- | Parses a roman numeral (uppercase or lowercase), returns number.-romanNumeral :: Stream s m Char => Bool -- ^ Uppercase if true- -> ParserT s st m Int-romanNumeral upperCase = do- let romanDigits = if upperCase- then uppercaseRomanDigits- else lowercaseRomanDigits- lookAhead $ oneOf romanDigits- let [one, five, ten, fifty, hundred, fivehundred, thousand] =- map char romanDigits- thousands <- many thousand >>= (return . (1000 *) . length)- ninehundreds <- option 0 $ try $ hundred >> thousand >> return 900- fivehundreds <- many fivehundred >>= (return . (500 *) . length)- fourhundreds <- option 0 $ try $ hundred >> fivehundred >> return 400- hundreds <- many hundred >>= (return . (100 *) . length)- nineties <- option 0 $ try $ ten >> hundred >> return 90- fifties <- many fifty >>= (return . (50 *) . length)- forties <- option 0 $ try $ ten >> fifty >> return 40- tens <- many ten >>= (return . (10 *) . length)- nines <- option 0 $ try $ one >> ten >> return 9- fives <- many five >>= (return . (5 *) . length)- fours <- option 0 $ try $ one >> five >> return 4- ones <- many one >>= (return . length)- let total = thousands + ninehundreds + fivehundreds + fourhundreds +- hundreds + nineties + fifties + forties + tens + nines +- fives + fours + ones- if total == 0- then fail "not a roman numeral"- else return total---- Parsers for email addresses and URIs---- | Parses an email address; returns original and corresponding--- escaped mailto: URI.-emailAddress :: Stream s m Char => ParserT s st m (String, String)-emailAddress = try $ toResult <$> mailbox <*> (char '@' *> domain)- where toResult mbox dom = let full = fromEntities $ mbox ++ '@':dom- in (full, escapeURI $ "mailto:" ++ full)- mailbox = intercalate "." <$> (emailWord `sepby1` dot)- domain = intercalate "." <$> (subdomain `sepby1` dot)- dot = char '.'- subdomain = many1 $ alphaNum <|> innerPunct- innerPunct = try (satisfy (\c -> isEmailPunct c || c == '@') <*- notFollowedBy space)- emailWord = many1 $ satisfy isEmailChar- isEmailChar c = isAlphaNum c || isEmailPunct c- isEmailPunct c = c `elem` "!\"#$%&'*+-/=?^_{|}~;"- -- note: sepBy1 from parsec consumes input when sep- -- succeeds and p fails, so we use this variant here.- sepby1 p sep = (:) <$> p <*> (many (try $ sep >> p))----- Schemes from http://www.iana.org/assignments/uri-schemes.html plus--- the unofficial schemes coap, doi, javascript, isbn, pmid-schemes :: [String]-schemes = ["coap","doi","javascript","aaa","aaas","about","acap","cap","cid",- "crid","data","dav","dict","dns","file","ftp","geo","go","gopher",- "h323","http","https","iax","icap","im","imap","info","ipp","iris",- "iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid",- "msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp",- "opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve",- "sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet",- "tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon",- "xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s",- "adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin",- "bolo","callto","chrome","chrome-extension","com-eventbrite-attendee",- "content", "cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb",- "ed2k","facetime","feed","finger","fish","gg","git","gizmoproject",- "gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms",- "keyparc","lastfm","ldaps","magnet","maps","market","message","mms",- "ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi",- "platform","proxy","psyc","query","res","resource","rmi","rsync",- "rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify",- "ssh","steam","svn","teamspeak","things","udp","unreal","ut2004",- "ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri",- "ymsgr", "isbn", "pmid"]--uriScheme :: Stream s m Char => ParserT s st m String-uriScheme = oneOfStringsCI schemes---- | Parses a URI. Returns pair of original and URI-escaped version.-uri :: Stream [Char] m Char => ParserT [Char] st m (String, String)-uri = try $ do- scheme <- uriScheme- char ':'- -- We allow punctuation except at the end, since- -- we don't want the trailing '.' in 'http://google.com.' We want to allow- -- http://en.wikipedia.org/wiki/State_of_emergency_(disambiguation)- -- as a URL, while NOT picking up the closing paren in- -- (http://wikipedia.org). So we include balanced parens in the URL.- let isWordChar c = isAlphaNum c || c == '_' || c == '/' || c == '+' ||- not (isAscii c)- let wordChar = satisfy isWordChar- let percentEscaped = try $ char '%' >> skipMany1 (satisfy isHexDigit)- let entity = () <$ characterReference- let punct = skipMany1 (char ',')- <|> () <$ (satisfy (\c -> not (isSpace c) && c /= '<'))- let uriChunk = skipMany1 wordChar- <|> percentEscaped- <|> entity- <|> (try $ punct >>- lookAhead (void (satisfy isWordChar) <|> percentEscaped))- str <- snd <$> withRaw (skipMany1 ( () <$- (enclosed (char '(') (char ')') uriChunk- <|> enclosed (char '{') (char '}') uriChunk- <|> enclosed (char '[') (char ']') uriChunk)- <|> uriChunk))- str' <- option str $ char '/' >> return (str ++ "/")- let uri' = scheme ++ ":" ++ fromEntities str'- return (uri', escapeURI uri')--mathInlineWith :: Stream s m Char => String -> String -> ParserT s st m String-mathInlineWith op cl = try $ do- string op- notFollowedBy space- words' <- many1Till (count 1 (noneOf " \t\n\\")- <|> (char '\\' >> anyChar >>= \c -> return ['\\',c])- <|> do (blankline <* notFollowedBy' blankline) <|>- (oneOf " \t" <* skipMany (oneOf " \t"))- notFollowedBy (char '$')- return " "- ) (try $ string cl)- notFollowedBy digit -- to prevent capture of $5- return $ concat words'--mathDisplayWith :: Stream s m Char => String -> String -> ParserT s st m String-mathDisplayWith op cl = try $ do- string op- many1Till (noneOf "\n" <|> (newline <* notFollowedBy' blankline)) (try $ string cl)--mathDisplay :: (HasReaderOptions st, Stream s m Char)- => ParserT s st m String-mathDisplay =- (guardEnabled Ext_tex_math_dollars >> mathDisplayWith "$$" "$$")- <|> (guardEnabled Ext_tex_math_single_backslash >>- mathDisplayWith "\\[" "\\]")- <|> (guardEnabled Ext_tex_math_double_backslash >>- mathDisplayWith "\\\\[" "\\\\]")--mathInline :: (HasReaderOptions st , Stream s m Char)- => ParserT s st m String-mathInline =- (guardEnabled Ext_tex_math_dollars >> mathInlineWith "$" "$")- <|> (guardEnabled Ext_tex_math_single_backslash >>- mathInlineWith "\\(" "\\)")- <|> (guardEnabled Ext_tex_math_double_backslash >>- mathInlineWith "\\\\(" "\\\\)")---- | Applies a parser, returns tuple of its results and its horizontal--- displacement (the difference between the source column at the end--- and the source column at the beginning). Vertical displacement--- (source row) is ignored.-withHorizDisplacement :: Stream s m Char- => ParserT s st m a -- ^ Parser to apply- -> ParserT s st m (a, Int) -- ^ (result, displacement)-withHorizDisplacement parser = do- pos1 <- getPosition- result <- parser- pos2 <- getPosition- return (result, sourceColumn pos2 - sourceColumn pos1)---- | Applies a parser and returns the raw string that was parsed,--- along with the value produced by the parser.-withRaw :: Stream [Char] m Char => ParsecT [Char] st m a -> ParsecT [Char] st m (a, [Char])-withRaw parser = do- pos1 <- getPosition- inp <- getInput- result <- parser- pos2 <- getPosition- let (l1,c1) = (sourceLine pos1, sourceColumn pos1)- let (l2,c2) = (sourceLine pos2, sourceColumn pos2)- let inplines = take ((l2 - l1) + 1) $ lines inp- let raw = case inplines of- [] -> ""- [l] -> take (c2 - c1) l- ls -> unlines (init ls) ++ take (c2 - 1) (last ls)- return (result, raw)---- | Parses backslash, then applies character parser.-escaped :: Stream s m Char- => ParserT s st m Char -- ^ Parser for character to escape- -> ParserT s st m Char-escaped parser = try $ char '\\' >> parser---- | Parse character entity.-characterReference :: Stream s m Char => ParserT s st m Char-characterReference = try $ do- char '&'- ent <- many1Till nonspaceChar (char ';')- case lookupEntity ent of- Just c -> return c- Nothing -> fail "entity not found"---- | Parses an uppercase roman numeral and returns (UpperRoman, number).-upperRoman :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)-upperRoman = do- num <- romanNumeral True- return (UpperRoman, num)---- | Parses a lowercase roman numeral and returns (LowerRoman, number).-lowerRoman :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)-lowerRoman = do- num <- romanNumeral False- return (LowerRoman, num)---- | Parses a decimal numeral and returns (Decimal, number).-decimal :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)-decimal = do- num <- many1 digit- return (Decimal, read num)---- | Parses a '@' and optional label and--- returns (DefaultStyle, [next example number]). The next--- example number is incremented in parser state, and the label--- (if present) is added to the label table.-exampleNum :: Stream s m Char- => ParserT s ParserState m (ListNumberStyle, Int)-exampleNum = do- char '@'- lab <- many (alphaNum <|> satisfy (\c -> c == '_' || c == '-'))- st <- getState- let num = stateNextExample st- let newlabels = if null lab- then stateExamples st- else M.insert lab num $ stateExamples st- updateState $ \s -> s{ stateNextExample = num + 1- , stateExamples = newlabels }- return (Example, num)---- | Parses a '#' returns (DefaultStyle, 1).-defaultNum :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)-defaultNum = do- char '#'- return (DefaultStyle, 1)---- | Parses a lowercase letter and returns (LowerAlpha, number).-lowerAlpha :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)-lowerAlpha = do- ch <- oneOf ['a'..'z']- return (LowerAlpha, ord ch - ord 'a' + 1)---- | Parses an uppercase letter and returns (UpperAlpha, number).-upperAlpha :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)-upperAlpha = do- ch <- oneOf ['A'..'Z']- return (UpperAlpha, ord ch - ord 'A' + 1)---- | Parses a roman numeral i or I-romanOne :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)-romanOne = (char 'i' >> return (LowerRoman, 1)) <|>- (char 'I' >> return (UpperRoman, 1))---- | Parses an ordered list marker and returns list attributes.-anyOrderedListMarker :: Stream s m Char => ParserT s ParserState m ListAttributes-anyOrderedListMarker = choice $- [delimParser numParser | delimParser <- [inPeriod, inOneParen, inTwoParens],- numParser <- [decimal, exampleNum, defaultNum, romanOne,- lowerAlpha, lowerRoman, upperAlpha, upperRoman]]---- | Parses a list number (num) followed by a period, returns list attributes.-inPeriod :: Stream s m Char- => ParserT s st m (ListNumberStyle, Int)- -> ParserT s st m ListAttributes-inPeriod num = try $ do- (style, start) <- num- char '.'- let delim = if style == DefaultStyle- then DefaultDelim- else Period- return (start, style, delim)---- | Parses a list number (num) followed by a paren, returns list attributes.-inOneParen :: Stream s m Char- => ParserT s st m (ListNumberStyle, Int)- -> ParserT s st m ListAttributes-inOneParen num = try $ do- (style, start) <- num- char ')'- return (start, style, OneParen)---- | Parses a list number (num) enclosed in parens, returns list attributes.-inTwoParens :: Stream s m Char- => ParserT s st m (ListNumberStyle, Int)- -> ParserT s st m ListAttributes-inTwoParens num = try $ do- char '('- (style, start) <- num- char ')'- return (start, style, TwoParens)---- | Parses an ordered list marker with a given style and delimiter,--- returns number.-orderedListMarker :: Stream s m Char- => ListNumberStyle- -> ListNumberDelim- -> ParserT s ParserState m Int-orderedListMarker style delim = do- let num = defaultNum <|> -- # can continue any kind of list- case style of- DefaultStyle -> decimal- Example -> exampleNum- Decimal -> decimal- UpperRoman -> upperRoman- LowerRoman -> lowerRoman- UpperAlpha -> upperAlpha- LowerAlpha -> lowerAlpha- let context = case delim of- DefaultDelim -> inPeriod- Period -> inPeriod- OneParen -> inOneParen- TwoParens -> inTwoParens- (start, _, _) <- context num- return start---- | Parses a character reference and returns a Str element.-charRef :: Stream s m Char => ParserT s st m Inline-charRef = do- c <- characterReference- return $ Str [c]--lineBlockLine :: Stream [Char] m Char => ParserT [Char] st m String-lineBlockLine = try $ do- char '|'- char ' '- white <- many (spaceChar >> return '\160')- notFollowedBy newline- line <- anyLine- continuations <- many (try $ char ' ' >> anyLine)- return $ white ++ unwords (line : continuations)---- | Parses an RST-style line block and returns a list of strings.-lineBlockLines :: Stream [Char] m Char => ParserT [Char] st m [String]-lineBlockLines = try $ do- lines' <- many1 lineBlockLine- skipMany1 $ blankline <|> try (char '|' >> blankline)- return lines'---- | Parse a table using 'headerParser', 'rowParser',--- 'lineParser', and 'footerParser'.-tableWith :: Stream s m Char- => ParserT s ParserState m ([[Block]], [Alignment], [Int])- -> ([Int] -> ParserT s ParserState m [[Block]])- -> ParserT s ParserState m sep- -> ParserT s ParserState m end- -> ParserT s ParserState m Block-tableWith headerParser rowParser lineParser footerParser = try $ do- (heads, aligns, indices) <- headerParser- lines' <- rowParser indices `sepEndBy1` lineParser- footerParser- numColumns <- getOption readerColumns- let widths = if (indices == [])- then replicate (length aligns) 0.0- else widthsFromIndices numColumns indices- return $ Table [] aligns widths heads lines'---- Calculate relative widths of table columns, based on indices-widthsFromIndices :: Int -- Number of columns on terminal- -> [Int] -- Indices- -> [Double] -- Fractional relative sizes of columns-widthsFromIndices _ [] = []-widthsFromIndices numColumns' indices =- let numColumns = max numColumns' (if null indices then 0 else last indices)- lengths' = zipWith (-) indices (0:indices)- lengths = reverse $- case reverse lengths' of- [] -> []- [x] -> [x]- -- compensate for the fact that intercolumn- -- spaces are counted in widths of all columns- -- but the last...- (x:y:zs) -> if x < y && y - x <= 2- then y:y:zs- else x:y:zs- totLength = sum lengths- quotient = if totLength > numColumns- then fromIntegral totLength- else fromIntegral numColumns- fracs = map (\l -> (fromIntegral l) / quotient) lengths in- tail fracs--------- Parse a grid table: starts with row of '-' on top, then header--- (which may be grid), then the rows,--- which may be grid, separated by blank lines, and--- ending with a footer (dashed line followed by blank line).-gridTableWith :: Stream [Char] m Char- => ParserT [Char] ParserState m [Block] -- ^ Block list parser- -> Bool -- ^ Headerless table- -> ParserT [Char] ParserState m Block-gridTableWith blocks headless =- tableWith (gridTableHeader headless blocks) (gridTableRow blocks)- (gridTableSep '-') gridTableFooter--gridTableSplitLine :: [Int] -> String -> [String]-gridTableSplitLine indices line = map removeFinalBar $ tail $- splitStringByIndices (init indices) $ trimr line--gridPart :: Stream s m Char => Char -> ParserT s st m (Int, Int)-gridPart ch = do- dashes <- many1 (char ch)- char '+'- return (length dashes, length dashes + 1)--gridDashedLines :: Stream s m Char => Char -> ParserT s st m [(Int,Int)]-gridDashedLines ch = try $ char '+' >> many1 (gridPart ch) <* blankline--removeFinalBar :: String -> String-removeFinalBar =- reverse . dropWhile (`elem` " \t") . dropWhile (=='|') . reverse---- | Separator between rows of grid table.-gridTableSep :: Stream s m Char => Char -> ParserT s ParserState m Char-gridTableSep ch = try $ gridDashedLines ch >> return '\n'---- | Parse header for a grid table.-gridTableHeader :: Stream [Char] m Char- => Bool -- ^ Headerless table- -> ParserT [Char] ParserState m [Block]- -> ParserT [Char] ParserState m ([[Block]], [Alignment], [Int])-gridTableHeader headless blocks = try $ do- optional blanklines- dashes <- gridDashedLines '-'- rawContent <- if headless- then return $ repeat ""- else many1- (notFollowedBy (gridTableSep '=') >> char '|' >>- many1Till anyChar newline)- if headless- then return ()- else gridTableSep '=' >> return ()- let lines' = map snd dashes- let indices = scanl (+) 0 lines'- let aligns = replicate (length lines') AlignDefault- -- RST does not have a notion of alignments- let rawHeads = if headless- then replicate (length dashes) ""- else map (intercalate " ") $ transpose- $ map (gridTableSplitLine indices) rawContent- heads <- mapM (parseFromString blocks) $ map trim rawHeads- return (heads, aligns, indices)--gridTableRawLine :: Stream s m Char => [Int] -> ParserT s ParserState m [String]-gridTableRawLine indices = do- char '|'- line <- many1Till anyChar newline- return (gridTableSplitLine indices line)---- | Parse row of grid table.-gridTableRow :: Stream [Char] m Char- => ParserT [Char] ParserState m [Block]- -> [Int]- -> ParserT [Char] ParserState m [[Block]]-gridTableRow blocks indices = do- colLines <- many1 (gridTableRawLine indices)- let cols = map ((++ "\n") . unlines . removeOneLeadingSpace) $- transpose colLines- mapM (liftM compactifyCell . parseFromString blocks) cols--removeOneLeadingSpace :: [String] -> [String]-removeOneLeadingSpace xs =- if all startsWithSpace xs- then map (drop 1) xs- else xs- where startsWithSpace "" = True- startsWithSpace (y:_) = y == ' '--compactifyCell :: [Block] -> [Block]-compactifyCell bs = head $ compactify [bs]---- | Parse footer for a grid table.-gridTableFooter :: Stream s m Char => ParserT s ParserState m [Char]-gridTableFooter = blanklines--------- | Removes the ParsecT layer from the monad transformer stack-readWithM :: (Monad m, Functor m)- => ParserT [Char] st m a -- ^ parser- -> st -- ^ initial state- -> String -- ^ input- -> m a-readWithM parser state input =- handleError <$> (runParserT parser state "source" input)- where- handleError (Left err') =- let errPos = errorPos err'- errLine = sourceLine errPos- errColumn = sourceColumn errPos- theline = (lines input ++ [""]) !! (errLine - 1)- in error $ "\nError at " ++ show err' ++ "\n" ++- theline ++ "\n" ++ replicate (errColumn - 1) ' ' ++- "^"- handleError (Right result) = result---- | Parse a string with a given parser and state-readWith :: Parser [Char] st a- -> st- -> String- -> a-readWith p t inp = runIdentity $ readWithM p t inp---- | Parse a string with @parser@ (for testing).-testStringWith :: (Show a, Stream [Char] Identity Char)- => ParserT [Char] ParserState Identity a- -> [Char]- -> IO ()-testStringWith parser str = UTF8.putStrLn $ show $- readWith parser defaultParserState str---- | Parsing options.-data ParserState = ParserState- { stateOptions :: ReaderOptions, -- ^ User options- stateParserContext :: ParserContext, -- ^ Inside list?- stateQuoteContext :: QuoteContext, -- ^ Inside quoted environment?- stateAllowLinks :: Bool, -- ^ Allow parsing of links- stateMaxNestingLevel :: Int, -- ^ Max # of nested Strong/Emph- stateLastStrPos :: Maybe SourcePos, -- ^ Position after last str parsed- stateKeys :: KeyTable, -- ^ List of reference keys (with fallbacks)- stateSubstitutions :: SubstTable, -- ^ List of substitution references- stateNotes :: NoteTable, -- ^ List of notes (raw bodies)- stateNotes' :: NoteTable', -- ^ List of notes (parsed bodies)- stateMeta :: Meta, -- ^ Document metadata- stateMeta' :: F Meta, -- ^ Document metadata- stateHeaderTable :: [HeaderType], -- ^ Ordered list of header types used- stateHeaders :: M.Map Inlines String, -- ^ List of headers and ids (used for implicit ref links)- stateIdentifiers :: [String], -- ^ List of header identifiers used- stateNextExample :: Int, -- ^ Number of next example- stateExamples :: M.Map String Int, -- ^ Map from example labels to numbers- stateHasChapters :: Bool, -- ^ True if \chapter encountered- stateMacros :: [Macro], -- ^ List of macros defined so far- stateRstDefaultRole :: String, -- ^ Current rST default interpreted text role- stateRstCustomRoles :: M.Map String (String, Maybe String, Attr -> (String, Attr)), -- ^ Current rST custom text roles- -- Triple represents: 1) Base role, 2) Optional format (only for :raw:- -- roles), 3) Source language annotation for code (could be used to- -- annotate role classes too).- stateCaption :: Maybe Inlines, -- ^ Caption in current environment- stateInHtmlBlock :: Maybe String, -- ^ Tag type of HTML block being parsed- stateMarkdownAttribute :: Bool, -- ^ True if in markdown=1 context- stateWarnings :: [String] -- ^ Warnings generated by the parser- }--instance Default ParserState where- def = defaultParserState--instance HasMeta ParserState where- setMeta field val st =- st{ stateMeta = setMeta field val $ stateMeta st }- deleteMeta field st =- st{ stateMeta = deleteMeta field $ stateMeta st }--class HasReaderOptions st where- extractReaderOptions :: st -> ReaderOptions- getOption :: (Stream s m t) => (ReaderOptions -> b) -> ParserT s st m b- -- default- getOption f = (f . extractReaderOptions) <$> getState--class HasQuoteContext st m where- getQuoteContext :: (Stream s m t) => ParsecT s st m QuoteContext- withQuoteContext :: QuoteContext -> ParsecT s st m a -> ParsecT s st m a--instance Monad m => HasQuoteContext ParserState m where- getQuoteContext = stateQuoteContext <$> getState- withQuoteContext context parser = do- oldState <- getState- let oldQuoteContext = stateQuoteContext oldState- setState oldState { stateQuoteContext = context }- result <- parser- newState <- getState- setState newState { stateQuoteContext = oldQuoteContext }- return result--instance HasReaderOptions ParserState where- extractReaderOptions = stateOptions--class HasHeaderMap st where- extractHeaderMap :: st -> M.Map Inlines String- updateHeaderMap :: (M.Map Inlines String -> M.Map Inlines String) ->- st -> st--instance HasHeaderMap ParserState where- extractHeaderMap = stateHeaders- updateHeaderMap f st = st{ stateHeaders = f $ stateHeaders st }--class HasIdentifierList st where- extractIdentifierList :: st -> [String]- updateIdentifierList :: ([String] -> [String]) -> st -> st--instance HasIdentifierList ParserState where- extractIdentifierList = stateIdentifiers- updateIdentifierList f st = st{ stateIdentifiers = f $ stateIdentifiers st }--class HasMacros st where- extractMacros :: st -> [Macro]- updateMacros :: ([Macro] -> [Macro]) -> st -> st--instance HasMacros ParserState where- extractMacros = stateMacros- updateMacros f st = st{ stateMacros = f $ stateMacros st }--class HasLastStrPosition st where- setLastStrPos :: SourcePos -> st -> st- getLastStrPos :: st -> Maybe SourcePos--instance HasLastStrPosition ParserState where- setLastStrPos pos st = st{ stateLastStrPos = Just pos }- getLastStrPos st = stateLastStrPos st--defaultParserState :: ParserState-defaultParserState =- ParserState { stateOptions = def,- stateParserContext = NullState,- stateQuoteContext = NoQuote,- stateAllowLinks = True,- stateMaxNestingLevel = 6,- stateLastStrPos = Nothing,- stateKeys = M.empty,- stateSubstitutions = M.empty,- stateNotes = [],- stateNotes' = [],- stateMeta = nullMeta,- stateMeta' = return nullMeta,- stateHeaderTable = [],- stateHeaders = M.empty,- stateIdentifiers = [],- stateNextExample = 1,- stateExamples = M.empty,- stateHasChapters = False,- stateMacros = [],- stateRstDefaultRole = "title-reference",- stateRstCustomRoles = M.empty,- stateCaption = Nothing,- stateInHtmlBlock = Nothing,- stateMarkdownAttribute = False,- stateWarnings = []}---- | Succeed only if the extension is enabled.-guardEnabled :: (Stream s m a, HasReaderOptions st) => Extension -> ParserT s st m ()-guardEnabled ext = getOption readerExtensions >>= guard . Set.member ext---- | Succeed only if the extension is disabled.-guardDisabled :: (Stream s m a, HasReaderOptions st) => Extension -> ParserT s st m ()-guardDisabled ext = getOption readerExtensions >>= guard . not . Set.member ext---- | Update the position on which the last string ended.-updateLastStrPos :: (Stream s m a, HasLastStrPosition st) => ParserT s st m ()-updateLastStrPos = getPosition >>= updateState . setLastStrPos---- | Whether we are right after the end of a string.-notAfterString :: (Stream s m a, HasLastStrPosition st) => ParserT s st m Bool-notAfterString = do- pos <- getPosition- st <- getState- return $ getLastStrPos st /= Just pos--data HeaderType- = SingleHeader Char -- ^ Single line of characters underneath- | DoubleHeader Char -- ^ Lines of characters above and below- deriving (Eq, Show)--data ParserContext- = ListItemState -- ^ Used when running parser on list item contents- | NullState -- ^ Default state- deriving (Eq, Show)--data QuoteContext- = InSingleQuote -- ^ Used when parsing inside single quotes- | InDoubleQuote -- ^ Used when parsing inside double quotes- | NoQuote -- ^ Used when not parsing inside quotes- deriving (Eq, Show)--type NoteTable = [(String, String)]--type NoteTable' = [(String, F Blocks)] -- used in markdown reader--newtype Key = Key String deriving (Show, Read, Eq, Ord)--toKey :: String -> Key-toKey = Key . map toLower . unwords . words--type KeyTable = M.Map Key Target--type SubstTable = M.Map Key Inlines---- | Add header to the list of headers in state, together--- with its associated identifier. If the identifier is null--- and the auto_identifers extension is set, generate a new--- unique identifier, and update the list of identifiers--- in state.-registerHeader :: (Stream s m a, HasReaderOptions st, HasHeaderMap st, HasIdentifierList st)- => Attr -> Inlines -> ParserT s st m Attr-registerHeader (ident,classes,kvs) header' = do- ids <- extractIdentifierList <$> getState- exts <- getOption readerExtensions- let insert' = M.insertWith (\_new old -> old)- if null ident && Ext_auto_identifiers `Set.member` exts- then do- let id' = uniqueIdent (B.toList header') ids- let id'' = if Ext_ascii_identifiers `Set.member` exts- then catMaybes $ map toAsciiChar id'- else id'- updateState $ updateIdentifierList $- if id' == id'' then (id' :) else ([id', id''] ++)- updateState $ updateHeaderMap $ insert' header' id'- return (id'',classes,kvs)- else do- unless (null ident) $- updateState $ updateHeaderMap $ insert' header' ident- return (ident,classes,kvs)---- | Fail unless we're in "smart typography" mode.-failUnlessSmart :: (Stream s m a, HasReaderOptions st) => ParserT s st m ()-failUnlessSmart = getOption readerSmart >>= guard--smartPunctuation :: (HasReaderOptions st, HasLastStrPosition st, HasQuoteContext st m, Stream s m Char)- => ParserT s st m Inlines- -> ParserT s st m Inlines-smartPunctuation inlineParser = do- failUnlessSmart- choice [ quoted inlineParser, apostrophe, dash, ellipses ]--apostrophe :: Stream s m Char => ParserT s st m Inlines-apostrophe = (char '\'' <|> char '\8217') >> return (B.str "\x2019")--quoted :: (HasLastStrPosition st, HasQuoteContext st m, Stream s m Char)- => ParserT s st m Inlines- -> ParserT s st m Inlines-quoted inlineParser = doubleQuoted inlineParser <|> singleQuoted inlineParser--singleQuoted :: (HasLastStrPosition st, HasQuoteContext st m, Stream s m Char)- => ParserT s st m Inlines- -> ParserT s st m Inlines-singleQuoted inlineParser = try $ do- singleQuoteStart- withQuoteContext InSingleQuote $ many1Till inlineParser singleQuoteEnd >>=- return . B.singleQuoted . mconcat--doubleQuoted :: (HasQuoteContext st m, Stream s m Char)- => ParserT s st m Inlines- -> ParserT s st m Inlines-doubleQuoted inlineParser = try $ do- doubleQuoteStart- withQuoteContext InDoubleQuote $ manyTill inlineParser doubleQuoteEnd >>=- return . B.doubleQuoted . mconcat--failIfInQuoteContext :: (HasQuoteContext st m, Stream s m t)- => QuoteContext- -> ParserT s st m ()-failIfInQuoteContext context = do- context' <- getQuoteContext- if context' == context- then fail "already inside quotes"- else return ()--charOrRef :: Stream s m Char => String -> ParserT s st m Char-charOrRef cs =- oneOf cs <|> try (do c <- characterReference- guard (c `elem` cs)- return c)--singleQuoteStart :: (HasLastStrPosition st, HasQuoteContext st m, Stream s m Char)- => ParserT s st m ()-singleQuoteStart = do- failIfInQuoteContext InSingleQuote- -- single quote start can't be right after str- guard =<< notAfterString- () <$ charOrRef "'\8216\145"--singleQuoteEnd :: Stream s m Char- => ParserT s st m ()-singleQuoteEnd = try $ do- charOrRef "'\8217\146"- notFollowedBy alphaNum--doubleQuoteStart :: (HasQuoteContext st m, Stream s m Char)- => ParserT s st m ()-doubleQuoteStart = do- failIfInQuoteContext InDoubleQuote- try $ do charOrRef "\"\8220\147"- notFollowedBy . satisfy $ flip elem [' ', '\t', '\n']--doubleQuoteEnd :: Stream s m Char- => ParserT s st m ()-doubleQuoteEnd = void (charOrRef "\"\8221\148")--ellipses :: Stream s m Char- => ParserT s st m Inlines-ellipses = try (string "..." >> return (B.str "\8230"))--dash :: (HasReaderOptions st, Stream s m Char)- => ParserT s st m Inlines-dash = try $ do- oldDashes <- getOption readerOldDashes- if oldDashes- then do- char '-'- (char '-' >> return (B.str "\8212"))- <|> (lookAhead digit >> return (B.str "\8211"))- else do- string "--"- (char '-' >> return (B.str "\8212"))- <|> return (B.str "\8211")---- This is used to prevent exponential blowups for things like:--- a**a*a**a*a**a*a**a*a**a*a**a*a**-nested :: Stream s m a- => ParserT s ParserState m a- -> ParserT s ParserState m a-nested p = do- nestlevel <- stateMaxNestingLevel <$> getState- guard $ nestlevel > 0- updateState $ \st -> st{ stateMaxNestingLevel = stateMaxNestingLevel st - 1 }- res <- p- updateState $ \st -> st{ stateMaxNestingLevel = nestlevel }- return res--citeKey :: (Stream s m Char, HasLastStrPosition st)- => ParserT s st m (Bool, String)-citeKey = try $ do- guard =<< notAfterString- suppress_author <- option False (char '-' *> return True)- char '@'- firstChar <- letter <|> char '_'- let regchar = satisfy (\c -> isAlphaNum c || c == '_')- let internal p = try $ p <* lookAhead regchar- rest <- many $ regchar <|> internal (oneOf ":.#$%&-+?<>~/")- let key = firstChar:rest- return (suppress_author, key)---token :: (Stream s m t)- => (t -> String)- -> (t -> SourcePos)- -> (t -> Maybe a)- -> ParsecT s st m a-token pp pos match = tokenPrim pp (\_ t _ -> pos t) match------- Macros------- | Parse a \newcommand or \renewcommand macro definition.-macro :: (Stream [Char] m Char, HasMacros st, HasReaderOptions st)- => ParserT [Char] st m Blocks-macro = do- apply <- getOption readerApplyMacros- inp <- getInput- case parseMacroDefinitions inp of- ([], _) -> mzero- (ms, rest) -> do def' <- count (length inp - length rest) anyChar- if apply- then do- updateState $ \st ->- updateMacros (ms ++) st- return mempty- else return $ rawBlock "latex" def'---- | Apply current macros to string.-applyMacros' :: (HasReaderOptions st, HasMacros st, Stream [Char] m Char)- => String- -> ParserT [Char] st m String-applyMacros' target = do- apply <- getOption readerApplyMacros- if apply- then do macros <- extractMacros <$> getState- return $ applyMacros macros target- else return target+{- |+ Module : Text.Pandoc.Parsing+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++A utility library with parsers used in pandoc readers.+-}++module Text.Pandoc.Parsing ( module Text.Pandoc.Sources,+ countChar,+ textStr,+ anyLine,+ anyLineNewline,+ indentWith,+ manyChar,+ many1Char,+ manyTillChar,+ many1TillChar,+ many1Till,+ manyUntil,+ manyUntilChar,+ sepBy1',+ notFollowedBy',+ oneOfStrings,+ oneOfStringsCI,+ spaceChar,+ nonspaceChar,+ skipSpaces,+ blankline,+ blanklines,+ gobbleSpaces,+ gobbleAtMostSpaces,+ enclosed,+ stringAnyCase,+ parseFromString,+ parseFromString',+ lineClump,+ charsInBalanced,+ romanNumeral,+ emailAddress,+ uri,+ mathInline,+ mathDisplay,+ withHorizDisplacement,+ withRaw,+ fromParsecError,+ escaped,+ characterReference,+ upperRoman,+ lowerRoman,+ decimal,+ lowerAlpha,+ upperAlpha,+ anyOrderedListMarker,+ orderedListMarker,+ charRef,+ lineBlockLines,+ tableWith,+ tableWith',+ tableWithSpans,+ tableWithSpans',+ widthsFromIndices,+ gridTableWith,+ gridTableWith',+ TableComponents (..),+ TableNormalization (..),+ toTableComponents,+ toTableComponents',+ toTableComponentsWithSpans,+ toTableComponentsWithSpans',+ singleRowSpans,+ singleColumnSpans,+ readWith,+ readWithM,+ testStringWith,+ guardEnabled,+ guardDisabled,+ updateLastStrPos,+ notAfterString,+ logMessage,+ reportLogMessages,+ ParserState (..),+ HasReaderOptions (..),+ HasIdentifierList (..),+ HasMacros (..),+ HasLogMessages (..),+ HasLastStrPosition (..),+ HasIncludeFiles (..),+ defaultParserState,+ HeaderType (..),+ ParserContext (..),+ QuoteContext (..),+ HasQuoteContext (..),+ NoteTable,+ NoteTable',+ KeyTable,+ SubstTable,+ Key (..),+ toKey,+ registerHeader,+ smartPunctuation,+ singleQuoteStart,+ singleQuoteEnd,+ doubleQuoteStart,+ doubleQuoteEnd,+ apostrophe,+ doubleCloseQuote,+ ellipses,+ dash,+ citeKey,+ Parsec,+ ParsecT,+ Future(..),+ runF,+ askF,+ asksF,+ returnF,+ trimInlinesF,+ token,+ (<+?>),+ extractIdClass,+ insertIncludedFile,+ -- * Re-exports from Text.Parsec+ Stream(..),+ runParser,+ runParserT,+ parse,+ tokenPrim,+ anyToken,+ getInput,+ setInput,+ unexpected,+ skipMany,+ skipMany1,+ count,+ eof,+ lookAhead,+ notFollowedBy,+ many,+ many1,+ manyTill,+ (<|>),+ (<?>),+ choice,+ try,+ sepBy,+ sepBy1,+ sepEndBy,+ sepEndBy1,+ endBy,+ endBy1,+ option,+ optional,+ optionMaybe,+ getState,+ setState,+ updateState,+ SourcePos,+ SourceName,+ updatePosString,+ getPosition,+ setPosition,+ sourceName,+ setSourceName,+ sourceColumn,+ sourceLine,+ setSourceColumn,+ setSourceLine,+ incSourceColumn,+ incSourceLine,+ newPos,+ initialPos,+ Line,+ Column,+ ParseError,+ errorMessages,+ messageString+ )+where++import Text.Pandoc.Sources+import Text.Parsec+ ( Parsec,+ ParsecT,+ SourcePos,+ SourceName,+ setSourceName,+ Column,+ Line,+ incSourceLine,+ incSourceColumn,+ setSourceLine,+ setSourceColumn,+ sourceLine,+ sourceColumn,+ sourceName,+ setSourceName,+ setPosition,+ getPosition,+ updateState,+ setState,+ getState,+ optionMaybe,+ optional,+ option,+ endBy1,+ endBy,+ sepEndBy1,+ sepEndBy,+ sepBy1,+ sepBy,+ try,+ choice,+ (<?>),+ (<|>),+ manyTill,+ many1,+ many,+ notFollowedBy,+ lookAhead,+ eof,+ count,+ skipMany1,+ skipMany,+ unexpected,+ setInput,+ getInput,+ anyToken,+ tokenPrim,+ parse,+ runParserT,+ runParser,+ ParseError,+ Stream(..) )+import Text.Parsec.Error (+ errorMessages,+ messageString )+import Text.Parsec.Pos (initialPos, newPos, updatePosString)+import Text.Pandoc.Parsing.Capabilities+ ( guardDisabled,+ guardEnabled,+ logMessage,+ notAfterString,+ reportLogMessages,+ updateLastStrPos,+ HasIdentifierList(..),+ HasIncludeFiles(..),+ HasLastStrPosition(..),+ HasLogMessages(..),+ HasMacros(..),+ HasQuoteContext(..),+ HasReaderOptions(..),+ QuoteContext(..) )+import Text.Pandoc.Parsing.Citations ( citeKey )+import Text.Pandoc.Parsing.General+ ( readWithM,+ (<+?>),+ anyLine,+ anyLineNewline,+ blankline,+ blanklines,+ charRef,+ characterReference,+ charsInBalanced,+ countChar,+ emailAddress,+ enclosed,+ escaped,+ extractIdClass,+ gobbleAtMostSpaces,+ gobbleSpaces,+ indentWith,+ insertIncludedFile,+ lineBlockLines,+ lineClump,+ many1Char,+ many1Till,+ many1TillChar,+ manyChar,+ manyTillChar,+ manyUntil,+ manyUntilChar,+ nonspaceChar,+ notFollowedBy',+ oneOfStrings,+ oneOfStringsCI,+ parseFromString,+ parseFromString',+ readWith,+ registerHeader,+ sepBy1',+ skipSpaces,+ spaceChar,+ stringAnyCase,+ testStringWith,+ textStr,+ token,+ trimInlinesF,+ uri,+ withHorizDisplacement,+ withRaw,+ fromParsecError )+import Text.Pandoc.Parsing.GridTable+ ( gridTableWith,+ gridTableWith',+ tableWith,+ tableWith',+ tableWithSpans,+ tableWithSpans',+ toTableComponents,+ toTableComponents',+ toTableComponentsWithSpans,+ toTableComponentsWithSpans',+ singleRowSpans,+ singleColumnSpans,+ widthsFromIndices,+ TableComponents(..),+ TableNormalization(..) )+import Text.Pandoc.Parsing.Lists+ ( anyOrderedListMarker,+ decimal,+ lowerAlpha,+ lowerRoman,+ orderedListMarker,+ romanNumeral,+ upperAlpha,+ upperRoman )+import Text.Pandoc.Parsing.Math ( mathDisplay, mathInline )+import Text.Pandoc.Parsing.Smart+ ( apostrophe,+ dash,+ doubleCloseQuote,+ doubleQuoteEnd,+ doubleQuoteStart,+ ellipses,+ singleQuoteEnd,+ singleQuoteStart,+ smartPunctuation )+import Text.Pandoc.Parsing.State+ ( defaultParserState,+ toKey,+ HeaderType(..),+ Key(..),+ KeyTable,+ NoteTable,+ NoteTable',+ ParserContext(..),+ ParserState(..),+ SubstTable )+import Text.Pandoc.Parsing.Future+ ( askF, asksF, returnF, runF, Future(..) )
@@ -0,0 +1,137 @@+{-# LANGUAGE MultiParamTypeClasses #-}+{- |+ Module : Text.Pandoc.Parsing+ Copyright : © 2006-2024 John MacFarlane+ License : GPL-2.0-or-later+ Maintainer : John MacFarlane <jgm@berkeley.edu>++Parser state capabilities.+-}+module Text.Pandoc.Parsing.Capabilities+ ( -- * Capabilities++ -- ** Element identifiers+ HasIdentifierList (..)++ -- ** Include files+ , HasIncludeFiles (..)++ -- ** String/Word boundaries+ , HasLastStrPosition (..)+ , updateLastStrPos+ , notAfterString++ -- ** Logging+ , HasLogMessages (..)+ , logMessage+ , reportLogMessages++ -- ** Macros+ , HasMacros (..)++ -- ** Quote context+ , QuoteContext (..)+ , HasQuoteContext (..)+ , failIfInQuoteContext++ -- ** Reader options+ , HasReaderOptions (..)+ , guardEnabled+ , guardDisabled+ )+where++import Control.Monad (guard, when)+import Data.Text (Text)+import Text.Parsec (SourcePos, Stream, ParsecT,+ getPosition, getState, updateState)+import Text.Pandoc.Class.PandocMonad (PandocMonad, report)+import Text.Pandoc.Logging (LogMessage)+import Text.Pandoc.Options+ ( Extension+ , ReaderOptions(readerExtensions)+ , extensionEnabled+ )+import Text.Pandoc.TeX (Macro)++import qualified Data.Map as M+import qualified Data.Set as Set++class HasReaderOptions st where+ extractReaderOptions :: st -> ReaderOptions+ getOption :: (Stream s m t) => (ReaderOptions -> b) -> ParsecT s st m b+ -- default+ getOption f = f . extractReaderOptions <$> getState++class HasQuoteContext st m where+ getQuoteContext :: (Stream s m t) => ParsecT s st m QuoteContext+ withQuoteContext :: QuoteContext -> ParsecT s st m a -> ParsecT s st m a++failIfInQuoteContext :: (HasQuoteContext st m, Stream s m t)+ => QuoteContext+ -> ParsecT s st m ()+failIfInQuoteContext context = do+ context' <- getQuoteContext+ when (context' == context) $ Prelude.fail "already inside quotes"++class HasIdentifierList st where+ extractIdentifierList :: st -> Set.Set Text+ updateIdentifierList :: (Set.Set Text -> Set.Set Text) -> st -> st++class HasMacros st where+ extractMacros :: st -> M.Map Text Macro+ updateMacros :: (M.Map Text Macro -> M.Map Text Macro) -> st -> st++class HasLastStrPosition st where+ setLastStrPos :: Maybe SourcePos -> st -> st+ getLastStrPos :: st -> Maybe SourcePos++class HasLogMessages st where+ addLogMessage :: LogMessage -> st -> st+ getLogMessages :: st -> [LogMessage]++class HasIncludeFiles st where+ getIncludeFiles :: st -> [Text]+ addIncludeFile :: Text -> st -> st+ dropLatestIncludeFile :: st -> st++-- | Add a log message.+logMessage :: (Stream s m a, HasLogMessages st)+ => LogMessage -> ParsecT s st m ()+logMessage msg = updateState (addLogMessage msg)++-- | Report all the accumulated log messages, according to verbosity level.+reportLogMessages :: (PandocMonad m, HasLogMessages st) => ParsecT s st m ()+reportLogMessages = do+ msgs <- getLogMessages <$> getState+ mapM_ report msgs++-- | Succeed only if the extension is enabled.+guardEnabled :: (Stream s m a, HasReaderOptions st)+ => Extension -> ParsecT s st m ()+guardEnabled ext =+ getOption readerExtensions >>= guard . extensionEnabled ext++-- | Succeed only if the extension is disabled.+guardDisabled :: (Stream s m a, HasReaderOptions st)+ => Extension -> ParsecT s st m ()+guardDisabled ext =+ getOption readerExtensions >>= guard . not . extensionEnabled ext++-- | Update the position on which the last string ended.+updateLastStrPos :: (Stream s m a, HasLastStrPosition st)+ => ParsecT s st m ()+updateLastStrPos = getPosition >>= updateState . setLastStrPos . Just++-- | Whether we are right after the end of a string.+notAfterString :: (Stream s m a, HasLastStrPosition st) => ParsecT s st m Bool+notAfterString = do+ pos <- getPosition+ st <- getState+ return $ getLastStrPos st /= Just pos++data QuoteContext+ = InSingleQuote -- ^ Used when parsing inside single quotes+ | InDoubleQuote -- ^ Used when parsing inside double quotes+ | NoQuote -- ^ Used when not parsing inside quotes+ deriving (Eq, Show)
@@ -0,0 +1,57 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+Module : Text.Pandoc.Parsing.Citations+Copyright : © 2006-2024 John MacFarlane+License : GPL-2.0-or-later+Maintainer : John MacFarlane <jgm@berkeley.edu>++Citation parsing.+-}++module Text.Pandoc.Parsing.Citations+ ( citeKey+ )+where++import Control.Monad (guard, MonadPlus(mzero))+import Data.Char (isAlphaNum , isSpace)+import Data.Text (Text)+import Text.Pandoc.Sources+import Text.Parsec+ ( (<|>)+ , Stream(..)+ , ParsecT+ , lookAhead+ , many+ , option+ , try+ )+import Text.Pandoc.Parsing.Capabilities (HasLastStrPosition, notAfterString)+import Text.Pandoc.Parsing.General++import qualified Data.Text as T++citeKey :: (Stream s m Char, UpdateSourcePos s Char, HasLastStrPosition st)+ => Bool -- ^ If True, allow expanded @{..} syntax.+ -> ParsecT s st m (Bool, Text)+citeKey allowBraced = try $ do+ guard =<< notAfterString+ suppress_author <- option False (True <$ char '-')+ char '@'+ key <- simpleCiteIdentifier+ <|> if allowBraced+ then charsInBalanced '{' '}'+ (T.singleton <$> (satisfy (not . isSpace)))+ else mzero+ return (suppress_author, key)++simpleCiteIdentifier :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Text+simpleCiteIdentifier = 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 ":.#$%&-+?<>~/") <|>+ try (oneOf ":/" <* lookAhead (char '/'))+ return $ T.pack $ firstChar:rest
@@ -0,0 +1,49 @@+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{- |+ Module : Text.Pandoc.Parsing.Future+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GPL-2.0-or-later+ Maintainer : John MacFarlane <jgm@berkeley.edu>++Future type for parsing.+-}++module Text.Pandoc.Parsing.Future+ ( Future (..)+ , runF+ , askF+ , asksF+ , returnF+ )+where++import Prelude hiding (Applicative(..))+import Control.Applicative (Applicative(..))+import Control.Monad.Reader+ ( asks, runReader, MonadReader(ask), Reader, ReaderT(ReaderT) )++-- | Reader monad wrapping the parser state. This is used to possibly+-- delay evaluation until all relevant information has been parsed and+-- made available in the parser state.+newtype Future s a = Future { runDelayed :: Reader s a }+ deriving (Monad, Applicative, Functor)++instance Semigroup a => Semigroup (Future s a) where+ (<>) = liftA2 (<>)++instance (Semigroup a, Monoid a) => Monoid (Future s a) where+ mempty = return mempty+ mappend = (<>)++-- | Run a delayed action with the given state.+runF :: Future s a -> s -> a+runF = runReader . runDelayed++askF :: Future s s+askF = Future ask++asksF :: (s -> a) -> Future s a+asksF f = Future $ asks f++returnF :: Monad m => a -> m (Future s a)+returnF = return . return
@@ -0,0 +1,763 @@+{-# LANGUAGE BangPatterns #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+Module : Text.Pandoc.Parsing.General+Copyright : © 2006-2024 John MacFarlane+License : GPL-2.0-or-later+Maintainer : John MacFarlane <jgm@berkeley.edu>++Parser combinators for pandoc format readers.+-}++module Text.Pandoc.Parsing.General+ ( (<+?>)+ , anyLine+ , anyLineNewline+ , blankline+ , blanklines+ , charRef+ , characterReference+ , charsInBalanced+ , countChar+ , emailAddress+ , enclosed+ , escaped+ , extractIdClass+ , gobbleAtMostSpaces+ , gobbleSpaces+ , indentWith+ , insertIncludedFile+ , isSpaceChar -- not re-exported from T.P.Parsing+ , lineBlockLines+ , lineClump+ , many1Char+ , many1Till+ , many1TillChar+ , manyChar+ , manyTillChar+ , manyUntil+ , manyUntilChar+ , nonspaceChar+ , notFollowedBy'+ , oneOfStrings+ , oneOfStringsCI+ , parseFromString+ , parseFromString'+ , readWith+ , readWithM+ , registerHeader+ , sepBy1'+ , skipSpaces+ , spaceChar+ , stringAnyCase+ , testStringWith+ , textStr+ , token+ , trimInlinesF+ , uri+ , withHorizDisplacement+ , withRaw+ , fromParsecError+ )+where++import Control.Monad+ ( join+ , liftM+ , unless+ , void+ , when+ , MonadPlus(mzero)+ )+import Control.Monad.Except ( MonadError(throwError) )+import Control.Monad.Identity ( Identity(..) )+import Data.Char+ ( chr+ , isAlphaNum+ , isAscii+ , isAsciiUpper+ , isSpace+ , ord+ , toLower+ , toUpper+ )+import Data.Functor (($>))+import Data.List (intercalate, sortOn)+import Data.Ord (Down(..))+import Data.Maybe (fromMaybe)+import Data.Text (Text)+import qualified Data.Text.Lazy.Builder as TB+import qualified Data.Text.Lazy as TL+import Text.Pandoc.Asciify (toAsciiText)+import Text.Pandoc.Builder (Attr, Inline(Str), Inlines, trimInlines)+import Text.Pandoc.Class.PandocMonad (PandocMonad, readFileFromDirs, report)+import Text.Pandoc.Logging+ ( LogMessage(CouldNotLoadIncludeFile, DuplicateIdentifier) )+import Text.Pandoc.Options+ ( extensionEnabled+ , Extension(Ext_auto_identifiers, Ext_ascii_identifiers)+ , ReaderOptions(readerTabStop, readerExtensions) )+import Text.Pandoc.Shared (tshow, uniqueIdent)+import Text.Pandoc.URI (schemes, escapeURI)+import Text.Pandoc.Sources+import Text.Pandoc.XML (fromEntities, lookupEntity)+import Text.Parsec+ ( (<|>)+ , Parsec+ , ParsecT+ , SourcePos+ , sourceLine+ , sourceColumn+ , sourceName+ , ParseError+ , errorPos+ , Stream(..)+ , between+ , choice+ , count+ , getInput+ , getPosition+ , getState+ , lookAhead+ , many+ , many1+ , manyTill+ , notFollowedBy+ , option+ , runParserT+ , setInput+ , setPosition+ , skipMany+ , sourceColumn+ , sourceName+ , tokenPrim+ , try+ , unexpected+ , updateState+ )+import Text.Parsec.Pos (initialPos, newPos)+import Text.Pandoc.Error+ ( PandocError(PandocParseError) )+import Text.Pandoc.Parsing.Capabilities+import Text.Pandoc.Parsing.State+import Text.Pandoc.Parsing.Future (Future (..))+import qualified Data.Set as Set+import qualified Data.Text as T+import qualified Text.Pandoc.Builder as B+import qualified Text.Pandoc.UTF8 as UTF8 (putStrLn)+import qualified Data.Bifunctor as Bifunctor++-- | Remove whitespace from start and end; just like @'trimInlines'@,+-- but lifted into the 'Future' type.+trimInlinesF :: Future s Inlines -> Future s Inlines+trimInlinesF = liftM trimInlines++-- | Like @count@, but packs its result+countChar :: (Stream s m Char, UpdateSourcePos s Char, Monad m)+ => Int+ -> ParsecT s st m Char+ -> ParsecT s st m Text+countChar n = fmap T.pack . count n++-- | Like @string@, but uses @Text@.+textStr :: (Stream s m Char, UpdateSourcePos s Char)+ => Text -> ParsecT s u m Text+textStr t = string (T.unpack t) $> t+++-- | Parse any line of text, returning the contents without the+-- final newline.+anyLine :: Monad m => ParsecT Sources st m Text+anyLine = do+ -- This is much faster than:+ -- manyTill anyChar newline+ inp <- getInput+ case inp of+ Sources [] -> mzero+ Sources ((fp,t):inps) ->+ -- we assume that lines don't span different input files+ case T.break (=='\n') t of+ (this, rest)+ | T.null rest+ , not (null inps) ->+ -- line may span different input files, so do it+ -- character by character+ T.pack <$> manyTill anyChar newline+ | otherwise -> do -- either end of inputs or newline in rest+ setInput $ Sources ((fp, rest):inps)+ char '\n' -- needed so parsec knows we won't match empty string+ -- and so source pos is updated+ return this++-- | Parse any line, include the final newline in the output+anyLineNewline :: Monad m => ParsecT Sources st m Text+anyLineNewline = (<> "\n") <$> anyLine++-- | Parse indent by specified number of spaces (or equiv. tabs)+indentWith :: (Stream s m Char, UpdateSourcePos s Char)+ => HasReaderOptions st+ => Int -> ParsecT s st m Text+indentWith num = do+ tabStop <- getOption readerTabStop+ if num < tabStop+ then countChar num (char ' ')+ else choice [ try (countChar num (char ' '))+ , try (char '\t' >> indentWith (num - tabStop)) ]++-- | Like @many@, but packs its result.+manyChar :: Stream s m t+ => ParsecT s st m Char+ -> ParsecT s st m Text+manyChar = fmap T.pack . many++-- | Like @many1@, but packs its result.+many1Char :: Stream s m t+ => ParsecT s st m Char+ -> ParsecT s st m Text+many1Char = fmap T.pack . many1++-- | Like @manyTill@, but packs its result.+manyTillChar :: Stream s m t+ => ParsecT s st m Char+ -> ParsecT s st m a+ -> ParsecT s st m Text+manyTillChar p = fmap T.pack . manyTill p++-- | Like @manyTill@, but reads at least one item.+many1Till :: (Show end, Stream s m t)+ => ParsecT s st m a+ -> ParsecT s st m end+ -> ParsecT s st m [a]+many1Till p end = do+ notFollowedBy' end+ first <- p+ rest <- manyTill p end+ return (first:rest)++-- | Like @many1Till@, but packs its result+many1TillChar :: (Show end, Stream s m t)+ => ParsecT s st m Char+ -> ParsecT s st m end+ -> ParsecT s st m Text+many1TillChar p = fmap T.pack . many1Till p++-- | Like @manyTill@, but also returns the result of end parser.+manyUntil :: ParsecT s u m a+ -> ParsecT s u m b+ -> ParsecT s u m ([a], b)+manyUntil p end = scan+ where scan =+ (do e <- end+ return ([], e)+ ) <|>+ (do x <- p+ (xs, e) <- scan+ return (x:xs, e))++-- | Like @manyUntil@, but also packs its result.+manyUntilChar :: ParsecT s u m Char+ -> ParsecT s u m b+ -> ParsecT s u m (Text, b)+manyUntilChar p = fmap go . manyUntil p+ where+ go (x, y) = (T.pack x, y)++-- | Like @sepBy1@ from Parsec,+-- but does not fail if it @sep@ succeeds and @p@ fails.+sepBy1' :: ParsecT s u m a+ -> ParsecT s u m sep+ -> ParsecT s u m [a]+sepBy1' p sep = (:) <$> p <*> many (try $ sep >> p)++-- | A more general form of @notFollowedBy@. This one allows any+-- type of parser to be specified, and succeeds only if that parser fails.+-- It does not consume any input.+notFollowedBy' :: (Show b, Stream s m a) => ParsecT s st m b -> ParsecT s st m ()+notFollowedBy' p = try $ join $ do a <- try p+ return (unexpected (show a))+ <|>+ return (return ())+-- (This version due to Andrew Pimlott on the Haskell mailing list.)++oneOfStrings' :: (Stream s m Char, UpdateSourcePos s Char)+ => (Char -> Char -> Bool) -> [Text] -> ParsecT s st m Text+oneOfStrings' _ [] = Prelude.fail "no strings to match"+oneOfStrings' matches strs =+ TL.toStrict . TB.toLazyText <$> try (go mempty strs)+ where+ go acc strs' = do+ c <- anyChar+ let strs'' = [t | Just (d, t) <- map T.uncons strs', matches c d]+ let !acc' = acc <> TB.singleton c+ case strs'' of+ [] -> Prelude.fail "not found"+ _ -> if any T.null strs''+ then option acc' (try (go acc' strs''))+ else go acc' strs''++-- | Parses one of a list of strings. If the list contains+-- two strings one of which is a prefix of the other, the longer+-- string will be matched if possible.+oneOfStrings :: (Stream s m Char, UpdateSourcePos s Char)+ => [Text] -> ParsecT s st m Text+oneOfStrings = oneOfStrings' (==)++-- | Parses one of a list of strings (tried in order), case insensitive.++-- TODO: This will not be accurate with general Unicode (neither+-- Text.toLower nor Text.toCaseFold can be implemented with a map)+oneOfStringsCI :: (Stream s m Char, UpdateSourcePos s Char)+ => [Text] -> ParsecT s st m Text+oneOfStringsCI = oneOfStrings' ciMatch+ where ciMatch x y = toLower' x == toLower' y+ -- this optimizes toLower by checking common ASCII case+ -- first, before calling the expensive unicode-aware+ -- function:+ toLower' c | isAsciiUpper c = chr (ord c + 32)+ | isAscii c = c+ | otherwise = toLower c++-- | Parses a space or tab.+spaceChar :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Char+spaceChar = satisfy $ \c -> c == ' ' || c == '\t'++-- | Parses a nonspace, nonnewline character.+nonspaceChar :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Char+nonspaceChar = satisfy (not . isSpaceChar)++isSpaceChar :: Char -> Bool+isSpaceChar ' ' = True+isSpaceChar '\t' = True+isSpaceChar '\n' = True+isSpaceChar '\r' = True+isSpaceChar _ = False++-- | Skips zero or more spaces or tabs.+skipSpaces :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m ()+skipSpaces = skipMany spaceChar++-- | Skips zero or more spaces or tabs, then reads a newline.+blankline :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Char+blankline = try $ skipSpaces >> newline++-- | Parses one or more blank lines and returns a string of newlines.+blanklines :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Text+blanklines = T.pack <$> many1 blankline++-- | Gobble n spaces; if tabs are encountered, expand them+-- and gobble some or all of their spaces, leaving the rest.+gobbleSpaces :: (HasReaderOptions st, Monad m)+ => Int -> ParsecT Sources st m ()+gobbleSpaces 0 = return ()+gobbleSpaces n+ | n < 0 = error "gobbleSpaces called with negative number"+ | otherwise = try $ do+ char ' ' <|> eatOneSpaceOfTab+ gobbleSpaces (n - 1)++eatOneSpaceOfTab :: (HasReaderOptions st, Monad m) => ParsecT Sources st m Char+eatOneSpaceOfTab = do+ lookAhead (char '\t')+ pos <- getPosition+ tabstop <- getOption readerTabStop+ -- replace the tab on the input stream with spaces+ let numSpaces = tabstop - ((sourceColumn pos - 1) `mod` tabstop)+ inp <- getInput+ setInput $+ case inp of+ Sources [] -> error "eatOneSpaceOfTab - empty Sources list"+ Sources ((fp,t):rest) ->+ -- drop the tab and add spaces+ Sources ((fp, T.replicate numSpaces " " <> T.drop 1 t):rest)+ char ' '++-- | Gobble up to n spaces; if tabs are encountered, expand them+-- and gobble some or all of their spaces, leaving the rest.+gobbleAtMostSpaces :: (HasReaderOptions st, Monad m)+ => Int -> ParsecT Sources st m Int+gobbleAtMostSpaces 0 = return 0+gobbleAtMostSpaces n+ | n < 0 = error "gobbleAtMostSpaces called with negative number"+ | otherwise = option 0 $ do+ char ' ' <|> eatOneSpaceOfTab+ (+ 1) <$> gobbleAtMostSpaces (n - 1)++-- | Parses material enclosed between start and end parsers.+enclosed :: (Show end, Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m t -- ^ start parser+ -> ParsecT s st m end -- ^ end parser+ -> ParsecT s st m a -- ^ content parser (to be used repeatedly)+ -> ParsecT s st m [a]+enclosed start end parser = try $+ start >> notFollowedBy space >> many1Till parser end++-- | Parse string, case insensitive.+stringAnyCase :: (Stream s m Char, UpdateSourcePos s Char)+ => Text -> ParsecT s st m Text+stringAnyCase t = TL.toStrict . TB.toLazyText <$> go (T.unpack t)+ where+ go [] = string "" $> mempty+ go (x:xs) = do+ c <- char (toUpper x) <|> char (toLower x)+ rest <- go xs+ pure $ TB.singleton c <> rest++-- TODO rewrite by just adding to Sources stream?+-- | Parse contents of 'str' using 'parser' and return result.+parseFromString :: Monad m+ => ParsecT Sources st m r+ -> Text+ -> ParsecT Sources st m r+parseFromString parser str = do+ oldPos <- getPosition+ oldInput <- getInput+ setInput $ toSources str+ setPosition $ initialPos $ sourceName oldPos <> "_chunk"+ result <- parser+ setInput oldInput+ setPosition oldPos+ return result++-- | Like 'parseFromString' but specialized for 'ParserState'.+-- This resets 'stateLastStrPos', which is almost always what we want.+parseFromString' :: (Monad m, HasLastStrPosition u)+ => ParsecT Sources u m a+ -> Text+ -> ParsecT Sources u m a+parseFromString' parser str = do+ oldLastStrPos <- getLastStrPos <$> getState+ updateState $ setLastStrPos Nothing+ res <- parseFromString parser str+ updateState $ setLastStrPos oldLastStrPos+ return res++-- | Parse raw line block up to and including blank lines.+lineClump :: Monad m => ParsecT Sources st m Text+lineClump = blanklines+ <|> (T.unlines <$> many1 (notFollowedBy blankline >> anyLine))++-- | Parse a string of characters between an open character+-- and a close character, including text between balanced+-- pairs of open and close, which must be different. For example,+-- @charsInBalanced '(' ')' (Data.Text.singleton <$> anyChar)@ will parse+-- "(hello (there))" and return "hello (there)".+charsInBalanced :: (Stream s m Char, UpdateSourcePos s Char)+ => Char -> Char -> ParsecT s st m Text -> ParsecT s st m Text+charsInBalanced open close parser = try $ do+ char open+ let isDelim c = c == open || c == close+ raw <- many $ mconcat <$> many1 (notFollowedBy (satisfy isDelim) >> parser)+ <|> (do res <- charsInBalanced open close parser+ return $ T.singleton open <> res <> T.singleton close)+ char close+ return $ mconcat raw++-- Parsers for email addresses and URIs++-- | Parses an email address; returns original and corresponding+-- escaped mailto: URI.+emailAddress :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (Text, Text)+emailAddress = try $ toResult <$> mailbox <*> (char '@' *> domain)+ where toResult mbox dom = let full = fromEntities $ T.pack $ mbox ++ '@':dom+ in (full, escapeURI $ "mailto:" <> full)+ mailbox = intercalate "." <$> (emailWord `sepBy1'` dot)+ domain = intercalate "." <$> (subdomain `sepBy1'` dot)+ dot = char '.'+ subdomain = many1 $ alphaNum <|> innerPunct (=='-')+ -- this excludes some valid email addresses, since an+ -- email could contain e.g. '__', but gives better results+ -- for our purposes, when combined with markdown parsing:+ innerPunct f = try (satisfy f+ <* notFollowedBy (satisfy (not . isAlphaNum)))+ -- technically an email address could begin with a symbol,+ -- but allowing this creates too many problems.+ -- See e.g. https://github.com/jgm/pandoc/issues/2940+ emailWord = do x <- satisfy isAlphaNum+ xs <- many (satisfy isEmailChar)+ return (x:xs)+ isEmailChar c = isAlphaNum c || isEmailPunct c+ isEmailPunct c = c `Set.member` emailPunctChars++emailPunctChars :: Set.Set Char+emailPunctChars = Set.fromList "!\"#$%&'*+-/=?^_{|}~;"++uriScheme :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m Text+uriScheme = oneOfStringsCI (Set.toList schemes)++-- | Parses a URI. Returns pair of original and URI-escaped version.+uri :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (Text, Text)+uri = try $ do+ scheme <- uriScheme+ char ':'+ -- Avoid parsing e.g. "**Notes:**" as a raw URI:+ notFollowedBy $ satisfy (\c -> c == '*' || c == '_' || c == ']')+ -- We allow sentence punctuation except at the end, since+ -- we don't want the trailing '.' in 'http://google.com.' We want to allow+ -- http://en.wikipedia.org/wiki/State_of_emergency_(disambiguation)+ -- as a URL, while NOT picking up the closing paren in+ -- (http://wikipedia.org). So we include balanced parens in the URL.+ str <- T.concat <$> many1 (uriChunkBetween '(' ')'+ <|> uriChunkBetween '{' '}'+ <|> uriChunkBetween '[' ']'+ <|> T.pack <$> uriChunk)+ str' <- option str $ char '/' >> return (str <> "/")+ let uri' = scheme <> ":" <> fromEntities str'+ return (uri', escapeURI uri')+ where+ isWordChar '#' = True+ isWordChar '$' = True+ isWordChar '%' = True+ isWordChar '+' = True+ isWordChar '/' = True+ isWordChar '@' = True+ isWordChar '\\' = True+ isWordChar '_' = True+ isWordChar '-' = True+ isWordChar '&' = True+ isWordChar '=' = True+ isWordChar c = isAlphaNum c++ wordChar = satisfy isWordChar+ percentEscaped = try $ (:) <$> char '%' <*> many1 hexDigit+ entity = try $ T.unpack <$> characterReference+ punct = try $ many1 (char ',') <|> fmap pure (satisfy (\c -> not (isSpace c) && c /= '<' && c /= '>'))+ uriChunk = many1 wordChar+ <|> percentEscaped+ <|> entity+ <|> try (punct <* lookAhead (void wordChar <|> void percentEscaped))+ uriChunkBetween l r = try $ do chunk <- between (char l) (char r) uriChunk+ return $ T.singleton l <> T.pack chunk <> T.singleton r++-- | Applies a parser, returns tuple of its results and its horizontal+-- displacement (the difference between the source column at the end+-- and the source column at the beginning). Vertical displacement+-- (source row) is ignored.+withHorizDisplacement :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m a -- ^ Parsec to apply+ -> ParsecT s st m (a, Int) -- ^ (result, displacement)+withHorizDisplacement parser = do+ pos1 <- getPosition+ result <- parser+ pos2 <- getPosition+ return (result, sourceColumn pos2 - sourceColumn pos1)++-- | Applies a parser and returns the raw string that was parsed,+-- along with the value produced by the parser.+withRaw :: Monad m+ => ParsecT Sources st m a+ -> ParsecT Sources st m (a, Text)+withRaw parser = do+ inps1 <- getInput+ result <- parser+ inps2 <- getInput+ -- 'raw' is the difference between inps1 and inps2+ return (result, sourcesDifference inps1 inps2)++sourcesDifference :: Sources -> Sources -> Text+sourcesDifference (Sources is1) (Sources is2) = go is1 is2+ where+ go inps1 inps2 =+ case (inps1, inps2) of+ ([], _) -> mempty+ (_, []) -> mconcat $ map snd inps1+ ((p1,t1):rest1, (p2, t2):rest2)+ | p1 == p2+ , t1 == t2 -> go rest1 rest2+ | p1 == p2+ , t1 /= t2 -> fromMaybe mempty $ T.stripSuffix t2 t1+ | otherwise -> t1 <> go rest1 inps2++-- | Parses backslash, then applies character parser.+escaped :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Char -- ^ Parsec for character to escape+ -> ParsecT s st m Char+escaped parser = try $ char '\\' >> parser++-- | Parse character entity.+characterReference :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m Text+characterReference = try $ do+ char '&'+ ent <- many1TillChar nonspaceChar (char ';')+ case lookupEntity (ent <> ";") of+ Just t -> return t+ _ -> Prelude.fail "entity not found"++-- | Parses a character reference and returns a Str element.+charRef :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m Inline+charRef = Str <$> characterReference++lineBlockLine :: Monad m => ParsecT Sources st m Text+lineBlockLine = try $ do+ char '|'+ char ' '+ white <- T.pack <$> many (spaceChar >> return '\160')+ notFollowedBy newline+ line <- anyLine+ continuations <- many (try $ char ' ' >> anyLine)+ return $ white <> T.unwords (line : continuations)++blankLineBlockLine :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m Char+blankLineBlockLine = try (char '|' >> blankline)++-- | Parses an RST-style line block and returns a list of strings.+lineBlockLines :: Monad m => ParsecT Sources st m [Text]+lineBlockLines = try $ do+ lines' <- many1 (lineBlockLine <|> (T.singleton <$> blankLineBlockLine))+ skipMany blankline+ return lines'+++-- | Removes the ParsecT layer from the monad transformer stack+readWithM :: (Monad m, ToSources t)+ => ParsecT Sources st m a -- ^ parser+ -> st -- ^ initial state+ -> t -- ^ input+ -> m (Either PandocError a)+readWithM parser state input =+ Bifunctor.first (fromParsecError sources)+ <$> runParserT parser state (initialSourceName sources) sources+ where+ sources = toSources input+++-- | Parse a string with a given parser and state+readWith :: ToSources t+ => Parsec Sources st a+ -> st+ -> t+ -> Either PandocError a+readWith p t inp = runIdentity $ readWithM p t inp++-- | Parse a string with @parser@ (for testing).+testStringWith :: Show a+ => ParsecT Sources ParserState Identity a+ -> Text+ -> IO ()+testStringWith parser str = UTF8.putStrLn $ tshow $+ readWith parser defaultParserState (toSources str)++-- | Add header to the list of headers in state, together+-- with its associated identifier. If the identifier is null+-- and the auto_identifiers extension is set, generate a new+-- unique identifier, and update the list of identifiers+-- in state. Issue a warning if an explicit identifier+-- is encountered that duplicates an earlier identifier+-- (explicit or automatically generated).+registerHeader :: (Stream s m a, HasReaderOptions st,+ HasLogMessages st, HasIdentifierList st)+ => Attr -> Inlines -> ParsecT s st m Attr+registerHeader (ident,classes,kvs) header' = do+ ids <- extractIdentifierList <$> getState+ exts <- getOption readerExtensions+ if T.null ident && Ext_auto_identifiers `extensionEnabled` exts+ then do+ let id' = uniqueIdent exts (B.toList header') ids+ let id'' = if Ext_ascii_identifiers `extensionEnabled` exts+ then toAsciiText id'+ else id'+ updateState $ updateIdentifierList $ Set.insert id'+ updateState $ updateIdentifierList $ Set.insert id''+ return (id'',classes,kvs)+ else do+ unless (T.null ident) $ do+ when (ident `Set.member` ids) $ do+ pos <- getPosition+ logMessage $ DuplicateIdentifier ident pos+ updateState $ updateIdentifierList $ Set.insert ident+ return (ident,classes,kvs)++token :: (Stream s m t)+ => (t -> Text)+ -> (t -> SourcePos)+ -> (t -> Maybe a)+ -> ParsecT s st m a+token pp pos match = tokenPrim (T.unpack . pp) (\_ t _ -> pos t) match++infixr 5 <+?>+(<+?>) :: (Monoid a) => ParsecT s st m a -> ParsecT s st m a -> ParsecT s st m a+a <+?> b = a >>= flip fmap (try b <|> return mempty) . mappend++extractIdClass :: Attr -> Attr+extractIdClass (ident, cls, kvs) = (ident', cls', kvs')+ where+ ident' = fromMaybe ident (lookup "id" kvs)+ cls' = maybe cls T.words $ lookup "class" kvs+ kvs' = filter (\(k,_) -> k /= "id" && k /= "class") kvs++insertIncludedFile :: (PandocMonad m, HasIncludeFiles st)+ => ParsecT a st m b -- ^ parser to apply+ -> (Text -> a) -- ^ convert Text to stream type+ -> [FilePath] -- ^ search path (directories)+ -> FilePath -- ^ path of file to include+ -> Maybe Int -- ^ start line (negative counts from end)+ -> Maybe Int -- ^ end line (negative counts from end)+ -> ParsecT a st m b+insertIncludedFile parser toStream dirs f mbstartline mbendline = do+ oldPos <- getPosition+ oldInput <- getInput+ containers <- getIncludeFiles <$> getState+ when (T.pack f `elem` containers) $+ throwError $ PandocParseError $ T.pack $ "Include file loop at " ++ show oldPos+ updateState $ addIncludeFile $ T.pack f+ mbcontents <- readFileFromDirs dirs f+ contents <- case mbcontents of+ Just s -> return $ exciseLines mbstartline mbendline s+ Nothing -> do+ report $ CouldNotLoadIncludeFile (T.pack f) oldPos+ return ""+ setInput $ toStream contents+ setPosition $ newPos f (fromMaybe 1 mbstartline) 1+ result <- parser+ setInput oldInput+ setPosition oldPos+ updateState dropLatestIncludeFile+ return result++exciseLines :: Maybe Int -> Maybe Int -> Text -> Text+exciseLines Nothing Nothing t = t+exciseLines mbstartline mbendline t =+ T.unlines $ take (endline' - (startline' - 1))+ $ drop (startline' - 1) contentLines+ where+ contentLines = T.lines t+ numLines = length contentLines+ startline' = case mbstartline of+ Nothing -> 1+ Just x | x >= 0 -> x+ | otherwise -> numLines + x -- negative from end+ endline' = case mbendline of+ Nothing -> numLines+ Just x | x >= 0 -> x+ | otherwise -> numLines + x -- negative from end++fromParsecError :: Sources -> ParseError -> PandocError+fromParsecError (Sources inputs) err' = PandocParseError msg+ where+ msg = "Error at " <> tshow err' <> errorContext+ errPos = errorPos err'+ errLine = sourceLine errPos+ errColumn = sourceColumn errPos+ errFile = sourceName errPos+ errorContext =+ case sortOn (Down . sourceLine . fst)+ [ (pos,t)+ | (pos,t) <- inputs+ , sourceName pos == errFile+ , sourceLine pos <= errLine+ ] of+ [] -> ""+ ((pos,txt):_) ->+ let ls = T.lines txt <> [""]+ ln = (errLine - sourceLine pos) + 1+ in case drop (ln - 1) ls of+ (l:_) | ln >= 1 ->+ T.concat ["\n", l+ ,"\n", T.replicate (errColumn - 1) " "+ ,"^"]+ _ -> ""
@@ -0,0 +1,308 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Parsing.GridTable+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GPL-2.0-or-later+ Maintainer : John MacFarlane <jgm@berkeley.edu>++Shared parsers for plaintext tables.+-}+module Text.Pandoc.Parsing.GridTable+ ( gridTableWith+ , gridTableWith'+ , tableWith+ , tableWith'+ , tableWithSpans+ , tableWithSpans'+ , widthsFromIndices+ -- * Components of a plain-text table+ , TableComponents (..)+ , TableNormalization (..)+ , toTableComponents+ , toTableComponents'+ , toTableComponentsWithSpans+ , toTableComponentsWithSpans'+ , singleRowSpans+ , singleColumnSpans+ )+where++import Data.Array (elems)+import Data.Text (Text)+import Safe (lastDef)+import Text.Pandoc.Options (ReaderOptions (readerColumns))+import Text.Pandoc.Builder (Blocks)+import Text.Pandoc.Definition+import Text.Pandoc.Parsing.Capabilities+import Text.Pandoc.Parsing.General+import Text.Pandoc.Sources+import Text.Parsec (Stream (..), ParsecT, optional, sepEndBy1, try)++import Data.Maybe (mapMaybe)+import qualified Data.Text as T+import qualified Text.GridTable as GT+import qualified Text.Pandoc.Builder as B++-- | Collection of components making up a Table block.+data TableComponents = TableComponents+ { tableAttr :: Attr+ , tableCaption :: Caption+ , tableColSpecs :: [ColSpec]+ , tableHead :: TableHead+ , tableBodies :: [TableBody]+ , tableFoot :: TableFoot+ }++-- | Creates a table block from the collection of table parts.+tableFromComponents :: TableComponents -> Blocks+tableFromComponents (TableComponents attr capt colspecs th tb tf) =+ B.tableWith attr capt colspecs th tb tf++-- | Bundles basic table components into a single value.+toTableComponents :: [Alignment] -> [Double] -> [[Blocks]] -> [[Blocks]]+ -> TableComponents+toTableComponents = toTableComponents' NoNormalization++-- | Bundles basic table components into a single value, performing+-- normalizations as necessary.+toTableComponents' :: TableNormalization+ -> [Alignment] -> [Double] -> [[Blocks]] -> [[Blocks]]+ -> TableComponents+toTableComponents' normalization aligns widths heads rows =+ toTableComponentsWithSpans' normalization aligns widths (singleSpansBlocks heads) (singleSpansBlocks rows)++-- | Bundles basic table components with span information into a single value.+toTableComponentsWithSpans :: [Alignment] -> [Double] -> [[(Blocks, RowSpan, ColSpan)]] -> [[(Blocks, RowSpan, ColSpan)]]+ -> TableComponents+toTableComponentsWithSpans = toTableComponentsWithSpans' NoNormalization++-- | Bundles basic table components with span information into a single value,+-- performing normalizations as necessary.+toTableComponentsWithSpans' :: TableNormalization+ -> [Alignment] -> [Double] -> [[(Blocks, RowSpan, ColSpan)]] -> [[(Blocks, RowSpan, ColSpan)]]+ -> TableComponents+toTableComponentsWithSpans' normalization aligns widths heads rows =+ let th = TableHead nullAttr (mapMaybe (toHeaderRow normalization) heads)+ tb = TableBody nullAttr 0 [] (map toRow rows)+ tf = TableFoot nullAttr []+ colspecs = toColSpecs aligns widths+ in TableComponents nullAttr B.emptyCaption colspecs th [tb] tf++-- | Combine a list of column alignments and column widths into a list+-- of column specifiers. Both input lists should have the same length.+toColSpecs :: [Alignment] -- ^ column alignments+ -> [Double] -- ^ column widths+ -> [ColSpec]+toColSpecs aligns widths = zip aligns (map fromWidth widths')+ where+ fromWidth n+ | n > 0 = ColWidth n+ | otherwise = ColWidthDefault++ -- renormalize widths if greater than 100%:+ totalWidth = sum widths+ widths' = if totalWidth < 1+ then widths+ else map (/ totalWidth) widths++-- | Whether the table header should be normalized, i.e., whether an header row+-- with only empty cells should be omitted.+data TableNormalization+ = NoNormalization+ | NormalizeHeader++--+-- Grid Tables+--++-- | Parse a grid table: starts with row of '-' on top, then header+-- (which may be grid), then the rows, which may be grid, separated by+-- blank lines, and ending with a footer (dashed line followed by blank+-- line).+gridTableWith :: (Monad m, Monad mf, HasLastStrPosition st, HasReaderOptions st)+ => ParsecT Sources st m (mf Blocks) -- ^ Block list parser+ -> ParsecT Sources st m (mf Blocks)+gridTableWith blocks = fmap tableFromComponents <$>+ gridTableWith' NoNormalization blocks++-- | Like @'gridTableWith'@, but returns 'TableComponents' instead of a+-- Table.+gridTableWith' :: (Monad m, Monad mf,+ HasReaderOptions st, HasLastStrPosition st)+ => TableNormalization+ -> ParsecT Sources st m (mf Blocks) -- ^ Block list parser+ -> ParsecT Sources st m (mf TableComponents)+gridTableWith' normalization blocks = do+ tbl <- GT.gridTable <* optional blanklines+ let blkTbl = GT.mapCells+ (\lns -> parseFromString' blocks+ . flip T.snoc '\n' -- ensure proper block parsing+ . T.unlines+ . removeOneLeadingSpace+ $ map T.stripEnd lns)+ tbl+ let rows = GT.rows blkTbl+ let toPandocCell (GT.Cell c (GT.RowSpan rs) (GT.ColSpan cs)) =+ fmap (B.cell AlignDefault (B.RowSpan rs) (B.ColSpan cs) . plainify) <$> c+ rows' <- mapM (mapM toPandocCell) rows+ columns <- getOption readerColumns+ let colspecs = zipWith (\cs w -> (convAlign $ fst cs, B.ColWidth w))+ (elems $ GT.arrayTableColSpecs tbl)+ (fractionalColumnWidths tbl columns)+ let caption = B.emptyCaption+ return $ do+ rows'' <- mapM sequence rows'+ let headLen = maybe 0 GT.fromRowIndex $ GT.arrayTableHead tbl+ let (hRows, bRows') =+ splitAt headLen (map (B.Row B.nullAttr) rows'')+ let (bRows, fRows) =+ case GT.arrayTableFoot tbl of+ Just fIdx -> splitAt (GT.fromRowIndex fIdx - headLen - 1) bRows'+ Nothing -> (bRows', [])+ let thead = B.TableHead B.nullAttr $ case (hRows, normalization) of+ -- normalize header if necessary: remove header if it contains+ -- only a single row in which all cells are empty.+ ([hrow], NormalizeHeader) ->+ let Row _attr cells = hrow+ simple = \case+ Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [] ->+ True+ _ ->+ False+ in [B.Row nullAttr cells | not (null cells) &&+ not (all simple cells)]+ _ -> hRows+ let tfoot = B.TableFoot B.nullAttr fRows+ let tbody = B.TableBody B.nullAttr 0 [] bRows+ return $ TableComponents nullAttr caption colspecs thead [tbody] tfoot++removeOneLeadingSpace :: [Text] -> [Text]+removeOneLeadingSpace xs =+ if all startsWithSpace xs+ then map (T.drop 1) xs+ else xs+ where startsWithSpace t = case T.uncons t of+ Nothing -> True+ Just (c, _) -> c == ' '++plainify :: B.Blocks -> B.Blocks+plainify blks = case B.toList blks of+ [Para x] -> B.fromList [Plain x]+ _ -> blks++convAlign :: GT.Alignment -> B.Alignment+convAlign GT.AlignLeft = B.AlignLeft+convAlign GT.AlignRight = B.AlignRight+convAlign GT.AlignCenter = B.AlignCenter+convAlign GT.AlignDefault = B.AlignDefault++fractionalColumnWidths :: GT.ArrayTable a -> Int -> [Double]+fractionalColumnWidths gt charColumns =+ let widths = map ((+1) . snd) -- include width of separator+ (elems $ GT.arrayTableColSpecs gt)+ norm = fromIntegral $ max (sum widths + length widths - 2) charColumns+ in map (\w -> fromIntegral w / norm) widths++---++-- | Parse a table using 'headerParser', 'rowParser',+-- 'lineParser', and 'footerParser'.+tableWith :: (Stream s m Char, UpdateSourcePos s Char,+ HasReaderOptions st, Monad mf)+ => ParsecT s st m (mf [[Blocks]], [Alignment], [Int]) -- ^ header parser+ -> ([Int] -> ParsecT s st m (mf [Blocks])) -- ^ row parser+ -> ParsecT s st m sep -- ^ line parser+ -> ParsecT s st m end -- ^ footer parser+ -> ParsecT s st m (mf Blocks)+tableWith hp rp lp fp = fmap tableFromComponents <$>+ tableWith' NoNormalization hp rp lp fp++tableWith' :: (Stream s m Char, UpdateSourcePos s Char,+ HasReaderOptions st, Monad mf)+ => TableNormalization+ -> ParsecT s st m (mf [[Blocks]], [Alignment], [Int]) -- ^ header parser+ -> ([Int] -> ParsecT s st m (mf [Blocks])) -- ^ row parser+ -> ParsecT s st m sep -- ^ line parser+ -> ParsecT s st m end -- ^ footer parser+ -> ParsecT s st m (mf TableComponents)+tableWith' n11n headerParser rowParser lineParser footerParser =+ tableWithSpans' n11n headerParser' rowParser' lineParser footerParser+ where+ headerParser' = fmap (\(heads, aligns, indices) -> (fmap singleSpansBlocks heads, aligns, indices)) headerParser+ rowParser' indices = fmap (\row -> zip3 row (repeat 1) (repeat 1)) <$> rowParser indices++tableWithSpans :: (Stream s m Char, UpdateSourcePos s Char,+ HasReaderOptions st, Monad mf)+ => ParsecT s st m (mf [[(Blocks, RowSpan, ColSpan)]], [Alignment], [Int]) -- ^ header parser+ -> ([Int] -> ParsecT s st m (mf [(Blocks, RowSpan, ColSpan)])) -- ^ row parser+ -> ParsecT s st m sep -- ^ line parser+ -> ParsecT s st m end -- ^ footer parser+ -> ParsecT s st m (mf Blocks)+tableWithSpans hp rp lp fp = fmap tableFromComponents <$>+ tableWithSpans' NoNormalization hp rp lp fp++tableWithSpans' :: (Stream s m Char, UpdateSourcePos s Char,+ HasReaderOptions st, Monad mf)+ => TableNormalization+ -> ParsecT s st m (mf [[(Blocks, RowSpan, ColSpan)]], [Alignment], [Int]) -- ^ header parser+ -> ([Int] -> ParsecT s st m (mf [(Blocks, RowSpan, ColSpan)])) -- ^ row parser+ -> ParsecT s st m sep -- ^ line parser+ -> ParsecT s st m end -- ^ footer parser+ -> ParsecT s st m (mf TableComponents)+tableWithSpans' n11n headerParser rowParser lineParser footerParser = try $ do+ (heads, aligns, indices) <- headerParser+ lines' <- sequence <$> rowParser indices `sepEndBy1` lineParser+ footerParser+ numColumns <- getOption readerColumns+ let widths = if null indices+ then replicate (length aligns) 0.0+ else widthsFromIndices numColumns indices+ return $ toTableComponentsWithSpans' n11n aligns widths <$> heads <*> lines'++toRow :: [(Blocks, RowSpan, ColSpan)] -> Row+toRow = Row nullAttr . map (\(blocks, rowSpan, columnSpan) -> B.cell AlignDefault rowSpan columnSpan blocks)++toHeaderRow :: TableNormalization -> [(Blocks, RowSpan, ColSpan)] -> Maybe Row+toHeaderRow = \case+ NoNormalization -> \l -> if not (null l) then Just (toRow l) else Nothing+ NormalizeHeader -> \l -> if not (all nullHeaderRow l) then Just (toRow l) else Nothing+ where+ nullHeaderRow (l, _, _) = null l++-- | Calculate relative widths of table columns, based on indices+widthsFromIndices :: Int -- Number of columns on terminal+ -> [Int] -- Indices+ -> [Double] -- Fractional relative sizes of columns+widthsFromIndices _ [] = []+widthsFromIndices numColumns' indices =+ let numColumns = max numColumns' (lastDef 0 indices)+ lengths' = zipWith (-) indices (0:indices)+ lengths = reverse $+ case reverse lengths' of+ [] -> []+ [x] -> [x]+ -- compensate for the fact that intercolumn+ -- spaces are counted in widths of all columns+ -- but the last...+ (x:y:zs) -> if x < y && y - x <= 2+ then y:y:zs+ else x:y:zs+ totLength = sum lengths+ quotient = if totLength > numColumns+ then fromIntegral totLength+ else fromIntegral numColumns+ fracs = map (\l -> fromIntegral l / quotient) lengths in+ drop 1 fracs++-- | List of lists of `RowSpan` of 1.+singleRowSpans :: [[RowSpan]]+singleRowSpans = repeat $ repeat 1++-- | List of lists of `ColsSpan` of 1.+singleColumnSpans :: [[ColSpan]]+singleColumnSpans = repeat $ repeat 1++singleSpansBlocks :: [[Blocks]] -> [[(Blocks, RowSpan, ColSpan)]]+singleSpansBlocks blocks = zipWith3 zip3 blocks singleRowSpans singleColumnSpans
@@ -0,0 +1,217 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+Module : Text.Pandoc.Parsing.Lists+Copyright : © 2006-2024 John MacFarlane+License : GPL-2.0-or-later+Maintainer : John MacFarlane <jgm@berkeley.edu>++Parsers for list markers.+-}++module Text.Pandoc.Parsing.Lists+ ( anyOrderedListMarker+ , decimal+ , lowerAlpha+ , lowerRoman+ , orderedListMarker+ , romanNumeral+ , upperAlpha+ , upperRoman+ )+where++import Data.Char+ ( isAsciiUpper+ , isAsciiLower+ , ord+ , toLower+ )+import Data.Maybe (fromMaybe)+import Text.Pandoc.Definition+ ( ListNumberDelim(..)+ , ListAttributes+ , ListNumberStyle(..)+ )+import Text.Pandoc.Shared (safeRead)+import Text.Pandoc.Sources+import Text.Parsec+ ( (<|>)+ , ParsecT+ , Stream(..)+ , choice+ , getState+ , lookAhead+ , many+ , many1+ , option+ , try+ , updateState+ )+import Text.Pandoc.Parsing.State++import qualified Data.Map as M+import qualified Data.Text as T++-- | Parses a roman numeral (uppercase or lowercase), returns number.+romanNumeral :: (Stream s m Char, UpdateSourcePos s Char)+ => Bool -- ^ Uppercase if true+ -> ParsecT s st m Int+romanNumeral upperCase = do+ let rchar uc = char $ if upperCase then uc else toLower uc+ let one = rchar 'I'+ let five = rchar 'V'+ let ten = rchar 'X'+ let fifty = rchar 'L'+ let hundred = rchar 'C'+ let fivehundred = rchar 'D'+ let thousand = rchar 'M'+ lookAhead $ choice [one, five, ten, fifty, hundred, fivehundred, thousand]+ thousands <- (1000 *) . length <$> many thousand+ ninehundreds <- option 0 $ try $ hundred >> thousand >> return 900+ fivehundreds <- option 0 $ 500 <$ fivehundred+ fourhundreds <- option 0 $ try $ hundred >> fivehundred >> return 400+ hundreds <- (100 *) . length <$> many hundred+ nineties <- option 0 $ try $ ten >> hundred >> return 90+ fifties <- option 0 (50 <$ fifty)+ forties <- option 0 $ try $ ten >> fifty >> return 40+ tens <- (10 *) . length <$> many ten+ nines <- option 0 $ try $ one >> ten >> return 9+ fives <- option 0 (5 <$ five)+ fours <- option 0 $ try $ one >> five >> return 4+ ones <- length <$> many one+ let total = thousands + ninehundreds + fivehundreds + fourhundreds ++ hundreds + nineties + fifties + forties + tens + nines ++ fives + fours + ones+ if total == 0+ then Prelude.fail "not a roman numeral"+ else return total++-- | Parses an uppercase roman numeral and returns (UpperRoman, number).+upperRoman :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)+upperRoman = do+ num <- romanNumeral True+ return (UpperRoman, num)++-- | Parses a lowercase roman numeral and returns (LowerRoman, number).+lowerRoman :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)+lowerRoman = do+ num <- romanNumeral False+ return (LowerRoman, num)++-- | Parses a decimal numeral and returns (Decimal, number).+decimal :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)+decimal = do+ num <- many1 digit+ return (Decimal, fromMaybe 1 $ safeRead $ T.pack num)++-- | Parses a '@' and optional label and+-- returns (DefaultStyle, [next example number]). The next+-- example number is incremented in parser state, and the label+-- (if present) is added to the label table.+exampleNum :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s ParserState m (ListNumberStyle, Int)+exampleNum = do+ char '@'+ lab <- T.pack . concat <$>+ many (many1 alphaNum <|>+ try (do c <- char '_' <|> char '-'+ cs <- many1 alphaNum+ return (c:cs)))+ st <- getState+ case M.lookup lab (stateExamples st) of+ Nothing -> do -- new label+ let num = stateNextExample st+ let newlabels = if T.null lab+ then stateExamples st+ else M.insert lab num $ stateExamples st+ updateState $ \s -> s{ stateNextExample = num + 1+ , stateExamples = newlabels }+ return (Example, num)+ Just num -> -- reuse existing label+ return (Example, num)++-- | Parses a '#' returns (DefaultStyle, 1).+defaultNum :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)+defaultNum = do+ char '#'+ return (DefaultStyle, 1)++-- | Parses a lowercase letter and returns (LowerAlpha, number).+lowerAlpha :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)+lowerAlpha = do+ ch <- satisfy isAsciiLower+ return (LowerAlpha, ord ch - ord 'a' + 1)++-- | Parses an uppercase letter and returns (UpperAlpha, number).+upperAlpha :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)+upperAlpha = do+ ch <- satisfy isAsciiUpper+ return (UpperAlpha, ord ch - ord 'A' + 1)++-- | Parses a roman numeral i or I+romanOne :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m (ListNumberStyle, Int)+romanOne = (char 'i' >> return (LowerRoman, 1)) <|>+ (char 'I' >> return (UpperRoman, 1))++-- | Parses an ordered list marker and returns list attributes.+anyOrderedListMarker :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s ParserState m ListAttributes+anyOrderedListMarker = choice+ [delimParser numParser | delimParser <- [inPeriod, inOneParen, inTwoParens],+ numParser <- [decimal, exampleNum, defaultNum, romanOne,+ lowerAlpha, lowerRoman, upperAlpha, upperRoman]]++-- | Parses a list number (num) followed by a period, returns list attributes.+inPeriod :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m (ListNumberStyle, Int)+ -> ParsecT s st m ListAttributes+inPeriod num = try $ do+ (style, start) <- num+ char '.'+ let delim = if style == DefaultStyle+ then DefaultDelim+ else Period+ return (start, style, delim)++-- | Parses a list number (num) followed by a paren, returns list attributes.+inOneParen :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m (ListNumberStyle, Int)+ -> ParsecT s st m ListAttributes+inOneParen num = try $ do+ (style, start) <- num+ char ')'+ return (start, style, OneParen)++-- | Parses a list number (num) enclosed in parens, returns list attributes.+inTwoParens :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m (ListNumberStyle, Int)+ -> ParsecT s st m ListAttributes+inTwoParens num = try $ do+ char '('+ (style, start) <- num+ char ')'+ return (start, style, TwoParens)++-- | Parses an ordered list marker with a given style and delimiter,+-- returns number.+orderedListMarker :: (Stream s m Char, UpdateSourcePos s Char)+ => ListNumberStyle+ -> ListNumberDelim+ -> ParsecT s ParserState m Int+orderedListMarker style delim = do+ let num = defaultNum <|> -- # can continue any kind of list+ case style of+ DefaultStyle -> decimal+ Example -> exampleNum+ Decimal -> decimal+ UpperRoman -> upperRoman+ LowerRoman -> lowerRoman+ UpperAlpha -> upperAlpha+ LowerAlpha -> lowerAlpha+ let context = case delim of+ DefaultDelim -> inPeriod+ Period -> inPeriod+ OneParen -> inOneParen+ TwoParens -> inTwoParens+ (start, _, _) <- context num+ return start
@@ -0,0 +1,102 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+Module : Text.Pandoc.Parsing.Math+Copyright : © 2006-2024 John MacFarlane+License : GPL-2.0-or-later+Maintainer : John MacFarlane <jgm@berkeley.edu>++Parsing of LaTeX math.+-}++module Text.Pandoc.Parsing.Math+ ( mathDisplay+ , mathInline+ )+where++import Control.Monad (mzero, when)+import Data.Text (Text)+import Text.Parsec ((<|>), ParsecT, Stream(..), notFollowedBy, many1, try)+import Text.Pandoc.Options+ ( Extension(Ext_tex_math_dollars, Ext_tex_math_single_backslash,+ Ext_tex_math_double_backslash) )+import Text.Pandoc.Parsing.Capabilities (HasReaderOptions, guardEnabled)+import Text.Pandoc.Parsing.General+import Text.Pandoc.Shared (trimMath)+import Text.Pandoc.Sources+ (UpdateSourcePos, anyChar, char, digit, newline, satisfy, space, string)++import qualified Data.Text as T+import qualified Data.Text.Lazy as TL+import qualified Data.Text.Lazy.Builder as TB++mathInlineWith :: (Stream s m Char, UpdateSourcePos s Char) => Text -> Text -> ParsecT s st m Text+mathInlineWith op cl = try $ do+ textStr op+ when (op == "$") $ notFollowedBy space+ words' <- many1Till (+ (T.singleton <$>+ satisfy (\c -> not (isSpaceChar c || c == '\\')))+ <|> (char '\\' >>+ -- This next clause is needed because \text{..} can+ -- contain $, \(\), etc.+ (try (string "text" >>+ (("\\text" <>) <$> inBalancedBraces 0 ""))+ <|> (\c -> T.pack ['\\',c]) <$> anyChar))+ <|> ("\n" <$ blankline <* notFollowedBy' blankline <* notFollowedBy (char '$'))+ <|> (T.pack <$> many1 spaceChar <* notFollowedBy (char '$'))+ ) (try $ textStr cl)+ notFollowedBy digit -- to prevent capture of $5+ return $ trimMath $ T.concat words'+ where+ inBalancedBraces :: (Stream s m Char, UpdateSourcePos s Char)+ => Int -> Text -> ParsecT s st m Text+ inBalancedBraces n t =+ TL.toStrict . TB.toLazyText <$>+ go n False (TB.fromText t) (not (T.null t))++ -- go depth lastWasBackslash accumulator started+ go :: (Stream s m Char, UpdateSourcePos s Char)+ => Int -> Bool -> TB.Builder -> Bool -> ParsecT s st m TB.Builder+ go 0 _ acc False = do+ c <- anyChar+ if c == '{'+ then go 1 False (acc <> TB.singleton '{') True+ else mzero+ go 0 _ acc True = return acc+ go depth True acc _ = do+ c <- anyChar+ go depth False (acc <> TB.singleton c) True+ go depth False acc _ = do+ c <- anyChar+ let acc' = acc <> TB.singleton c+ case c of+ '\\' -> go depth True acc' True+ '}' -> go (depth - 1) False acc' True+ '{' -> go (depth + 1) False acc' True+ _ -> go depth False acc' True++mathDisplayWith :: (Stream s m Char, UpdateSourcePos s Char) => Text -> Text -> ParsecT s st m Text+mathDisplayWith op cl = try $ fmap T.pack $ do+ textStr op+ many1Till (satisfy (/= '\n') <|> (newline <* notFollowedBy' blankline))+ (try $ textStr cl)++mathDisplay :: (HasReaderOptions st, Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Text+mathDisplay =+ (guardEnabled Ext_tex_math_dollars >> mathDisplayWith "$$" "$$")+ <|> (guardEnabled Ext_tex_math_single_backslash >>+ mathDisplayWith "\\[" "\\]")+ <|> (guardEnabled Ext_tex_math_double_backslash >>+ mathDisplayWith "\\\\[" "\\\\]")++mathInline :: (HasReaderOptions st, Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Text+mathInline =+ (guardEnabled Ext_tex_math_dollars >> mathInlineWith "$" "$")+ <|> (guardEnabled Ext_tex_math_single_backslash >>+ mathInlineWith "\\(" "\\)")+ <|> (guardEnabled Ext_tex_math_double_backslash >>+ mathInlineWith "\\\\(" "\\\\)")
@@ -0,0 +1,179 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+Module : Text.Pandoc.Parsing.Smart+Copyright : © 2006-2024 John MacFarlane+License : GPL-2.0-or-later+Maintainer : John MacFarlane <jgm@berkeley.edu>++Smart parsing of quotes, dashes, and other character combinations.+-}++module Text.Pandoc.Parsing.Smart+ ( apostrophe+ , dash+ , doubleCloseQuote+ , doubleQuoteEnd+ , doubleQuoteStart+ , doubleQuoted+ , ellipses+ , singleQuoteEnd+ , singleQuoteStart+ , singleQuoted+ , smartPunctuation+ )+where++import Control.Monad (guard , void)+import Text.Pandoc.Builder (Inlines)+import Text.Pandoc.Options+ ( extensionEnabled+ , Extension(Ext_old_dashes, Ext_smart)+ , ReaderOptions(readerExtensions) )+import Text.Pandoc.Sources+import Text.Pandoc.Parsing.Capabilities+import Text.Pandoc.Parsing.General+import Text.Parsec+ ( (<|>)+ , Stream(..)+ , ParsecT+ , choice+ , lookAhead+ , manyTill+ , notFollowedBy+ , try+ )+import qualified Text.Pandoc.Builder as B++-- | Parses various ASCII punctuation, quotes, and apostrophe in a smart+-- way, inferring their semantic meaning.+--+-- Fails unless the 'Ext_smart' extension has been enabled.+smartPunctuation :: (HasReaderOptions st, HasLastStrPosition st,+ HasQuoteContext st m,+ Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Inlines+ -> ParsecT s st m Inlines+smartPunctuation inlineParser = do+ guardEnabled Ext_smart+ choice [ quoted inlineParser, apostrophe, doubleCloseQuote, dash, ellipses ]++-- | Parses inline text in single or double quotes, assumes English+-- quoting conventions.+quoted :: (HasLastStrPosition st, HasQuoteContext st m,+ Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Inlines+ -> ParsecT s st m Inlines+quoted inlineParser = doubleQuoted inlineParser <|> singleQuoted inlineParser++-- | Parses inline text in single quotes, assumes English quoting+-- conventions.+singleQuoted :: (HasLastStrPosition st, HasQuoteContext st m,+ Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Inlines+ -> ParsecT s st m Inlines+singleQuoted inlineParser = do+ singleQuoteStart+ (B.singleQuoted . mconcat <$>+ try+ (withQuoteContext InSingleQuote (many1Till inlineParser singleQuoteEnd)))+ <|> pure "\8217"++-- | Parses inline text in double quotes; assumes English quoting+-- conventions.+doubleQuoted :: (HasQuoteContext st m, HasLastStrPosition st,+ Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Inlines+ -> ParsecT s st m Inlines+doubleQuoted inlineParser = do+ doubleQuoteStart+ (B.doubleQuoted . mconcat <$>+ try+ (withQuoteContext InDoubleQuote (manyTill inlineParser doubleQuoteEnd)))+ <|> pure (B.str "\8220")++-- | Succeeds if the parser is+--+-- * not within single quoted text;+-- * not directly after a word; and+-- * looking at an opening single quote char that's not followed by a+-- space.+--+-- Gobbles the quote character on success.+singleQuoteStart :: (HasLastStrPosition st, HasQuoteContext st m,+ Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m ()+singleQuoteStart = do+ failIfInQuoteContext InSingleQuote+ -- single quote start can't be right after str+ guard =<< notAfterString+ try $ do+ char '\''+ void $ lookAhead (satisfy (not . isSpaceChar))++singleQuoteEnd :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m ()+singleQuoteEnd = try $ do+ char '\''+ notFollowedBy alphaNum++-- | Succeeds if the parser is+--+-- * not within a double quoted text;+--+-- * not directly after a word; and+--+-- * looking at an opening double quote char that's not followed by a+-- space.+--+-- Gobbles the quote character on success.+doubleQuoteStart :: (HasLastStrPosition st,+ HasQuoteContext st m,+ Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m ()+doubleQuoteStart = do+ failIfInQuoteContext InDoubleQuote+ guard =<< notAfterString+ try $ do char '"'+ void $ lookAhead (satisfy (not . isSpaceChar))++-- | Parses a closing quote character.+doubleQuoteEnd :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m ()+doubleQuoteEnd = void (char '"')++-- | Parses an ASCII apostrophe (@'@) or right single quotation mark and+-- returns a RIGHT SINGLE QUOtatiON MARK character.+apostrophe :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Inlines+apostrophe = (char '\'' <|> char '\8217') >> return (B.str "\8217")++-- | Parses an ASCII quotation mark character and returns a RIGHT DOUBLE+-- QUOTATION MARK.+doubleCloseQuote :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Inlines+doubleCloseQuote = B.str "\8221" <$ char '"'++-- | Parses three dots as HORIZONTAL ELLIPSIS.+ellipses :: (Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Inlines+ellipses = try (string "..." >> return (B.str "\8230"))++-- | Parses two hyphens as EN DASH and three as EM DASH.+--+-- If the extension @'Ext_old_dashes'@ is enabled, then two hyphens are+-- parsed as EM DASH, and one hyphen is parsed as EN DASH if it is+-- followed by a digit.+dash :: (HasReaderOptions st, Stream s m Char, UpdateSourcePos s Char)+ => ParsecT s st m Inlines+dash = try $ do+ oldDashes <- extensionEnabled Ext_old_dashes <$> getOption readerExtensions+ if oldDashes+ then do+ char '-'+ (char '-' >> return (B.str "\8212"))+ <|> (lookAhead digit >> return (B.str "\8211"))+ else do+ string "--"+ (char '-' >> return (B.str "\8212"))+ <|> return (B.str "\8211")
@@ -0,0 +1,189 @@+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Parsing+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GPL-2.0-or-later+ Maintainer : John MacFarlane <jgm@berkeley.edu>++A default parser state with commonly used properties.+-}++module Text.Pandoc.Parsing.State+ ( ParserState (..)+ , ParserContext (..)+ , HeaderType (..)+ , NoteTable+ , NoteTable'+ , Key (..)+ , KeyTable+ , SubstTable+ , defaultParserState+ , toKey+ )+where++import Data.Default (Default (def))+import Data.Text (Text)+import Text.Parsec (SourcePos, getState, setState)+import Text.Pandoc.Builder (Blocks, HasMeta (..), Inlines)+import Text.Pandoc.Definition (Attr, Meta, Target, nullMeta)+import Text.Pandoc.Logging (LogMessage)+import Text.Pandoc.Options (ReaderOptions)+import Text.Pandoc.Parsing.Capabilities+import Text.Pandoc.Parsing.Future+import Text.Pandoc.TeX (Macro)++import qualified Data.Map as M+import qualified Data.Set as Set+import qualified Data.Text as T++-- | Parsing options.+data ParserState = ParserState+ { stateOptions :: ReaderOptions -- ^ User options+ , stateParserContext :: ParserContext -- ^ Inside list?+ , stateQuoteContext :: QuoteContext -- ^ Inside quoted environment?+ , stateAllowLinks :: Bool -- ^ Allow parsing of links+ , stateAllowLineBreaks :: Bool -- ^ Allow parsing of line breaks+ , stateLastStrPos :: Maybe SourcePos -- ^ Position after last str parsed+ , stateKeys :: KeyTable -- ^ List of reference keys+ , stateHeaderKeys :: KeyTable -- ^ List of implicit header ref keys+ , stateSubstitutions :: SubstTable -- ^ List of substitution references+ , stateNotes :: NoteTable -- ^ List of notes (raw bodies)+ , stateNotes' :: NoteTable' -- ^ List of notes (parsed bodies)+ , stateNoteRefs :: Set.Set Text -- ^ List of note references used+ , stateInNote :: Bool -- ^ True if parsing note contents+ , stateNoteNumber :: Int -- ^ Last note number for citations+ , stateMeta :: Meta -- ^ Document metadata+ , stateMeta' :: Future ParserState Meta -- ^ Document metadata+ , stateCitations :: M.Map Text Text -- ^ RST-style citations+ , stateHeaderTable :: [HeaderType] -- ^ Ordered list of header types used+ , stateIdentifiers :: Set.Set Text -- ^ Header identifiers used+ , stateNextExample :: Int -- ^ Number of next example+ , stateExamples :: M.Map Text Int -- ^ Map from example labels to numbers+ , stateMacros :: M.Map Text Macro -- ^ Table of macros defined so far+ , stateRstDefaultRole :: Text -- ^ Current rST default+ -- interpreted text role+ , stateRstHighlight :: Maybe Text -- ^ Current rST literal block+ -- language+ , stateRstCustomRoles :: M.Map Text (Text, Maybe Text, Attr)+ -- ^ Current rST cust text roles;+ -- Triple represents:) Base role 2) Optional format (only for :raw:+ -- roles) 3) Addition classes (rest of Attr is unused)).+ , stateCaption :: Maybe Inlines -- ^ Caption in current environment+ , stateInHtmlBlock :: Maybe Text -- ^ Tag type of HTML block being parsed+ , stateFencedDivLevel :: Int -- ^ Depth of fenced div+ , stateContainers :: [Text] -- ^ parent include files+ , stateLogMessages :: [LogMessage] -- ^ log messages+ , stateMarkdownAttribute :: Bool -- ^ True if in markdown=1 context+ }++instance Default ParserState where+ def = defaultParserState++instance HasMeta ParserState where+ setMeta field val st =+ st{ stateMeta = setMeta field val $ stateMeta st }+ deleteMeta field st =+ st{ stateMeta = deleteMeta field $ stateMeta st }++instance HasReaderOptions ParserState where+ extractReaderOptions = stateOptions++instance Monad m => HasQuoteContext ParserState m where+ getQuoteContext = stateQuoteContext <$> getState+ withQuoteContext context parser = do+ oldState <- getState+ let oldQuoteContext = stateQuoteContext oldState+ setState oldState { stateQuoteContext = context }+ result <- parser+ newState <- getState+ setState newState { stateQuoteContext = oldQuoteContext }+ return result++instance HasIdentifierList ParserState where+ extractIdentifierList = stateIdentifiers+ updateIdentifierList f st = st{ stateIdentifiers = f $ stateIdentifiers st }++instance HasMacros ParserState where+ extractMacros = stateMacros+ updateMacros f st = st{ stateMacros = f $ stateMacros st }++instance HasLastStrPosition ParserState where+ setLastStrPos pos st = st{ stateLastStrPos = pos }+ getLastStrPos st = stateLastStrPos st++instance HasLogMessages ParserState where+ addLogMessage msg st = st{ stateLogMessages = msg : stateLogMessages st }+ getLogMessages st = reverse $ stateLogMessages st++instance HasIncludeFiles ParserState where+ getIncludeFiles = stateContainers+ addIncludeFile f s = s{ stateContainers = f : stateContainers s }+ dropLatestIncludeFile s = s { stateContainers = drop 1 $ stateContainers s }++data ParserContext+ = ListItemState -- ^ Used when running parser on list item contents+ | NullState -- ^ Default state+ deriving (Eq, Show)++data HeaderType+ = SingleHeader Char -- ^ Single line of characters underneath+ | DoubleHeader Char -- ^ Lines of characters above and below+ deriving (Eq, Show)++defaultParserState :: ParserState+defaultParserState = ParserState+ { stateOptions = def+ , stateParserContext = NullState+ , stateQuoteContext = NoQuote+ , stateAllowLinks = True+ , stateAllowLineBreaks = True+ , stateLastStrPos = Nothing+ , stateKeys = M.empty+ , stateHeaderKeys = M.empty+ , stateSubstitutions = M.empty+ , stateNotes = []+ , stateNotes' = M.empty+ , stateNoteRefs = Set.empty+ , stateInNote = False+ , stateNoteNumber = 0+ , stateMeta = nullMeta+ , stateMeta' = return nullMeta+ , stateCitations = M.empty+ , stateHeaderTable = []+ , stateIdentifiers = Set.empty+ , stateNextExample = 1+ , stateExamples = M.empty+ , stateMacros = M.empty+ , stateRstDefaultRole = "title-reference"+ , stateRstHighlight = Nothing+ , stateRstCustomRoles = M.empty+ , stateCaption = Nothing+ , stateInHtmlBlock = Nothing+ , stateFencedDivLevel = 0+ , stateContainers = []+ , stateLogMessages = []+ , stateMarkdownAttribute = False+ }++type NoteTable = [(Text, Text)]++type NoteTable' = M.Map Text (SourcePos, Future ParserState Blocks)+-- used in markdown reader++newtype Key = Key Text deriving (Show, Read, Eq, Ord)++toKey :: Text -> Key+toKey = Key . T.toLower . T.unwords . T.words . unbracket+ where unbracket t+ | Just ('[', t') <- T.uncons t+ , Just (t'', ']') <- T.unsnoc t'+ = t''+ | otherwise+ = t++type KeyTable = M.Map Key (Target, Attr)++type SubstTable = M.Map Key Blocks
@@ -1,534 +0,0 @@-{-# LANGUAGE GeneralizedNewtypeDeriving, CPP #-}-{--Copyright (C) 2010-2014 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(-1)307 USA--}--{- |- Module : Text.Pandoc.Pretty- Copyright : Copyright (C) 2010-2014 John MacFarlane- License : GNU GPL, version 2 or above-- Maintainer : John MacFarlane <jgm@berkeley.edu>- Stability : alpha- Portability : portable--A prettyprinting library for the production of text documents,-including wrapped text, indentated blocks, and tables.--}--module Text.Pandoc.Pretty (- Doc- , render- , cr- , blankline- , blanklines- , space- , text- , char- , prefixed- , flush- , nest- , hang- , beforeNonBlank- , nowrap- , offset- , height- , lblock- , cblock- , rblock- , (<>)- , (<+>)- , ($$)- , ($+$)- , isEmpty- , empty- , cat- , hcat- , hsep- , vcat- , vsep- , nestle- , chomp- , inside- , braces- , brackets- , parens- , quotes- , doubleQuotes- , charWidth- , realLength- )--where-import Data.Sequence (Seq, fromList, (<|), singleton, mapWithIndex, viewl, ViewL(..))-import Data.Foldable (toList)-import Data.List (intercalate)-import Data.Monoid-import Data.String-import Control.Monad.State-import Data.Char (isSpace)--data RenderState a = RenderState{- output :: [a] -- ^ In reverse order- , prefix :: String- , usePrefix :: Bool- , lineLength :: Maybe Int -- ^ 'Nothing' means no wrapping- , column :: Int- , newlines :: Int -- ^ Number of preceding newlines- }--type DocState a = State (RenderState a) ()--data D = Text Int String- | Block Int [String]- | Prefixed String Doc- | BeforeNonBlank Doc- | Flush Doc- | BreakingSpace- | CarriageReturn- | NewLine- | BlankLines Int -- number of blank lines- deriving (Show)--newtype Doc = Doc { unDoc :: Seq D }- deriving (Monoid, Show)--instance IsString Doc where- fromString = text--isBlank :: D -> Bool-isBlank BreakingSpace = True-isBlank CarriageReturn = True-isBlank NewLine = True-isBlank (BlankLines _) = True-isBlank (Text _ (c:_)) = isSpace c-isBlank _ = False---- | True if the document is empty.-isEmpty :: Doc -> Bool-isEmpty = null . toList . unDoc---- | The empty document.-empty :: Doc-empty = mempty--#if MIN_VERSION_base(4,5,0)--- (<>) is defined in Data.Monoid-#else-infixr 6 <>---- | An infix synonym for 'mappend'.--- @a <> b@ is the result of concatenating @a@ with @b@.-(<>) :: Monoid m => m -> m -> m-(<>) = mappend-{-# INLINE (<>) #-}-#endif---- | Concatenate a list of 'Doc's.-cat :: [Doc] -> Doc-cat = mconcat---- | Same as 'cat'.-hcat :: [Doc] -> Doc-hcat = mconcat---- | Concatenate a list of 'Doc's, putting breakable spaces--- between them.-infixr 6 <+>-(<+>) :: Doc -> Doc -> Doc-(<+>) x y = if isEmpty x- then y- else if isEmpty y- then x- else x <> space <> y---- | Same as 'cat', but putting breakable spaces between the--- 'Doc's.-hsep :: [Doc] -> Doc-hsep = foldr (<+>) empty--infixr 5 $$--- | @a $$ b@ puts @a@ above @b@.-($$) :: Doc -> Doc -> Doc-($$) x y = if isEmpty x- then y- else if isEmpty y- then x- else x <> cr <> y--infixr 5 $+$--- | @a $$ b@ puts @a@ above @b@, with a blank line between.-($+$) :: Doc -> Doc -> Doc-($+$) x y = if isEmpty x- then y- else if isEmpty y- then x- else x <> blankline <> y---- | List version of '$$'.-vcat :: [Doc] -> Doc-vcat = foldr ($$) empty---- | List version of '$+$'.-vsep :: [Doc] -> Doc-vsep = foldr ($+$) empty---- | Removes leading blank lines from a 'Doc'.-nestle :: Doc -> Doc-nestle (Doc d) = Doc $ go d- where go x = case viewl x of- (BlankLines _ :< rest) -> go rest- (NewLine :< rest) -> go rest- _ -> x---- | Chomps trailing blank space off of a 'Doc'.-chomp :: Doc -> Doc-chomp d = Doc (fromList dl')- where dl = toList (unDoc d)- dl' = reverse $ go $ reverse dl- go [] = []- go (BreakingSpace : xs) = go xs- go (CarriageReturn : xs) = go xs- go (NewLine : xs) = go xs- go (BlankLines _ : xs) = go xs- go (Prefixed s d' : xs) = Prefixed s (chomp d') : xs- go xs = xs--outp :: (IsString a, Monoid a)- => Int -> String -> DocState a-outp off s | off < 0 = do -- offset < 0 means newline characters- st' <- get- let rawpref = prefix st'- when (column st' == 0 && usePrefix st' && not (null rawpref)) $ do- let pref = reverse $ dropWhile isSpace $ reverse rawpref- modify $ \st -> st{ output = fromString pref : output st- , column = column st + realLength pref }- let numnewlines = length $ takeWhile (=='\n') $ reverse s- modify $ \st -> st { output = fromString s : output st- , column = 0- , newlines = newlines st + numnewlines }-outp off s = do -- offset >= 0 (0 might be combining char)- st' <- get- let pref = prefix st'- when (column st' == 0 && usePrefix st' && not (null pref)) $ do- modify $ \st -> st{ output = fromString pref : output st- , column = column st + realLength pref }- modify $ \st -> st{ output = fromString s : output st- , column = column st + off- , newlines = 0 }---- | Renders a 'Doc'. @render (Just n)@ will use--- a line length of @n@ to reflow text on breakable spaces.--- @render Nothing@ will not reflow text.-render :: (Monoid a, IsString a)- => Maybe Int -> Doc -> a-render linelen doc = fromString . mconcat . reverse . output $- execState (renderDoc doc) startingState- where startingState = RenderState{- output = mempty- , prefix = ""- , usePrefix = True- , lineLength = linelen- , column = 0- , newlines = 2 }--renderDoc :: (IsString a, Monoid a)- => Doc -> DocState a-renderDoc = renderList . toList . unDoc--renderList :: (IsString a, Monoid a)- => [D] -> DocState a-renderList [] = return ()-renderList (Text off s : xs) = do- outp off s- renderList xs--renderList (Prefixed pref d : xs) = do- st <- get- let oldPref = prefix st- put st{ prefix = prefix st ++ pref }- renderDoc d- modify $ \s -> s{ prefix = oldPref }- renderList xs--renderList (Flush d : xs) = do- st <- get- let oldUsePrefix = usePrefix st- put st{ usePrefix = False }- renderDoc d- modify $ \s -> s{ usePrefix = oldUsePrefix }- renderList xs--renderList (BeforeNonBlank d : xs) =- case xs of- (x:_) | isBlank x -> renderList xs- | otherwise -> renderDoc d >> renderList xs- [] -> renderList xs--renderList (BlankLines num : xs) = do- st <- get- case output st of- _ | newlines st > num || null xs -> return ()- | otherwise -> replicateM_ (1 + num - newlines st) (outp (-1) "\n")- renderList xs--renderList (CarriageReturn : xs) = do- st <- get- if newlines st > 0 || null xs- then renderList xs- else do- outp (-1) "\n"- renderList xs--renderList (NewLine : xs) = do- outp (-1) "\n"- renderList xs--renderList (BreakingSpace : CarriageReturn : xs) = renderList (CarriageReturn:xs)-renderList (BreakingSpace : NewLine : xs) = renderList (NewLine:xs)-renderList (BreakingSpace : BlankLines n : xs) = renderList (BlankLines n:xs)-renderList (BreakingSpace : BreakingSpace : xs) = renderList (BreakingSpace:xs)-renderList (BreakingSpace : xs) = do- let isText (Text _ _) = True- isText (Block _ _) = True- isText _ = False- let isBreakingSpace BreakingSpace = True- isBreakingSpace _ = False- let xs' = dropWhile isBreakingSpace xs- let next = takeWhile isText xs'- st <- get- let off = sum $ map offsetOf next- case lineLength st of- Just l | column st + 1 + off > l -> do- outp (-1) "\n"- renderList xs'- _ -> do- outp 1 " "- renderList xs'--renderList (b1@Block{} : b2@Block{} : xs) =- renderList (mergeBlocks False b1 b2 : xs)--renderList (b1@Block{} : BreakingSpace : b2@Block{} : xs) =- renderList (mergeBlocks True b1 b2 : xs)--renderList (Block width lns : xs) = do- st <- get- let oldPref = prefix st- case column st - realLength oldPref of- n | n > 0 -> modify $ \s -> s{ prefix = oldPref ++ replicate n ' ' }- _ -> return ()- renderDoc $ blockToDoc width lns- modify $ \s -> s{ prefix = oldPref }- renderList xs--mergeBlocks :: Bool -> D -> D -> D-mergeBlocks addSpace (Block w1 lns1) (Block w2 lns2) =- Block (w1 + w2 + if addSpace then 1 else 0) $- zipWith (\l1 l2 -> pad w1 l1 ++ l2) (lns1 ++ empties) (map sp lns2 ++ empties)- where empties = replicate (abs $ length lns1 - length lns2) ""- pad n s = s ++ replicate (n - realLength s) ' '- sp "" = ""- sp xs = if addSpace then (' ' : xs) else xs-mergeBlocks _ _ _ = error "mergeBlocks tried on non-Block!"--blockToDoc :: Int -> [String] -> Doc-blockToDoc _ lns = text $ intercalate "\n" lns--offsetOf :: D -> Int-offsetOf (Text o _) = o-offsetOf (Block w _) = w-offsetOf BreakingSpace = 1-offsetOf _ = 0---- | A literal string.-text :: String -> Doc-text = Doc . toChunks- where toChunks :: String -> Seq D- toChunks [] = mempty- toChunks s = case break (=='\n') s of- ([], _:ys) -> NewLine <| toChunks ys- (xs, _:ys) -> Text (realLength xs) xs <|- (NewLine <| toChunks ys)- (xs, []) -> singleton $ Text (realLength xs) xs---- | A character.-char :: Char -> Doc-char c = text [c]---- | A breaking (reflowable) space.-space :: Doc-space = Doc $ singleton BreakingSpace---- | A carriage return. Does nothing if we're at the beginning of--- a line; otherwise inserts a newline.-cr :: Doc-cr = Doc $ singleton CarriageReturn---- | Inserts a blank line unless one exists already.--- (@blankline <> blankline@ has the same effect as @blankline@.-blankline :: Doc-blankline = Doc $ singleton (BlankLines 1)---- | Inserts a blank lines unless they exists already.--- (@blanklines m <> blanklines n@ has the same effect as @blankline (max m n)@.-blanklines :: Int -> Doc-blanklines n = Doc $ singleton (BlankLines n)---- | Uses the specified string as a prefix for every line of--- the inside document (except the first, if not at the beginning--- of the line).-prefixed :: String -> Doc -> Doc-prefixed pref doc = Doc $ singleton $ Prefixed pref doc---- | Makes a 'Doc' flush against the left margin.-flush :: Doc -> Doc-flush doc = Doc $ singleton $ Flush doc---- | Indents a 'Doc' by the specified number of spaces.-nest :: Int -> Doc -> Doc-nest ind = prefixed (replicate ind ' ')---- | A hanging indent. @hang ind start doc@ prints @start@,--- then @doc@, leaving an indent of @ind@ spaces on every--- line but the first.-hang :: Int -> Doc -> Doc -> Doc-hang ind start doc = start <> nest ind doc---- | @beforeNonBlank d@ conditionally includes @d@ unless it is--- followed by blank space.-beforeNonBlank :: Doc -> Doc-beforeNonBlank d = Doc $ singleton (BeforeNonBlank d)---- | Makes a 'Doc' non-reflowable.-nowrap :: Doc -> Doc-nowrap doc = Doc $ mapWithIndex replaceSpace $ unDoc doc- where replaceSpace _ BreakingSpace = Text 1 " "- replaceSpace _ x = x---- | Returns the width of a 'Doc'.-offset :: Doc -> Int-offset d = case map realLength . lines . render Nothing $ d of- [] -> 0- os -> maximum os--block :: (String -> String) -> Int -> Doc -> Doc-block filler width = Doc . singleton . Block width .- map filler . chop width . render (Just width)---- | @lblock n d@ is a block of width @n@ characters, with--- text derived from @d@ and aligned to the left.-lblock :: Int -> Doc -> Doc-lblock = block id---- | Like 'lblock' but aligned to the right.-rblock :: Int -> Doc -> Doc-rblock w = block (\s -> replicate (w - realLength s) ' ' ++ s) w---- | Like 'lblock' but aligned centered.-cblock :: Int -> Doc -> Doc-cblock w = block (\s -> replicate ((w - realLength s) `div` 2) ' ' ++ s) w---- | Returns the height of a block or other 'Doc'.-height :: Doc -> Int-height = length . lines . render Nothing--chop :: Int -> String -> [String]-chop _ [] = []-chop n cs = case break (=='\n') cs of- (xs, ys) -> if len <= n- then case ys of- [] -> [xs]- (_:[]) -> [xs, ""]- (_:zs) -> xs : chop n zs- else take n xs : chop n (drop n xs ++ ys)- where len = realLength xs---- | Encloses a 'Doc' inside a start and end 'Doc'.-inside :: Doc -> Doc -> Doc -> Doc-inside start end contents =- start <> contents <> end---- | Puts a 'Doc' in curly braces.-braces :: Doc -> Doc-braces = inside (char '{') (char '}')---- | Puts a 'Doc' in square brackets.-brackets :: Doc -> Doc-brackets = inside (char '[') (char ']')---- | Puts a 'Doc' in parentheses.-parens :: Doc -> Doc-parens = inside (char '(') (char ')')---- | Wraps a 'Doc' in single quotes.-quotes :: Doc -> Doc-quotes = inside (char '\'') (char '\'')---- | Wraps a 'Doc' in double quotes.-doubleQuotes :: Doc -> Doc-doubleQuotes = inside (char '"') (char '"')---- | Returns width of a character in a monospace font: 0 for a combining--- character, 1 for a regular character, 2 for an East Asian wide character.-charWidth :: Char -> Int-charWidth c =- case c of- _ | c < '\x0300' -> 1- | c >= '\x0300' && c <= '\x036F' -> 0 -- combining- | c >= '\x0370' && c <= '\x10FC' -> 1- | c >= '\x1100' && c <= '\x115F' -> 2- | c >= '\x1160' && c <= '\x11A2' -> 1- | c >= '\x11A3' && c <= '\x11A7' -> 2- | c >= '\x11A8' && c <= '\x11F9' -> 1- | c >= '\x11FA' && c <= '\x11FF' -> 2- | c >= '\x1200' && c <= '\x2328' -> 1- | c >= '\x2329' && c <= '\x232A' -> 2- | c >= '\x232B' && c <= '\x2E31' -> 1- | c >= '\x2E80' && c <= '\x303E' -> 2- | c == '\x303F' -> 1- | c >= '\x3041' && c <= '\x3247' -> 2- | c >= '\x3248' && c <= '\x324F' -> 1 -- ambiguous- | c >= '\x3250' && c <= '\x4DBF' -> 2- | c >= '\x4DC0' && c <= '\x4DFF' -> 1- | c >= '\x4E00' && c <= '\xA4C6' -> 2- | c >= '\xA4D0' && c <= '\xA95F' -> 1- | c >= '\xA960' && c <= '\xA97C' -> 2- | c >= '\xA980' && c <= '\xABF9' -> 1- | c >= '\xAC00' && c <= '\xD7FB' -> 2- | c >= '\xD800' && c <= '\xDFFF' -> 1- | c >= '\xE000' && c <= '\xF8FF' -> 1 -- ambiguous- | c >= '\xF900' && c <= '\xFAFF' -> 2- | c >= '\xFB00' && c <= '\xFDFD' -> 1- | c >= '\xFE00' && c <= '\xFE0F' -> 1 -- ambiguous- | c >= '\xFE10' && c <= '\xFE19' -> 2- | c >= '\xFE20' && c <= '\xFE26' -> 1- | c >= '\xFE30' && c <= '\xFE6B' -> 2- | c >= '\xFE70' && c <= '\xFEFF' -> 1- | c >= '\xFF01' && c <= '\xFF60' -> 2- | c >= '\xFF61' && c <= '\x16A38' -> 1- | c >= '\x1B000' && c <= '\x1B001' -> 2- | c >= '\x1D000' && c <= '\x1F1FF' -> 1- | c >= '\x1F200' && c <= '\x1F251' -> 2- | c >= '\x1F300' && c <= '\x1F773' -> 1- | c >= '\x20000' && c <= '\x3FFFD' -> 2- | otherwise -> 1---- | Get real length of string, taking into account combining and double-wide--- characters.-realLength :: String -> Int-realLength = sum . map charWidth
@@ -1,24 +1,6 @@-{--Copyright (C) 2013-2014 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.Process- Copyright : Copyright (C) 2013-2014 John MacFarlane+ Copyright : Copyright (C) 2013-2024 John MacFarlane License : GNU GPL, version 2 or above Maintainer : John MacFarlane <jgm@berkeley.edu>@@ -29,76 +11,102 @@ -} module Text.Pandoc.Process (pipeProcess) where-import System.Process-import System.Exit (ExitCode (..))-import Control.Exception-import System.IO (hClose, hFlush)-import Control.Concurrent (putMVar, takeMVar, newEmptyMVar, forkIO)+import Control.Concurrent (MVar, forkIO, killThread, newEmptyMVar, putMVar,+ takeMVar)+import Control.Exception (SomeException (..))+import qualified Control.Exception as E import Control.Monad (unless)+import Control.DeepSeq (rnf) import qualified Data.ByteString.Lazy as BL+import Foreign.C (Errno (Errno), ePIPE)+import GHC.IO.Exception (IOErrorType(..), IOException(..))+import System.Exit (ExitCode (..))+import System.IO (hClose)+import System.Process {- | Version of 'System.Process.readProcessWithExitCode' that uses lazy bytestrings instead of strings and allows setting environment variables. @readProcessWithExitCode@ creates an external process, reads its-standard output and standard error strictly, waits until the process-terminates, and then returns the 'ExitCode' of the process,-the standard output, and the standard error.+standard output strictly, waits until the process+terminates, and then returns the 'ExitCode' of the process+and the standard output. stderr is inherited from the parent. If an asynchronous exception is thrown to the thread executing @readProcessWithExitCode@, the forked process will be terminated and @readProcessWithExitCode@ will wait (block) until the process has been terminated.--} +This function was adapted from @readProcessWithExitCode@ of module+System.Process, package process-1.6.3.0. The original code is BSD+licensed and © University of Glasgow 2004-2008.+-} pipeProcess :: Maybe [(String, String)] -- ^ environment variables -> FilePath -- ^ Filename of the executable (see 'proc' for details) -> [String] -- ^ any arguments -> BL.ByteString -- ^ standard input- -> IO (ExitCode,BL.ByteString,BL.ByteString) -- ^ exitcode, stdout, stderr-pipeProcess mbenv cmd args input =- mask $ \restore -> do- (Just inh, Just outh, Just errh, pid) <- createProcess (proc cmd args)- { env = mbenv,- std_in = CreatePipe,- std_out = CreatePipe,- std_err = CreatePipe }- flip onException- (do hClose inh; hClose outh; hClose errh;- terminateProcess pid; waitForProcess pid) $ restore $ do- -- fork off a thread to start consuming stdout- out <- BL.hGetContents outh- waitOut <- forkWait $ evaluate $ BL.length out+ -> IO (ExitCode,BL.ByteString) -- ^ exitcode, stdout+pipeProcess mbenv cmd args input = do+ let cp_opts = (proc cmd args)+ { env = mbenv+ , std_in = CreatePipe+ , std_out = CreatePipe+ , std_err = Inherit+ }+ withCreateProcess cp_opts $+ \mbInh mbOuth _ pid -> do+ let (inh, outh) =+ case (mbInh, mbOuth) of+ (Just i, Just o) -> (i, o)+ (Nothing, _) -> error "withCreateProcess no inh"+ (_, Nothing) -> error "withCreateProcess no outh" - -- fork off a thread to start consuming stderr- err <- BL.hGetContents errh- waitErr <- forkWait $ evaluate $ BL.length err+ out <- BL.hGetContents outh - -- now write and flush any input- let writeInput = do- unless (BL.null input) $ do- BL.hPutStr inh input- hFlush inh- hClose inh+ -- fork off threads to start consuming stdout & stderr+ withForkWait (E.evaluate $ rnf out) $ \waitOut -> do - writeInput+ -- now write any input+ unless (BL.null input) $+ ignoreSigPipe $ BL.hPutStr inh input+ -- hClose performs implicit hFlush, and thus may trigger a SIGPIPE+ ignoreSigPipe $ hClose inh - -- wait on the output- waitOut- waitErr+ -- wait on the output+ waitOut - hClose outh- hClose errh+ hClose outh -- wait on the process ex <- waitForProcess pid - return (ex, out, err)+ return (ex, out) -forkWait :: IO a -> IO (IO a)-forkWait a = do- res <- newEmptyMVar- _ <- mask $ \restore -> forkIO $ try (restore a) >>= putMVar res- return (takeMVar res >>= either (\ex -> throwIO (ex :: SomeException)) return)+-- | Fork a thread while doing something else, but kill it if there's an+-- exception.+--+-- This is important in the cases above because we want to kill the thread+-- that is holding the Handle lock, because when we clean up the process we+-- try to close that handle, which could otherwise deadlock.+--+-- This function was copied verbatim from module System.Process of package+-- process-1.6.3.0.+withForkWait :: IO () -> (IO () -> IO a) -> IO a+withForkWait async body = do+ waitVar <- newEmptyMVar :: IO (MVar (Either SomeException ()))+ E.mask $ \restore -> do+ tid <- forkIO $ E.try (restore async) >>= putMVar waitVar+ let wait = takeMVar waitVar >>= either E.throwIO return+ restore (body wait) `E.onException` killThread tid++-- This function was copied verbatim from module System.Process of package+-- process-1.6.3.0.+ignoreSigPipe :: IO () -> IO ()+ignoreSigPipe = E.handle $ \e ->+ case e of+ IOError { ioe_type = ResourceVanished+ , ioe_errno = Just ioe }+ | Errno ioe == ePIPE -> return ()+ _ -> E.throwIO e
@@ -0,0 +1,210 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE MonoLocalBinds #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TupleSections #-}+{- |+ Module : Text.Pandoc.Readers+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++This helper module exports the readers.++Note: all of the readers assume that the input text has @'\n'@+line endings. So if you get your input text from a web form,+you should remove @'\r'@ characters using @filter (/='\r')@.++-}++module Text.Pandoc.Readers+ (+ -- * Readers: converting /to/ Pandoc format+ Reader (..)+ , readers+ , readAsciiDoc+ , readDocx+ , readPptx+ , readXlsx+ , readODT+ , readMarkdown+ , readCommonMark+ , readCreole+ , readDokuWiki+ , readMediaWiki+ , readVimwiki+ , readRST+ , readOrg+ , readLaTeX+ , readHtml+ , readJATS+ , readJira+ , readTextile+ , readDocBook+ , readOPML+ , readHaddock+ , readNative+ , readJSON+ , readTWiki+ , readTikiWiki+ , readTxt2Tags+ , readEPUB+ , readMuse+ , readMan+ , readMdoc+ , readFB2+ , readIpynb+ , readCSV+ , readTSV+ , readCslJson+ , readBibTeX+ , readBibLaTeX+ , readEndNoteXML+ , readRIS+ , readRTF+ , readTypst+ , readDjot+ , readPod+ , readXML+ -- * Miscellaneous+ , getReader+ , getDefaultExtensions+ ) where++import Control.Monad.Except (throwError)+import Data.Aeson+import qualified Data.ByteString.Lazy as BL+import Data.Text (Text)+import qualified Data.Text as T+import Text.Pandoc.Class+import Text.Pandoc.Definition+import Text.Pandoc.Error+import Text.Pandoc.Extensions+import qualified Text.Pandoc.Format as Format+import Text.Pandoc.Options+import Text.Pandoc.Readers.AsciiDoc+import Text.Pandoc.Readers.CommonMark+import Text.Pandoc.Readers.Markdown+import Text.Pandoc.Readers.Creole+import Text.Pandoc.Readers.DocBook+import Text.Pandoc.Readers.Docx+import Text.Pandoc.Readers.Pptx+import Text.Pandoc.Readers.Xlsx+import Text.Pandoc.Readers.DokuWiki+import Text.Pandoc.Readers.EPUB+import Text.Pandoc.Readers.FB2+import Text.Pandoc.Readers.Ipynb+import Text.Pandoc.Readers.Haddock+import Text.Pandoc.Readers.HTML (readHtml)+import Text.Pandoc.Readers.JATS (readJATS)+import Text.Pandoc.Readers.Jira (readJira)+import Text.Pandoc.Readers.LaTeX+import Text.Pandoc.Readers.MediaWiki+import Text.Pandoc.Readers.Muse+import Text.Pandoc.Readers.Native+import Text.Pandoc.Readers.ODT+import Text.Pandoc.Readers.OPML+import Text.Pandoc.Readers.Org+import Text.Pandoc.Readers.Pod+import Text.Pandoc.Readers.RST+import Text.Pandoc.Readers.Textile+import Text.Pandoc.Readers.TikiWiki+import Text.Pandoc.Readers.TWiki+import Text.Pandoc.Readers.Txt2Tags+import Text.Pandoc.Readers.Vimwiki+import Text.Pandoc.Readers.Man+import Text.Pandoc.Readers.Mdoc+import Text.Pandoc.Readers.CSV+import Text.Pandoc.Readers.CslJson+import Text.Pandoc.Readers.BibTeX+import Text.Pandoc.Readers.EndNote+import Text.Pandoc.Readers.RIS+import Text.Pandoc.Readers.RTF+import Text.Pandoc.Readers.Typst+import Text.Pandoc.Readers.Djot+import Text.Pandoc.Readers.XML+import qualified Text.Pandoc.UTF8 as UTF8+import Text.Pandoc.Sources (ToSources(..), sourcesToText)++data Reader m = TextReader (forall a . ToSources a =>+ ReaderOptions -> a -> m Pandoc)+ | ByteStringReader (ReaderOptions -> BL.ByteString -> m Pandoc)++-- | Association list of formats and readers.+readers :: PandocMonad m => [(Text, Reader m)]+readers = [("native" , TextReader readNative)+ ,("json" , TextReader readJSON)+ ,("markdown" , TextReader readMarkdown)+ ,("markdown_strict" , TextReader readMarkdown)+ ,("markdown_phpextra" , TextReader readMarkdown)+ ,("markdown_github" , TextReader readMarkdown)+ ,("markdown_mmd", TextReader readMarkdown)+ ,("commonmark" , TextReader readCommonMark)+ ,("commonmark_x" , TextReader readCommonMark)+ ,("asciidoc" , TextReader readAsciiDoc)+ ,("creole" , TextReader readCreole)+ ,("dokuwiki" , TextReader readDokuWiki)+ ,("gfm" , TextReader readCommonMark)+ ,("rst" , TextReader readRST)+ ,("mediawiki" , TextReader readMediaWiki)+ ,("vimwiki" , TextReader readVimwiki)+ ,("docbook" , TextReader readDocBook)+ ,("opml" , TextReader readOPML)+ ,("org" , TextReader readOrg)+ ,("textile" , TextReader readTextile) -- TODO : textile+lhs+ ,("html" , TextReader readHtml)+ ,("bits" , TextReader readJATS)+ ,("jats" , TextReader readJATS)+ ,("jira" , TextReader readJira)+ ,("latex" , TextReader readLaTeX)+ ,("haddock" , TextReader readHaddock)+ ,("twiki" , TextReader readTWiki)+ ,("tikiwiki" , TextReader readTikiWiki)+ ,("docx" , ByteStringReader readDocx)+ ,("pptx" , ByteStringReader readPptx)+ ,("xlsx" , ByteStringReader readXlsx)+ ,("odt" , ByteStringReader readODT)+ ,("t2t" , TextReader readTxt2Tags)+ ,("epub" , ByteStringReader readEPUB)+ ,("muse" , TextReader readMuse)+ ,("man" , TextReader readMan)+ ,("fb2" , TextReader readFB2)+ ,("ipynb" , TextReader readIpynb)+ ,("csv" , TextReader readCSV)+ ,("tsv" , TextReader readTSV)+ ,("csljson" , TextReader readCslJson)+ ,("bibtex" , TextReader readBibTeX)+ ,("biblatex" , TextReader readBibLaTeX)+ ,("endnotexml" , TextReader readEndNoteXML)+ ,("ris" , TextReader readRIS)+ ,("rtf" , TextReader readRTF)+ ,("typst" , TextReader readTypst)+ ,("djot" , TextReader readDjot)+ ,("mdoc" , TextReader readMdoc)+ ,("pod" , TextReader readPod)+ ,("xml" , TextReader readXML)+ ]++-- | Retrieve reader, extensions based on format spec (format+extensions).+getReader :: PandocMonad m => Format.FlavoredFormat -> m (Reader m, Extensions)+getReader flvrd = do+ let readerName = Format.formatName flvrd+ case lookup readerName readers of+ Nothing -> throwError $ PandocUnknownReaderError readerName+ Just r -> (r,) <$>+ Format.applyExtensionsDiff (Format.getExtensionsConfig readerName) flvrd++-- | Read pandoc document from JSON format.+readJSON :: (PandocMonad m, ToSources a)+ => ReaderOptions+ -> a+ -> m Pandoc+readJSON _ s =+ case eitherDecode' . BL.fromStrict . UTF8.fromText+ . sourcesToText . toSources $ s of+ Right doc -> return doc+ Left e -> throwError $ PandocParseError ("JSON parse error: "+ <> T.pack e)
@@ -0,0 +1,416 @@+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FlexibleContexts #-}++{- |+ Module : Text.Pandoc.Readers.AsciiDoc+ Copyright : Copyright (C) 2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++Reads and evaluates a AsciiDoc document as a Pandoc AST.+-}+module Text.Pandoc.Readers.AsciiDoc+ ( readAsciiDoc+ )+where++import Text.Pandoc.Class+import Text.Pandoc.Options+import Text.Pandoc.Definition+import Text.Pandoc.Walk+import Text.Pandoc.Shared (addPandocAttributes, blocksToInlines, safeRead,+ tshow)+import qualified Text.Pandoc.UTF8 as UTF8+import qualified AsciiDoc as A+import Text.Pandoc.Error+import qualified Text.Pandoc.Builder as B+import Text.Pandoc.Readers.HTML (readHtml)+import Control.Monad.Except (throwError)+import Control.Monad+import Text.Pandoc.Parsing (newPos, sourceName)+import Text.Pandoc.Logging+import Text.Pandoc.Sources+import Control.Monad.State+import qualified Data.List as L+import Data.Char (chr, ord)+import qualified Data.Text as T+import qualified Data.Map as M+import Data.Maybe (fromMaybe)++-- import Debug.Trace++-- | Read AsciiDoc from an input string and return a Pandoc document.+readAsciiDoc :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc+readAsciiDoc _opts inp = do+ let Sources sources = toSources inp+ (mconcat <$> mapM+ (\(sourcepos, t) ->+ A.parseDocument getIncludeFile raiseError (sourceName sourcepos) t)+ sources)+ >>= resolveFootnotes+ >>= resolveStem+ >>= resolveIcons+ >>= toPandoc+ where+ getIncludeFile fp = UTF8.toText <$> readFileStrict fp+ raiseError fp pos msg = throwError $ PandocParseError $ T.pack+ $ msg <> " at " <> show fp <>+ " char " <> show pos++toPandoc :: PandocMonad m => A.Document -> m Pandoc+toPandoc doc =+ Pandoc <$> doMeta (A.docMeta doc)+ <*> (B.toList <$> doBlocks (A.docBlocks doc))++resolveFootnotes :: Monad m => A.Document -> m A.Document+resolveFootnotes doc = do+ evalStateT (A.mapInlines go doc) (mempty :: M.Map T.Text [A.Inline])+ where+ go (A.Inline attr (A.Footnote (Just (A.FootnoteId fnid)) ils)) = do+ fnmap <- get+ case M.lookup fnid fnmap of+ Just ils' ->+ pure $ A.Inline attr (A.Footnote (Just (A.FootnoteId fnid)) ils')+ Nothing -> do+ put $ M.insert fnid ils fnmap+ pure $ A.Inline attr (A.Footnote (Just (A.FootnoteId fnid)) ils)+ go x = pure x++resolveStem :: Monad m => A.Document -> m A.Document+resolveStem doc = do+ let defaultType = case M.lookup "stem" (A.docAttributes (A.docMeta doc)) of+ Just "asciimath" -> A.AsciiMath+ _ -> A.LaTeXMath+ let doInlineStem (A.Inline attr (A.Math Nothing t)) =+ pure $ A.Inline attr (A.Math (Just defaultType) t)+ doInlineStem x = pure x+ let doBlockStem (A.Block attr mbtit (A.MathBlock Nothing t)) =+ pure $ A.Block attr mbtit (A.MathBlock (Just defaultType) t)+ doBlockStem x = A.mapInlines doInlineStem x+ A.mapBlocks doBlockStem doc++-- resolve icons as either characters in an icon font or images+resolveIcons :: Monad m => A.Document -> m A.Document+resolveIcons doc = A.mapInlines fromIcon doc+ where+ docattrs = A.docAttributes (A.docMeta doc)+ iconFont = case M.lookup "icons" docattrs of+ Just "font" -> True+ _ -> False+ iconsdir = fromMaybe "./images/icons" $ M.lookup "iconsdir" docattrs+ icontype = fromMaybe "png" $ M.lookup "icontype" docattrs+ addClasses cls (A.Attr ps kvs) =+ A.Attr ps $+ case M.lookup "role" kvs of+ Just r -> M.insert "role" (T.unwords (r : cls)) kvs+ Nothing -> M.insert "role" (T.unwords cls) kvs+ fromIcon (A.Inline attr (A.Icon name)) =+ if iconFont+ then pure $+ A.Inline (addClasses ["fa", "fa-" <> name] attr) (A.Span [])+ else pure $ -- default is to use an image+ A.Inline (addClasses ["icon"] attr)+ (A.InlineImage+ (A.Target+ (iconsdir <> "/" <> name <> "." <> icontype))+ Nothing Nothing Nothing)+ fromIcon x = pure x++addAttribution :: Maybe A.Attribution -> B.Blocks -> B.Blocks+addAttribution Nothing bs = bs+addAttribution (Just (A.Attribution t)) bs = B.fromList $+ case B.toList bs of+ [B.Div attr bls] -> [B.Div attr (bls ++ [attrBlock])]+ [B.BlockQuote bls] -> [B.BlockQuote (bls ++ [attrBlock])]+ xs -> xs ++ [attrBlock]+ where+ attrBlock = Para (B.toList $ B.text $ "\x2014 " <> t)++doMeta :: PandocMonad m => A.Meta -> m B.Meta+doMeta meta = do+ tit' <- doInlines (A.docTitle meta)+ pure $+ (if tit' == mempty+ then id+ else B.setMeta "title" tit') .+ (case A.docAuthors meta of+ [] -> id+ as -> B.setMeta "author" (map fromAuthor as)) .+ (case A.docRevision meta of+ Nothing -> id+ Just (A.Revision vers mbdate mbremark) ->+ B.setMeta "version" vers .+ maybe id (B.setMeta "date") mbdate .+ maybe id (B.setMeta "remark") mbremark) .+ flip (L.foldl' (\m (k,v) ->+ -- leave out flags that are set just for processing+ if k == "sectids" || k == "stem"+ then m+ else if T.null v+ then B.setMeta k True m+ else B.setMeta k v m))+ (M.toList (A.docAttributes meta))+ $ mempty++fromAuthor :: A.Author -> B.Inlines+fromAuthor au = B.text (A.authorName au) <>+ maybe mempty (\email ->+ " (" <> B.link ("mailto:" <> email) "" (B.str email) <> ")")+ (A.authorEmail au)++doBlocks :: PandocMonad m => [A.Block] -> m B.Blocks+doBlocks = fmap mconcat . mapM doBlock++addBlockAttr :: A.Attr -> B.Blocks -> B.Blocks+addBlockAttr (A.Attr _ kvs') bs =+ case B.toList bs of+ x@(B.OrderedList{}) : xs -> -- "start" is handled in list attribs+ addPandocAttributes (M.toList $ M.delete "start" kvs)+ (B.singleton x) <> B.fromList xs+ x:xs -> addPandocAttributes (M.toList kvs) (B.singleton x)+ <> B.fromList xs+ [] -> mempty+ where+ kvs = M.mapKeys (\k -> if k == "role" then "class" else k) kvs'++addBlockTitle :: B.Inlines -> B.Blocks -> B.Blocks+addBlockTitle tit' bs =+ let tit = B.toList tit'+ in case B.toList bs of+ [B.Table attr _ colspecs thead tbody tfoot] ->+ B.singleton $ B.Table attr (B.Caption Nothing [B.Plain tit])+ colspecs thead tbody tfoot+ [B.Figure attr _ bs'] ->+ B.singleton $ B.Figure attr (B.Caption Nothing [B.Plain tit]) bs'+ [B.Div attr (B.Div ("",["title"],[]) [Para _] : bs')] ->+ -- replace existing title, which might be e.g. "Note"+ B.singleton $ B.Div attr (B.Div ("",["title"],[]) [B.Para tit] : bs')+ [B.Div attr bs'] -> -- put title Div inside+ B.singleton $ B.Div attr (B.Div ("",["title"],[]) [B.Para tit] : bs')+ _ -> B.divWith B.nullAttr (B.divWith ("",["title"],[]) (B.para tit') <> bs)++doBlock :: PandocMonad m => A.Block -> m B.Blocks+doBlock (A.Block attr@(A.Attr ps kvs) mbtitle bt) = do+ mbtitle' <- case mbtitle of+ Nothing -> pure Nothing+ Just (A.BlockTitle ils) -> Just <$> doInlines ils+ addBlockAttr attr . maybe id addBlockTitle mbtitle' <$>+ case bt of+ A.Section (A.Level lev) ils bs -> do+ ils' <- doInlines ils+ bs' <- doBlocks bs+ pure $ (B.header lev ils') <> bs'+ A.DiscreteHeading (A.Level lev) ils ->+ B.header lev <$> doInlines ils+ A.Paragraph ils -> B.para <$> doInlines ils+ A.LiteralBlock t -> pure $ B.codeBlock t+ A.Listing mblang lns -> do+ let fromCallout (A.Callout i)+ | i <= 20 = T.pack [' ', chr (0x2460 + i - 1)]+ | otherwise = "<" <> tshow i <> ">"+ let fromSourceLine (A.SourceLine t callouts) =+ t <> mconcat (map fromCallout callouts)+ let code = T.intercalate "\n" $ map fromSourceLine lns+ let classes = case mblang of+ Nothing -> []+ Just (A.Language l) -> [l]+ pure $ B.codeBlockWith ("", classes, []) code+ A.IncludeListing _ _ Nothing -> pure mempty+ A.IncludeListing mblang _fp (Just lns) ->+ doBlock (A.Block mempty mbtitle (A.Listing mblang lns))+ A.ExampleBlock bs -> B.divWith ("",["example"],[]) <$> doBlocks bs+ A.Sidebar bs -> B.divWith ("",["sidebar"],[]) <$> doBlocks bs+ A.OpenBlock bs -> B.divWith ("",[],[]) <$> doBlocks bs+ A.QuoteBlock mbattrib bs ->+ addAttribution mbattrib . B.blockQuote <$> doBlocks bs+ A.Verse mbattrib bs ->+ addAttribution mbattrib . B.blockQuote <$> doBlocks bs+ -- TODO when texmath's asciimath parser works, convert:+ A.MathBlock (Just A.AsciiMath) t -> pure $ B.para $ B.displayMath t+ A.MathBlock (Just A.LaTeXMath) t -> pure $ B.para $ B.displayMath t+ A.MathBlock Nothing _ ->+ throwError $ PandocParseError "Encountered math type Nothing"+ A.List (A.BulletList _) items ->+ B.bulletList <$> mapM doItem items+ A.List A.CheckList items ->+ B.bulletList <$> mapM doItem items+ A.List (A.OrderedList _ mbstart) items -> do+ let start = fromMaybe (1 :: Int)+ (mbstart `mplus` (M.lookup "start" kvs >>= safeRead))+ let getStyle xs = case xs of+ "arabic":_ -> Decimal+ "decimal":_ -> Decimal+ "loweralpha":_ -> LowerAlpha+ "upperalpha":_ -> UpperAlpha+ "lowerroman":_ -> LowerRoman+ "upperroman":_ -> UpperRoman+ _:rest -> getStyle rest+ [] -> DefaultStyle+ let sty = getStyle ps+ let delim = DefaultDelim+ B.orderedListWith (start, sty, delim) <$> mapM doItem items+ A.List A.CalloutList items ->+ B.divWith ("",["callout-list"],[]) . B.orderedList <$> mapM doItem items+ A.DefinitionList items+ | "ordered" `elem` ps ->+ B.orderedList <$>+ mapM (fmap (B.definitionList . (:[])) . doDefListItem) items+ | otherwise -> B.definitionList <$> mapM doDefListItem items+ A.Table specs mbHeader rows mbFooter -> do+ let toAlign A.AlignLeft = B.AlignLeft+ toAlign A.AlignCenter = B.AlignCenter+ toAlign A.AlignRight = B.AlignRight+ let fromCell (A.TableCell bs mbHorizAlign _mbVertAlign colspan rowspan) =+ B.Cell B.nullAttr (maybe B.AlignDefault toAlign mbHorizAlign)+ (B.RowSpan rowspan) (B.ColSpan colspan) . B.toList+ <$> doBlocks bs+ let fromRow (A.TableRow cs) = B.Row B.nullAttr <$> mapM fromCell cs+ tbody <- B.TableBody B.nullAttr (B.RowHeadColumns 0) [] <$> mapM fromRow rows+ thead <- B.TableHead B.nullAttr <$> maybe (pure []) (mapM fromRow) mbHeader+ tfoot <- B.TableFoot B.nullAttr <$> maybe (pure []) (mapM fromRow) mbFooter+ let totalWidth = sum $ map (fromMaybe 1 . A.colWidth) specs+ let toColSpec spec = (maybe B.AlignDefault toAlign (A.colHorizAlign spec),+ maybe B.ColWidthDefault+ (B.ColWidth . (\x ->+ fromIntegral x / fromIntegral totalWidth))+ (A.colWidth spec))+ let colspecs = map toColSpec specs+ pure $ B.table (B.Caption Nothing mempty) -- added by addBlockTitle+ colspecs thead [tbody] tfoot+ A.BlockImage target mbalt mbw mbh -> do+ img' <- doInline (A.Inline mempty (A.InlineImage target mbalt mbw mbh))+ -- TODO have a global function that adds the title to caption here:+ pure $ B.figure (Caption Nothing mempty) -- added by addBlockTitle+ (B.plain img')+ -- TODO alt text?+ A.BlockAudio (A.Target t) ->+ pure $ B.plain $ B.image t "" (B.str t)+ -- TODO alt text?+ A.BlockVideo (A.Target t) ->+ pure $ B.plain $ B.image t "" (B.str t)+ A.TOC -> pure $ B.divWith ("toc",[],[]) mempty+ A.Admonition admonitionType bs -> do+ let admon = T.pack $ show admonitionType+ bs' <- doBlocks bs+ pure $ B.divWith ("",[T.toLower admon],[])+ $ B.divWith ("",["title"],[]) (B.para (B.str admon)) <> bs'+ A.PageBreak ->+ pure $ B.divWith ("", ["page-break"], [("wrapper", "1")]) B.horizontalRule+ A.ThematicBreak -> pure $ B.horizontalRule+ A.Include fp (Just bs) ->+ B.divWith ("",["included"],[("path",T.pack fp)]) <$> doBlocks bs+ A.Include fp Nothing -> do+ report $ CouldNotLoadIncludeFile (T.pack fp) (newPos "" 0 0)+ pure mempty+ A.PassthroughBlock t ->+ case runPure (readHtml def{+ readerExtensions = extensionsFromList [Ext_raw_html]+ } t) of+ Left _ -> pure $ B.rawBlock "html" t+ Right (Pandoc _ bs) -> pure $ B.fromList bs++doItem :: PandocMonad m => A.ListItem -> m B.Blocks+doItem (A.ListItem Nothing bs) = doBlocks bs+doItem (A.ListItem (Just checkstate) bs) = do+ bs' <- doBlocks bs+ let check = case checkstate of+ A.Checked -> Str "\9746"+ A.Unchecked -> Str "\9744"+ pure $ B.fromList+ $ case B.toList bs' of+ (B.Para ils : rest) -> B.Para (check : B.Space : ils) : rest+ (B.Plain ils : rest) -> B.Plain (check : B.Space : ils) : rest+ rest -> B.Para [check] : rest++doDefListItem :: PandocMonad m+ => ([A.Inline], [A.Block]) -> m (B.Inlines , [B.Blocks])+doDefListItem (lab, bs) = do+ lab' <- doInlines lab+ bs' <- doBlocks bs+ pure (lab', [bs'])++doInlines :: PandocMonad m => [A.Inline] -> m B.Inlines+doInlines = fmap mconcat . mapM doInline++doInline :: PandocMonad m => A.Inline -> m B.Inlines+doInline (A.Inline (A.Attr _ps kvs') it) = do+ let kvs = M.mapKeys (\k -> if k == "role" then "class" else k) kvs'+ addPandocAttributes (M.toList kvs) <$>+ case it of+ A.Str t -> pure $ B.text t+ A.HardBreak -> pure B.linebreak+ A.Bold ils -> B.strong <$> doInlines ils+ A.Italic ils -> B.emph <$> doInlines ils+ A.Monospace ils -> walk monospaceStr <$> doInlines ils+ A.Superscript ils -> B.superscript <$> doInlines ils+ A.Subscript ils -> B.subscript <$> doInlines ils+ A.Highlight ils -> B.spanWith ("",["mark"],[]) <$> doInlines ils+ A.Strikethrough ils -> B.strikeout <$> doInlines ils+ A.DoubleQuoted ils -> B.doubleQuoted <$> doInlines ils+ A.SingleQuoted ils -> B.singleQuoted <$> doInlines ils+ -- TODO when texmath's asciimath parser works, convert:+ A.Math (Just A.AsciiMath) t -> pure $ B.math t+ A.Math (Just A.LaTeXMath) t -> pure $ B.math t+ A.Math Nothing _ ->+ throwError $ PandocParseError "Encountered math type Nothing"+ A.Icon t -> pure $ B.spanWith ("",["icon"],[("name",t)])+ (B.str ("[" <> t <> "]"))+ A.Button t -> pure $ B.spanWith ("",["button"],[])+ (B.strong $ B.str ("[" <> t <> "]"))+ A.Kbd ts -> pure $ mconcat $ L.intersperse (B.str "+") $+ map (B.spanWith ("",["kbd"],[]) . B.strong . B.str) ts+ A.Menu ts -> pure $ B.spanWith ("",["menu"],[]) $+ B.strong $ B.text $ T.intercalate " › " ts+ -- TODO do we need linktype?+ A.Link _linkType (A.Target t) ils -> B.link t "" <$> doInlines ils+ A.InlineImage (A.Target url) mbalt mbwidth mbheight -> do+ let alt = case mbalt of+ Just (A.AltText t) -> B.text t+ Nothing -> mempty+ width = case mbwidth of+ Just (A.Width n) -> [("width", T.pack $ show n <> "px")]+ Nothing -> []+ height = case mbheight of+ Just (A.Height n) -> [("height", T.pack $ show n <> "px")]+ Nothing -> []+ pure $ B.imageWith ("",[], width ++ height) url "" alt+ A.Footnote _ ils -> B.note . B.para <$> doInlines ils+ A.InlineAnchor t _ -> pure $ B.spanWith (t, [], []) mempty+ A.BibliographyAnchor t _ -> pure $ B.spanWith (t, [], []) mempty+ A.CrossReference t Nothing ->+ pure $ B.linkWith ("",["cross-reference"],[]) ("#" <> t) "" (B.str t)+ A.CrossReference t (Just ils) -> do+ B.linkWith ("",["cross-reference"],[]) ("#" <> t) "" <$> doInlines ils+ A.AttributeReference (A.AttributeName t) -> -- if this is here, it's unresolved+ pure $ B.str ("{" <> t <> "}")+ A.Span ils -> B.spanWith B.nullAttr <$> doInlines ils+ A.IndexEntry (A.TermInText t) ->+ pure $ B.spanWith ("",["index"],[("term",t)]) (B.text t)+ A.IndexEntry (A.TermConcealed ts) ->+ pure $ B.spanWith ("",["index"],[("term",T.intercalate "," ts)]) mempty+ A.Counter name ctype val ->+ pure $ B.spanWith ("",["counter"],[("name",name)]) $ B.str $+ case ctype of+ A.DecimalCounter -> tshow val+ A.UpperAlphaCounter -> T.singleton $ chr (ord 'A' + val - 1)+ A.LowerAlphaCounter -> T.singleton $ chr (ord 'a' + val - 1)+ -- Passthrough is hard to get right, because pandoc's RawInline needs+ -- a format specifier. Often in asciidoc passthrough is used as a form+ -- of escaping, so the best approach seems to be treating it as HTML+ -- and parsing it:+ A.Passthrough t -> do+ case runPure (readHtml def{+ readerExtensions = extensionsFromList [Ext_raw_html]+ } t) of+ Left _ -> pure $ B.rawInline "html" t+ Right (Pandoc _ bs) -> pure $ B.fromList . blocksToInlines $ bs++monospaceStr :: Inline -> Inline+monospaceStr (Str t) = Code B.nullAttr t+monospaceStr x = x
@@ -0,0 +1,78 @@+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Readers.BibTeX+ Copyright : Copyright (C) 2020-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++Parses BibTeX or BibLaTeX bibliographies into a Pandoc document+with empty body and `references` and `nocite` fields+in the metadata. A wildcard `nocite` is used so that+if the document is rendered in another format, the+entire bibliography will be printed.+-}+module Text.Pandoc.Readers.BibTeX+ ( readBibTeX+ , readBibLaTeX+ )+where++import Text.Pandoc.Options+import Text.Pandoc.Definition+import Text.Pandoc.Builder (setMeta, cite, str)+import Text.Pandoc.Parsing (fromParsecError)+import Citeproc (Lang(..), parseLang)+import Citeproc.Locale (getLocale)+import Text.Pandoc.Error (PandocError(..))+import Text.Pandoc.Class (PandocMonad, lookupEnv)+import Text.Pandoc.Citeproc.BibTeX as BibTeX+import Text.Pandoc.Citeproc.MetaValue (referenceToMetaValue)+import Text.Pandoc.Sources (ToSources(..))+import Control.Monad.Except (throwError)++-- | Read BibTeX from an input string and return a Pandoc document.+-- The document will have only metadata, with an empty body.+-- The metadata will contain a `references` field with the+-- bibliography entries, and a `nocite` field with the wildcard `[@*]`.+readBibTeX :: (PandocMonad m, ToSources a)+ => ReaderOptions -> a -> m Pandoc+readBibTeX = readBibTeX' BibTeX.Bibtex++-- | Read BibLaTeX from an input string and return a Pandoc document.+-- The document will have only metadata, with an empty body.+-- The metadata will contain a `references` field with the+-- bibliography entries, and a `nocite` field with the wildcard `[@*]`.+readBibLaTeX :: (PandocMonad m, ToSources a)+ => ReaderOptions -> a -> m Pandoc+readBibLaTeX = readBibTeX' BibTeX.Biblatex++readBibTeX' :: (PandocMonad m, ToSources a)+ => Variant -> ReaderOptions -> a -> m Pandoc+readBibTeX' variant _opts t = do+ mblangEnv <- lookupEnv "LANG"+ let defaultLang = Lang "en" Nothing (Just "US") [] [] []+ let lang = case mblangEnv of+ Nothing -> defaultLang+ Just l -> either (const defaultLang) id $ parseLang l+ locale <- case getLocale lang of+ Left e ->+ case getLocale (Lang "en" Nothing (Just "US") [] [] []) of+ Right l -> return l+ Left _ -> throwError $ PandocCiteprocError e+ Right l -> return l+ case BibTeX.readBibtexString variant locale (const True) t of+ Left e -> throwError $ fromParsecError (toSources t) e+ Right refs -> return $ setMeta "references"+ (map referenceToMetaValue refs)+ . setMeta "nocite"+ (cite [Citation {citationId = "*"+ , citationPrefix = []+ , citationSuffix = []+ , citationMode = NormalCitation+ , citationNoteNum = 0+ , citationHash = 0}]+ (str "[@*]"))+ $ Pandoc nullMeta []
@@ -0,0 +1,73 @@+{-# LANGUAGE FlexibleContexts #-}++{-# LANGUAGE ScopedTypeVariables #-}+{- |+ Module : Text.Pandoc.Readers.CSV+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++Conversion from CSV or TSV to a 'Pandoc' table.+-}+module Text.Pandoc.Readers.CSV (+ readCSV,+ readTSV+) where+import qualified Data.Text as T+import Text.Pandoc.CSV (parseCSV, defaultCSVOptions, CSVOptions(..))+import Text.Pandoc.Definition+import qualified Text.Pandoc.Builder as B+import Text.Pandoc.Class (PandocMonad)+import Text.Pandoc.Sources (ToSources(..), sourcesToText)+import Text.Pandoc.Options (ReaderOptions)+import Control.Monad.Except (throwError)+import Data.Text (Text)+import Data.List (intersperse)+import Text.Pandoc.Parsing (fromParsecError)++readCSV :: (PandocMonad m, ToSources a)+ => ReaderOptions -- ^ Reader options+ -> a+ -> m Pandoc+readCSV _opts s = do+ readCSVWith defaultCSVOptions $ sourcesToText $ toSources s++readTSV :: (PandocMonad m, ToSources a)+ => ReaderOptions -- ^ Reader options+ -> a+ -> m Pandoc+readTSV _opts s = do+ readCSVWith tsvOpts $ sourcesToText $ toSources s+ where+ tsvOpts = CSVOptions{+ csvDelim = '\t',+ csvQuote = Nothing,+ csvKeepSpace = False,+ csvEscape = Nothing }++readCSVWith :: PandocMonad m+ => CSVOptions+ -> Text+ -> m Pandoc+readCSVWith csvopts txt = do+ case parseCSV csvopts txt of+ Right (r:rs) -> return $ B.doc $ B.table capt+ (zip aligns widths)+ (TableHead nullAttr hdrs)+ [TableBody nullAttr 0 [] rows]+ (TableFoot nullAttr [])+ where capt = B.emptyCaption+ numcols = length r+ toplain = B.simpleCell . B.plain . mconcat .+ intersperse B.linebreak . map B.text . T.lines+ toRow = Row nullAttr . map toplain+ toHeaderRow l = [toRow l | not (null l)]+ hdrs = toHeaderRow r+ rows = map toRow rs+ aligns = replicate numcols AlignDefault+ widths = replicate numcols ColWidthDefault+ Right [] -> return $ B.doc mempty+ Left e -> throwError $ fromParsecError (toSources [("",txt)]) e
@@ -0,0 +1,196 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE ScopedTypeVariables #-}+{- |+ Module : Text.Pandoc.Readers.CommonMark+ Copyright : Copyright (C) 2015-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++Conversion of CommonMark-formatted plain text to 'Pandoc' document.++CommonMark is a strongly specified variant of Markdown: http://commonmark.org.+-}+module Text.Pandoc.Readers.CommonMark (readCommonMark)+where++import Commonmark+import Commonmark.Extensions+import Commonmark.Pandoc+import Data.Text (Text)+import Text.Pandoc.Class.PandocMonad (PandocMonad)+import Text.Pandoc.Definition+import Text.Pandoc.Builder as B+import Text.Pandoc.Options+import Text.Pandoc.Readers.Metadata (yamlMetaBlock)+import Control.Monad (MonadPlus(mzero))+import Control.Monad.Except ( MonadError(throwError) )+import Data.Functor.Identity (runIdentity)+import Data.Typeable+import Text.Pandoc.Parsing (runParserT, getInput, getPosition,+ runF, defaultParserState, option, many1, anyChar,+ Sources(..), ToSources(..), ParsecT, Future,+ incSourceLine, fromParsecError)+import Text.Pandoc.Walk (walk)+import qualified Data.Text as T+import qualified Data.Attoparsec.Text as A+import Control.Applicative ((<|>))++-- | Parse a CommonMark formatted string into a 'Pandoc' structure.+readCommonMark :: (PandocMonad m, ToSources a)+ => ReaderOptions -> a -> m Pandoc+readCommonMark opts s+ | isEnabled Ext_yaml_metadata_block opts = do+ let sources = toSources s+ let firstSourceName = case unSources sources of+ ((pos,_):_) -> sourceName pos+ _ -> ""+ let toks = concatMap sourceToToks (unSources sources)+ res <- runParserT (do meta <- yamlMetaBlock (metaValueParser opts)+ pos <- getPosition+ rest <- getInput+ let rest' = case rest of+ -- update position of first source (#7863):+ Sources ((_,t):xs) -> Sources ((pos,t):xs)+ _ -> rest+ return (meta, rest'))+ defaultParserState firstSourceName sources+ case res of+ Left _ -> readCommonMarkBody opts sources toks+ Right (meta, rest) -> do+ -- strip off metadata section and parse body+ let body = concatMap sourceToToks (unSources rest)+ Pandoc _ bs <- readCommonMarkBody opts sources body+ return $ Pandoc (runF meta defaultParserState) bs+ | otherwise = do+ let sources = toSources s+ let toks = concatMap sourceToToks (unSources sources)+ readCommonMarkBody opts sources toks++makeFigures :: Block -> Block+makeFigures (Para [Image (ident,classes,kvs) alt (src,tit)])+ | not (null alt) =+ Figure (ident,[],[])+ (Caption Nothing [Plain alt])+ [Plain [Image ("",classes,kvs) alt (src,tit)]]+makeFigures b = b++sourceToToks :: (SourcePos, Text) -> [Tok]+sourceToToks (pos, s) = map adjust $ tokenize (sourceName pos) s+ where+ adjust = case sourceLine pos of+ 1 -> id+ n -> \tok -> tok{ tokPos =+ incSourceLine (tokPos tok) (n - 1) }+++metaValueParser :: Monad m+ => ReaderOptions -> ParsecT Sources st m (Future st MetaValue)+metaValueParser opts = do+ inp <- option "" $ T.pack <$> many1 anyChar+ let toks = concatMap sourceToToks (unSources (toSources inp))+ case runIdentity (parseCommonmarkWith (specFor opts) toks) of+ Left _ -> mzero+ Right (Cm bls :: Cm () Blocks) -> return $ return $ B.toMetaValue bls++readCommonMarkBody :: PandocMonad m => ReaderOptions -> Sources -> [Tok] -> m Pandoc+readCommonMarkBody opts s toks =+ (if isEnabled Ext_implicit_figures opts+ then walk makeFigures+ else id) .+ (if isEnabled Ext_tex_math_gfm opts+ then walk handleGfmMath+ else id) .+ (if readerStripComments opts+ then walk stripBlockComments . walk stripInlineComments+ else id) <$>+ if isEnabled Ext_sourcepos opts+ then case runIdentity (parseCommonmarkWith (specFor opts) toks) of+ Left err -> throwError $ fromParsecError s err+ Right (Cm bls :: Cm SourceRange Blocks) -> return $ B.doc bls+ else case runIdentity (parseCommonmarkWith (specFor opts) toks) of+ Left err -> throwError $ fromParsecError s err+ Right (Cm bls :: Cm () Blocks) -> return $ B.doc bls++handleGfmMath :: Block -> Block+handleGfmMath (CodeBlock ("",["math"],[]) raw) = Para [Math DisplayMath raw]+handleGfmMath x = walk handleGfmMathInline x++handleGfmMathInline :: Inline -> Inline+handleGfmMathInline (Math InlineMath math'') =+ let math' = T.replace "\\\\{" "\\{" . T.replace "\\\\}" "\\}" $ math''+ -- see #10631+ (ticks, rest) = T.span (== '`') math'+ in if T.null ticks+ then Math InlineMath math'+ else case T.stripSuffix ticks rest of+ Just middle | not (T.null middle) && (T.last middle /= '`')+ -> Math InlineMath middle+ _ -> Math InlineMath math'+handleGfmMathInline x = x++stripBlockComments :: Block -> Block+stripBlockComments (RawBlock (B.Format "html") s) =+ RawBlock (B.Format "html") (removeComments s)+stripBlockComments x = x++stripInlineComments :: Inline -> Inline+stripInlineComments (RawInline (B.Format "html") s) =+ RawInline (B.Format "html") (removeComments s)+stripInlineComments x = x++removeComments :: Text -> Text+removeComments s =+ either (const s) id $ A.parseOnly pRemoveComments s+ where+ pRemoveComments = mconcat <$> A.many'+ ("" <$ (A.string "<!--" *> A.scan (0 :: Int) scanChar <* A.char '>') <|>+ (A.takeWhile1 (/= '<')) <|>+ (A.string "<"))+ scanChar st c =+ case c of+ '-' -> Just (st + 1)+ '>' | st >= 2 -> Nothing+ _ -> Just 0++specFor :: (Monad m, Typeable m, Typeable a,+ Rangeable (Cm a Inlines), Rangeable (Cm a Blocks))+ => ReaderOptions -> SyntaxSpec m (Cm a Inlines) (Cm a Blocks)+specFor opts = foldr ($) defaultSyntaxSpec exts+ where+ exts = [ (hardLineBreaksSpec <>) | isEnabled Ext_hard_line_breaks opts ] +++ [ (smartPunctuationSpec <>) | isEnabled Ext_smart opts ] +++ [ (strikethroughSpec <>) | isEnabled Ext_strikeout opts ] +++ [ (superscriptSpec <>) | isEnabled Ext_superscript opts ] +++ [ (subscriptSpec <>) | isEnabled Ext_subscript opts ] +++ [ (mathSpec <>) | isEnabled Ext_tex_math_dollars opts ] +++ [ (fancyListSpec <>) | isEnabled Ext_fancy_lists opts ] +++ [ (fencedDivSpec <>) | isEnabled Ext_fenced_divs opts ] +++ [ (bracketedSpanSpec <>) | isEnabled Ext_bracketed_spans opts ] +++ [ (rawAttributeSpec <>) | isEnabled Ext_raw_attribute opts ] +++ [ (attributesSpec <>) | isEnabled Ext_attributes opts ] +++ [ (alertSpec <>) | isEnabled Ext_alerts opts ] +++ [ (<> pipeTableSpec) | isEnabled Ext_pipe_tables opts ] +++ -- see #6739+ [ (autolinkSpec <>) | isEnabled Ext_autolink_bare_uris opts ] +++ [ (emojiSpec <>) | isEnabled Ext_emoji opts ] +++ [ (autoIdentifiersSpec <>)+ | isEnabled Ext_gfm_auto_identifiers opts+ , not (isEnabled Ext_ascii_identifiers opts) ] +++ [ (autoIdentifiersAsciiSpec <>)+ | isEnabled Ext_gfm_auto_identifiers opts+ , isEnabled Ext_ascii_identifiers opts ] +++ [ (implicitHeadingReferencesSpec <>)+ | isEnabled Ext_implicit_header_references opts ] +++ [ (footnoteSpec <>) | isEnabled Ext_footnotes opts ] +++ [ (definitionListSpec <>) | isEnabled Ext_definition_lists opts ] +++ [ (taskListSpec <>) | isEnabled Ext_task_lists opts ] +++ [ (wikilinksSpec TitleAfterPipe <>)+ | isEnabled Ext_wikilinks_title_after_pipe opts ] +++ [ (wikilinksSpec TitleBeforePipe <>)+ | isEnabled Ext_wikilinks_title_before_pipe opts ] +++ [ (rebaseRelativePathsSpec <>)+ | isEnabled Ext_rebase_relative_paths opts ]
@@ -0,0 +1,295 @@+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Readers.Creole+ Copyright : Copyright (C) 2017 Sascha Wilde+ License : GNU GPL, version 2 or above++ Maintainer : Sascha Wilde <wilde@sha-bang.de>+ Stability : alpha+ Portability : portable++Conversion of creole text to 'Pandoc' document.+-}+module Text.Pandoc.Readers.Creole ( readCreole+ ) where++import Control.Monad+import Control.Monad.Except (throwError)+import qualified Data.Foldable as F+import Data.Maybe (fromMaybe)+import Data.Text (Text)+import qualified Data.Text as T+import qualified Text.Pandoc.Builder as B+import Text.Pandoc.Class.PandocMonad (PandocMonad (..))+import Text.Pandoc.Definition+import Text.Pandoc.Options+import Text.Pandoc.Parsing hiding (enclosed)++-- | Read creole from an input string and return a Pandoc document.+readCreole :: (PandocMonad m, ToSources a)+ => ReaderOptions+ -> a+ -> m Pandoc+readCreole opts s = do+ let sources = ensureFinalNewlines 2 (toSources s)+ res <- readWithM parseCreole def{ stateOptions = opts } sources+ case res of+ Left e -> throwError e+ Right d -> return d++type CRLParser = ParsecT Sources ParserState++--+-- Utility functions+--++(<+>) :: (Monad m, Semigroup a) => m a -> m a -> m a+(<+>) = liftM2 (<>)++-- we have to redefine `enclosed' from Text.Pandoc.Parsing, because it+-- assumes, that there can't be a space after the start parser, but+-- with creole this is possible.+enclosed :: (Show end, PandocMonad m) => CRLParser m start -- ^ start parser+ -> CRLParser m end -- ^ end parser+ -> CRLParser m a -- ^ content parser (to be used repeatedly)+ -> CRLParser m [a]+enclosed start end parser = try $ start >> many1Till parser end++--+-- main parser+--++specialChars :: [Char]+specialChars = "*/~{}\\|[]()<>\"'"++parseCreole :: PandocMonad m => CRLParser m Pandoc+parseCreole = do+ bs <- mconcat <$> many block+ spaces+ eof+ return $ B.doc bs++--+-- block parsers+--++block :: PandocMonad m => CRLParser m B.Blocks+block = do+ res <- mempty <$ skipMany1 blankline+ <|> nowiki+ <|> header+ <|> horizontalRule+ <|> anyList 1+ <|> table+ <|> para+ skipMany blankline+ return res++nowiki :: PandocMonad m => CRLParser m B.Blocks+nowiki = try $ fmap (B.codeBlock . mconcat) (nowikiStart+ >> manyTill content nowikiEnd)+ where+ content = brackets <|> line+ brackets = try $ option "" (T.singleton <$> newline)+ <+> (char ' ' >> (manyChar (char ' ') <+> textStr "}}}") <* eol)+ line = option "" (T.singleton <$> newline) <+> manyTillChar anyChar eol+ eol = lookAhead $ try $ nowikiEnd <|> newline+ nowikiStart = optional newline >> string "{{{" >> skipMany spaceChar >> newline+ nowikiEnd = try $ linebreak >> string "}}}" >> skipMany spaceChar >> newline++header :: PandocMonad m => CRLParser m B.Blocks+header = try $ do+ skipSpaces+ level <-+ fmap length (many1 (char '='))+ guard $ level <= 6+ skipSpaces+ content <- B.str <$> manyTillChar (noneOf "\n") headerEnd+ return $ B.header level content+ where+ headerEnd = try $ skipSpaces >> many (char '=') >> skipSpaces >> newline++unorderedList :: PandocMonad m => Int -> CRLParser m B.Blocks+unorderedList = list '*' B.bulletList++orderedList :: PandocMonad m => Int -> CRLParser m B.Blocks+orderedList = list '#' B.orderedList++anyList :: PandocMonad m => Int -> CRLParser m B.Blocks+anyList n = unorderedList n <|> orderedList n++anyListItem :: PandocMonad m => Int -> CRLParser m B.Blocks+anyListItem n = listItem '*' n <|> listItem '#' n++list :: PandocMonad m => Char -> ([B.Blocks] -> B.Blocks) -> Int -> CRLParser m B.Blocks+list c f n =+ fmap f (many1 (itemPlusSublist <|> listItem c n))+ where itemPlusSublist = try $ listItem c n <+> anyList (n+1)++listItem :: PandocMonad m => Char -> Int -> CRLParser m B.Blocks+listItem c n =+ fmap (B.plain . B.trimInlines .mconcat) (listStart >> many1Till inline itemEnd)+ where+ listStart = try $ skipSpaces >> optional newline >> skipSpaces+ >> count n (char c)+ >> lookAhead (noneOf [c]) >> skipSpaces+ itemEnd = endOfParaElement <|> nextItem n+ <|> if n < 3 then nextItem (n+1)+ else nextItem (n+1) <|> nextItem (n-1)+ nextItem x = lookAhead $ try $ blankline >> anyListItem x >> return mempty++table :: PandocMonad m => CRLParser m B.Blocks+table = try $ do+ headers <- optionMaybe headerRow+ rows <- many1 row+ return $ B.simpleTable (fromMaybe [mempty] headers) rows+ where+ headerRow = try $ skipSpaces >> many1Till headerCell rowEnd+ headerCell = B.plain . B.trimInlines . mconcat+ <$> (string "|=" >> many1Till inline cellEnd)+ row = try $ skipSpaces >> many1Till cell rowEnd+ cell = B.plain . B.trimInlines . mconcat+ <$> (char '|' >> manyTill inline cellEnd)+ rowEnd = try $ optional (char '|') >> skipSpaces >> newline+ cellEnd = lookAhead $ try $ char '|' <|> rowEnd++para :: PandocMonad m => CRLParser m B.Blocks+para = fmap (result . mconcat) (many1Till inline endOfParaElement)+ where+ result content = if F.all (==Space) content+ then mempty+ else B.para $ B.trimInlines content++endOfParaElement :: PandocMonad m => CRLParser m ()+endOfParaElement = lookAhead $ endOfInput <|> endOfPara+ <|> startOfList <|> startOfTable+ <|> startOfHeader <|> hr <|> startOfNowiki+ where+ endOfInput = try $ skipMany blankline >> skipSpaces >> eof+ endOfPara = try $ blankline >> skipMany1 blankline+ startOf :: PandocMonad m => CRLParser m a -> CRLParser m ()+ startOf p = try $ blankline >> p >> return mempty+ startOfList = startOf $ anyListItem 1+ startOfTable = startOf table+ startOfHeader = startOf header+ startOfNowiki = startOf nowiki+ hr = startOf horizontalRule++horizontalRule :: PandocMonad m => CRLParser m B.Blocks+horizontalRule = try $ skipSpaces >> string "----" >> skipSpaces >> newline+ >> return B.horizontalRule++--+-- inline parsers+--++inline :: PandocMonad m => CRLParser m B.Inlines+inline = choice [ whitespace+ , escapedLink+ , escapedChar+ , link+ , inlineNowiki+ , placeholder+ , image+ , forcedLinebreak+ , bold+ , finalBold+ , italics+ , finalItalics+ , str+ , symbol+ ] <?> "inline"++escapedChar :: PandocMonad m => CRLParser m B.Inlines+escapedChar =+ fmap (B.str . T.singleton) (try $ char '~' >> noneOf "\t\n ")++escapedLink :: PandocMonad m => CRLParser m B.Inlines+escapedLink = try $ do+ char '~'+ (orig, _) <- uri+ return $ B.str orig++image :: PandocMonad m => CRLParser m B.Inlines+image = try $ do+ (orig, src) <- wikiImg+ return $ B.image src "" (B.str orig)+ where+ linkSrc = manyChar $ noneOf "|}\n\r\t"+ linkDsc = char '|' >> manyChar (noneOf "}\n\r\t")+ wikiImg = try $ do+ string "{{"+ src <- linkSrc+ dsc <- option "" linkDsc+ string "}}"+ return (dsc, src)++link :: PandocMonad m => CRLParser m B.Inlines+link = try $ do+ (orig, src) <- uriLink <|> wikiLink+ return $ B.link src "" orig+ where+ linkSrc = manyChar $ noneOf "|]\n\r\t"+ linkDsc :: PandocMonad m => Text -> CRLParser m B.Inlines+ linkDsc otxt = B.str+ <$> try (option otxt+ (char '|' >> manyChar (noneOf "]\n\r\t")))+ linkImg = try $ char '|' >> image+ wikiLink = try $ do+ string "[["+ src <- linkSrc+ dsc <- linkImg <|> linkDsc src+ string "]]"+ return (dsc, src)+ uriLink = try $ do+ (orig, src) <- uri+ return (B.str orig, src)++inlineNowiki :: PandocMonad m => CRLParser m B.Inlines+inlineNowiki = B.code <$> (start >> manyTillChar (noneOf "\n\r") end)+ where+ start = try $ string "{{{"+ end = try $ string "}}}" >> lookAhead (noneOf "}")++placeholder :: PandocMonad m => CRLParser m B.Inlines+-- The semantics of the placeholder is basically implementation+-- dependent, so there is no way to DTRT for all cases.+-- So for now we just drop them.+placeholder = B.text <$> try (string "<<<" >> manyTill anyChar (string ">>>")+ >> return "")++whitespace :: PandocMonad m => CRLParser m B.Inlines+whitespace = lb <|> regsp+ where lb = try $ skipMany spaceChar >> linebreak >> return B.space+ regsp = try $ skipMany1 spaceChar >> return B.space++linebreak :: PandocMonad m => CRLParser m B.Inlines+linebreak = newline >> notFollowedBy newline >> (lastNewline <|> innerNewline)+ where lastNewline = eof >> return mempty+ innerNewline = return B.space++symbol :: PandocMonad m => CRLParser m B.Inlines+symbol = fmap (B.str . T.singleton) (oneOf specialChars)++str :: PandocMonad m => CRLParser m B.Inlines+str = let strChar = noneOf ("\t\n " ++ specialChars) in+ fmap B.str (many1Char strChar)++bold :: PandocMonad m => CRLParser m B.Inlines+bold = B.strong . mconcat <$>+ enclosed (string "**") (try $ string "**") inline++italics :: PandocMonad m => CRLParser m B.Inlines+italics = B.emph . mconcat <$>+ enclosed (string "//") (try $ string "//") inline++finalBold :: PandocMonad m => CRLParser m B.Inlines+finalBold = B.strong . mconcat <$>+ try (string "**" >> many1Till inline endOfParaElement)++finalItalics :: PandocMonad m => CRLParser m B.Inlines+finalItalics = B.emph . mconcat <$>+ try (string "//" >> many1Till inline endOfParaElement)++forcedLinebreak :: PandocMonad m => CRLParser m B.Inlines+forcedLinebreak = try $ string "\\\\" >> return B.linebreak
@@ -0,0 +1,54 @@+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Readers.CslJson+ Copyright : Copyright (C) 2020-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++Parses CSL JSON bibliographies into a Pandoc document+with empty body and `references` and `nocite` fields+in the metadata. A wildcard `nocite` is used so that+if the document is rendered in another format, the+entire bibliography will be printed.++<https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html>.+-}+module Text.Pandoc.Readers.CslJson+ ( readCslJson )+where++import Text.Pandoc.Options+import Text.Pandoc.Definition+import Text.Pandoc.Builder (setMeta, cite, str)+import qualified Text.Pandoc.UTF8 as UTF8+import qualified Data.Text as T+import Text.Pandoc.Error (PandocError(..))+import Text.Pandoc.Class (PandocMonad)+import Text.Pandoc.Citeproc.CslJson (cslJsonToReferences)+import Text.Pandoc.Citeproc.MetaValue (referenceToMetaValue)+import Control.Monad.Except (throwError)+import Text.Pandoc.Sources (ToSources(..), sourcesToText)++-- | Read CSL JSON from an input string and return a Pandoc document.+-- The document will have only metadata, with an empty body.+-- The metadata will contain a `references` field with the+-- bibliography entries, and a `nocite` field with the wildcard `[@*]`.+readCslJson :: (PandocMonad m, ToSources a)+ => ReaderOptions -> a -> m Pandoc+readCslJson _opts x =+ case cslJsonToReferences (UTF8.fromText $ sourcesToText $ toSources x) of+ Left e -> throwError $ PandocParseError $ T.pack e+ Right refs -> return $ setMeta "references"+ (map referenceToMetaValue refs)+ . setMeta "nocite"+ (cite [Citation {citationId = "*"+ , citationPrefix = []+ , citationSuffix = []+ , citationMode = NormalCitation+ , citationNoteNum = 0+ , citationHash = 0}]+ (str "[@*]"))+ $ Pandoc nullMeta []
@@ -0,0 +1,273 @@+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE ScopedTypeVariables #-}++{- |+ Module : Text.Pandoc.Readers.Djot+ Copyright : Copyright (C) 2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++Reads and evaluates a Djot document as a Pandoc AST.+-}+module Text.Pandoc.Readers.Djot+ ( readDjot+ )+where++import Text.Pandoc.Class+import Text.Pandoc.Sources+import Text.Parsec.Pos (newPos)+import Text.Pandoc.Options+import Text.Pandoc.Definition+import Text.Pandoc.Shared (addPandocAttributes, tshow)+import qualified Text.Pandoc.UTF8 as UTF8+import Djot (ParseOptions(..), SourcePosOption(..), parseDoc, Pos(..))+import qualified Djot.AST as D+import Text.Pandoc.Error (PandocError(..))+import Control.Monad.Except (throwError)+import qualified Data.Text as T+import Text.Pandoc.Builder+import Text.Pandoc.Logging+import Text.Pandoc.Emoji (emojiToInline)+import Control.Monad.Reader+import qualified Data.Foldable as F+import Data.ByteString (ByteString)+-- import Debug.Trace++-- | Read Djot from an input string and return a Pandoc document.+readDjot :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc+readDjot opts inp = do+ let sources = toSources inp+ case parseDoc ParseOptions{ sourcePositions =+ if isEnabled Ext_sourcepos opts+ then AllSourcePos+ else NoSourcePos }+ (UTF8.fromText $ sourcesToText sources) of+ Left e -> throwError $ PandocParseError $ T.pack $ show e+ Right d ->+ runReaderT (doc <$> convertBlocks (D.docBlocks d))+ Env{ references = D.docReferences d <> D.docAutoReferences d+ , footnotes = D.docFootnotes d+ }++data Env =+ Env{ references :: D.ReferenceMap+ , footnotes :: D.NoteMap+ }+ deriving (Show, Ord, Eq)++convertBlocks :: PandocMonad m => D.Blocks -> ReaderT Env m Blocks+convertBlocks = fmap mconcat . mapM convertBlock . F.toList . D.unMany++convertBlock :: PandocMonad m => D.Node D.Block -> ReaderT Env m Blocks+convertBlock (D.Node pos attr bl) = addAttrToBlock pos attr <$>+ case bl of+ D.Para ils -> para <$> convertInlines ils+ D.Section bls -> divWith ("",["section"],[]) <$> convertBlocks bls+ D.Heading lev ils -> header lev <$> convertInlines ils+ D.BlockQuote bls -> blockQuote <$> convertBlocks bls+ D.CodeBlock lang bs -> pure $+ codeBlockWith ("", [UTF8.toText lang], []) $ UTF8.toText bs+ D.Div bls -> divWith nullAttr <$> convertBlocks bls+ D.OrderedList olattr listSpacing items ->+ orderedListWith olattr' .+ (case listSpacing of+ D.Tight -> map toTight+ D.Loose -> id) <$> mapM convertBlocks items+ where+ olattr' = ( D.orderedListStart olattr+ , case D.orderedListStyle olattr of+ D.Decimal -> Decimal+ D.LetterUpper -> UpperAlpha+ D.LetterLower -> LowerAlpha+ D.RomanUpper -> UpperRoman+ D.RomanLower -> LowerRoman+ , case D.orderedListDelim olattr of+ D.RightPeriod -> Period+ D.RightParen -> OneParen+ D.LeftRightParen -> TwoParens+ )+ D.BulletList listSpacing items ->+ bulletList .+ (case listSpacing of+ D.Tight -> map toTight+ D.Loose -> id) <$> mapM convertBlocks items+ D.TaskList listSpacing items ->+ bulletList .+ (case listSpacing of+ D.Tight -> map toTight+ D.Loose -> id) <$> mapM toTaskListItem items+ D.DefinitionList listSpacing items ->+ definitionList .+ (case listSpacing of+ D.Tight -> map (\(t,d) -> (t, map toTight d))+ D.Loose -> id) <$> mapM toDlItem items+ where+ toDlItem (ils,bls) = (,) <$> convertInlines ils+ <*> ((:[]) <$> convertBlocks bls)+ D.ThematicBreak -> pure horizontalRule+ D.Table mbCaption rows -> do+ capt <- case mbCaption of+ Just (D.Caption bls') ->+ Caption Nothing . toList <$> convertBlocks bls'+ Nothing -> pure $ Caption Nothing mempty+ let toAlign D.AlignLeft = AlignLeft+ toAlign D.AlignRight = AlignRight+ toAlign D.AlignCenter = AlignCenter+ toAlign D.AlignDefault = AlignDefault+ let toColSpec (D.Cell _ align _) = (toAlign align, ColWidthDefault)+ let colspecs = case rows of+ [] -> []+ (cells:_) -> map toColSpec cells+ let (headrow, rest) =+ case rows of+ (r@(D.Cell D.HeadCell _ _ : _) : rs) -> (r, rs)+ _ -> ([],rows)+ let getBody bods row =+ case row of+ (D.Cell D.HeadCell _ _ : _) ->+ case bods of+ [] -> [([row],[])]+ ([],_):_ -> (([row],[]):bods)+ (hs,bs):rs -> (hs,row:bs):rs+ _ -> case bods of+ (hs,bs):rs -> (hs,row:bs):rs+ [] -> [([],[row])]+ let reverseSnd (as,bs) = (as,reverse bs)+ let bodies = reverse $ map reverseSnd $ F.foldl' getBody [] rest+ let toCell (D.Cell _ al ils) =+ Cell nullAttr (toAlign al) (RowSpan 1) (ColSpan 1)+ . (\is -> [Para $ toList is]) <$> convertInlines ils+ let toRow = fmap (Row nullAttr) . mapM toCell+ thead <- TableHead mempty <$> mapM toRow [headrow]+ let toTableBody (hs, rs) =+ TableBody mempty (RowHeadColumns 0) <$>+ mapM toRow hs <*> mapM toRow rs+ tbodies <- mapM toTableBody bodies+ let tfoot = TableFoot mempty []+ pure $ singleton $ Table mempty capt colspecs thead tbodies tfoot+ D.RawBlock (D.Format fmt) bs -> pure $+ rawBlock (UTF8.toText fmt) (UTF8.toText bs)++addAttrToBlock :: Pos -> D.Attr -> Blocks -> Blocks+addAttrToBlock pos (D.Attr as) =+ addPandocAttributes $+ case pos of+ NoPos -> textkvs+ Pos sl sc el ec ->+ ("data-pos", tshow sl <> ":" <> tshow sc <>+ "-" <> tshow el <> ":" <> tshow ec) : textkvs+ where+ textkvs = (map (\(k,v) -> (UTF8.toText k, UTF8.toText v))+ (filter (not . internalAttribute) as))++addAttrToInline :: Pos -> D.Attr -> Inlines -> Inlines+addAttrToInline pos (D.Attr as) =+ addPandocAttributes $+ case pos of+ NoPos -> textkvs+ Pos sl sc el ec ->+ ("data-pos", tshow sl <> ":" <> tshow sc <>+ "-" <> tshow el <> ":" <> tshow ec) : textkvs+ where+ textkvs = (map (\(k,v) -> (UTF8.toText k, UTF8.toText v))+ (filter (not . internalAttribute) as))++convertInlines :: PandocMonad m => D.Inlines -> ReaderT Env m Inlines+convertInlines = fmap mconcat . mapM convertInline . F.toList . D.unMany++convertInline :: PandocMonad m => D.Node D.Inline -> ReaderT Env m Inlines+convertInline (D.Node pos attr il) = addAttrToInline pos attr <$>+ case il of+ D.Str bs -> pure $ text (UTF8.toText bs)+ D.Emph ils -> emph <$> convertInlines ils+ D.Strong ils -> strong <$> convertInlines ils+ D.Highlight ils -> spanWith ("",["mark"],[]) <$> convertInlines ils+ D.Insert ils -> spanWith ("",["inserted"],[]) <$> convertInlines ils+ D.Delete ils -> spanWith ("",["deleted"],[]) <$> convertInlines ils+ D.Subscript ils -> subscript <$> convertInlines ils+ D.Superscript ils -> superscript <$> convertInlines ils+ D.Span ils -> spanWith nullAttr <$> convertInlines ils+ D.Quoted D.DoubleQuotes ils -> doubleQuoted <$> convertInlines ils+ D.Quoted D.SingleQuotes ils -> singleQuoted <$> convertInlines ils+ D.Verbatim bs -> pure $ code (UTF8.toText bs)+ D.Symbol bs -> pure $+ let s = UTF8.toText bs+ in maybe (spanWith ("",["symbol"],[]) (str s)) singleton $ emojiToInline s+ D.Math sty bs -> pure $+ (case sty of+ D.DisplayMath -> displayMath+ D.InlineMath -> math) (UTF8.toText bs)+ D.Link ils target ->+ case target of+ D.Direct url -> link (UTF8.toText url) "" <$> convertInlines ils+ D.Reference label -> do+ refs <- asks references+ case D.lookupReference label refs of+ Just (url, lattr) ->+ addAttrToInline pos lattr .+ link (UTF8.toText url) "" <$> convertInlines ils+ Nothing -> do+ report $ ReferenceNotFound (UTF8.toText label) (newPos "" 0 0)+ link "" "" <$> convertInlines ils+ D.Image ils target ->+ case target of+ D.Direct url -> image (UTF8.toText url) "" <$> convertInlines ils+ D.Reference label -> do+ refs <- asks references+ case D.lookupReference label refs of+ Just (url, lattr) ->+ addAttrToInline pos lattr .+ image (UTF8.toText url) "" <$> convertInlines ils+ Nothing -> do+ report $ ReferenceNotFound (UTF8.toText label) (newPos "" 0 0)+ image "" "" <$> convertInlines ils+ D.FootnoteReference bs -> do+ notes <- asks footnotes+ case D.lookupNote bs notes of+ Just bls -> note <$> convertBlocks bls+ Nothing -> do+ -- TODO consider new warning for this?+ report $ IgnoredElement ("Undefined footnote reference " <> tshow bs)+ pure mempty+ D.UrlLink bs -> do+ let url = UTF8.toText bs+ pure $ linkWith ("",["uri"],[]) url "" (str url)+ D.EmailLink bs -> do+ let email = UTF8.toText bs+ pure $ linkWith ("",["email"],[]) ("mailto:" <> email) "" (str email)+ D.RawInline (D.Format fbs) bs -> pure $+ rawInline (UTF8.toText fbs) (UTF8.toText bs)+ D.NonBreakingSpace -> pure $ str "\160"+ D.SoftBreak -> pure softbreak+ D.HardBreak -> pure linebreak++internalAttribute :: (ByteString, ByteString) -> Bool+internalAttribute ("_implicit",_) = True+internalAttribute ("_autogen",_) = True+internalAttribute _ = False++toTight :: Blocks -> Blocks+toTight (Many bls) = Many $ paraToPlain <$> bls+ where+ paraToPlain (Para ils) = Plain ils+ paraToPlain x = x++toTaskListItem :: PandocMonad m+ => (D.TaskStatus, D.Blocks) -> ReaderT Env m Blocks+toTaskListItem (status, bls) = do+ bls' <- convertBlocks bls+ case toList bls' of+ (Para ils : rest) -> pure $+ fromList $ Para (Str taskmarker : Space : ils) : rest+ _ -> pure $ para (str taskmarker) <> bls'+ where+ taskmarker+ | status == D.Complete = "[X]"+ | otherwise = "[ ]"
@@ -1,976 +1,1502 @@-module Text.Pandoc.Readers.DocBook ( readDocBook ) where-import Data.Char (toUpper)-import Text.Pandoc.Shared (safeRead)-import Text.Pandoc.Options-import Text.Pandoc.Definition-import Text.Pandoc.Builder-import Text.XML.Light-import Text.Pandoc.Compat.TagSoupEntity (lookupEntity)-import Data.Either (rights)-import Data.Generics-import Data.Monoid-import Data.Char (isSpace)-import Control.Monad.State-import Control.Applicative ((<$>))-import Data.List (intersperse)-import Data.Maybe (fromMaybe)-import Text.TeXMath (readMathML, writeTeX)--{---List of all DocBook tags, with [x] indicating implemented,-[o] meaning intentionally left unimplemented (pass through):--[o] abbrev - An abbreviation, especially one followed by a period-[x] abstract - A summary-[o] accel - A graphical user interface (GUI) keyboard shortcut-[x] ackno - Acknowledgements in an Article-[o] acronym - An often pronounceable word made from the initial-[o] action - A response to a user event-[o] address - A real-world address, generally a postal address-[ ] affiliation - The institutional affiliation of an individual-[ ] alt - Text representation for a graphical element-[o] anchor - A spot in the document-[x] answer - An answer to a question posed in a QandASet-[x] appendix - An appendix in a Book or Article-[x] appendixinfo - Meta-information for an Appendix-[o] application - The name of a software program-[x] area - A region defined for a Callout in a graphic or code example-[x] areaset - A set of related areas in a graphic or code example-[x] areaspec - A collection of regions in a graphic or code example-[ ] arg - An argument in a CmdSynopsis-[x] article - An article-[x] articleinfo - Meta-information for an Article-[ ] artpagenums - The page numbers of an article as published-[x] attribution - The source of a block quote or epigraph-[ ] audiodata - Pointer to external audio data-[ ] audioobject - A wrapper for audio data and its associated meta-information-[x] author - The name of an individual author-[ ] authorblurb - A short description or note about an author-[x] authorgroup - Wrapper for author information when a document has- multiple authors or collabarators-[x] authorinitials - The initials or other short identifier for an author-[o] beginpage - The location of a page break in a print version of the document-[ ] bibliocoverage - The spatial or temporal coverage of a document-[x] bibliodiv - A section of a Bibliography-[x] biblioentry - An entry in a Bibliography-[x] bibliography - A bibliography-[ ] bibliographyinfo - Meta-information for a Bibliography-[ ] biblioid - An identifier for a document-[o] bibliolist - A wrapper for a set of bibliography entries-[ ] bibliomisc - Untyped bibliographic information-[x] bibliomixed - An entry in a Bibliography-[ ] bibliomset - A cooked container for related bibliographic information-[ ] biblioref - A cross reference to a bibliographic entry-[ ] bibliorelation - The relationship of a document to another-[ ] biblioset - A raw container for related bibliographic information-[ ] bibliosource - The source of a document-[ ] blockinfo - Meta-information for a block element-[x] blockquote - A quotation set off from the main text-[x] book - A book-[x] bookinfo - Meta-information for a Book-[x] bridgehead - A free-floating heading-[ ] callout - A “called out” description of a marked Area-[ ] calloutlist - A list of Callouts-[x] caption - A caption-[x] caution - A note of caution-[x] chapter - A chapter, as of a book-[x] chapterinfo - Meta-information for a Chapter-[ ] citation - An inline bibliographic reference to another published work-[ ] citebiblioid - A citation of a bibliographic identifier-[ ] citerefentry - A citation to a reference page-[ ] citetitle - The title of a cited work-[ ] city - The name of a city in an address-[ ] classname - The name of a class, in the object-oriented programming sense-[ ] classsynopsis - The syntax summary for a class definition-[ ] classsynopsisinfo - Information supplementing the contents of- a ClassSynopsis-[ ] cmdsynopsis - A syntax summary for a software command-[ ] co - The location of a callout embedded in text-[x] code - An inline code fragment-[x] col - Specifications for a column in an HTML table-[x] colgroup - A group of columns in an HTML table-[ ] collab - Identifies a collaborator-[ ] collabname - The name of a collaborator-[ ] colophon - Text at the back of a book describing facts about its production-[x] colspec - Specifications for a column in a table-[x] command - The name of an executable program or other software command-[x] computeroutput - Data, generally text, displayed or presented by a computer-[ ] confdates - The dates of a conference for which a document was written-[ ] confgroup - A wrapper for document meta-information about a conference-[ ] confnum - An identifier, frequently numerical, associated with a conference for which a document was written-[ ] confsponsor - The sponsor of a conference for which a document was written-[ ] conftitle - The title of a conference for which a document was written-[x] constant - A programming or system constant-[ ] constraint - A constraint in an EBNF production-[ ] constraintdef - The definition of a constraint in an EBNF production-[ ] constructorsynopsis - A syntax summary for a constructor-[ ] contractnum - The contract number of a document-[ ] contractsponsor - The sponsor of a contract-[ ] contrib - A summary of the contributions made to a document by a- credited source-[ ] copyright - Copyright information about a document-[ ] coref - A cross reference to a co-[ ] corpauthor - A corporate author, as opposed to an individual-[ ] corpcredit - A corporation or organization credited in a document-[ ] corpname - The name of a corporation-[ ] country - The name of a country-[ ] database - The name of a database, or part of a database-[x] date - The date of publication or revision of a document-[ ] dedication - A wrapper for the dedication section of a book-[ ] destructorsynopsis - A syntax summary for a destructor-[ ] edition - The name or number of an edition of a document-[ ] editor - The name of the editor of a document-[x] email - An email address-[x] emphasis - Emphasized text-[x] entry - A cell in a table-[ ] entrytbl - A subtable appearing in place of an Entry in a table-[ ] envar - A software environment variable-[x] epigraph - A short inscription at the beginning of a document or component- note: also handle embedded attribution tag-[x] equation - A displayed mathematical equation-[ ] errorcode - An error code-[ ] errorname - An error name-[ ] errortext - An error message.-[ ] errortype - The classification of an error message-[ ] example - A formal example, with a title-[ ] exceptionname - The name of an exception-[ ] fax - A fax number-[ ] fieldsynopsis - The name of a field in a class definition-[x] figure - A formal figure, generally an illustration, with a title-[x] filename - The name of a file-[ ] firstname - The first name of a person-[ ] firstterm - The first occurrence of a term-[x] footnote - A footnote-[ ] footnoteref - A cross reference to a footnote (a footnote mark)-[x] foreignphrase - A word or phrase in a language other than the primary- language of the document-[x] formalpara - A paragraph with a title-[ ] funcdef - A function (subroutine) name and its return type-[ ] funcparams - Parameters for a function referenced through a function- pointer in a synopsis-[ ] funcprototype - The prototype of a function-[ ] funcsynopsis - The syntax summary for a function definition-[ ] funcsynopsisinfo - Information supplementing the FuncDefs of a FuncSynopsis-[x] function - The name of a function or subroutine, as in a- programming language-[x] glossary - A glossary-[x] glossaryinfo - Meta-information for a Glossary-[x] glossdef - A definition in a GlossEntry-[x] glossdiv - A division in a Glossary-[x] glossentry - An entry in a Glossary or GlossList-[x] glosslist - A wrapper for a set of GlossEntrys-[x] glosssee - A cross-reference from one GlossEntry to another-[x] glossseealso - A cross-reference from one GlossEntry to another-[x] glossterm - A glossary term-[ ] graphic - A displayed graphical object (not an inline)-[ ] graphicco - A graphic that contains callout areas-[ ] group - A group of elements in a CmdSynopsis-[ ] guibutton - The text on a button in a GUI-[ ] guiicon - Graphic and/or text appearing as a icon in a GUI-[ ] guilabel - The text of a label in a GUI-[ ] guimenu - The name of a menu in a GUI-[ ] guimenuitem - The name of a terminal menu item in a GUI-[ ] guisubmenu - The name of a submenu in a GUI-[ ] hardware - A physical part of a computer system-[ ] highlights - A summary of the main points of the discussed component-[ ] holder - The name of the individual or organization that holds a copyright-[o] honorific - The title of a person-[ ] html:form - An HTML form-[ ] imagedata - Pointer to external image data-[ ] imageobject - A wrapper for image data and its associated meta-information-[ ] imageobjectco - A wrapper for an image object with callouts-[x] important - An admonition set off from the text-[x] index - An index-[x] indexdiv - A division in an index-[x] indexentry - An entry in an index-[x] indexinfo - Meta-information for an Index-[x] indexterm - A wrapper for terms to be indexed-[x] info - A wrapper for information about a component or other block. (DocBook v5)-[x] informalequation - A displayed mathematical equation without a title-[ ] informalexample - A displayed example without a title-[ ] informalfigure - A untitled figure-[ ] informaltable - A table without a title-[ ] initializer - The initializer for a FieldSynopsis-[x] inlineequation - A mathematical equation or expression occurring inline-[ ] inlinegraphic - An object containing or pointing to graphical data- that will be rendered inline-[x] inlinemediaobject - An inline media object (video, audio, image, and so on)-[ ] interface - An element of a GUI-[ ] interfacename - The name of an interface-[ ] invpartnumber - An inventory part number-[ ] isbn - The International Standard Book Number of a document-[ ] issn - The International Standard Serial Number of a periodical-[ ] issuenum - The number of an issue of a journal-[x] itemizedlist - A list in which each entry is marked with a bullet or- other dingbat-[ ] itermset - A set of index terms in the meta-information of a document-[ ] jobtitle - The title of an individual in an organization-[ ] keycap - The text printed on a key on a keyboard-[ ] keycode - The internal, frequently numeric, identifier for a key- on a keyboard-[ ] keycombo - A combination of input actions-[ ] keysym - The symbolic name of a key on a keyboard-[ ] keyword - One of a set of keywords describing the content of a document-[ ] keywordset - A set of keywords describing the content of a document-[ ] label - A label on a Question or Answer-[ ] legalnotice - A statement of legal obligations or requirements-[ ] lhs - The left-hand side of an EBNF production-[ ] lineage - The portion of a person's name indicating a relationship to- ancestors-[ ] lineannotation - A comment on a line in a verbatim listing-[x] link - A hypertext link-[x] listitem - A wrapper for the elements of a list item-[x] literal - Inline text that is some literal value-[x] literallayout - A block of text in which line breaks and white space are- to be reproduced faithfully-[ ] lot - A list of the titles of formal objects (as tables or figures) in- a document-[ ] lotentry - An entry in a list of titles-[ ] manvolnum - A reference volume number-[x] markup - A string of formatting markup in text that is to be- represented literally-[ ] mathphrase - A mathematical phrase, an expression that can be represented- with ordinary text and a small amount of markup-[ ] medialabel - A name that identifies the physical medium on which some- information resides-[x] mediaobject - A displayed media object (video, audio, image, etc.)-[ ] mediaobjectco - A media object that contains callouts-[x] member - An element of a simple list-[ ] menuchoice - A selection or series of selections from a menu-[ ] methodname - The name of a method-[ ] methodparam - Parameters to a method-[ ] methodsynopsis - A syntax summary for a method-[x] mml:math - A MathML equation-[ ] modespec - Application-specific information necessary for the- completion of an OLink-[ ] modifier - Modifiers in a synopsis-[ ] mousebutton - The conventional name of a mouse button-[ ] msg - A message in a message set-[ ] msgaud - The audience to which a message in a message set is relevant-[ ] msgentry - A wrapper for an entry in a message set-[ ] msgexplan - Explanatory material relating to a message in a message set-[ ] msginfo - Information about a message in a message set-[ ] msglevel - The level of importance or severity of a message in a message set-[ ] msgmain - The primary component of a message in a message set-[ ] msgorig - The origin of a message in a message set-[ ] msgrel - A related component of a message in a message set-[ ] msgset - A detailed set of messages, usually error messages-[ ] msgsub - A subcomponent of a message in a message set-[ ] msgtext - The actual text of a message component in a message set-[ ] nonterminal - A non-terminal in an EBNF production-[x] note - A message set off from the text-[ ] objectinfo - Meta-information for an object-[ ] olink - A link that addresses its target indirectly, through an entity-[ ] ooclass - A class in an object-oriented programming language-[ ] ooexception - An exception in an object-oriented programming language-[ ] oointerface - An interface in an object-oriented programming language-[x] option - An option for a software command-[x] optional - Optional information-[x] orderedlist - A list in which each entry is marked with a sequentially- incremented label-[ ] orgdiv - A division of an organization-[ ] orgname - The name of an organization other than a corporation-[ ] otheraddr - Uncategorized information in address-[ ] othercredit - A person or entity, other than an author or editor,- credited in a document-[ ] othername - A component of a persons name that is not a first name,- surname, or lineage-[ ] package - A package-[ ] pagenums - The numbers of the pages in a book, for use in a bibliographic- entry-[x] para - A paragraph-[ ] paramdef - Information about a function parameter in a programming language-[x] parameter - A value or a symbolic reference to a value-[ ] part - A division in a book-[ ] partinfo - Meta-information for a Part-[ ] partintro - An introduction to the contents of a part-[ ] personblurb - A short description or note about a person-[ ] personname - The personal name of an individual-[ ] phone - A telephone number-[ ] phrase - A span of text-[ ] pob - A post office box in an address-[ ] postcode - A postal code in an address-[x] preface - Introductory matter preceding the first chapter of a book-[ ] prefaceinfo - Meta-information for a Preface-[ ] primary - The primary word or phrase under which an index term should be- sorted-[ ] primaryie - A primary term in an index entry, not in the text-[ ] printhistory - The printing history of a document-[ ] procedure - A list of operations to be performed in a well-defined sequence-[ ] production - A production in a set of EBNF productions-[ ] productionrecap - A cross-reference to an EBNF production-[ ] productionset - A set of EBNF productions-[ ] productname - The formal name of a product-[ ] productnumber - A number assigned to a product-[x] programlisting - A literal listing of all or part of a program-[ ] programlistingco - A program listing with associated areas used in callouts-[x] prompt - A character or string indicating the start of an input field in- a computer display-[ ] property - A unit of data associated with some part of a computer system-[ ] pubdate - The date of publication of a document-[ ] publisher - The publisher of a document-[ ] publishername - The name of the publisher of a document-[ ] pubsnumber - A number assigned to a publication other than an ISBN or ISSN- or inventory part number-[x] qandadiv - A titled division in a QandASet-[o] qandaentry - A question/answer set within a QandASet-[o] qandaset - A question-and-answer set-[x] question - A question in a QandASet-[x] quote - An inline quotation-[ ] refclass - The scope or other indication of applicability of a- reference entry-[ ] refdescriptor - A description of the topic of a reference page-[ ] refentry - A reference page (originally a UNIX man-style reference page)-[ ] refentryinfo - Meta-information for a Refentry-[ ] refentrytitle - The title of a reference page-[ ] reference - A collection of reference entries-[ ] referenceinfo - Meta-information for a Reference-[ ] refmeta - Meta-information for a reference entry-[ ] refmiscinfo - Meta-information for a reference entry other than the title- and volume number-[ ] refname - The name of (one of) the subject(s) of a reference page-[ ] refnamediv - The name, purpose, and classification of a reference page-[ ] refpurpose - A short (one sentence) synopsis of the topic of a reference- page-[x] refsect1 - A major subsection of a reference entry-[x] refsect1info - Meta-information for a RefSect1-[x] refsect2 - A subsection of a RefSect1-[x] refsect2info - Meta-information for a RefSect2-[x] refsect3 - A subsection of a RefSect2-[x] refsect3info - Meta-information for a RefSect3-[x] refsection - A recursive section in a refentry-[x] refsectioninfo - Meta-information for a refsection-[ ] refsynopsisdiv - A syntactic synopsis of the subject of the reference page-[ ] refsynopsisdivinfo - Meta-information for a RefSynopsisDiv-[x] releaseinfo - Information about a particular release of a document-[ ] remark - A remark (or comment) intended for presentation in a draft- manuscript-[ ] replaceable - Content that may or must be replaced by the user-[ ] returnvalue - The value returned by a function-[ ] revdescription - A extended description of a revision to a document-[ ] revhistory - A history of the revisions to a document-[ ] revision - An entry describing a single revision in the history of the- revisions to a document-[ ] revnumber - A document revision number-[ ] revremark - A description of a revision to a document-[ ] rhs - The right-hand side of an EBNF production-[x] row - A row in a table-[ ] sbr - An explicit line break in a command synopsis-[x] screen - Text that a user sees or might see on a computer screen-[o] screenco - A screen with associated areas used in callouts-[o] screeninfo - Information about how a screen shot was produced-[ ] screenshot - A representation of what the user sees or might see on a- computer screen-[ ] secondary - A secondary word or phrase in an index term-[ ] secondaryie - A secondary term in an index entry, rather than in the text-[x] sect1 - A top-level section of document-[x] sect1info - Meta-information for a Sect1-[x] sect2 - A subsection within a Sect1-[x] sect2info - Meta-information for a Sect2-[x] sect3 - A subsection within a Sect2-[x] sect3info - Meta-information for a Sect3-[x] sect4 - A subsection within a Sect3-[x] sect4info - Meta-information for a Sect4-[x] sect5 - A subsection within a Sect4-[x] sect5info - Meta-information for a Sect5-[x] section - A recursive section-[x] sectioninfo - Meta-information for a recursive section-[x] see - Part of an index term directing the reader instead to another entry- in the index-[x] seealso - Part of an index term directing the reader also to another entry- in the index-[ ] seealsoie - A See also entry in an index, rather than in the text-[ ] seeie - A See entry in an index, rather than in the text-[x] seg - An element of a list item in a segmented list-[x] seglistitem - A list item in a segmented list-[x] segmentedlist - A segmented list, a list of sets of elements-[x] segtitle - The title of an element of a list item in a segmented list-[ ] seriesvolnums - Numbers of the volumes in a series of books-[ ] set - A collection of books-[ ] setindex - An index to a set of books-[ ] setindexinfo - Meta-information for a SetIndex-[ ] setinfo - Meta-information for a Set-[ ] sgmltag - A component of SGML markup-[ ] shortaffil - A brief description of an affiliation-[ ] shortcut - A key combination for an action that is also accessible through- a menu-[ ] sidebar - A portion of a document that is isolated from the main- narrative flow-[ ] sidebarinfo - Meta-information for a Sidebar-[x] simpara - A paragraph that contains only text and inline markup, no block- elements-[x] simplelist - An undecorated list of single words or short phrases-[ ] simplemsgentry - A wrapper for a simpler entry in a message set-[ ] simplesect - A section of a document with no subdivisions-[ ] spanspec - Formatting information for a spanned column in a table-[ ] state - A state or province in an address-[ ] step - A unit of action in a procedure-[ ] stepalternatives - Alternative steps in a procedure-[ ] street - A street address in an address-[ ] structfield - A field in a structure (in the programming language sense)-[ ] structname - The name of a structure (in the programming language sense)-[ ] subject - One of a group of terms describing the subject matter of a- document-[ ] subjectset - A set of terms describing the subject matter of a document-[ ] subjectterm - A term in a group of terms describing the subject matter of- a document-[x] subscript - A subscript (as in H2O, the molecular formula for water)-[ ] substeps - A wrapper for steps that occur within steps in a procedure-[x] subtitle - The subtitle of a document-[x] superscript - A superscript (as in x2, the mathematical notation for x- multiplied by itself)-[ ] surname - A family name; in western cultures the last name-[ ] svg:svg - An SVG graphic-[x] symbol - A name that is replaced by a value before processing-[ ] synopfragment - A portion of a CmdSynopsis broken out from the main body- of the synopsis-[ ] synopfragmentref - A reference to a fragment of a command synopsis-[ ] synopsis - A general-purpose element for representing the syntax of- commands or functions-[ ] systemitem - A system-related item or term-[ ] table - A formal table in a document-[ ] task - A task to be completed-[ ] taskprerequisites - The prerequisites for a task-[ ] taskrelated - Information related to a task-[ ] tasksummary - A summary of a task-[x] tbody - A wrapper for the rows of a table or informal table-[x] td - A table entry in an HTML table-[x] term - The word or phrase being defined or described in a variable list-[ ] termdef - An inline term definition-[ ] tertiary - A tertiary word or phrase in an index term-[ ] tertiaryie - A tertiary term in an index entry, rather than in the text-[ ] textdata - Pointer to external text data-[ ] textobject - A wrapper for a text description of an object and its- associated meta-information-[ ] tfoot - A table footer consisting of one or more rows-[x] tgroup - A wrapper for the main content of a table, or part of a table-[x] th - A table header entry in an HTML table-[x] thead - A table header consisting of one or more rows-[x] tip - A suggestion to the user, set off from the text-[x] title - The text of the title of a section of a document or of a formal- block-level element-[x] titleabbrev - The abbreviation of a Title-[x] toc - A table of contents-[x] tocback - An entry in a table of contents for a back matter component-[x] tocchap - An entry in a table of contents for a component in the body of- a document-[x] tocentry - A component title in a table of contents-[x] tocfront - An entry in a table of contents for a front matter component-[x] toclevel1 - A top-level entry within a table of contents entry for a- chapter-like component-[x] toclevel2 - A second-level entry within a table of contents entry for a- chapter-like component-[x] toclevel3 - A third-level entry within a table of contents entry for a- chapter-like component-[x] toclevel4 - A fourth-level entry within a table of contents entry for a- chapter-like component-[x] toclevel5 - A fifth-level entry within a table of contents entry for a- chapter-like component-[x] tocpart - An entry in a table of contents for a part of a book-[ ] token - A unit of information-[x] tr - A row in an HTML table-[ ] trademark - A trademark-[ ] type - The classification of a value-[x] ulink - A link that addresses its target by means of a URL- (Uniform Resource Locator)-[x] uri - A Uniform Resource Identifier-[x] userinput - Data entered by the user-[x] varargs - An empty element in a function synopsis indicating a variable- number of arguments-[x] variablelist - A list in which each entry is composed of a set of one or- more terms and an associated description-[x] varlistentry - A wrapper for a set of terms and the associated description- in a variable list-[x] varname - The name of a variable-[ ] videodata - Pointer to external video data-[ ] videoobject - A wrapper for video data and its associated meta-information-[ ] void - An empty element in a function synopsis indicating that the- function in question takes no arguments-[ ] volumenum - The volume number of a document in a set (as of books in a set- or articles in a journal)-[x] warning - An admonition set off from the text-[x] wordasword - A word meant specifically as a word and not representing- anything else-[ ] xref - A cross reference to another part of the document-[ ] year - The year of publication of a document-[x] ?asciidoc-br? - line break from asciidoc docbook output--}--type DB = State DBState--data DBState = DBState{ dbSectionLevel :: Int- , dbQuoteType :: QuoteType- , dbMeta :: Meta- , dbAcceptsMeta :: Bool- , dbBook :: Bool- , dbFigureTitle :: Inlines- } deriving Show--readDocBook :: ReaderOptions -> String -> Pandoc-readDocBook _ inp = Pandoc (dbMeta st') (toList $ mconcat bs)- where (bs, st') = runState (mapM parseBlock $ normalizeTree $ parseXML inp')- DBState{ dbSectionLevel = 0- , dbQuoteType = DoubleQuote- , dbMeta = mempty- , dbAcceptsMeta = False- , dbBook = False- , dbFigureTitle = mempty- }- inp' = handleInstructions inp---- We treat <?asciidoc-br?> specially (issue #1236), converting it--- to <br/>, since xml-light doesn't parse the instruction correctly.--- Other xml instructions are simply removed from the input stream.-handleInstructions :: String -> String-handleInstructions ('<':'?':'a':'s':'c':'i':'i':'d':'o':'c':'-':'b':'r':'?':'>':xs) = '<':'b':'r':'/':'>': handleInstructions xs-handleInstructions xs = case break (=='<') xs of- (ys, []) -> ys- ([], '<':zs) -> '<' : handleInstructions zs- (ys, zs) -> ys ++ handleInstructions zs--getFigure :: Element -> DB Blocks-getFigure e = do- tit <- case filterChild (named "title") e of- Just t -> getInlines t- Nothing -> return mempty- modify $ \st -> st{ dbFigureTitle = tit }- res <- getBlocks e- modify $ \st -> st{ dbFigureTitle = mempty }- return res---- normalize input, consolidating adjacent Text and CRef elements-normalizeTree :: [Content] -> [Content]-normalizeTree = everywhere (mkT go)- where go :: [Content] -> [Content]- go (Text (CData CDataRaw _ _):xs) = xs- go (Text (CData CDataText s1 z):Text (CData CDataText s2 _):xs) =- Text (CData CDataText (s1 ++ s2) z):xs- go (Text (CData CDataText s1 z):CRef r:xs) =- Text (CData CDataText (s1 ++ convertEntity r) z):xs- go (CRef r:Text (CData CDataText s1 z):xs) =- Text (CData CDataText (convertEntity r ++ s1) z):xs- go (CRef r1:CRef r2:xs) =- Text (CData CDataText (convertEntity r1 ++ convertEntity r2) Nothing):xs- go xs = xs--convertEntity :: String -> String-convertEntity e = maybe (map toUpper e) (:[]) (lookupEntity e)---- convenience function to get an attribute value, defaulting to ""-attrValue :: String -> Element -> String-attrValue attr elt =- case lookupAttrBy (\x -> qName x == attr) (elAttribs elt) of- Just z -> z- Nothing -> ""---- convenience function-named :: String -> Element -> Bool-named s e = qName (elName e) == s------acceptingMetadata :: DB a -> DB a-acceptingMetadata p = do- modify (\s -> s { dbAcceptsMeta = True } )- res <- p- modify (\s -> s { dbAcceptsMeta = False })- return res--checkInMeta :: Monoid a => DB () -> DB a-checkInMeta p = do- accepts <- dbAcceptsMeta <$> get- when accepts p- return mempty----addMeta :: ToMetaValue a => String -> a -> DB ()-addMeta field val = modify (setMeta field val)--instance HasMeta DBState where- setMeta field v s = s {dbMeta = setMeta field v (dbMeta s)}- deleteMeta field s = s {dbMeta = deleteMeta field (dbMeta s)}--isBlockElement :: Content -> Bool-isBlockElement (Elem e) = qName (elName e) `elem` blocktags- where blocktags = ["toc","index","para","formalpara","simpara",- "ackno","epigraph","blockquote","bibliography","bibliodiv",- "biblioentry","glossee","glosseealso","glossary",- "glossdiv","glosslist","chapter","appendix","preface",- "bridgehead","sect1","sect2","sect3","sect4","sect5","section",- "refsect1","refsect2","refsect3","refsection",- "important","caution","note","tip","warning","qandadiv",- "question","answer","abstract","itemizedlist","orderedlist",- "variablelist","article","book","table","informaltable",- "screen","programlisting","example"]-isBlockElement _ = False---- Trim leading and trailing newline characters-trimNl :: String -> String-trimNl = reverse . go . reverse . go- where go ('\n':xs) = xs- go xs = xs---- meld text into beginning of first paragraph of Blocks.--- assumes Blocks start with a Para; if not, does nothing.-addToStart :: Inlines -> Blocks -> Blocks-addToStart toadd bs =- case toList bs of- (Para xs : rest) -> para (toadd <> fromList xs) <> fromList rest- _ -> bs---- function that is used by both mediaobject (in parseBlock)--- and inlinemediaobject (in parseInline)-getImage :: Element -> DB Inlines-getImage e = do- imageUrl <- case filterChild (named "imageobject") e of- Nothing -> return mempty- Just z -> case filterChild (named "imagedata") z of- Nothing -> return mempty- Just i -> return $ attrValue "fileref" i- caption <- case filterChild- (\x -> named "caption" x || named "textobject" x) e of- Nothing -> gets dbFigureTitle- Just z -> mconcat <$> (mapM parseInline $ elContent z)- return $ image imageUrl "" caption--getBlocks :: Element -> DB Blocks-getBlocks e = mconcat <$> (mapM parseBlock $ elContent e)---parseBlock :: Content -> DB Blocks-parseBlock (Text (CData CDataRaw _ _)) = return mempty -- DOCTYPE-parseBlock (Text (CData _ s _)) = if all isSpace s- then return mempty- else return $ plain $ trimInlines $ text s-parseBlock (CRef x) = return $ plain $ str $ map toUpper x-parseBlock (Elem e) =- case qName (elName e) of- "toc" -> return mempty -- skip TOC, since in pandoc it's autogenerated- "index" -> return mempty -- skip index, since page numbers meaningless- "para" -> parseMixed para (elContent e)- "formalpara" -> do- tit <- case filterChild (named "title") e of- Just t -> (para . strong . (<> str ".")) <$>- getInlines t- Nothing -> return mempty- (tit <>) <$> parseMixed para (elContent e)- "simpara" -> parseMixed para (elContent e)- "ackno" -> parseMixed para (elContent e)- "epigraph" -> parseBlockquote- "blockquote" -> parseBlockquote- "attribution" -> return mempty- "titleabbrev" -> return mempty- "authorinitials" -> return mempty- "title" -> checkInMeta getTitle- "author" -> checkInMeta getAuthor- "authorgroup" -> checkInMeta getAuthorGroup- "releaseinfo" -> checkInMeta (getInlines e >>= addMeta "release")- "date" -> checkInMeta getDate- "bibliography" -> sect 0- "bibliodiv" -> sect 1- "biblioentry" -> parseMixed para (elContent e)- "bibliomixed" -> parseMixed para (elContent e)- "glosssee" -> para . (\ils -> text "See " <> ils <> str ".")- <$> getInlines e- "glossseealso" -> para . (\ils -> text "See also " <> ils <> str ".")- <$> getInlines e- "glossary" -> sect 0- "glossdiv" -> definitionList <$>- mapM parseGlossEntry (filterChildren (named "glossentry") e)- "glosslist" -> definitionList <$>- mapM parseGlossEntry (filterChildren (named "glossentry") e)- "chapter" -> sect 0- "appendix" -> sect 0- "preface" -> sect 0- "bridgehead" -> para . strong <$> getInlines e- "sect1" -> sect 1- "sect2" -> sect 2- "sect3" -> sect 3- "sect4" -> sect 4- "sect5" -> sect 5- "section" -> gets dbSectionLevel >>= sect . (+1)- "refsect1" -> sect 1- "refsect2" -> sect 2- "refsect3" -> sect 3- "refsection" -> gets dbSectionLevel >>= sect . (+1)- "important" -> blockQuote . (para (strong $ str "Important") <>)- <$> getBlocks e- "caution" -> blockQuote . (para (strong $ str "Caution") <>)- <$> getBlocks e- "note" -> blockQuote . (para (strong $ str "Note") <>)- <$> getBlocks e- "tip" -> blockQuote . (para (strong $ str "Tip") <>)- <$> getBlocks e- "warning" -> blockQuote . (para (strong $ str "Warning") <>)- <$> getBlocks e- "area" -> return mempty- "areaset" -> return mempty- "areaspec" -> return mempty- "qandadiv" -> gets dbSectionLevel >>= sect . (+1)- "question" -> addToStart (strong (str "Q:") <> str " ") <$> getBlocks e- "answer" -> addToStart (strong (str "A:") <> str " ") <$> getBlocks e- "abstract" -> blockQuote <$> getBlocks e- "itemizedlist" -> bulletList <$> listitems- "orderedlist" -> do- let listStyle = case attrValue "numeration" e of- "arabic" -> Decimal- "loweralpha" -> LowerAlpha- "upperalpha" -> UpperAlpha- "lowerroman" -> LowerRoman- "upperroman" -> UpperRoman- _ -> Decimal- let start = fromMaybe 1 $- (attrValue "override" <$> filterElement (named "listitem") e)- >>= safeRead- orderedListWith (start,listStyle,DefaultDelim)- <$> listitems- "variablelist" -> definitionList <$> deflistitems- "figure" -> getFigure e- "mediaobject" -> para <$> getImage e- "caption" -> return mempty- "info" -> metaBlock- "articleinfo" -> metaBlock- "sectioninfo" -> return mempty -- keywords & other metadata- "refsectioninfo" -> return mempty -- keywords & other metadata- "refsect1info" -> return mempty -- keywords & other metadata- "refsect2info" -> return mempty -- keywords & other metadata- "refsect3info" -> return mempty -- keywords & other metadata- "sect1info" -> return mempty -- keywords & other metadata- "sect2info" -> return mempty -- keywords & other metadata- "sect3info" -> return mempty -- keywords & other metadata- "sect4info" -> return mempty -- keywords & other metadata- "sect5info" -> return mempty -- keywords & other metadata- "chapterinfo" -> return mempty -- keywords & other metadata- "glossaryinfo" -> return mempty -- keywords & other metadata- "appendixinfo" -> return mempty -- keywords & other metadata- "bookinfo" -> metaBlock- "article" -> modify (\st -> st{ dbBook = False }) >>- getBlocks e- "book" -> modify (\st -> st{ dbBook = True }) >> getBlocks e- "table" -> parseTable- "informaltable" -> parseTable- "literallayout" -> codeBlockWithLang- "screen" -> codeBlockWithLang- "programlisting" -> codeBlockWithLang- "?xml" -> return mempty- _ -> getBlocks e- where parseMixed container conts = do- let (ils,rest) = break isBlockElement conts- ils' <- (trimInlines . mconcat) <$> mapM parseInline ils- let p = if ils' == mempty then mempty else container ils'- case rest of- [] -> return p- (r:rs) -> do- b <- parseBlock r- x <- parseMixed container rs- return $ p <> b <> x- codeBlockWithLang = do- let classes' = case attrValue "language" e of- "" -> []- x -> [x]- return $ codeBlockWith (attrValue "id" e, classes', [])- $ trimNl $ strContentRecursive e- strContentRecursive = strContent . (\e' -> e'{ elContent =- map elementToStr $ elContent e' })- elementToStr :: Content -> Content- elementToStr (Elem e') = Text $ CData CDataText (strContentRecursive e') Nothing- elementToStr x = x- parseBlockquote = do- attrib <- case filterChild (named "attribution") e of- Nothing -> return mempty- Just z -> (para . (str "— " <>) . mconcat)- <$> (mapM parseInline $ elContent z)- contents <- getBlocks e- return $ blockQuote (contents <> attrib)- listitems = mapM getBlocks $ filterChildren (named "listitem") e- deflistitems = mapM parseVarListEntry $ filterChildren- (named "varlistentry") e- parseVarListEntry e' = do- let terms = filterChildren (named "term") e'- let items = filterChildren (named "listitem") e'- terms' <- mapM getInlines terms- items' <- mapM getBlocks items- return (mconcat $ intersperse (str "; ") terms', items')- parseGlossEntry e' = do- let terms = filterChildren (named "glossterm") e'- let items = filterChildren (named "glossdef") e'- terms' <- mapM getInlines terms- items' <- mapM getBlocks items- return (mconcat $ intersperse (str "; ") terms', items')- getTitle = do- tit <- getInlines e- subtit <- case filterChild (named "subtitle") e of- Just s -> (text ": " <>) <$>- getInlines s- Nothing -> return mempty- addMeta "title" (tit <> subtit)-- getAuthor = (:[]) <$> getInlines e >>= addMeta "author"- getAuthorGroup = do- let terms = filterChildren (named "author") e- mapM getInlines terms >>= addMeta "author"- getDate = getInlines e >>= addMeta "date"- parseTable = do- let isCaption x = named "title" x || named "caption" x- caption <- case filterChild isCaption e of- Just t -> getInlines t- Nothing -> return mempty- let e' = fromMaybe e $ filterChild (named "tgroup") e- let isColspec x = named "colspec" x || named "col" x- let colspecs = case filterChild (named "colgroup") e' of- Just c -> filterChildren isColspec c- _ -> filterChildren isColspec e'- let isRow x = named "row" x || named "tr" x- headrows <- case filterChild (named "thead") e' of- Just h -> case filterChild isRow h of- Just x -> parseRow x- Nothing -> return []- Nothing -> return []- bodyrows <- case filterChild (named "tbody") e' of- Just b -> mapM parseRow- $ filterChildren isRow b- Nothing -> mapM parseRow- $ filterChildren isRow e'- let toAlignment c = case findAttr (unqual "align") c of- Just "left" -> AlignLeft- Just "right" -> AlignRight- Just "center" -> AlignCenter- _ -> AlignDefault- let toWidth c = case findAttr (unqual "colwidth") c of- Just w -> fromMaybe 0- $ safeRead $ '0': filter (\x ->- (x >= '0' && x <= '9')- || x == '.') w- Nothing -> 0 :: Double- let numrows = case bodyrows of- [] -> 0- xs -> maximum $ map length xs- let aligns = case colspecs of- [] -> replicate numrows AlignDefault- cs -> map toAlignment cs- let widths = case colspecs of- [] -> replicate numrows 0- cs -> let ws = map toWidth cs- tot = sum ws- in if all (> 0) ws- then map (/ tot) ws- else replicate numrows 0- let headrows' = if null headrows- then replicate numrows mempty- else headrows- return $ table caption (zip aligns widths)- headrows' bodyrows- isEntry x = named "entry" x || named "td" x || named "th" x- parseRow = mapM (parseMixed plain . elContent) . filterChildren isEntry- sect n = do isbook <- gets dbBook- let n' = if isbook || n == 0 then n + 1 else n- headerText <- case filterChild (named "title") e of- Just t -> getInlines t- Nothing -> return mempty- modify $ \st -> st{ dbSectionLevel = n }- b <- getBlocks e- modify $ \st -> st{ dbSectionLevel = n - 1 }- return $ header n' headerText <> b- metaBlock = acceptingMetadata (getBlocks e) >> return mempty--getInlines :: Element -> DB Inlines-getInlines e' = (trimInlines . mconcat) <$> (mapM parseInline $ elContent e')--parseInline :: Content -> DB Inlines-parseInline (Text (CData _ s _)) = return $ text s-parseInline (CRef ref) =- return $ maybe (text $ map toUpper ref) (text . (:[])) $ lookupEntity ref-parseInline (Elem e) =- case qName (elName e) of- "equation" -> equation displayMath- "informalequation" -> equation displayMath- "inlineequation" -> equation math- "subscript" -> subscript <$> innerInlines- "superscript" -> superscript <$> innerInlines- "inlinemediaobject" -> getImage e- "quote" -> do- qt <- gets dbQuoteType- let qt' = if qt == SingleQuote then DoubleQuote else SingleQuote- modify $ \st -> st{ dbQuoteType = qt' }- contents <- innerInlines- modify $ \st -> st{ dbQuoteType = qt }- return $ if qt == SingleQuote- then singleQuoted contents- else doubleQuoted contents- "simplelist" -> simpleList- "segmentedlist" -> segmentedList- "code" -> codeWithLang- "filename" -> codeWithLang- "literal" -> codeWithLang- "computeroutput" -> codeWithLang- "prompt" -> codeWithLang- "parameter" -> codeWithLang- "option" -> codeWithLang- "optional" -> do x <- getInlines e- return $ str "[" <> x <> str "]"- "markup" -> codeWithLang- "wordasword" -> emph <$> innerInlines- "command" -> codeWithLang- "varname" -> codeWithLang- "function" -> codeWithLang- "type" -> codeWithLang- "symbol" -> codeWithLang- "constant" -> codeWithLang- "userinput" -> codeWithLang- "varargs" -> return $ code "(...)"- "xref" -> return $ str "?" -- so at least you know something is there- "email" -> return $ link ("mailto:" ++ strContent e) ""- $ str $ strContent e- "uri" -> return $ link (strContent e) "" $ str $ strContent e- "ulink" -> link (attrValue "url" e) "" <$> innerInlines- "link" -> do- ils <- innerInlines- let href = case findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e of- Just h -> h- _ -> ('#' : attrValue "linkend" e)- let ils' = if ils == mempty then str href else ils- return $ link href "" ils'- "foreignphrase" -> emph <$> innerInlines- "emphasis" -> case attrValue "role" e of- "bold" -> strong <$> innerInlines- "strong" -> strong <$> innerInlines- "strikethrough" -> strikeout <$> innerInlines- _ -> emph <$> innerInlines- "footnote" -> (note . mconcat) <$> (mapM parseBlock $ elContent e)- "title" -> return mempty- "affiliation" -> return mempty- -- Note: this isn't a real docbook tag; it's what we convert- -- <?asciidor-br?> to in handleInstructions, above. A kludge to- -- work around xml-light's inability to parse an instruction.- "br" -> return linebreak- _ -> innerInlines- where innerInlines = (trimInlines . mconcat) <$>- (mapM parseInline $ elContent e)- equation constructor = return $ mconcat $- map (constructor . writeTeX)- $ rights- $ map (readMathML . showElement . everywhere (mkT removePrefix))- $ filterChildren (\x -> qName (elName x) == "math" &&- qPrefix (elName x) == Just "mml") e- removePrefix elname = elname { qPrefix = Nothing }- codeWithLang = do- let classes' = case attrValue "language" e of- "" -> []- l -> [l]- return $ codeWith (attrValue "id" e,classes',[]) $ strContent e- simpleList = (mconcat . intersperse (str "," <> space)) <$> mapM getInlines- (filterChildren (named "member") e)- segmentedList = do- tit <- maybe (return mempty) getInlines $ filterChild (named "title") e- segtits <- mapM getInlines $ filterChildren (named "segtitle") e- segitems <- mapM (mapM getInlines . filterChildren (named "seg"))- $ filterChildren (named "seglistitem") e- let toSeg = mconcat . zipWith (\x y -> strong (x <> str ":") <> space <>- y <> linebreak) segtits- let segs = mconcat $ map toSeg segitems- let tit' = if tit == mempty- then mempty- else strong tit <> linebreak- return $ linebreak <> tit' <> segs+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE TemplateHaskell #-}+{- |+ Module : Text.Pandoc.Readers.DocBook+ Copyright : Copyright (C) 2006-2024 John MacFarlane+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++Conversion of DocBook XML to 'Pandoc' document.+-}+module Text.Pandoc.Readers.DocBook ( readDocBook ) where+import Control.Monad (MonadPlus(mplus))+import Control.Applicative ()+import Control.Monad.State.Strict+ ( MonadTrans(lift),+ StateT(runStateT),+ MonadState(get),+ gets,+ modify )+import Data.ByteString (ByteString)+import Data.FileEmbed+import Data.Char (isSpace, isLetter, chr)+import Data.Default+import Data.List.Split (splitWhen)+import Data.Either (rights)+import Data.Foldable (asum)+import Data.Generics+import Data.List (intersperse,elemIndex)+import qualified Data.Set as Set+import Data.List.NonEmpty (nonEmpty)+import Data.Maybe (catMaybes,fromMaybe,mapMaybe,maybeToList)+import Data.Text (Text)+import Data.Text.Read as TR+import Data.Text.Encoding (decodeUtf8)+import qualified Data.Text as T+import qualified Data.Text.Lazy as TL+import Control.Monad.Except (throwError)+import Text.Pandoc.XML (lookupEntity)+import Text.Pandoc.Error (PandocError(..))+import Text.Pandoc.Builder+import Text.Pandoc.Class.PandocMonad (PandocMonad, report)+import Text.Pandoc.Options+import Text.Pandoc.Logging (LogMessage(..))+import Text.Pandoc.Shared (safeRead, addPandocAttributes)+import Text.Pandoc.Sources (ToSources(..), sourcesToText)+import Text.Pandoc.Transforms (headerShift)+import Text.TeXMath (readMathML, writeTeX)+import qualified Data.Map as M+import Text.Pandoc.XML.Light+import Text.Pandoc.Walk (query)+import Text.Read (readMaybe)++{-++List of all DocBook tags, with [x] indicating implemented,+[o] meaning intentionally left unimplemented (pass through):++[o] abbrev - An abbreviation, especially one followed by a period+[x] abstract - A summary+[o] accel - A graphical user interface (GUI) keyboard shortcut+[x] ackno - Acknowledgements in an Article+[o] acronym - An often pronounceable word made from the initial+[o] action - A response to a user event+[o] address - A real-world address, generally a postal address+[ ] affiliation - The institutional affiliation of an individual+[ ] alt - Text representation for a graphical element+[x] anchor - A spot in the document+[x] answer - An answer to a question posed in a QandASet+[x] appendix - An appendix in a Book or Article+[x] appendixinfo - Meta-information for an Appendix+[o] application - The name of a software program+[x] area - A region defined for a Callout in a graphic or code example+[x] areaset - A set of related areas in a graphic or code example+[x] areaspec - A collection of regions in a graphic or code example+[ ] arg - An argument in a CmdSynopsis+[x] article - An article+[x] articleinfo - Meta-information for an Article+[ ] artpagenums - The page numbers of an article as published+[x] attribution - The source of a block quote or epigraph+[ ] audiodata - Pointer to external audio data+[ ] audioobject - A wrapper for audio data and its associated meta-information+[x] author - The name of an individual author+[ ] authorblurb - A short description or note about an author+[x] authorgroup - Wrapper for author information when a document has+ multiple authors or collaborators+[x] authorinitials - The initials or other short identifier for an author+[o] beginpage - The location of a page break in a print version of the document+[ ] bibliocoverage - The spatial or temporal coverage of a document+[x] bibliodiv - A section of a Bibliography+[x] biblioentry - An entry in a Bibliography+[x] bibliography - A bibliography+[ ] bibliographyinfo - Meta-information for a Bibliography+[ ] biblioid - An identifier for a document+[o] bibliolist - A wrapper for a set of bibliography entries+[x] bibliomisc - Untyped bibliographic information+[x] bibliomixed - An entry in a Bibliography+[ ] bibliomset - A cooked container for related bibliographic information+[ ] biblioref - A cross reference to a bibliographic entry+[ ] bibliorelation - The relationship of a document to another+[ ] biblioset - A raw container for related bibliographic information+[ ] bibliosource - The source of a document+[ ] blockinfo - Meta-information for a block element+[x] blockquote - A quotation set off from the main text+[x] book - A book+[x] bookinfo - Meta-information for a Book+[x] bridgehead - A free-floating heading+[x] callout - A “called out” description of a marked Area+[x] calloutlist - A list of Callouts+[x] caption - A caption+[x] caution - A note of caution+[x] chapter - A chapter, as of a book+[x] chapterinfo - Meta-information for a Chapter+[ ] citation - An inline bibliographic reference to another published work+[ ] citebiblioid - A citation of a bibliographic identifier+[x] citerefentry - A citation to a reference page+[ ] citetitle - The title of a cited work+[ ] city - The name of a city in an address+[x] classname - The name of a class, in the object-oriented programming sense+[ ] classsynopsis - The syntax summary for a class definition+[ ] classsynopsisinfo - Information supplementing the contents of+ a ClassSynopsis+[ ] cmdsynopsis - A syntax summary for a software command+[ ] co - The location of a callout embedded in text+[x] code - An inline code fragment+[x] col - Specifications for a column in an HTML table+[x] colgroup - A group of columns in an HTML table+[ ] collab - Identifies a collaborator+[ ] collabname - The name of a collaborator+[ ] colophon - Text at the back of a book describing facts about its production+[x] colspec - Specifications for a column in a table+[x] command - The name of an executable program or other software command+[x] computeroutput - Data, generally text, displayed or presented by a computer+[ ] confdates - The dates of a conference for which a document was written+[ ] confgroup - A wrapper for document meta-information about a conference+[ ] confnum - An identifier, frequently numerical, associated with a conference for which a document was written+[ ] confsponsor - The sponsor of a conference for which a document was written+[ ] conftitle - The title of a conference for which a document was written+[x] constant - A programming or system constant+[ ] constraint - A constraint in an EBNF production+[ ] constraintdef - The definition of a constraint in an EBNF production+[ ] constructorsynopsis - A syntax summary for a constructor+[ ] contractnum - The contract number of a document+[ ] contractsponsor - The sponsor of a contract+[ ] contrib - A summary of the contributions made to a document by a+ credited source+[ ] copyright - Copyright information about a document+[ ] coref - A cross reference to a co+[ ] corpauthor - A corporate author, as opposed to an individual+[ ] corpcredit - A corporation or organization credited in a document+[ ] corpname - The name of a corporation+[ ] country - The name of a country+[x] danger - An admonition set off from the text indicating hazardous situation+[ ] database - The name of a database, or part of a database+[x] date - The date of publication or revision of a document+[ ] dedication - A wrapper for the dedication section of a book+[ ] destructorsynopsis - A syntax summary for a destructor+[ ] edition - The name or number of an edition of a document+[ ] editor - The name of the editor of a document+[x] email - An email address+[x] emphasis - Emphasized text+[x] entry - A cell in a table+[ ] entrytbl - A subtable appearing in place of an Entry in a table+[x] envar - A software environment variable+[x] epigraph - A short inscription at the beginning of a document or component+ note: also handle embedded attribution tag+[x] equation - A displayed mathematical equation+[ ] errorcode - An error code+[ ] errorname - An error name+[ ] errortext - An error message.+[ ] errortype - The classification of an error message+[x] example - A formal example, with a title+[ ] exceptionname - The name of an exception+[ ] fax - A fax number+[ ] fieldsynopsis - The name of a field in a class definition+[x] figure - A formal figure, generally an illustration, with a title+[x] filename - The name of a file+[ ] firstname - The first name of a person+[ ] firstterm - The first occurrence of a term+[x] footnote - A footnote+[ ] footnoteref - A cross reference to a footnote (a footnote mark)+[x] foreignphrase - A word or phrase in a language other than the primary+ language of the document+[x] formalpara - A paragraph with a title+[ ] funcdef - A function (subroutine) name and its return type+[ ] funcparams - Parameters for a function referenced through a function+ pointer in a synopsis+[ ] funcprototype - The prototype of a function+[ ] funcsynopsis - The syntax summary for a function definition+[ ] funcsynopsisinfo - Information supplementing the FuncDefs of a FuncSynopsis+[x] function - The name of a function or subroutine, as in a+ programming language+[x] glossary - A glossary+[x] glossaryinfo - Meta-information for a Glossary+[x] glossdef - A definition in a GlossEntry+[x] glossdiv - A division in a Glossary+[x] glossentry - An entry in a Glossary or GlossList+[x] glosslist - A wrapper for a set of GlossEntrys+[x] glosssee - A cross-reference from one GlossEntry to another+[x] glossseealso - A cross-reference from one GlossEntry to another+[x] glossterm - A glossary term+[ ] graphic - A displayed graphical object (not an inline)+ Note: in DocBook v5 `graphic` is discarded+[ ] graphicco - A graphic that contains callout areas+ Note: in DocBook v5 `graphicco` is discarded+[ ] group - A group of elements in a CmdSynopsis+[ ] guibutton - The text on a button in a GUI+[ ] guiicon - Graphic and/or text appearing as a icon in a GUI+[ ] guilabel - The text of a label in a GUI+[x] guimenu - The name of a menu in a GUI+[x] guimenuitem - The name of a terminal menu item in a GUI+[x] guisubmenu - The name of a submenu in a GUI+[ ] hardware - A physical part of a computer system+[ ] highlights - A summary of the main points of the discussed component+[ ] holder - The name of the individual or organization that holds a copyright+[o] honorific - The title of a person+[ ] html:form - An HTML form+[x] imagedata - Pointer to external image data (only `fileref` attribute+ implemented but not `entityref` which would require parsing of the DTD)+[x] imageobject - A wrapper for image data and its associated meta-information+[ ] imageobjectco - A wrapper for an image object with callouts+[x] important - An admonition set off from the text+[x] index - An index+[x] indexdiv - A division in an index+[x] indexentry - An entry in an index+[x] indexinfo - Meta-information for an Index+[x] indexterm - A wrapper for terms to be indexed+[x] info - A wrapper for information about a component or other block. (DocBook v5)+[x] informalequation - A displayed mathematical equation without a title+[x] informalexample - A displayed example without a title+[x] informalfigure - An untitled figure+[ ] informaltable - A table without a title+[ ] initializer - The initializer for a FieldSynopsis+[x] inlineequation - A mathematical equation or expression occurring inline+[ ] inlinegraphic - An object containing or pointing to graphical data+ that will be rendered inline+[x] inlinemediaobject - An inline media object (video, audio, image, and so on)+[ ] interface - An element of a GUI+[ ] interfacename - The name of an interface+[ ] invpartnumber - An inventory part number+[ ] isbn - The International Standard Book Number of a document+[ ] issn - The International Standard Serial Number of a periodical+[ ] issuenum - The number of an issue of a journal+[x] itemizedlist - A list in which each entry is marked with a bullet or+ other dingbat+[ ] itermset - A set of index terms in the meta-information of a document+[ ] jobtitle - The title of an individual in an organization+[x] keycap - The text printed on a key on a keyboard+[ ] keycode - The internal, frequently numeric, identifier for a key+ on a keyboard+[x] keycombo - A combination of input actions+[ ] keysym - The symbolic name of a key on a keyboard+[ ] keyword - One of a set of keywords describing the content of a document+[ ] keywordset - A set of keywords describing the content of a document+[ ] label - A label on a Question or Answer+[ ] legalnotice - A statement of legal obligations or requirements+[ ] lhs - The left-hand side of an EBNF production+[ ] lineage - The portion of a person's name indicating a relationship to+ ancestors+[ ] lineannotation - A comment on a line in a verbatim listing+[x] link - A hypertext link+[x] listitem - A wrapper for the elements of a list item+[x] literal - Inline text that is some literal value+[x] literallayout - A block of text in which line breaks and white space are+ to be reproduced faithfully+[ ] lot - A list of the titles of formal objects (as tables or figures) in+ a document+[ ] lotentry - An entry in a list of titles+[ ] manvolnum - A reference volume number+[x] markup - A string of formatting markup in text that is to be+ represented literally+[x] mathphrase - A mathematical phrase, an expression that can be represented+ with ordinary text and a small amount of markup+[ ] medialabel - A name that identifies the physical medium on which some+ information resides+[x] mediaobject - A displayed media object (video, audio, image, etc.)+[ ] mediaobjectco - A media object that contains callouts+[x] member - An element of a simple list+[x] menuchoice - A selection or series of selections from a menu+[ ] methodname - The name of a method+[ ] methodparam - Parameters to a method+[ ] methodsynopsis - A syntax summary for a method+[x] mml:math - A MathML equation+[ ] modespec - Application-specific information necessary for the+ completion of an OLink+[ ] modifier - Modifiers in a synopsis+[ ] mousebutton - The conventional name of a mouse button+[ ] msg - A message in a message set+[ ] msgaud - The audience to which a message in a message set is relevant+[ ] msgentry - A wrapper for an entry in a message set+[ ] msgexplan - Explanatory material relating to a message in a message set+[ ] msginfo - Information about a message in a message set+[ ] msglevel - The level of importance or severity of a message in a message set+[ ] msgmain - The primary component of a message in a message set+[ ] msgorig - The origin of a message in a message set+[ ] msgrel - A related component of a message in a message set+[ ] msgset - A detailed set of messages, usually error messages+[ ] msgsub - A subcomponent of a message in a message set+[ ] msgtext - The actual text of a message component in a message set+[ ] nonterminal - A non-terminal in an EBNF production+[x] note - A message set off from the text+[ ] objectinfo - Meta-information for an object+[ ] olink - A link that addresses its target indirectly, through an entity+[ ] ooclass - A class in an object-oriented programming language+[ ] ooexception - An exception in an object-oriented programming language+[ ] oointerface - An interface in an object-oriented programming language+[x] option - An option for a software command+[x] optional - Optional information+[x] orderedlist - A list in which each entry is marked with a sequentially+ incremented label+[ ] orgdiv - A division of an organization+[ ] orgname - The name of an organization other than a corporation+[ ] otheraddr - Uncategorized information in address+[ ] othercredit - A person or entity, other than an author or editor,+ credited in a document+[ ] othername - A component of a persons name that is not a first name,+ surname, or lineage+[ ] package - A package+[ ] pagenums - The numbers of the pages in a book, for use in a bibliographic+ entry+[x] para - A paragraph+[ ] paramdef - Information about a function parameter in a programming language+[x] parameter - A value or a symbolic reference to a value+[x] part - A division in a book+[ ] partinfo - Meta-information for a Part+[ ] partintro - An introduction to the contents of a part+[ ] personblurb - A short description or note about a person+[ ] personname - The personal name of an individual+[ ] phone - A telephone number+[x] phrase - A span of text+[ ] pob - A post office box in an address+[ ] postcode - A postal code in an address+[x] preface - Introductory matter preceding the first chapter of a book+[ ] prefaceinfo - Meta-information for a Preface+[x] primary - The primary word or phrase under which an index term should be+ sorted+[ ] primaryie - A primary term in an index entry, not in the text+[ ] printhistory - The printing history of a document+[x] procedure - A list of operations to be performed in a well-defined sequence+[ ] production - A production in a set of EBNF productions+[ ] productionrecap - A cross-reference to an EBNF production+[ ] productionset - A set of EBNF productions+[ ] productname - The formal name of a product+[ ] productnumber - A number assigned to a product+[x] programlisting - A literal listing of all or part of a program+[ ] programlistingco - A program listing with associated areas used in callouts+[x] prompt - A character or string indicating the start of an input field in+ a computer display+[ ] property - A unit of data associated with some part of a computer system+[ ] pubdate - The date of publication of a document+[ ] publisher - The publisher of a document+[ ] publishername - The name of the publisher of a document+[ ] pubsnumber - A number assigned to a publication other than an ISBN or ISSN+ or inventory part number+[x] qandadiv - A titled division in a QandASet+[o] qandaentry - A question/answer set within a QandASet+[o] qandaset - A question-and-answer set+[x] question - A question in a QandASet+[x] quote - An inline quotation+[ ] refclass - The scope or other indication of applicability of a+ reference entry+[ ] refdescriptor - A description of the topic of a reference page+[ ] refentry - A reference page (originally a UNIX man-style reference page)+[ ] refentryinfo - Meta-information for a Refentry+[ ] refentrytitle - The title of a reference page+[ ] reference - A collection of reference entries+[ ] referenceinfo - Meta-information for a Reference+[ ] refmeta - Meta-information for a reference entry+[ ] refmiscinfo - Meta-information for a reference entry other than the title+ and volume number+[ ] refname - The name of (one of) the subject(s) of a reference page+[ ] refnamediv - The name, purpose, and classification of a reference page+[ ] refpurpose - A short (one sentence) synopsis of the topic of a reference+ page+[x] refsect1 - A major subsection of a reference entry+[x] refsect1info - Meta-information for a RefSect1+[x] refsect2 - A subsection of a RefSect1+[x] refsect2info - Meta-information for a RefSect2+[x] refsect3 - A subsection of a RefSect2+[x] refsect3info - Meta-information for a RefSect3+[x] refsection - A recursive section in a refentry+[x] refsectioninfo - Meta-information for a refsection+[ ] refsynopsisdiv - A syntactic synopsis of the subject of the reference page+[ ] refsynopsisdivinfo - Meta-information for a RefSynopsisDiv+[ ] releaseinfo - Information about a particular release of a document+[ ] remark - A remark (or comment) intended for presentation in a draft+ manuscript+[x] replaceable - Content that may or must be replaced by the user+[ ] returnvalue - The value returned by a function+[ ] revdescription - A extended description of a revision to a document+[ ] revhistory - A history of the revisions to a document+[ ] revision - An entry describing a single revision in the history of the+ revisions to a document+[ ] revnumber - A document revision number+[ ] revremark - A description of a revision to a document+[ ] rhs - The right-hand side of an EBNF production+[x] row - A row in a table+[ ] sbr - An explicit line break in a command synopsis+[x] screen - Text that a user sees or might see on a computer screen+[o] screenco - A screen with associated areas used in callouts+[o] screeninfo - Information about how a screen shot was produced+[ ] screenshot - A representation of what the user sees or might see on a+ computer screen+[x] secondary - A secondary word or phrase in an index term+[ ] secondaryie - A secondary term in an index entry, rather than in the text+[x] sect1 - A top-level section of document+[x] sect1info - Meta-information for a Sect1+[x] sect2 - A subsection within a Sect1+[x] sect2info - Meta-information for a Sect2+[x] sect3 - A subsection within a Sect2+[x] sect3info - Meta-information for a Sect3+[x] sect4 - A subsection within a Sect3+[x] sect4info - Meta-information for a Sect4+[x] sect5 - A subsection within a Sect4+[x] sect5info - Meta-information for a Sect5+[x] section - A recursive section+[x] sectioninfo - Meta-information for a recursive section+[x] see - Part of an index term directing the reader instead to another entry+ in the index+[x] seealso - Part of an index term directing the reader also to another entry+ in the index+[ ] seealsoie - A See also entry in an index, rather than in the text+[ ] seeie - A See entry in an index, rather than in the text+[x] seg - An element of a list item in a segmented list+[x] seglistitem - A list item in a segmented list+[x] segmentedlist - A segmented list, a list of sets of elements+[x] segtitle - The title of an element of a list item in a segmented list+[ ] seriesvolnums - Numbers of the volumes in a series of books+[ ] set - A collection of books+[ ] setindex - An index to a set of books+[ ] setindexinfo - Meta-information for a SetIndex+[ ] setinfo - Meta-information for a Set+[ ] sgmltag - A component of SGML markup+[ ] shortaffil - A brief description of an affiliation+[ ] shortcut - A key combination for an action that is also accessible through+ a menu+[x] sidebar - A portion of a document that is isolated from the main+ narrative flow+[ ] sidebarinfo - Meta-information for a Sidebar+[x] simpara - A paragraph that contains only text and inline markup, no block+ elements+[x] simplelist - An undecorated list of single words or short phrases+[ ] simplemsgentry - A wrapper for a simpler entry in a message set+[x] simplesect - A section of a document with no subdivisions+[ ] spanspec - Formatting information for a spanned column in a table+[ ] state - A state or province in an address+[x] step - A unit of action in a procedure+[ ] stepalternatives - Alternative steps in a procedure+[ ] street - A street address in an address+[ ] structfield - A field in a structure (in the programming language sense)+[ ] structname - The name of a structure (in the programming language sense)+[ ] subject - One of a group of terms describing the subject matter of a+ document+[ ] subjectset - A set of terms describing the subject matter of a document+[ ] subjectterm - A term in a group of terms describing the subject matter of+ a document+[x] subscript - A subscript (as in H2O, the molecular formula for water)+[x] substeps - A wrapper for steps that occur within steps in a procedure+[x] subtitle - The subtitle of a document+[x] superscript - A superscript (as in x2, the mathematical notation for x+ multiplied by itself)+[ ] surname - A family name; in western cultures the last name+[ ] svg:svg - An SVG graphic+[x] symbol - A name that is replaced by a value before processing+[ ] synopfragment - A portion of a CmdSynopsis broken out from the main body+ of the synopsis+[ ] synopfragmentref - A reference to a fragment of a command synopsis+[ ] synopsis - A general-purpose element for representing the syntax of+ commands or functions+[x] systemitem - A system-related item or term+[ ] table - A formal table in a document+[ ] task - A task to be completed+[ ] taskprerequisites - The prerequisites for a task+[ ] taskrelated - Information related to a task+[ ] tasksummary - A summary of a task+[x] tbody - A wrapper for the rows of a table or informal table+[x] td - A table entry in an HTML table+[x] term - The word or phrase being defined or described in a variable list+[ ] termdef - An inline term definition+[x] tertiary - A tertiary word or phrase in an index term+[ ] tertiaryie - A tertiary term in an index entry, rather than in the text+[ ] textdata - Pointer to external text data+[ ] textobject - A wrapper for a text description of an object and its+ associated meta-information+[ ] tfoot - A table footer consisting of one or more rows+[x] tgroup - A wrapper for the main content of a table, or part of a table+[x] th - A table header entry in an HTML table+[x] thead - A table header consisting of one or more rows+[x] tip - A suggestion to the user, set off from the text+[x] title - The text of the title of a section of a document or of a formal+ block-level element+[x] titleabbrev - The abbreviation of a Title+[x] toc - A table of contents+[x] tocback - An entry in a table of contents for a back matter component+[x] tocchap - An entry in a table of contents for a component in the body of+ a document+[x] tocentry - A component title in a table of contents+[x] tocfront - An entry in a table of contents for a front matter component+[x] toclevel1 - A top-level entry within a table of contents entry for a+ chapter-like component+[x] toclevel2 - A second-level entry within a table of contents entry for a+ chapter-like component+[x] toclevel3 - A third-level entry within a table of contents entry for a+ chapter-like component+[x] toclevel4 - A fourth-level entry within a table of contents entry for a+ chapter-like component+[x] toclevel5 - A fifth-level entry within a table of contents entry for a+ chapter-like component+[x] tocpart - An entry in a table of contents for a part of a book+[ ] token - A unit of information+[x] tr - A row in an HTML table+[ ] trademark - A trademark+[x] type - The classification of a value+[x] ulink - A link that addresses its target by means of a URL+ (Uniform Resource Locator)+[x] uri - A Uniform Resource Identifier+[x] userinput - Data entered by the user+[x] varargs - An empty element in a function synopsis indicating a variable+ number of arguments+[x] variablelist - A list in which each entry is composed of a set of one or+ more terms and an associated description+[x] varlistentry - A wrapper for a set of terms and the associated description+ in a variable list+[x] varname - The name of a variable+[ ] videodata - Pointer to external video data+[ ] videoobject - A wrapper for video data and its associated meta-information+[ ] void - An empty element in a function synopsis indicating that the+ function in question takes no arguments+[ ] volumenum - The volume number of a document in a set (as of books in a set+ or articles in a journal)+[x] warning - An admonition set off from the text+[x] wordasword - A word meant specifically as a word and not representing+ anything else+[x] xref - A cross reference to another part of the document+[ ] year - The year of publication of a document+[x] ?asciidoc-br? - line break from asciidoc docbook output+-}++type DB m = StateT DBState m++data DBState = DBState{ dbSectionLevel :: Int+ , dbQuoteType :: QuoteType+ , dbMeta :: Meta+ , dbBook :: Bool+ , dbContent :: [Content]+ , dbLiteralLayout :: Bool+ , dbElementStack :: [Text]+ } deriving Show++instance Default DBState where+ def = DBState{ dbSectionLevel = 0+ , dbQuoteType = DoubleQuote+ , dbMeta = mempty+ , dbBook = False+ , dbContent = []+ , dbLiteralLayout = False+ , dbElementStack = []+ }+++readDocBook :: (PandocMonad m, ToSources a)+ => ReaderOptions+ -> a+ -> m Pandoc+readDocBook _ inp = do+ let sources = toSources inp+ tree <- either (throwError . PandocXMLError "") return $+ parseXMLContentsWithEntities+ docbookEntityMap+ (TL.fromStrict . handleInstructions . sourcesToText $ sources)+ (bs, st') <- flip runStateT (def{ dbContent = tree }) $ mapM parseBlock tree+ let headerLevel (Header n _ _) = [n]+ headerLevel _ = []+ let bottomLevel = maybe 1 minimum $ nonEmpty $ query headerLevel bs+ return $+ -- handle the case where you have <part> or <chapter>+ (if bottomLevel < 1+ then headerShift (1 - bottomLevel)+ else id) $ Pandoc (dbMeta st') $ toList $ mconcat bs++-- We treat certain processing instructions by converting them to tags+-- beginning "pi-".+handleInstructions :: Text -> Text+handleInstructions t =+ let (x,y) = T.breakOn "<?" t+ in if T.null y+ then x+ else+ let (w,z) = T.breakOn "?>" y+ in (if T.takeWhile (\c -> isLetter c || c == '-')+ (T.drop 2 w) `elem` ["asciidoc-br", "dbfo"]+ then x <> "<pi-" <> T.drop 2 w <> "/>"+ else x <> w <> T.take 2 z) <>+ handleInstructions (T.drop 2 z)++getFigure :: PandocMonad m => Element -> DB m Blocks+getFigure e = do+ tit <- case filterChild (named "title") e of+ Just t -> getInlines t+ Nothing -> return mempty+ contents <- getBlocks e+ let contents' =+ case toList contents of+ [Para [img@Image{}]] -> plain (fromList [img])+ _ -> contents+ return $ figureWith+ (attrValue "id" e, [], [])+ (simpleCaption $ plain tit)+ contents'++-- convenience function to get an attribute value, defaulting to ""+attrValue :: Text -> Element -> Text+attrValue attr elt =+ fromMaybe "" (lookupAttrBy (\x -> qName x == attr) (elAttribs elt))++-- convenience function+named :: Text -> Element -> Bool+named s e = qName (elName e) == s++--++addMetadataFromElement :: PandocMonad m => Element -> DB m Blocks+addMetadataFromElement e = do+ -- Add metadata if at root or appropriate parent element+ elementStack <- gets dbElementStack+ if take 1 elementStack `elem` [[], ["book"], ["article"]]+ then mempty <$ mapM_ handleMetadataElement+ (filterChildren ((isMetadataField . qName . elName)) e)+ else return mempty+ where+ handleMetadataElement elt =+ case qName (elName elt) of+ "title" -> addContentsToMetadata "title" elt+ "subtitle" -> addContentsToMetadata "subtitle" elt+ "abstract" -> addContentsToMetadata "abstract" elt+ "date" -> addContentsToMetadata "date" elt+ "release" -> addContentsToMetadata "release" elt+ "releaseinfo" -> addContentsToMetadata "releaseinfo" elt+ "address" -> addContentsToMetadata "address" elt+ "copyright" -> addContentsToMetadata "copyright" elt+ "author" -> fromAuthor elt >>= addMeta "author"+ "authorgroup" ->+ mapM fromAuthor (filterChildren (named "author") elt) >>= addMeta "author"+ _ -> report . IgnoredElement . qName . elName $ elt++ fromAuthor elt =+ mconcat . intersperse space . filter (not . null)+ <$> mapM getInlines (elChildren elt)++ addContentsToMetadata fieldname elt =+ if any ((`Set.member` blockTags) . qName . elName) (elChildren elt)+ then getBlocks elt >>= addMeta fieldname+ else getInlines elt >>= addMeta fieldname++ isMetadataField "abstract" = True+ isMetadataField "address" = True+ isMetadataField "annotation" = True+ isMetadataField "artpagenums" = True+ isMetadataField "author" = True+ isMetadataField "authorgroup" = True+ isMetadataField "authorinitials" = True+ isMetadataField "bibliocoverage" = True+ isMetadataField "biblioid" = True+ isMetadataField "bibliomisc" = True+ isMetadataField "bibliomset" = True+ isMetadataField "bibliorelation" = True+ isMetadataField "biblioset" = True+ isMetadataField "bibliosource" = True+ isMetadataField "collab" = True+ isMetadataField "confgroup" = True+ isMetadataField "contractnum" = True+ isMetadataField "contractsponsor" = True+ isMetadataField "copyright" = True+ isMetadataField "cover" = True+ isMetadataField "date" = True+ isMetadataField "edition" = True+ isMetadataField "editor" = True+ isMetadataField "extendedlink" = True+ isMetadataField "issuenum" = True+ isMetadataField "itermset" = True+ isMetadataField "keywordset" = True+ isMetadataField "legalnotice" = True+ isMetadataField "mediaobject" = True+ isMetadataField "org" = True+ isMetadataField "orgname" = True+ isMetadataField "othercredit" = True+ isMetadataField "pagenums" = True+ isMetadataField "printhistory" = True+ isMetadataField "productname" = True+ isMetadataField "productnumber" = True+ isMetadataField "pubdate" = True+ isMetadataField "publisher" = True+ isMetadataField "publishername" = True+ isMetadataField "releaseinfo" = True+ isMetadataField "revhistory" = True+ isMetadataField "seriesvolnums" = True+ isMetadataField "subjectset" = True+ isMetadataField "subtitle" = True+ isMetadataField "title" = True+ isMetadataField "titleabbrev" = True+ isMetadataField "volumenum" = True+ isMetadataField _ = False+++addMeta :: PandocMonad m => ToMetaValue a => Text -> a -> DB m ()+addMeta field val = modify (setMeta field val)++instance HasMeta DBState where+ setMeta field v s = s {dbMeta = setMeta field v (dbMeta s)}+ deleteMeta field s = s {dbMeta = deleteMeta field (dbMeta s)}++isBlockElement :: Content -> Bool+isBlockElement (Elem e) = qName (elName e) `Set.member` blockTags+isBlockElement _ = False++blockTags :: Set.Set Text+blockTags = Set.fromList $+ [ "abstract"+ , "ackno"+ , "answer"+ , "appendix"+ , "appendixinfo"+ , "area"+ , "areaset"+ , "areaspec"+ , "article"+ , "articleinfo"+ , "attribution"+ , "authorinitials"+ , "biblioentry"+ , "bibliomisc"+ , "bibliomixed"+ , "blockquote"+ , "book"+ , "bookinfo"+ , "bridgehead"+ , "calloutlist"+ , "caption"+ , "chapter"+ , "chapterinfo"+ , "epigraph"+ , "example"+ , "figure"+ , "formalpara"+ , "glossary"+ , "glossaryinfo"+ , "glossdiv"+ , "glossee"+ , "glosseealso"+ , "glosslist"+ , "glosssee"+ , "glossseealso"+ , "index"+ , "info"+ , "informalexample"+ , "informalfigure"+ , "informaltable"+ , "itemizedlist"+ , "linegroup"+ , "literallayout"+ , "mediaobject"+ , "orderedlist"+ , "para"+ , "part"+ , "partinfo"+ , "preface"+ , "procedure"+ , "programlisting"+ , "question"+ , "refsect1info"+ , "refsect2info"+ , "refsect3info"+ , "refsectioninfo"+ , "screen"+ , "sect1info"+ , "sect2info"+ , "sect3info"+ , "sect4info"+ , "sect5info"+ , "sectioninfo"+ , "simpara"+ , "substeps"+ , "subtitle"+ , "table"+ , "title"+ , "titleabbrev"+ , "toc"+ , "variablelist"+ ] ++ sectionTags ++ admonitionTags++sectionTags :: [Text]+sectionTags = ["bibliography", "bibliodiv"+ , "sect1", "sect2", "sect3", "sect4", "sect5", "section", "simplesect"+ , "refsect1", "refsect2", "refsect3", "refsection", "qandadiv"+ ]++admonitionTags :: [Text]+admonitionTags = ["caution","danger","important","note","tip","warning"]++titledBlockElements :: [Text]+titledBlockElements = ["example", "formalpara", "sidebar"]++-- Trim leading and trailing newline characters+trimNl :: Text -> Text+trimNl = T.dropAround (== '\n')++-- meld text into beginning of first paragraph of Blocks.+-- assumes Blocks start with a Para; if not, does nothing.+addToStart :: Inlines -> Blocks -> Blocks+addToStart toadd bs =+ case toList bs of+ (Para xs : rest) -> para (toadd <> fromList xs) <> fromList rest+ _ -> bs++-- function that is used by both mediaobject (in parseBlock)+-- and inlinemediaobject (in parseInline)+-- A DocBook mediaobject is a wrapper around a set of alternative presentations+getMediaobject :: PandocMonad m => Element -> DB m Inlines+getMediaobject e = do+ let (imageUrl, tit, attr) =+ case filterElements (named "imageobject") e of+ [] -> (mempty, mempty, nullAttr)+ (z:_) ->+ let tit' = maybe "" strContent $+ filterChild (named "objectinfo") z >>=+ filterChild (named "title")+ (imageUrl', attr') =+ case filterChild (named "imagedata") z of+ Nothing -> (mempty, nullAttr)+ Just i -> let atVal a = attrValue a i+ w = case atVal "width" of+ "" -> []+ d -> [("width", d)]+ h = case atVal "depth" of+ "" -> []+ d -> [("height", d)]+ id' = atVal "id"+ cs = T.words $ atVal "role"+ atr = (id', cs, w ++ h)+ in (atVal "fileref", atr)+ in (imageUrl', tit', attr')+ let capt = case filterChild (\x -> named "caption" x+ || named "textobject" x+ || named "alt" x) e of+ Nothing -> return mempty+ Just z -> trimInlines . mconcat <$>+ mapM parseInline (elContent z)+ fmap (imageWith attr imageUrl tit) capt++getBlocks :: PandocMonad m => Element -> DB m Blocks+getBlocks e = do+ modify (\st -> st{ dbElementStack = qName (elName e) : dbElementStack st })+ blocks <- mconcat <$> mapM parseBlock (elContent e)+ modify (\st -> st{ dbElementStack = drop 1 $ dbElementStack st })+ return blocks++getRoleAttr :: Element -> [(Text, Text)] -- extract role attribute and add it to the attribute list+getRoleAttr e = case attrValue "role" e of+ "" -> []+ r -> [("role", r)]++parseBlock :: PandocMonad m => Content -> DB m Blocks+parseBlock (Text (CData CDataRaw _ _)) = return mempty -- DOCTYPE+parseBlock (Text (CData _ s _)) = if T.all isSpace s+ then return mempty+ else return $ plain $ trimInlines $ text s+parseBlock (CRef x) = return $ plain $ str $ T.toUpper x+parseBlock (Elem e) = do+ parsedBlock <- case qName (elName e) of+ "toc" -> skip -- skip TOC, since in pandoc it's autogenerated+ "index" -> skip -- skip index, since page numbers meaningless+ "para" -> parseMixed para (elContent e)+ "simpara" -> parseMixed para (elContent e)+ "ackno" -> parseMixed para (elContent e)+ "epigraph" -> parseBlockquote+ "blockquote" -> withOptionalTitle parseBlockquote+ "attribution" -> skip+ "titleabbrev" -> skip+ "authorinitials" -> skip+ "bibliography" -> sect 0+ "bibliodiv" ->+ case filterChild (named "title") e of+ Just _ -> sect 1+ Nothing -> return mempty+ "biblioentry" -> parseMixed para (elContent e)+ "bibliomisc" -> parseMixed para (elContent e)+ "bibliomixed" -> parseMixed para (elContent e)+ "equation" -> para <$> equation e displayMath+ "informalequation" -> divWith (attrValue "id" e,["informalequation"],[]) .+ para <$> equation e displayMath+ "glosssee" -> para . (\ils -> text "See " <> ils <> str ".")+ <$> getInlines e+ "glossseealso" -> para . (\ils -> text "See also " <> ils <> str ".")+ <$> getInlines e+ "glossary" -> sect 0+ "glossdiv" -> definitionList <$>+ mapM parseGlossEntry (filterChildren (named "glossentry") e)+ "glosslist" -> definitionList <$>+ mapM parseGlossEntry (filterChildren (named "glossentry") e)+ "chapter" -> modify (\st -> st{ dbBook = True}) >> sect 0+ "part" -> modify (\st -> st{ dbBook = True}) >> sect (-1)+ "appendix" -> sect 0+ "preface" -> sect 0+ "bridgehead" -> para . strong <$> getInlines e+ "sect1" -> sect 1+ "sect2" -> sect 2+ "sect3" -> sect 3+ "sect4" -> sect 4+ "sect5" -> sect 5+ "section" -> gets dbSectionLevel >>= sect . (+1)+ "simplesect" ->+ gets dbSectionLevel >>=+ sectWith(attrValue "id" e) ["unnumbered"] [] . (+1)+ "refsect1" -> sect 1+ "refsect2" -> sect 2+ "refsect3" -> sect 3+ "refsection" -> gets dbSectionLevel >>= sect . (+1)+ l | l `elem` titledBlockElements -> parseAdmonition False l+ l | l `elem` admonitionTags -> parseAdmonition True l+ "area" -> skip+ "areaset" -> skip+ "areaspec" -> skip+ "qandadiv" -> gets dbSectionLevel >>= sect . (+1)+ "question" -> addToStart (strong (str "Q:") <> str " ") <$> getBlocks e+ "answer" -> addToStart (strong (str "A:") <> str " ") <$> getBlocks e+ "abstract" -> blockQuote <$> getBlocks e+ "calloutlist" -> withOptionalTitle $ bulletList <$> callouts+ "itemizedlist" -> withOptionalTitle $+ bulletList . handleCompact <$> listitems+ "orderedlist" -> withOptionalTitle $ do+ let listStyle = case attrValue "numeration" e of+ "arabic" -> Decimal+ "loweralpha" -> LowerAlpha+ "upperalpha" -> UpperAlpha+ "lowerroman" -> LowerRoman+ "upperroman" -> UpperRoman+ _ -> Decimal+ let start = fromMaybe 1 $ safeRead $ attrValue "startingnumber" e+ orderedListWith (start,listStyle,DefaultDelim) . handleCompact+ <$> listitems+ "variablelist" -> definitionList <$> deflistitems+ "procedure" -> orderedList <$> steps+ "substeps" -> orderedList <$> steps+ "figure" -> getFigure e+ "informalfigure" -> getFigure e+ "mediaobject" -> para <$> getMediaobject e+ "caption" -> skip+ "info" -> addMetadataFromElement e+ "articleinfo" -> addMetadataFromElement e+ "sectioninfo" -> skip -- keywords & other metadata+ "refsectioninfo" -> skip -- keywords & other metadata+ "refsect1info" -> skip -- keywords & other metadata+ "refsect2info" -> skip -- keywords & other metadata+ "refsect3info" -> skip -- keywords & other metadata+ "sect1info" -> skip -- keywords & other metadata+ "sect2info" -> skip -- keywords & other metadata+ "sect3info" -> skip -- keywords & other metadata+ "sect4info" -> skip -- keywords & other metadata+ "sect5info" -> skip -- keywords & other metadata+ "chapterinfo" -> skip -- keywords & other metadata+ "partinfo" -> skip -- keywords & other metadata+ "glossaryinfo" -> skip -- keywords & other metadata+ "appendixinfo" -> skip -- keywords & other metadata+ "bookinfo" -> addMetadataFromElement e+ "article" -> modify (\st -> st{ dbBook = False }) >>+ addMetadataFromElement e >> getBlocks e+ "book" -> modify (\st -> st{ dbBook = True }) >>+ addMetadataFromElement e >> getBlocks e+ "table" -> parseTable+ "informaltable" -> parseTable+ "informalexample" -> divWith ("", ["informalexample"], []) <$>+ getBlocks e+ "linegroup" -> lineBlock <$> lineItems+ "literallayout" -> literalLayout+ "screen" -> codeBlockWithLang+ "programlisting" -> codeBlockWithLang+ "?xml" -> return mempty+ "title" -> return mempty -- handled in parent element+ "subtitle" -> return mempty -- handled in parent element+ _ -> skip >> getBlocks e+ if qName (elName e) `elem` sectionTags+ then return parsedBlock+ else return $ addPandocAttributes (getRoleAttr e) parsedBlock+ where skip = do+ let qn = qName $ elName e+ let name = if "pi-" `T.isPrefixOf` qn+ then "<?" <> qn <> "?>"+ else qn+ lift $ report $ IgnoredElement name+ return mempty+++ compactSpacing = case attrValue "spacing" e of+ "compact" -> True+ _ -> False++ handleCompact = if compactSpacing+ then map (fmap paraToPlain)+ else id++ literalLayout+ | "monospaced" `elem` (T.words (attrValue "class" e))+ = codeBlockWithLang+ | otherwise = do+ oldLiteralLayout <- gets dbLiteralLayout+ modify $ \st -> st{ dbLiteralLayout = True }+ content <- mconcat <$> mapM parseInline (elContent e)+ let ls = map fromList . splitWhen (== LineBreak) . toList $ content+ modify $ \st -> st{ dbLiteralLayout = oldLiteralLayout }+ return $ lineBlock ls++ codeBlockWithLang = do+ let classes' = case attrValue "language" e of+ "" -> []+ x -> [x]+ ++ ["numberLines" | attrValue "linenumbering" e == "numbered"]+ return $ codeBlockWith (attrValue "id" e, classes', [])+ $ trimNl $ strContentRecursive e+ parseBlockquote = do+ attrib <- case filterChild (named "attribution") e of+ Nothing -> return mempty+ Just z -> para . (str "— " <>) . mconcat+ <$>+ mapM parseInline (elContent z)+ contents <- getBlocks e+ return $ blockQuote (contents <> attrib)+ listitems = mapM getBlocks $ filterChildren (named "listitem") e+ callouts = mapM getBlocks $ filterChildren (named "callout") e+ deflistitems = mapM parseVarListEntry $ filterChildren+ (named "varlistentry") e+ steps = mapM getBlocks $ filterChildren (named "step") e+ parseVarListEntry e' = do+ let terms = filterChildren (named "term") e'+ let items = filterChildren (named "listitem") e'+ terms' <- mapM getInlines terms+ items' <- mapM getBlocks items+ return (mconcat $ intersperse (str "; ") terms', items')+ parseGlossEntry e' = do+ let terms = filterChildren (named "glossterm") e'+ let items = filterChildren (named "glossdef") e'+ terms' <- mapM getInlines terms+ items' <- mapM getBlocks items+ return (mconcat $ intersperse (str "; ") terms', items')+ parseTable = do+ let elId = attrValue "id" e+ let attrs = case attrValue "tabstyle" e of+ "" -> []+ x -> [("custom-style", x)]+ let classes = T.words $ attrValue "class" e+ let isCaption x = named "title" x || named "caption" x+ capt <- case filterChild isCaption e of+ Just t -> getInlines t+ Nothing -> return mempty+ let e' = fromMaybe e $ filterChild (named "tgroup") e+ let isColspec x = named "colspec" x || named "col" x+ let colspecs = case filterChild (named "colgroup") e' of+ Just c -> filterChildren isColspec c+ _ -> filterChildren isColspec e'+ let colnames = case colspecs of+ [] -> []+ cs -> mapMaybe (findAttr (unqual "colname" )) cs+ let isRow x = named "row" x || named "tr" x+ headrows <- case filterChild (named "thead") e' of+ Just h -> mapM (parseRow colnames)+ $ filterChildren isRow h+ Nothing -> return []+ bodyrows <- case filterChild (named "tbody") e' of+ Just b -> mapM (parseRow colnames)+ $ filterChildren isRow b+ Nothing -> mapM (parseRow colnames)+ $ filterChildren isRow e'+ let toWidth c = do+ w <- findAttr (unqual "colwidth") c+ n <- safeRead $ "0" <> T.filter (\x ->+ (x >= '0' && x <= '9')+ || x == '.') w+ if n > 0 then Just n else Nothing+ let numrows = maybe 0 maximum $ nonEmpty+ $ map length (bodyrows ++ headrows)+ let aligns = case colspecs of+ [] -> replicate numrows AlignDefault+ cs -> map toAlignment cs+ let parseWidth s = safeRead (T.filter (\x -> (x >= '0' && x <= '9')+ || x == '.') s)+ let textWidth = case filterChild (named "pi-dbfo") e of+ Just d -> case attrValue "table-width" d of+ "" -> 1.0+ w -> fromMaybe 100.0 (parseWidth w) / 100.0+ Nothing -> 1.0+ let widths = case colspecs of+ [] -> replicate numrows ColWidthDefault+ cs -> let ws = map toWidth cs+ in case sequence ws of+ Just ws' -> let colTot = sum ws'+ scale+ | textWidth == 1.0 = (/ colTot)+ | otherwise = (* (textWidth / colTot) )+ in ColWidth . scale <$> ws'+ Nothing -> replicate numrows ColWidthDefault+ let toRow = Row nullAttr+ return $ tableWith (elId,classes,attrs)+ (simpleCaption $ plain capt)+ (zip aligns widths)+ (TableHead nullAttr $ map toRow headrows)+ [TableBody nullAttr 0 [] $ map toRow bodyrows]+ (TableFoot nullAttr [])+ sect n = sectWith(attrValue "id" e) [] [] n+ sectWith elId classes attrs n = do+ isbook <- gets dbBook+ let n' = if isbook || n == 0 then n + 1 else n+ headerText <- case filterChild (named "title") e `mplus`+ (filterChild (named "info") e >>=+ filterChild (named "title")) of+ Just t -> getInlines t+ Nothing -> return mempty+ modify $ \st -> st{ dbSectionLevel = n }+ b <- getBlocks e+ modify $ \st -> st{ dbSectionLevel = n - 1 }+ let hdr = addPandocAttributes (getRoleAttr e)+ $ headerWith (elId, classes, maybeToList titleabbrevElAsAttr ++ attrs)+ n' headerText+ return $ hdr <> b+ titleabbrevElAsAttr =+ case filterChild (named "titleabbrev") e `mplus`+ (filterChild (named "info") e >>=+ filterChild (named "titleabbrev")) of+ Just t -> Just ("titleabbrev", strContentRecursive t)+ Nothing -> Nothing+ lineItems = mapM getInlines $ filterChildren (named "line") e++ -- <title> elements can be directly nested inside an admonition block, use+ -- it if it's there. It is unclear whether we should include the label in+ -- the title: docbook references are ambiguous on that, and some implementations of admonitions+ -- (e.g. asciidoctor) just use an icon in all cases. To be conservative, we don't+ -- include the label and leave it to styling.+ --+ getTitle = case filterChild (named "title") e of+ Just t -> Just <$> getInlines t+ Nothing -> return Nothing+ withOptionalTitle p = do+ mbt <- getTitle+ b <- p+ case mbt of+ Nothing -> return b+ Just t -> return $ divWith (attrValue "id" e, [], getRoleAttr e)+ (divWith ("", ["title"], []) (plain t) <> b)++ -- Admonitions are parsed into a div. Following other Docbook tools that output HTML,+ -- we parse the optional title as a div with the @title@ class, and give the+ -- block itself a class corresponding to the admonition name.+ parseAdmonition alwaysIncludeTitle label = do+ mbt <- getTitle+ -- this will ignore the title element if it is present:+ b <- getBlocks e+ let t = maybe mempty (divWith ("", ["title"], []) . plain)+ (case mbt of+ Nothing | alwaysIncludeTitle -> Just mempty+ _ -> mbt)+ -- we also attach the label as a class, so it can be styled properly+ return $ divWith (attrValue "id" e,[label],[]) (t <> b)++toAlignment :: Element -> Alignment+toAlignment c = case findAttr (unqual "align") c of+ Just "left" -> AlignLeft+ Just "right" -> AlignRight+ Just "center" -> AlignCenter+ _ -> AlignDefault+++parseMixed :: PandocMonad m => (Inlines -> Blocks) -> [Content] -> DB m Blocks+parseMixed container conts = do+ let (ils,rest) = break isBlockElement conts+ ils' <- trimInlines . mconcat <$> mapM parseInline ils+ let p = if ils' == mempty then mempty else container ils'+ case rest of+ [] -> return p+ (r:rs) -> do+ b <- parseBlock r+ x <- parseMixed container rs+ return $ p <> b <> x++parseRow :: PandocMonad m => [Text] -> Element -> DB m [Cell]+parseRow cn = do+ let isEntry x = named "entry" x || named "td" x || named "th" x+ mapM (parseEntry cn) . filterChildren isEntry++parseEntry :: PandocMonad m => [Text] -> Element -> DB m Cell+parseEntry cn el = do+ let colDistance sa ea = do+ let iStrt = elemIndex sa cn+ let iEnd = elemIndex ea cn+ case (iStrt, iEnd) of+ (Just start, Just end) -> ColSpan $ end - start + 1+ _ -> 1+ let toColSpan en = do+ let mStrt = findAttr (unqual "namest") en+ let mEnd = findAttr (unqual "nameend") en+ case (mStrt, mEnd) of+ (Just start, Just end) -> colDistance start end+ _ -> 1+ let rowDistance mr = do+ case readMaybe $ T.unpack mr :: Maybe Int of+ Just moreRow -> RowSpan $ moreRow + 1+ _ -> 1+ let toRowSpan en = do+ case findAttr (unqual "morerows") en of+ Just moreRow -> rowDistance moreRow+ _ -> 1+ let colSpan = toColSpan el+ let rowSpan = toRowSpan el+ let align = toAlignment el+ (fmap (cell align rowSpan colSpan) . parseMixed plain . elContent) el++getInlines :: PandocMonad m => Element -> DB m Inlines+getInlines e' = trimInlines . mconcat <$>+ mapM parseInline (elContent e')++strContentRecursive :: Element -> Text+strContentRecursive = strContent .+ (\e' -> e'{ elContent = map elementToStr $ elContent e' })++elementToStr :: Content -> Content+elementToStr (Elem e') = Text $ CData CDataText (strContentRecursive e') Nothing+elementToStr x = x++childElTextAsAttr :: Text -> Element -> Maybe (Text, Text)+childElTextAsAttr n e = case findChild q e of+ Nothing -> Nothing+ Just childEl -> Just (n, strContentRecursive childEl)+ where q = QName n (Just "http://docbook.org/ns/docbook") Nothing++attrValueAsOptionalAttr :: Text -> Element -> Maybe (Text, Text)+attrValueAsOptionalAttr n e = case attrValue n e of+ "" -> Nothing+ _ -> Just (n, attrValue n e)++parseInline :: PandocMonad m => Content -> DB m Inlines+parseInline (Text (CData _ s _)) = do+ literalLayout <- gets dbLiteralLayout+ if literalLayout+ then do+ let ls = T.splitOn "\n" s+ let toLiteralLine = str . T.map (\c -> if c == ' ' then '\xa0' else c)+ return $ mconcat $ intersperse linebreak $ map toLiteralLine ls+ else return $ text s+parseInline (CRef ref) =+ return $ text $ fromMaybe (T.toUpper ref) $ lookupEntity ref+parseInline (Elem e) = do+ parsedInline <- case qName (elName e) of+ "anchor" -> do+ return $ spanWith (attrValue "id" e, [], []) mempty+ "phrase" -> do+ let ident = attrValue "id" e+ let classes = T.words $ attrValue "role" e+ if ident /= "" || classes /= []+ then innerInlines (spanWith (ident,classes,[]))+ else innerInlines id+ "indexterm" -> do+ let ident = attrValue "id" e+ let classes = T.words $ attrValue "role" e+ let attrs =+ -- In DocBook, <primary>, <secondary>, <tertiary>, <see>, and <seealso>+ -- have mixed content models. However, because we're representing these+ -- elements in Pandoc's AST as attributes of a phrase, we flatten all+ -- the descendant content of these elements.+ [ childElTextAsAttr "primary" e+ , childElTextAsAttr "secondary" e+ , childElTextAsAttr "tertiary" e+ , childElTextAsAttr "see" e+ , childElTextAsAttr "seealso" e+ , attrValueAsOptionalAttr "significance" e+ , attrValueAsOptionalAttr "startref" e+ , attrValueAsOptionalAttr "scope" e+ , attrValueAsOptionalAttr "class" e+ -- We don't do anything with the "pagenum" attribute, because these only+ -- occur within literal <index> sections, which is not supported by Pandoc,+ -- because Pandoc has no concept of pages.+ ]+ return $ spanWith (ident, ("indexterm" : classes), (catMaybes attrs)) mempty+ "equation" -> equation e displayMath+ "informalequation" -> equation e displayMath+ "inlineequation" -> equation e math+ "subscript" -> innerInlines subscript+ "superscript" -> innerInlines superscript+ "inlinemediaobject" -> getMediaobject e+ "quote" -> do+ qt <- gets dbQuoteType+ let qt' = if qt == SingleQuote then DoubleQuote else SingleQuote+ modify $ \st -> st{ dbQuoteType = qt' }+ contents <- innerInlines id+ modify $ \st -> st{ dbQuoteType = qt }+ return $ if qt == SingleQuote+ then singleQuoted contents+ else doubleQuoted contents+ "simplelist" -> simpleList+ "segmentedlist" -> segmentedList+ "classname" -> codeWithLang+ "code" -> codeWithLang+ "citerefentry" -> do+ let title = maybe mempty strContent $ filterChild (named "refentrytitle") e+ let manvolnum = maybe mempty (\el -> "(" <> strContent el <> ")") $ filterChild (named "manvolnum") e+ return $ codeWith ("",["citerefentry"],[]) (title <> manvolnum)+ "filename" -> codeWithLang+ "envar" -> codeWithLang+ "literal" -> codeWithLang+ "computeroutput" -> codeWithLang+ "prompt" -> codeWithLang+ "parameter" -> codeWithLang+ "option" -> codeWithLang+ "optional" -> do x <- getInlines e+ return $ str "[" <> x <> str "]"+ "replaceable" -> do x <- getInlines e+ return $ str "<" <> x <> str ">"+ "markup" -> codeWithLang+ "wordasword" -> innerInlines emph+ "command" -> codeWithLang+ "varname" -> codeWithLang+ "function" -> codeWithLang+ "type" -> codeWithLang+ "symbol" -> codeWithLang+ "constant" -> codeWithLang+ "userinput" -> codeWithLang+ "systemitem" -> codeWithLang+ "varargs" -> return $ code "(...)"+ "keycap" -> return (str $ strContent e)+ "keycombo" -> keycombo <$>+ mapM parseInline (elContent e)+ "menuchoice" -> menuchoice <$>+ mapM parseInline (+ filter isGuiMenu $ elContent e)+ "xref" -> do+ content <- dbContent <$> get+ let linkend = attrValue "linkend" e+ let title = case attrValue "endterm" e of+ "" -> maybe "???" xrefTitleByElem+ (findElementById linkend content)+ endterm -> maybe "???" strContent+ (findElementById endterm content)+ return $ link ("#" <> linkend) "" (text title)+ "email" -> return $ link ("mailto:" <> strContent e) ""+ $ str $ strContent e+ "uri" -> return $ link (strContent e) "" $ str $ strContent e+ "ulink" -> innerInlines (link (attrValue "url" e) "")+ "link" -> do+ ils <- innerInlines id+ let href = case findAttrBy+ (\case+ QName "href" _ _ -> True+ _ -> False) e of+ Just h -> h+ _ -> "#" <> attrValue "linkend" e+ let ils' = if ils == mempty then str href else ils+ let attr = (attrValue "id" e, T.words $ attrValue "role" e, [])+ return $ linkWith attr href "" ils'+ "foreignphrase" -> innerInlines emph+ "emphasis" -> case attrValue "role" e of+ "bf" -> innerInlines strong+ "bold" -> innerInlines strong+ "strong" -> innerInlines strong+ "strikethrough" -> innerInlines strikeout+ "underline" -> innerInlines underline+ _ -> innerInlines emph+ "footnote" -> note . mconcat <$>+ mapM parseBlock (elContent e)+ "title" -> return mempty+ "affiliation" -> skip+ -- Note: this isn't a real docbook tag; it's what we convert+ -- <?asciidor-br?> to in handleInstructions, above.+ "pi-asciidoc-br" -> return linebreak+ _ -> skip >> innerInlines id+ return $ case qName (elName e) of+ "emphasis" -> parsedInline+ _ -> addPandocAttributes (getRoleAttr e) parsedInline+ where skip = do+ let qn = qName $ elName e+ let name = if "pi-" `T.isPrefixOf` qn+ then "<?" <> qn <> "?>"+ else qn+ lift $ report $ IgnoredElement name+ return mempty++ innerInlines f = f . mconcat <$> mapM parseInline (elContent e)+ codeWithLang = do+ let classes' = case attrValue "language" e of+ "" -> []+ l -> [l]+ return $ codeWith (attrValue "id" e,classes',[]) $+ T.unwords $ T.words $ strContentRecursive e+ -- collapse internal spaces/newlines, see #7821+ simpleList = mconcat . intersperse (str "," <> space) <$> mapM getInlines+ (filterChildren (named "member") e)+ segmentedList = do+ tit <- maybe (return mempty) getInlines $ filterChild (named "title") e+ segtits <- mapM getInlines $ filterChildren (named "segtitle") e+ segitems <- mapM (mapM getInlines . filterChildren (named "seg"))+ $ filterChildren (named "seglistitem") e+ let toSeg = mconcat . zipWith (\x y -> strong (x <> str ":") <> space <>+ y <> linebreak) segtits+ let segs = mconcat $ map toSeg segitems+ let tit' = if tit == mempty+ then mempty+ else strong tit <> linebreak+ return $ linebreak <> tit' <> segs+ keycombo = spanWith ("",["keycombo"],[]) .+ mconcat . intersperse (str "+")+ menuchoice = spanWith ("",["menuchoice"],[]) .+ mconcat . intersperse (text " > ")+ isGuiMenu (Elem x) = named "guimenu" x || named "guisubmenu" x ||+ named "guimenuitem" x+ isGuiMenu _ = False++ findElementById idString content+ = asum [filterElement (\x -> attrValue "id" x == idString) el | Elem el <- content]++ -- Use the 'xreflabel' attribute for getting the title of a xref link;+ -- if there's no such attribute, employ some heuristics based on what+ -- docbook-xsl does.+ xrefTitleByElem el+ | not (T.null xrefLabel) = xrefLabel+ | otherwise = case qName (elName el) of+ "book" -> descendantContent "title" el+ "part" -> descendantContent "title" el+ "chapter" -> descendantContent "title" el+ "section" -> descendantContent "title" el+ "sect1" -> descendantContent "title" el+ "sect2" -> descendantContent "title" el+ "sect3" -> descendantContent "title" el+ "sect4" -> descendantContent "title" el+ "sect5" -> descendantContent "title" el+ "cmdsynopsis" -> descendantContent "command" el+ "funcsynopsis" -> descendantContent "function" el+ "figure" -> descendantContent "title" el+ "table" -> descendantContent "title" el+ _ -> qName (elName el) <> "_title"+ where+ xrefLabel = attrValue "xreflabel" el+ descendantContent name = maybe "???" strContent+ . filterElementName (\n -> qName n == name)++-- | Extract a math equation from an element+--+-- asciidoc can generate Latex math in CDATA sections.+--+-- Note that if some MathML can't be parsed it is silently ignored!+equation+ :: Monad m+ => Element+ -- ^ The element from which to extract a mathematical equation+ -> (Text -> Inlines)+ -- ^ A constructor for some Inlines, taking the TeX code as input+ -> m Inlines+equation e constructor =+ return $ mconcat $ map constructor $ mathMLEquations <> latexEquations+ where+ mathMLEquations :: [Text]+ mathMLEquations = map writeTeX $ rights $ readMath+ (\x -> qName (elName x) == "math" &&+ qURI (elName x) == Just "http://www.w3.org/1998/Math/MathML")+ (readMathML . showElement)++ latexEquations :: [Text]+ latexEquations = readMath (\x -> qName (elName x) == "mathphrase")+ (T.concat . fmap showVerbatimCData . elContent)++ readMath :: (Element -> Bool) -> (Element -> b) -> [b]+ readMath childPredicate fromElement =+ map (fromElement . everywhere (mkT removePrefix))+ $ filterChildren childPredicate e++-- | Get the actual text stored in a CData block. 'showContent'+-- returns the text still surrounded by the [[CDATA]] tags.+showVerbatimCData :: Content -> Text+showVerbatimCData (Text (CData _ d _)) = d+showVerbatimCData c = showContent c+++-- | Set the prefix of a name to 'Nothing'+removePrefix :: QName -> QName+removePrefix elname = elname { qPrefix = Nothing }++paraToPlain :: Block -> Block+paraToPlain (Para ils) = Plain ils+paraToPlain x = x++docbookEntityMap :: M.Map Text Text+docbookEntityMap = M.fromList+ (map lineToPair (T.lines (decodeUtf8 docbookEntities)))+ where+ lineToPair l =+ case T.words l of+ (x:ys) -> (x, T.pack (mapMaybe readHex ys))+ [] -> ("","")+ readHex t = case TR.hexadecimal t of+ Left _ -> Nothing+ Right (n,_) -> Just (chr n)++docbookEntities :: ByteString+docbookEntities = $(embedFile "data/docbook-entities.txt")
@@ -1,568 +1,923 @@-{-# LANGUAGE PatternGuards, OverloadedStrings #-}--{--Copyright (C) 2014 Jesse Rosenthal <jrosenthal@jhu.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.Readers.Docx- Copyright : Copyright (C) 2014 Jesse Rosenthal- License : GNU GPL, version 2 or above-- Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>- Stability : alpha- Portability : portable--Conversion of Docx type (defined in Text.Pandoc.Readers.Docx.Parse)-to 'Pandoc' document. -}--{--Current state of implementation of Docx entities ([x] means-implemented, [-] means partially implemented):--* Blocks-- - [X] Para- - [X] CodeBlock (styled with `SourceCode`)- - [X] BlockQuote (styled with `Quote`, `BlockQuote`, or, optionally,- indented)- - [X] OrderedList- - [X] BulletList- - [X] DefinitionList (styled with adjacent `DefinitionTerm` and `Definition`)- - [X] Header (styled with `Heading#`)- - [ ] HorizontalRule- - [-] Table (column widths and alignments not yet implemented)--* Inlines-- - [X] Str- - [X] Emph (From italics. `underline` currently read as span. In- future, it might optionally be emph as well)- - [X] Strong- - [X] Strikeout- - [X] Superscript- - [X] Subscript- - [X] SmallCaps- - [ ] Quoted- - [ ] Cite- - [X] Code (styled with `VerbatimChar`)- - [X] Space- - [X] LineBreak (these are invisible in Word: entered with Shift-Return)- - [ ] Math- - [X] Link (links to an arbitrary bookmark create a span with the target as- id and "anchor" class)- - [-] Image (Links to path in archive. Future option for- data-encoded URI likely.)- - [X] Note (Footnotes and Endnotes are silently combined.)--}--module Text.Pandoc.Readers.Docx- ( readDocx- ) where--import Codec.Archive.Zip-import Text.Pandoc.Definition-import Text.Pandoc.Options-import Text.Pandoc.Builder-import Text.Pandoc.Walk-import Text.Pandoc.Readers.Docx.Parse-import Text.Pandoc.Readers.Docx.Lists-import Text.Pandoc.Readers.Docx.Reducible-import Text.Pandoc.Shared-import Text.Pandoc.MediaBag (insertMedia, MediaBag)-import Data.Maybe (isJust)-import Data.List (delete, stripPrefix, (\\), intersect)-import Data.Monoid-import Text.TeXMath (writeTeX)-import Data.Default (Default)-import qualified Data.ByteString.Lazy as B-import qualified Data.Map as M-import Control.Monad.Reader-import Control.Monad.State-import Control.Applicative ((<$>))-import Data.Sequence (ViewL(..), viewl)-import qualified Data.Sequence as Seq (null)--readDocx :: ReaderOptions- -> B.ByteString- -> (Pandoc, MediaBag)-readDocx opts bytes =- case archiveToDocx (toArchive bytes) of- Right docx -> (Pandoc meta blks, mediaBag) where- (meta, blks, mediaBag) = (docxToOutput opts docx)- Left _ -> error $ "couldn't parse docx file"--data DState = DState { docxAnchorMap :: M.Map String String- , docxMediaBag :: MediaBag- , docxDropCap :: Inlines- }--instance Default DState where- def = DState { docxAnchorMap = M.empty- , docxMediaBag = mempty- , docxDropCap = mempty- }--data DEnv = DEnv { docxOptions :: ReaderOptions- , docxInHeaderBlock :: Bool }--instance Default DEnv where- def = DEnv def False--type DocxContext = ReaderT DEnv (State DState)--evalDocxContext :: DocxContext a -> DEnv -> DState -> a-evalDocxContext ctx env st = evalState (runReaderT ctx env) st---- This is empty, but we put it in for future-proofing.-spansToKeep :: [String]-spansToKeep = []--divsToKeep :: [String]-divsToKeep = ["list-item", "Definition", "DefinitionTerm"]--metaStyles :: M.Map String String-metaStyles = M.fromList [ ("Title", "title")- , ("Subtitle", "subtitle")- , ("Author", "author")- , ("Date", "date")- , ("Abstract", "abstract")]--sepBodyParts :: [BodyPart] -> ([BodyPart], [BodyPart])-sepBodyParts = span (\bp -> (isMetaPar bp || isEmptyPar bp))--isMetaPar :: BodyPart -> Bool-isMetaPar (Paragraph pPr _) =- not $ null $ intersect (pStyle pPr) (M.keys metaStyles)-isMetaPar _ = False--isEmptyPar :: BodyPart -> Bool-isEmptyPar (Paragraph _ parParts) =- all isEmptyParPart parParts- where- isEmptyParPart (PlainRun (Run _ runElems)) = all isEmptyElem runElems- isEmptyParPart _ = False- isEmptyElem (TextRun s) = trim s == ""- isEmptyElem _ = True-isEmptyPar _ = False--bodyPartsToMeta' :: [BodyPart] -> DocxContext (M.Map String MetaValue)-bodyPartsToMeta' [] = return M.empty-bodyPartsToMeta' (bp : bps)- | (Paragraph pPr parParts) <- bp- , (c : _)<- intersect (pStyle pPr) (M.keys metaStyles)- , (Just metaField) <- M.lookup c metaStyles = do- inlines <- concatReduce <$> mapM parPartToInlines parParts- remaining <- bodyPartsToMeta' bps- let- f (MetaInlines ils) (MetaInlines ils') = MetaBlocks [Para ils, Para ils']- f (MetaInlines ils) (MetaBlocks blks) = MetaBlocks ((Para ils) : blks)- f m (MetaList mv) = MetaList (m : mv)- f m n = MetaList [m, n]- return $ M.insertWith f metaField (MetaInlines (toList inlines)) remaining-bodyPartsToMeta' (_ : bps) = bodyPartsToMeta' bps--bodyPartsToMeta :: [BodyPart] -> DocxContext Meta-bodyPartsToMeta bps = do- mp <- bodyPartsToMeta' bps- let mp' =- case M.lookup "author" mp of- Just mv -> M.insert "author" (fixAuthors mv) mp- Nothing -> mp- return $ Meta mp'--fixAuthors :: MetaValue -> MetaValue-fixAuthors (MetaBlocks blks) =- MetaList $ map g $ filter f blks- where f (Para _) = True- f _ = False- g (Para ils) = MetaInlines ils- g _ = MetaInlines []-fixAuthors mv = mv--codeStyles :: [String]-codeStyles = ["VerbatimChar"]--blockQuoteDivs :: [String]-blockQuoteDivs = ["Quote", "BlockQuote", "BlockQuotation"]--codeDivs :: [String]-codeDivs = ["SourceCode"]--runElemToInlines :: RunElem -> Inlines-runElemToInlines (TextRun s) = text s-runElemToInlines (LnBrk) = linebreak-runElemToInlines (Tab) = space--runElemToString :: RunElem -> String-runElemToString (TextRun s) = s-runElemToString (LnBrk) = ['\n']-runElemToString (Tab) = ['\t']--runToString :: Run -> String-runToString (Run _ runElems) = concatMap runElemToString runElems-runToString _ = ""--parPartToString :: ParPart -> String-parPartToString (PlainRun run) = runToString run-parPartToString (InternalHyperLink _ runs) = concatMap runToString runs-parPartToString (ExternalHyperLink _ runs) = concatMap runToString runs-parPartToString _ = ""--blacklistedCharStyles :: [String]-blacklistedCharStyles = ["Hyperlink"]--resolveDependentRunStyle :: RunStyle -> RunStyle-resolveDependentRunStyle rPr- | Just (s, _) <- rStyle rPr, s `elem` blacklistedCharStyles =- rPr- | Just (_, cs) <- rStyle rPr =- let rPr' = resolveDependentRunStyle cs- in- RunStyle { isBold = case isBold rPr of- Just bool -> Just bool- Nothing -> isBold rPr'- , isItalic = case isItalic rPr of- Just bool -> Just bool- Nothing -> isItalic rPr'- , isSmallCaps = case isSmallCaps rPr of- Just bool -> Just bool- Nothing -> isSmallCaps rPr'- , isStrike = case isStrike rPr of- Just bool -> Just bool- Nothing -> isStrike rPr'- , rVertAlign = case rVertAlign rPr of- Just valign -> Just valign- Nothing -> rVertAlign rPr'- , rUnderline = case rUnderline rPr of- Just ulstyle -> Just ulstyle- Nothing -> rUnderline rPr'- , rStyle = rStyle rPr }- | otherwise = rPr--runStyleToTransform :: RunStyle -> (Inlines -> Inlines)-runStyleToTransform rPr- | Just (s, _) <- rStyle rPr- , s `elem` spansToKeep =- let rPr' = rPr{rStyle = Nothing}- in- (spanWith ("", [s], [])) . (runStyleToTransform rPr')- | Just True <- isItalic rPr =- emph . (runStyleToTransform rPr {isItalic = Nothing})- | Just True <- isBold rPr =- strong . (runStyleToTransform rPr {isBold = Nothing})- | Just True <- isSmallCaps rPr =- smallcaps . (runStyleToTransform rPr {isSmallCaps = Nothing})- | Just True <- isStrike rPr =- strikeout . (runStyleToTransform rPr {isStrike = Nothing})- | Just SupScrpt <- rVertAlign rPr =- superscript . (runStyleToTransform rPr {rVertAlign = Nothing})- | Just SubScrpt <- rVertAlign rPr =- subscript . (runStyleToTransform rPr {rVertAlign = Nothing})- | Just "single" <- rUnderline rPr =- emph . (runStyleToTransform rPr {rUnderline = Nothing})- | otherwise = id--runToInlines :: Run -> DocxContext Inlines-runToInlines (Run rs runElems)- | Just (s, _) <- rStyle rs- , s `elem` codeStyles =- return $ code $ concatMap runElemToString runElems- | otherwise = do- let ils = concatReduce (map runElemToInlines runElems)- return $ (runStyleToTransform $ resolveDependentRunStyle rs) ils-runToInlines (Footnote bps) = do- blksList <- concatReduce <$> (mapM bodyPartToBlocks bps)- return $ note blksList-runToInlines (Endnote bps) = do- blksList <- concatReduce <$> (mapM bodyPartToBlocks bps)- return $ note blksList-runToInlines (InlineDrawing fp bs) = do- mediaBag <- gets docxMediaBag- modify $ \s -> s { docxMediaBag = insertMedia fp Nothing bs mediaBag }- return $ image fp "" ""--parPartToInlines :: ParPart -> DocxContext Inlines-parPartToInlines (PlainRun r) = runToInlines r-parPartToInlines (Insertion _ author date runs) = do- opts <- asks docxOptions- case readerTrackChanges opts of- AcceptChanges -> concatReduce <$> mapM runToInlines runs- RejectChanges -> return mempty- AllChanges -> do- ils <- concatReduce <$> mapM runToInlines runs- let attr = ("", ["insertion"], [("author", author), ("date", date)])- return $ spanWith attr ils-parPartToInlines (Deletion _ author date runs) = do- opts <- asks docxOptions- case readerTrackChanges opts of- AcceptChanges -> return mempty- RejectChanges -> concatReduce <$> mapM runToInlines runs- AllChanges -> do- ils <- concatReduce <$> mapM runToInlines runs- let attr = ("", ["deletion"], [("author", author), ("date", date)])- return $ spanWith attr ils-parPartToInlines (BookMark _ anchor) | anchor `elem` dummyAnchors =- return mempty-parPartToInlines (BookMark _ anchor) =- -- We record these, so we can make sure not to overwrite- -- user-defined anchor links with header auto ids.- do- -- get whether we're in a header.- inHdrBool <- asks docxInHeaderBlock- -- Get the anchor map.- anchorMap <- gets docxAnchorMap- -- We don't want to rewrite if we're in a header, since we'll take- -- care of that later, when we make the header anchor. If the- -- bookmark were already in uniqueIdent form, this would lead to a- -- duplication. Otherwise, we check to see if the id is already in- -- there. Rewrite if necessary. This will have the possible effect- -- of rewriting user-defined anchor links. However, since these- -- are not defined in pandoc, it seems like a necessary evil to- -- avoid an extra pass.- let newAnchor =- if not inHdrBool && anchor `elem` (M.elems anchorMap)- then uniqueIdent [Str anchor] (M.elems anchorMap)- else anchor- unless inHdrBool- (modify $ \s -> s { docxAnchorMap = M.insert anchor newAnchor anchorMap})- return $ spanWith (newAnchor, ["anchor"], []) mempty-parPartToInlines (Drawing fp bs) = do- mediaBag <- gets docxMediaBag- modify $ \s -> s { docxMediaBag = insertMedia fp Nothing bs mediaBag }- return $ image fp "" ""-parPartToInlines (InternalHyperLink anchor runs) = do- ils <- concatReduce <$> mapM runToInlines runs- return $ link ('#' : anchor) "" ils-parPartToInlines (ExternalHyperLink target runs) = do- ils <- concatReduce <$> mapM runToInlines runs- return $ link target "" ils-parPartToInlines (PlainOMath exps) = do- return $ math $ writeTeX exps--isAnchorSpan :: Inline -> Bool-isAnchorSpan (Span (_, classes, kvs) ils) =- classes == ["anchor"] &&- null kvs &&- null ils-isAnchorSpan _ = False--dummyAnchors :: [String]-dummyAnchors = ["_GoBack"]--makeHeaderAnchor :: Blocks -> DocxContext Blocks-makeHeaderAnchor bs = case viewl $ unMany bs of- (x :< xs) -> do- x' <- (makeHeaderAnchor' x)- xs' <- (makeHeaderAnchor $ Many xs)- return $ (singleton x') <> xs'- EmptyL -> return mempty--makeHeaderAnchor' :: Block -> DocxContext Block--- If there is an anchor already there (an anchor span in the header,--- to be exact), we rename and associate the new id with the old one.-makeHeaderAnchor' (Header n (_, classes, kvs) ils)- | (c:cs) <- filter isAnchorSpan ils- , (Span (ident, ["anchor"], _) _) <- c = do- hdrIDMap <- gets docxAnchorMap- let newIdent = uniqueIdent ils (M.elems hdrIDMap)- modify $ \s -> s {docxAnchorMap = M.insert ident newIdent hdrIDMap}- return $ Header n (newIdent, classes, kvs) (ils \\ (c:cs))--- Otherwise we just give it a name, and register that name (associate--- it with itself.)-makeHeaderAnchor' (Header n (_, classes, kvs) ils) =- do- hdrIDMap <- gets docxAnchorMap- let newIdent = uniqueIdent ils (M.elems hdrIDMap)- modify $ \s -> s {docxAnchorMap = M.insert newIdent newIdent hdrIDMap}- return $ Header n (newIdent, classes, kvs) ils-makeHeaderAnchor' blk = return blk---- Rewrite a standalone paragraph block as a plain-singleParaToPlain :: Blocks -> Blocks-singleParaToPlain blks- | (Para (ils) :< seeq) <- viewl $ unMany blks- , Seq.null seeq =- singleton $ Plain ils-singleParaToPlain blks = blks--cellToBlocks :: Cell -> DocxContext Blocks-cellToBlocks (Cell bps) = concatReduce <$> mapM bodyPartToBlocks bps--rowToBlocksList :: Row -> DocxContext [Blocks]-rowToBlocksList (Row cells) = do- blksList <- mapM cellToBlocks cells- return $ map singleParaToPlain blksList--trimLineBreaks :: [Inline] -> [Inline]-trimLineBreaks [] = []-trimLineBreaks (LineBreak : ils) = trimLineBreaks ils-trimLineBreaks ils- | (LineBreak : ils') <- reverse ils = trimLineBreaks (reverse ils')-trimLineBreaks ils = ils--parStyleToTransform :: ParagraphStyle -> (Blocks -> Blocks)-parStyleToTransform pPr- | (c:cs) <- pStyle pPr- , c `elem` divsToKeep =- let pPr' = pPr { pStyle = cs }- in- (divWith ("", [c], [])) . (parStyleToTransform pPr')- | (c:cs) <- pStyle pPr,- c `elem` listParagraphDivs =- let pPr' = pPr { pStyle = cs, indentation = Nothing}- in- (divWith ("", [c], [])) . (parStyleToTransform pPr')- | (c:cs) <- pStyle pPr- , c `elem` blockQuoteDivs =- let pPr' = pPr { pStyle = cs \\ blockQuoteDivs }- in- blockQuote . (parStyleToTransform pPr')- | (_:cs) <- pStyle pPr =- let pPr' = pPr { pStyle = cs}- in- parStyleToTransform pPr'- | null (pStyle pPr)- , Just left <- indentation pPr >>= leftParIndent- , Just hang <- indentation pPr >>= hangingParIndent =- let pPr' = pPr { indentation = Nothing }- in- case (left - hang) > 0 of- True -> blockQuote . (parStyleToTransform pPr')- False -> parStyleToTransform pPr'- | null (pStyle pPr),- Just left <- indentation pPr >>= leftParIndent =- let pPr' = pPr { indentation = Nothing }- in- case left > 0 of- True -> blockQuote . (parStyleToTransform pPr')- False -> parStyleToTransform pPr'-parStyleToTransform _ = id--bodyPartToBlocks :: BodyPart -> DocxContext Blocks-bodyPartToBlocks (Paragraph pPr parparts)- | not $ null $ codeDivs `intersect` (pStyle pPr) =- return- $ parStyleToTransform pPr- $ codeBlock- $ concatMap parPartToString parparts- | (c : cs) <- filter (isJust . isHeaderClass) $ pStyle pPr- , Just n <- isHeaderClass c = do- ils <- local (\s-> s{docxInHeaderBlock=True}) $- (concatReduce <$> mapM parPartToInlines parparts)-- makeHeaderAnchor $- headerWith ("", delete ("Heading" ++ show n) cs, []) n ils- | otherwise = do- ils <- concatReduce <$> mapM parPartToInlines parparts >>=- (return . fromList . trimLineBreaks . normalizeSpaces . toList)- dropIls <- gets docxDropCap- let ils' = dropIls <> ils- if dropCap pPr- then do modify $ \s -> s { docxDropCap = ils' }- return mempty- else do modify $ \s -> s { docxDropCap = mempty }- return $ case isNull ils' of- True -> mempty- _ -> parStyleToTransform pPr $ para ils'-bodyPartToBlocks (ListItem pPr numId lvl levelInfo parparts) = do- let- kvs = case levelInfo of- (_, fmt, txt, Just start) -> [ ("level", lvl)- , ("num-id", numId)- , ("format", fmt)- , ("text", txt)- , ("start", (show start))- ]-- (_, fmt, txt, Nothing) -> [ ("level", lvl)- , ("num-id", numId)- , ("format", fmt)- , ("text", txt)- ]- blks <- bodyPartToBlocks (Paragraph pPr parparts)- return $ divWith ("", ["list-item"], kvs) blks-bodyPartToBlocks (Tbl _ _ _ []) =- return $ para mempty-bodyPartToBlocks (Tbl cap _ look (r:rs)) = do- let caption = text cap- (hdr, rows) = case firstRowFormatting look of- True -> (Just r, rs)- False -> (Nothing, r:rs)- hdrCells <- case hdr of- Just r' -> rowToBlocksList r'- Nothing -> return []-- cells <- mapM rowToBlocksList rows-- let size = case null hdrCells of- True -> length $ head cells- False -> length $ hdrCells- --- -- The two following variables (horizontal column alignment and- -- relative column widths) go to the default at the- -- moment. Width information is in the TblGrid field of the Tbl,- -- so should be possible. Alignment might be more difficult,- -- since there doesn't seem to be a column entity in docx.- alignments = replicate size AlignDefault- widths = replicate size 0 :: [Double]-- return $ table caption (zip alignments widths) hdrCells cells-bodyPartToBlocks (OMathPara e) = do- return $ para $ displayMath (writeTeX e)----- replace targets with generated anchors.-rewriteLink' :: Inline -> DocxContext Inline-rewriteLink' l@(Link ils ('#':target, title)) = do- anchorMap <- gets docxAnchorMap- return $ case M.lookup target anchorMap of- Just newTarget -> (Link ils ('#':newTarget, title))- Nothing -> l-rewriteLink' il = return il--rewriteLink :: Blocks -> DocxContext Blocks-rewriteLink ils = case viewl $ unMany ils of- (x :< xs) -> do- x' <- walkM rewriteLink' x- xs' <- rewriteLink $ Many xs- return $ (singleton x') <> xs'- EmptyL -> return ils--bodyToOutput :: Body -> DocxContext (Meta, [Block], MediaBag)-bodyToOutput (Body bps) = do- let (metabps, blkbps) = sepBodyParts bps- meta <- bodyPartsToMeta metabps- blks <- concatReduce <$> mapM bodyPartToBlocks blkbps- blks' <- rewriteLink blks- mediaBag <- gets docxMediaBag- return $ (meta,- blocksToDefinitions $ blocksToBullets $ toList blks',- mediaBag)--docxToOutput :: ReaderOptions -> Docx -> (Meta, [Block], MediaBag)-docxToOutput opts (Docx (Document _ body)) =- let dEnv = def { docxOptions = opts} in- evalDocxContext (bodyToOutput body) dEnv def--isHeaderClass :: String -> Maybe Int-isHeaderClass s | Just s' <- stripPrefix "Heading" s =- case reads s' :: [(Int, String)] of- [] -> Nothing- ((n, "") : []) -> Just n- _ -> Nothing-isHeaderClass _ = Nothing+{-# LANGUAGE CPP #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE ViewPatterns #-}+{- |+ Module : Text.Pandoc.Readers.Docx+ Copyright : Copyright (C) 2014-2020 Jesse Rosenthal+ License : GNU GPL, version 2 or above++ Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>+ Stability : alpha+ Portability : portable++Conversion of Docx type (defined in Text.Pandoc.Readers.Docx.Parse)+to 'Pandoc' document. -}++{-+Current state of implementation of Docx entities ([x] means+implemented, [-] means partially implemented):++* Blocks++ - [X] Para+ - [X] CodeBlock (styled with `SourceCode`)+ - [X] BlockQuote (styled with `Quote`, `BlockQuote`, `Intense Quote` or, optionally,+ indented)+ - [X] OrderedList+ - [X] BulletList+ - [X] DefinitionList (styled with adjacent `DefinitionTerm` and `Definition`)+ - [X] Header (styled with `Heading#`)+ - [ ] HorizontalRule+ - [-] Table (column widths and alignments not yet implemented)++* Inlines++ - [X] Str+ - [X] Emph+ - [X] Strong+ - [X] Strikeout+ - [X] Superscript+ - [X] Subscript+ - [X] SmallCaps+ - [-] Underline (was previously converted to Emph)+ - [ ] Quoted+ - [ ] Cite+ - [X] Code (styled with `VerbatimChar`)+ - [X] Space+ - [X] LineBreak (these are invisible in Word: entered with Shift-Return)+ - [X] Math+ - [X] Link (links to an arbitrary bookmark create a span with the target as+ id and "anchor" class)+ - [X] Image+ - [X] Note (Footnotes and Endnotes are silently combined.)+-}++module Text.Pandoc.Readers.Docx+ ( readDocx+ ) where++import Codec.Archive.Zip+import Control.Monad ( liftM, unless )+import Control.Monad.Reader+ ( asks,+ MonadReader(local),+ MonadTrans(lift),+ ReaderT(runReaderT) )+import Control.Monad.State.Strict+ ( StateT,+ gets,+ modify,+ evalStateT )+import Data.Bifunctor (bimap, first)+import qualified Data.ByteString.Lazy as B+import Data.Default (Default)+import Data.List (delete, intersect)+import qualified Data.List as L+import Data.Char (isSpace)+import qualified Data.Map as M+import qualified Data.Text as T+import Data.Maybe (isJust, fromMaybe, mapMaybe)+import Data.Sequence (ViewL (..), viewl)+import qualified Data.Sequence as Seq+import qualified Data.Set as Set+import Citeproc (ItemId(..), Val(TextVal,FancyVal), Reference(..), CitationItem(..))+import qualified Citeproc+import Text.Pandoc.Builder as Pandoc+import Text.Pandoc.MediaBag (MediaBag)+import Text.Pandoc.Options+import Text.Pandoc.Readers.Docx.Combine+import Text.Pandoc.Readers.Docx.Lists+import Text.Pandoc.Readers.Docx.Parse as Docx+import Text.Pandoc.Shared+import Text.Pandoc.Walk+import Text.TeXMath (writeTeX)+import Control.Monad.Except (throwError, catchError)+import Text.Pandoc.Class.PandocMonad (PandocMonad)+import qualified Text.Pandoc.Class.PandocMonad as P+import Text.Pandoc.Error+import Text.Pandoc.Logging+import Data.List.NonEmpty (nonEmpty)+import Data.Aeson (eitherDecode)+import qualified Data.Text.Lazy as TL+import Text.Pandoc.UTF8 (fromTextLazy)+import Text.Pandoc.Citeproc.MetaValue (referenceToMetaValue)+import Text.Pandoc.Readers.EndNote (readEndNoteXMLCitation)++readDocx :: PandocMonad m+ => ReaderOptions+ -> B.ByteString+ -> m Pandoc+readDocx opts bytes =+ case toArchiveOrFail bytes of+ Right archive ->+ case archiveToDocxWithWarnings archive of+ Right (docx, parserWarnings) -> do+ mapM_ (P.report . DocxParserWarning) parserWarnings+ (meta, blks) <- docxToOutput opts docx+ return $ Pandoc meta blks+ Left docxerr -> throwError $ PandocSomeError $+ "couldn't parse docx file: " <> T.pack (show docxerr)+ Left err -> throwError $ PandocSomeError $+ "couldn't unpack docx container: " <> T.pack err++data DState = DState { docxAnchorMap :: M.Map T.Text T.Text+ , docxAnchorSet :: Set.Set T.Text+ , docxImmedPrevAnchor :: Maybe T.Text+ , docxMediaBag :: MediaBag+ , docxNumberedHeadings :: Bool+ , docxDropCap :: Inlines+ -- keep track of (numId, lvl) values for+ -- restarting+ , docxListState :: M.Map (T.Text, T.Text) Integer+ , docxPrevPara :: Inlines+ , docxReferences :: M.Map ItemId (Reference Inlines)+ }++instance Default DState where+ def = DState { docxAnchorMap = M.empty+ , docxAnchorSet = mempty+ , docxImmedPrevAnchor = Nothing+ , docxMediaBag = mempty+ , docxNumberedHeadings = False+ , docxDropCap = mempty+ , docxListState = M.empty+ , docxPrevPara = mempty+ , docxReferences = mempty+ }++data DEnv = DEnv { docxOptions :: ReaderOptions+ , docxInHeaderBlock :: Bool+ , docxInBidi :: Bool+ }++instance Default DEnv where+ def = DEnv def False False++type DocxContext m = ReaderT DEnv (StateT DState m)++evalDocxContext :: PandocMonad m => DocxContext m a -> DEnv -> DState -> m a+evalDocxContext ctx env st = flip evalStateT st $ runReaderT ctx env++-- This is empty, but we put it in for future-proofing.+spansToKeep :: [CharStyleName]+spansToKeep = []++divsToKeep :: [ParaStyleName]+divsToKeep = ["Definition", "Definition Term"]++metaStyles :: M.Map ParaStyleName T.Text+metaStyles = M.fromList [ ("Title", "title")+ , ("Subtitle", "subtitle")+ , ("Author", "author")+ , ("Date", "date")+ , ("Abstract", "abstract")]++sepBodyParts :: [BodyPart] -> ([BodyPart], [BodyPart])+sepBodyParts = span (\bp -> isMetaPar bp || isEmptyPar bp)++isMetaPar :: BodyPart -> Bool+isMetaPar (Paragraph pPr _) =+ not $ null $ intersect (getStyleNames $ pStyle pPr) (M.keys metaStyles)+isMetaPar _ = False++isEmptyPar :: BodyPart -> Bool+isEmptyPar (Paragraph _ parParts) =+ all isEmptyParPart parParts+ where+ isEmptyParPart (PlainRun (Run _ runElems)) = all isEmptyElem runElems+ isEmptyParPart _ = False+ isEmptyElem (TextRun s) = trim s == ""+ isEmptyElem _ = True+isEmptyPar _ = False++bodyPartsToMeta' :: PandocMonad m => [BodyPart] -> DocxContext m (M.Map T.Text MetaValue)+bodyPartsToMeta' [] = return M.empty+bodyPartsToMeta' (bp : bps)+ | (Paragraph pPr parParts) <- bp+ , (c : _)<- getStyleNames (pStyle pPr) `intersect` M.keys metaStyles+ , (Just metaField) <- M.lookup c metaStyles = do+ inlines <- smushInlines <$> mapM parPartToInlines parParts+ remaining <- bodyPartsToMeta' bps+ let+ -- for titles, we just take the first one and ignore the rest, #10359:+ f _ x | metaField == "title" || metaField == "subtitle" = x+ f (MetaInlines ils) (MetaInlines ils') = MetaBlocks [Para ils, Para ils']+ f (MetaInlines ils) (MetaBlocks blks) = MetaBlocks (Para ils : blks)+ f m (MetaList mv) = MetaList (m : mv)+ f m n = MetaList [m, n]+ return $ M.insertWith f metaField (MetaInlines (toList inlines)) remaining+bodyPartsToMeta' (_ : bps) = bodyPartsToMeta' bps++bodyPartsToMeta :: PandocMonad m => [BodyPart] -> DocxContext m Meta+bodyPartsToMeta bps = do+ mp <- bodyPartsToMeta' bps+ let mp' =+ case M.lookup "author" mp of+ Just mv -> M.insert "author" (fixAuthors mv) mp+ Nothing -> mp+ return $ Meta mp'++fixAuthors :: MetaValue -> MetaValue+fixAuthors (MetaBlocks blks) = MetaList [MetaInlines ils | Para ils <- blks]+fixAuthors mv = mv++isInheritedFromStyles :: (Eq (StyleName s), HasStyleName s, HasParentStyle s) => [StyleName s] -> s -> Bool+isInheritedFromStyles names sty+ | getStyleName sty `elem` names = True+ | Just psty <- getParentStyle sty = isInheritedFromStyles names psty+ | otherwise = False++hasStylesInheritedFrom :: [ParaStyleName] -> ParagraphStyle -> Bool+hasStylesInheritedFrom ns s = any (isInheritedFromStyles ns) $ pStyle s++removeStyleNamed :: ParaStyleName -> ParagraphStyle -> ParagraphStyle+removeStyleNamed sn ps = ps{pStyle = filter (\psd -> getStyleName psd /= sn) $ pStyle ps}++isCodeCharStyle :: CharStyle -> Bool+isCodeCharStyle = isInheritedFromStyles ["Verbatim Char"]++isCodeDiv :: ParagraphStyle -> Bool+isCodeDiv = hasStylesInheritedFrom ["Source Code", "SourceCode", "source_code"]++isBlockQuote :: ParStyle -> Bool+isBlockQuote =+ isInheritedFromStyles [+ "Quote", "Block Text", "Block Quote", "Block Quotation", "Intense Quote"+ ]++runElemToInlines :: RunElem -> Inlines+runElemToInlines (TextRun s) = text s+runElemToInlines LnBrk = linebreak+runElemToInlines Tab = space+runElemToInlines SoftHyphen = text "\xad"+runElemToInlines NoBreakHyphen = text "\x2011"++runElemToText :: RunElem -> T.Text+runElemToText (TextRun s) = s+runElemToText LnBrk = T.singleton '\n'+runElemToText Tab = T.singleton '\t'+runElemToText SoftHyphen = T.singleton '\xad'+runElemToText NoBreakHyphen = T.singleton '\x2011'++runToText :: Run -> T.Text+runToText (Run _ runElems) = T.concat $ map runElemToText runElems+runToText _ = ""++parPartToText :: ParPart -> T.Text+parPartToText (PlainRun run) = runToText run+parPartToText (InternalHyperLink _ children) = T.concat $ map parPartToText children+parPartToText (ExternalHyperLink _ children) = T.concat $ map parPartToText children+parPartToText _ = ""++blacklistedCharStyles :: [CharStyleName]+blacklistedCharStyles = ["Hyperlink"]++resolveDependentRunStyle :: PandocMonad m => RunStyle -> DocxContext m RunStyle+resolveDependentRunStyle rPr+ | Just s <- rParentStyle rPr+ , getStyleName s `notElem` blacklistedCharStyles = do+ opts <- asks docxOptions+ if isEnabled Ext_styles opts+ then return rPr+ else leftBiasedMergeRunStyle rPr <$> resolveDependentRunStyle (cStyleData s)+ | otherwise = return rPr++runStyleToTransform :: PandocMonad m => RunStyle -> DocxContext m (Inlines -> Inlines)+runStyleToTransform rPr' = do+ opts <- asks docxOptions+ inBidi <- asks docxInBidi+ let styles = isEnabled Ext_styles opts+ ctl = (Just True == isRTL rPr') || (Just True == isForceCTL rPr')+ italic rPr | ctl = isItalicCTL rPr+ | otherwise = isItalic rPr+ bold rPr | ctl = isBoldCTL rPr+ | otherwise = isBold rPr+ go rPr+ | Just sn <- getStyleName <$> rParentStyle rPr+ , sn `elem` spansToKeep =+ spanWith ("", [normalizeToClassName sn], [])+ . go rPr{rParentStyle = Nothing}+ | styles, Just s <- rParentStyle rPr =+ spanWith (extraAttr s) . go rPr{rParentStyle = Nothing}+ | Just True <- italic rPr =+ emph . go rPr{isItalic = Nothing, isItalicCTL = Nothing}+ | Just True <- bold rPr =+ strong . go rPr{isBold = Nothing, isBoldCTL = Nothing}+ | Just v <- rHighlight rPr+ , v /= "none" =+ spanWith ("",["mark"],[]) . go rPr{rHighlight = Nothing}+ | Just True <- isSmallCaps rPr =+ smallcaps . go rPr{isSmallCaps = Nothing}+ | Just True <- isStrike rPr =+ strikeout . go rPr{isStrike = Nothing}+ | Just True <- isRTL rPr =+ spanWith ("",[],[("dir","rtl")]) . go rPr{isRTL = Nothing}+ | inBidi, Just False <- isRTL rPr =+ spanWith ("",[],[("dir","ltr")]) . go rPr{isRTL = Nothing}+ | Just SupScrpt <- rVertAlign rPr =+ superscript . go rPr{rVertAlign = Nothing}+ | Just SubScrpt <- rVertAlign rPr =+ subscript . go rPr{rVertAlign = Nothing}+ | Just "single" <- rUnderline rPr =+ Pandoc.underline . go rPr{rUnderline = Nothing}+ | otherwise = id+ return $ go rPr'+++runToInlines :: PandocMonad m => Run -> DocxContext m Inlines+runToInlines (Run rs runElems)+ | maybe False isCodeCharStyle $ rParentStyle rs = do+ rPr <- resolveDependentRunStyle rs+ let codeString = code $ T.concat $ map runElemToText runElems+ return $ case rVertAlign rPr of+ Just SupScrpt -> superscript codeString+ Just SubScrpt -> subscript codeString+ _ -> codeString+ | otherwise = do+ rPr <- resolveDependentRunStyle rs+ let ils = smushInlines (map runElemToInlines runElems)+ transform <- runStyleToTransform rPr+ return $ transform ils+runToInlines (Footnote bps) = note . smushBlocks <$> mapM bodyPartToBlocks bps+runToInlines (Endnote bps) = note . smushBlocks <$> mapM bodyPartToBlocks bps+runToInlines (InlineDrawing fp title alt bs ext) = do+ (lift . lift) $ P.insertMedia fp Nothing bs+ return $ imageWith (extentToAttr ext) (T.pack fp) title $ text alt+runToInlines InlineChart = return $ spanWith ("", ["chart"], []) $ text "[CHART]"+runToInlines InlineDiagram = return $ spanWith ("", ["diagram"], []) $ text "[DIAGRAM]"++extentToAttr :: Extent -> Attr+extentToAttr (Just (w, h)) =+ ("", [], [("width", showDim w), ("height", showDim h)] )+ where+ showDim d = tshow (d / 914400) <> "in"+extentToAttr _ = nullAttr++blocksToInlinesWarn :: PandocMonad m => T.Text -> Blocks -> DocxContext m Inlines+blocksToInlinesWarn cmtId blks = do+ let paraOrPlain :: Block -> Bool+ paraOrPlain (Para _) = True+ paraOrPlain (Plain _) = True+ paraOrPlain (Div _ nested) = all paraOrPlain nested+ paraOrPlain _ = False+ unless (all paraOrPlain blks) $+ lift $ P.report $ DocxParserWarning $+ "Docx comment " <> cmtId <> " will not retain formatting"+ return $ blocksToInlines' (toList blks)++-- The majority of work in this function is done in the primed+-- subfunction `partPartToInlines'`. We make this wrapper so that we+-- don't have to modify `docxImmedPrevAnchor` state after every function.+parPartToInlines :: PandocMonad m => ParPart -> DocxContext m Inlines+parPartToInlines parPart =+ case parPart of+ (BookMark _ anchor) | anchor `notElem` dummyAnchors -> do+ inHdrBool <- asks docxInHeaderBlock+ ils <- parPartToInlines' parPart+ immedPrevAnchor <- gets docxImmedPrevAnchor+ unless (isJust immedPrevAnchor || inHdrBool)+ (modify $ \s -> s{ docxImmedPrevAnchor = Just anchor})+ return ils+ _ -> do+ ils <- parPartToInlines' parPart+ modify $ \s -> s{ docxImmedPrevAnchor = Nothing}+ return ils++parPartToInlines' :: PandocMonad m => ParPart -> DocxContext m Inlines+parPartToInlines' (PlainRun r) = runToInlines r+parPartToInlines' (ChangedRuns (TrackedChange Insertion (ChangeInfo _ author date)) pparts) = do+ opts <- asks docxOptions+ case readerTrackChanges opts of+ AcceptChanges -> smushInlines <$> mapM parPartToInlines pparts+ RejectChanges -> return mempty+ AllChanges -> do+ ils <- smushInlines <$> mapM parPartToInlines pparts+ let attr = ("", ["insertion"], addAuthorAndDate author date)+ return $ spanWith attr ils+parPartToInlines' (ChangedRuns (TrackedChange Deletion (ChangeInfo _ author date)) pparts) = do+ opts <- asks docxOptions+ case readerTrackChanges opts of+ AcceptChanges -> return mempty+ RejectChanges -> smushInlines <$> mapM parPartToInlines pparts+ AllChanges -> do+ ils <- smushInlines <$> mapM parPartToInlines pparts+ let attr = ("", ["deletion"], addAuthorAndDate author date)+ return $ spanWith attr ils+parPartToInlines' (CommentStart cmtId author date bodyParts) = do+ opts <- asks docxOptions+ case readerTrackChanges opts of+ AllChanges -> do+ blks <- smushBlocks <$> mapM bodyPartToBlocks bodyParts+ ils <- blocksToInlinesWarn cmtId blks+ let attr = ("", ["comment-start"], ("id", cmtId) : addAuthorAndDate author date)+ return $ spanWith attr ils+ _ -> return mempty+parPartToInlines' (CommentEnd cmtId) = do+ opts <- asks docxOptions+ case readerTrackChanges opts of+ AllChanges -> do+ let attr = ("", ["comment-end"], [("id", cmtId)])+ return $ spanWith attr mempty+ _ -> return mempty+parPartToInlines' (BookMark _ anchor) | anchor `elem` dummyAnchors =+ return mempty+parPartToInlines' (BookMark _ anchor) =+ -- We record these, so we can make sure not to overwrite+ -- user-defined anchor links with header auto ids.+ do+ -- get whether we're in a header.+ inHdrBool <- asks docxInHeaderBlock+ -- Get the anchor map.+ anchorMap <- gets docxAnchorMap+ -- We don't want to rewrite if we're in a header, since we'll take+ -- care of that later, when we make the header anchor. If the+ -- bookmark were already in uniqueIdent form, this would lead to a+ -- duplication. Otherwise, we check to see if the id is already in+ -- there. Rewrite if necessary. This will have the possible effect+ -- of rewriting user-defined anchor links. However, since these+ -- are not defined in pandoc, it seems like a necessary evil to+ -- avoid an extra pass.+ immedPrevAnchor <- gets docxImmedPrevAnchor+ case immedPrevAnchor of+ Just prevAnchor | not inHdrBool -> do+ (modify $ \s -> s { docxAnchorMap = M.insert anchor prevAnchor anchorMap})+ return mempty+ _ -> do+ exts <- asks (readerExtensions . docxOptions)+ let newAnchor =+ if not inHdrBool && anchor `elem` M.elems anchorMap+ then uniqueIdent exts [Str anchor]+ (Set.fromList $ M.elems anchorMap)+ else anchor+ unless inHdrBool+ (modify $ \s -> s { docxAnchorMap = M.insert anchor newAnchor anchorMap})+ return $ spanWith (newAnchor, ["anchor"], []) mempty+parPartToInlines' (Drawing fp title alt bs ext) = do+ (lift . lift) $ P.insertMedia fp Nothing bs+ return $ imageWith (extentToAttr ext) (T.pack fp) title $ text alt+parPartToInlines' Chart =+ return $ spanWith ("", ["chart"], []) $ text "[CHART]"+parPartToInlines' Diagram =+ return $ spanWith ("", ["diagram"], []) $ text "[DIAGRAM]"+parPartToInlines' (InternalHyperLink anchor children) = do+ ils <- smushInlines <$> mapM parPartToInlines' children+ return $ link ("#" <> anchor) "" ils+parPartToInlines' (ExternalHyperLink target children) = do+ ils <- smushInlines <$> mapM parPartToInlines' children+ return $ link target "" ils+parPartToInlines' (PlainOMath exps) =+ return $ math $ writeTeX exps+parPartToInlines' (OMathPara exps) =+ return $ displayMath $ writeTeX exps+parPartToInlines' (Field info children) =+ case info of+ HyperlinkField url -> parPartToInlines' $ ExternalHyperLink url children+ IndexrefField ie ->+ pure $ spanWith ("",["indexref"],+ (("entry", entryTitle ie) :+ maybe [] (\x -> [("crossref",x)]) (entrySee ie)+ ++ maybe [] (\x -> [("yomi",x)]) (entryYomi ie)+ ++ [("bold","") | entryBold ie]+ ++ [("italic","") | entryItalic ie])) mempty+ PagerefField fieldAnchor True -> parPartToInlines' $ InternalHyperLink fieldAnchor children+ CrossrefField fieldAnchor True -> parPartToInlines' $ InternalHyperLink fieldAnchor children+ EndNoteCite t -> do+ formattedCite <- smushInlines <$> mapM parPartToInlines' children+ opts <- asks docxOptions+ if isEnabled Ext_citations opts+ then catchError+ (do citation <- readEndNoteXMLCitation t+ cs <- handleCitation citation+ return $ cite cs formattedCite)+ (\case+ PandocXMLError _ msg -> do+ P.report $ DocxParserWarning+ ("Cannot parse EndNote citation: " <> msg)+ return formattedCite+ e -> throwError e)+ else return formattedCite+ CslCitation t -> do+ formattedCite <- smushInlines <$> mapM parPartToInlines' children+ opts <- asks docxOptions+ if isEnabled Ext_citations opts+ then do+ let bs = fromTextLazy $ TL.fromStrict t+ case eitherDecode bs of+ Left _err -> return formattedCite+ Right citation -> do+ cs <- handleCitation citation+ return $ cite cs formattedCite+ else return formattedCite+ CslBibliography -> do+ opts <- asks docxOptions+ if isEnabled Ext_citations opts+ then return mempty -- omit Zotero-generated bibliography+ else smushInlines <$> mapM parPartToInlines' children+ EndNoteRefList -> do+ opts <- asks docxOptions+ if isEnabled Ext_citations opts+ then return mempty -- omit EndNote-generated bibliography+ else smushInlines <$> mapM parPartToInlines' children+ _ -> smushInlines <$> mapM parPartToInlines' children++-- Helper function to convert CitationItemType to CitationMode+convertCitationMode :: Citeproc.CitationItemType -> CitationMode+convertCitationMode itemType = case itemType of+ Citeproc.NormalCite -> NormalCitation+ Citeproc.SuppressAuthor -> SuppressAuthor+ Citeproc.AuthorOnly -> AuthorInText++-- Turn a 'Citeproc.Citation' into a list of 'Text.Pandoc.Definition.Citation',+-- and store the embedded bibliographic data in state.+handleCitation :: PandocMonad m+ => Citeproc.Citation T.Text+ -> DocxContext m [Citation]+handleCitation citation = do+ let getItemId item =+ case citationItemData item >>= M.lookup "citation-key" . referenceVariables of+ Just (TextVal k) -> ItemId k+ Just (FancyVal k) -> ItemId k+ _ -> citationItemId item+ let toPandocCitation item =+ Citation{ citationId = unItemId (getItemId item)+ , citationPrefix = maybe [] (toList . text) $+ Citeproc.citationItemPrefix item+ , citationSuffix = (toList . text) $+ maybe mempty (\x -> ", " <>+ maybe "" (<>" ") (Citeproc.citationItemLabel item)+ <> x <> " ")+ (Citeproc.citationItemLocator item)+ <> fromMaybe mempty (Citeproc.citationItemSuffix item)+ , citationMode = convertCitationMode (Citeproc.citationItemType item)+ , citationNoteNum = 0+ , citationHash = 0 }+ let items = Citeproc.citationItems citation+ let cs = map toPandocCitation items+ let refs = mapMaybe (\item -> fmap (\itemData -> text <$>+ -- see #10366, sometimes itemData has a different+ -- id and we need to use the same one:+ itemData{ referenceId = getItemId item })+ (Citeproc.citationItemData item)) items+ modify $ \st ->+ st{ docxReferences = foldr+ (\ref -> M.insert (referenceId ref) ref)+ (docxReferences st)+ refs }+ return cs++isAnchorSpan :: Inline -> Bool+isAnchorSpan (Span (_, ["anchor"], []) _) = True+isAnchorSpan _ = False++dummyAnchors :: [T.Text]+dummyAnchors = ["_GoBack"]++makeHeaderAnchor :: PandocMonad m => Blocks -> DocxContext m Blocks+makeHeaderAnchor bs = traverse makeHeaderAnchor' bs++makeHeaderAnchor' :: PandocMonad m => Block -> DocxContext m Block+-- If there is an anchor already there (an anchor span in the header,+-- to be exact), we rename and associate the new id with the old one.+makeHeaderAnchor' (Header n (ident, classes, kvs) ils)+ | (c:_) <- filter isAnchorSpan ils+ , (Span (anchIdent, ["anchor"], _) cIls) <- c = do+ hdrIDMap <- gets docxAnchorMap+ exts <- asks (readerExtensions . docxOptions)+ let newIdent = if T.null ident+ then uniqueIdent exts ils (Set.fromList $ M.elems hdrIDMap)+ else ident+ newIls = concatMap f ils where f il | il == c = cIls+ | otherwise = [il]+ modify $ \s -> s {docxAnchorMap = M.insert anchIdent newIdent hdrIDMap}+ makeHeaderAnchor' $ Header n (newIdent, classes, kvs) newIls+-- Otherwise we just give it a name, and register that name (associate+-- it with itself.)+makeHeaderAnchor' (Header n (ident, classes, kvs) ils) =+ do+ hdrIDMap <- gets docxAnchorMap+ exts <- asks (readerExtensions . docxOptions)+ let newIdent = if T.null ident+ then uniqueIdent exts ils (Set.fromList $ M.elems hdrIDMap)+ else ident+ modify $ \s -> s {docxAnchorMap = M.insert newIdent newIdent hdrIDMap}+ return $ Header n (newIdent, classes, kvs) ils+makeHeaderAnchor' blk = return blk++-- Rewrite a standalone paragraph block as a plain+singleParaToPlain :: Blocks -> Blocks+singleParaToPlain blks+ | (Para ils :< seeq) <- viewl $ unMany blks+ , Seq.null seeq =+ singleton $ Plain ils+singleParaToPlain blks = blks++cellToCell :: PandocMonad m => RowSpan -> Docx.Cell -> DocxContext m Pandoc.Cell+cellToCell rowSpan (Docx.Cell align gridSpan _ bps) = do+ blks <- smushBlocks <$> mapM bodyPartToBlocks bps+ let blks' = singleParaToPlain $ fromList $ blocksToDefinitions $ blocksToBullets $ toList blks+ return (cell (convertAlign align)+ rowSpan (ColSpan (fromIntegral gridSpan)) blks')++rowsToRows :: PandocMonad m => [Docx.Row] -> DocxContext m [Pandoc.Row]+rowsToRows rows = do+ let rowspans = (fmap . fmap) (first RowSpan) (Docx.rowsToRowspans rows)+ cells <- traverse (traverse (uncurry cellToCell)) rowspans+ return (fmap (Pandoc.Row nullAttr) cells)++splitHeaderRows :: Bool -> [Docx.Row] -> ([Docx.Row], [Docx.Row])+splitHeaderRows hasFirstRowFormatting rs = bimap reverse reverse $ fst+ $ if hasFirstRowFormatting+ then L.foldl' f ((take 1 rs, []), True) (drop 1 rs)+ else L.foldl' f (([], []), False) rs+ where+ f ((headerRows, bodyRows), previousRowWasHeader) r@(Docx.Row h cs)+ | h == HasTblHeader || (previousRowWasHeader && any isContinuationCell cs)+ = ((r : headerRows, bodyRows), True)+ | otherwise+ = ((headerRows, r : bodyRows), False)++ isContinuationCell (Docx.Cell _ _ vm _) = vm == Docx.Continue+++-- like trimInlines, but also take out linebreaks+trimSps :: Inlines -> Inlines+trimSps (Many ils) = Many $ Seq.dropWhileL isSp $ Seq.dropWhileR isSp ils+ where isSp Space = True+ isSp SoftBreak = True+ isSp LineBreak = True+ isSp _ = False++extraAttr :: (Eq (StyleName a), HasStyleName a) => a -> Attr+extraAttr s = ("", [], [("custom-style", fromStyleName $ getStyleName s)])++paragraphStyleToTransform :: PandocMonad m => ParagraphStyle -> DocxContext m (Blocks -> Blocks)+paragraphStyleToTransform pPr =+ let transform = if relativeIndent pPr > 0 && not (numbered pPr) &&+ not (any ((`elem` listParagraphStyles) . getStyleName) (pStyle pPr))+ then blockQuote+ else id+ in do+ extStylesEnabled <- asks (isEnabled Ext_styles . docxOptions)+ return $ foldr (\parStyle transform' ->+ (parStyleToTransform extStylesEnabled parStyle) . transform'+ ) transform (pStyle pPr)++parStyleToTransform :: Bool -> ParStyle -> Blocks -> Blocks+parStyleToTransform extStylesEnabled parStyle@(getStyleName -> styleName)+ | (styleName `elem` divsToKeep) || (styleName `elem` listParagraphStyles) =+ divWith ("", [normalizeToClassName styleName], [])+ | otherwise =+ (if extStylesEnabled then divWith (extraAttr parStyle) else id)+ . (if isBlockQuote parStyle then blockQuote else id)++-- The relative indent is the indentation minus the indentation of the parent style.+-- This tells us whether this paragraph in particular was indented more and thus+-- should be considered a block quote.+relativeIndent :: ParagraphStyle -> Integer+relativeIndent pPr =+ let pStyleLeft = fromMaybe 0 $ pStyleIndentation pPr >>= leftParIndent+ pStyleHang = fromMaybe 0 $ pStyleIndentation pPr >>= hangingParIndent+ left = fromMaybe pStyleLeft $ indentation pPr >>= leftParIndent+ hang = fromMaybe pStyleHang $ indentation pPr >>= hangingParIndent+ in (left - hang) - (pStyleLeft - pStyleHang)++normalizeToClassName :: (FromStyleName a) => a -> T.Text+normalizeToClassName = T.map go . fromStyleName+ where go c | isSpace c = '-'+ | otherwise = c++bodyPartToBlocks :: PandocMonad m => BodyPart -> DocxContext m Blocks+bodyPartToBlocks (Heading n style pPr numId lvl mblvlInfo parparts) = do+ ils <- local (\s-> s{docxInHeaderBlock=True})+ (smushInlines <$> mapM parPartToInlines parparts)+ let classes = map normalizeToClassName . delete style+ $ getStyleNames (pStyle pPr)+ hasNumbering <- gets docxNumberedHeadings+ let addNum = if hasNumbering && not (numbered pPr)+ then (++ ["unnumbered"])+ else id+ if T.null numId+ then pure ()+ else do+ -- We check whether this current numId has previously been used,+ -- since Docx expects us to pick up where we left off.+ listState <- gets docxListState+ let start = case M.lookup (numId, lvl) listState of+ Nothing -> case mblvlInfo of+ Nothing -> 1+ Just (Level _ _ _ z) -> fromMaybe 1 z+ Just z -> z + 1+ modify $ \st -> st{ docxListState =+ -- expire all the continuation data for lists of level > this one:+ -- a new level 1 list item resets continuation for level 2++ -- see #10258+ let notExpired (_, lvl') _ = lvl' <= lvl+ in M.insert (numId, lvl) start+ (M.filterWithKey notExpired listState) }+ makeHeaderAnchor $ headerWith ("", addNum classes, []) n ils+bodyPartToBlocks (Paragraph pPr parparts)+ | Just True <- pBidi pPr = do+ let pPr' = pPr { pBidi = Nothing }+ local (\s -> s{ docxInBidi = True })+ (bodyPartToBlocks (Paragraph pPr' parparts))+ | isCodeDiv pPr = do+ transform <- paragraphStyleToTransform pPr+ return $+ transform $+ codeBlock $+ T.concat $+ map parPartToText parparts+ | otherwise = do+ ils <- trimSps . smushInlines <$> mapM parPartToInlines parparts+ prevParaIls <- gets docxPrevPara+ dropIls <- gets docxDropCap+ let ils' = dropIls <> ils+ let (paraOrPlain, pPr')+ | hasStylesInheritedFrom ["Compact"] pPr = (plain, removeStyleNamed "Compact" pPr)+ | otherwise = (para, pPr)+ if dropCap pPr'+ then do modify $ \s -> s { docxDropCap = ils' }+ return mempty+ else do modify $ \s -> s { docxDropCap = mempty }+ let ils'' = (if null prevParaIls then mempty+ else prevParaIls <> space) <> ils'+ handleInsertion = do+ modify $ \s -> s {docxPrevPara = mempty}+ transform <- paragraphStyleToTransform pPr'+ return $ transform $ paraOrPlain ils''+ opts <- asks docxOptions+ case (pChange pPr', readerTrackChanges opts) of+ _ | null ils'', not (isEnabled Ext_empty_paragraphs opts) ->+ return mempty+ (Just (TrackedChange Insertion _), AcceptChanges) ->+ handleInsertion+ (Just (TrackedChange Insertion _), RejectChanges) -> do+ modify $ \s -> s {docxPrevPara = ils''}+ return mempty+ (Just (TrackedChange Insertion (ChangeInfo _ cAuthor cDate))+ , AllChanges) -> do+ let attr = ("", ["paragraph-insertion"], addAuthorAndDate cAuthor cDate)+ insertMark = spanWith attr mempty+ transform <- paragraphStyleToTransform pPr'+ return $ transform $+ paraOrPlain $ ils'' <> insertMark+ (Just (TrackedChange Deletion _), AcceptChanges) -> do+ modify $ \s -> s {docxPrevPara = ils''}+ return mempty+ (Just (TrackedChange Deletion _), RejectChanges) ->+ handleInsertion+ (Just (TrackedChange Deletion (ChangeInfo _ cAuthor cDate))+ , AllChanges) -> do+ let attr = ("", ["paragraph-deletion"], addAuthorAndDate cAuthor cDate)+ insertMark = spanWith attr mempty+ transform <- paragraphStyleToTransform pPr'+ return $ transform $+ paraOrPlain $ ils'' <> insertMark+ _ -> handleInsertion+bodyPartToBlocks (ListItem pPr numId lvl (Just levelInfo) parparts) = do+ -- We check whether this current numId has previously been used,+ -- since Docx expects us to pick up where we left off.+ listState <- gets docxListState+ let startFromState = M.lookup (numId, lvl) listState+ Level _ fmt txt startFromLevelInfo = levelInfo+ start = case startFromState of+ Just n -> n + 1+ Nothing -> fromMaybe 1 startFromLevelInfo+ kvs = [ ("level", lvl)+ , ("num-id", numId)+ , ("format", fmt)+ , ("text", txt)+ , ("start", tshow start)+ ]+ modify $ \st -> st{ docxListState =+ -- expire all the continuation data for lists of level > this one:+ -- a new level 1 list item resets continuation for level 2++ let notExpired (_, lvl') _ = lvl' <= lvl+ in M.insert (numId, lvl) start (M.filterWithKey notExpired listState) }+ blks <- bodyPartToBlocks (Paragraph pPr parparts)+ return $ divWith ("", ["list-item"], kvs) blks+bodyPartToBlocks (ListItem pPr _ _ _ parparts) =+ let pPr' = pPr {pStyle = constructBogusParStyleData "list-paragraph": pStyle pPr}+ in+ bodyPartToBlocks $ Paragraph pPr' parparts+bodyPartToBlocks (Captioned parstyle parparts bpart) = do+ bs <- bodyPartToBlocks bpart+ captContents <- bodyPartToBlocks (Paragraph parstyle parparts)+ let capt = Caption Nothing (toList captContents)+ let toCaptioned attr' bls = case bls of+ [Table attr _cap colspecs thead tbodies tfoot]+ -> singleton $ Table (attr <> attr') capt colspecs thead tbodies tfoot+ [Figure attr _cap blks]+ -> singleton $ Figure (attr <> attr') capt blks+ [Para im@[Image{}]]+ -> singleton $ Figure attr' capt [Plain im]+ [Div attr bls']+ -> toCaptioned (attr <> attr') bls'+ [BlockQuote bls']+ -> toCaptioned attr' bls'+ _ -> captContents+ pure $ toCaptioned nullAttr (toList bs)+bodyPartToBlocks (Tbl _ _ _ _ []) =+ return mempty+bodyPartToBlocks (Tbl mbsty cap grid look parts) = do+ let fullCaption = if T.null cap then mempty else plain (text cap)+ let shortCaption = if T.null cap then Nothing else Just (toList (text cap))+ cap' = caption shortCaption fullCaption+ (hdr, rows) = splitHeaderRows (firstRowFormatting look) parts++ let width = maybe 0 maximum $ nonEmpty $ map rowLength parts+ rowLength :: Docx.Row -> Int+ rowLength (Docx.Row _ c) = sum (fmap (\(Docx.Cell _ gridSpan _ _) -> fromIntegral gridSpan) c)++ headerCells <- rowsToRows hdr+ bodyCells <- rowsToRows rows++ -- Horizontal column alignment is taken from the first row's cells.+ let getAlignment (Docx.Cell al colspan _ _) = replicate (fromIntegral colspan)+ $ convertAlign al+ alignments = case rows of+ [] -> replicate width Pandoc.AlignDefault+ Docx.Row _ cs : _ -> concatMap getAlignment cs+ widths = map (\n -> if n == 0+ then ColWidthDefault+ else ColWidth n) grid++ extStylesEnabled <- asks (isEnabled Ext_styles . docxOptions)+ let attr = case mbsty of+ Just sty | extStylesEnabled -> ("", [], [("custom-style", sty)])+ _ -> nullAttr+ return $ tableWith attr cap'+ (zip alignments widths)+ (TableHead nullAttr headerCells)+ [TableBody nullAttr 0 [] bodyCells]+ (TableFoot nullAttr [])+bodyPartToBlocks HRule = pure Pandoc.horizontalRule++-- replace targets with generated anchors.+rewriteLink' :: PandocMonad m => Inline -> DocxContext m Inline+rewriteLink' l@(Link attr ils (T.uncons -> Just ('#',target), title)) = do+ anchorMap <- gets docxAnchorMap+ case M.lookup target anchorMap of+ Just newTarget -> do+ modify $ \s -> s{docxAnchorSet = Set.insert newTarget (docxAnchorSet s)}+ return $ Link attr ils ("#" <> newTarget, title)+ Nothing -> do+ modify $ \s -> s{docxAnchorSet = Set.insert target (docxAnchorSet s)}+ return l+rewriteLink' il = return il++rewriteLinks :: PandocMonad m => [Block] -> DocxContext m [Block]+rewriteLinks = mapM (walkM rewriteLink')++removeOrphanAnchors'' :: PandocMonad m => Inline -> DocxContext m [Inline]+removeOrphanAnchors'' s@(Span (ident, classes, _) ils)+ | "anchor" `elem` classes = do+ anchorSet <- gets docxAnchorSet+ return $ if ident `Set.member` anchorSet+ then [s]+ else ils+removeOrphanAnchors'' il = return [il]++removeOrphanAnchors' :: PandocMonad m => [Inline] -> DocxContext m [Inline]+removeOrphanAnchors' ils = liftM concat $ mapM removeOrphanAnchors'' ils++removeOrphanAnchors :: PandocMonad m => [Block] -> DocxContext m [Block]+removeOrphanAnchors = mapM (walkM removeOrphanAnchors')++bodyToOutput :: PandocMonad m => Body -> DocxContext m (Meta, [Block])+bodyToOutput (Body bps) = do+ let (metabps, blkbps) = sepBodyParts bps+ meta <- bodyPartsToMeta metabps+ let isNumberedPara (Paragraph pPr _) = numbered pPr+ isNumberedPara _ = False+ modify (\s -> s { docxNumberedHeadings = any isNumberedPara blkbps })+ blks <- smushBlocks <$> mapM bodyPartToBlocks blkbps+ blks' <- rewriteLinks $ blocksToDefinitions $ blocksToBullets $ toList blks+ blks'' <- removeOrphanAnchors blks'+ refs <- gets (map referenceToMetaValue . M.elems . docxReferences)+ let meta' = if null refs+ then meta+ else setMeta "references" refs meta+ return (meta', blks'')++docxToOutput :: PandocMonad m+ => ReaderOptions+ -> Docx+ -> m (Meta, [Block])+docxToOutput opts (Docx (Document _ body)) =+ let dEnv = def { docxOptions = opts} in+ evalDocxContext (bodyToOutput body) dEnv def++addAuthorAndDate :: T.Text -> Maybe T.Text -> [(T.Text, T.Text)]+addAuthorAndDate author mdate =+ ("author", author) : maybe [] (\date -> [("date", date)]) mdate++convertAlign :: Docx.Align -> Pandoc.Alignment+convertAlign al = case al of+ Docx.AlignDefault -> Pandoc.AlignDefault+ Docx.AlignLeft -> Pandoc.AlignLeft+ Docx.AlignCenter -> Pandoc.AlignCenter+ Docx.AlignRight -> Pandoc.AlignRight
@@ -0,0 +1,189 @@+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Readers.Docx.Combine+ Copyright : © 2014-2020 Jesse Rosenthal <jrosenthal@jhu.edu>,+ 2014-2024 John MacFarlane <jgm@berkeley.edu>,+ 2020 Nikolay Yakimov <root@livid.pp.ru>+ License : GNU GPL, version 2 or above++ Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>+ Stability : alpha+ Portability : portable++Flatten sequences of elements.+-}++{-+The purpose of this module is to combine the formatting of separate+runs, which have *non-nesting* formatting. Because the formatting+doesn't nest, you can't actually tell the nesting order until you+combine with the runs that follow.++For example, say you have a something like `<em><strong>foo</strong>+bar</em>`. Then in ooxml, you'll get these two runs:++~~~+<w:r>+ <w:rPr>+ <w:b />+ <w:i />+ </w:rPr>+ <w:t>Foo</w:t>+</w:r>+<w:r>+ <w:rPr>+ <w:i />+ </w:rPr>+ <w:t> Bar</w:t>+</w:r>+~~~++Note that this is an ideal situation. In practice, it will probably be+more---if, for example, the user turned italics+off and then on.++So, when you get the first run, which is marked as both bold and italic,+you have no idea whether it's `Strong [Emph [Str "Foo"]]` or `Emph+[Strong [Str "Foo"]]`.++We combine two runs, then, by taking off the formatting that modifies an+inline, seeing what is shared between them, and rebuilding an inline. We+fold this to combine the inlines.++-}++module Text.Pandoc.Readers.Docx.Combine ( combineBlocks+ , smushInlines+ , smushBlocks+ )+ where++import qualified Data.List as L+import Data.Bifunctor+import Data.Sequence ( ViewL (..), ViewR (..), viewl, viewr, spanr, spanl+ , (><), (|>) )+import Text.Pandoc.Builder as B++data Modifier a = Modifier (a -> a)+ | AttrModifier (Attr -> a -> a) Attr++spaceOutInlinesL :: Inlines -> (Inlines, Inlines)+spaceOutInlinesL ms = (l, stackInlines fs (m' <> r))+ where (l, (fs, m'), r) = spaceOutInlines ms++spaceOutInlinesR :: Inlines -> (Inlines, Inlines)+spaceOutInlinesR ms = (stackInlines fs (l <> m'), r)+ where (l, (fs, m'), r) = spaceOutInlines ms++spaceOutInlines :: Inlines -> (Inlines, ([Modifier Inlines], Inlines), Inlines)+spaceOutInlines ils =+ let (fs, ils') = unstackInlines ils+ (left, (right, contents')) = second (spanr isSpace) $ spanl isSpace $ unMany ils'+ -- NOTE: spanr counterintuitively returns suffix as the FIRST tuple element+ in (Many left, (fs, Many contents'), Many right)++isSpace :: Inline -> Bool+isSpace Space = True+isSpace SoftBreak = True+isSpace _ = False++stackInlines :: [Modifier Inlines] -> Inlines -> Inlines+stackInlines [] ms = ms+stackInlines (Modifier f : fs) ms =+ if null ms+ then stackInlines fs ms+ else f $ stackInlines fs ms+stackInlines (AttrModifier f attr : fs) ms = f attr $ stackInlines fs ms++unstackInlines :: Inlines -> ([Modifier Inlines], Inlines)+unstackInlines ms = case ilModifierAndInnards ms of+ Nothing -> ([], ms)+ Just (f, inner) -> first (f :) $ unstackInlines inner++ilModifierAndInnards :: Inlines -> Maybe (Modifier Inlines, Inlines)+ilModifierAndInnards ils = case viewl $ unMany ils of+ x :< xs | null xs -> second fromList <$> case x of+ Emph lst -> Just (Modifier emph, lst)+ Strong lst -> Just (Modifier strong, lst)+ SmallCaps lst -> Just (Modifier smallcaps, lst)+ Strikeout lst -> Just (Modifier strikeout, lst)+ Underline lst -> Just (Modifier underline, lst)+ Superscript lst -> Just (Modifier superscript, lst)+ Subscript lst -> Just (Modifier subscript, lst)+ Link attr lst tgt -> Just (Modifier $ uncurry (linkWith attr) tgt, lst)+ Span attr lst -> Just (AttrModifier spanWith attr, lst)+ _ -> Nothing+ _ -> Nothing++inlinesL :: Inlines -> (Inlines, Inlines)+inlinesL ils = case viewl $ unMany ils of+ (s :< sq) -> (B.singleton s, Many sq)+ _ -> (mempty, ils)++inlinesR :: Inlines -> (Inlines, Inlines)+inlinesR ils = case viewr $ unMany ils of+ (sq :> s) -> (Many sq, B.singleton s)+ _ -> (ils, mempty)++combineInlines :: Inlines -> Inlines -> Inlines+combineInlines x y =+ let (xs', x') = inlinesR x+ (y', ys') = inlinesL y+ in+ xs' <> combineSingletonInlines x' y' <> ys'++combineSingletonInlines :: Inlines -> Inlines -> Inlines+combineSingletonInlines x y =+ let (xfs, xs) = unstackInlines x+ (yfs, ys) = unstackInlines y+ shared = xfs `L.intersect` yfs+ x_remaining = xfs L.\\ shared+ y_remaining = yfs L.\\ shared+ x_rem_attr = filter isAttrModifier x_remaining+ y_rem_attr = filter isAttrModifier y_remaining+ in+ case null shared of+ True | null xs && null ys ->+ stackInlines (x_rem_attr <> y_rem_attr) mempty+ | null xs ->+ let (sp, y') = spaceOutInlinesL y in+ stackInlines x_rem_attr mempty <> sp <> y'+ | null ys ->+ let (x', sp) = spaceOutInlinesR x in+ x' <> sp <> stackInlines y_rem_attr mempty+ | otherwise ->+ let (x', xsp) = spaceOutInlinesR x+ (ysp, y') = spaceOutInlinesL y+ in+ x' <> xsp <> ysp <> y'+ False -> stackInlines shared $+ combineInlines+ (stackInlines x_remaining xs)+ (stackInlines y_remaining ys)++combineBlocks :: Blocks -> Blocks -> Blocks+combineBlocks bs cs+ | bs' :> BlockQuote bs'' <- viewr (unMany bs)+ , BlockQuote cs'' :< cs' <- viewl (unMany cs) =+ Many $ (bs' |> BlockQuote (bs'' <> cs'')) >< cs'+ | bs' :> CodeBlock attr codeStr <- viewr (unMany bs)+ , CodeBlock attr' codeStr' :< cs' <- viewl (unMany cs)+ , attr == attr' =+ Many $ (bs' |> CodeBlock attr (codeStr <> "\n" <> codeStr')) >< cs'+combineBlocks bs cs = bs <> cs++instance (Monoid a, Eq a) => Eq (Modifier a) where+ (Modifier f) == (Modifier g) = f mempty == g mempty+ (AttrModifier f attr) == (AttrModifier g attr') = f attr mempty == g attr' mempty+ _ == _ = False++isAttrModifier :: Modifier a -> Bool+isAttrModifier (AttrModifier _ _) = True+isAttrModifier _ = False++smushInlines :: [Inlines] -> Inlines+smushInlines xs = combineInlines xs' mempty+ where xs' = L.foldl' combineInlines mempty xs++smushBlocks :: [Blocks] -> Blocks+smushBlocks xs = L.foldl' combineBlocks mempty xs
@@ -0,0 +1,167 @@+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Readers.Docx.Fields+ Copyright : Copyright (C) 2014-2020 Jesse Rosenthal+ License : GNU GPL, version 2 or above++ Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>+ Stability : alpha+ Portability : portable++For parsing Field definitions in instText tags, as described in+ECMA-376-1:2016, §17.16.5 -}++module Text.Pandoc.Readers.Docx.Fields ( FieldInfo(..)+ , IndexEntry(..)+ , parseFieldInfo+ ) where++import Data.Functor (($>), void)+import qualified Data.Text as T+import Text.Pandoc.Parsing+import Data.Maybe (isJust)++type URL = T.Text+type Anchor = T.Text++data IndexEntry = IndexEntry+ { entryTitle :: T.Text+ , entrySee :: Maybe T.Text+ , entryYomi :: Maybe T.Text+ , entryBold :: Bool+ , entryItalic :: Bool }+ deriving (Show)++data FieldInfo = HyperlinkField URL+ -- The boolean indicates whether the field is a hyperlink.+ | PagerefField Anchor Bool+ | CrossrefField Anchor Bool+ | IndexrefField IndexEntry+ | CslCitation T.Text+ | CslBibliography+ | EndNoteCite T.Text+ | EndNoteRefList+ | UnknownField+ deriving (Show)++type Parser = Parsec T.Text ()++parseFieldInfo :: T.Text -> Either ParseError FieldInfo+parseFieldInfo = parse fieldInfo ""++fieldInfo :: Parser FieldInfo+fieldInfo = do+ spaces+ hyperlink+ <|>+ pageref+ <|>+ indexref+ <|>+ crossref+ <|>+ addIn+ <|>+ return UnknownField++addIn :: Parser FieldInfo+addIn = do+ string "ADDIN"+ spaces+ try cslCitation <|> cslBibliography <|> endnoteCite <|> endnoteRefList++cslCitation :: Parser FieldInfo+cslCitation = do+ optional (string "ZOTERO_ITEM" *> spaces)+ string "CSL_CITATION"+ spaces+ CslCitation <$> getInput++cslBibliography :: Parser FieldInfo+cslBibliography = do+ string "ZOTERO_BIBL" <|> string "Mendeley Bibliography CSL_BIBLIOGRAPHY"+ return CslBibliography++endnoteCite :: Parser FieldInfo+endnoteCite = try $ do+ string "EN.CITE"+ spaces+ EndNoteCite <$> getInput++endnoteRefList :: Parser FieldInfo+endnoteRefList = try $ do+ string "EN.REFLIST"+ return EndNoteRefList+++escapedQuote :: Parser T.Text+escapedQuote = string "\\\"" $> "\\\""++inQuotes :: Parser T.Text+inQuotes =+ try escapedQuote <|> (T.singleton <$> anyChar)++quotedString :: Parser T.Text+quotedString = do+ char '"'+ T.concat <$> manyTill inQuotes (try (char '"'))++unquotedString :: Parser T.Text+unquotedString = T.pack <$> manyTill anyChar (try $ void (lookAhead space) <|> eof)++fieldArgument :: Parser T.Text+fieldArgument = do+ notFollowedBy (char '\\') -- switch+ quotedString <|> unquotedString++hyperlink :: Parser FieldInfo+hyperlink = do+ string "HYPERLINK"+ spaces+ farg <- option "" $ notFollowedBy (char '\\') *> fieldArgument+ switches <- many fieldSwitch+ let url = case [s | ('l',s) <- switches] of+ [s] -> farg <> "#" <> s+ _ -> farg+ return $ HyperlinkField url++-- See §17.16.5.45+fieldSwitch :: Parser (Char, T.Text)+fieldSwitch = try $ do+ spaces+ char '\\'+ c <- anyChar+ spaces+ farg <- option mempty fieldArgument+ return (c, farg)++pageref :: Parser FieldInfo+pageref = do+ string "PAGEREF"+ spaces+ farg <- fieldArgument+ switches <- many fieldSwitch+ let isLink = any ((== 'h') . fst) switches+ return $ PagerefField farg isLink++crossref :: Parser FieldInfo+crossref = do+ string "REF"+ spaces+ farg <- fieldArgument+ switches <- many fieldSwitch+ let isLink = any ((== 'h') . fst) switches+ return $ CrossrefField farg isLink++-- second element of tuple is optional "see".+indexref :: Parser FieldInfo+indexref = do+ string "XE"+ spaces+ farg <- fieldArgument+ switches <- spaces *> many fieldSwitch+ return $ IndexrefField $ IndexEntry{ entryTitle = farg+ , entrySee = lookup 't' switches+ , entryYomi = lookup 'y' switches+ , entryBold = isJust (lookup 'b' switches)+ , entryItalic = isJust (lookup 'i' switches) }
@@ -1,238 +0,0 @@-{--Copyright (C) 2014 Matthew Pickering <matthewtpickering@gmail.com>--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.Readers.Docx.Fonts- Copyright : Copyright (C) 2014 Matthew Pickering- License : GNU GPL, version 2 or above-- Maintainer : Matthew Pickering <matthewtpickering@gmail.com>- Stability : alpha- Portability : portable--Utilities to convert between font codepoints and unicode characters.--}-module Text.Pandoc.Readers.Docx.Fonts (getUnicode, Font(..)) where----- | Enumeration of recognised fonts-data Font = Symbol -- ^ <http://en.wikipedia.org/wiki/Symbol_(typeface) Adobe Symbol>- deriving (Show, Eq)---- | Given a font and codepoint, returns the corresponding unicode--- character-getUnicode :: Font -> Char -> Maybe Char-getUnicode Symbol c = lookup c symbol---- Generated from lib/fonts/symbol.txt-symbol :: [(Char, Char)]-symbol =- [ (' ',' ')- , (' ','\160')- , ('!','!')- , ('"','\8704')- , ('#','#')- , ('$','\8707')- , ('%','%')- , ('&','&')- , ('\'','\8715')- , ('(','(')- , (')',')')- , ('*','\8727')- , ('+','+')- , (',',',')- , ('-','\8722')- , ('.','.')- , ('/','/')- , ('0','0')- , ('1','1')- , ('2','2')- , ('3','3')- , ('4','4')- , ('5','5')- , ('6','6')- , ('7','7')- , ('8','8')- , ('9','9')- , (':',':')- , (';',';')- , ('<','<')- , ('=','=')- , ('>','>')- , ('?','?')- , ('@','\8773')- , ('A','\913')- , ('B','\914')- , ('C','\935')- , ('D','\916')- , ('D','\8710')- , ('E','\917')- , ('F','\934')- , ('G','\915')- , ('H','\919')- , ('I','\921')- , ('J','\977')- , ('K','\922')- , ('L','\923')- , ('M','\924')- , ('N','\925')- , ('O','\927')- , ('P','\928')- , ('Q','\920')- , ('R','\929')- , ('S','\931')- , ('T','\932')- , ('U','\933')- , ('V','\962')- , ('W','\937')- , ('W','\8486')- , ('X','\926')- , ('Y','\936')- , ('Z','\918')- , ('[','[')- , ('\\','\8756')- , (']',']')- , ('^','\8869')- , ('_','_')- , ('`','\63717')- , ('a','\945')- , ('b','\946')- , ('c','\967')- , ('d','\948')- , ('e','\949')- , ('f','\966')- , ('g','\947')- , ('h','\951')- , ('i','\953')- , ('j','\981')- , ('k','\954')- , ('l','\955')- , ('m','\181')- , ('m','\956')- , ('n','\957')- , ('o','\959')- , ('p','\960')- , ('q','\952')- , ('r','\961')- , ('s','\963')- , ('t','\964')- , ('u','\965')- , ('v','\982')- , ('w','\969')- , ('x','\958')- , ('y','\968')- , ('z','\950')- , ('{','{')- , ('|','|')- , ('}','}')- , ('~','\8764')- , ('\160','\8364')- , ('\161','\978')- , ('\162','\8242')- , ('\163','\8804')- , ('\164','\8260')- , ('\164','\8725')- , ('\165','\8734')- , ('\166','\402')- , ('\167','\9827')- , ('\168','\9830')- , ('\169','\9829')- , ('\170','\9824')- , ('\171','\8596')- , ('\172','\8592')- , ('\173','\8593')- , ('\174','\8594')- , ('\175','\8595')- , ('\176','\176')- , ('\177','\177')- , ('\178','\8243')- , ('\179','\8805')- , ('\180','\215')- , ('\181','\8733')- , ('\182','\8706')- , ('\183','\8226')- , ('\184','\247')- , ('\185','\8800')- , ('\186','\8801')- , ('\187','\8776')- , ('\188','\8230')- , ('\189','\63718')- , ('\190','\63719')- , ('\191','\8629')- , ('\192','\8501')- , ('\193','\8465')- , ('\194','\8476')- , ('\195','\8472')- , ('\196','\8855')- , ('\197','\8853')- , ('\198','\8709')- , ('\199','\8745')- , ('\200','\8746')- , ('\201','\8835')- , ('\202','\8839')- , ('\203','\8836')- , ('\204','\8834')- , ('\205','\8838')- , ('\206','\8712')- , ('\207','\8713')- , ('\208','\8736')- , ('\209','\8711')- , ('\210','\63194')- , ('\211','\63193')- , ('\212','\63195')- , ('\213','\8719')- , ('\214','\8730')- , ('\215','\8901')- , ('\216','\172')- , ('\217','\8743')- , ('\218','\8744')- , ('\219','\8660')- , ('\220','\8656')- , ('\221','\8657')- , ('\222','\8658')- , ('\223','\8659')- , ('\224','\9674')- , ('\225','\9001')- , ('\226','\63720')- , ('\227','\63721')- , ('\228','\63722')- , ('\229','\8721')- , ('\230','\63723')- , ('\231','\63724')- , ('\232','\63725')- , ('\233','\63726')- , ('\234','\63727')- , ('\235','\63728')- , ('\236','\63729')- , ('\237','\63730')- , ('\238','\63731')- , ('\239','\63732')- , ('\241','\9002')- , ('\242','\8747')- , ('\243','\8992')- , ('\244','\63733')- , ('\245','\8993')- , ('\246','\63734')- , ('\247','\63735')- , ('\248','\63736')- , ('\249','\63737')- , ('\250','\63738')- , ('\251','\63739')- , ('\252','\63740')- , ('\253','\63741')- , ('\254','\63742')]
@@ -1,24 +1,8 @@-{--Copyright (C) 2014 Jesse Rosenthal <jrosenthal@jhu.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--}-+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.Readers.Docx.Lists- Copyright : Copyright (C) 2014 Jesse Rosenthal+ Copyright : Copyright (C) 2014-2020 Jesse Rosenthal License : GNU GPL, version 2 or above Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>@@ -31,54 +15,54 @@ module Text.Pandoc.Readers.Docx.Lists ( blocksToBullets , blocksToDefinitions , listParagraphDivs+ , listParagraphStyles ) where -import Text.Pandoc.JSON-import Text.Pandoc.Generic (bottomUp)-import Text.Pandoc.Shared (trim)-import Control.Monad import Data.List+import Data.Char (isDigit) import Data.Maybe+import Data.String (fromString)+import qualified Data.Text as T+import Text.Pandoc.Walk (walk)+import Text.Pandoc.JSON+import Text.Pandoc.Readers.Docx.Parse (ParaStyleName)+import Text.Pandoc.Shared (trim, safeRead) isListItem :: Block -> Bool isListItem (Div (_, classes, _) _) | "list-item" `elem` classes = True-isListItem _ = False+isListItem _ = False getLevel :: Block -> Maybe Integer-getLevel (Div (_, _, kvs) _) = liftM read $ lookup "level" kvs-getLevel _ = Nothing+getLevel (Div (_, _, kvs) _) = lookup "level" kvs >>= safeRead+getLevel _ = Nothing getLevelN :: Block -> Integer-getLevelN b = case getLevel b of- Just n -> n- Nothing -> -1+getLevelN b = fromMaybe (-1) (getLevel b) getNumId :: Block -> Maybe Integer-getNumId (Div (_, _, kvs) _) = liftM read $ lookup "num-id" kvs-getNumId _ = Nothing+getNumId (Div (_, _, kvs) _) = lookup "num-id" kvs >>= safeRead+getNumId _ = Nothing getNumIdN :: Block -> Integer-getNumIdN b = case getNumId b of- Just n -> n- Nothing -> -1+getNumIdN b = fromMaybe (-1) (getNumId b) -getText :: Block -> Maybe String+getText :: Block -> Maybe T.Text getText (Div (_, _, kvs) _) = lookup "text" kvs-getText _ = Nothing+getText _ = Nothing data ListType = Itemized | Enumerated ListAttributes -listStyleMap :: [(String, ListNumberStyle)]+listStyleMap :: [(T.Text, ListNumberStyle)] listStyleMap = [("upperLetter", UpperAlpha), ("lowerLetter", LowerAlpha), ("upperRoman", UpperRoman), ("lowerRoman", LowerRoman), ("decimal", Decimal)] -listDelimMap :: [(String, ListNumberDelim)]-listDelimMap = [("%1)", OneParen),- ("(%1)", TwoParens),- ("%1.", Period)]+listDelimMap :: [(T.Text, ListNumberDelim)]+listDelimMap = [("%)", OneParen),+ ("(%)", TwoParens),+ ("%.", Period)] getListType :: Block -> Maybe ListType getListType b@(Div (_, _, kvs) _) | isListItem b =@@ -90,18 +74,21 @@ case frmt of Just "bullet" -> Just Itemized Just f ->- case txt of+ case T.filter (not . isDigit) <$> txt of Just t -> Just $ Enumerated (- read (fromMaybe "1" start) :: Int,+ fromMaybe 1 (start >>= safeRead) :: Int, fromMaybe DefaultStyle (lookup f listStyleMap), fromMaybe DefaultDelim (lookup t listDelimMap)) Nothing -> Nothing _ -> Nothing getListType _ = Nothing -listParagraphDivs :: [String]-listParagraphDivs = ["ListParagraph"]+listParagraphDivs :: [T.Text]+listParagraphDivs = ["list-paragraph"] +listParagraphStyles :: [ParaStyleName]+listParagraphStyles = map (fromString . T.unpack) listParagraphDivs+ -- This is a first stab at going through and attaching meaning to list -- paragraphs, without an item marker, following a list item. We -- assume that these are paragraphs in the same item.@@ -109,27 +96,27 @@ handleListParagraphs :: [Block] -> [Block] handleListParagraphs [] = [] handleListParagraphs (- (Div attr1@(_, classes1, _) blks1) :- (Div (ident2, classes2, kvs2) blks2) :+ Div attr1@(_, classes1, _) blks1 :+ Div (ident2, classes2, kvs2) blks2 : blks ) | "list-item" `elem` classes1 &&- not ("list-item" `elem` classes2) &&+ notElem "list-item" classes2 && (not . null) (listParagraphDivs `intersect` classes2) = -- We don't want to keep this indent. let newDiv2 =- (Div (ident2, classes2, filter (\kv -> fst kv /= "indent") kvs2) blks2)+ Div (ident2, classes2, filter (\kv -> fst kv /= "indent") kvs2) blks2 in- handleListParagraphs ((Div attr1 (blks1 ++ [newDiv2])) : blks)-handleListParagraphs (blk:blks) = blk : (handleListParagraphs blks)+ handleListParagraphs (Div attr1 (blks1 ++ [newDiv2]) : blks)+handleListParagraphs (blk:blks) = blk : handleListParagraphs blks separateBlocks' :: Block -> [[Block]] -> [[Block]]-separateBlocks' blk ([] : []) = [[blk]]-separateBlocks' b@(BulletList _) acc = (init acc) ++ [(last acc) ++ [b]]-separateBlocks' b@(OrderedList _ _) acc = (init acc) ++ [(last acc) ++ [b]]+separateBlocks' blk [[]] = [[blk]]+separateBlocks' b@(BulletList _) acc = init acc ++ [last acc ++ [b]]+separateBlocks' b@(OrderedList _ _) acc = init acc ++ [last acc ++ [b]] -- The following is for the invisible bullet lists. This is how -- pandoc-generated ooxml does multiparagraph item lists.-separateBlocks' b acc | liftM trim (getText b) == Just "" =- (init acc) ++ [(last acc) ++ [b]]+separateBlocks' b acc | fmap trim (getText b) == Just "" =+ init acc ++ [last acc ++ [b]] separateBlocks' b acc = acc ++ [[b]] separateBlocks :: [Block] -> [[Block]]@@ -137,91 +124,110 @@ flatToBullets' :: Integer -> [Block] -> [Block] flatToBullets' _ [] = []-flatToBullets' num xs@(b : elems)- | getLevelN b == num = b : (flatToBullets' num elems)- | otherwise =- let bNumId = getNumIdN b- bLevel = getLevelN b- (children, remaining) =- span- (\b' ->- ((getLevelN b') > bLevel ||- ((getLevelN b') == bLevel && (getNumIdN b') == bNumId)))- xs- in- case getListType b of- Just (Enumerated attr) ->- (OrderedList attr (separateBlocks $ flatToBullets' bLevel children)) :- (flatToBullets' num remaining)- _ ->- (BulletList (separateBlocks $ flatToBullets' bLevel children)) :- (flatToBullets' num remaining)+flatToBullets' num xs@(b : elems) =+ if getLevelN b == num+ then (case bCheckmark of+ Just checked -> addCheckmark checked b+ Nothing -> b) : flatToBullets' num elems+ else case getListType b of+ Just (Enumerated attr) ->+ OrderedList attr (separateBlocks $ flatToBullets' bLevel children) :+ flatToBullets' num remaining+ _ ->+ BulletList (separateBlocks $ flatToBullets' bLevel children) :+ flatToBullets' num remaining+ where+ bNumId = getNumIdN b+ bLevel = getLevelN b+ isCheckmark (Just "\9744") = Just False+ isCheckmark (Just "\9746") = Just True+ isCheckmark _ = Nothing+ bCheckmark =+ case getListType b of+ Just Itemized -> isCheckmark (getText b)+ _ -> Nothing+ addCheckmark checked (Div attrs [Para ils]) =+ Div attrs [Para (Str (if checked then "\9746" else "\9744") : Space : ils)]+ addCheckmark checked (Div attrs [Plain ils]) =+ Div attrs [Plain (Str (if checked then "\9746" else "\9744") : Space : ils)]+ addCheckmark _ x = x+ (children, remaining) =+ span+ (\b' ->+ getLevelN b' > bLevel ||+ (getLevelN b' == bLevel &&+ (getNumIdN b' == bNumId ||+ (case bCheckmark of+ Just _ ->+ case getText b' of+ Just "" -> True+ Just " " -> True+ Just x -> isJust (isCheckmark (Just x))+ Nothing -> False+ Nothing -> False))))+ xs flatToBullets :: [Block] -> [Block] flatToBullets elems = flatToBullets' (-1) elems +singleItemHeaderToHeader :: Block -> Block+singleItemHeaderToHeader (OrderedList _ [[h@Header{}]]) = h+singleItemHeaderToHeader blk = blk++ blocksToBullets :: [Block] -> [Block] blocksToBullets blks =- bottomUp removeListDivs $- flatToBullets $ (handleListParagraphs blks)+ map singleItemHeaderToHeader $+ walk removeListDivs $ flatToBullets (handleListParagraphs blks) plainParaInlines :: Block -> [Inline] plainParaInlines (Plain ils) = ils-plainParaInlines (Para ils) = ils-plainParaInlines _ = []+plainParaInlines (Para ils) = ils+plainParaInlines _ = [] blocksToDefinitions' :: [([Inline], [[Block]])] -> [Block] -> [Block] -> [Block] blocksToDefinitions' [] acc [] = reverse acc blocksToDefinitions' defAcc acc [] =- reverse $ (DefinitionList (reverse defAcc)) : acc+ reverse $ DefinitionList (reverse defAcc) : acc blocksToDefinitions' defAcc acc- ((Div (_, classes1, _) blks1) : (Div (ident2, classes2, kvs2) blks2) : blks)- | "DefinitionTerm" `elem` classes1 && "Definition" `elem` classes2 =+ (Div (_, classes1, _) blks1 : Div (ident2, classes2, kvs2) blks2 : blks)+ | "Definition-Term" `elem` classes1 && "Definition" `elem` classes2 = let remainingAttr2 = (ident2, delete "Definition" classes2, kvs2)- pair = case remainingAttr2 == ("", [], []) of- True -> (concatMap plainParaInlines blks1, [blks2])- False -> (concatMap plainParaInlines blks1, [[Div remainingAttr2 blks2]])+ pair = if remainingAttr2 == ("", [], []) then (concatMap plainParaInlines blks1, [blks2]) else (concatMap plainParaInlines blks1, [[Div remainingAttr2 blks2]]) in blocksToDefinitions' (pair : defAcc) acc blks-blocksToDefinitions' defAcc acc- ((Div (ident2, classes2, kvs2) blks2) : blks)- | (not . null) defAcc && "Definition" `elem` classes2 =+blocksToDefinitions' ((defTerm, defItems):defs) acc+ (Div (ident2, classes2, kvs2) blks2 : blks)+ | "Definition" `elem` classes2 = let remainingAttr2 = (ident2, delete "Definition" classes2, kvs2)- defItems2 = case remainingAttr2 == ("", [], []) of- True -> blks2- False -> [Div remainingAttr2 blks2]- ((defTerm, defItems):defs) = defAcc- defAcc' = case null defItems of- True -> (defTerm, [defItems2]) : defs- False -> (defTerm, init defItems ++ [last defItems ++ defItems2]) : defs+ defItems2 = if remainingAttr2 == ("", [], [])+ then blks2+ else [Div remainingAttr2 blks2]+ defAcc' = if null defItems+ then (defTerm, [defItems2]) : defs+ else (defTerm, init defItems ++ [last defItems ++ defItems2]) : defs in blocksToDefinitions' defAcc' acc blks blocksToDefinitions' [] acc (b:blks) = blocksToDefinitions' [] (b:acc) blks blocksToDefinitions' defAcc acc (b:blks) =- blocksToDefinitions' [] (b : (DefinitionList (reverse defAcc)) : acc) blks+ blocksToDefinitions' [] (b : DefinitionList (reverse defAcc) : acc) blks removeListDivs' :: Block -> [Block] removeListDivs' (Div (ident, classes, kvs) blks) | "list-item" `elem` classes = case delete "list-item" classes of- [] -> blks- classes' -> [Div (ident, classes', kvs) $ blks]+ [] -> blks+ classes' -> [Div (ident, classes', kvs) blks] removeListDivs' (Div (ident, classes, kvs) blks) | not $ null $ listParagraphDivs `intersect` classes = case classes \\ listParagraphDivs of- [] -> blks+ [] -> blks classes' -> [Div (ident, classes', kvs) blks] removeListDivs' blk = [blk] removeListDivs :: [Block] -> [Block] removeListDivs = concatMap removeListDivs' -- blocksToDefinitions :: [Block] -> [Block] blocksToDefinitions = blocksToDefinitions' [] []----
@@ -1,813 +1,1502 @@-{-# LANGUAGE PatternGuards, ViewPatterns #-}--{--Copyright (C) 2014 Jesse Rosenthal <jrosenthal@jhu.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.Readers.Docx.Parse- Copyright : Copyright (C) 2014 Jesse Rosenthal- License : GNU GPL, version 2 or above-- Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>- Stability : alpha- Portability : portable--Conversion of docx archive into Docx haskell type--}--module Text.Pandoc.Readers.Docx.Parse ( Docx(..)- , Document(..)- , Body(..)- , BodyPart(..)- , TblLook(..)- , ParPart(..)- , Run(..)- , RunElem(..)- , Notes- , Numbering- , Relationship- , Media- , RunStyle(..)- , VertAlign(..)- , ParIndentation(..)- , ParagraphStyle(..)- , Row(..)- , Cell(..)- , archiveToDocx- ) where-import Codec.Archive.Zip-import Text.XML.Light-import Data.Maybe-import Data.List-import System.FilePath-import Data.Bits ((.|.))-import qualified Data.ByteString.Lazy as B-import qualified Text.Pandoc.UTF8 as UTF8-import Control.Monad.Reader-import Control.Applicative ((<$>), (<|>))-import qualified Data.Map as M-import Text.Pandoc.Compat.Except-import Text.TeXMath.Readers.OMML (readOMML)-import Text.Pandoc.Readers.Docx.Fonts (getUnicode, Font(..))-import Text.TeXMath (Exp)-import Data.Char (readLitChar, ord, chr)--data ReaderEnv = ReaderEnv { envNotes :: Notes- , envNumbering :: Numbering- , envRelationships :: [Relationship]- , envMedia :: Media- , envFont :: Maybe Font- , envCharStyles :: CharStyleMap- }- deriving Show--data DocxError = DocxError | WrongElem- deriving Show--instance Error DocxError where- noMsg = WrongElem--type D = ExceptT DocxError (Reader ReaderEnv)--runD :: D a -> ReaderEnv -> Either DocxError a-runD dx re = runReader (runExceptT dx ) re--maybeToD :: Maybe a -> D a-maybeToD (Just a) = return a-maybeToD Nothing = throwError DocxError--eitherToD :: Either a b -> D b-eitherToD (Right b) = return b-eitherToD (Left _) = throwError DocxError--concatMapM :: (Monad m) => (a -> m [b]) -> [a] -> m [b]-concatMapM f xs = liftM concat (mapM f xs)----- This is similar to `mapMaybe`: it maps a function returning the D--- monad over a list, and only keeps the non-erroring return values.-mapD :: (a -> D b) -> [a] -> D [b]-mapD f xs =- let handler x = (f x >>= (\y-> return [y])) `catchError` (\_ -> return [])- in- concatMapM handler xs--type NameSpaces = [(String, String)]--data Docx = Docx Document- deriving Show--data Document = Document NameSpaces Body- deriving Show--data Body = Body [BodyPart]- deriving Show--type Media = [(FilePath, B.ByteString)]--type CharStyle = (String, RunStyle)--type CharStyleMap = M.Map String RunStyle--data Numbering = Numbering NameSpaces [Numb] [AbstractNumb]- deriving Show--data Numb = Numb String String -- right now, only a key to an abstract num- deriving Show--data AbstractNumb = AbstractNumb String [Level]- deriving Show---- (ilvl, format, string, start)-type Level = (String, String, String, Maybe Integer)--data Relationship = Relationship (RelId, Target)- deriving Show--data Notes = Notes NameSpaces- (Maybe (M.Map String Element))- (Maybe (M.Map String Element))- deriving Show--data ParIndentation = ParIndentation { leftParIndent :: Maybe Integer- , rightParIndent :: Maybe Integer- , hangingParIndent :: Maybe Integer}- deriving Show--data ParagraphStyle = ParagraphStyle { pStyle :: [String]- , indentation :: Maybe ParIndentation- , dropCap :: Bool- }- deriving Show--defaultParagraphStyle :: ParagraphStyle-defaultParagraphStyle = ParagraphStyle { pStyle = []- , indentation = Nothing- , dropCap = False- }---data BodyPart = Paragraph ParagraphStyle [ParPart]- | ListItem ParagraphStyle String String Level [ParPart]- | Tbl String TblGrid TblLook [Row]- | OMathPara [Exp]- deriving Show--type TblGrid = [Integer]--data TblLook = TblLook {firstRowFormatting::Bool}- deriving Show--defaultTblLook :: TblLook-defaultTblLook = TblLook{firstRowFormatting = False}--data Row = Row [Cell]- deriving Show--data Cell = Cell [BodyPart]- deriving Show--data ParPart = PlainRun Run- | Insertion ChangeId Author ChangeDate [Run]- | Deletion ChangeId Author ChangeDate [Run]- | BookMark BookMarkId Anchor- | InternalHyperLink Anchor [Run]- | ExternalHyperLink URL [Run]- | Drawing FilePath B.ByteString- | PlainOMath [Exp]- deriving Show--data Run = Run RunStyle [RunElem]- | Footnote [BodyPart]- | Endnote [BodyPart]- | InlineDrawing FilePath B.ByteString- deriving Show--data RunElem = TextRun String | LnBrk | Tab- deriving Show--data VertAlign = BaseLn | SupScrpt | SubScrpt- deriving Show--data RunStyle = RunStyle { isBold :: Maybe Bool- , isItalic :: Maybe Bool- , isSmallCaps :: Maybe Bool- , isStrike :: Maybe Bool- , rVertAlign :: Maybe VertAlign- , rUnderline :: Maybe String- , rStyle :: Maybe CharStyle}- deriving Show--defaultRunStyle :: RunStyle-defaultRunStyle = RunStyle { isBold = Nothing- , isItalic = Nothing- , isSmallCaps = Nothing- , isStrike = Nothing- , rVertAlign = Nothing- , rUnderline = Nothing- , rStyle = Nothing}---type Target = String-type Anchor = String-type URL = String-type BookMarkId = String-type RelId = String-type ChangeId = String-type Author = String-type ChangeDate = String--attrToNSPair :: Attr -> Maybe (String, String)-attrToNSPair (Attr (QName s _ (Just "xmlns")) val) = Just (s, val)-attrToNSPair _ = Nothing--archiveToDocx :: Archive -> Either DocxError Docx-archiveToDocx archive = do- let notes = archiveToNotes archive- numbering = archiveToNumbering archive- rels = archiveToRelationships archive- media = archiveToMedia archive- styles = archiveToStyles archive- rEnv = ReaderEnv notes numbering rels media Nothing styles- doc <- runD (archiveToDocument archive) rEnv- return $ Docx doc---archiveToDocument :: Archive -> D Document-archiveToDocument zf = do- entry <- maybeToD $ findEntryByPath "word/document.xml" zf- docElem <- maybeToD $ (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry- let namespaces = mapMaybe attrToNSPair (elAttribs docElem)- bodyElem <- maybeToD $ findChild (elemName namespaces "w" "body") docElem- body <- elemToBody namespaces bodyElem- return $ Document namespaces body--elemToBody :: NameSpaces -> Element -> D Body-elemToBody ns element | isElem ns "w" "body" element =- mapD (elemToBodyPart ns) (elChildren element) >>=- (\bps -> return $ Body bps)-elemToBody _ _ = throwError WrongElem--archiveToStyles :: Archive -> CharStyleMap-archiveToStyles zf =- let stylesElem = findEntryByPath "word/styles.xml" zf >>=- (parseXMLDoc . UTF8.toStringLazy . fromEntry)- in- case stylesElem of- Nothing -> M.empty- Just styElem ->- let namespaces = mapMaybe attrToNSPair (elAttribs styElem)- in- M.fromList $ buildBasedOnList namespaces styElem Nothing--isBasedOnStyle :: NameSpaces -> Element -> Maybe CharStyle -> Bool-isBasedOnStyle ns element parentStyle- | isElem ns "w" "style" element- , Just "character" <- findAttr (elemName ns "w" "type") element- , Just basedOnVal <- findChild (elemName ns "w" "basedOn") element >>=- findAttr (elemName ns "w" "val")- , Just (parentId, _) <- parentStyle = (basedOnVal == parentId)- | isElem ns "w" "style" element- , Just "character" <- findAttr (elemName ns "w" "type") element- , Nothing <- findChild (elemName ns "w" "basedOn") element- , Nothing <- parentStyle = True- | otherwise = False--elemToCharStyle :: NameSpaces -> Element -> Maybe CharStyle -> Maybe CharStyle-elemToCharStyle ns element parentStyle- | isElem ns "w" "style" element- , Just "character" <- findAttr (elemName ns "w" "type") element- , Just styleId <- findAttr (elemName ns "w" "styleId") element =- Just (styleId, elemToRunStyle ns element parentStyle)- | otherwise = Nothing--getStyleChildren :: NameSpaces -> Element -> Maybe CharStyle -> [CharStyle]-getStyleChildren ns element parentStyle- | isElem ns "w" "styles" element =- mapMaybe (\e -> elemToCharStyle ns e parentStyle) $- filterChildren (\e' -> isBasedOnStyle ns e' parentStyle) element- | otherwise = []--buildBasedOnList :: NameSpaces -> Element -> Maybe CharStyle -> [CharStyle]-buildBasedOnList ns element rootStyle =- case (getStyleChildren ns element rootStyle) of- [] -> []- stys -> stys ++- (concatMap (\s -> buildBasedOnList ns element (Just s)) stys)--archiveToNotes :: Archive -> Notes-archiveToNotes zf =- let fnElem = findEntryByPath "word/footnotes.xml" zf- >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry)- enElem = findEntryByPath "word/endnotes.xml" zf- >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry)- fn_namespaces = case fnElem of- Just e -> mapMaybe attrToNSPair (elAttribs e)- Nothing -> []- en_namespaces = case enElem of- Just e -> mapMaybe attrToNSPair (elAttribs e)- Nothing -> []- ns = unionBy (\x y -> fst x == fst y) fn_namespaces en_namespaces- fn = fnElem >>= (elemToNotes ns "footnote")- en = enElem >>= (elemToNotes ns "endnote")- in- Notes ns fn en--filePathIsRel :: FilePath -> Bool-filePathIsRel fp =- let (dir, name) = splitFileName fp- in- (dir == "word/_rels/") && ((takeExtension name) == ".rels")--relElemToRelationship :: Element -> Maybe Relationship-relElemToRelationship 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---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--filePathIsMedia :: FilePath -> Bool-filePathIsMedia fp =- let (dir, _) = splitFileName fp- in- (dir == "word/media/")--getMediaPair :: Archive -> FilePath -> Maybe (FilePath, B.ByteString)-getMediaPair zf fp =- case findEntryByPath fp zf of- Just e -> Just (fp, fromEntry e)- Nothing -> Nothing--archiveToMedia :: Archive -> Media-archiveToMedia zf =- mapMaybe (getMediaPair zf) (filter filePathIsMedia (filesInArchive zf))--lookupLevel :: String -> String -> Numbering -> Maybe Level-lookupLevel numId ilvl (Numbering _ numbs absNumbs) = do- absNumId <- lookup numId $ map (\(Numb nid absnumid) -> (nid, absnumid)) numbs- lvls <- lookup absNumId $ map (\(AbstractNumb aid ls) -> (aid, ls)) absNumbs- lvl <- lookup ilvl $ map (\l@(i, _, _, _) -> (i, l)) lvls- return lvl--numElemToNum :: NameSpaces -> Element -> Maybe Numb-numElemToNum ns element |- qName (elName element) == "num" &&- qURI (elName element) == (lookup "w" ns) = do- numId <- findAttr (QName "numId" (lookup "w" ns) (Just "w")) element- absNumId <- findChild (QName "abstractNumId" (lookup "w" ns) (Just "w")) element- >>= findAttr (QName "val" (lookup "w" ns) (Just "w"))- return $ Numb numId absNumId-numElemToNum _ _ = Nothing--absNumElemToAbsNum :: NameSpaces -> Element -> Maybe AbstractNumb-absNumElemToAbsNum ns element |- qName (elName element) == "abstractNum" &&- qURI (elName element) == (lookup "w" ns) = do- absNumId <- findAttr- (QName "abstractNumId" (lookup "w" ns) (Just "w"))- element- let levelElems = findChildren- (QName "lvl" (lookup "w" ns) (Just "w"))- element- levels = mapMaybe (levelElemToLevel ns) levelElems- return $ AbstractNumb absNumId levels-absNumElemToAbsNum _ _ = Nothing--levelElemToLevel :: NameSpaces -> Element -> Maybe Level-levelElemToLevel ns element |- qName (elName element) == "lvl" &&- qURI (elName element) == (lookup "w" ns) = do- ilvl <- findAttr (QName "ilvl" (lookup "w" ns) (Just "w")) element- fmt <- findChild (QName "numFmt" (lookup "w" ns) (Just "w")) element- >>= findAttr (QName "val" (lookup "w" ns) (Just "w"))- txt <- findChild (QName "lvlText" (lookup "w" ns) (Just "w")) element- >>= findAttr (QName "val" (lookup "w" ns) (Just "w"))- let start = findChild (QName "start" (lookup "w" ns) (Just "w")) element- >>= findAttr (QName "val" (lookup "w" ns) (Just "w"))- >>= (\s -> listToMaybe (map fst (reads s :: [(Integer, String)])))- return (ilvl, fmt, txt, start)-levelElemToLevel _ _ = Nothing--archiveToNumbering' :: Archive -> Maybe Numbering-archiveToNumbering' zf = do- case findEntryByPath "word/numbering.xml" zf of- Nothing -> Just $ Numbering [] [] []- Just entry -> do- numberingElem <- (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry- let namespaces = mapMaybe attrToNSPair (elAttribs numberingElem)- numElems = findChildren- (QName "num" (lookup "w" namespaces) (Just "w"))- numberingElem- absNumElems = findChildren- (QName "abstractNum" (lookup "w" namespaces) (Just "w"))- numberingElem- nums = mapMaybe (numElemToNum namespaces) numElems- absNums = mapMaybe (absNumElemToAbsNum namespaces) absNumElems- return $ Numbering namespaces nums absNums--archiveToNumbering :: Archive -> Numbering-archiveToNumbering archive =- fromMaybe (Numbering [] [] []) (archiveToNumbering' archive)--elemToNotes :: NameSpaces -> String -> Element -> Maybe (M.Map String Element)-elemToNotes ns notetype element- | isElem ns "w" (notetype ++ "s") element =- let pairs = mapMaybe- (\e -> findAttr (elemName ns "w" "id") e >>=- (\a -> Just (a, e)))- (findChildren (elemName ns "w" notetype) element)- in- Just $ M.fromList $ pairs-elemToNotes _ _ _ = Nothing-----------------------------------------------------------------------------------------------elemName :: NameSpaces -> String -> String -> QName-elemName ns prefix name = (QName name (lookup prefix ns) (Just prefix))--isElem :: NameSpaces -> String -> String -> Element -> Bool-isElem ns prefix name element =- qName (elName element) == name &&- qURI (elName element) == (lookup prefix ns)---elemToTblGrid :: NameSpaces -> Element -> D TblGrid-elemToTblGrid ns element | isElem ns "w" "tblGrid" element =- let cols = findChildren (elemName ns "w" "gridCol") element- in- mapD (\e -> maybeToD (findAttr (elemName ns "w" "val") e >>= stringToInteger))- cols-elemToTblGrid _ _ = throwError WrongElem--elemToTblLook :: NameSpaces -> Element -> D TblLook-elemToTblLook ns element | isElem ns "w" "tblLook" element =- let firstRow = findAttr (elemName ns "w" "firstRow") element- val = findAttr (elemName ns "w" "val") element- firstRowFmt =- case firstRow of- Just "1" -> True- Just _ -> False- Nothing -> case val of- Just bitMask -> testBitMask bitMask 0x020- Nothing -> False- in- return $ TblLook{firstRowFormatting = firstRowFmt}-elemToTblLook _ _ = throwError WrongElem--elemToRow :: NameSpaces -> Element -> D Row-elemToRow ns element | isElem ns "w" "tr" element =- do- let cellElems = findChildren (elemName ns "w" "tc") element- cells <- mapD (elemToCell ns) cellElems- return $ Row cells-elemToRow _ _ = throwError WrongElem--elemToCell :: NameSpaces -> Element -> D Cell-elemToCell ns element | isElem ns "w" "tc" element =- do- cellContents <- mapD (elemToBodyPart ns) (elChildren element)- return $ Cell cellContents-elemToCell _ _ = throwError WrongElem--elemToParIndentation :: NameSpaces -> Element -> Maybe ParIndentation-elemToParIndentation ns element | isElem ns "w" "ind" element =- Just $ ParIndentation {- leftParIndent =- findAttr (QName "left" (lookup "w" ns) (Just "w")) element >>=- stringToInteger- , rightParIndent =- findAttr (QName "right" (lookup "w" ns) (Just "w")) element >>=- stringToInteger- , hangingParIndent =- findAttr (QName "hanging" (lookup "w" ns) (Just "w")) element >>=- stringToInteger}-elemToParIndentation _ _ = Nothing---elemToNumInfo :: NameSpaces -> Element -> Maybe (String, String)-elemToNumInfo ns element | isElem ns "w" "p" element = do- let pPr = findChild (elemName ns "w" "pPr") element- numPr = pPr >>= findChild (elemName ns "w" "numPr")- lvl <- numPr >>=- findChild (elemName ns "w" "ilvl") >>=- findAttr (elemName ns "w" "val")- numId <- numPr >>=- findChild (elemName ns "w" "numId") >>=- findAttr (elemName ns "w" "val")- return (numId, lvl)-elemToNumInfo _ _ = Nothing--testBitMask :: String -> Int -> Bool-testBitMask bitMaskS n =- case (reads ("0x" ++ bitMaskS) :: [(Int, String)]) of- [] -> False- ((n', _) : _) -> ((n' .|. n) /= 0)--stringToInteger :: String -> Maybe Integer-stringToInteger s = listToMaybe $ map fst (reads s :: [(Integer, String)])--elemToBodyPart :: NameSpaces -> Element -> D BodyPart-elemToBodyPart ns element- | isElem ns "w" "p" element- , (c:_) <- findChildren (elemName ns "m" "oMathPara") element =- do- expsLst <- eitherToD $ readOMML $ showElement c- return $ OMathPara expsLst-elemToBodyPart ns element- | isElem ns "w" "p" element- , Just (numId, lvl) <- elemToNumInfo ns element = do- let parstyle = elemToParagraphStyle ns element- parparts <- mapD (elemToParPart ns) (elChildren element)- num <- asks envNumbering- case lookupLevel numId lvl num of- Just levelInfo -> return $ ListItem parstyle numId lvl levelInfo parparts- Nothing -> throwError WrongElem-elemToBodyPart ns element- | isElem ns "w" "p" element = do- let parstyle = elemToParagraphStyle ns element- parparts <- mapD (elemToParPart ns) (elChildren element)- return $ Paragraph parstyle parparts-elemToBodyPart ns element- | isElem ns "w" "tbl" element = do- let caption' = findChild (elemName ns "w" "tblPr") element- >>= findChild (elemName ns "w" "tblCaption")- >>= findAttr (elemName ns "w" "val")- caption = (fromMaybe "" caption')- grid' = case findChild (elemName ns "w" "tblGrid") element of- Just g -> elemToTblGrid ns g- Nothing -> return []- tblLook' = case findChild (elemName ns "w" "tblPr") element >>=- findChild (elemName ns "w" "tblLook")- of- Just l -> elemToTblLook ns l- Nothing -> return defaultTblLook-- grid <- grid'- tblLook <- tblLook'- rows <- mapD (elemToRow ns) (elChildren 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)--expandDrawingId :: String -> D (FilePath, B.ByteString)-expandDrawingId s = do- target <- asks (lookupRelationship s . envRelationships)- case target of- Just filepath -> do- bytes <- asks (lookup (combine "word" filepath) . envMedia)- case bytes of- Just bs -> return (filepath, bs)- Nothing -> throwError DocxError- Nothing -> throwError DocxError--elemToParPart :: NameSpaces -> Element -> D ParPart-elemToParPart ns element- | isElem ns "w" "r" element- , Just _ <- findChild (elemName ns "w" "drawing") element =- let a_ns = "http://schemas.openxmlformats.org/drawingml/2006/main"- drawing = findElement (QName "blip" (Just a_ns) (Just "a")) element- >>= findAttr (QName "embed" (lookup "r" ns) (Just "r"))- in- case drawing of- Just s -> expandDrawingId s >>= (\(fp, bs) -> return $ Drawing fp bs)- Nothing -> throwError WrongElem-elemToParPart ns element- | isElem ns "w" "r" element =- elemToRun ns element >>= (\r -> return $ PlainRun r)-elemToParPart ns element- | isElem ns "w" "ins" element- , Just cId <- findAttr (elemName ns "w" "id") element- , Just cAuthor <- findAttr (elemName ns "w" "author") element- , Just cDate <- findAttr (elemName ns "w" "date") element = do- runs <- mapD (elemToRun ns) (elChildren element)- return $ Insertion cId cAuthor cDate runs-elemToParPart ns element- | isElem ns "w" "del" element- , Just cId <- findAttr (elemName ns "w" "id") element- , Just cAuthor <- findAttr (elemName ns "w" "author") element- , Just cDate <- findAttr (elemName ns "w" "date") element = do- runs <- mapD (elemToRun ns) (elChildren element)- return $ Deletion cId cAuthor cDate runs-elemToParPart ns element- | isElem ns "w" "bookmarkStart" element- , Just bmId <- findAttr (elemName ns "w" "id") element- , Just bmName <- findAttr (elemName ns "w" "name") element =- return $ BookMark bmId bmName-elemToParPart ns element- | isElem ns "w" "hyperlink" element- , Just anchor <- findAttr (elemName ns "w" "anchor") element = do- runs <- mapD (elemToRun ns) (elChildren element)- return $ InternalHyperLink anchor runs-elemToParPart ns element- | isElem ns "w" "hyperlink" element- , Just relId <- findAttr (elemName ns "r" "id") element = do- runs <- mapD (elemToRun ns) (elChildren element)- rels <- asks envRelationships- return $ case lookupRelationship relId rels of- Just target -> ExternalHyperLink target runs- Nothing -> ExternalHyperLink "" runs-elemToParPart ns element- | isElem ns "m" "oMath" element =- (eitherToD $ readOMML $ showElement element) >>= (return . PlainOMath)-elemToParPart _ _ = throwError WrongElem--lookupFootnote :: String -> Notes -> Maybe Element-lookupFootnote s (Notes _ fns _) = fns >>= (M.lookup s)--lookupEndnote :: String -> Notes -> Maybe Element-lookupEndnote s (Notes _ _ ens) = ens >>= (M.lookup s)--elemToRun :: NameSpaces -> Element -> D Run-elemToRun ns element- | isElem ns "w" "r" element- , Just drawingElem <- findChild (elemName ns "w" "drawing") element =- let a_ns = "http://schemas.openxmlformats.org/drawingml/2006/main"- drawing = findElement (QName "blip" (Just a_ns) (Just "a")) drawingElem- >>= findAttr (QName "embed" (lookup "r" ns) (Just "r"))- in- case drawing of- Just s -> expandDrawingId s >>=- (\(fp, bs) -> return $ InlineDrawing fp bs)- Nothing -> throwError WrongElem-elemToRun ns element- | isElem ns "w" "r" element- , Just ref <- findChild (elemName ns "w" "footnoteReference") 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)- return $ Footnote bps- Nothing -> return $ Footnote []-elemToRun ns element- | isElem ns "w" "r" element- , Just ref <- findChild (elemName ns "w" "endnoteReference") 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)- return $ Endnote bps- Nothing -> return $ Endnote []-elemToRun ns element- | isElem ns "w" "r" element = do- runElems <- elemToRunElems ns element- runStyle <- elemToRunStyleD ns element- return $ Run runStyle runElems-elemToRun _ _ = throwError WrongElem--elemToParagraphStyle :: NameSpaces -> Element -> ParagraphStyle-elemToParagraphStyle ns element- | Just pPr <- findChild (elemName ns "w" "pPr") element =- ParagraphStyle- {pStyle =- mapMaybe- (findAttr (elemName ns "w" "val"))- (findChildren (elemName ns "w" "pStyle") pPr)- , indentation =- findChild (elemName ns "w" "ind") pPr >>=- elemToParIndentation ns- , dropCap =- case- findChild (elemName ns "w" "framePr") pPr >>=- findAttr (elemName ns "w" "dropCap")- of- Just "none" -> False- Just _ -> True- Nothing -> False- }-elemToParagraphStyle _ _ = defaultParagraphStyle--checkOnOff :: NameSpaces -> Element -> QName -> Maybe Bool-checkOnOff ns rPr tag- | Just t <- findChild tag rPr- , Just val <- findAttr (elemName ns "w" "val") t =- Just $ case val of- "true" -> True- "false" -> False- "on" -> True- "off" -> False- "1" -> True- "0" -> False- _ -> False- | Just _ <- findChild tag rPr = Just True-checkOnOff _ _ _ = Nothing--elemToRunStyleD :: NameSpaces -> Element -> D RunStyle-elemToRunStyleD ns element- | Just rPr <- findChild (elemName ns "w" "rPr") element = do- charStyles <- asks envCharStyles- let parentSty = case- findChild (elemName ns "w" "rStyle") rPr >>=- findAttr (elemName ns "w" "val")- of- Just styName | Just style <- M.lookup styName charStyles ->- Just (styName, style)- _ -> Nothing- return $ elemToRunStyle ns element parentSty-elemToRunStyleD _ _ = return defaultRunStyle--elemToRunStyle :: NameSpaces -> Element -> Maybe CharStyle -> RunStyle-elemToRunStyle ns element parentStyle- | Just rPr <- findChild (elemName ns "w" "rPr") element =- RunStyle- {- isBold = checkOnOff ns rPr (elemName ns "w" "b")- , isItalic = checkOnOff ns rPr (elemName ns "w" "i")- , isSmallCaps = checkOnOff ns rPr (elemName ns "w" "smallCaps")- , isStrike = checkOnOff ns rPr (elemName ns "w" "strike")- , rVertAlign =- findChild (elemName ns "w" "vertAlign") rPr >>=- findAttr (elemName ns "w" "val") >>=- \v -> Just $ case v of- "superscript" -> SupScrpt- "subscript" -> SubScrpt- _ -> BaseLn- , rUnderline =- findChild (elemName ns "w" "u") rPr >>=- findAttr (elemName ns "w" "val")- , rStyle = parentStyle- }-elemToRunStyle _ _ _ = defaultRunStyle--elemToRunElem :: NameSpaces -> Element -> D RunElem-elemToRunElem ns element- | isElem ns "w" "t" element- || isElem ns "w" "delText" element- || isElem ns "m" "t" element = do- let str = strContent element- font <- asks envFont- case font of- Nothing -> return $ TextRun str- Just f -> return . TextRun $- map (\x -> fromMaybe x . getUnicode f . lowerFromPrivate $ x) str- | isElem ns "w" "br" element = return LnBrk- | isElem ns "w" "tab" element = return Tab- | isElem ns "w" "sym" element = return (getSymChar ns element)- | otherwise = throwError WrongElem- where- lowerFromPrivate (ord -> c)- | c >= ord '\xF000' = chr $ c - ord '\xF000'- | otherwise = chr c---- The char attribute is a hex string-getSymChar :: NameSpaces -> Element -> RunElem-getSymChar ns element- | Just s <- lowerFromPrivate <$> getCodepoint- , Just font <- getFont =- let [(char, _)] = readLitChar ("\\x" ++ s) in- TextRun . maybe "" (:[]) $ getUnicode font char- where- getCodepoint = findAttr (elemName ns "w" "char") element- getFont = stringToFont =<< findAttr (elemName ns "w" "font") element- lowerFromPrivate ('F':xs) = '0':xs- lowerFromPrivate xs = xs-getSymChar _ _ = TextRun ""--stringToFont :: String -> Maybe Font-stringToFont "Symbol" = Just Symbol-stringToFont _ = Nothing--elemToRunElems :: NameSpaces -> Element -> D [RunElem]-elemToRunElems ns element- | isElem ns "w" "r" element- || isElem ns "m" "r" element = do- let qualName = elemName ns "w"- let font = do- fontElem <- findElement (qualName "rFonts") element- stringToFont =<<- (foldr (<|>) Nothing $- map (flip findAttr fontElem . qualName) ["ascii", "hAnsi"])- local (setFont font) (mapD (elemToRunElem ns) (elChildren element))-elemToRunElems _ _ = throwError WrongElem--setFont :: Maybe Font -> ReaderEnv -> ReaderEnv-setFont f s = s{envFont = f}+{-# LANGUAGE TupleSections #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Readers.Docx.Parse+ Copyright : Copyright (C) 2014-2020 Jesse Rosenthal+ 2019 Nikolay Yakimov <root@livid.pp.ru>+ License : GNU GPL, version 2 or above++ Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>+ Stability : alpha+ Portability : portable++Conversion of docx archive into Docx haskell type+-}++module Text.Pandoc.Readers.Docx.Parse ( Docx(..)+ , Document(..)+ , Body(..)+ , BodyPart(..)+ , TblLook(..)+ , Extent+ , ParPart(..)+ , Run(..)+ , RunElem(..)+ , Notes+ , Numbering+ , Relationship+ , Media+ , RunStyle(..)+ , VertAlign(..)+ , ParIndentation(..)+ , Justification(..)+ , ParagraphStyle(..)+ , ParStyle+ , CharStyle(cStyleData)+ , Row(..)+ , TblHeader(..)+ , Align(..)+ , Cell(..)+ , VMerge(..)+ , TrackedChange(..)+ , ChangeType(..)+ , ChangeInfo(..)+ , FieldInfo(..)+ , IndexEntry(..)+ , Level(..)+ , ParaStyleName+ , CharStyleName+ , FromStyleName(..)+ , HasStyleName(..)+ , HasParentStyle(..)+ , archiveToDocx+ , archiveToDocxWithWarnings+ , getStyleNames+ , pHeading+ , pStyleIndentation+ , constructBogusParStyleData+ , leftBiasedMergeRunStyle+ , rowsToRowspans+ , extractTarget+ ) where+import Text.Pandoc.Readers.Docx.Parse.Styles+import Codec.Archive.Zip+import Control.Applicative ((<|>))+import Control.Monad+import Control.Monad.Except+import Control.Monad.Reader+import Control.Monad.State.Strict+import Data.Bits ((.&.))+import qualified Data.ByteString.Lazy as B+import Data.Char (chr, ord, readLitChar)+import Data.List+import qualified Data.Map as M+import qualified Data.Text as T+import Data.Text (Text)+import Data.Maybe+import System.FilePath+import Text.Pandoc.Readers.Docx.Util+import Text.Pandoc.Readers.Docx.Fields+import Text.Pandoc.Shared (filteredFilesFromArchive, safeRead)+import qualified Text.Pandoc.UTF8 as UTF8+import Text.TeXMath (Exp)+import Text.TeXMath.Readers.OMML (readOMML)+import Text.Pandoc.Readers.Docx.Symbols (symbolMap, Font(..), textToFont)+import Text.Pandoc.XML.Light+ ( filterChild,+ findElement,+ strContent,+ showElement,+ findAttr,+ filterChild,+ filterChildrenName,+ filterElementName,+ filterElementsName,+ lookupAttrBy,+ parseXMLElement,+ elChildren,+ QName(QName, qName),+ Content(Elem),+ Element(..))++data ReaderEnv = ReaderEnv { envNotes :: Notes+ , envComments :: Comments+ , envNumbering :: Numbering+ , envRelationships :: [Relationship]+ , envMedia :: Media+ , envFont :: Maybe Font+ , envCharStyles :: CharStyleMap+ , envParStyles :: ParStyleMap+ , envLocation :: DocumentLocation+ , envDocXmlPath :: FilePath+ , envTextWidth :: Int+ }+ deriving Show++data ReaderState = ReaderState { stateWarnings :: [T.Text]+ , stateFldCharState :: [FldCharState]+ }+ deriving Show++data FldCharState = FldCharOpen+ | FldCharFieldInfo T.Text+ | FldCharContent FieldInfo [ParPart]+ deriving (Show)++data DocxError = DocxError+ | WrongElem+ deriving Show++type D = ExceptT DocxError (ReaderT ReaderEnv (State ReaderState))++runD :: D a -> ReaderEnv -> ReaderState -> (Either DocxError a, ReaderState)+runD dx re rs = runState (runReaderT (runExceptT dx) re) rs++maybeToD :: Maybe a -> D a+maybeToD (Just a) = return a+maybeToD Nothing = throwError DocxError++eitherToD :: Either a b -> D b+eitherToD (Right b) = return b+eitherToD (Left _) = throwError DocxError++concatMapM :: (Monad m) => (a -> m [b]) -> [a] -> m [b]+concatMapM f xs = liftM concat (mapM f xs)++-- This is similar to `mapMaybe`: it maps a function returning the D+-- monad over a list, and only keeps the non-erroring return values.+mapD :: (a -> D b) -> [a] -> D [b]+mapD f xs =+ let handler x = (f x >>= (\y-> return [y])) `catchError` (\_ -> return [])+ in+ concatMapM handler xs++unwrapElement :: NameSpaces -> Element -> [Element]+unwrapElement ns element+ | isElem ns "w" "sdt" element+ , Just sdtContent <- findChildByName ns "w" "sdtContent" element+ = concatMap (unwrapElement ns) (elChildren sdtContent)+ | isElem ns "w" "smartTag" element+ = concatMap (unwrapElement ns) (elChildren element)+ | isElem ns "w" "p" element+ , _:_ <- findChildrenByName ns "w" "r" element >>= findTextboxes+ = let result = splitP (elContent element) [] -- handle #9214, #11053+ in [element{ elName = QName "textbox-image" Nothing Nothing+ , elContent = map Elem result }]+ | isElem ns "w" "r" element+ , Just fallback <- findChildByName ns "mc" "AlternateContent" element >>=+ findChildByName ns "mc" "Fallback"+ = [element{ elContent = concatMap (unwrapContent ns) (elContent fallback) }]+ | otherwise+ = [element{ elContent = concatMap (unwrapContent ns) (elContent element) }]+ where+ -- Split a w:p's children around textbox-bearing runs, preserving order.+ -- Non-textbox content is grouped into a copy of the original w:p;+ -- textbox content is unwrapped into sibling elements in place.+ splitP [] acc = [wrapP acc | hasContent acc]+ splitP (c:cs) acc+ | Elem el <- c+ , isElem ns "w" "r" el+ , tbs@(_:_) <- findTextboxes el+ = [wrapP acc | hasContent acc]+ ++ concatMap (unwrapElement ns) (concatMap elChildren tbs)+ ++ splitP cs []+ | otherwise+ = splitP cs (acc ++ [c])+ wrapP cs = element{ elContent = concatMap (unwrapContent ns) cs }+ hasContent = any (\case Elem el -> isElem ns "w" "r" el+ && any (isContentElem . elName)+ (elChildren el)+ _ -> False)+ isContentElem n = qName n `elem`+ ["t", "drawing", "pict", "br", "tab", "sym", "fldChar", "instrText"]+ -- Search textbox content in the run's effective children.+ -- If AlternateContent is present, use only the fallback branch,+ -- matching the w:r unwrapping logic and avoiding duplicate textbox+ -- extraction when both direct and fallback encodings are present.+ findRunFallback run =+ findChildByName ns "mc" "AlternateContent" run >>=+ findChildByName ns "mc" "Fallback"+ findTextboxes run =+ findTextboxContent =<<+ case findRunFallback run of+ Just fallback -> findChildrenByName ns "w" "pict" fallback+ Nothing -> findChildrenByName ns "w" "pict" run+ findTextboxContent pict =+ (findChildrenByName ns "v" "shape" pict <>+ findChildrenByName ns "v" "rect" pict) >>=+ findChildrenByName ns "v" "textbox" >>=+ findChildrenByName ns "w" "txbxContent"++unwrapContent :: NameSpaces -> Content -> [Content]+unwrapContent ns (Elem element) = map Elem $ unwrapElement ns element+unwrapContent _ content = [content]++walkDocument :: NameSpaces -> Element -> Element+walkDocument ns element =+ element{ elContent = concatMap (unwrapContent ns) (elContent element) }++newtype Docx = Docx Document+ deriving Show++data Document = Document NameSpaces Body+ deriving Show++newtype Body = Body [BodyPart]+ deriving Show++type Media = [(FilePath, B.ByteString)]++type CharStyleMap = M.Map CharStyleId CharStyle++type ParStyleMap = M.Map ParaStyleId ParStyle++data Numbering = Numbering NameSpaces [Numb] [AbstractNumb]+ deriving Show++data Numb = Numb T.Text T.Text [LevelOverride]+ deriving Show++-- ilvl startOverride lvl+data LevelOverride = LevelOverride T.Text (Maybe Integer) (Maybe Level)+ deriving Show++data AbstractNumb = AbstractNumb T.Text [Level]+ deriving Show++-- ilvl format string start+data Level = Level T.Text T.Text T.Text (Maybe Integer)+ deriving Show++data DocumentLocation = InDocument | InFootnote | InEndnote+ deriving (Eq,Show)++data Relationship = Relationship DocumentLocation RelId Target+ deriving Show++data Notes = Notes NameSpaces+ (Maybe (M.Map T.Text Element))+ (Maybe (M.Map T.Text Element))+ deriving Show++data Comments = Comments NameSpaces (M.Map T.Text Element)+ deriving Show++data ChangeType = Insertion | Deletion+ deriving Show++data ChangeInfo = ChangeInfo ChangeId Author (Maybe ChangeDate)+ deriving Show++data TrackedChange = TrackedChange ChangeType ChangeInfo+ deriving Show++data Justification = JustifyBoth | JustifyLeft | JustifyRight | JustifyCenter+ deriving (Show, Eq)++data ParagraphStyle = ParagraphStyle { pStyle :: [ParStyle]+ , indentation :: Maybe ParIndentation+ , justification :: Maybe Justification+ , numbered :: Bool+ , dropCap :: Bool+ , pChange :: Maybe TrackedChange+ , pBidi :: Maybe Bool+ , pKeepNext :: Bool+ }+ deriving Show++defaultParagraphStyle :: ParagraphStyle+defaultParagraphStyle = ParagraphStyle { pStyle = []+ , indentation = Nothing+ , justification = Nothing+ , numbered = False+ , dropCap = False+ , pChange = Nothing+ , pBidi = Just False+ , pKeepNext = False+ }+++data BodyPart = Paragraph ParagraphStyle [ParPart]+ | Heading Int ParaStyleName ParagraphStyle T.Text T.Text (Maybe Level)+ [ParPart]+ | ListItem ParagraphStyle T.Text T.Text (Maybe Level) [ParPart]+ | Tbl (Maybe T.Text) T.Text TblGrid TblLook [Row]+ | Captioned ParagraphStyle [ParPart] BodyPart+ | HRule+ deriving Show++type TblGrid = [Double]++newtype TblLook = TblLook {firstRowFormatting::Bool}+ deriving Show++defaultTblLook :: TblLook+defaultTblLook = TblLook{firstRowFormatting = False}++data Row = Row TblHeader [Cell] deriving Show++data TblHeader = HasTblHeader | NoTblHeader deriving (Show, Eq)++data Align = AlignDefault | AlignLeft | AlignRight | AlignCenter+ deriving (Show, Eq)++data Cell = Cell Align GridSpan VMerge [BodyPart]+ deriving Show++emptyCell :: Cell+emptyCell = Cell AlignDefault 1 Restart []++type GridSpan = Integer++data VMerge = Continue+ -- ^ This cell should be merged with the one above it+ | Restart+ -- ^ This cell should not be merged with the one above it+ deriving (Show, Eq)++rowsToRowspans :: [Row] -> [[(Int, Cell)]]+rowsToRowspans rows = let+ removeMergedCells = fmap (filter (\(_, Cell _ _ vmerge _) -> vmerge == Restart))+ in removeMergedCells (foldr f [] rows)+ where+ f :: Row -> [[(Int, Cell)]] -> [[(Int, Cell)]]+ f (Row _ cells) acc = let+ spans = g cells Nothing (listToMaybe acc)+ in spans : acc++ g :: [Cell] -- the current row+ -> Maybe Integer -- Number of columns left below+ -> Maybe [(Int, Cell)] -- (rowspan so far, cell) for the row below this one+ -> [(Int, Cell)] -- (rowspan so far, cell) for this row+ g cells _ Nothing = map (1,) cells+ g cells columnsLeftBelow (Just rowBelow) =+ case cells of+ [] -> []+ thisCell@(Cell _ thisGridSpan _ _) : restOfRow -> case rowBelow of+ [] -> map (1,) cells+ (spanSoFarBelow, Cell _ gridSpanBelow vmerge _) : _ ->+ let spanSoFar = case vmerge of+ Restart -> 1+ Continue -> 1 + spanSoFarBelow+ columnsToDrop = thisGridSpan + (gridSpanBelow - fromMaybe gridSpanBelow columnsLeftBelow)+ (newColumnsLeftBelow, restOfRowBelow) = dropColumns columnsToDrop rowBelow+ in (spanSoFar, thisCell) : g restOfRow (Just newColumnsLeftBelow) (Just restOfRowBelow)++ dropColumns :: Integer -> [(a, Cell)] -> (Integer, [(a, Cell)])+ dropColumns n [] = (n, [])+ dropColumns n cells@((_, Cell _ gridSpan _ _) : otherCells) =+ if n < gridSpan+ then (gridSpan - n, cells)+ else dropColumns (n - gridSpan) otherCells++leftBiasedMergeRunStyle :: RunStyle -> RunStyle -> RunStyle+leftBiasedMergeRunStyle a b = RunStyle+ { isBold = isBold a <|> isBold b+ , isBoldCTL = isBoldCTL a <|> isBoldCTL b+ , isItalic = isItalic a <|> isItalic b+ , isItalicCTL = isItalicCTL a <|> isItalicCTL b+ , isSmallCaps = isSmallCaps a <|> isSmallCaps b+ , isStrike = isStrike a <|> isStrike b+ , isRTL = isRTL a <|> isRTL b+ , isForceCTL = isForceCTL a <|> isForceCTL b+ , rHighlight = rHighlight a <|> rHighlight b+ , rVertAlign = rVertAlign a <|> rVertAlign b+ , rUnderline = rUnderline a <|> rUnderline b+ , rParentStyle = rParentStyle a+ }++-- (width, height) in EMUs+type Extent = Maybe (Double, Double)++data ParPart = PlainRun Run+ | ChangedRuns TrackedChange [ParPart]+ | CommentStart CommentId Author (Maybe CommentDate) [BodyPart]+ | CommentEnd CommentId+ | BookMark BookMarkId Anchor+ | InternalHyperLink Anchor [ParPart]+ | ExternalHyperLink URL [ParPart]+ | Drawing FilePath T.Text T.Text B.ByteString Extent -- title, alt+ | Chart -- placeholder for now+ | Diagram -- placeholder for now+ | PlainOMath [Exp]+ | OMathPara [Exp]+ | Field FieldInfo [ParPart]+ deriving Show++data Run = Run RunStyle [RunElem]+ | Footnote [BodyPart]+ | Endnote [BodyPart]+ | InlineDrawing FilePath T.Text T.Text B.ByteString Extent -- title, alt+ | InlineChart -- placeholder+ | InlineDiagram -- placeholder+ deriving Show++data RunElem = TextRun T.Text | LnBrk | Tab | SoftHyphen | NoBreakHyphen+ deriving Show++type Target = T.Text+type Anchor = T.Text+type URL = T.Text+type BookMarkId = T.Text+type RelId = T.Text+type ChangeId = T.Text+type CommentId = T.Text+type Author = T.Text+type ChangeDate = T.Text+type CommentDate = T.Text++archiveToDocx :: Archive -> Either DocxError Docx+archiveToDocx archive = fst <$> archiveToDocxWithWarnings archive++archiveToDocxWithWarnings :: Archive -> Either DocxError (Docx, [T.Text])+archiveToDocxWithWarnings archive = do+ docXmlPath <- case getDocumentXmlPath archive of+ Just fp -> Right fp+ Nothing -> Left DocxError+ let notes = archiveToNotes archive+ comments = archiveToComments archive+ numbering = archiveToNumbering archive+ rels = archiveToRelationships archive docXmlPath+ media = filteredFilesFromArchive archive filePathIsMedia+ (styles, parstyles) = archiveToStyles archive+ textWidth = archiveToTextWidth archive+ rEnv = ReaderEnv { envNotes = notes+ , envComments = comments+ , envNumbering = numbering+ , envRelationships = rels+ , envMedia = media+ , envFont = Nothing+ , envCharStyles = styles+ , envParStyles = parstyles+ , envLocation = InDocument+ , envDocXmlPath = docXmlPath+ , envTextWidth = fromMaybe 9360 textWidth+ }+ rState = ReaderState { stateWarnings = []+ , stateFldCharState = []+ }+ (eitherDoc, st) = runD (archiveToDocument archive) rEnv rState+ case eitherDoc of+ Right doc -> Right (Docx doc, stateWarnings st)+ Left e -> Left e++parseXMLFromEntry :: Entry -> Maybe Element+parseXMLFromEntry entry =+ case parseXMLElement (UTF8.toTextLazy (fromEntry entry)) of+ Left _ -> Nothing+ Right el -> Just el++getDocumentXmlPath :: Archive -> Maybe FilePath+getDocumentXmlPath zf = do+ entry <- findEntryByPath "_rels/.rels" zf+ relsElem <- parseXMLFromEntry entry+ let rels = filterChildrenName (\n -> qName n == "Relationship") relsElem+ rel <- find (\e ->+ case findAttr (QName "Type" Nothing Nothing) e of+ Just u -> isNamespace "officeDocument" "relationships/officeDocument" u+ Nothing -> False)+ rels+ fp <- findAttr (QName "Target" Nothing Nothing) rel+ -- sometimes there will be a leading slash, which windows seems to+ -- have trouble with.+ return $ case T.unpack fp of+ '/' : fp' -> fp'+ fp' -> fp'++archiveToDocument :: Archive -> D Document+archiveToDocument zf = do+ docPath <- asks envDocXmlPath+ entry <- maybeToD $ findEntryByPath docPath zf+ docElem <- maybeToD $ parseXMLFromEntry entry+ let namespaces = elemToNameSpaces docElem+ bodyElem <- maybeToD $ findChildByName namespaces "w" "body" docElem+ let bodyElem' = walkDocument namespaces bodyElem+ body <- elemToBody namespaces bodyElem'+ return $ Document namespaces body++elemToBody :: NameSpaces -> Element -> D Body+elemToBody ns element+ | isElem ns "w" "body" element =+ Body . addCaptioned <$> concatMapM (elemToBodyParts ns) (elChildren element)+ | otherwise = throwError WrongElem+ where+ elemToBodyParts ns' el+ | qName (elName el) == "textbox-image"+ = addSplitGroupCaptioned . splitMixedParagraphs+ <$> mapD (elemToBodyPart ns') (elChildren el)+ | otherwise+ = ((:[]) <$> elemToBodyPart ns' el) `catchError` (\_ -> return [])++archiveToStyles :: Archive -> (CharStyleMap, ParStyleMap)+archiveToStyles = archiveToStyles' getStyleId getStyleId++class HasParentStyle a where+ getParentStyle :: a -> Maybe a++instance HasParentStyle CharStyle where+ getParentStyle = rParentStyle . cStyleData++instance HasParentStyle ParStyle where+ getParentStyle = psParentStyle++getStyleNames :: (Functor t, HasStyleName a) => t a -> t (StyleName a)+getStyleNames = fmap getStyleName++constructBogusParStyleData :: ParaStyleName -> ParStyle+constructBogusParStyleData stName = ParStyle+ { headingLev = Nothing+ , indent = Nothing+ , numInfo = Nothing+ , psParentStyle = Nothing+ , pStyleName = stName+ , pStyleId = ParaStyleId . T.filter (/=' ') . fromStyleName $ stName+ }++archiveToNotes :: Archive -> Notes+archiveToNotes zf =+ let fnElem = findEntryByPath "word/footnotes.xml" zf+ >>= parseXMLFromEntry+ enElem = findEntryByPath "word/endnotes.xml" zf+ >>= parseXMLFromEntry+ fn_namespaces = maybe mempty elemToNameSpaces fnElem+ en_namespaces = maybe mempty elemToNameSpaces enElem+ ns = M.union fn_namespaces en_namespaces+ fn = fnElem >>= elemToNotes ns "footnote" . walkDocument ns+ en = enElem >>= elemToNotes ns "endnote" . walkDocument ns+ in+ Notes ns fn en++archiveToComments :: Archive -> Comments+archiveToComments zf =+ let cmtsElem = findEntryByPath "word/comments.xml" zf+ >>= parseXMLFromEntry+ cmts_namespaces = maybe mempty elemToNameSpaces cmtsElem+ cmts = elemToComments cmts_namespaces . walkDocument cmts_namespaces <$>+ cmtsElem+ in+ case cmts of+ Just c -> Comments cmts_namespaces c+ Nothing -> Comments cmts_namespaces M.empty++filePathToRelType :: FilePath -> FilePath -> Maybe DocumentLocation+filePathToRelType "word/_rels/footnotes.xml.rels" _ = Just InFootnote+filePathToRelType "word/_rels/endnotes.xml.rels" _ = Just InEndnote+-- -- to see if it's a documentPath, we have to check against the dynamic+-- -- docPath specified in "_rels/.rels"+filePathToRelType path docXmlPath =+ if path == "word/_rels/" ++ takeFileName docXmlPath ++ ".rels"+ then Just InDocument+ else Nothing++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+ -- target may be relative (media/image1.jpeg) or absolute (/word/media/image1.jpg)+ return $ Relationship relType relId target+relElemToRelationship _ _ = Nothing++extractTarget :: Element -> Maybe Target+extractTarget element = do (Relationship _ _ target) <- relElemToRelationship InDocument element+ return target++filePathToRelationships :: Archive -> FilePath -> FilePath -> [Relationship]+filePathToRelationships ar docXmlPath fp+ | Just relType <- filePathToRelType fp docXmlPath+ , Just entry <- findEntryByPath fp ar+ , Just relElems <- parseXMLFromEntry entry =+ mapMaybe (relElemToRelationship relType) $ elChildren relElems+filePathToRelationships _ _ _ = []++archiveToRelationships :: Archive -> FilePath -> [Relationship]+archiveToRelationships archive docXmlPath =+ concatMap (filePathToRelationships archive docXmlPath) $ filesInArchive archive++filePathIsMedia :: FilePath -> Bool+filePathIsMedia fp =+ "media" `elem` splitDirectories (takeDirectory fp)++lookupLevel :: T.Text -> T.Text -> Numbering -> Maybe Level+lookupLevel numId ilvl (Numbering _ numbs absNumbs) = do+ (absNumId, ovrrides) <- lookup numId $+ map (\(Numb nid absnumid ovrRides) -> (nid, (absnumid, ovrRides))) numbs+ lvls <- lookup absNumId $+ map (\(AbstractNumb aid ls) -> (aid, ls)) absNumbs+ -- this can be a maybe, so we do a let+ let lvlOverride = lookup ilvl $+ map (\lo@(LevelOverride ilvl' _ _) -> (ilvl', lo)) ovrrides+ case lvlOverride of+ Just (LevelOverride _ _ (Just lvl')) -> Just lvl'+ Just (LevelOverride _ (Just strt) _) ->+ lookup ilvl $ map (\(Level i fmt s _) -> (i, Level i fmt s (Just strt))) lvls+ _ ->+ lookup ilvl $ map (\l@(Level i _ _ _) -> (i, l)) lvls++loElemToLevelOverride :: NameSpaces -> Element -> Maybe LevelOverride+loElemToLevelOverride ns element+ | isElem ns "w" "lvlOverride" element = do+ ilvl <- findAttrByName ns "w" "ilvl" element+ let startOverride = findChildByName ns "w" "startOverride" element+ >>= findAttrByName ns "w" "val"+ >>= stringToInteger+ lvl = findChildByName ns "w" "lvl" element+ >>= levelElemToLevel ns+ return $ LevelOverride ilvl startOverride lvl+loElemToLevelOverride _ _ = Nothing++numElemToNum :: NameSpaces -> Element -> Maybe Numb+numElemToNum ns element+ | isElem ns "w" "num" element = do+ numId <- findAttrByName ns "w" "numId" element+ absNumId <- findChildByName ns "w" "abstractNumId" element+ >>= findAttrByName ns "w" "val"+ let lvlOverrides = mapMaybe+ (loElemToLevelOverride ns)+ (findChildrenByName ns "w" "lvlOverride" element)+ return $ Numb numId absNumId lvlOverrides+numElemToNum _ _ = Nothing++absNumElemToAbsNum :: NameSpaces -> Element -> Maybe AbstractNumb+absNumElemToAbsNum ns element+ | isElem ns "w" "abstractNum" element = do+ absNumId <- findAttrByName ns "w" "abstractNumId" element+ let levelElems = findChildrenByName ns "w" "lvl" element+ levels = mapMaybe (levelElemToLevel ns) levelElems+ return $ AbstractNumb absNumId levels+absNumElemToAbsNum _ _ = Nothing++levelElemToLevel :: NameSpaces -> Element -> Maybe Level+levelElemToLevel ns element+ | isElem ns "w" "lvl" element = do+ ilvl <- findAttrByName ns "w" "ilvl" element+ fmt <- findChildByName ns "w" "numFmt" element+ >>= findAttrByName ns "w" "val"+ txt <- findChildByName ns "w" "lvlText" element+ >>= findAttrByName ns "w" "val"+ let start = findChildByName ns "w" "start" element+ >>= findAttrByName ns "w" "val"+ >>= stringToInteger+ return (Level ilvl fmt txt start)+levelElemToLevel _ _ = Nothing++archiveToNumbering' :: Archive -> Maybe Numbering+archiveToNumbering' zf =+ case findEntryByPath "word/numbering.xml" zf of+ Nothing -> Just $ Numbering mempty [] []+ Just entry -> do+ numberingElem <- parseXMLFromEntry entry+ let namespaces = elemToNameSpaces numberingElem+ numElems = findChildrenByName namespaces "w" "num" numberingElem+ absNumElems = findChildrenByName namespaces "w" "abstractNum" numberingElem+ nums = mapMaybe (numElemToNum namespaces) numElems+ absNums = mapMaybe (absNumElemToAbsNum namespaces) absNumElems+ return $ Numbering namespaces nums absNums++archiveToNumbering :: Archive -> Numbering+archiveToNumbering archive =+ fromMaybe (Numbering mempty [] []) (archiveToNumbering' archive)++archiveToTextWidth :: Archive -> Maybe Int+archiveToTextWidth zf = do+ entry <- findEntryByPath "word/document.xml" zf+ docElem <- parseXMLFromEntry entry+ let ns = elemToNameSpaces docElem+ sectElem <- findChildByName ns "w" "body" docElem >>= findChildByName ns "w" "sectPr"+ pgWidth <- findChildByName ns "w" "pgSz" sectElem+ >>= findAttrByName ns "w" "w" >>= safeRead+ pgMar <- findChildByName ns "w" "pgMar" sectElem+ leftMargin <- findAttrByName ns "w" "left" pgMar >>= safeRead+ rightMargin <- findAttrByName ns "w" "right" pgMar >>= safeRead+ gutter <- findAttrByName ns "w" "gutter" pgMar >>= safeRead+ return $ pgWidth - (leftMargin + rightMargin + gutter)++elemToNotes :: NameSpaces -> Text -> Element -> Maybe (M.Map T.Text Element)+elemToNotes ns notetype element+ | isElem ns "w" (notetype <> "s") element =+ let pairs = mapMaybe+ (\e -> findAttrByName ns "w" "id" e >>=+ (\a -> Just (a, e)))+ (findChildrenByName ns "w" notetype element)+ in+ Just $+ M.fromList pairs+elemToNotes _ _ _ = Nothing++elemToComments :: NameSpaces -> Element -> M.Map T.Text Element+elemToComments ns element+ | isElem ns "w" "comments" element =+ let pairs = mapMaybe+ (\e -> findAttrByName ns "w" "id" e >>=+ (\a -> Just (a, e)))+ (findChildrenByName ns "w" "comment" element)+ in+ M.fromList pairs+elemToComments _ _ = M.empty+++---------------------------------------------+---------------------------------------------++elemToTblGrid :: NameSpaces -> Element -> D TblGrid+elemToTblGrid ns element | isElem ns "w" "tblGrid" element = do+ let cols = findChildrenByName ns "w" "gridCol" element+ textWidth <- asks envTextWidth+ -- space between cols is 10 twips, so we subtract this:+ let totalWidth = textWidth - (10 * (length cols - 1))+ let toFraction :: Int -> Double+ toFraction x = fromIntegral x / fromIntegral totalWidth+ let normalizeFractions xs =+ case sum xs of+ tot | tot > 1.0 -> map (/ tot) xs+ _ -> xs+ normalizeFractions <$>+ mapD (\e -> maybeToD (findAttrByName ns "w" "w" e >>=+ fmap toFraction . safeRead)) cols+elemToTblGrid _ _ = throwError WrongElem++elemToTblLook :: NameSpaces -> Element -> D TblLook+elemToTblLook ns element | isElem ns "w" "tblLook" element =+ let firstRow = findAttrByName ns "w" "firstRow" element+ val = findAttrByName ns "w" "val" element+ firstRowFmt =+ case firstRow of+ Just "1" -> True+ Just _ -> False+ Nothing -> case val of+ Just bitMask -> testBitMask bitMask 0x020+ Nothing -> False+ in+ return TblLook{firstRowFormatting = firstRowFmt}+elemToTblLook _ _ = throwError WrongElem++elemToRow :: NameSpaces -> Element -> D Row+elemToRow ns element | isElem ns "w" "tr" element =+ do+ let properties = findChildByName ns "w" "trPr" element+ let gridBefore = properties+ >>= findChildByName ns "w" "gridBefore"+ >>= findAttrByName ns "w" "val"+ >>= stringToInteger+ let cellElems = findChildrenByName ns "w" "tc" element+ let beforeCells = genericReplicate (fromMaybe 0 gridBefore) emptyCell+ cells <- mapD (elemToCell ns) cellElems+ let hasTblHeader =+ case (properties >>= findChildByName ns "w" "tblHeader") of+ Nothing -> NoTblHeader+ Just he -> case findAttrByName ns "w" "val" he of+ Just "0" -> NoTblHeader+ _ -> HasTblHeader+ return $ Row hasTblHeader (beforeCells ++ cells)+elemToRow _ _ = throwError WrongElem++elemToCell :: NameSpaces -> Element -> D Cell+elemToCell ns element | isElem ns "w" "tc" element =+ do+ let properties = findChildByName ns "w" "tcPr" element+ let gridSpan = properties+ >>= findChildByName ns "w" "gridSpan"+ >>= findAttrByName ns "w" "val"+ >>= stringToInteger+ let vMerge = case properties >>= findChildByName ns "w" "vMerge" of+ Nothing -> Restart+ Just e ->+ fromMaybe Continue $ do+ s <- findAttrByName ns "w" "val" e+ case s of+ "continue" -> Just Continue+ "restart" -> Just Restart+ _ -> Nothing+ cellContents <- mapD (elemToBodyPart ns) (elChildren element)+ let align = case cellContents of -- take alignment from first paragraph+ Paragraph pstyle _ : _ ->+ case justification pstyle of+ Just JustifyBoth -> AlignLeft+ Just JustifyLeft -> AlignLeft+ Just JustifyRight -> AlignRight+ Just JustifyCenter -> AlignCenter+ Nothing -> AlignDefault+ _ -> AlignDefault+ return $ Cell align (fromMaybe 1 gridSpan) vMerge cellContents+elemToCell _ _ = throwError WrongElem++testBitMask :: Text -> Int -> Bool+testBitMask bitMaskS n =+ case (reads ("0x" ++ T.unpack bitMaskS) :: [(Int, String)]) of+ [] -> False+ ((n', _) : _) -> (n' .&. n) /= 0++pHeading :: ParagraphStyle -> Maybe (ParaStyleName, Int)+pHeading = getParStyleField headingLev . pStyle++pNumInfo :: ParagraphStyle -> Maybe (T.Text, T.Text)+pNumInfo = getParStyleField numInfo . pStyle++mkListItem :: ParagraphStyle -> Text -> Text -> [ParPart] -> D BodyPart+mkListItem parstyle numId lvl parparts = do+ lvlInfo <- lookupLevel numId lvl <$> asks envNumbering+ return $ ListItem parstyle numId lvl lvlInfo parparts++pStyleIndentation :: ParagraphStyle -> Maybe ParIndentation+pStyleIndentation style = (getParStyleField indent . pStyle) style++addCaptioned :: [BodyPart] -> [BodyPart]+addCaptioned [] = []+addCaptioned (Paragraph parstyle parparts : x : xs)+ | hasCaptionStyle parstyle+ , isCaptionable x+ = Captioned parstyle parparts x : addCaptioned xs+addCaptioned (x : Paragraph parstyle parparts : xs)+ | hasCaptionStyle parstyle+ , not (pKeepNext parstyle)+ , isCaptionable x+ = Captioned parstyle parparts x : addCaptioned xs+addCaptioned (x:xs) = x : addCaptioned xs++-- Split paragraphs that contain both a Drawing and text into two body parts,+-- so that the captioning logic can combine them.+splitMixedParagraphs :: [BodyPart] -> [BodyPart]+splitMixedParagraphs [] = []+splitMixedParagraphs (Paragraph ps parts : rest)+ | (drawings@(_:_), texts@(_:_)) <- partition isDrawingPart parts+ = Paragraph ps drawings : Paragraph ps texts : splitMixedParagraphs rest+ where isDrawingPart Drawing{} = True+ isDrawingPart _ = False+splitMixedParagraphs (x:xs) = x : splitMixedParagraphs xs++-- For textbox-image groups: combine image + any adjacent text into Captioned+addSplitGroupCaptioned :: [BodyPart] -> [BodyPart]+addSplitGroupCaptioned [] = []+addSplitGroupCaptioned (Paragraph parstyle parparts : x : xs)+ | isCaptionable x+ = Captioned parstyle parparts x : addSplitGroupCaptioned xs+addSplitGroupCaptioned (x : Paragraph parstyle parparts : xs)+ | isCaptionable x+ = Captioned parstyle parparts x : addSplitGroupCaptioned xs+addSplitGroupCaptioned (x:xs) = x : addSplitGroupCaptioned xs++isCaptionable :: BodyPart -> Bool+isCaptionable (Paragraph _ [Drawing{}]) = True+isCaptionable (Tbl{}) = True+isCaptionable _ = False++elemToBodyPart :: NameSpaces -> Element -> D BodyPart+elemToBodyPart ns element+ | isElem ns "m" "oMathPara" element = do+ expsLst <- eitherToD $ readOMML $ showElement element+ parstyle <- elemToParagraphStyle ns element+ <$> asks envParStyles+ <*> asks envNumbering+ return $ Paragraph parstyle [OMathPara expsLst]+elemToBodyPart ns element+ | isElem ns "w" "p" element+ , Just (numId, lvl) <- getNumInfo ns element = do+ lvlInfo <- lookupLevel numId lvl <$> asks envNumbering+ parstyle <- elemToParagraphStyle ns element+ <$> asks envParStyles+ <*> asks envNumbering+ parparts <- mconcat <$> mapD (elemToParPart ns) (elChildren element)+ case pHeading parstyle of+ Nothing -> mkListItem parstyle numId lvl parparts+ Just (parstylename, lev)+ -> return $ Heading lev parstylename parstyle numId lvl lvlInfo parparts+elemToBodyPart ns element+ | isElem ns "w" "p" element+ , [Elem ppr] <- elContent element+ , isElem ns "w" "pPr" ppr+ , [Elem pbdr] <- elContent ppr+ , isElem ns "w" "pBdr" pbdr+ = return HRule+ -- for this style of horizontal rule, see+ -- https://support.microsoft.com/en-us/office/insert-a-horizontal-line-9bf172f6-5908-4791-9bb9-2c952197b1a9+elemToBodyPart ns element -- pandoc-style horizontal rule+ | isElem ns "w" "p" element+ , [Elem r] <- elContent element+ , isElem ns "w" "r" r+ , [Elem pict] <- elContent r+ , isElem ns "w" "pict" pict+ , [Elem rect] <- elContent pict+ , isElem ns "v" "rect" rect+ = return HRule+elemToBodyPart ns element+ | isElem ns "w" "p" element = do+ parstyle <- elemToParagraphStyle ns element+ <$> asks envParStyles+ <*> asks envNumbering++ let children =+ (if hasCaptionStyle parstyle+ then stripCaptionLabel+ else id) (elChildren element)++ parparts' <- mconcat <$> mapD (elemToParPart ns) children+ fldCharState <- gets stateFldCharState+ modify $ \st -> st {stateFldCharState = emptyFldCharContents fldCharState}+ -- Word uses list enumeration for numbered headings, so we only+ -- want to infer a list from the styles if it is NOT a heading.+ let parparts = parparts' ++ openFldCharsToParParts fldCharState+ case pHeading parstyle of+ Nothing | Just (numId, lvl) <- pNumInfo parstyle -> do+ mkListItem parstyle numId lvl parparts+ Just (parstylename, lev) -> do+ let (numId, lvl) = fromMaybe ("","") $ pNumInfo parstyle+ lvlInfo <- lookupLevel numId lvl <$> asks envNumbering+ return $ Heading lev parstylename parstyle numId lvl lvlInfo parparts+ Nothing -> return $ Paragraph parstyle parparts+elemToBodyPart ns element+ | isElem ns "w" "tbl" element = do+ let tblProperties = findChildByName ns "w" "tblPr" element+ caption = fromMaybe "" $ tblProperties+ >>= findChildByName ns "w" "tblCaption"+ >>= findAttrByName ns "w" "val"+ description = fromMaybe "" $ tblProperties+ >>= findChildByName ns "w" "tblDescription"+ >>= findAttrByName ns "w" "val"+ mbstyle = tblProperties+ >>= findChildByName ns "w" "tblStyle"+ >>= findAttrByName ns "w" "val"+ grid' = case findChildByName ns "w" "tblGrid" element of+ Just g -> elemToTblGrid ns g+ Nothing -> return []+ tblLook' = case findChildByName ns "w" "tblPr" element >>=+ findChildByName ns "w" "tblLook"+ of+ Just l -> elemToTblLook ns l+ Nothing -> return defaultTblLook++ grid'' <- grid'+ tblLook <- tblLook'+ rows <- mapD (elemToRow ns) (elChildren element)+ let grid = if null grid''+ then let numcols = case rowsToRowspans rows of+ (cs@(_:_):_) -> sum (map fst cs)+ _ -> 0+ in replicate numcols 0.0+ else grid''+ return $ Tbl mbstyle (caption <> description) grid tblLook rows+elemToBodyPart _ _ = throwError WrongElem++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++openFldCharsToParParts :: [FldCharState] -> [ParPart]+openFldCharsToParParts [] = []+openFldCharsToParParts (FldCharContent info children : ancestors) = case openFldCharsToParParts ancestors of+ Field parentInfo siblings : _ -> [Field parentInfo $ siblings ++ [Field info $ reverse children]]+ _ -> [Field info $ reverse children]+openFldCharsToParParts (_ : ancestors) = openFldCharsToParParts ancestors++emptyFldCharContents :: [FldCharState] -> [FldCharState]+emptyFldCharContents = map+ (\x -> case x of+ FldCharContent info _ -> FldCharContent info []+ _ -> x)++expandDrawingId :: T.Text -> D (FilePath, B.ByteString)+expandDrawingId s = do+ location <- asks envLocation+ target <- asks (fmap T.unpack . lookupRelationship location s . envRelationships)+ case target of+ Just filepath -> do+ media <- asks envMedia+ -- the mediaName is the name we store it under in the mediabag.+ -- This is derived from the path, which might be absolute, e.g. /media/foo.jpg,+ -- or relative, media/foo.jpg (interpreted as /word/media/foo.jpg).+ -- The mediaName will strip off any leading `/` or `word/`.+ -- We assume here that the media will not be stored *both* in+ -- /media and in /word/media, which would lead to a name conflict+ -- given the scheme here for generating a mediaName.+ let (filepath', mediaName) =+ case filepath of+ ('/':rest) -- absolute path e.g. /media/foo.jpg+ -> (rest, case stripPrefix "word/" rest of+ Just rest' -> rest'+ Nothing -> rest)+ _ -- rel path to word, e.g. media/foo.jpg+ -> ("word/" ++ filepath, filepath)+ case lookup filepath' media of+ Just bs -> return (mediaName, bs)+ Nothing -> throwError DocxError+ Nothing -> throwError DocxError++getTitleAndAlt :: NameSpaces -> Element -> (T.Text, T.Text)+getTitleAndAlt ns element =+ let mbDocPr = (findChildByName ns "wp" "inline" element <|> -- Word+ findChildByName ns "wp" "anchor" element) >>= -- LibreOffice+ findChildByName ns "wp" "docPr"+ title = fromMaybe "" (mbDocPr >>= findAttrByName ns "" "title")+ alt = fromMaybe "" (mbDocPr >>= findAttrByName ns "" "descr")+ in (title, alt)++elemToParPart :: NameSpaces -> Element -> D [ParPart]+{-+The next one is a bit complicated. fldChar fields work by first+having a <w:fldChar fldCharType="begin"> in a run, then a run with+<w:instrText>, then a <w:fldChar fldCharType="separate"> run, then the+content runs, and finally a <w:fldChar fldCharType="end"> run. For+example (omissions and my comments in brackets):++ <w:r>+ [...]+ <w:fldChar w:fldCharType="begin"/>+ </w:r>+ <w:r>+ [...]+ <w:instrText xml:space="preserve"> HYPERLINK [hyperlink url] </w:instrText>+ </w:r>+ <w:r>+ [...]+ <w:fldChar w:fldCharType="separate"/>+ </w:r>+ <w:r w:rsidRPr=[...]>+ [...]+ <w:t>Foundations of Analysis, 2nd Edition</w:t>+ </w:r>+ <w:r>+ [...]+ <w:fldChar w:fldCharType="end"/>+ </w:r>++Note that there may be mulitple w:instrText elements in a row.+For example, you might first have ` XE "`, then `Kay, Alan`, then `"`.+The texts in all of them should be concatenated before it is processed!++So we do this in a number of steps. If we encounter the fldchar begin+tag, we start open a fldchar state variable (see state above). We add+the instrtext to it as FieldInfo. Then we close that and start adding+the children when we get to separate. Then when we get to end, we produce+the Field type with appropriate FieldInfo and ParParts.++Since there can be nested fields, the fldchar state needs to be a stack,+so we can have multiple fldchars open at the same time. When a fldchar is+closed, we either add the resulting field to its parent or we return it if+there is no parent.+-}+elemToParPart ns element+ | isElem ns "w" "r" element+ , Just fldChar <- findChildByName ns "w" "fldChar" element+ , Just fldCharType <- findAttrByName ns "w" "fldCharType" fldChar = do+ fldCharState <- gets stateFldCharState+ case fldCharState of+ _ | fldCharType == "begin" -> do+ modify $ \st -> st {stateFldCharState = FldCharOpen : fldCharState}+ return []+ FldCharFieldInfo t : ancestors | fldCharType == "separate" -> do+ info <- eitherToD $ parseFieldInfo t+ modify $ \st -> st {stateFldCharState = FldCharContent info [] : ancestors}+ return []+ -- Some fields have no content, e.g. index XE:+ FldCharFieldInfo t : ancestors | fldCharType == "end" -> do+ modify $ \st -> st {stateFldCharState = ancestors}+ info <- eitherToD $ parseFieldInfo t+ return [Field info []]+ [FldCharContent info children] | fldCharType == "end" -> do+ modify $ \st -> st {stateFldCharState = []}+ return [Field info $ reverse children]+ FldCharContent info children : FldCharContent parentInfo siblings : ancestors | fldCharType == "end" ->+ let parent = FldCharContent parentInfo $ (Field info (reverse children)) : siblings in do+ modify $ \st -> st {stateFldCharState = parent : ancestors}+ return []+ _ -> throwError WrongElem+elemToParPart ns element+ | isElem ns "w" "r" element+ , Just instrText <- findChildByName ns "w" "instrText" element = do+ fldCharState <- gets stateFldCharState+ case fldCharState of+ FldCharOpen : ancestors -> do+ modify $ \st -> st {stateFldCharState =+ FldCharFieldInfo (strContent instrText) : ancestors}+ return []+ FldCharFieldInfo t : ancestors -> do+ modify $ \st -> st {stateFldCharState =+ FldCharFieldInfo (t <> strContent instrText) :+ ancestors}+ return []+ _ -> return []+{-+There is an open fldchar, so we calculate the element and add it to the+children. For this we need to first change the fldchar state to an empty+stack to avoid descendants of children simply being added to the state instead+of to their direct parent element. This would happen in the case of a+w:hyperlink element for example.+-}+elemToParPart ns element = do+ fldCharState <- gets stateFldCharState+ case fldCharState of+ FldCharContent info children : ancestors -> do+ modify $ \st -> st {stateFldCharState = []}+ parParts <- elemToParPart' ns element `catchError` \_ -> return []+ modify $ \st -> st{stateFldCharState = FldCharContent info (parParts ++ children) : ancestors}+ return []+ _ -> elemToParPart' ns element++elemToParPart' :: NameSpaces -> Element -> D [ParPart]+elemToParPart' ns element+ | isElem ns "w" "r" element+ , Just drawingElem <- findChildByName ns "w" "drawing" element+ , picElems <- filterElementsName+ (matchQName "drawingml" "picture" (Just "pic") "pic") drawingElem+ = let (title, alt) = getTitleAndAlt ns drawingElem+ drawings = map (\el ->+ ((findBlip el >>= findAttrByName ns "r" "embed"), el))+ picElems+ in mapM (\case+ (Just s, el) -> do+ (fp, bs) <- expandDrawingId s+ let extent = elemToExtent el <|> elemToExtent element+ return $ Drawing fp title alt bs extent+ (Nothing, _) -> throwError WrongElem)+ drawings+-- The two cases below are an attempt to deal with images in deprecated vml format.+-- Todo: check out title and attr for deprecated format.+elemToParPart' ns element+ | isElem ns "w" "r" element+ , Just _ <- findChildByName ns "w" "pict" element =+ let drawing = findElement (elemName ns "v" "imagedata") element+ >>= findAttrByName ns "r" "id"+ in+ case drawing of+ Just s -> expandDrawingId s >>= (\(fp, bs) -> return [Drawing fp "" "" bs Nothing])+ Nothing -> throwError WrongElem+elemToParPart' ns element+ | isElem ns "w" "r" element+ , Just objectElem <- findChildByName ns "w" "object" element+ , Just shapeElem <- findChildByName ns "v" "shape" objectElem+ , Just imagedataElem <- findChildByName ns "v" "imagedata" shapeElem+ , Just drawingId <- findAttrByName ns "r" "id" imagedataElem+ = expandDrawingId drawingId >>= (\(fp, bs) -> return [Drawing fp "" "" bs Nothing])+-- Diagram+elemToParPart' ns element+ | isElem ns "w" "r" element+ , Just drawingElem <- findChildByName ns "w" "drawing" element+ , Just _ <- filterElementName+ (matchQName "drawingml" "diagram" (Just "dgm") "relIds") drawingElem+ = return [Diagram]+-- Chart+elemToParPart' ns element+ | isElem ns "w" "r" element+ , Just drawingElem <- findChildByName ns "w" "drawing" element+ , Just _ <- filterElementName+ (matchQName "drawingml" "chart" (Just "c") "chart") drawingElem+ = return [Chart]+elemToParPart' ns element+ | isElem ns "w" "r" element = do+ runs <- elemToRun ns element+ return $ map PlainRun runs+elemToParPart' ns element+ | Just change <- getTrackedChange ns element = do+ runs <- mconcat <$> mapD (elemToParPart' ns) (elChildren element)+ return [ChangedRuns change runs]+elemToParPart' ns element+ | isElem ns "w" "bookmarkStart" element+ , Just bmId <- findAttrByName ns "w" "id" element+ , Just bmName <- findAttrByName ns "w" "name" element =+ return [BookMark bmId bmName]+elemToParPart' ns element+ | isElem ns "w" "hyperlink" element+ , Just relId <- findAttrByName ns "r" "id" element = do+ location <- asks envLocation+ children <- mconcat <$> mapD (elemToParPart ns) (elChildren element)+ rels <- asks envRelationships+ case lookupRelationship location relId rels of+ Just target ->+ case findAttrByName ns "w" "anchor" element of+ Just anchor -> return+ [ExternalHyperLink (target <> "#" <> anchor) children]+ Nothing -> return [ExternalHyperLink target children]+ Nothing -> return [ExternalHyperLink "" children]+elemToParPart' ns element+ | isElem ns "w" "hyperlink" element+ , Just anchor <- findAttrByName ns "w" "anchor" element = do+ children <- mconcat <$> mapD (elemToParPart ns) (elChildren element)+ return [InternalHyperLink anchor children]+elemToParPart' ns element+ | isElem ns "w" "commentRangeStart" element+ , Just cmtId <- findAttrByName ns "w" "id" element = do+ (Comments _ commentMap) <- asks envComments+ case M.lookup cmtId commentMap of+ Just cmtElem -> elemToCommentStart ns cmtElem+ Nothing -> throwError WrongElem+elemToParPart' ns element+ | isElem ns "w" "commentRangeEnd" element+ , Just cmtId <- findAttrByName ns "w" "id" element =+ return [CommentEnd cmtId]+elemToParPart' ns element+ | isElem ns "m" "oMath" element =+ fmap (return . PlainOMath) (eitherToD $ readOMML $ showElement element)+elemToParPart' ns element+ | isElem ns "m" "oMathPara" element =+ fmap (return . OMathPara) (eitherToD $ readOMML $ showElement element)+elemToParPart' _ _ = throwError WrongElem++elemToCommentStart :: NameSpaces -> Element -> D [ParPart]+elemToCommentStart ns element+ | isElem ns "w" "comment" element+ , Just cmtId <- findAttrByName ns "w" "id" element+ , Just cmtAuthor <- findAttrByName ns "w" "author" element+ , cmtDate <- findAttrByName ns "w" "date" element = do+ bps <- mapD (elemToBodyPart ns) (elChildren element)+ return [CommentStart cmtId cmtAuthor cmtDate bps]+elemToCommentStart _ _ = throwError WrongElem++lookupFootnote :: T.Text -> Notes -> Maybe Element+lookupFootnote s (Notes _ fns _) = fns >>= M.lookup s++lookupEndnote :: T.Text -> Notes -> Maybe Element+lookupEndnote s (Notes _ _ ens) = ens >>= M.lookup s++elemToExtent :: Element -> Extent+elemToExtent el =+ case (getDim "cx", getDim "cy") of+ (Just w, Just h) -> Just (w, h)+ _ -> Nothing+ where+ getDim at = filterElementName (\n -> qName n == "extent") el+ >>= findAttr (QName at Nothing Nothing) >>= safeRead+++childElemToRun :: NameSpaces -> Element -> D [Run]+childElemToRun ns element+ | isElem ns "w" "drawing" element+ , picElems <- filterElementsName+ (matchQName "drawingml" "picture" (Just "pic") "pic") element+ = let (title, alt) = getTitleAndAlt ns element+ drawings = map (\el ->+ ((findBlip el >>= findAttrByName ns "r" "embed"), el))+ picElems+ in mapM (\case+ (Just s, el) -> do+ (fp, bs) <- expandDrawingId s+ let extent = elemToExtent el <|> elemToExtent element+ return $ InlineDrawing fp title alt bs extent+ (Nothing, _) -> throwError WrongElem)+ drawings+childElemToRun ns element+ | isElem ns "w" "drawing" element+ , Just _ <- filterElementName+ (matchQName "drawingml" "chart" (Just "c") "chart") element+ = return [InlineChart]+childElemToRun ns element+ | isElem ns "w" "drawing" element+ , Just _ <- filterElementName+ (matchQName "drawingml" "diagram" (Just "dgm") "relIds") element+ = return [InlineDiagram]+childElemToRun ns element+ | isElem ns "w" "footnoteReference" element+ , Just fnId <- findAttrByName ns "w" "id" element = do+ notes <- asks envNotes+ case lookupFootnote fnId notes of+ Just e -> do bps <- local (\r -> r {envLocation=InFootnote}) $ mapD (elemToBodyPart ns) (elChildren e)+ return [Footnote bps]+ Nothing -> return [Footnote []]+childElemToRun ns element+ | isElem ns "w" "endnoteReference" element+ , Just enId <- findAttrByName ns "w" "id" element = do+ notes <- asks envNotes+ case lookupEndnote enId notes of+ Just e -> do bps <- local (\r -> r {envLocation=InEndnote}) $ mapD (elemToBodyPart ns) (elChildren e)+ return [Endnote bps]+ Nothing -> return [Endnote []]+childElemToRun _ _ = throwError WrongElem++elemToRun :: NameSpaces -> Element -> D [Run]+elemToRun ns element+ | isElem ns "w" "r" element+ , Just drawingElem <- findChildByName ns "w" "drawing" element =+ childElemToRun ns drawingElem+elemToRun ns element+ | isElem ns "w" "r" element+ , Just ref <- findChildByName ns "w" "footnoteReference" element =+ childElemToRun ns ref+elemToRun ns element+ | isElem ns "w" "r" element+ , Just ref <- findChildByName ns "w" "endnoteReference" element =+ childElemToRun ns ref+elemToRun ns element+ | isElem ns "w" "r" element = do+ runElems <- elemToRunElems ns element+ runStyle <- elemToRunStyleD ns element+ return [Run runStyle runElems]+elemToRun _ _ = throwError WrongElem++getParentStyleValue :: (ParStyle -> Maybe a) -> ParStyle -> Maybe a+getParentStyleValue field style+ | Just value <- field style = Just value+ | Just parentStyle <- psParentStyle style+ = getParentStyleValue field parentStyle+getParentStyleValue _ _ = Nothing++getParStyleField :: (ParStyle -> Maybe a) -> [ParStyle] -> Maybe a+getParStyleField field styles+ | (y:_) <- mapMaybe (getParentStyleValue field) styles+ = Just y+getParStyleField _ _ = Nothing++getTrackedChange :: NameSpaces -> Element -> Maybe TrackedChange+getTrackedChange ns element+ | isElem ns "w" "ins" element || isElem ns "w" "moveTo" element+ , Just cId <- findAttrByName ns "w" "id" element+ , Just cAuthor <- findAttrByName ns "w" "author" element+ , mcDate <- findAttrByName ns "w" "date" element =+ Just $ TrackedChange Insertion (ChangeInfo cId cAuthor mcDate)+getTrackedChange ns element+ | isElem ns "w" "del" element || isElem ns "w" "moveFrom" element+ , Just cId <- findAttrByName ns "w" "id" element+ , Just cAuthor <- findAttrByName ns "w" "author" element+ , mcDate <- findAttrByName ns "w" "date" element =+ Just $ TrackedChange Deletion (ChangeInfo cId cAuthor mcDate)+getTrackedChange _ _ = Nothing++elemToParagraphStyle :: NameSpaces -> Element+ -> ParStyleMap+ -> Numbering+ -> ParagraphStyle+elemToParagraphStyle ns element sty numbering+ | Just pPr <- findChildByName ns "w" "pPr" element =+ let style =+ mapMaybe+ (fmap ParaStyleId . findAttrByName ns "w" "val")+ (findChildrenByName ns "w" "pStyle" pPr)+ pStyle' = mapMaybe (`M.lookup` sty) style+ in ParagraphStyle+ {pStyle = pStyle'+ , numbered = case getNumInfo ns element of+ Just (numId, lvl) -> isJust $ lookupLevel numId lvl numbering+ Nothing -> isJust $ getParStyleField numInfo pStyle'+ , justification =+ case findChildByName ns "w" "jc" pPr >>= findAttrByName ns "w" "val" of+ Nothing -> Nothing+ Just "both" -> Just JustifyBoth+ Just "center" -> Just JustifyCenter+ Just "left" -> Just JustifyLeft+ Just "right" -> Just JustifyRight+ _ -> Nothing+ , indentation =+ getIndentation ns element+ , dropCap =+ case+ findChildByName ns "w" "framePr" pPr >>=+ findAttrByName ns "w" "dropCap"+ of+ Just "none" -> False+ Just _ -> True+ Nothing -> False+ , pChange = findChildByName ns "w" "rPr" pPr >>=+ filterChild (\e -> isElem ns "w" "ins" e ||+ isElem ns "w" "moveTo" e ||+ isElem ns "w" "del" e ||+ isElem ns "w" "moveFrom" e+ ) >>=+ getTrackedChange ns+ , pBidi = checkOnOff ns pPr (elemName ns "w" "bidi")+ , pKeepNext = isJust $ findChildByName ns "w" "keepNext" pPr+ }+ | otherwise = defaultParagraphStyle++elemToRunStyleD :: NameSpaces -> Element -> D RunStyle+elemToRunStyleD ns element+ | Just rPr <- findChildByName ns "w" "rPr" element = do+ charStyles <- asks envCharStyles+ let parentSty =+ findChildByName ns "w" "rStyle" rPr >>=+ findAttrByName ns "w" "val" >>=+ flip M.lookup charStyles . CharStyleId+ return $ elemToRunStyle ns element parentSty+elemToRunStyleD _ _ = return defaultRunStyle++elemToRunElem :: NameSpaces -> Element -> D RunElem+elemToRunElem ns element+ | isElem ns "w" "t" element+ || isElem ns "w" "delText" element+ || isElem ns "m" "t" element = do+ let str = strContent element+ font <- asks envFont+ case font of+ Nothing -> return $ TextRun str+ Just f -> return . TextRun $+ T.map (\c -> fromMaybe c (getFontChar f c)) str+ | isElem ns "w" "br" element = return LnBrk+ | isElem ns "w" "tab" element = return Tab+ | isElem ns "w" "softHyphen" element = return SoftHyphen+ | isElem ns "w" "noBreakHyphen" element = return NoBreakHyphen+ | isElem ns "w" "sym" element = return (getSymChar ns element)+ | otherwise = throwError WrongElem++-- The char attribute is a hex string+getSymChar :: NameSpaces -> Element -> RunElem+getSymChar ns element+ | Just s <- getCodepoint+ , Just font <- getFont =+ case readLitChar ("\\x" ++ T.unpack s) of+ [(ch, _)] ->+ TextRun $ T.singleton $ fromMaybe ch $ getFontChar font ch+ _ -> TextRun ""+ where+ getCodepoint = findAttrByName ns "w" "char" element+ getFont = findAttrByName ns "w" "font" element >>= textToFont+getSymChar _ _ = TextRun ""++getFontChar :: Font -> Char -> Maybe Char+getFontChar font ch = chr <$> M.lookup (font, point) symbolMap+ where+ point -- sometimes F000 is added to put char in private range:+ | ch >= '\xF000' = ord ch - 0xF000+ | otherwise = ord ch++elemToRunElems :: NameSpaces -> Element -> D [RunElem]+elemToRunElems ns element+ | isElem ns "w" "r" element+ || isElem ns "m" "r" element = do+ let qualName = elemName ns "w"+ let font = do+ fontElem <- findElement (qualName "rFonts") element+ foldr ((<|>) . (flip findAttr fontElem . qualName))+ Nothing ["ascii", "hAnsi"]+ >>= textToFont+ local (setFont font) (mapD (elemToRunElem ns) (elChildren element))+elemToRunElems _ _ = throwError WrongElem++setFont :: Maybe Font -> ReaderEnv -> ReaderEnv+setFont f s = s{envFont = f}++findBlip :: Element -> Maybe Element+findBlip el = do+ blip <- filterElementName (matchQName "drawingml" "main" (Just "a") "blip") el+ -- return svg if present:+ filterElementName (\(QName tag _ _) -> tag == "svgBlip") el `mplus` pure blip++-- | Checks if any style in the style hierarchy is a caption style.+hasCaptionStyle :: ParagraphStyle -> Bool+hasCaptionStyle =+ any (isCaptionStyleName . pStyleName) . concatMap nestedStyles . pStyle+ where -- note that these are case insensitive:+ isCaptionStyleName "caption" = True+ isCaptionStyleName "table caption" = True+ isCaptionStyleName "image caption" = True+ isCaptionStyleName _ = False++ -- Gets all the style names in the style hierarchy+ nestedStyles :: ParStyle -> [ParStyle]+ nestedStyles ps = ps : maybe [] nestedStyles (psParentStyle ps)++stripCaptionLabel :: [Element] -> [Element]+stripCaptionLabel els =+ if any isNumberElt els+ then dropWhile (not . isNumberElt) els+ else els+ where+ isNumberElt el@(Element name attribs _ _) =+ (qName name == "fldSimple" &&+ case lookupAttrBy ((== "instr") . qName) attribs of+ Nothing -> False+ Just instr -> "Table" `elem` T.words instr ||+ "Figure" `elem` T.words instr) ||+ (qName name == "instrText" &&+ let ws = T.words (strContent el)+ in ("Table" `elem` ws || "Figure" `elem` ws))++isNamespace :: Text -> Text -> Text -> Bool+isNamespace primary secondary url =+ -- first try transitional:+ case T.stripPrefix "http://schemas.openxmlformats.org/" url of+ Just path -> path == primary <> "/2006/" <> secondary+ Nothing -> -- then try strict:+ case T.stripPrefix "http://purl.oclc.org/ooxml/" url of+ Just path -> path == primary <> "/" <> snakeToCamel secondary+ Nothing -> False+ where+ snakeToCamel "custom-properties" = "customProperties"+ snakeToCamel "extended-properties" = "extendedProperties"+ snakeToCamel x = x++matchQName :: Text -> Text -> Maybe Text -> Text -> QName -> Bool+matchQName primary secondary mbprefix name (QName name' mbns' mbprefix') =+ name == name' &&+ (isNothing mbprefix || mbprefix' == mbprefix) &&+ maybe True (isNamespace primary secondary) mbns'
@@ -0,0 +1,352 @@+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Readers.Docx.Parse.Styles+ Copyright : Copyright (C) 2014-2020 Jesse Rosenthal+ 2019 Nikolay Yakimov <root@livid.pp.ru>+ License : GNU GPL, version 2 or above++ Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>+ Stability : alpha+ Portability : portable++Type machinery and code for extraction and manipulation of docx styles+-}++module Text.Pandoc.Readers.Docx.Parse.Styles (+ CharStyleId(..)+ , CharStyle+ , ParaStyleId(..)+ , ParStyle(..)+ , ParIndentation(..)+ , RunStyle(..)+ , HasStyleName+ , StyleName+ , ParaStyleName+ , CharStyleName+ , FromStyleName+ , VertAlign(..)+ , StyleId+ , HasStyleId+ , archiveToStyles'+ , getStyleId+ , getStyleName+ , cStyleData+ , fromStyleName+ , fromStyleId+ , stringToInteger+ , getIndentation+ , getNumInfo+ , elemToRunStyle+ , defaultRunStyle+ , checkOnOff+ ) where+import Codec.Archive.Zip+import Control.Applicative ((<|>))+import Data.Function (on)+import Data.String (IsString(..))+import qualified Data.Map as M+import qualified Data.Text as T+import qualified Data.Text.Read+import Data.Text (Text)+import Data.Maybe+import Data.Coerce+import Text.Pandoc.Readers.Docx.Util+import qualified Text.Pandoc.UTF8 as UTF8+import Text.Pandoc.XML.Light++newtype CharStyleId = CharStyleId T.Text+ deriving (Show, Eq, Ord, IsString, FromStyleId)+newtype ParaStyleId = ParaStyleId T.Text+ deriving (Show, Eq, Ord, IsString, FromStyleId)++newtype CharStyleName = CharStyleName CIString+ deriving (Show, Eq, Ord, IsString, FromStyleName)+newtype ParaStyleName = ParaStyleName CIString+ deriving (Show, Eq, Ord, IsString, FromStyleName)++-- Case-insensitive comparisons+newtype CIString = CIString T.Text deriving (Show, IsString, FromStyleName)++class FromStyleName a where+ fromStyleName :: a -> T.Text++instance FromStyleName String where+ fromStyleName = T.pack++instance FromStyleName T.Text where+ fromStyleName = id++class FromStyleId a where+ fromStyleId :: a -> T.Text++instance FromStyleId String where+ fromStyleId = T.pack++instance FromStyleId T.Text where+ fromStyleId = id++instance Eq CIString where+ (==) = (==) `on` T.toCaseFold . coerce++instance Ord CIString where+ compare = compare `on` T.toCaseFold . coerce++data VertAlign = BaseLn | SupScrpt | SubScrpt+ deriving Show++data CharStyle = CharStyle { cStyleId :: CharStyleId+ , cStyleName :: CharStyleName+ , cStyleData :: RunStyle+ } deriving (Show)++data RunStyle = RunStyle { isBold :: Maybe Bool+ , isBoldCTL :: Maybe Bool+ , isItalic :: Maybe Bool+ , isItalicCTL :: Maybe Bool+ , isSmallCaps :: Maybe Bool+ , isStrike :: Maybe Bool+ , isRTL :: Maybe Bool+ , isForceCTL :: Maybe Bool+ , rHighlight :: Maybe Text+ , rVertAlign :: Maybe VertAlign+ , rUnderline :: Maybe Text+ , rParentStyle :: Maybe CharStyle+ }+ deriving Show++data ParIndentation = ParIndentation { leftParIndent :: Maybe Integer+ , rightParIndent :: Maybe Integer+ , hangingParIndent :: Maybe Integer}+ deriving Show++data ParStyle = ParStyle { headingLev :: Maybe (ParaStyleName, Int)+ , indent :: Maybe ParIndentation+ , numInfo :: Maybe (T.Text, T.Text)+ , psParentStyle :: Maybe ParStyle+ , pStyleName :: ParaStyleName+ , pStyleId :: ParaStyleId+ }+ deriving Show++defaultRunStyle :: RunStyle+defaultRunStyle = RunStyle { isBold = Nothing+ , isBoldCTL = Nothing+ , isItalic = Nothing+ , isItalicCTL = Nothing+ , isSmallCaps = Nothing+ , isStrike = Nothing+ , isRTL = Nothing+ , isForceCTL = Nothing+ , rHighlight = Nothing+ , rVertAlign = Nothing+ , rUnderline = Nothing+ , rParentStyle = Nothing+ }++archiveToStyles'+ :: (Ord k1, Ord k2, ElemToStyle a1, ElemToStyle a2)+ => (a1 -> k1) -> (a2 -> k2) -> Archive -> (M.Map k1 a1, M.Map k2 a2)+archiveToStyles' conv1 conv2 zf =+ case findEntryByPath "word/styles.xml" zf of+ Nothing -> (M.empty, M.empty)+ Just entry ->+ case parseXMLElement . UTF8.toTextLazy . fromEntry $ entry of+ Left _ -> (M.empty, M.empty)+ Right styElem ->+ let namespaces = elemToNameSpaces styElem+ in+ ( M.fromList $ map (\r -> (conv1 r, r)) $+ buildBasedOnList namespaces styElem Nothing,+ M.fromList $ map (\p -> (conv2 p, p)) $+ buildBasedOnList namespaces styElem Nothing)++isBasedOnStyle :: (ElemToStyle a, FromStyleId (StyleId a)) => NameSpaces -> Element -> Maybe a -> Bool+isBasedOnStyle ns element parentStyle+ | isElem ns "w" "style" element+ , Just styleType <- findAttrByName ns "w" "type" element+ , styleType == cStyleType parentStyle+ , Just basedOnVal <- findChildByName ns "w" "basedOn" element >>=+ findAttrByName ns "w" "val"+ , Just ps <- parentStyle = basedOnVal == fromStyleId (getStyleId ps)+ | isElem ns "w" "style" element+ , Just styleType <- findAttrByName ns "w" "type" element+ , styleType == cStyleType parentStyle+ , Nothing <- findChildByName ns "w" "basedOn" element+ , Nothing <- parentStyle = True+ | otherwise = False++class HasStyleId a => ElemToStyle a where+ cStyleType :: Maybe a -> Text+ elemToStyle :: NameSpaces -> Element -> Maybe a -> Maybe a++class FromStyleId (StyleId a) => HasStyleId a where+ type StyleId a+ getStyleId :: a -> StyleId a++class FromStyleName (StyleName a) => HasStyleName a where+ type StyleName a+ getStyleName :: a -> StyleName a++instance ElemToStyle CharStyle where+ cStyleType _ = "character"+ elemToStyle ns element parentStyle+ | isElem ns "w" "style" element+ , Just "character" <- findAttrByName ns "w" "type" element =+ elemToCharStyle ns element parentStyle+ | otherwise = Nothing++instance HasStyleId CharStyle where+ type StyleId CharStyle = CharStyleId+ getStyleId = cStyleId++instance HasStyleName CharStyle where+ type StyleName CharStyle = CharStyleName+ getStyleName = cStyleName++instance ElemToStyle ParStyle where+ cStyleType _ = "paragraph"+ elemToStyle ns element parentStyle+ | isElem ns "w" "style" element+ , Just "paragraph" <- findAttrByName ns "w" "type" element+ = elemToParStyleData ns element parentStyle+ | otherwise = Nothing++instance HasStyleId ParStyle where+ type StyleId ParStyle = ParaStyleId+ getStyleId = pStyleId++instance HasStyleName ParStyle where+ type StyleName ParStyle = ParaStyleName+ getStyleName = pStyleName++getStyleChildren :: (ElemToStyle a) => NameSpaces -> Element -> Maybe a -> [a]+getStyleChildren ns element parentStyle+ | isElem ns "w" "styles" element =+ mapMaybe (\e -> elemToStyle ns e parentStyle) $+ filterChildren (\e' -> isBasedOnStyle ns e' parentStyle) element+ | otherwise = []++buildBasedOnList :: (ElemToStyle a) => NameSpaces -> Element -> Maybe a -> [a]+buildBasedOnList ns element rootStyle =+ case getStyleChildren ns element rootStyle of+ [] -> []+ stys -> stys +++ concatMap (buildBasedOnList ns element . Just) stys++stringToInteger :: Text -> Maybe Integer+stringToInteger s = case Data.Text.Read.decimal s of+ Right (x,t) | T.null t -> Just x+ _ -> Nothing++checkOnOff :: NameSpaces -> Element -> QName -> Maybe Bool+checkOnOff ns rPr tag+ | Just t <- findChild tag rPr+ , Just val <- findAttrByName ns "w" "val" t =+ Just $ case val of+ "true" -> True+ "false" -> False+ "on" -> True+ "off" -> False+ "1" -> True+ "0" -> False+ _ -> False+ | Just _ <- findChild tag rPr = Just True+checkOnOff _ _ _ = Nothing++elemToCharStyle :: NameSpaces+ -> Element -> Maybe CharStyle -> Maybe CharStyle+elemToCharStyle ns element parentStyle+ = CharStyle <$> (CharStyleId <$> findAttrByName ns "w" "styleId" element)+ <*> getElementStyleName ns element+ <*> Just (elemToRunStyle ns element parentStyle)++elemToRunStyle :: NameSpaces -> Element -> Maybe CharStyle -> RunStyle+elemToRunStyle ns element parentStyle+ | Just rPr <- findChildByName ns "w" "rPr" element =+ RunStyle+ {+ isBold = checkOnOff ns rPr (elemName ns "w" "b")+ , isBoldCTL = checkOnOff ns rPr (elemName ns "w" "bCs")+ , isItalic = checkOnOff ns rPr (elemName ns "w" "i")+ , isItalicCTL = checkOnOff ns rPr (elemName ns "w" "iCs")+ , isSmallCaps = checkOnOff ns rPr (elemName ns "w" "smallCaps")+ , isStrike = checkOnOff ns rPr (elemName ns "w" "strike")+ , isRTL = checkOnOff ns rPr (elemName ns "w" "rtl")+ , isForceCTL = checkOnOff ns rPr (elemName ns "w" "cs")+ , rHighlight =+ findChildByName ns "w" "highlight" rPr >>=+ findAttrByName ns "w" "val"+ , rVertAlign =+ findChildByName ns "w" "vertAlign" rPr >>=+ findAttrByName ns "w" "val" >>=+ \v -> Just $ case v of+ "superscript" -> SupScrpt+ "subscript" -> SubScrpt+ _ -> BaseLn+ , rUnderline =+ findChildByName ns "w" "u" rPr >>=+ findAttrByName ns "w" "val"+ , rParentStyle = parentStyle+ }+elemToRunStyle _ _ _ = defaultRunStyle++getHeaderLevel :: NameSpaces -> Element -> Maybe (ParaStyleName, Int)+getHeaderLevel ns element+ | Just styleName <- getElementStyleName ns element+ , Just n <- stringToInteger =<<+ (T.stripPrefix "heading " . T.toLower $+ fromStyleName styleName)+ , n > 0 = Just (styleName, fromInteger n)+getHeaderLevel _ _ = Nothing++getIndentation :: NameSpaces -> Element -> Maybe ParIndentation+getIndentation ns el = do+ indElement <- findChildByName ns "w" "pPr" el >>=+ findChildByName ns "w" "ind"+ return $ ParIndentation+ {+ leftParIndent = findAttrByName ns "w" "left" indElement <|>+ findAttrByName ns "w" "start" indElement >>=+ stringToInteger+ , rightParIndent = findAttrByName ns "w" "right" indElement <|>+ findAttrByName ns "w" "end" indElement >>=+ stringToInteger+ , hangingParIndent = findAttrByName ns "w" "hanging" indElement >>=+ stringToInteger+ }++getElementStyleName :: Coercible T.Text a => NameSpaces -> Element -> Maybe a+getElementStyleName ns el = coerce <$>+ ((findChildByName ns "w" "name" el >>= findAttrByName ns "w" "val")+ <|> findAttrByName ns "w" "styleId" el)++getNumInfo :: NameSpaces -> Element -> Maybe (T.Text, T.Text)+getNumInfo ns element = do+ let numPr = findChildByName ns "w" "pPr" element >>=+ findChildByName ns "w" "numPr"+ lvl = fromMaybe "0" (numPr >>=+ findChildByName ns "w" "ilvl" >>=+ findAttrByName ns "w" "val")+ numId <- numPr >>=+ findChildByName ns "w" "numId" >>=+ findAttrByName ns "w" "val"+ return (numId, lvl)++elemToParStyleData :: NameSpaces -> Element -> Maybe ParStyle -> Maybe ParStyle+elemToParStyleData ns element parentStyle+ | Just styleId <- findAttrByName ns "w" "styleId" element+ , Just styleName <- getElementStyleName ns element+ = Just $ ParStyle+ {+ headingLev = getHeaderLevel ns element+ , indent = getIndentation ns element+ , numInfo = getNumInfo ns element+ , psParentStyle = parentStyle+ , pStyleName = styleName+ , pStyleId = ParaStyleId styleId+ }+elemToParStyleData _ _ _ = Nothing
@@ -1,182 +0,0 @@-{-# LANGUAGE TypeSynonymInstances, FlexibleInstances,- PatternGuards #-}--module Text.Pandoc.Readers.Docx.Reducible ( concatReduce- , (<+>)- )- where---import Text.Pandoc.Builder-import Data.Monoid-import Data.List-import Data.Sequence (ViewR(..), ViewL(..), viewl, viewr)-import qualified Data.Sequence as Seq (null)--data Modifier a = Modifier (a -> a)- | AttrModifier (Attr -> a -> a) Attr- | NullModifier--class (Eq a) => Modifiable a where- modifier :: a -> Modifier a- innards :: a -> a- getL :: a -> (a, a)- getR :: a -> (a, a)- spaceOut :: a -> (a, a, a)--spaceOutL :: (Monoid a, Modifiable a) => a -> (a, a)-spaceOutL ms = (l, stack fs (m' <> r))- where (l, m, r) = spaceOut ms- (fs, m') = unstack m--spaceOutR :: (Monoid a, Modifiable a) => a -> (a, a)-spaceOutR ms = (stack fs (l <> m'), r)- where (l, m, r) = spaceOut ms- (fs, m') = unstack m--instance (Monoid a, Show a) => Show (Modifier a) where- show (Modifier f) = show $ f mempty- show (AttrModifier f attr) = show $ f attr mempty- show (NullModifier) = "NullModifier"--instance (Monoid a, Eq a) => Eq (Modifier a) where- (Modifier f) == (Modifier g) = (f mempty == g mempty)- (AttrModifier f attr) == (AttrModifier g attr') = (f attr mempty == g attr' mempty)- (NullModifier) == (NullModifier) = True- _ == _ = False--instance Modifiable Inlines where- modifier ils = case viewl (unMany ils) of- (x :< xs) | Seq.null xs -> case x of- (Emph _) -> Modifier emph- (Strong _) -> Modifier strong- (SmallCaps _) -> Modifier smallcaps- (Strikeout _) -> Modifier strikeout- (Superscript _) -> Modifier superscript- (Subscript _) -> Modifier subscript- (Span attr _) -> AttrModifier spanWith attr- _ -> NullModifier- _ -> NullModifier-- innards ils = case viewl (unMany ils) of- (x :< xs) | Seq.null xs -> case x of- (Emph lst) -> fromList lst- (Strong lst) -> fromList lst- (SmallCaps lst) -> fromList lst- (Strikeout lst) -> fromList lst- (Superscript lst) -> fromList lst- (Subscript lst) -> fromList lst- (Span _ lst) -> fromList lst- _ -> ils- _ -> ils-- getL ils = case viewl $ unMany ils of- (s :< sq) -> (singleton s, Many sq)- _ -> (mempty, ils)-- getR ils = case viewr $ unMany ils of- (sq :> s) -> (Many sq, singleton s)- _ -> (ils, mempty)-- spaceOut ils =- let (fs, ils') = unstack ils- contents = unMany ils'- left = case viewl contents of- (Space :< _) -> space- _ -> mempty- right = case viewr contents of- (_ :> Space) -> space- _ -> mempty in- (left, (stack fs $ trimInlines .Many $ contents), right)--instance Modifiable Blocks where- modifier blks = case viewl (unMany blks) of- (x :< xs) | Seq.null xs -> case x of- (BlockQuote _) -> Modifier blockQuote- -- (Div attr _) -> AttrModifier divWith attr- _ -> NullModifier- _ -> NullModifier-- innards blks = case viewl (unMany blks) of- (x :< xs) | Seq.null xs -> case x of- (BlockQuote lst) -> fromList lst- -- (Div attr lst) -> fromList lst- _ -> blks- _ -> blks-- spaceOut blks = (mempty, blks, mempty)-- getL ils = case viewl $ unMany ils of- (s :< sq) -> (singleton s, Many sq)- _ -> (mempty, ils)-- getR ils = case viewr $ unMany ils of- (sq :> s) -> (Many sq, singleton s)- _ -> (ils, mempty)---unstack :: (Modifiable a) => a -> ([Modifier a], a)-unstack ms = case modifier ms of- NullModifier -> ([], ms)- _ -> (f : fs, ms') where- f = modifier ms- (fs, ms') = unstack $ innards ms--stack :: (Monoid a, Modifiable a) => [Modifier a] -> a -> a-stack [] ms = ms-stack (NullModifier : fs) ms = stack fs ms-stack ((Modifier f) : fs) ms =- if isEmpty ms- then stack fs ms- else f $ stack fs ms-stack ((AttrModifier f attr) : fs) ms = f attr $ stack fs ms--isEmpty :: (Monoid a, Eq a) => a -> Bool-isEmpty x = x == mempty---combine :: (Monoid a, Modifiable a, Eq a) => a -> a -> a-combine x y =- let (xs', x') = getR x- (y', ys') = getL y- in- xs' <> (combineSingleton x' y') <> ys'--isAttrModifier :: Modifier a -> Bool-isAttrModifier (AttrModifier _ _) = True-isAttrModifier _ = False--combineSingleton :: (Monoid a, Modifiable a, Eq a) => a -> a -> a-combineSingleton x y =- let (xfs, xs) = unstack x- (yfs, ys) = unstack y- shared = xfs `intersect` yfs- x_remaining = xfs \\ shared- y_remaining = yfs \\ shared- x_rem_attr = filter isAttrModifier x_remaining- y_rem_attr = filter isAttrModifier y_remaining- in- case null shared of- True | isEmpty xs && isEmpty ys ->- stack (x_rem_attr ++ y_rem_attr) mempty- | isEmpty xs ->- let (sp, y') = spaceOutL y in- (stack x_rem_attr mempty) <> sp <> y'- | isEmpty ys ->- let (x', sp) = spaceOutR x in- x' <> sp <> (stack y_rem_attr mempty)- | otherwise ->- let (x', xsp) = spaceOutR x- (ysp, y') = spaceOutL y- in- x' <> xsp <> ysp <> y'- False -> stack shared $- combine- (stack x_remaining xs)- (stack y_remaining ys)--(<+>) :: (Monoid a, Modifiable a, Eq a) => a -> a -> a-x <+> y = combine x y--concatReduce :: (Monoid a, Modifiable a) => [a] -> a-concatReduce xs = foldl combine mempty xs
@@ -0,0 +1,1085 @@+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Readers.Docx.Symbols+ Copyright : © 2023 John MacFarlane <jgm@berkeley.edu>+ License : GNU GPL, version 2 or above++ Maintainer : John MacFarlane <jgm@berkeley.edu>+ Stability : alpha+ Portability : portable++Symbol tables for MS symbol fonts. This is needed for w:sym.+-}+module Text.Pandoc.Readers.Docx.Symbols ( Font(..),+ textToFont,+ symbolMap ) where++import Data.Text (Text)+import qualified Data.Map as M++data Font = Symbol | Wingdings | Wingdings2 | Wingdings3 | Webdings+ deriving (Show, Ord, Eq)++textToFont :: Text -> Maybe Font+textToFont "Symbol" = Just Symbol+textToFont "Wingdings" = Just Wingdings+textToFont "Wingdings 2" = Just Wingdings2+textToFont "Wingdings 3" = Just Wingdings3+textToFont "Webdings" = Just Webdings+textToFont _ = Nothing++-- \ Maps font and internal character number to Unicode code point.+symbolMap :: M.Map (Font, Int) Int+symbolMap = M.fromList+ [((Wingdings, 0x21), 0x1F589)+ ,((Wingdings, 0x22), 0x2702)+ ,((Wingdings, 0x23), 0x2701)+ ,((Wingdings, 0x24), 0x1F453)+ ,((Wingdings, 0x25), 0x1F56D)+ ,((Wingdings, 0x26), 0x1F56E)+ ,((Wingdings, 0x27), 0x1F56F)+ ,((Wingdings, 0x28), 0x1F57F)+ ,((Wingdings, 0x29), 0x2706)+ ,((Wingdings, 0x2A), 0x1F582)+ ,((Wingdings, 0x2B), 0x1F583)+ ,((Wingdings, 0x2C), 0x1F4EA)+ ,((Wingdings, 0x2D), 0x1F4EB)+ ,((Wingdings, 0x2E), 0x1F4EC)+ ,((Wingdings, 0x2F), 0x1F4ED)+ ,((Wingdings, 0x30), 0x1F4C1)+ ,((Wingdings, 0x31), 0x1F4C2)+ ,((Wingdings, 0x32), 0x1F4C4)+ ,((Wingdings, 0x33), 0x1F5CF)+ ,((Wingdings, 0x34), 0x1F5D0)+ ,((Wingdings, 0x35), 0x1F5C4)+ ,((Wingdings, 0x36), 0x231B)+ ,((Wingdings, 0x37), 0x1F5AE)+ ,((Wingdings, 0x38), 0x1F5B0)+ ,((Wingdings, 0x39), 0x1F5B2)+ ,((Wingdings, 0x3A), 0x1F5B3)+ ,((Wingdings, 0x3B), 0x1F5B4)+ ,((Wingdings, 0x3C), 0x1F5AB)+ ,((Wingdings, 0x3D), 0x1F5AC)+ ,((Wingdings, 0x3E), 0x2707)+ ,((Wingdings, 0x3F), 0x270D)+ ,((Wingdings, 0x40), 0x1F58E)+ ,((Wingdings, 0x41), 0x270C)+ ,((Wingdings, 0x42), 0x1F44C)+ ,((Wingdings, 0x43), 0x1F44D)+ ,((Wingdings, 0x44), 0x1F44E)+ ,((Wingdings, 0x45), 0x261C)+ ,((Wingdings, 0x46), 0x261E)+ ,((Wingdings, 0x47), 0x261D)+ ,((Wingdings, 0x48), 0x261F)+ ,((Wingdings, 0x49), 0x1F590)+ ,((Wingdings, 0x4A), 0x263A)+ ,((Wingdings, 0x4B), 0x1F610)+ ,((Wingdings, 0x4C), 0x2639)+ ,((Wingdings, 0x4D), 0x1F4A3)+ ,((Wingdings, 0x4E), 0x2620)+ ,((Wingdings, 0x4F), 0x1F3F3)+ ,((Wingdings, 0x50), 0x1F3F1)+ ,((Wingdings, 0x51), 0x2708)+ ,((Wingdings, 0x52), 0x263C)+ ,((Wingdings, 0x53), 0x1F4A7)+ ,((Wingdings, 0x54), 0x2744)+ ,((Wingdings, 0x55), 0x1F546)+ ,((Wingdings, 0x56), 0x271E)+ ,((Wingdings, 0x57), 0x1F548)+ ,((Wingdings, 0x58), 0x2720)+ ,((Wingdings, 0x59), 0x2721)+ ,((Wingdings, 0x5A), 0x262A)+ ,((Wingdings, 0x5B), 0x262F)+ ,((Wingdings, 0x5C), 0x0950)+ ,((Wingdings, 0x5D), 0x2638)+ ,((Wingdings, 0x5E), 0x2648)+ ,((Wingdings, 0x5F), 0x2649)+ ,((Wingdings, 0x60), 0x264A)+ ,((Wingdings, 0x61), 0x264B)+ ,((Wingdings, 0x62), 0x264C)+ ,((Wingdings, 0x63), 0x264D)+ ,((Wingdings, 0x64), 0x264E)+ ,((Wingdings, 0x65), 0x264F)+ ,((Wingdings, 0x66), 0x2650)+ ,((Wingdings, 0x67), 0x2651)+ ,((Wingdings, 0x68), 0x2652)+ ,((Wingdings, 0x69), 0x2653)+ ,((Wingdings, 0x6A), 0x1F670)+ ,((Wingdings, 0x6B), 0x1F675)+ ,((Wingdings, 0x6C), 0x25CF)+ ,((Wingdings, 0x6D), 0x1F53E)+ ,((Wingdings, 0x6E), 0x25A0)+ ,((Wingdings, 0x6F), 0x25A1)+ ,((Wingdings, 0x70), 0x1F790)+ ,((Wingdings, 0x71), 0x2751)+ ,((Wingdings, 0x72), 0x2752)+ ,((Wingdings, 0x73), 0x2B27)+ ,((Wingdings, 0x74), 0x29EB)+ ,((Wingdings, 0x75), 0x25C6)+ ,((Wingdings, 0x76), 0x2756)+ ,((Wingdings, 0x77), 0x2B25)+ ,((Wingdings, 0x78), 0x2327)+ ,((Wingdings, 0x79), 0x2BB9)+ ,((Wingdings, 0x7A), 0x2318)+ ,((Wingdings, 0x7B), 0x1F3F5)+ ,((Wingdings, 0x7C), 0x1F3F6)+ ,((Wingdings, 0x7D), 0x1F676)+ ,((Wingdings, 0x7E), 0x1F677)+ ,((Wingdings, 0x80), 0x24EA)+ ,((Wingdings, 0x81), 0x2460)+ ,((Wingdings, 0x82), 0x2461)+ ,((Wingdings, 0x83), 0x2462)+ ,((Wingdings, 0x84), 0x2463)+ ,((Wingdings, 0x85), 0x2464)+ ,((Wingdings, 0x86), 0x2465)+ ,((Wingdings, 0x87), 0x2466)+ ,((Wingdings, 0x88), 0x2467)+ ,((Wingdings, 0x89), 0x2468)+ ,((Wingdings, 0x8A), 0x2469)+ ,((Wingdings, 0x8B), 0x24FF)+ ,((Wingdings, 0x8C), 0x2776)+ ,((Wingdings, 0x8D), 0x2777)+ ,((Wingdings, 0x8E), 0x2778)+ ,((Wingdings, 0x8F), 0x2779)+ ,((Wingdings, 0x90), 0x277A)+ ,((Wingdings, 0x91), 0x277B)+ ,((Wingdings, 0x92), 0x277C)+ ,((Wingdings, 0x93), 0x277D)+ ,((Wingdings, 0x94), 0x277E)+ ,((Wingdings, 0x95), 0x277F)+ ,((Wingdings, 0x96), 0x1F662)+ ,((Wingdings, 0x97), 0x1F660)+ ,((Wingdings, 0x98), 0x1F661)+ ,((Wingdings, 0x99), 0x1F663)+ ,((Wingdings, 0x9A), 0x1F65E)+ ,((Wingdings, 0x9B), 0x1F65C)+ ,((Wingdings, 0x9C), 0x1F65D)+ ,((Wingdings, 0x9D), 0x1F65F)+ ,((Wingdings, 0x9E), 0x00B7)+ ,((Wingdings, 0x9F), 0x2022)+ ,((Wingdings, 0xA1), 0x26AA)+ ,((Wingdings, 0xA2), 0x1F786)+ ,((Wingdings, 0xA3), 0x1F788)+ ,((Wingdings, 0xA4), 0x25C9)+ ,((Wingdings, 0xA5), 0x25CE)+ ,((Wingdings, 0xA6), 0x1F53F)+ ,((Wingdings, 0xA7), 0x25AA)+ ,((Wingdings, 0xA8), 0x25FB)+ ,((Wingdings, 0xA9), 0x1F7C2)+ ,((Wingdings, 0xAA), 0x2726)+ ,((Wingdings, 0xAB), 0x2605)+ ,((Wingdings, 0xAC), 0x2736)+ ,((Wingdings, 0xAD), 0x2734)+ ,((Wingdings, 0xAE), 0x2739)+ ,((Wingdings, 0xAF), 0x2735)+ ,((Wingdings, 0xB0), 0x2BD0)+ ,((Wingdings, 0xB1), 0x2316)+ ,((Wingdings, 0xB2), 0x27E1)+ ,((Wingdings, 0xB3), 0x2311)+ ,((Wingdings, 0xB4), 0x2BD1)+ ,((Wingdings, 0xB5), 0x272A)+ ,((Wingdings, 0xB6), 0x2730)+ ,((Wingdings, 0xB7), 0x1F550)+ ,((Wingdings, 0xB8), 0x1F551)+ ,((Wingdings, 0xB9), 0x1F552)+ ,((Wingdings, 0xBA), 0x1F553)+ ,((Wingdings, 0xBB), 0x1F554)+ ,((Wingdings, 0xBC), 0x1F555)+ ,((Wingdings, 0xBD), 0x1F556)+ ,((Wingdings, 0xBE), 0x1F557)+ ,((Wingdings, 0xBF), 0x1F558)+ ,((Wingdings, 0xC0), 0x1F559)+ ,((Wingdings, 0xC1), 0x1F55A)+ ,((Wingdings, 0xC2), 0x1F55B)+ ,((Wingdings, 0xC3), 0x2BB0)+ ,((Wingdings, 0xC4), 0x2BB1)+ ,((Wingdings, 0xC5), 0x2BB2)+ ,((Wingdings, 0xC6), 0x2BB3)+ ,((Wingdings, 0xC7), 0x2BB4)+ ,((Wingdings, 0xC8), 0x2BB5)+ ,((Wingdings, 0xC9), 0x2BB6)+ ,((Wingdings, 0xCA), 0x2BB7)+ ,((Wingdings, 0xCB), 0x1F66A)+ ,((Wingdings, 0xCC), 0x1F66B)+ ,((Wingdings, 0xCD), 0x1F655)+ ,((Wingdings, 0xCE), 0x1F654)+ ,((Wingdings, 0xCF), 0x1F657)+ ,((Wingdings, 0xD0), 0x1F656)+ ,((Wingdings, 0xD1), 0x1F650)+ ,((Wingdings, 0xD2), 0x1F651)+ ,((Wingdings, 0xD3), 0x1F652)+ ,((Wingdings, 0xD4), 0x1F653)+ ,((Wingdings, 0xD5), 0x232B)+ ,((Wingdings, 0xD6), 0x2326)+ ,((Wingdings, 0xD7), 0x2B98)+ ,((Wingdings, 0xD8), 0x2B9A)+ ,((Wingdings, 0xD9), 0x2B99)+ ,((Wingdings, 0xDA), 0x2B9B)+ ,((Wingdings, 0xDB), 0x2B88)+ ,((Wingdings, 0xDC), 0x2B8A)+ ,((Wingdings, 0xDD), 0x2B89)+ ,((Wingdings, 0xDE), 0x2B8B)+ ,((Wingdings, 0xDF), 0x1F868)+ ,((Wingdings, 0xE0), 0x1F86A)+ ,((Wingdings, 0xE1), 0x1F869)+ ,((Wingdings, 0xE2), 0x1F86B)+ ,((Wingdings, 0xE3), 0x1F86C)+ ,((Wingdings, 0xE4), 0x1F86D)+ ,((Wingdings, 0xE5), 0x1F86F)+ ,((Wingdings, 0xE6), 0x1F86E)+ ,((Wingdings, 0xE7), 0x1F878)+ ,((Wingdings, 0xE8), 0x1F87A)+ ,((Wingdings, 0xE9), 0x1F879)+ ,((Wingdings, 0xEA), 0x1F87B)+ ,((Wingdings, 0xEB), 0x1F87C)+ ,((Wingdings, 0xEC), 0x1F87D)+ ,((Wingdings, 0xED), 0x1F87F)+ ,((Wingdings, 0xEE), 0x1F87E)+ ,((Wingdings, 0xEF), 0x21E6)+ ,((Wingdings, 0xF0), 0x21E8)+ ,((Wingdings, 0xF1), 0x21E7)+ ,((Wingdings, 0xF2), 0x21E9)+ ,((Wingdings, 0xF3), 0x2B04)+ ,((Wingdings, 0xF4), 0x21F3)+ ,((Wingdings, 0xF5), 0x2B00)+ ,((Wingdings, 0xF6), 0x2B01)+ ,((Wingdings, 0xF7), 0x2B03)+ ,((Wingdings, 0xF8), 0x2B02)+ ,((Wingdings, 0xF9), 0x1F8AC)+ ,((Wingdings, 0xFA), 0x1F8AD)+ ,((Wingdings, 0xFB), 0x1F5F6)+ ,((Wingdings, 0xFC), 0x2714)+ ,((Wingdings, 0xFD), 0x1F5F7)+ ,((Wingdings, 0xFE), 0x1F5F9)+ ,((Wingdings2, 0x21), 0x1F58A)+ ,((Wingdings2, 0x22), 0x1F58B)+ ,((Wingdings2, 0x23), 0x1F58C)+ ,((Wingdings2, 0x24), 0x1F58D)+ ,((Wingdings2, 0x25), 0x2704)+ ,((Wingdings2, 0x26), 0x2700)+ ,((Wingdings2, 0x27), 0x1F57E)+ ,((Wingdings2, 0x28), 0x1F57D)+ ,((Wingdings2, 0x29), 0x1F5C5)+ ,((Wingdings2, 0x2A), 0x1F5C6)+ ,((Wingdings2, 0x2B), 0x1F5C7)+ ,((Wingdings2, 0x2C), 0x1F5C8)+ ,((Wingdings2, 0x2D), 0x1F5C9)+ ,((Wingdings2, 0x2E), 0x1F5CA)+ ,((Wingdings2, 0x2F), 0x1F5CB)+ ,((Wingdings2, 0x30), 0x1F5CC)+ ,((Wingdings2, 0x31), 0x1F5CD)+ ,((Wingdings2, 0x32), 0x1F4CB)+ ,((Wingdings2, 0x33), 0x1F5D1)+ ,((Wingdings2, 0x34), 0x1F5D4)+ ,((Wingdings2, 0x35), 0x1F5B5)+ ,((Wingdings2, 0x36), 0x1F5B6)+ ,((Wingdings2, 0x37), 0x1F5B7)+ ,((Wingdings2, 0x38), 0x1F5B8)+ ,((Wingdings2, 0x39), 0x1F5AD)+ ,((Wingdings2, 0x3A), 0x1F5AF)+ ,((Wingdings2, 0x3B), 0x1F5B1)+ ,((Wingdings2, 0x3C), 0x1F592)+ ,((Wingdings2, 0x3D), 0x1F593)+ ,((Wingdings2, 0x3E), 0x1F598)+ ,((Wingdings2, 0x3F), 0x1F599)+ ,((Wingdings2, 0x40), 0x1F59A)+ ,((Wingdings2, 0x41), 0x1F59B)+ ,((Wingdings2, 0x42), 0x1F448)+ ,((Wingdings2, 0x43), 0x1F449)+ ,((Wingdings2, 0x44), 0x1F59C)+ ,((Wingdings2, 0x45), 0x1F59D)+ ,((Wingdings2, 0x46), 0x1F59E)+ ,((Wingdings2, 0x47), 0x1F59F)+ ,((Wingdings2, 0x48), 0x1F5A0)+ ,((Wingdings2, 0x49), 0x1F5A1)+ ,((Wingdings2, 0x4A), 0x1F446)+ ,((Wingdings2, 0x4B), 0x1F447)+ ,((Wingdings2, 0x4C), 0x1F5A2)+ ,((Wingdings2, 0x4D), 0x1F5A3)+ ,((Wingdings2, 0x4E), 0x1F591)+ ,((Wingdings2, 0x4F), 0x1F5F4)+ ,((Wingdings2, 0x50), 0x2713)+ ,((Wingdings2, 0x51), 0x1F5F5)+ ,((Wingdings2, 0x52), 0x2611)+ ,((Wingdings2, 0x53), 0x2612)+ ,((Wingdings2, 0x54), 0x2612)+ ,((Wingdings2, 0x55), 0x2BBE)+ ,((Wingdings2, 0x56), 0x2BBF)+ ,((Wingdings2, 0x57), 0x29B8)+ ,((Wingdings2, 0x58), 0x29B8)+ ,((Wingdings2, 0x59), 0x1F671)+ ,((Wingdings2, 0x5A), 0x1F674)+ ,((Wingdings2, 0x5B), 0x1F672)+ ,((Wingdings2, 0x5C), 0x1F673)+ ,((Wingdings2, 0x5D), 0x203D)+ ,((Wingdings2, 0x5E), 0x1F679)+ ,((Wingdings2, 0x5F), 0x1F67A)+ ,((Wingdings2, 0x60), 0x1F67B)+ ,((Wingdings2, 0x61), 0x1F666)+ ,((Wingdings2, 0x62), 0x1F664)+ ,((Wingdings2, 0x63), 0x1F665)+ ,((Wingdings2, 0x64), 0x1F667)+ ,((Wingdings2, 0x65), 0x1F65A)+ ,((Wingdings2, 0x66), 0x1F658)+ ,((Wingdings2, 0x67), 0x1F659)+ ,((Wingdings2, 0x68), 0x1F65B)+ ,((Wingdings2, 0x69), 0x24EA)+ ,((Wingdings2, 0x6A), 0x2460)+ ,((Wingdings2, 0x6B), 0x2461)+ ,((Wingdings2, 0x6C), 0x2462)+ ,((Wingdings2, 0x6D), 0x2463)+ ,((Wingdings2, 0x6E), 0x2464)+ ,((Wingdings2, 0x6F), 0x2465)+ ,((Wingdings2, 0x70), 0x2466)+ ,((Wingdings2, 0x71), 0x2467)+ ,((Wingdings2, 0x72), 0x2468)+ ,((Wingdings2, 0x73), 0x2469)+ ,((Wingdings2, 0x74), 0x24FF)+ ,((Wingdings2, 0x75), 0x2776)+ ,((Wingdings2, 0x76), 0x2777)+ ,((Wingdings2, 0x77), 0x2778)+ ,((Wingdings2, 0x78), 0x2779)+ ,((Wingdings2, 0x79), 0x277A)+ ,((Wingdings2, 0x7A), 0x277B)+ ,((Wingdings2, 0x7B), 0x277C)+ ,((Wingdings2, 0x7C), 0x277D)+ ,((Wingdings2, 0x7D), 0x277E)+ ,((Wingdings2, 0x7E), 0x277F)+ ,((Wingdings2, 0x80), 0x2609)+ ,((Wingdings2, 0x81), 0x1F315)+ ,((Wingdings2, 0x82), 0x263D)+ ,((Wingdings2, 0x83), 0x263E)+ ,((Wingdings2, 0x84), 0x2E3F)+ ,((Wingdings2, 0x85), 0x271D)+ ,((Wingdings2, 0x86), 0x1F547)+ ,((Wingdings2, 0x87), 0x1F55C)+ ,((Wingdings2, 0x88), 0x1F55D)+ ,((Wingdings2, 0x89), 0x1F55E)+ ,((Wingdings2, 0x8A), 0x1F55F)+ ,((Wingdings2, 0x8B), 0x1F560)+ ,((Wingdings2, 0x8C), 0x1F561)+ ,((Wingdings2, 0x8D), 0x1F562)+ ,((Wingdings2, 0x8E), 0x1F563)+ ,((Wingdings2, 0x8F), 0x1F564)+ ,((Wingdings2, 0x90), 0x1F565)+ ,((Wingdings2, 0x91), 0x1F566)+ ,((Wingdings2, 0x92), 0x1F567)+ ,((Wingdings2, 0x93), 0x1F668)+ ,((Wingdings2, 0x94), 0x1F669)+ ,((Wingdings2, 0x95), 0x2022)+ ,((Wingdings2, 0x96), 0x25CF)+ ,((Wingdings2, 0x97), 0x26AB)+ ,((Wingdings2, 0x98), 0x2B24)+ ,((Wingdings2, 0x99), 0x1F785)+ ,((Wingdings2, 0x9A), 0x1F786)+ ,((Wingdings2, 0x9B), 0x1F787)+ ,((Wingdings2, 0x9C), 0x1F788)+ ,((Wingdings2, 0x9D), 0x1F78A)+ ,((Wingdings2, 0x9E), 0x29BF)+ ,((Wingdings2, 0x9F), 0x25FE)+ ,((Wingdings2, 0xA1), 0x25FC)+ ,((Wingdings2, 0xA2), 0x2B1B)+ ,((Wingdings2, 0xA3), 0x2B1C)+ ,((Wingdings2, 0xA4), 0x1F791)+ ,((Wingdings2, 0xA5), 0x1F792)+ ,((Wingdings2, 0xA6), 0x1F793)+ ,((Wingdings2, 0xA7), 0x1F794)+ ,((Wingdings2, 0xA8), 0x25A3)+ ,((Wingdings2, 0xA9), 0x1F795)+ ,((Wingdings2, 0xAA), 0x1F796)+ ,((Wingdings2, 0xAB), 0x1F797)+ ,((Wingdings2, 0xAC), 0x2B29)+ ,((Wingdings2, 0xAD), 0x2B25)+ ,((Wingdings2, 0xAE), 0x25C6)+ ,((Wingdings2, 0xAF), 0x25C7)+ ,((Wingdings2, 0xB0), 0x1F79A)+ ,((Wingdings2, 0xB1), 0x25C8)+ ,((Wingdings2, 0xB2), 0x1F79B)+ ,((Wingdings2, 0xB3), 0x1F79C)+ ,((Wingdings2, 0xB4), 0x1F79D)+ ,((Wingdings2, 0xB5), 0x2B2A)+ ,((Wingdings2, 0xB6), 0x2B27)+ ,((Wingdings2, 0xB7), 0x29EB)+ ,((Wingdings2, 0xB8), 0x25CA)+ ,((Wingdings2, 0xB9), 0x1F7A0)+ ,((Wingdings2, 0xBA), 0x25D6)+ ,((Wingdings2, 0xBB), 0x25D7)+ ,((Wingdings2, 0xBC), 0x2BCA)+ ,((Wingdings2, 0xBD), 0x2BCB)+ ,((Wingdings2, 0xBE), 0x25FC)+ ,((Wingdings2, 0xBF), 0x2B25)+ ,((Wingdings2, 0xC0), 0x2B1F)+ ,((Wingdings2, 0xC1), 0x2BC2)+ ,((Wingdings2, 0xC2), 0x2B23)+ ,((Wingdings2, 0xC3), 0x2B22)+ ,((Wingdings2, 0xC4), 0x2BC3)+ ,((Wingdings2, 0xC5), 0x2BC4)+ ,((Wingdings2, 0xC6), 0x1F7A1)+ ,((Wingdings2, 0xC7), 0x1F7A2)+ ,((Wingdings2, 0xC8), 0x1F7A3)+ ,((Wingdings2, 0xC9), 0x1F7A4)+ ,((Wingdings2, 0xCA), 0x1F7A5)+ ,((Wingdings2, 0xCB), 0x1F7A6)+ ,((Wingdings2, 0xCC), 0x1F7A7)+ ,((Wingdings2, 0xCD), 0x1F7A8)+ ,((Wingdings2, 0xCE), 0x1F7A9)+ ,((Wingdings2, 0xCF), 0x1F7AA)+ ,((Wingdings2, 0xD0), 0x1F7AB)+ ,((Wingdings2, 0xD1), 0x1F7AC)+ ,((Wingdings2, 0xD2), 0x1F7AD)+ ,((Wingdings2, 0xD3), 0x1F7AE)+ ,((Wingdings2, 0xD4), 0x1F7AF)+ ,((Wingdings2, 0xD5), 0x1F7B0)+ ,((Wingdings2, 0xD6), 0x1F7B1)+ ,((Wingdings2, 0xD7), 0x1F7B2)+ ,((Wingdings2, 0xD8), 0x1F7B3)+ ,((Wingdings2, 0xD9), 0x1F7B4)+ ,((Wingdings2, 0xDA), 0x1F7B5)+ ,((Wingdings2, 0xDB), 0x1F7B6)+ ,((Wingdings2, 0xDC), 0x1F7B7)+ ,((Wingdings2, 0xDD), 0x1F7B8)+ ,((Wingdings2, 0xDE), 0x1F7B9)+ ,((Wingdings2, 0xDF), 0x1F7BA)+ ,((Wingdings2, 0xE0), 0x1F7BB)+ ,((Wingdings2, 0xE1), 0x1F7BC)+ ,((Wingdings2, 0xE2), 0x1F7BD)+ ,((Wingdings2, 0xE3), 0x1F7BE)+ ,((Wingdings2, 0xE4), 0x1F7BF)+ ,((Wingdings2, 0xE5), 0x1F7C0)+ ,((Wingdings2, 0xE6), 0x1F7C2)+ ,((Wingdings2, 0xE7), 0x1F7C4)+ ,((Wingdings2, 0xE8), 0x2726)+ ,((Wingdings2, 0xE9), 0x1F7C9)+ ,((Wingdings2, 0xEA), 0x2605)+ ,((Wingdings2, 0xEB), 0x2736)+ ,((Wingdings2, 0xEC), 0x1F7CB)+ ,((Wingdings2, 0xED), 0x2737)+ ,((Wingdings2, 0xEE), 0x1F7CF)+ ,((Wingdings2, 0xEF), 0x1F7D2)+ ,((Wingdings2, 0xF0), 0x2739)+ ,((Wingdings2, 0xF1), 0x1F7C3)+ ,((Wingdings2, 0xF2), 0x1F7C7)+ ,((Wingdings2, 0xF3), 0x272F)+ ,((Wingdings2, 0xF4), 0x1F7CD)+ ,((Wingdings2, 0xF5), 0x1F7D4)+ ,((Wingdings2, 0xF6), 0x2BCC)+ ,((Wingdings2, 0xF7), 0x2BCD)+ ,((Wingdings2, 0xF8), 0x203B)+ ,((Wingdings2, 0xF9), 0x2042)+ ,((Wingdings3, 0x21), 0x2B60)+ ,((Wingdings3, 0x22), 0x2B62)+ ,((Wingdings3, 0x23), 0x2B61)+ ,((Wingdings3, 0x24), 0x2B63)+ ,((Wingdings3, 0x25), 0x2B66)+ ,((Wingdings3, 0x26), 0x2B67)+ ,((Wingdings3, 0x27), 0x2B69)+ ,((Wingdings3, 0x28), 0x2B68)+ ,((Wingdings3, 0x29), 0x2B70)+ ,((Wingdings3, 0x2A), 0x2B72)+ ,((Wingdings3, 0x2B), 0x2B71)+ ,((Wingdings3, 0x2C), 0x2B73)+ ,((Wingdings3, 0x2D), 0x2B76)+ ,((Wingdings3, 0x2E), 0x2B78)+ ,((Wingdings3, 0x2F), 0x2B7B)+ ,((Wingdings3, 0x30), 0x2B7D)+ ,((Wingdings3, 0x31), 0x2B64)+ ,((Wingdings3, 0x32), 0x2B65)+ ,((Wingdings3, 0x33), 0x2B6A)+ ,((Wingdings3, 0x34), 0x2B6C)+ ,((Wingdings3, 0x35), 0x2B6B)+ ,((Wingdings3, 0x36), 0x2B6D)+ ,((Wingdings3, 0x37), 0x2B4D)+ ,((Wingdings3, 0x38), 0x2BA0)+ ,((Wingdings3, 0x39), 0x2BA1)+ ,((Wingdings3, 0x3A), 0x2BA2)+ ,((Wingdings3, 0x3B), 0x2BA3)+ ,((Wingdings3, 0x3C), 0x2BA4)+ ,((Wingdings3, 0x3D), 0x2BA5)+ ,((Wingdings3, 0x3E), 0x2BA6)+ ,((Wingdings3, 0x3F), 0x2BA7)+ ,((Wingdings3, 0x40), 0x2B90)+ ,((Wingdings3, 0x41), 0x2B91)+ ,((Wingdings3, 0x42), 0x2B92)+ ,((Wingdings3, 0x43), 0x2B93)+ ,((Wingdings3, 0x44), 0x2B80)+ ,((Wingdings3, 0x45), 0x2B83)+ ,((Wingdings3, 0x46), 0x2B7E)+ ,((Wingdings3, 0x47), 0x2B7F)+ ,((Wingdings3, 0x48), 0x2B84)+ ,((Wingdings3, 0x49), 0x2B86)+ ,((Wingdings3, 0x4A), 0x2B85)+ ,((Wingdings3, 0x4B), 0x2B87)+ ,((Wingdings3, 0x4C), 0x2B8F)+ ,((Wingdings3, 0x4D), 0x2B8D)+ ,((Wingdings3, 0x4E), 0x2B8E)+ ,((Wingdings3, 0x4F), 0x2B8C)+ ,((Wingdings3, 0x50), 0x2B6E)+ ,((Wingdings3, 0x51), 0x2B6F)+ ,((Wingdings3, 0x52), 0x238B)+ ,((Wingdings3, 0x53), 0x2324)+ ,((Wingdings3, 0x54), 0x2303)+ ,((Wingdings3, 0x55), 0x2325)+ ,((Wingdings3, 0x56), 0x23B5)+ ,((Wingdings3, 0x57), 0x237D)+ ,((Wingdings3, 0x58), 0x21EA)+ ,((Wingdings3, 0x59), 0x2BB8)+ ,((Wingdings3, 0x5A), 0x1F8A0)+ ,((Wingdings3, 0x5B), 0x1F8A1)+ ,((Wingdings3, 0x5C), 0x1F8A2)+ ,((Wingdings3, 0x5D), 0x1F8A3)+ ,((Wingdings3, 0x5E), 0x1F8A4)+ ,((Wingdings3, 0x5F), 0x1F8A5)+ ,((Wingdings3, 0x60), 0x1F8A6)+ ,((Wingdings3, 0x61), 0x1F8A7)+ ,((Wingdings3, 0x62), 0x1F8A8)+ ,((Wingdings3, 0x63), 0x1F8A9)+ ,((Wingdings3, 0x64), 0x1F8AA)+ ,((Wingdings3, 0x65), 0x1F8AB)+ ,((Wingdings3, 0x66), 0x2190)+ ,((Wingdings3, 0x67), 0x2192)+ ,((Wingdings3, 0x68), 0x2191)+ ,((Wingdings3, 0x69), 0x2193)+ ,((Wingdings3, 0x6A), 0x2196)+ ,((Wingdings3, 0x6B), 0x2197)+ ,((Wingdings3, 0x6C), 0x2199)+ ,((Wingdings3, 0x6D), 0x2198)+ ,((Wingdings3, 0x6E), 0x1F858)+ ,((Wingdings3, 0x6F), 0x1F859)+ ,((Wingdings3, 0x70), 0x25B2)+ ,((Wingdings3, 0x71), 0x25BC)+ ,((Wingdings3, 0x72), 0x25B3)+ ,((Wingdings3, 0x73), 0x25BD)+ ,((Wingdings3, 0x74), 0x25C4)+ ,((Wingdings3, 0x75), 0x25BA)+ ,((Wingdings3, 0x76), 0x25C1)+ ,((Wingdings3, 0x77), 0x25B7)+ ,((Wingdings3, 0x78), 0x25E3)+ ,((Wingdings3, 0x79), 0x25E2)+ ,((Wingdings3, 0x7A), 0x25E4)+ ,((Wingdings3, 0x7B), 0x25E5)+ ,((Wingdings3, 0x7C), 0x1F780)+ ,((Wingdings3, 0x7D), 0x1F782)+ ,((Wingdings3, 0x7E), 0x1F781)+ ,((Wingdings3, 0x80), 0x1F783)+ ,((Wingdings3, 0x81), 0x25B2)+ ,((Wingdings3, 0x82), 0x25BC)+ ,((Wingdings3, 0x83), 0x25C0)+ ,((Wingdings3, 0x84), 0x25B6)+ ,((Wingdings3, 0x85), 0x2B9C)+ ,((Wingdings3, 0x86), 0x2B9E)+ ,((Wingdings3, 0x87), 0x2B9D)+ ,((Wingdings3, 0x88), 0x2B9F)+ ,((Wingdings3, 0x89), 0x1F810)+ ,((Wingdings3, 0x8A), 0x1F812)+ ,((Wingdings3, 0x8B), 0x1F811)+ ,((Wingdings3, 0x8C), 0x1F813)+ ,((Wingdings3, 0x8D), 0x1F814)+ ,((Wingdings3, 0x8E), 0x1F816)+ ,((Wingdings3, 0x8F), 0x1F815)+ ,((Wingdings3, 0x90), 0x1F817)+ ,((Wingdings3, 0x91), 0x1F818)+ ,((Wingdings3, 0x92), 0x1F81A)+ ,((Wingdings3, 0x93), 0x1F819)+ ,((Wingdings3, 0x94), 0x1F81B)+ ,((Wingdings3, 0x95), 0x1F81C)+ ,((Wingdings3, 0x96), 0x1F81E)+ ,((Wingdings3, 0x97), 0x1F81D)+ ,((Wingdings3, 0x98), 0x1F81F)+ ,((Wingdings3, 0x99), 0x1F800)+ ,((Wingdings3, 0x9A), 0x1F802)+ ,((Wingdings3, 0x9B), 0x1F801)+ ,((Wingdings3, 0x9C), 0x1F803)+ ,((Wingdings3, 0x9D), 0x1F804)+ ,((Wingdings3, 0x9E), 0x1F806)+ ,((Wingdings3, 0x9F), 0x1F805)+ ,((Wingdings3, 0xA1), 0x1F808)+ ,((Wingdings3, 0xA2), 0x1F80A)+ ,((Wingdings3, 0xA3), 0x1F809)+ ,((Wingdings3, 0xA4), 0x1F80B)+ ,((Wingdings3, 0xA5), 0x1F820)+ ,((Wingdings3, 0xA6), 0x1F822)+ ,((Wingdings3, 0xA7), 0x1F824)+ ,((Wingdings3, 0xA8), 0x1F826)+ ,((Wingdings3, 0xA9), 0x1F828)+ ,((Wingdings3, 0xAA), 0x1F82A)+ ,((Wingdings3, 0xAB), 0x1F82C)+ ,((Wingdings3, 0xAC), 0x1F89C)+ ,((Wingdings3, 0xAD), 0x1F89D)+ ,((Wingdings3, 0xAE), 0x1F89E)+ ,((Wingdings3, 0xAF), 0x1F89F)+ ,((Wingdings3, 0xB0), 0x1F82E)+ ,((Wingdings3, 0xB1), 0x1F830)+ ,((Wingdings3, 0xB2), 0x1F832)+ ,((Wingdings3, 0xB3), 0x1F834)+ ,((Wingdings3, 0xB4), 0x1F836)+ ,((Wingdings3, 0xB5), 0x1F838)+ ,((Wingdings3, 0xB6), 0x1F83A)+ ,((Wingdings3, 0xB7), 0x1F839)+ ,((Wingdings3, 0xB8), 0x1F83B)+ ,((Wingdings3, 0xB9), 0x1F898)+ ,((Wingdings3, 0xBA), 0x1F89A)+ ,((Wingdings3, 0xBB), 0x1F899)+ ,((Wingdings3, 0xBC), 0x1F89B)+ ,((Wingdings3, 0xBD), 0x1F83C)+ ,((Wingdings3, 0xBE), 0x1F83E)+ ,((Wingdings3, 0xBF), 0x1F83D)+ ,((Wingdings3, 0xC0), 0x1F83F)+ ,((Wingdings3, 0xC1), 0x1F840)+ ,((Wingdings3, 0xC2), 0x1F842)+ ,((Wingdings3, 0xC3), 0x1F841)+ ,((Wingdings3, 0xC4), 0x1F843)+ ,((Wingdings3, 0xC5), 0x1F844)+ ,((Wingdings3, 0xC6), 0x1F846)+ ,((Wingdings3, 0xC7), 0x1F845)+ ,((Wingdings3, 0xC8), 0x1F847)+ ,((Wingdings3, 0xC9), 0x2BA8)+ ,((Wingdings3, 0xCA), 0x2BA9)+ ,((Wingdings3, 0xCB), 0x2BAA)+ ,((Wingdings3, 0xCC), 0x2BAB)+ ,((Wingdings3, 0xCD), 0x2BAC)+ ,((Wingdings3, 0xCE), 0x2BAD)+ ,((Wingdings3, 0xCF), 0x2BAE)+ ,((Wingdings3, 0xD0), 0x2BAF)+ ,((Wingdings3, 0xD1), 0x1F860)+ ,((Wingdings3, 0xD2), 0x1F862)+ ,((Wingdings3, 0xD3), 0x1F861)+ ,((Wingdings3, 0xD4), 0x1F863)+ ,((Wingdings3, 0xD5), 0x1F864)+ ,((Wingdings3, 0xD6), 0x1F865)+ ,((Wingdings3, 0xD7), 0x1F867)+ ,((Wingdings3, 0xD8), 0x1F866)+ ,((Wingdings3, 0xD9), 0x1F870)+ ,((Wingdings3, 0xDA), 0x1F872)+ ,((Wingdings3, 0xDB), 0x1F871)+ ,((Wingdings3, 0xDC), 0x1F873)+ ,((Wingdings3, 0xDD), 0x1F874)+ ,((Wingdings3, 0xDE), 0x1F875)+ ,((Wingdings3, 0xDF), 0x1F877)+ ,((Wingdings3, 0xE0), 0x1F876)+ ,((Wingdings3, 0xE1), 0x1F880)+ ,((Wingdings3, 0xE2), 0x1F882)+ ,((Wingdings3, 0xE3), 0x1F881)+ ,((Wingdings3, 0xE4), 0x1F883)+ ,((Wingdings3, 0xE5), 0x1F884)+ ,((Wingdings3, 0xE6), 0x1F885)+ ,((Wingdings3, 0xE7), 0x1F887)+ ,((Wingdings3, 0xE8), 0x1F886)+ ,((Wingdings3, 0xE9), 0x1F890)+ ,((Wingdings3, 0xEA), 0x1F892)+ ,((Wingdings3, 0xEB), 0x1F891)+ ,((Wingdings3, 0xEC), 0x1F893)+ ,((Wingdings3, 0xED), 0x1F894)+ ,((Wingdings3, 0xEE), 0x1F896)+ ,((Wingdings3, 0xEF), 0x1F895)+ ,((Wingdings3, 0xF0), 0x1F897)+ ,((Webdings, 0x21), 0x1F577)+ ,((Webdings, 0x22), 0x1F578)+ ,((Webdings, 0x23), 0x1F572)+ ,((Webdings, 0x24), 0x1F576)+ ,((Webdings, 0x25), 0x1F3C6)+ ,((Webdings, 0x26), 0x1F396)+ ,((Webdings, 0x27), 0x1F587)+ ,((Webdings, 0x28), 0x1F5E8)+ ,((Webdings, 0x29), 0x1F5E9)+ ,((Webdings, 0x2A), 0x1F5F0)+ ,((Webdings, 0x2B), 0x1F5F1)+ ,((Webdings, 0x2C), 0x1F336)+ ,((Webdings, 0x2D), 0x1F397)+ ,((Webdings, 0x2E), 0x1F67E)+ ,((Webdings, 0x2F), 0x1F67C)+ ,((Webdings, 0x30), 0x1F5D5)+ ,((Webdings, 0x31), 0x1F5D6)+ ,((Webdings, 0x32), 0x1F5D7)+ ,((Webdings, 0x33), 0x23F4)+ ,((Webdings, 0x34), 0x23F5)+ ,((Webdings, 0x35), 0x23F6)+ ,((Webdings, 0x36), 0x23F7)+ ,((Webdings, 0x37), 0x23EA)+ ,((Webdings, 0x38), 0x23E9)+ ,((Webdings, 0x39), 0x23EE)+ ,((Webdings, 0x3A), 0x23ED)+ ,((Webdings, 0x3B), 0x23F8)+ ,((Webdings, 0x3C), 0x23F9)+ ,((Webdings, 0x3D), 0x23FA)+ ,((Webdings, 0x3E), 0x1F5DA)+ ,((Webdings, 0x3F), 0x1F5F3)+ ,((Webdings, 0x40), 0x1F6E0)+ ,((Webdings, 0x41), 0x1F3D7)+ ,((Webdings, 0x42), 0x1F3D8)+ ,((Webdings, 0x43), 0x1F3D9)+ ,((Webdings, 0x44), 0x1F3DA)+ ,((Webdings, 0x45), 0x1F3DC)+ ,((Webdings, 0x46), 0x1F3ED)+ ,((Webdings, 0x47), 0x1F3DB)+ ,((Webdings, 0x48), 0x1F3E0)+ ,((Webdings, 0x49), 0x1F3D6)+ ,((Webdings, 0x4A), 0x1F3DD)+ ,((Webdings, 0x4B), 0x1F6E3)+ ,((Webdings, 0x4C), 0x1F50D)+ ,((Webdings, 0x4D), 0x1F3D4)+ ,((Webdings, 0x4E), 0x1F441)+ ,((Webdings, 0x4F), 0x1F442)+ ,((Webdings, 0x50), 0x1F3DE)+ ,((Webdings, 0x51), 0x1F3D5)+ ,((Webdings, 0x52), 0x1F6E4)+ ,((Webdings, 0x53), 0x1F3DF)+ ,((Webdings, 0x54), 0x1F6F3)+ ,((Webdings, 0x55), 0x1F56C)+ ,((Webdings, 0x56), 0x1F56B)+ ,((Webdings, 0x57), 0x1F568)+ ,((Webdings, 0x58), 0x1F508)+ ,((Webdings, 0x59), 0x1F394)+ ,((Webdings, 0x5A), 0x1F395)+ ,((Webdings, 0x5B), 0x1F5EC)+ ,((Webdings, 0x5C), 0x1F67D)+ ,((Webdings, 0x5D), 0x1F5ED)+ ,((Webdings, 0x5E), 0x1F5EA)+ ,((Webdings, 0x5F), 0x1F5EB)+ ,((Webdings, 0x60), 0x2B94)+ ,((Webdings, 0x61), 0x2714)+ ,((Webdings, 0x62), 0x1F6B2)+ ,((Webdings, 0x63), 0x25A1)+ ,((Webdings, 0x64), 0x1F6E1)+ ,((Webdings, 0x65), 0x1F4E6)+ ,((Webdings, 0x66), 0x1F6F1)+ ,((Webdings, 0x67), 0x25A0)+ ,((Webdings, 0x68), 0x1F691)+ ,((Webdings, 0x69), 0x1F6C8)+ ,((Webdings, 0x6A), 0x1F6E9)+ ,((Webdings, 0x6B), 0x1F6F0)+ ,((Webdings, 0x6C), 0x1F7C8)+ ,((Webdings, 0x6D), 0x1F574)+ ,((Webdings, 0x6E), 0x26AB)+ ,((Webdings, 0x6F), 0x1F6E5)+ ,((Webdings, 0x70), 0x1F694)+ ,((Webdings, 0x71), 0x1F5D8)+ ,((Webdings, 0x72), 0x1F5D9)+ ,((Webdings, 0x73), 0x2753)+ ,((Webdings, 0x74), 0x1F6F2)+ ,((Webdings, 0x75), 0x1F687)+ ,((Webdings, 0x76), 0x1F68D)+ ,((Webdings, 0x77), 0x26F3)+ ,((Webdings, 0x78), 0x1F6C7)+ ,((Webdings, 0x79), 0x2296)+ ,((Webdings, 0x7A), 0x1F6AD)+ ,((Webdings, 0x7B), 0x1F5EE)+ ,((Webdings, 0x7C), 0x007C)+ ,((Webdings, 0x7D), 0x1F5EF)+ ,((Webdings, 0x7E), 0x1F5F2)+ ,((Webdings, 0x80), 0x1F6B9)+ ,((Webdings, 0x81), 0x1F6BA)+ ,((Webdings, 0x82), 0x1F6C9)+ ,((Webdings, 0x83), 0x1F6CA)+ ,((Webdings, 0x84), 0x1F6BC)+ ,((Webdings, 0x85), 0x1F47D)+ ,((Webdings, 0x86), 0x1F3CB)+ ,((Webdings, 0x87), 0x26F7)+ ,((Webdings, 0x88), 0x1F3C2)+ ,((Webdings, 0x89), 0x1F3CC)+ ,((Webdings, 0x8A), 0x1F3CA)+ ,((Webdings, 0x8B), 0x1F3C4)+ ,((Webdings, 0x8C), 0x1F3CD)+ ,((Webdings, 0x8D), 0x1F3CE)+ ,((Webdings, 0x8E), 0x1F698)+ ,((Webdings, 0x8F), 0x1F5E0)+ ,((Webdings, 0x90), 0x1F6E2)+ ,((Webdings, 0x91), 0x1F4B0)+ ,((Webdings, 0x92), 0x1F3F7)+ ,((Webdings, 0x93), 0x1F4B3)+ ,((Webdings, 0x94), 0x1F46A)+ ,((Webdings, 0x95), 0x1F5E1)+ ,((Webdings, 0x96), 0x1F5E2)+ ,((Webdings, 0x97), 0x1F5E3)+ ,((Webdings, 0x98), 0x272F)+ ,((Webdings, 0x99), 0x1F584)+ ,((Webdings, 0x9A), 0x1F585)+ ,((Webdings, 0x9B), 0x1F583)+ ,((Webdings, 0x9C), 0x1F586)+ ,((Webdings, 0x9D), 0x1F5B9)+ ,((Webdings, 0x9E), 0x1F5BA)+ ,((Webdings, 0x9F), 0x1F5BB)+ ,((Webdings, 0xA1), 0x1F570)+ ,((Webdings, 0xA2), 0x1F5BD)+ ,((Webdings, 0xA3), 0x1F5BE)+ ,((Webdings, 0xA4), 0x1F4CB)+ ,((Webdings, 0xA5), 0x1F5D2)+ ,((Webdings, 0xA6), 0x1F5D3)+ ,((Webdings, 0xA7), 0x1F4D6)+ ,((Webdings, 0xA8), 0x1F4DA)+ ,((Webdings, 0xA9), 0x1F5DE)+ ,((Webdings, 0xAA), 0x1F5DF)+ ,((Webdings, 0xAB), 0x1F5C3)+ ,((Webdings, 0xAC), 0x1F5C2)+ ,((Webdings, 0xAD), 0x1F5BC)+ ,((Webdings, 0xAE), 0x1F3AD)+ ,((Webdings, 0xAF), 0x1F39C)+ ,((Webdings, 0xB0), 0x1F398)+ ,((Webdings, 0xB1), 0x1F399)+ ,((Webdings, 0xB2), 0x1F3A7)+ ,((Webdings, 0xB3), 0x1F4BF)+ ,((Webdings, 0xB4), 0x1F39E)+ ,((Webdings, 0xB5), 0x1F4F7)+ ,((Webdings, 0xB6), 0x1F39F)+ ,((Webdings, 0xB7), 0x1F3AC)+ ,((Webdings, 0xB8), 0x1F4FD)+ ,((Webdings, 0xB9), 0x1F4F9)+ ,((Webdings, 0xBA), 0x1F4FE)+ ,((Webdings, 0xBB), 0x1F4FB)+ ,((Webdings, 0xBC), 0x1F39A)+ ,((Webdings, 0xBD), 0x1F39B)+ ,((Webdings, 0xBE), 0x1F4FA)+ ,((Webdings, 0xBF), 0x1F4BB)+ ,((Webdings, 0xC0), 0x1F5A5)+ ,((Webdings, 0xC1), 0x1F5A6)+ ,((Webdings, 0xC2), 0x1F5A7)+ ,((Webdings, 0xC3), 0x1F579)+ ,((Webdings, 0xC4), 0x1F3AE)+ ,((Webdings, 0xC5), 0x1F57B)+ ,((Webdings, 0xC6), 0x1F57C)+ ,((Webdings, 0xC7), 0x1F4DF)+ ,((Webdings, 0xC8), 0x1F581)+ ,((Webdings, 0xC9), 0x1F580)+ ,((Webdings, 0xCA), 0x1F5A8)+ ,((Webdings, 0xCB), 0x1F5A9)+ ,((Webdings, 0xCC), 0x1F5BF)+ ,((Webdings, 0xCD), 0x1F5AA)+ ,((Webdings, 0xCE), 0x1F5DC)+ ,((Webdings, 0xCF), 0x1F512)+ ,((Webdings, 0xD0), 0x1F513)+ ,((Webdings, 0xD1), 0x1F5DD)+ ,((Webdings, 0xD2), 0x1F4E5)+ ,((Webdings, 0xD3), 0x1F4E4)+ ,((Webdings, 0xD4), 0x1F573)+ ,((Webdings, 0xD5), 0x1F323)+ ,((Webdings, 0xD6), 0x1F324)+ ,((Webdings, 0xD7), 0x1F325)+ ,((Webdings, 0xD8), 0x1F326)+ ,((Webdings, 0xD9), 0x2601)+ ,((Webdings, 0xDA), 0x1F327)+ ,((Webdings, 0xDB), 0x1F328)+ ,((Webdings, 0xDC), 0x1F329)+ ,((Webdings, 0xDD), 0x1F32A)+ ,((Webdings, 0xDE), 0x1F32C)+ ,((Webdings, 0xDF), 0x1F32B)+ ,((Webdings, 0xE0), 0x1F31C)+ ,((Webdings, 0xE1), 0x1F321)+ ,((Webdings, 0xE2), 0x1F6CB)+ ,((Webdings, 0xE3), 0x1F6CF)+ ,((Webdings, 0xE4), 0x1F37D)+ ,((Webdings, 0xE5), 0x1F378)+ ,((Webdings, 0xE6), 0x1F6CE)+ ,((Webdings, 0xE7), 0x1F6CD)+ ,((Webdings, 0xE8), 0x24C5)+ ,((Webdings, 0xE9), 0x267F)+ ,((Webdings, 0xEA), 0x1F6C6)+ ,((Webdings, 0xEB), 0x1F588)+ ,((Webdings, 0xEC), 0x1F393)+ ,((Webdings, 0xED), 0x1F5E4)+ ,((Webdings, 0xEE), 0x1F5E5)+ ,((Webdings, 0xEF), 0x1F5E6)+ ,((Webdings, 0xF0), 0x1F5E7)+ ,((Webdings, 0xF1), 0x1F6EA)+ ,((Webdings, 0xF2), 0x1F43F)+ ,((Webdings, 0xF3), 0x1F426)+ ,((Webdings, 0xF4), 0x1F41F)+ ,((Webdings, 0xF5), 0x1F415)+ ,((Webdings, 0xF6), 0x1F408)+ ,((Webdings, 0xF7), 0x1F66C)+ ,((Webdings, 0xF8), 0x1F66E)+ ,((Webdings, 0xF9), 0x1F66D)+ ,((Webdings, 0xFA), 0x1F66F)+ ,((Webdings, 0xFB), 0x1F5FA)+ ,((Webdings, 0xFC), 0x1F30D)+ ,((Webdings, 0xFD), 0x1F30F)+ ,((Webdings, 0xFE), 0x1F30E)+ ,((Webdings, 0xFF), 0x1F54A)+ ,((Symbol,0x20), 0xA0)+ ,((Symbol,0x21), 0x21)+ ,((Symbol,0x22), 0x2200)+ ,((Symbol,0x23), 0x23)+ ,((Symbol,0x24), 0x2203)+ ,((Symbol,0x25), 0x25)+ ,((Symbol,0x26), 0x26)+ ,((Symbol,0x27), 0x220B)+ ,((Symbol,0x28), 0x28)+ ,((Symbol,0x29), 0x29)+ ,((Symbol,0x2A), 0x2217)+ ,((Symbol,0x2B), 0x2B)+ ,((Symbol,0x2C), 0x2C)+ ,((Symbol,0x2D), 0x2212)+ ,((Symbol,0x2E), 0x2E)+ ,((Symbol,0x2F), 0x2F)+ ,((Symbol,0x30), 0x30)+ ,((Symbol,0x31), 0x31)+ ,((Symbol,0x32), 0x32)+ ,((Symbol,0x33), 0x33)+ ,((Symbol,0x34), 0x34)+ ,((Symbol,0x35), 0x35)+ ,((Symbol,0x36), 0x36)+ ,((Symbol,0x37), 0x37)+ ,((Symbol,0x38), 0x38)+ ,((Symbol,0x39), 0x39)+ ,((Symbol,0x3A), 0x3A)+ ,((Symbol,0x3B), 0x3B)+ ,((Symbol,0x3C), 0x3C)+ ,((Symbol,0x3D), 0x3D)+ ,((Symbol,0x3E), 0x3E)+ ,((Symbol,0x3F), 0x3F)+ ,((Symbol,0x40), 0x2245)+ ,((Symbol,0x41), 0x391)+ ,((Symbol,0x42), 0x392)+ ,((Symbol,0x43), 0x3A7)+ ,((Symbol,0x44), 0x2206)+ ,((Symbol,0x45), 0x395)+ ,((Symbol,0x46), 0x3A6)+ ,((Symbol,0x47), 0x393)+ ,((Symbol,0x48), 0x397)+ ,((Symbol,0x49), 0x399)+ ,((Symbol,0x4A), 0x3D1)+ ,((Symbol,0x4B), 0x39A)+ ,((Symbol,0x4C), 0x39B)+ ,((Symbol,0x4D), 0x39C)+ ,((Symbol,0x4E), 0x39D)+ ,((Symbol,0x4F), 0x39F)+ ,((Symbol,0x50), 0x3A0)+ ,((Symbol,0x51), 0x398)+ ,((Symbol,0x52), 0x3A1)+ ,((Symbol,0x53), 0x3A3)+ ,((Symbol,0x54), 0x3A4)+ ,((Symbol,0x55), 0x3A5)+ ,((Symbol,0x56), 0x3C2)+ ,((Symbol,0x57), 0x2126)+ ,((Symbol,0x58), 0x39E)+ ,((Symbol,0x59), 0x3A8)+ ,((Symbol,0x5A), 0x396)+ ,((Symbol,0x5B), 0x5B)+ ,((Symbol,0x5C), 0x2234)+ ,((Symbol,0x5D), 0x5D)+ ,((Symbol,0x5E), 0x22A5)+ ,((Symbol,0x5F), 0x5F)+ ,((Symbol,0x60), 0xF8E5)+ ,((Symbol,0x61), 0x3B1)+ ,((Symbol,0x62), 0x3B2)+ ,((Symbol,0x63), 0x3C7)+ ,((Symbol,0x64), 0x3B4)+ ,((Symbol,0x65), 0x3B5)+ ,((Symbol,0x66), 0x3C6)+ ,((Symbol,0x67), 0x3B3)+ ,((Symbol,0x68), 0x3B7)+ ,((Symbol,0x69), 0x3B9)+ ,((Symbol,0x6A), 0x3D5)+ ,((Symbol,0x6B), 0x3BA)+ ,((Symbol,0x6C), 0x3BB)+ ,((Symbol,0x6D), 0x3BC)+ ,((Symbol,0x6E), 0x3BD)+ ,((Symbol,0x6F), 0x3BF)+ ,((Symbol,0x70), 0x3C0)+ ,((Symbol,0x71), 0x3B8)+ ,((Symbol,0x72), 0x3C1)+ ,((Symbol,0x73), 0x3C3)+ ,((Symbol,0x74), 0x3C4)+ ,((Symbol,0x75), 0x3C5)+ ,((Symbol,0x76), 0x3D6)+ ,((Symbol,0x77), 0x3C9)+ ,((Symbol,0x78), 0x3BE)+ ,((Symbol,0x79), 0x3C8)+ ,((Symbol,0x7A), 0x3B6)+ ,((Symbol,0x7B), 0x7B)+ ,((Symbol,0x7C), 0x7C)+ ,((Symbol,0x7D), 0x7D)+ ,((Symbol,0x7E), 0x223C)+ ,((Symbol,0xA0), 0x20AC)+ ,((Symbol,0xA1), 0x3D2)+ ,((Symbol,0xA2), 0x2032)+ ,((Symbol,0xA3), 0x2264)+ ,((Symbol,0xA4), 0x2215)+ ,((Symbol,0xA5), 0x221E)+ ,((Symbol,0xA6), 0x192)+ ,((Symbol,0xA7), 0x2663)+ ,((Symbol,0xA8), 0x2666)+ ,((Symbol,0xA9), 0x2665)+ ,((Symbol,0xAA), 0x2660)+ ,((Symbol,0xAB), 0x2194)+ ,((Symbol,0xAC), 0x2190)+ ,((Symbol,0xAD), 0x2191)+ ,((Symbol,0xAE), 0x2192)+ ,((Symbol,0xAF), 0x2193)+ ,((Symbol,0xB0), 0xB0)+ ,((Symbol,0xB1), 0xB1)+ ,((Symbol,0xB2), 0x2033)+ ,((Symbol,0xB3), 0x2265)+ ,((Symbol,0xB4), 0xD7)+ ,((Symbol,0xB5), 0x221D)+ ,((Symbol,0xB6), 0x2202)+ ,((Symbol,0xB7), 0x2022)+ ,((Symbol,0xB8), 0xF7)+ ,((Symbol,0xB9), 0x2260)+ ,((Symbol,0xBA), 0x2261)+ ,((Symbol,0xBB), 0x2248)+ ,((Symbol,0xBC), 0x2026)+ ,((Symbol,0xBD), 0xF8E6)+ ,((Symbol,0xBE), 0xF8E7)+ ,((Symbol,0xBF), 0x21B5)+ ,((Symbol,0xC0), 0x2135)+ ,((Symbol,0xC1), 0x2111)+ ,((Symbol,0xC2), 0x211C)+ ,((Symbol,0xC3), 0x2118)+ ,((Symbol,0xC4), 0x2297)+ ,((Symbol,0xC5), 0x2295)+ ,((Symbol,0xC6), 0x2205)+ ,((Symbol,0xC7), 0x2229)+ ,((Symbol,0xC8), 0x222A)+ ,((Symbol,0xC9), 0x2283)+ ,((Symbol,0xCA), 0x2287)+ ,((Symbol,0xCB), 0x2284)+ ,((Symbol,0xCC), 0x2282)+ ,((Symbol,0xCD), 0x2286)+ ,((Symbol,0xCE), 0x2208)+ ,((Symbol,0xCF), 0x2209)+ ,((Symbol,0xD0), 0x2220)+ ,((Symbol,0xD1), 0x2207)+ ,((Symbol,0xD2), 0xF6DA)+ ,((Symbol,0xD3), 0xF6D9)+ ,((Symbol,0xD4), 0xF6DB)+ ,((Symbol,0xD5), 0x220F)+ ,((Symbol,0xD6), 0x221A)+ ,((Symbol,0xD7), 0x22C5)+ ,((Symbol,0xD8), 0xAC)+ ,((Symbol,0xD9), 0x2227)+ ,((Symbol,0xDA), 0x2228)+ ,((Symbol,0xDB), 0x21D4)+ ,((Symbol,0xDC), 0x21D0)+ ,((Symbol,0xDD), 0x21D1)+ ,((Symbol,0xDE), 0x21D2)+ ,((Symbol,0xDF), 0x21D3)+ ,((Symbol,0xE0), 0x25CA)+ ,((Symbol,0xE1), 0x2329)+ ,((Symbol,0xE2), 0xF8E8)+ ,((Symbol,0xE3), 0xF8E9)+ ,((Symbol,0xE4), 0xF8EA)+ ,((Symbol,0xE5), 0x2211)+ ,((Symbol,0xE6), 0xF8EB)+ ,((Symbol,0xE7), 0xF8EC)+ ,((Symbol,0xE8), 0xF8ED)+ ,((Symbol,0xE9), 0xF8EE)+ ,((Symbol,0xEA), 0xF8EF)+ ,((Symbol,0xEB), 0xF8F0)+ ,((Symbol,0xEC), 0xF8F1)+ ,((Symbol,0xED), 0xF8F2)+ ,((Symbol,0xEE), 0xF8F3)+ ,((Symbol,0xEF), 0xF8F4)+ ,((Symbol,0xF1), 0x232A)+ ,((Symbol,0xF2), 0x222B)+ ,((Symbol,0xF3), 0x2320)+ ,((Symbol,0xF4), 0xF8F5)+ ,((Symbol,0xF5), 0x2321)+ ,((Symbol,0xF6), 0xF8F6)+ ,((Symbol,0xF7), 0xF8F7)+ ,((Symbol,0xF8), 0xF8F8)+ ,((Symbol,0xF9), 0xF8F9)+ ,((Symbol,0xFA), 0xF8FA)+ ,((Symbol,0xFB), 0xF8FB)+ ,((Symbol,0xFC), 0xF8FC)+ ,((Symbol,0xFD), 0xF8FD)+ ,((Symbol,0xFE), 0xF8FE)+ ]
@@ -0,0 +1,45 @@+{-# LANGUAGE OverloadedStrings #-}+{- |+ Module : Text.Pandoc.Readers.Docx.Util+ Copyright : © 2014-2020 Jesse Rosenthal <jrosenthal@jhu.edu>,+ 2014-2024 John MacFarlane <jgm@berkeley.edu>,+ 2015 Nikolay Yakimov <root@livid.pp.ru>+ License : GNU GPL, version 2 or above++ Maintainer : Jesse Rosenthal <jrosenthal@jhu.edu>+ Stability : alpha+ Portability : portable++Docx reader utility functions.+-}+module Text.Pandoc.Readers.Docx.Util (+ NameSpaces+ , elemName+ , isElem+ , elemToNameSpaces+ , findChildByName+ , findChildrenByName+ , findElementByName+ , findAttrByName+ , extractChildren+ ) where++import Data.List (partition)+import Text.Pandoc.XML.Light+import Text.Pandoc.Readers.OOXML.Shared+ (NameSpaces, elemName, isElem, elemToNameSpaces,+ findChildByName, findChildrenByName, findElementByName, findAttrByName)+++-- | Removes child elements that satisfy a given condition.+-- Returns the modified element and the list of removed children.+extractChildren :: Element -> (Element -> Bool) -> Maybe (Element, [Element])+extractChildren el condition+ | null removedChildren = Nothing -- No children removed, return Nothing+ | otherwise = Just (modifiedElement, removedChildren) -- Children removed, return Just+ where+ -- Separate the children based on the condition+ (removedChildren, keptChildren) = partition condition (onlyElems $ elContent el)++ -- Reconstruct the element with the kept children+ modifiedElement = el { elContent = map Elem keptChildren }
@@ -0,0 +1,571 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TupleSections #-}+{-# LANGUAGE ViewPatterns #-}+{- |+ Module : Text.Pandoc.Readers.DokuWiki+ Copyright : Copyright (C) 2018-2020 Alexander Krotov+ License : GNU GPL, version 2 or above++ Maintainer : Alexander Krotov <ilabdsf@gmail.com>+ Stability : alpha+ Portability : portable++Conversion of DokuWiki text to 'Pandoc' document.+-}+module Text.Pandoc.Readers.DokuWiki (readDokuWiki) where++import Control.Monad+import Control.Monad.Except (throwError)+import Data.Char (isAlphaNum, isDigit)+import qualified Data.Foldable as F+import Data.Maybe (fromMaybe, catMaybes)+import Data.Bifunctor (second)+import Data.Text (Text)+import qualified Data.Text as T+import qualified Text.Pandoc.Builder as B+import Text.Pandoc.Class.PandocMonad (PandocMonad (..))+import Text.Pandoc.Definition+import Text.Pandoc.Options+import Text.Pandoc.Parsing hiding (enclosed)+import Text.Pandoc.Shared (trim, stringify, tshow)+import Data.List (isPrefixOf, isSuffixOf, groupBy)+import qualified Safe++-- | Read DokuWiki from an input string and return a Pandoc document.+readDokuWiki :: (PandocMonad m, ToSources a)+ => ReaderOptions+ -> a+ -> m Pandoc+readDokuWiki opts s = do+ let sources = toSources s+ res <- runParserT parseDokuWiki def {stateOptions = opts }+ (initialSourceName sources) sources+ case res of+ Left e -> throwError $ fromParsecError sources e+ Right d -> return d++type DWParser = ParsecT Sources ParserState++-- * Utility functions++-- | Parse end-of-line, which can be either a newline or end-of-file.+eol :: (Stream s m Char, UpdateSourcePos s Char) => ParsecT s st m ()+eol = void newline <|> eof++guardColumnOne :: PandocMonad m => DWParser m ()+guardColumnOne = getPosition >>= \pos -> guard (sourceColumn pos == 1)++-- | Parse DokuWiki document.+parseDokuWiki :: PandocMonad m => DWParser m Pandoc+parseDokuWiki =+ B.doc . mconcat <$> many block <* spaces <* eof++-- | Parse <code> and <file> attributes+codeLanguage :: PandocMonad m => DWParser m (Text, [Text], [(Text, Text)])+codeLanguage = try $ do+ rawLang <- option "-" (spaceChar *> manyTillChar anyChar (lookAhead (spaceChar <|> char '>')))+ let attr = case rawLang of+ "-" -> []+ l -> [l]+ return ("", attr, [])++-- | Generic parser for <code> and <file> tags+codeTag :: PandocMonad m+ => ((Text, [Text], [(Text, Text)]) -> Text -> a)+ -> Text+ -> DWParser m a+codeTag f tag = try $ f+ <$ char '<'+ <* textStr tag+ <*> codeLanguage+ <* manyTill anyChar (char '>')+ <* optional (manyTill spaceChar eol)+ <*> manyTillChar anyChar (try $ string "</" <* textStr tag <* char '>')++-- * Inline parsers++-- | Parse any inline element but softbreak.+inline' :: PandocMonad m => DWParser m B.Inlines+inline' = whitespace+ <|> inline''++-- | Parse any inline element but whitespace.+inline'' :: PandocMonad m => DWParser m B.Inlines+inline'' = br+ <|> bold+ <|> italic+ <|> underlined+ <|> nowiki+ <|> percent+ <|> link+ <|> image+ <|> monospaced+ <|> subscript+ <|> superscript+ <|> deleted+ <|> footnote+ <|> inlineRaw+ <|> math+ <|> autoLink+ <|> autoEmail+ <|> notoc+ <|> nocache+ <|> smartPunctuation inline+ <|> str+ <|> symbol+ <?> "inline"++-- | Parse any inline element but soft breaks and do not consolidate spaces.+inlineUnconsolidatedWhitespace :: PandocMonad m => DWParser m B.Inlines+inlineUnconsolidatedWhitespace = (B.space <$ spaceChar) <|> inline'++-- | Parse any inline element, including soft break.+inline :: PandocMonad m => DWParser m B.Inlines+inline = endline <|> inline'++endline :: PandocMonad m => DWParser m B.Inlines+endline = try $ B.softbreak <$ skipMany spaceChar <* linebreak++whitespace :: PandocMonad m => DWParser m B.Inlines+whitespace = try $ B.space <$ skipMany1 spaceChar++br :: PandocMonad m => DWParser m B.Inlines+br = try $ B.linebreak <$ string "\\\\" <* space++linebreak :: PandocMonad m => DWParser m B.Inlines+linebreak = newline >> notFollowedBy newline >> (lastNewline <|> innerNewline)+ where lastNewline = mempty <$ eof+ innerNewline = pure B.space++between :: (Monoid c, PandocMonad m, Show b)+ => DWParser m a -> DWParser m b -> (DWParser m b -> DWParser m c)+ -> DWParser m c+between start end p =+ mconcat <$> try (start >> notFollowedBy whitespace >> many1Till (p end) end)++enclosed :: (Monoid b, PandocMonad m, Show a)+ => DWParser m a -> (DWParser m a -> DWParser m b) -> DWParser m b+enclosed sep p = between sep (try sep) p++nestedInlines :: (Show a, PandocMonad m)+ => DWParser m a -> DWParser m B.Inlines+nestedInlines end = innerSpace <|> nestedInline+ where+ innerSpace = try $ whitespace <* notFollowedBy end+ nestedInline = notFollowedBy whitespace >> inline++bold :: PandocMonad m => DWParser m B.Inlines+bold = try $ B.strong <$> enclosed (string "**") nestedInlines++italic :: PandocMonad m => DWParser m B.Inlines+italic = try $ B.emph <$> enclosed (string "//") nestedInlines++underlined :: PandocMonad m => DWParser m B.Inlines+underlined = try $ B.underline <$> enclosed (string "__") nestedInlines++nowiki :: PandocMonad m => DWParser m B.Inlines+nowiki = try $ B.text <$ string "<nowiki>" <*> manyTillChar anyChar (try $ string "</nowiki>")++percent :: PandocMonad m => DWParser m B.Inlines+percent = try $ B.text <$> enclosed (string "%%") nestedText++nestedText :: (Show a, PandocMonad m)+ => DWParser m a -> DWParser m Text+nestedText end = innerSpace <|> countChar 1 nonspaceChar+ where+ innerSpace = try $ many1Char spaceChar <* notFollowedBy end++monospaced :: PandocMonad m => DWParser m B.Inlines+monospaced = try $ B.code . (T.concat . map stringify . B.toList) <$> enclosed (string "''") nestedInlines++subscript :: PandocMonad m => DWParser m B.Inlines+subscript = try $ B.subscript <$> between (string "<sub>") (try $ string "</sub>") nestedInlines++superscript :: PandocMonad m => DWParser m B.Inlines+superscript = try $ B.superscript <$> between (string "<sup>") (try $ string "</sup>") nestedInlines++deleted :: PandocMonad m => DWParser m B.Inlines+deleted = try $ B.strikeout <$> between (string "<del>") (try $ string "</del>") nestedInlines++-- | Parse a footnote.+footnote :: PandocMonad m => DWParser m B.Inlines+footnote = try $ B.note . B.para <$> between (string "((") (try $ string "))") nestedInlines++inlineRaw :: PandocMonad m => DWParser m B.Inlines+inlineRaw = try $ do+ char '<'+ fmt <- oneOfStrings ["html", "php", "latex"]+ -- LaTeX via https://www.dokuwiki.org/plugin:latex+ char '>'+ contents <- manyTillChar anyChar+ (try $ string "</" *> string (T.unpack fmt) *> char '>')+ return $+ case T.toLower fmt of+ "php" -> B.rawInline "html" $ "<?php " <> contents <> " ?>"+ f -> B.rawInline f contents++-- see https://www.dokuwiki.org/plugin:latex+math :: PandocMonad m => DWParser m B.Inlines+math = (B.displayMath <$> mathDisplay) <|> (B.math <$> mathInline)++makeLink :: (Text, Text) -> B.Inlines+makeLink (text, url) = B.link url "" $ B.str text++autoEmail :: PandocMonad m => DWParser m B.Inlines+autoEmail = try $ do+ state <- getState+ guard $ stateAllowLinks state+ makeLink <$ char '<' <*> emailAddress <* char '>'++autoLink :: PandocMonad m => DWParser m B.Inlines+autoLink = try $ do+ state <- getState+ guard $ stateAllowLinks state+ (text, url) <- uri+ guard $ not $ T.isInfixOf "%%//%%" text -- see #9153+ guard $ checkLink (T.last url)+ return $ makeLink (text, url)+ where+ checkLink c+ | c == '/' = True+ | otherwise = isAlphaNum c++notoc :: PandocMonad m => DWParser m B.Inlines+notoc = try $ mempty <$ string "~~NOTOC~~"++nocache :: PandocMonad m => DWParser m B.Inlines+nocache = try $ mempty <$ string "~~NOCACHE~~"++str :: PandocMonad m => DWParser m B.Inlines+str = B.str <$> (many1Char alphaNum <|> characterReference)++symbol :: PandocMonad m => DWParser m B.Inlines+symbol = B.str <$> (notFollowedBy' blockCode *> countChar 1 nonspaceChar)++link :: PandocMonad m => DWParser m B.Inlines+link = try $ do+ st <- getState+ guard $ stateAllowLinks st+ setState $ st{ stateAllowLinks = False }+ l <- linkText+ setState $ st{ stateAllowLinks = True }+ return l++isExternalLink :: Text -> Bool+isExternalLink s = "://" `T.isPrefixOf` sSuff+ where+ sSuff = T.dropWhile (\c -> isAlphaNum c || (c `elem` ['-', '.', '+'])) s++isAbsolutePath :: Text -> Bool+isAbsolutePath (T.uncons -> Just ('.', _)) = False+isAbsolutePath s = T.any (== ':') s++normalizeDots :: Text -> Text+normalizeDots path+ | not (T.null pref) = case T.uncons suff of+ Just (':', _) -> path+ _ -> pref <> ":" <> suff+ | otherwise = path+ where+ (pref, suff) = T.span (== '.') path++normalizeInternalPath :: Text -> Text+normalizeInternalPath path =+ if isAbsolutePath path+ then ensureAbsolute normalizedPath+ else normalizedPath+ where+ normalizedPath = T.intercalate "/" $ dropWhile (== ".") $ T.splitOn ":" $ normalizeDots path+ ensureAbsolute s@(T.uncons -> Just ('/', _)) = s+ ensureAbsolute s = "/" <> s++normalizePath :: Text -> Text+normalizePath path =+ if isExternalLink path+ then path+ else normalizeInternalPath path++urlToText :: Text -> Text+urlToText url =+ if isExternalLink url+ then url+ else T.takeWhileEnd (/= ':') url++-- Parse link or image+parseLink :: PandocMonad m+ => (Text -> Maybe B.Inlines -> B.Inlines)+ -> Text+ -> Text+ -> DWParser m B.Inlines+parseLink f l r = f+ <$ textStr l+ <*> many1TillChar anyChar (lookAhead (void (char '|') <|> try (void $ textStr r)))+ <*> ( (char '|' *> optionMaybe (B.trimInlines . B.text . T.pack <$>+ many1Till anyChar (lookAhead (try (textStr r)))))+ <|> pure Nothing+ )+ <* textStr r++-- | Split Interwiki link into left and right part+-- | Return Nothing if it is not Interwiki link+splitInterwiki :: Text -> Maybe (Text, Text)+splitInterwiki path =+ case T.span (\c -> isAlphaNum c || c == '.') path of+ (l, T.uncons -> Just ('>', r)) -> Just (l, r)+ _ -> Nothing++interwikiToUrl :: Text -> Text -> Text+interwikiToUrl "callto" page = "callto://" <> page+interwikiToUrl "doku" page = "https://www.dokuwiki.org/" <> page+interwikiToUrl "phpfn" page = "https://secure.php.net/" <> page+interwikiToUrl "tel" page = "tel:" <> page+interwikiToUrl "wp" page = "https://en.wikipedia.org/wiki/" <> page+interwikiToUrl "wpde" page = "https://de.wikipedia.org/wiki/" <> page+interwikiToUrl "wpes" page = "https://es.wikipedia.org/wiki/" <> page+interwikiToUrl "wpfr" page = "https://fr.wikipedia.org/wiki/" <> page+interwikiToUrl "wpjp" page = "https://jp.wikipedia.org/wiki/" <> page+interwikiToUrl "wppl" page = "https://pl.wikipedia.org/wiki/" <> page+interwikiToUrl unknown page = unknown <> ">" <> page++linkText :: PandocMonad m => DWParser m B.Inlines+linkText = parseLink fromRaw "[[" "]]"+ where+ fromRaw path description =+ B.link normalizedPath "" (fromMaybe (B.str defaultDescription) description)+ where+ path' = trim path+ interwiki = splitInterwiki path'+ normalizedPath =+ case interwiki of+ Nothing -> normalizePath path'+ Just (l, r) -> interwikiToUrl l r+ defaultDescription =+ case interwiki of+ Nothing -> urlToText path'+ Just (_, r) -> r++-- Matches strings like "100x100" (width x height) and "50" (width)+isWidthHeightParameter :: Text -> Bool+isWidthHeightParameter s =+ case T.uncons s of+ Just (x, xs) ->+ isDigit x && case T.uncons $ T.dropWhile isDigit xs of+ Just ('x', ys) | not (T.null ys) -> T.all isDigit ys+ Nothing -> True+ _ -> False+ _ -> False++parseWidthHeight :: Text -> (Maybe Text, Maybe Text)+parseWidthHeight s = (width, height)+ where+ width = Just $ T.takeWhile isDigit s+ height =+ case T.uncons $ T.dropWhile isDigit s of+ Just ('x', xs) -> Just xs+ _ -> Nothing++image :: PandocMonad m => DWParser m B.Inlines+image = try $ parseLink fromRaw "{{" "}}"+ where+ fromRaw path description =+ if linkOnly+ then B.link normalizedPath "" (fromMaybe defaultDescription description)+ else B.imageWith ("", classes, attributes) normalizedPath "" (fromMaybe defaultDescription description)+ where+ (path', parameters) = T.span (/= '?') $ trim path+ normalizedPath = normalizePath path'+ leftPadding = " " `T.isPrefixOf` path+ rightPadding = " " `T.isSuffixOf` path+ classes =+ case (leftPadding, rightPadding) of+ (False, False) -> []+ (False, True) -> ["align-left"]+ (True, False) -> ["align-right"]+ (True, True) -> ["align-center"]+ parameterList = T.splitOn "&" $ T.drop 1 parameters+ linkOnly = "linkonly" `elem` parameterList+ (width, height) = maybe (Nothing, Nothing) parseWidthHeight (F.find isWidthHeightParameter parameterList)+ attributes = catMaybes [+ fmap ("width",) width,+ fmap ("height",) height,+ fmap ("query",) (if T.null parameters then Nothing else Just parameters)+ ]+ defaultDescription = B.str $ urlToText path'++-- * Block parsers++block :: PandocMonad m => DWParser m B.Blocks+block = do+ res <- mempty <$ skipMany1 blankline+ <|> blockElements+ <|> para+ skipMany blankline+ trace (T.take 60 $ tshow $ B.toList res)+ return res++blockElements :: PandocMonad m => DWParser m B.Blocks+blockElements = horizontalLine+ <|> header+ <|> list " "+ <|> indentedCode+ <|> quote+ <|> blockCode+ <|> blockRaw+ <|> table++horizontalLine :: PandocMonad m => DWParser m B.Blocks+horizontalLine = try $ B.horizontalRule <$ string "---" <* many1 (char '-') <* eol++header :: PandocMonad m => DWParser m B.Blocks+header = try $ do+ guardColumnOne+ eqs <- many1 (char '=')+ let lev = length eqs+ guard $ lev < 7+ contents <- B.trimInlines . mconcat <$> manyTill inline (try $ char '=' *> many1 (char '='))+ attr <- registerHeader nullAttr contents+ return $ B.headerWith attr (7 - lev) contents++list :: PandocMonad m => Text -> DWParser m B.Blocks+list prefix = bulletList prefix <|> orderedList prefix++bulletList :: PandocMonad m => Text -> DWParser m B.Blocks+bulletList prefix = try $ B.bulletList <$> parseList prefix '*'++orderedList :: PandocMonad m => Text -> DWParser m B.Blocks+orderedList prefix = try $ B.orderedList <$> parseList prefix '-'++parseList :: PandocMonad m+ => Text+ -> Char+ -> DWParser m [B.Blocks]+parseList prefix marker =+ many1 ((<>) <$> item <*> fmap mconcat (many continuation))+ where+ continuation = try $ list (" " <> prefix)+ item = try $ textStr prefix *>+ optional (char ' ') *> -- see #8863+ char marker *> char ' ' *>+ (mconcat <$> many1 itemContents <* eol)+ itemContents = (B.plain . mconcat <$> many1 inline') <|>+ blockCode++indentedCode :: PandocMonad m => DWParser m B.Blocks+indentedCode = try $ B.codeBlock . T.unlines <$> many1 indentedLine+ where+ indentedLine = try $ string " " *> manyTillChar anyChar eol++-- Note that block quotes in dokuwiki parse as lists of hard-break+-- separated lines; see #6461.+quote :: PandocMonad m => DWParser m B.Blocks+quote = go <$> many1 blockQuoteLine+ where+ blockQuoteLine = try $ do+ lev <- length <$> many1 (char '>')+ skipMany spaceChar+ contents <- (blockCode <* skipMany spaceChar <* optional eol) <|>+ (B.plain . B.trimInlines . mconcat <$> many1Till inline' eol)+ pure (lev, contents)+ go [] = mempty+ go xs = mconcat $ map go' (groupBy (\(x,_) (y,_) -> (x == 0 && y == 0) ||+ (x > 0 && y > 0)) xs)+ go' [] = mempty+ go' xs@((0,_):_) =+ let (lns, bls) = F.foldl' consolidatePlains (mempty,mempty) (map snd xs)+ in bls <> if lns == mempty+ then mempty+ else B.plain lns+ go' xs = B.blockQuote (go $ map (\(x,y) -> (x - 1, y)) xs)+ consolidatePlains (lns, bls) b =+ case B.toList b of+ [Plain ils] -> ((if lns == mempty+ then B.fromList ils+ else lns <> B.linebreak <> B.fromList ils), bls)+ _ -> (mempty, bls <>+ (if lns == lns+ then mempty+ else B.plain lns)+ <> b)++blockRaw :: PandocMonad m => DWParser m B.Blocks+blockRaw = try $ do+ char '<'+ fmt <- oneOfStrings ["HTML", "PHP", "LATEX"]+ -- LaTeX via https://www.dokuwiki.org/plugin:latex+ char '>'+ optional (manyTill spaceChar eol)+ contents <- manyTillChar anyChar+ (try $ string "</" *> string (T.unpack fmt) *> char '>')+ return $+ case T.toLower fmt of+ "php" -> B.rawBlock "html" $ "<?php " <> contents <> " ?>"+ f -> B.rawBlock f contents++table :: PandocMonad m => DWParser m B.Blocks+table = do+ firstSeparator <- lookAhead tableCellSeparator+ rows <- tableRows+ let firstRow = fromMaybe [] . Safe.headMay $ rows+ let (headerRow, body) = if firstSeparator == '^'+ then (firstRow, drop 1 rows)+ else ([], rows)+ -- Since Pandoc only has column level alignment, we have to make an arbitrary+ -- choice of how to reconcile potentially different alignments in the row.+ -- Here we end up assuming that the alignment of the header / first row is+ -- what the user wants to apply to the whole thing.+ let attrs = map (\(a, _) -> (a, ColWidthDefault)) firstRow+ let toRow = Row nullAttr . map B.simpleCell+ toHeaderRow l = [toRow l | not (null l)]+ pure $ B.table B.emptyCaption+ attrs+ (TableHead nullAttr $ toHeaderRow (map snd headerRow))+ [TableBody nullAttr 0 [] $ map (toRow . (map snd)) body]+ (TableFoot nullAttr [])+++tableRows :: PandocMonad m => DWParser m [[(Alignment, B.Blocks)]]+tableRows = many1 tableRow++tableRow :: PandocMonad m => DWParser m [(Alignment, B.Blocks)]+tableRow = many1Till tableCell tableRowEnd++tableRowEnd :: PandocMonad m => DWParser m Char+tableRowEnd = try $ tableCellSeparator <* manyTill spaceChar eol++tableCellSeparator :: PandocMonad m => DWParser m Char+tableCellSeparator = char '|' <|> char '^'++tableCell :: PandocMonad m => DWParser m (Alignment, B.Blocks)+tableCell = try $ (second (B.plain . B.trimInlines . mconcat)) <$> cellContent+ where+ cellContent = do+ -- https://www.dokuwiki.org/wiki:syntax#tables+ -- DokuWiki represents the alignment of cells with two spaces padding.+ tableCellSeparator+ cellInline <- manyTill inlineUnconsolidatedWhitespace (lookAhead tableCellSeparator)+ let left = [B.space, B.space] `isPrefixOf` cellInline+ let right = [B.space, B.space] `isSuffixOf` cellInline+ let alignment = case (left, right) of+ (True, True) -> AlignCenter+ (True, False) -> AlignRight+ (False, True) -> AlignLeft+ (False, False) -> AlignDefault+ return (alignment, cellInline)+++blockCode :: PandocMonad m => DWParser m B.Blocks+blockCode = codeTag B.codeBlockWith "code" <|>+ codeTag B.codeBlockWith "file"++para :: PandocMonad m => DWParser m B.Blocks+para = result . mconcat <$> many1Till inline endOfParaElement+ where+ endOfParaElement = lookAhead $ endOfInput <|> endOfPara <|> newBlockElement+ endOfInput = try $ skipMany blankline >> skipSpaces >> eof+ endOfPara = try $ blankline >> skipMany1 blankline+ newBlockElement = try (blankline >> void blockElements)+ <|> lookAhead (void blockCode)+ result content = if F.all (==Space) content+ then mempty+ else B.para $ B.trimInlines content
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff