Skip to content
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

Relax index.Rmd constraint and correctly support edge case #1351

Merged
merged 17 commits into from
Sep 28, 2022

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Jun 22, 2022

This should close #1349

This PR tries to achieve two things:

  • Supports index.Rmd and index.rmd as main file expected in a bookdown project
  • Still render a book even if these file are not provided (basically render_book("my_file.Rmd") where my_file.Rmd plays the role of index file but with another name.

I am opening this PR as a draft to get some first feedback @yihui. I also need to check that report in community (https://community.rstudio.com/t/render-book-error-stop-if-not-exists-and-some-files-were-not-found/139927/19) is taken into account.

When a directory is passed, search for index file and if they do not exists, just don't set an input value.

input is just use as fallback for format guessing. Otherwise `sources_files()` is used to know what to render.

This should restore better past behavior from discussion in
https://community.rstudio.com/t/render-book-error-stop-if-not-exists-and-some-files-were-not-found/139927/24
Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two small suggestions. Thanks!

R/bs4_book.R Outdated Show resolved Hide resolved
R/utils.R Outdated Show resolved Hide resolved
@cderv cderv changed the title Relax index.Rmd constraint while still trying to guess output formats Relax index.Rmd constraint and correctly support edge case Sep 28, 2022
@cderv cderv merged commit 7b53f2d into main Sep 28, 2022
@cderv cderv deleted the relax-index-constraint branch September 28, 2022 14:55
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

render_book("filename") complains about missing "index.Rmd"
2 participants