"Online documentation for BioCro" {target="_blank"}
Note: A copy of the bookdown BioCro developer's manual is automatically generated on BioCro's GitHub documentation site at https://biocro.github.io and may be viewed by clicking on the Developer's Manual menu-bar link found there. What follows, therefore, will mostly be of interest to developers working on revising the documentation who want to check the results of their revisions.
To generate the bookdown BioCro developer's manual, do as follows:
Install Pandoc, if it is not already on your system. See https://pandoc.org/installing.html for instructions. (Note to RStudio users: As mentioned in the R Markdown Cookbook (https://bookdown.org/yihui/rmarkdown-cookbook/install-pandoc.html), RStudio comes with its own copy of Pandoc, so you may be able to get by without installing it separately.)
Install the R bookdown package, if it hasn't been installed already. These instructions are written for bookdown version 0.22 or greater but may work for other versions.
In the bookdown
directory of your BioCro source tree, run
sh
Rscript -e "bookdown::render_book()"
Note: If you wish to run render_book
from other than the
bookdown
directory, you may pass a path argument:
Rscript -e "bookdown::render_book(<path>)
Here, <path>
denotes the path from the current directory to the
bookdown
directory.
This only works in bookdown versions 0.22 and later! With earlier
versions, you can make use of the xfun::in_dir
function:
xfun::in_dir('<path>', bookdown::render_book())
Again, <path>
here denotes the path from the current directory to
the bookdown
directory.
Note: Because some sections of the book are contained in their own
files rather than being in a larger file comprising a complete
chapter, render_book
will issue a warning such as the
following, which may be safely ignored:
"In split_chapters(output, gitbook_page, number_sections, split_by, :
You have 13 Rmd input file(s) but only 7 first-level heading(s). Did you forget first-level headings in certain Rmd files?"
bookdown/_book/index.html
.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.