tinyrox

Minimal R Documentation Generator

Last updated: 2026-02-06

Minimal R documentation generator - base R only, no magic.

What it does

tinyrox is a lightweight alternative to roxygen2 that generates valid .Rd files and NAMESPACE from #' comments using only base R.

Installation

1remotes::install_github("cornball-ai/tinyrox")

Usage

 1library(tinyrox)
 2
 3# Generate man/*.Rd and NAMESPACE from R/*.R
 4document()
 5
 6# Clean generated files (man/, NAMESPACE)
 7clean()
 8
 9# Check for common CRAN policy issues
10check_cran()

Supported Tags

Documentation

TagPurpose
@titleOne-line title
@descriptionShort description
@detailsLonger description
@param nameParameter documentation
@returnReturn value
@valueAlias for @return
@examplesCode examples (verbatim)
@example pathInclude example from file
@seealsoCross-references
@referencesCitations
@section Title:Custom section
@authorAuthor information
@family nameRelated functions
@aliasesAdditional topic aliases
@keywordsRd keywords (e.g., internal)
@nameExplicit topic name
@inheritParams fnCopy params from another function
@noRdSkip Rd generation

Namespace

TagEffect
@exportexport()
@exportS3Method generic classS3method()
@import pkgimport()
@importFrom pkg sym1 sym2importFrom()
@useDynLib pkguseDynLib()

Example

 1#' Add Two Numbers
 2#'
 3#' @param x First number
 4#' @param y Second number
 5#' @return The sum
 6#' @export
 7#'
 8#' @examples
 9#' add(1, 2)
10add <- function(x, y) {
11  x + y
12}

CRAN Compliance Checking

tinyrox includes automated CRAN compliance checks:

 1# Check DESCRIPTION for common issues
 2check_description_cran()
 3# Warns about: unquoted package names, missing web service links
 4
 5# Check R code for CRAN policy violations
 6check_code_cran()
 7# Warns about: T/F, print()/cat(), .GlobalEnv, installed.packages(), etc.
 8
 9# Run all checks
10check_cran()
11
12# Auto-fix DESCRIPTION quoting issues
13fix_description_cran()

Issues detected:

  • Unquoted package/software names in Title/Description
  • Missing web service links for packages like hfhub, gh
  • T/F instead of TRUE/FALSE
  • print()/cat() instead of message()
  • installed.packages() usage
  • .GlobalEnv modifications
  • setwd() without on.exit() restoration
  • Hardcoded set.seed() without parameter

Philosophy

tinyrox follows the tinyverse philosophy:

Dependencies have real costs. Each dependency is an invitation to break your project.

Design principles:

  • Minimize dependencies (tinyrox has none)
  • Explicit over implicit - no inference magic
  • Strict subset of tags - not everything roxygen2 does
  • Deterministic output - same input = same output
  • Fail fast on unknown tags

What tinyrox does NOT do:

  • Markdown parsing
  • Automatic dependency inference
  • @rdname grouping magic
  • pkgdown integration

Development Workflow

tinyrox is part of the tinyverse toolchain for R package development:

PackagePurpose
tinyroxDocumentation & NAMESPACE
tinypkgrinstall, load_all, check, build
tinytestUnit testing
fyiRd to markdown (LLM context, static sites)
 1# Edit R/*.R files with #' comments
 2
 3# Regenerate docs
 4tinyrox::document()
 5
 6# Load for interactive development (no install)
 7tinypkgr::load_all()
 8
 9# Install and reload in current session
10tinypkgr::reload()
11tinytest::test_package("mypkg")
12
13# Full R CMD check
14tinypkgr::check()

Or from the command line with littler:

1r -e 'tinyrox::document(); tinypkgr::install(); tinytest::test_package("mypkg")'

License

GPL-3

Reference

See Function Reference for complete API documentation.

Functions