quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.77k stars 309 forks source link

Identify and process revealjs metadata from command line option #10812

Open cderv opened 4 days ago

cderv commented 4 days ago

Let's say you have this YAML header

format:
  revealjs:
    show-notes: true

It seems you can't do

quarto render index.qmd -M show-notes:true

and you need to do

quarto render index.qmd -M showNotes:true

This is because in former case the metadata will be

( "show-notes" , MetaBool True )

while Pandoc is expecting showNotes variable for the template.

This is happening in this specific case because metadata is passed while not associated to revealjs format. When it is, we do provess the metadata in typescript

https://github.com/quarto-dev/quarto-cli/blob/5b0edd24765852bf4f32652cd8aeab1fcff25e0b/src/format/reveal/format-reveal.ts#L73-L74

https://github.com/quarto-dev/quarto-cli/blob/5b0edd24765852bf4f32652cd8aeab1fcff25e0b/src/format/reveal/metadata.ts#L23-L50

We should improve this.

cderv commented 4 days ago

While opening this issue, it reminds me of other problem with --metadata flag. I think this behavior is happening because we only catch some of the metadata to be processed within Quarto processing, others are passed directly to Pandoc. https://github.com/quarto-dev/quarto-cli/blob/5b0edd24765852bf4f32652cd8aeab1fcff25e0b/src/command/render/flags.ts#L308-L325