quarto-dev / quarto-dev/quarto-cli
A more comprehensive documentation of metadata options
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
What would you like to do?
Give feedback or suggest an improvement
Description
I love quarto and have completely switched my workflow to it, but one thing that consistently frustrates me is the documentation of YAML metadata options. I find it very cumbersome to quickly find information about where options should go, what arguments they accept, what options are relevant for what I want to do, what the current defaults are, etc. This is getting less bad as I work more and more with quarto and memorize them, but I found that when I try to introduce colleagues to it, this is a major initial roadblock. This is not comprehensive but here are some of the major friction points I find
Issues
Efficient navigation to reference/help
It is currently really cumbersome to quickly find information about an option. Let's say I remember I can control many aspects of the output via the execute: key:
execute:
echo: false
warning: false
But the only way to figure out what options I can use is to open a browser, navigate to the quarto website, and search the reference section. These are way too many steps and context switching.
In VSCODE there is the Quarto Contextual Assist panel, which is a good option, but it's incomplete:
- it does not show information for many options. For example, if I hover on "echo", it gives me the information for that suboption, but if I hover on "execute", it remains blank and doesn't tell me what options I have to control the execution. There is no help for major keys such as "project", "format", "website" - basically for none of the high-level organization keys. For others there is only a minimal description: "siderbar" for example.
- since many options are explained not in the reference section, but rahter in the "Guide" on the website, the information on how to use them is also not available directly. It would be really helpful if there were links that open relevant pages on the website. For the example above, linking to Sidebar and Side Navigation would be a huge time saver. This already happens for isolated examples like "cookie-consent"...
- it does not work for chunk options. Even though autocomplete works for e.g. "#| column: body", the quarto assist panel thinks this is an R function and shows links to
base::bodyandgclus::body...
I saw these are defined as yaml schemas. There is a lot of duplicated information from the reference jsons. That is why the reference info on the website and yaml contextual assistance are sometimes inconsistent. Wouldn't it be safer/easier to feed off the information for both from a single source? This could also help with the issues described below, since the yaml schemas contain information about the expected type and allowed values - it should be easy to write. a script to include that information in the documentation
Document (a) value type or (b) allowed values of options
The documentation should state the expected value type (logical, numeric, date, etc) and list all available options if it's not an open field such as a title. Here is an example from the toc option:
It is not clear that this should be a logical value (true or false). As I user plausible expected inputs might be "auto", "left", "yes", etc... In this case it's not so difficult to figure it out, but there are many other options where it took me a lot of trial and error to figure out how they work.
In contrast, here is pandoc's documentation of the --toc option from which the above is copied:
--toc[=true|false]
Include an automatically generated table of contents...
--toc-depth=NUMBER
Specify the number of section levels...
Every option has a clearly identified value type and options. They use special syntax to identify if the value information reflects a format, a choice of specific values, or a choice of formats. For some options this is already done well
Document default values of options
This is inconsistent in the documentation - some options have documented defaults while (https://quarto.org/docs/output-formats/html-basics.html#anchor-sections) don't
Ensure that errors are correct
Given this yml:
---
title: "Test YAML Options"
format: abc
code-copy: truee
---
the following strange error occurs during rendering:
ERROR: Validation of YAML front matter failed.
ERROR: In file index.qmd
(line 3, columns 9--12) Field "format" has value abc, which must instead be 'asciidoc'
2: title: "Test YAML Options"
3: format: abc
~~~~
4: code-copy: truee
ERROR: In file index.qmd
(line 4, columns 12--17) Field "code-copy" has value truee, which must instead be 'hover'
3: format: abc
4: code-copy: truee
~~~~~~
ERROR: Render failed due to invalid YAML.
It is telling me that the values for format and code-copy are invalid, but it incorrectly tells me they should be 'asciidoc' and 'hover', which are just some of the allowed options. For other arguments it correctly says "it should be one of ..."
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the YAML schemas in quarto-cli/src/resources/schema with the reference JSONs in quarto-web/docs/reference/projects. Review how the VS Code Quarto Contextual Assist consumes this metadata and identify the documented gaps described in the issue. Done means the relevant metadata options, types, allowed values, defaults, links, and validation messages are consistently documented or clearly scoped for follow-up.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, vscode
- Domain
- documentation, tooling
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100