feat(Builder): Ignore unknown quartodoc options#371
feat(Builder): Ignore unknown quartodoc options#371gadenbuie wants to merge 2 commits intomachow:mainfrom
Conversation
Rather than throwing an error to allow for backwards-compatible future expansion of quartodoc options.
|
If we add an option to quartodoc, and use it in It seems like in the |
|
Yeah I guess I don't have a strong reason why you'd need quartodoc not to throw with an unknown option. Personally, with loosely structured data (like YAML) in artifacts that live longer than package updates, I personally prefer avoiding halting everything unless it's absolutely required. So in this case, I'd rather quartodoc let me know that there's an unused keyword but not halt rendering. That said, I'm realizing now that the halting happens with I do think the error message could be more useful, though. Here's what I get if I add an extra item in to the I updated this PR to throw instead of warn, here's an example: import yaml
from quartodoc import Builder
cfg = yaml.safe_load(
"""
quartodoc:
package: quartodoc
this_is_not_a_real_option: true
options:
members: [a_func, a_attr]
sections:
- contents: [quartodoc.tests.example]
"""
)
Builder.from_quarto_config(cfg) |
Rather than throwing an error to allow for backwards-compatible future expansion of quartodoc options.
In #370 I noticed that adding a new quartodoc option would make the
_quarto.ymlfile automatically incompatible with older versions of quartodoc. I think it's reasonable to ignore extra options with a warning.