-
-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable specifying arbitrary yaml files as alternatives of _output.yml #1634
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just nitpicking: could you change yaml
to YAML
in text (including comments)? Thanks!
Co-Authored-By: Yihui Xie <xie@yihui.name>
Thanks a lot. Commited your suggestions and also fixed a grammar mistake. |
Oh I need to update docs as well. |
About the comments, I see lower case "yaml" in those not only edited by me. Line 380 in 9611ee4
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to bring too much trivial work to you. Let's leave other instances of yaml
behind. If you do want to change them, please feel free to do so in another PR. I don't really care. As I said, I was only nitpicking.
Thank you!
This PR enables
render()
and YAML front matter to specify arbitrary yaml files as alternatives of_output.yml
or_output.yaml
, and closes #1613 .render()
supports it by theoutput_yaml
argument and YAML front matter supports it by theoutput_yaml
top level parameter.There, multiple yaml files can be specified and the first existing one is used.
If
output_yaml
is specified both for render and YAML front matter, thenrender
has the priority.If none are found, then
_output.yml
or_output.yaml
will be used if they exists.Example
Prepare bar.yaml
Prepare test-yaml.Rmd
Render Rmd
If simply rendered by
render("test-yaml.Rmd")
then,
bar.yml
is used becausefoo.yml
is missing.Even if
output_yaml
is commented out from the YAML frontmatter,bar.yml
can still be used viarender()
.