Rmarkdown / gitbook format manual all documents #4751
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
SGN Documentation
View the documentation
Syntax and Use
This folder
docs/
can be used to build the site through R package - bookdown. More about bookdown here.https://bookdown.org/
https://bookdown.org/yihui/bookdown/
The entire page along with the source files in r-markdown format are in the folder
/docs/r_markdown_docs
Tools.
The best way to work with the documentation is to
setwd("{path_on_local_machine}/sgn/docs/r_markdown_docs")
we can check current working directory bygetwd()
.How to work with documentation
Introduction
This section provides an overview of managing R Markdown documentation using Bookdown and outlines the purpose of this technical manual.
Defining the Document Structure in
_bookdown.yml
file.Files: Structure of the document is stored in
_bookdown.yml
file.rmd_files
variable in_bookdown.yml
is a list of documents used to build a documentation in a given order. If we want to add a new file to documentation - it must be added to the Rmd_files list and a new file must be created inr_markdown_docs
folder with .Rmd extension.Setting the Order of Chapters/Sections: Order of chapters is an order of files in
rmd_files
list.Adding New Chapters/Sections
Creating New R Markdown Files: to create a new section or chapter - just create a
<filename>.Rmd
file in/docs/r_markdown_docs
folder.Updating the Rmd Files List: Once you create a file and want to add it to official documentation update
_bookdown.yml
->rmd_files
with new additions.Building Your Documentation
Rendering the Documentation: Best way to render document is to open
index.Rmd
inRStudio
and use the knit icon ( command ).Alternatively, to preview html gitbook format and pdf use the R command:
bookdown::render_book("index.Rmd", "bookdown::pdf_book")
bookdown::render_book("index.Rmd", "bookdown::gitbook")
Previewing the Documentation: Best option is RStudio - with
knit
command we have also a live local server for gitbook html documents.Deployment and Sharing
Publishing Your Documentation:
.Rmd
files in ther_markdown_docs
folder and check_bookdown.yml
file if the structure is correct.RStudio
or any other live server if changes are correct and documentation looks correct.r_markdown_docs
folder. If there are, it will trigger a gitaction to automatically build documentation on github containers.That process is completely automated.
r_markdown_docs
folder and create pull requestChecklist
/t/data/fixture/patches/
./docs
has been updated./js
to/js/source/legacy
.