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

header option to ignore an .Rmd file / or ability to recognize alternate output format? #97

Closed
cboettig opened this Issue Apr 30, 2017 · 10 comments

Comments

Projects
None yet
3 participants
@cboettig

cboettig commented Apr 30, 2017

Would it be possible to support an option in the yaml metadata of an .Rmd post which would tell blogdown not to build the file automatically?

Rationale: Sometimes I want .Rmd files in my site repo that have alternative output formats, e.g. a content/slides directory that has .Rmd files which already use an output: command to specify some slide format (e.g. slides for a lecture). I can knit these separately, but currently blogdown will compile these .Rmds as if they were regular posts, ignoring the requested output format and overwriting a previously-generated html. It would be simplest and most convenient if blogdown just ignored these .Rmds, and then their original outputs can still be part of the website in unaltered form.

Alternately, it would be nice if blogdown could recognize requested output: formats in yaml and render accordingly via rmarkdown, instead of following the usual knit command.

@yihui

This comment has been minimized.

Show comment
Hide comment
@yihui

yihui May 1, 2017

Member

That makes perfect sense. I'll definitely think more about the possibility of ignoring certain Rmd files or respecting existing output formats. The latter is a little tricky, though, when you have R plots and HTML widgets generated from code chunks.

Member

yihui commented May 1, 2017

That makes perfect sense. I'll definitely think more about the possibility of ignoring certain Rmd files or respecting existing output formats. The latter is a little tricky, though, when you have R plots and HTML widgets generated from code chunks.

@RobertMyles

This comment has been minimized.

Show comment
Hide comment
@RobertMyles

RobertMyles Jun 11, 2017

This would be a nice option. Sometimes I have posts in development that are not knitting (maybe some error in the code, for example), it would be nice to ignore these when I run serve_site() .

RobertMyles commented Jun 11, 2017

This would be a nice option. Sometimes I have posts in development that are not knitting (maybe some error in the code, for example), it would be nice to ignore these when I run serve_site() .

@yihui

This comment has been minimized.

Show comment
Hide comment
@yihui

yihui Jun 12, 2017

Member

@RobertMyles In your case, I think you can use the file extension .Rmarkdown instead of .Rmd before the post is ready to be compiled.

Member

yihui commented Jun 12, 2017

@RobertMyles In your case, I think you can use the file extension .Rmarkdown instead of .Rmd before the post is ready to be compiled.

@RobertMyles

This comment has been minimized.

Show comment
Hide comment
@RobertMyles

RobertMyles Jun 12, 2017

@yihui Ah, I didn't know that I could do that! Thanks!

RobertMyles commented Jun 12, 2017

@yihui Ah, I didn't know that I could do that! Thanks!

@yihui

This comment has been minimized.

Show comment
Hide comment
@yihui

yihui Jul 27, 2017

Member

@RobertMyles I'm sorry but I want to make a change here and it will break my suggestion above. I'm hoping to reserve the extension .Rmarkdown for #165, and I wonder if you could move to other extensions like .Rmkd for the R Markdown documents that you do not want blogdown to compile.

Member

yihui commented Jul 27, 2017

@RobertMyles I'm sorry but I want to make a change here and it will break my suggestion above. I'm hoping to reserve the extension .Rmarkdown for #165, and I wonder if you could move to other extensions like .Rmkd for the R Markdown documents that you do not want blogdown to compile.

@RobertMyles

This comment has been minimized.

Show comment
Hide comment
@RobertMyles

RobertMyles Jul 28, 2017

@yihui sure, no problem for me. I'm moving to the recommended blogdown-netlify workflow, so I'm not sure this would be an issue with that way of doing things anyway.

RobertMyles commented Jul 28, 2017

@yihui sure, no problem for me. I'm moving to the recommended blogdown-netlify workflow, so I'm not sure this would be an issue with that way of doing things anyway.

@yihui

This comment has been minimized.

Show comment
Hide comment
@yihui

yihui Jul 28, 2017

Member

@RobertMyles You should be fine. This won't affect you in the blogdown-Netlify workflow. The only impact is that .Rmarkdown files will be compiled to Markdown instead of HTML. Previously they were ignored by blogdown. Thanks for giving me the freedom!

Member

yihui commented Jul 28, 2017

@RobertMyles You should be fine. This won't affect you in the blogdown-Netlify workflow. The only impact is that .Rmarkdown files will be compiled to Markdown instead of HTML. Previously they were ignored by blogdown. Thanks for giving me the freedom!

@yihui yihui added this to the v0.1 milestone Jul 28, 2017

@yihui yihui closed this in 6c9121f Jul 28, 2017

@yihui

This comment has been minimized.

Show comment
Hide comment
@yihui

yihui Jul 28, 2017

Member

@cboettig Please read this section: https://bookdown.org/yihui/blogdown/static-files.html I think it should solve your problems. Note you need the latest version of blogdown here.

Member

yihui commented Jul 28, 2017

@cboettig Please read this section: https://bookdown.org/yihui/blogdown/static-files.html I think it should solve your problems. Note you need the latest version of blogdown here.

@cboettig

This comment has been minimized.

Show comment
Hide comment
@cboettig

cboettig Jul 28, 2017

What an elegant solution, thanks!

cboettig commented Jul 28, 2017

What an elegant solution, thanks!

@yihui

This comment has been minimized.

Show comment
Hide comment
@yihui

yihui Jul 28, 2017

Member

I finally came up with this idea last night and was quite happy with it. At the first glance at your issue a couple of months ago, I thought it would be a terrible mess and require quite a bit of changes in blogdown, but eventually it boiled down to one line of code :) So thanks for asking! This has boosted the usefulness of blogdown by 200%! 🎉 🎉 🎉

Member

yihui commented Jul 28, 2017

I finally came up with this idea last night and was quite happy with it. At the first glance at your issue a couple of months ago, I thought it would be a terrible mess and require quite a bit of changes in blogdown, but eventually it boiled down to one line of code :) So thanks for asking! This has boosted the usefulness of blogdown by 200%! 🎉 🎉 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment