diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-05-05 23:01:50 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-07-19 22:51:59 -0700 |
commit | 0aed9dd589189a9bbe5cae99e0e024e2d4a92c36 (patch) | |
tree | 5b281841a2088020a8086dd9fe7041436d683c6d /src/Text | |
parent | 3a22fbd11bba805140b1963a583a11b4fa1169a2 (diff) | |
download | pandoc-0aed9dd589189a9bbe5cae99e0e024e2d4a92c36.tar.gz |
Add commonmark_x output format...
commonmark with a number of useful extensions (more than gfm).
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Extensions.hs | 34 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers.hs | 1 | ||||
-rw-r--r-- | src/Text/Pandoc/Templates.hs | 1 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers.hs | 1 |
4 files changed, 34 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs index 2b7cfca7e..3db2db4e5 100644 --- a/src/Text/Pandoc/Extensions.hs +++ b/src/Text/Pandoc/Extensions.hs @@ -338,6 +338,29 @@ getDefaultExtensions "plain" = plainExtensions getDefaultExtensions "gfm" = githubMarkdownExtensions getDefaultExtensions "commonmark" = extensionsFromList [Ext_raw_html] +getDefaultExtensions "commonmark_x" = extensionsFromList + [ Ext_pipe_tables + , Ext_raw_html + , Ext_auto_identifiers + , Ext_strikeout + , Ext_task_lists + , Ext_emoji + , Ext_pipe_tables + , Ext_raw_html + , Ext_raw_tex -- only supported in writer (for math) + , 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 + ] getDefaultExtensions "org" = extensionsFromList [Ext_citations, Ext_auto_identifiers] @@ -433,10 +456,16 @@ getAllExtensions f = universalExtensions <> getAll f [ Ext_amuse ] getAll "asciidoc" = autoIdExtensions getAll "plain" = allMarkdownExtensions - getAll "gfm" = githubMarkdownExtensions <> + getAll "gfm" = getAll "commonmark" + getAll "commonmark" = autoIdExtensions <> extensionsFromList - [ Ext_raw_html + [ Ext_pipe_tables + , Ext_autolink_bare_uris + , Ext_strikeout + , Ext_task_lists + , Ext_emoji + , Ext_raw_html , Ext_raw_tex -- only supported in writer (for math) , Ext_implicit_figures , Ext_hard_line_breaks @@ -453,7 +482,6 @@ getAllExtensions f = universalExtensions <> getAll f , Ext_implicit_header_references , Ext_attributes ] - getAll "commonmark" = getAll "gfm" getAll "org" = autoIdExtensions <> extensionsFromList [ Ext_citations diff --git a/src/Text/Pandoc/Readers.hs b/src/Text/Pandoc/Readers.hs index 5d33d494c..1337c742c 100644 --- a/src/Text/Pandoc/Readers.hs +++ b/src/Text/Pandoc/Readers.hs @@ -111,6 +111,7 @@ readers = [ ("native" , TextReader readNative) ,("markdown_github" , TextReader readMarkdown) ,("markdown_mmd", TextReader readMarkdown) ,("commonmark" , TextReader readCommonMark) + ,("commonmark_x" , TextReader readCommonMark) ,("creole" , TextReader readCreole) ,("dokuwiki" , TextReader readDokuWiki) ,("gfm" , TextReader readCommonMark) diff --git a/src/Text/Pandoc/Templates.hs b/src/Text/Pandoc/Templates.hs index b95df23e7..1f253b465 100644 --- a/src/Text/Pandoc/Templates.hs +++ b/src/Text/Pandoc/Templates.hs @@ -97,6 +97,7 @@ getDefaultTemplate writer = do "markdown_mmd" -> getDefaultTemplate "markdown" "markdown_phpextra" -> getDefaultTemplate "markdown" "gfm" -> getDefaultTemplate "commonmark" + "commonmark_x" -> getDefaultTemplate "commonmark" _ -> do let fname = "templates" </> "default" <.> T.unpack format UTF8.toText <$> readDataFile fname diff --git a/src/Text/Pandoc/Writers.hs b/src/Text/Pandoc/Writers.hs index f4e667a87..df8355c32 100644 --- a/src/Text/Pandoc/Writers.hs +++ b/src/Text/Pandoc/Writers.hs @@ -178,6 +178,7 @@ writers = [ ,("asciidoctor" , TextWriter writeAsciiDoctor) ,("haddock" , TextWriter writeHaddock) ,("commonmark" , TextWriter writeCommonMark) + ,("commonmark_x" , TextWriter writeCommonMark) ,("gfm" , TextWriter writeCommonMark) ,("tei" , TextWriter writeTEI) ,("muse" , TextWriter writeMuse) |