-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
render_book("filename") complains about missing "index.Rmd" #1349
Comments
I had another report of this recently in https://community.rstudio.com/t/render-book-error-stop-if-not-exists-and-some-files-were-not-found/139927/19 I don't think it comes from the same code part, but change impact this is the same. In bookdown 0.27 we enforced the checking of We were not checking for I think the error is thrown for you from Lines 79 to 87 in 7e9b46f
_output.yaml and index.Rmd .
It seems bookdown was used without a Where are you format defined if not in a @yihui what is you take on this ? Thanks. |
@cderv , was it a question to me?
(Note: the files are *.md, not *.rmd, see #1262 for explanations)
|
So this confirms it works with Usually in a bookdown project, there is a main file with some YAML header. I was wondering which one you used if not |
In my big project I was using index.rmd (all lower case, sorry for the typo above), that one has the yaml header. It seems that index.Rmd is currently required. But my reading from the docs is that index.Rmd is just the default starting point for directories, but if one submits another file name then it is not needed. This is how I understood the docs, and up to now it also worked in this way:
I'd expect it either to a) let the user choose an arbitrary file name, and build the book based on that file and the config file; or b) state clearly that index.Rmd is needed (and capitalization matters). I'd prefer the option a), there may be various reasons why one cannot use index.Rmd for the main file. |
I'd add a third option here: c) use the first file specified in the config file to look for the yaml header, and do not require the input argument at all. |
So
The
I thought it could be relaxed but it seems we have always assumed that For example, this is the file that is supposed to contain Lines 86 to 92 in 4ac16f0
This is also what Line 391 in 4ac16f0
Lines 394 to 400 in 7e9b46f
Clearly, we are not coherent in all part of the code base regarding if I'll need to reconsider this for next version. Thanks for reporting, I'll think about this more. |
Thanks for being so responsive! |
I'd like to add my 2 cents that we've been maintaining the book Modern Statistics for Modern Biology for several years now where the front page is generated from
My interpretation of the documentation was the same as @otoomet that Thanks for maintaining this super useful package. |
Thanks for your feedback @grimbough ! What will do based on all your feedbacks:
|
@otoomet @grimbough #1351 can be tested to see if this fix things for you. If you want to try it out. remotes::install_github("rstudio/bookdown#1351") |
Thanks, now works for me even if I remove the dummy I thought that someone simply had overlooked an old hard-coded value, but it seems bookdown is quite a complicated project. |
Thanks for confirming. And yes bookdown is quite a complicated workflow, also it is an now old project and it is always a non-so-easy task to adapt.
Thanks for opening the issue. |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
I have a project in a separate folder that contains three files (and only these three files):
foo.rmd`
bar.rmd
and _bookdown.yml:
I attempt to knit the book as
Rscript -e "bookdown::render_book('foo.rmd')"
This gives me an error
So bookdown is looking for index.Rmd although this file is nowhere in my project, and
?render_book
states thatThis occurs in R 4.2, bookdown 0.27 and also the github version 0.27.1. It worked in R 4.1, bookdown 0.24.
For a larger project a workaround seems to be to create an empty index.Rmd file, but not for this simple example.
The text was updated successfully, but these errors were encountered: