Skip to content

Commit

Permalink
style and docs: run devtools::document() and styler::style_pkg()
Browse files Browse the repository at this point in the history
  • Loading branch information
kellijohnson-NOAA committed Jun 18, 2024
1 parent 73405dd commit ceef4b9
Showing 1 changed file with 34 additions and 33 deletions.
67 changes: 34 additions & 33 deletions vignettes/fims-documentation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ This page provides information related to the FIMS documentation for version `r
## Document data template
template <- list(
description = "**Description:** \n",
audience = "**Audience**: project manager, developer, and user\n",
audience = "**Audience**: project manager, developer, and user\n",
link = "**Link**:\n
\t\t - \n\n",
update = "**Update frequency**: \n",
horizontal_line = "---"
)
## Overview
## Overview
overview <- list(
description = "**Description:** a summary of critical information (e.g., history of FIMS, organization overview, and technologies and tools used to build FIMS) and operating processes (< 2 pages). Links to additional resources (e.g., Term of reference, technical memos, and manuscripts) can be included in this summary. This document can serve as an initial resource for new team members, addressing fundamental questions they are likely to have.\n",
audience = "**Audience**: project manager, developer, and user\n",
audience = "**Audience**: project manager, developer, and user\n",
link = "**Link**:\n
\t\t - under development\n",
update = "**Update frequency**: update the document as requested, particularly if new members encounter difficulties resolving major issues or uncover misinformation while using this document.\n",
Expand Down Expand Up @@ -62,7 +62,7 @@ requirements <- list(
## Developer guide
developer_guide <- list(
description = "**Description:** this guide helps developers install, configure, and manage FIMS.\n",
audience = "**Audience**: developer\n",
audience = "**Audience**: developer\n",
link = "**Link**:\n
\t\t - [FIMS collaborative workflow repository](https://noaa-fims.github.io/collaborative_workflow/)\n
\t\t - [FIMS Developer Handbook](https://noaa-fims.github.io/collaborative_workflow/)\n",
Expand All @@ -73,7 +73,7 @@ developer_guide <- list(
## Design documents
design_documents <- list(
description = "**Description:** a summary of key decisions regarding the design and architecture of FIMS.\n",
audience = "**Audience**: developer\n",
audience = "**Audience**: developer\n",
link = "**Link**:\n
\t\t - [design documents Google Drive folder (NOAA internal only)](https://drive.google.com/drive/folders/1e-7MNRa61uGQaWsixKsyw5rGnRlcrYFf?usp=drive_link)\n",
update = "**Update frequency**: create the documentation as a design document at the beginning of a milestone, update design decisions throughout development within the milestone, archive it at the end of the milestone. Document design decisions that are not obvious, thereby avoiding needless refactoring in the future or rehashing previously made decisions. At the end of the milestone, we can summarize key pieces of the document and put them into the overview document.\n",
Expand All @@ -83,7 +83,7 @@ design_documents <- list(
## C++ source code documentation
c_code_documentation <- list(
description = "**Description:** use comments in the code to document C++ files, namespaces, classes, structs, templates, variables, functions, and typedefs.\n",
audience = "**Audience**: developer and user\n",
audience = "**Audience**: developer and user\n",
link = "**Link**:\n
\t\t - [C++ Doxygen website](https://noaa-fims.github.io/FIMS-docs/)\n",
update = "**Update frequency**: always up to date.\n",
Expand All @@ -93,7 +93,7 @@ c_code_documentation <- list(
## R source code documentation
r_code_documentation <- list(
description = "**Description:** describe R functions in comments next to their definitions.\n",
audience = "**Audience**: developer and user\n",
audience = "**Audience**: developer and user\n",
link = "**Link**:\n
\t\t - [Function reference](https://noaa-fims.github.io/FIMS/reference/index.html)\n",
update = "**Update frequency**: always up to date.\n",
Expand All @@ -103,7 +103,7 @@ r_code_documentation <- list(
## Release notes
release_notes <- list(
description = "**Description:** provide notes associated with each release of FIMS.\n",
audience = "**Audience**: user\n",
audience = "**Audience**: user\n",
link = "**Link**:\n
\t\t - [Changelog](https://noaa-fims.github.io/FIMS/news/index.html)\n",
update = "**Update frequency**: update before a release.\n",
Expand All @@ -113,7 +113,7 @@ release_notes <- list(
## License
license <- list(
description = "**Description:** provide full copies of the license statements.\n",
audience = "**Audience**: user\n",
audience = "**Audience**: user\n",
link = "**Link**:\n
\t\t - [License file](https://noaa-fims.github.io/FIMS/LICENSE-text.html)\n",
update = "**Update frequency**: review the license before a major version release and determine if any updates are necessary.\n",
Expand All @@ -123,7 +123,7 @@ license <- list(
## Case studies
case_studies <- list(
description = "**Description:** provide test cases of FIMS.\n",
audience = "**Audience**: developer and user\n",
audience = "**Audience**: developer and user\n",
link = "**Link**:\n
\t\t - [case studies website](https://noaa-fims.github.io/case-studies/)\n",
update = "**Update frequency**: publish test cases within milestone 2 and then update the website as requested.\n",
Expand All @@ -133,9 +133,9 @@ case_studies <- list(
## User guide
user_guide <- list(
description = "**Description:** describe the available installation options for FIMS. Provide step-by-step procedures for common beginner and advanced FIMS workflows.\n",
audience = "**Audience**: user\n",
link = "**Link**:\n
\t\t - [installation guide in the README file](https://noaa-fims.github.io/FIMS/)\n
audience = "**Audience**: user\n",
link = "**Link**:\n
\t\t - [installation guide in the README file](https://noaa-fims.github.io/FIMS/)\n
\t\t - [vignettes on the FIMS {pkgdown} website](https://noaa-fims.github.io/FIMS/articles/index.html
)\n",
update = "**Update frequency**: always up to date (The person making the change is responsible for the update and a dedicated user guide maintainer should check in on it at the end of each milestone).\n",
Expand All @@ -161,59 +161,60 @@ doc_list <- list(
```{r list-to-markdown, echo=FALSE, warning=FALSE, message=FALSE}
library(tidyverse)
list2markdown <- function(list){
enframe(list) %>%
group_by(name) %>%
list2markdown <- function(list) {
enframe(list) %>%
group_by(name) %>%
mutate(items = paste0(
"- ",
name,
"- ",
name,
paste0(
"\n\t- ",
unlist(value),
collapse = ""))) %>%
pull(items) %>%
paste0(collapse = "\n") %>%
"\n\t- ",
unlist(value),
collapse = ""
)
)) %>%
pull(items) %>%
paste0(collapse = "\n") %>%
cat()
}
```
## Documentation list {.tabset}

### Documentation for user
```{r user-doc, echo=FALSE, warning=FALSE, results='asis'}
list_index <- lapply(doc_list, function(x){
list_index <- lapply(doc_list, function(x) {
grepl("user", x$audience)
})
user_doc <- doc_list[names(list_index)[which(unlist(list_index))]]
user_doc <- lapply(user_doc,'[', c("description", "link", "horizontal_line"))
user_doc <- lapply(user_doc, "[", c("description", "link", "horizontal_line"))
list2markdown(user_doc)
```

### Documentation for developer
```{r developer-doc, echo=FALSE, warning=FALSE, results='asis'}
list_index <- lapply(doc_list, function(x){
list_index <- lapply(doc_list, function(x) {
grepl("developer", x$audience)
})
developer_doc <- doc_list[names(list_index)[which(unlist(list_index))]]
developer_doc <- lapply(developer_doc,'[', c("description", "link", "update", "horizontal_line"))
developer_doc <- lapply(developer_doc, "[", c("description", "link", "update", "horizontal_line"))
list2markdown(developer_doc)
```

### Documentation for project manager
```{r project-manager-doc, echo=FALSE, warning=FALSE, results='asis'}
list_index <- lapply(doc_list, function(x){
list_index <- lapply(doc_list, function(x) {
grepl("project manager", x$audience)
})
project_manager_doc <- doc_list[names(list_index)[which(unlist(list_index))]]
project_manager_doc <- lapply(project_manager_doc,'[', c("description", "link", "update", "horizontal_line"))
project_manager_doc <- lapply(project_manager_doc, "[", c("description", "link", "update", "horizontal_line"))
list2markdown(project_manager_doc)
```
Expand Down

0 comments on commit ceef4b9

Please sign in to comment.