Replies: 1 comment
-
Hi @amygimma . To my current understanding every golem is an R package (with additional features for shiny development). This means that the rules (restrictions…) for R package development apply in general. Following http://colinfay.me/writing-r-extensions/creating-r-packages.html (specifically 1.1.5 for the exact reference) and see the bottom footnote number 1 for non-technical lingo: it is not allowed to have a nested folder structure within R. So unfortunately this will not work but fail silently: you can compile docs, build the package and even run Using > golem::add_module("sectionAModules/section_a_feature_b")
Error: [ENOENT] Failed to open 'R/mod_sectionAModules/section_a_feature_b.R': no such file or directory If you seek to structure content within Example:For example name the modules “01_XXXX”, “02_XXXX”. Depending on the some scheme. The scheme could be for example inernal model of your UI development. I tend to structure my module-numbers in the order they (logically and visually) appear inside a shiny App i.e. following my internal mental model of the App. If there are two or more files relating to one UI-piece, say the “02_”, use letters like “02_A_XXX” or “02_B_XX”. If you sort the file pane in Rstudio/vscode by name, the module files appear in the order of your mental shiny App model. This way you still find the files rather quickly. |
Beta Was this translation helpful? Give feedback.
-
Hi, simple question but I couldn't find any examples of this. I was wondering if I could include a nested folder structure for module files to make them easier to navigate. I was thinking something like this:
├── R
│ ├── sectionAModules
│ │ ├── mod_section_a_feature_a
│ │ ├── mod_section_a_feature_b
│ │ ├── mod_section_a_feature_c
│ ├── sectionBModules
│ │ ├── mod_section_b_feature_a
│ │ ├── mod_section_b_feature_b
│ │ ├── mod_section_b_feature_c
If is ok to do - would I call something like
golem::add_module("sectionAModules/section_a_feature_b")
?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions