summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/App.hs2
-rw-r--r--src/Text/Pandoc/App/CommandLineOptions.hs9
-rw-r--r--src/Text/Pandoc/App/Opt.hs6
3 files changed, 14 insertions, 3 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index 1a694abb0..2bddcf1a3 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -351,7 +351,7 @@ convertWithOpts opts = do
| T.null t || T.last t /= '\n' = t <> T.singleton '\n'
| otherwise = t
textOutput <- ensureNl <$> f writerOptions doc
- if optSelfContained opts && htmlFormat format
+ if (optSelfContained opts || optEmbedResources opts) && htmlFormat format
then TextOutput <$> makeSelfContained textOutput
else return $ TextOutput textOutput
reports <- getLog
diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs
index 2db1fe53c..ce6ff4a35 100644
--- a/src/Text/Pandoc/App/CommandLineOptions.hs
+++ b/src/Text/Pandoc/App/CommandLineOptions.hs
@@ -439,7 +439,14 @@ options =
, Option "" ["self-contained"]
(NoArg
- (\opt -> return opt { optSelfContained = True }))
+ (\opt -> do
+ deprecatedOption "--self-contained" "use --embed-resources --standalone"
+ return opt { optSelfContained = True }))
+ "" -- "Make slide shows include all the needed js and css (deprecated)"
+
+ , Option "" ["embed-resources"]
+ (NoArg
+ (\opt -> return opt { optEmbedResources = True }))
"" -- "Make slide shows include all the needed js and css"
, Option "" ["request-header"]
diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs
index ae1248833..5d15560d8 100644
--- a/src/Text/Pandoc/App/Opt.hs
+++ b/src/Text/Pandoc/App/Opt.hs
@@ -96,7 +96,8 @@ data Opt = Opt
, optNumberOffset :: [Int] -- ^ Starting number for sections
, optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
, optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5
- , optSelfContained :: Bool -- ^ Make HTML accessible offline
+ , optSelfContained :: Bool -- ^ Make HTML accessible offline (deprecated)
+ , optEmbedResources :: Bool -- ^ Make HTML accessible offline
, optHtmlQTags :: Bool -- ^ Use <q> tags in HTML
, optHighlightStyle :: Maybe Text -- ^ Style to use for highlighted code
, optSyntaxDefinitions :: [FilePath] -- ^ xml syntax defs to load
@@ -415,6 +416,8 @@ doOpt (k,v) = do
parseJSON v >>= \x -> return (\o -> o{ optIncremental = x })
"self-contained" ->
parseJSON v >>= \x -> return (\o -> o{ optSelfContained = x })
+ "embed-resources" ->
+ parseJSON v >>= \x -> return (\o -> o{ optEmbedResources = x })
"html-q-tags" ->
parseJSON v >>= \x -> return (\o -> o{ optHtmlQTags = x })
"highlight-style" ->
@@ -622,6 +625,7 @@ defaultOpts = Opt
, optSectionDivs = False
, optIncremental = False
, optSelfContained = False
+ , optEmbedResources = False
, optHtmlQTags = False
, optHighlightStyle = Just "pygments"
, optSyntaxDefinitions = []