git.iko.soy/typeable/pandoc
on master help sign in
Added some entity tests in Markdown reader tests.
4d74a96John MacFarlane
README+8−7
@@ -22,7 +22,7 @@ markup], [Haddock markup], [OPML], [Emacs Org mode], [DocBook],
22[OpenDocument], [ODT], [Word docx], [GNU Texinfo], [MediaWiki markup],
22[OpenDocument], [ODT], [Word docx], [GNU Texinfo], [MediaWiki markup],
23[DokuWiki markup], [Haddock markup], [EPUB] (v2 or v3),
23[DokuWiki markup], [Haddock markup], [EPUB] (v2 or v3),
24[FictionBook2], [Textile], [groff man] pages, [Emacs Org mode],
24[FictionBook2], [Textile], [groff man] pages, [Emacs Org mode],
25−[AsciiDoc], [InDesign ICML], and [Slidy], [Slideous], [DZSlides],
25+[AsciiDoc], [InDesign ICML], [TEI XML], and [Slidy], [Slideous], [DZSlides],
26[reveal.js] or [S5] HTML slide shows. It can also produce [PDF] output
26[reveal.js] or [S5] HTML slide shows. It can also produce [PDF] output
27on systems where LaTeX, ConTeXt, or `wkhtmltopdf` is installed.
27on systems where LaTeX, ConTeXt, or `wkhtmltopdf` is installed.
28
28
@@ -89,6 +89,7 @@ Markdown can be expected to be lossy.
89[reveal.js]: http://lab.hakim.se/reveal-js/
89[reveal.js]: http://lab.hakim.se/reveal-js/
90[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
90[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
91[InDesign ICML]: https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf
91[InDesign ICML]: https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf
92+[TEI Simple]: https://github.com/TEIC/TEI-Simple
92
93
93Using `pandoc`
94Using `pandoc`
94--------------
95--------------
@@ -277,11 +278,11 @@ General options
277 `docx` (Word docx), `haddock` (Haddock markup), `rtf` (rich text
278 `docx` (Word docx), `haddock` (Haddock markup), `rtf` (rich text
278 format), `epub` (EPUB v2 book), `epub3` (EPUB v3), `fb2`
279 format), `epub` (EPUB v2 book), `epub3` (EPUB v3), `fb2`
279 (FictionBook2 e-book), `asciidoc` (AsciiDoc), `icml` (InDesign
280 (FictionBook2 e-book), `asciidoc` (AsciiDoc), `icml` (InDesign
280− ICML), `slidy` (Slidy HTML and javascript slide show), `slideous`
281+ ICML), `tei` (TEI Simple), `slidy` (Slidy HTML and javascript slide
281− (Slideous HTML and javascript slide show), `dzslides` (DZSlides
282+ show), `slideous` (Slideous HTML and javascript slide show),
282− HTML5 + javascript slide show), `revealjs` (reveal.js HTML5 +
283+ `dzslides` (DZSlides HTML5 + javascript slide show), `revealjs`
283− javascript slide show), `s5` (S5 HTML and javascript slide show),
284+ (reveal.js HTML5 + javascript slide show), `s5` (S5 HTML and javascript
284− or the path of a custom lua writer (see [Custom
285+ slide show), or the path of a custom lua writer (see [Custom
285 writers], below). Note that `odt`, `epub`, and
286 writers], below). Note that `odt`, `epub`, and
286 `epub3` output will not be directed to *stdout*; an output
287 `epub3` output will not be directed to *stdout*; an output
287 filename must be specified using the `-o/--output` option. If
288 filename must be specified using the `-o/--output` option. If
@@ -471,7 +472,7 @@ General writer options
471`-s`, `--standalone`
472`-s`, `--standalone`
472
473
473: Produce output with an appropriate header and footer (e.g. a
474: Produce output with an appropriate header and footer (e.g. a
474− standalone HTML, LaTeX, or RTF file, not a fragment). This option
475+ standalone HTML, LaTeX, TEI, or RTF file, not a fragment). This option
475 is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`
476 is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`
476 output.
477 output.
477
478
src/Text/Pandoc/Writers/TEI.hs+6−6
@@ -92,8 +92,8 @@ elementToTEI opts lvl (Sec _ _num (id',_,_) title elements) =
92 else elements
92 else elements
93 divType = case lvl of
93 divType = case lvl of
94 n | n == 0 -> "chapter"
94 n | n == 0 -> "chapter"
95− | n >= 1 && n <= 5 -> "sect" ++ show n
95+ | n >= 1 && n <= 5 -> "level" ++ show n
96− | otherwise -> "simplesect"
96+ | otherwise -> "section"
97 in inTags True "div" [("type", divType) | not (null id')] $
97 in inTags True "div" [("type", divType) | not (null id')] $
98-- ("id", writerIdentifierPrefix opts ++ id') | not (null id')] $
98-- ("id", writerIdentifierPrefix opts ++ id') | not (null id')] $
99 inTagsSimple "head" (inlinesToTEI opts title) $$
99 inTagsSimple "head" (inlinesToTEI opts title) $$
@@ -181,7 +181,7 @@ blockToTEI _ (CodeBlock (_,classes,_) str) =
181 else languagesByExtension . map toLower $ s
181 else languagesByExtension . map toLower $ s
182 langs = concatMap langsFrom classes
182 langs = concatMap langsFrom classes
183blockToTEI opts (BulletList lst) =
183blockToTEI opts (BulletList lst) =
184− let attribs = [("type", "bullet") | isTightList lst]
184+ let attribs = [("type", "unordered")]
185 in inTags True "list" attribs $ listItemsToTEI opts lst
185 in inTags True "list" attribs $ listItemsToTEI opts lst
186blockToTEI _ (OrderedList _ []) = empty
186blockToTEI _ (OrderedList _ []) = empty
187blockToTEI opts (OrderedList (start, numstyle, _) (first:rest)) =
187blockToTEI opts (OrderedList (start, numstyle, _) (first:rest)) =
@@ -277,9 +277,9 @@ inlineToTEI _ (Math t str) =
277 DisplayMath -> inTags True "figure" [("type","math")] $
277 DisplayMath -> inTags True "figure" [("type","math")] $
278 inTags False "formula" [("notation","TeX")] $ text (str)
278 inTags False "formula" [("notation","TeX")] $ text (str)
279
279
280−inlineToTEI _ (RawInline f x) | f == "html" || f == "tei" = text x
280+inlineToTEI _ (RawInline f x) | f == "tei" = text x
281− | otherwise = empty
281+ | otherwise = empty
282−inlineToTEI _ LineBreak = text ""
282+inlineToTEI _ LineBreak = selfClosingTag "lb" []
283inlineToTEI _ Space = space
283inlineToTEI _ Space = space
284-- because we use \n for LineBreak, we can't do soft breaks:
284-- because we use \n for LineBreak, we can't do soft breaks:
285inlineToTEI _ SoftBreak = space
285inlineToTEI _ SoftBreak = space
tests/Tests/Writers/TEI.hs+11−9
@@ -27,15 +27,17 @@ infix 4 =:
27tests :: [Test]
27tests :: [Test]
28tests = [ testGroup "block elements"
28tests = [ testGroup "block elements"
29 ["para" =: para "Lorem ipsum cetera."
29 ["para" =: para "Lorem ipsum cetera."
30− =?> "<p>Lorem ipsum cetera.</p>"
30+ =?> "<p>Lorem ipsum cetera.</p>"
31 ]
31 ]
32−-- ]
33−-- , testGroup "lists"
34−-- [
35−-- ]
36 , testGroup "inlines"
32 , testGroup "inlines"
37 [
33 [
38− "Emphasis" =: emph ("emphasized")
34+ "Emphasis" =: emph ("emphasized")
39− =?> "<hi rendition=\"simple:italic\">emphasized</hi>"
35+ =?> "<p><hi rendition=\"simple:italic\">emphasized</hi></p>"
36+ ,"SingleQuoted" =: singleQuoted (text "quoted material")
37+ =?> "<p><quote>quoted material</quote></p>"
38+ ,"DoubleQuoted" =: doubleQuoted (text "quoted material")
39+ =?> "<p><quote>quoted material</quote></p>"
40+ ,"NestedQuoted" =: doubleQuoted (singleQuoted (text "quoted material"))
41+ =?> "<p><quote><quote>quoted material</quote></quote></p>"
40− ]
42+ ]
41− ]
43+ ]