quarto-dev / quarto-dev/quarto-cli

metadata override through CLI flags is inconsitent

Open
#6,123 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

This has been discussed in

Currently there is --metadata and --metadata-file available at Pandoc command line. This is addition of the shared metadata mechanism in Quarto project.

Those 2 flags does not behave the same and this is not clear - this is explain in https://github.com/quarto-dev/quarto-cli/issues/6013

  • --metadata values will be processed through isQuartoMetadata() function, and add to metadata to be used by Quarto process. Otherwise they will be considered Pandoc only metadata.

  • --metadata-file is only considered as Pandoc only metadata. No quarto metadata (like citation or date-format) can be passed to be processed by Quarto EDIT: this is the other way, it will be added with other metadata it seems

if this is the behavior we want, we should document this more clearly.

Anyhow, there is inconsistency in isQuartoMetadata() which are the source of the two links issues (#6013 and #6119). Some of the metadata are not considered as isQuartoMetadata whereas they should. This is the case of quarto render test.qmd -M citation:true or quarto render test.qmd -M date-format:"rev. DD.MM.YYYY HH:mm:ss"

This should probably be fixed to really considered all Quarto Metadata in the --metadata flag, as this is the only way to really override the YAML frontmatter value at command line execution (discussion of #6119)

Again detail explanation of the differences in https://github.com/quarto-dev/quarto-cli/issues/6013#issuecomment-1607318287

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the isQuartoMetadata() behavior described in this issue and the linked issues #6013 and discussion #6119. Compare --metadata and --metadata-file handling, including citation and date-format, then verify that the chosen behavior is consistent and clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.