msprev / panzer

pandoc + styles
BSD 3-Clause "New" or "Revised" License
159 stars 15 forks source link

ensure `commandline` works with repeated options #3

Closed msprev closed 9 years ago

msprev commented 9 years ago
  • For pandoc key-values, the value should be a quoted inline code span, e.g. include-in-header: "path/to/my/header".

Not having tested I wonder if you have noted that some options beside -F and -M are repeatable and therefore should take a list (of 'codes') as value?

E.g. the default latex template says:

 $for(header-includes)$ 
 $header-includes$ 
 $endfor$ 

and it works with plain pandoc:

 $ echo '\foo' >foo.ltx 
 $ echo '\bar' >bar.ltx 
 $ pandoc -w latex -H foo.ltx -H bar.ltx 
 ^D 
 ... 
 \foo 
 \bar 

 \begin{document} 
 ... 

I use particularly -H like that so I reacted at the wording of the readme.

/bpj

jgrizou commented 9 years ago

Hi,

I just tested panzer and it is very convenient.

I also use include-in-header but also include-before-body and the like. Yet, on my machine, repeated key-val works for include-in-header but not for include-before-body.. it seems very strange, is there a reason for that?

yaml:

style: Template
styledef:
  Template:
    all:
      commandline:
        standalone: true
        include-in-header:
          - "`header_addon.html`"
          - "`header_addon2.html`"
        include-before-body:
          - "`navbar.html`"
          - "`body.html`"

log:

         ----- pandoc read -----
         running
         ----- style definitions -----
         no global definitions loaded
         local:
           Template        
         ----- document style -----
         style:
           Template
         full hierarchy:
           Template
         writer:
           html
ERROR:   Cannot read entry "include-before-body" with type "MetaList" in "commandline"---ignoring
         ----- run list -----
           empty
         ----- pandoc write -----
         pandoc writing with options:
           --include-in-header=header_addon.html --include-in-header=header_addon2.html --standalone
         output written to "test_template_panzer.html"
msprev commented 9 years ago

Now fixed. Let me know if it doesn't work. Thanks for catching this!

jgrizou commented 9 years ago

Works perfectely!