Generate Individual Documentation Files
Description
Creates a directory of individual markdown files, one per help topic. LLMs can read these on-demand when they need details about specific functions.
Usage
1use_fyi_docs(
2 package,
3 dir = "man-md",
4 pattern = NULL,
5 topics = NULL,
6 exclude = NULL,
7 exports_only = FALSE,
8 clean = TRUE,
9 format = "default"
10)
Arguments
package: Character. Package name.dir: Directory to write files. Default “man-md” in current directory.pattern: Optional regex to filter which topics to include.topics: Optional character vector of specific topics to include.exclude: Optional regex pattern to exclude topics.exports_only: Logical. Only include docs for exported functions? Default FALSE.clean: Logical. Remove existing files in dir first? Default TRUE.format: Output format: “default” (HTML comments) or “hugo” (YAML front matter).
Value
Character vector of generated file paths, invisibly.
Examples
1# Generate all doc files
2use_fyi_docs("sttapi")
3
4# Filter to specific patterns (torch example)
5use_fyi_docs("torch", pattern = "^nn_") # Neural network modules
6use_fyi_docs("torch", pattern = "^optim_") # Optimizers
7use_fyi_docs("torch", pattern = "^torch_") # Tensor operations
8
9# Specific topics only
10use_fyi_docs("torch", topics = c("nn_linear", "nn_conv2d", "nn_module"))
11
12# Exclude patterns
13use_fyi_docs("torch", exclude = "^nnf_") # Skip functional variants
14
15# Only exported functions (skip internal helper docs)
16use_fyi_docs("torch", exports_only = TRUE)
17
18# Hugo format for static sites
19use_fyi_docs("sttapi", format = "hugo")