-
Notifications
You must be signed in to change notification settings - Fork 334
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
Document output format for .Rmarkdown
files
#530
Comments
I think this is related to another topic we discuss:
By full markdown mode, the workflow where someone wants to use only the I think in other terms, this would be how to include hugodown behavior inside blogdown ? I am thinking more and more about that. That is not the place to develop maybe, but I think this is related because having a By the way, this is also thoughts I have because the IDE uses pandoc extensions to output Goldmark format and hugodown does to (but differently it seems) - so I would think it is possible for blogdown to have a Anyway, if this is interesting, we could discuss it more. Regarding your question now, from what I understand (it was a great opportunity to know more about blogdown internals, so sharing my understanding)
Is this correct ? |
This is indeed a "mode" that would benefit many users, as we mention in the book:
Additional benefits:
It feels like
The |
I would also like full Markdown support. A hack I've just tried
path <- rstudioapi::getSourceEditorContext()$path
rmarkdown::render(
path,
output_format = hugodown::md_document()
)
file.remove(sub(".Rmd", ".html", path)) It would work with other Markdown formats, of course, but I tried the hack to get downlit highlighting. |
I find it odd that you need to remove the html file - using Also, for this type of use case, it would be interested to pass Lines 62 to 67 in 28bb4a8
this would be a way to get the path of the file without having to rely on rstudioapi (which would currently not work if you try to use build_site() at command line and the Rmd needs to be knitted).
|
I thought the HTML file came from hugodown but I'm not so sure. I actually use the knit button. (which might explain the HTML creation?) |
@apreshill If you are developing a theme, it's a little tricky to make the RStudio IDE recognize the type of the project and render posts under
This should solve your original problem. The rest of replies brought up another issue, which I just tried to address:
@apreshill That makes sense. I left the option I guess that will also solve @maelle's problem (no need to hack with |
I can't get ".Rmd will be rendered to .md" to work.
The Rmd still gets knit to html 🤔 https://github.com/maelle/apresacademic/tree/main/content/blog/2021-01-05-hi-blogdown Sorry if I'm getting something wrong. I'm very excited about this update! |
It seems there is something off in RStudio IDE when using the knit button. Using This happens only with .Rmd to .md - .Rmarkdown are correctly rendered to .markdown. Still looking into this 🤔 |
Sounds like a bug. Sorry I didn't test it yesterday since it was too late at night. I'm investigating now. |
Just to be clear, I stumbled upon this bug before you added the feature here, while testing what @maelle was trying (#530 (comment)). As it was happening also with the new method, it confirmed something was off. I investigated this morning but was missing some information as I am not sure what the Knit button is really doing in RStudio IDE. Happy to discuss it further ! |
Should be fixed now. Thanks for the report! remotes::install_github('rstudio/blogdown') |
It works now. 🎉 Thank you! It feels very natural to me to use the knit button. 🧶 😁 |
(I also need to know the answer to this question!)
We have
blogdown::html_page
documented in the code, but it isn't clear how to knit an.Rmarkdown
file to the appropriate.markdown
file output format. I find myself trying to use the knit button to knit an.Rmarkdown
post inside my own theme's exampleSite, and unable to knit to.markdown
file I think because the project is not detected as a blogdown website by the IDE. The knit button knits straight to.html
, and I cannot figure out how to ask for the.markdown
output format.The text was updated successfully, but these errors were encountered: