Framework for R

Workflow

docs_export()

Export Package Documentation to Database

Parses roxygen2-generated .Rd files and exports structured documentation to SQLite (for GUI) or other formats. This enables searchable documentation in the Framework GUI and powers the public documentation website.

Usage

docs_export(
  output_path = "docs.db",
  man_dir = "man",
  package_name = "framework",
  package_version = NULL,
  include_internal = FALSE,
  verbose = TRUE
)

Arguments

Name Description
output_path

Path to SQLite database file. Default: "docs.db"

man_dir

Directory containing .Rd files. Default: "man"

package_name

Package name for metadata. Default: "framework"

package_version

Package version for metadata. Default: NULL (auto-detect)

include_internal

Include internal/non-exported functions. Default: FALSE

verbose

Print progress messages. Default: TRUE

Value

Invisibly returns the database connection path

Details

The exporter reads all .Rd files from the man/ directory and extracts:

  • Function name, title, description, details
  • Arguments/parameters with descriptions
  • Usage signatures
  • Examples (with dontrun detection)
  • See Also references
  • Custom sections and subsections
  • Keywords

The SQLite output includes FTS5 full-text search for fast querying.

Examples

if (FALSE) {
# Export to default location (exported functions only)
docs_export()
# Export to custom location
docs_export("inst/gui/docs.db")
# Include internal/private functions too
docs_export("all_docs.db", include_internal = TRUE)
# Query the exported docs
con <- DBI::dbConnect(RSQLite::SQLite(), "docs.db")
DBI::dbGetQuery(con, "SELECT name, title FROM functions WHERE name LIKE 'data_%'")
DBI::dbDisconnect(con)
}