Ensure Package Docs Exist in Cache
Description
Generates fyi.md and man-md/ docs for any installed package into a
central cache (~/.fyi/
Usage
1fyi_cache(
2 package,
3 force = FALSE,
4 pattern = NULL,
5 max_exports = NULL,
6 max_internals = NULL,
7 max_topics = NULL,
8 internals = TRUE,
9 docs_pattern = pattern,
10 format = "default"
11)
Arguments
package: Character. Package name.force: Logical. Regenerate even if docs exist? Default FALSE.pattern: Optional regex to filter exports/internals/topics in fyi.md, and which doc files to generate in man-md/.max_exports: Maximum exports in fyi.md. Default NULL (all).max_internals: Maximum internals in fyi.md. Use 0 to skip. Default NULL.max_topics: Maximum doc topics to list in fyi.md. Default NULL (all).internals: Include internal functions in fyi.md? Default TRUE.docs_pattern: Optional separate pattern for man-md/ files (if different from fyi.md pattern).format: Output format: “default” (HTML comments) or “hugo” (YAML front matter).
Value
Path to the package’s fyi directory, invisibly.
Examples
1# Cache all docs for a small package
2fyi_cache("sttapi")
3
4# For large packages, filter to reduce fyi.md size
5# (man-md/ files still generated for on-demand reading)
6fyi_cache("torch",
7 max_exports = 100,
8 max_internals = 0,
9 max_topics = 100)
10
11# Only cache nn_* modules
12fyi_cache("torch", pattern = "^nn_")
13
14# Filter fyi.md but generate all doc files
15fyi_cache("torch",
16 pattern = "^nn_",
17 docs_pattern = NULL) # NULL = all docs
18
19# Force regeneration
20fyi_cache("torch", force = TRUE)
21
22# Hugo format for static sites
23fyi_cache("sttapi", format = "hugo")