You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By the time rhelpi18n:::.getHelpFile runs, the \Sexpr[stage=build] and \Sexpr[stage=install] macros have already been evaluated, but \Sexpr[stage=render] have not and will be evaluated by Rd2whatever calling tools:::prepareRd(stage = 'render').
This has consequences for the translation strings. If any translatable strings are produced by Rd macros, they won't be seen by i18n_translation_template without additional work. For an installed package, tools::Rd_db returns all pre-parsed Rd files with \Sexprs processed the same way as .getHelpFile will see them. For a source package, it's probably easier to install the package in a temporary library in order to process everything as expected by code inside the dynamic macros. If you try to run tools:::prepareRd manually, the code may get confused by not running with the same version of the package is has been written for.
Edit: the opposite problem happens for platform-specific chunks wrapped in #ifdef...#endif. They are processed after the build stage but before the install stage. Extracting strings from the value returned by .getHelpFile will miss the documentation for the other platform.
Documentation can have code that is run dynamically either at install, build or render time:
https://cran.r-project.org/doc/manuals/R-exts.html#Dynamic-pages
The text was updated successfully, but these errors were encountered: