diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-02-28 20:28:16 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-02-28 21:50:09 -0800 |
commit | 77faccb505992c944cd1b92f50e4e00d2927682b (patch) | |
tree | e9c80f4f48974860378fa3ea9fd33b767625a200 /src/Text/Pandoc/App | |
parent | 7aeabd8430bce7253d34a9a4baf26bbf71e9869e (diff) | |
download | pandoc-77faccb505992c944cd1b92f50e4e00d2927682b.tar.gz |
Shared: add filterIpynbOutput. [API change]
Add command line option `--ipynb-output=all|none|best`.
Closes #5339.
Diffstat (limited to 'src/Text/Pandoc/App')
-rw-r--r-- | src/Text/Pandoc/App/CommandLineOptions.hs | 12 | ||||
-rw-r--r-- | src/Text/Pandoc/App/Opt.hs | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs index 6ae167ebf..be93357cb 100644 --- a/src/Text/Pandoc/App/CommandLineOptions.hs +++ b/src/Text/Pandoc/App/CommandLineOptions.hs @@ -643,7 +643,17 @@ options = "NUMBER") "" -- "Header level at which to split chapters in EPUB" - , Option "" ["pdf-engine"] + , Option "" ["ipynb-output"] + (ReqArg + (\arg opt -> + if arg `notElem` ["all","none","best"] + then E.throwIO $ PandocOptionError $ + "ipynb-output must be all, none, or best" + else return opt { optIpynbOutput = arg }) + "all|none|best") + "" -- "Starting number for sections, subsections, etc." + + , Option "" ["pdf-engine"] (ReqArg (\arg opt -> do let b = takeBaseName arg diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs index 698fdc96b..59405cbeb 100644 --- a/src/Text/Pandoc/App/Opt.hs +++ b/src/Text/Pandoc/App/Opt.hs @@ -123,6 +123,7 @@ data Opt = Opt , optFileScope :: Bool -- ^ Parse input files before combining , optTitlePrefix :: Maybe String -- ^ Prefix for title , optCss :: [FilePath] -- ^ CSS files to link to + , optIpynbOutput :: String -- ^ Maybe f to use best data; Nothing to omit , optIncludeBeforeBody :: [FilePath] -- ^ Files to include before , optIncludeAfterBody :: [FilePath] -- ^ Files to include after body , optIncludeInHeader :: [FilePath] -- ^ Files to include in header @@ -196,6 +197,7 @@ defaultOpts = Opt , optFileScope = False , optTitlePrefix = Nothing , optCss = [] + , optIpynbOutput = "best" , optIncludeBeforeBody = [] , optIncludeAfterBody = [] , optIncludeInHeader = [] |