Comments (13)
There are 2 issues here:
-
rmarkdown::render
doesn't respect theoutput: github_document
when within a site directory. -
rmarkdown::render_site
processes README.Rmd and clobbers any .md that may have been previously generated.
I have fixed #2 via rstudio/rmarkdown@3c33142
For #1, the fix would be a bit more risky/intrusive because we'd have to change the code which determines the default output format for render (already a somewhat complex codepath). For now (once you have rmarkdown from master installed) you should be able to do this to generate a README.md:
rmarkdown::render("README.Rmd", output_format = "github_document")
from distill.
I'm stumbling into this README
issue as well- has anyone found a way to use Distill and still have a GitHub-rendered README
?
I have a README.Rmd
for a workshop that I knit to github_document
so that it shows up in the GitHub repo. Unfortunately, once I added a Distill site, it cannot respect either my README.Rmd
or README.md
in the project root. I also tried adding to exclude
as @jdblischak and @MilesMcBain did, and luckily stumbled upon this issue from there. I am now noticing that no Distill sites have a README
:
- https://github.com/rstudio/tensorflow-blog
- https://github.com/r-music/site
- https://github.com/m-clark/m-clark.github.io
from distill.
Okay, thanks!
The issue w/ the title is because Radix is attempting to render your README.md as a Radix article. If you just remove that file then you won't see that error.
In terms of pandoc, what is the output of:
rmarkdown:::.pandoc$dir
rmarkdown:::.pandoc$version
from distill.
I had this same problem with the README.md even though I had it listed in exclude
in the _site.yml. It appears this is not being respected, is this a bug?
I am using the latest GitHub version at the time of writing.
from distill.
There was an error in the CRAN version of Radix related to version checking. Try installing the development version of Radix with:
devtools::install_github("rstudio/radix")
In terms of the other error, if you could point me to a reproducible example of the problem I'll investigate!
from distill.
@jjallaire I did reinstalled using the github version! )-: Still get the pandoc error even with the newest pandoc (I'm using macOS)
The blog I'm trying to render and have the title error is this one: https://github.com/rladies/blog-rladies-latam
from distill.
@jjallaire thank you so much!
I’m away from the computer now but as soon as I can check the output I post it here! My main problem was with that specific repository anyway :) Thanks again!
from distill.
np, let me know what you find out re: pandoc
from distill.
@jjallaire Apparently everything is working now. My pandoc version is:
> rmarkdown::pandoc_version()
[1] ‘2.3.1’
Just one more question: can I change the content language in Radix? I would like to use Portuguese or Spanish
from distill.
I've made a change that prevents the error from occurring in this case (we just provide a default title of "Untitled").
In terms of exclude
support for README.md, the exclude directive is used to determine which files are copied over to the _site
(as opposed to which files are rendered). All Rmd and md files will automatically be rendered.
from distill.
@jjallaire Is it possible to change the content language in Radix? to Portuguese or Spanish for example
from distill.
You can set the language on the <html>
element using the lang
pandoc metadata option: http://pandoc.org/MANUAL.html#language-variables.
That said, there is non-localized text emitted by Radix so you would have some English text where you'd want e.g. Spanish text (e.g. the names of the appendixes).
from distill.
I had this same problem with the README.md even though I had it listed in exclude in the _site.yml. It appears this is not being respected, is this a bug?
@MilesMcBain It appears that .md files are treated the same as .Rmd files, so this isn't a bug necessarily. From the R Markdown book:
Note that include and exclude are not used to determine which Rmd files are rendered: all of them in the root directory save for those named with the _ prefix will be rendered.
However, I still couldn't get it to behave as I expected.
In terms of exclude support for README.md, the exclude directive is used to determine which files are copied over to the _site (as opposed to which files are rendered). All Rmd and md files will automatically be rendered.
@jjallaire If exclude
determines which files are copied to _site
, I would expect exclude: ["README.html"]
to prevent README.html
from being copied to the output directory. However, it still gets copied. Also, because I have base_url
set, the README.html
entry gets added to sitemap.xml
.
Here is a reproducible example:
library(distill)
packageVersion("distill")
path <- tempfile()
distill::create_blog(dir = path, title = "reprex", edit = FALSE)
cat('base_url: https://testing-distill.com\n',
file = file.path(path, "_site.yml"), append = TRUE)
file.create(file.path(path, "README.md"))
library(rmarkdown)
render_site(input = path, encoding = "UTF-8")
file.exists(file.path(path, "_site/README.html"))
file.remove(file.path(path, "_site/README.html"))
cat('exclude: ["README.html"]\n', file = file.path(path, "_site.yml"), append = TRUE)
render_site(input = path, encoding = "UTF-8")
file.exists(file.path(path, "_site/README.html"))
grep("README", readLines(file.path(path, "_site/sitemap.xml")), value = TRUE)
I tried using the reprex package, but it failed with Error: Distill articles cannot be previewed in this version of RStudio.
I am using the latest version from GitHub (currently 0.7).
from distill.
Related Issues (20)
- Upkeep for distill
- Check and add alt-text to pictures, plots, ... in website
- invalid byte sequence when deploying to github HOT 3
- RSS category-based feeds HOT 1
- Creative Commons Markdown Table Not Rendering Properly
- Warning due to deprecation of 'format' argument to 'as.character.POSIXlt()' HOT 2
- Description in _site.yaml causing Error "STRING_ELT() can only be applied to a 'character vector', not a 'list'" HOT 1
- How to add email and multiple affiliations to a single author? HOT 2
- Article description does not show up when adding posts HOT 1
- Improve alt-text for ORCiD icon HOT 3
- Add <hr> for screen reader accessibility HOT 1
- Space between lines in bulleted lists HOT 1
- Various minor accessibility issues
- Release distill 1.6
- Gallery outdated, remove Quarto pages HOT 1
- Javascript & D3 page error HOT 1
- Journal (site) title is incorrectly prepended to the article title in cititations.
- Has anyone used any alternative to Google analytics? HOT 2
- italicized species names in a Rmarkdown distill package
- Using a `distill` vignette on CRAN HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from distill.