Skip to content

Update documentation for render_book(). - #931

Closed
j-magnolia wants to merge 0 commit into
rstudio:masterfrom
j-magnolia:csl_env
Closed

j-magnolia wants to merge 0 commit into
rstudio:masterfrom
j-magnolia:csl_env

Conversation

@j-magnolia

@j-magnolia j-magnolia commented Aug 23, 2020 •

Copy link
Copy Markdown
Contributor

Add details about how the options are set for the output_format parameter to documentation for render_book() function. See discussion in comments to #930.

@cderv

cderv commented Aug 24, 2020

Copy link
Copy Markdown
Collaborator

Thanks !
What about adding examples as in the issue, in \dontrun clauses maybe ? one with the function & parameters and one with with the sring ? Could be best to prevent convention in the future, right ?

Comment thread NEWS.md Outdated
## MINOR CHANGES

- The `--file-scope` behavior introduced in bookdown v0.20 is now disabled by default. This is due to broken TOC links for duplicate section names (e.g., "Exercises"; see #909) that have automatically generated identifiers.
- Updated documentation for `render_book` to make it clearer how options are set for the `output_format` parameter (See #930).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As below, syntax is

(thanks, @yourname, #prnumber)

Thanks!

@yihui yihui left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I feel rmarkdown::render might be a better place to document this behavior: https://github.com/rstudio/rmarkdown/blob/204aa41faea12212dc80642f5a8e53e4e52e0999/R/render.R#L158-L165 because bookdown::render_book's output_format is eventualy passed to rmarkdown::render. The original issue #930 was not specific to bookdown but any R Markdown documents/projects.

What do you think?

@j-magnolia

Copy link
Copy Markdown
Contributor Author

I think @yihui makes sense in saying that the documentation fits better into rmarkdown, but it would be useful to put a modicum of documentation into bookdown alerting people to look at the rmarkdown documentation.

If you all want, I can write up some small PRs, one for rmarkdown documenting this behavior and the other for bookdown alerting the user to go look in rmarkdown for details.

I'll defer to what you all would like.

@cderv

cderv commented Aug 25, 2020 •

Copy link
Copy Markdown
Collaborator

Yeah it is right. This should be in rmarkdown::render. The help page of render_book already linked to rmarkdown::render, so having only this documented there seems ok to me. In render_book I would maybe only add some example with comments in a \dontrun close

# will use the default format defined in _output.yml
bookdown::render_book("index.Rmd")
# will use the options for format defines in yaml
bookdown::render_book("index.Rmd",  "pdf_book")
# If you pass an output format, it must have all the options set
bookdown::render_book("index.Rmd", bookdown::pdf_book(toc = FALSE))

and I would add the link to https://bookdown.org/yihui/bookdown/build-the-book.html in a reference part of this help page.

We could also have bookdown::render_book inherits param for rmarkdown::render so that both are up to date, but it is not the practice here it seems - we just link to the other topic instead of inheriting.

@j-magnolia

Copy link
Copy Markdown
Contributor Author

Closed this and created a new PR #933 following the suggestions from the discussion above. I also created a PR in rmarkdown (rstudio/rmarkdown#1880)

@j-magnolia j-magnolia mentioned this pull request Sep 26, 2020
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 24, 2021
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.

3 participants