pyfan.util.rmd.bookdownparse
¶
Generate README from Fan Rmd Frontmatter
The pyfan.util.rmd.bookdownparse
generates rmd frontmatter.
Generates README.md TOC contents based on parsed YAML frontmatter from files listed in a bookdown yaml file that contains a list of RMD files to process through.
Includes method fs_yml2readme()
Module Contents¶
Functions¶
|
Write to file README detailed TOC for files in bookdown yaml list |
-
pyfan.util.rmd.bookdownparse.
fs_yml2readme
(sfc_prj='R4Econ', sph_prj='C:/Users/fan/R4Econ/', spn_prj_bookdown_yml='_bookdown.yml', spn_prj_readme_toc='README_toc.md', ls_st_ignore=['index.Rmd', 'README_appendix.md', 'title.Rmd', 'main.Rmd'], sph_pdf='htmlpdfr', sph_html='htmlpdfr', sph_r='htmlpdfr', st_file_type='r', verbose=False)[source]¶ Write to file README detailed TOC for files in bookdown yaml list
- Parameters
- sfc_prjstring
The git project name
- sph_prjstring
the local path to the git project
- spn_prj_bookdown_ymlstring
yml file name under project root contains rmd names under ‘rmd_files’ key
- spn_prj_readme_tocstring
md generated file name under project root
- ls_st_ignore: list
list of string names to ignore
- sph_pdfstring
subfolder to store pdf files in the rmd folder
- sph_htmlstring
subfolder to store html files in the rmd folder
- sph_rstring
subfolder to store r files in the rmd folder does not have to be r, any other raw file type, m of py for example
- st_file_type: string
the RMD file is for which underlying language: r for R, m for matlab, py for python
- verbose: bool
print details
- Returns
- None
nothing is returned, the spn_prj_readme_toc toc file is generated
Examples
>>> fs_yml2readme(sfc_prj='pyfan', sph_prj='../../../', verbose=False)