-
Notifications
You must be signed in to change notification settings - Fork 48
Updating the User Manual
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
The best way to work with the documentation is to
- Install the free R Studio with on your local machine with the sgn repository.
- Set the working directory environment variable to the path from our documentation R command
setwd("{path_on_local_machine}/sgn/docs/r_markdown_docs")we can check current working directory bygetwd(). - Install R packages “bookdown”, "rmarkdown", "pandoc", and "knitr". Load each using library() (e.g. library(bookdown)).
-
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.ymlfile. Files: Structure of the document is stored in_bookdown.ymlfile.rmd_filesvariable in_bookdown.ymlis 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_docsfolder with .Rmd extension. Setting the Order of Chapters/Sections: Order of chapters is an order of files inrmd_fileslist. -
Adding New Chapters/Sections Creating New R Markdown Files: to create a new section or chapter - just create a
<filename>.Rmdfile in/docs/r_markdown_docsfolder. Updating the Rmd Files List: Once you create a file and want to add it to official documentation update_bookdown.yml->rmd_fileswith new additions. -
Building Your Documentation Rendering the Documentation: Best way to render document is to open
index.RmdinRStudioand 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 - withknitcommand we have also a live local server for gitbook html documents. -
Deployment and Sharing Publishing Your Documentation:
- Once changes in documentation are done. Please save all
.Rmdfiles in ther_markdown_docsfolder and check_bookdown.ymlfile if the structure is correct. - Build and check in
RStudioor any other live server if changes are correct and documentation looks correct. - Commit changes to sgn repository and create a new pull request. With the new pull github through github action will check if there are any changes in
r_markdown_docsfolder. If there are, it will trigger a gitaction to automatically build documentation on github containers. - If build action passes, then when the branch with documentation changes is merged with master, Gitaction workflow automatically builds proper gitbook html document, and pdf, and then deploys a static version of html to github pages.
That process is completely automated.
- Build and check locally in RStudio
- Commit changes in
r_markdown_docsfolder and create pull request - Check if the GitHub Action test for building documentation passes.
- Merge to master and check GitHub Action workflow result.
- Once changes in documentation are done. Please save all