diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2014-07-13 23:38:22 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2014-07-27 00:12:56 +0100 |
commit | ab3589ff0bc2c66c711e7a92021edd79bf52046a (patch) | |
tree | 32cfa00cd1a2b82acf31e94543a930a2cd0be9c2 | |
parent | 7d04d383a61299015e8017e42c38e1887808465a (diff) | |
download | pandoc-ab3589ff0bc2c66c711e7a92021edd79bf52046a.tar.gz |
Txt2Tags Reader: Integrated into pandoc
-rw-r--r-- | pandoc.hs | 3 | ||||
-rw-r--r-- | src/Text/Pandoc.hs | 4 |
2 files changed, 6 insertions, 1 deletions
@@ -876,6 +876,7 @@ defaultReaderName fallback (x:xs) = ".native" -> "native" ".json" -> "json" ".docx" -> "docx" + ".t2t" -> "t2t" _ -> defaultReaderName fallback xs -- Returns True if extension of first source is .lhs @@ -1181,7 +1182,7 @@ main = do let readFiles [] = error "Cannot read archive from stdin" readFiles (x:_) = B.readFile x - let convertTabs = tabFilter (if preserveTabs then 0 else tabStop) + let convertTabs = tabFilter (if (preserveTabs || readerName' == "t2t") then 0 else tabStop) let handleIncludes' = if readerName' == "latex" || readerName' == "latex+lhs" then handleIncludes diff --git a/src/Text/Pandoc.hs b/src/Text/Pandoc.hs index b303fa7d7..15880c39a 100644 --- a/src/Text/Pandoc.hs +++ b/src/Text/Pandoc.hs @@ -76,6 +76,8 @@ module Text.Pandoc , readHaddock , readNative , readJSON + , readTxt2Tags + , readTxt2TagsNoMacros -- * Writers: converting /from/ Pandoc format , Writer (..) , writeNative @@ -130,6 +132,7 @@ 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.Writers.Native import Text.Pandoc.Writers.Markdown import Text.Pandoc.Writers.RST @@ -227,6 +230,7 @@ readers = [ ("native" , StringReader $ \_ s -> return $ readNative s) ,("latex" , mkStringReader readLaTeX) ,("haddock" , mkStringReader readHaddock) ,("docx" , mkBSReader readDocx) + ,("t2t" , mkStringReader readTxt2Tags) ] data Writer = PureStringWriter (WriterOptions -> Pandoc -> String) |