Closed superjai closed 3 years ago
Hey @bbest & @mspector13 - OK, so the process of going from rmd to html is now much simpler. There are only 2 functions to remember, which are both in the nms4r package:
generate_html_4_rmd: The function to render a single rmd file (including tooltips), whether or not it contains interactive figures. You just need to provide the full pathname for the rmd file.
render_all_rmd: This function renders all rmd files in the modals directory (skipping rmd files that don't need to be rendered because they haven't changed since the last time the html was rendered). There is a function option (interactive_only = T) to only render rmd files that contain interactive elements. Using this option will always render the selected rmd files.
Awesome! Let's just run pkgdown::build_site()
to update Function reference • nms4r and close this 😄
So, the process of going from the R markdown files to html now has gotten quite confusing in CINMS.
One can hit the Knit button on an individual rmd file in Rstudio, but you won't get the glossary tooltip functionality in the html if you go that way.
You can use the function nms4r::rmd2html, which will render the html with working tooltips, but it only works for functions that don't contain interactive figures.
For rmd files with interactive figures, one can use the function nms4r::generate_html_4_interactive_rmd specifically, which does generate the html with working tooltip functionality. However, this function generates the html for all interactive rmd's in the modals folder, not a specific one.
There is the function nms4r::generate_html_4_noninteractive_rmd which will generate the html (with tooltips) for all noninteractive rmds in the modals folder.
There is nms4r::render_modal_windows that generates the html (with working tooltips) for every rmd file - with interactive figures and without - in the modals directory.
Finally, there is render_site.R which is another way to render all rmd files for the site. However, this code will now fail, as it has not been updated to account for changes to how the rmd files are rendered.
This is way too many choices. Simplification of the process of going from rmd to html is needed.