Created
September 19, 2014 00:51
-
-
Save pamolloy/b147f0c05321c6bf0ffc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
, Option "V" ["variable"] | |
(ReqArg | |
(\arg opt -> do | |
let (key,val) = case break (`elem` ":=") arg of | |
(k,_:v) -> (k,v) | |
(k,_) -> (k,"true") | |
return opt{ optVariables = (key,val) : optVariables opt }) | |
"KEY[:VALUE]") | |
"" |
-V KEY[=VAL], --variable=KEY[:VAL]
Set the template variable KEY to the value VAL when rendering the document in standalone mode.
This is generally only useful when the --template option is used to specify a custom template, since
pandoc automatically sets the variables used in the default templates. If no VAL is specified, the key will
be given the value true.
Their templates look like this:
$for(author)$
<h2 class="author">$author$</h2>
$endfor$
Custom delimiters can be defined as follows:
$for(tags)$tags$$sep$, $endfor$
There's currently no way to set complex values like this from the
command line. You'd have to embed them in the source file as YAML, or
in a separate file that you include on the command line.
See https://groups.google.com/d/topic/pandoc-discuss/r-t0hXKSMTM/discussion
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to pass this a key with multiple variables. How can I do that? I can see that if no value is provided it defaults to true, but what does the line above that do?