Skip to content

Commit

Permalink
Merge pull request #2638 from c-forster/teiwriter
Browse files Browse the repository at this point in the history
Add TEI Writer.
  • Loading branch information
jgm committed Jan 21, 2016
2 parents 7ea4d17 + 4d74a96 commit 3b39b16
Show file tree
Hide file tree
Showing 7 changed files with 380 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README
Expand Up @@ -22,7 +22,7 @@ markup], [Haddock markup], [OPML], [Emacs Org mode], [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],
[AsciiDoc], [InDesign ICML], [TEI XML], and [Slidy], [Slideous], [DZSlides],
[reveal.js] or [S5] HTML slide shows. It can also produce [PDF] output
on systems where LaTeX, ConTeXt, or `wkhtmltopdf` is installed.

Expand Down Expand Up @@ -89,6 +89,7 @@ Markdown can be expected to be lossy.
[reveal.js]: http://lab.hakim.se/reveal-js/
[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
[InDesign ICML]: https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf
[TEI Simple]: https://github.com/TEIC/TEI-Simple

Using `pandoc`
--------------
Expand Down Expand Up @@ -277,11 +278,11 @@ General options
`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
ICML), `tei` (TEI Simple), `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], 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
Expand Down Expand Up @@ -471,7 +472,7 @@ 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
standalone HTML, LaTeX, TEI, or RTF file, not a fragment). This option
is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`
output.

Expand Down
2 changes: 2 additions & 0 deletions pandoc.cabal
Expand Up @@ -362,6 +362,7 @@ Library
Text.Pandoc.Writers.Docx,
Text.Pandoc.Writers.EPUB,
Text.Pandoc.Writers.FB2,
Text.Pandoc.Writers.TEI,
Text.Pandoc.PDF,
Text.Pandoc.UTF8,
Text.Pandoc.Templates,
Expand Down Expand Up @@ -504,6 +505,7 @@ Test-Suite test-pandoc
Tests.Writers.LaTeX
Tests.Writers.Docx
Tests.Writers.RST
Tests.Writers.TEI
Ghc-Options: -rtsopts -Wall -fno-warn-unused-do-bind -threaded
Default-Language: Haskell98

Expand Down
2 changes: 2 additions & 0 deletions pandoc.hs
Expand Up @@ -1009,6 +1009,8 @@ defaultWriterName x =
".fb2" -> "fb2"
".opml" -> "opml"
".icml" -> "icml"
".tei.xml" -> "tei"
".tei" -> "tei"
['.',y] | y `elem` ['1'..'9'] -> "man"
_ -> "html"

Expand Down
3 changes: 3 additions & 0 deletions src/Text/Pandoc.hs
Expand Up @@ -115,6 +115,7 @@ module Text.Pandoc
, writeHaddock
, writeCommonMark
, writeCustom
, writeTEI
-- * Rendering templates and default templates
, module Text.Pandoc.Templates
-- * Miscellaneous
Expand Down Expand Up @@ -169,6 +170,7 @@ import Text.Pandoc.Writers.AsciiDoc
import Text.Pandoc.Writers.Haddock
import Text.Pandoc.Writers.CommonMark
import Text.Pandoc.Writers.Custom
import Text.Pandoc.Writers.TEI
import Text.Pandoc.Templates
import Text.Pandoc.Options
import Text.Pandoc.Shared (safeRead, warn, mapLeft, pandocVersion)
Expand Down Expand Up @@ -304,6 +306,7 @@ writers = [
,("asciidoc" , PureStringWriter writeAsciiDoc)
,("haddock" , PureStringWriter writeHaddock)
,("commonmark" , PureStringWriter writeCommonMark)
,("tei" , PureStringWriter writeTEI)
]

getDefaultExtensions :: String -> Set Extension
Expand Down

0 comments on commit 3b39b16

Please sign in to comment.