MyNixOS website logo
Description

Run 'roxygen2' on (Chunks of) Single Code Files.

Have you ever been tempted to create 'roxygen2'-style documentation comments for one of your functions that was not part of one of your packages (yet)? This is exactly what this package is about: running 'roxygen2' on (chunks of) a single code file.

pipeline status
coverage report

CRAN_Status_Badge RStudio_downloads_monthly RStudio_downloads_total

document

Introduction

After installation, please read the vignette

vignette("Introduction_to_document", package = "document")

or the help page:

help("document-package", package = "document")
#> Document a Single R Code File
#> 
#> Description:
#> 
#>      Have you ever been tempted to create 'roxygen2'-style
#>      documentation comments for one of your functions that was not part
#>      of one of your packages (yet)? This is exactly what this package
#>      is about: running 'roxygen2::roxygenize' on (chunks of) a single
#>      code file.
#>      This package enables you to
#> 
#>        1. create function documentation with 'roxygen2'
#> 
#>        2. detect code/documentation mismatches
#> 
#>        3. save the documentation to disk
#> 
#>        4. view the documentation in your interactive R session
#> 
#>      You will probably be looking for 'document' and 'man', the
#>      remaining functions are mainly for internal use.
#> 
#> Details:
#> 
#>      R is a programming language that supports and checks documentation
#>      for program libraries (called `packages'). The package 'roxygen2'
#>      provides a tool for creating documentation from annotated source
#>      code - much like 'doxygen', 'javadoc' and 'docstrings/pydoc' do.
#> 
#>      And R is a free software environment for statistical computing and
#>      graphics, used by people like me who start out hacking down code,
#>      eventually pouring chunks of code into functions (and sometimes
#>      even ending up creating and documenting packages). Along that work
#>      flow you cannot use R's documentation system, let alone
#>      'roxygen2', unless you have come to forge your code into a
#>      package.
#> 
#>      I am fully aware of the fact that 'roxygen2' is meant to document
#>      packages, not single code chunks. So should you. Nevertheless I
#>      feel the temptation to use 'roxygen2'-style comments in code
#>      chunks that are not part of any package. And to convert them to
#>      pdf for better readability.
#> 
#> Warning:
#> 
#>      This package writes to disk, so *never* run as superuser.
#> 
#> Note:
#> 
#>      This package is basically a wrapper to
#> 
#>        1. 'roxygen2'. It internally creates a temporary package from
#>           the code file provided (using 'utils::package.skeleton')
#>           which it then passes to 'roxygen2::roxygenize'.
#> 
#>        2. 'R CMD' commands run by 'callr'.
#> 
#> See Also:
#> 
#>      'docstring' (<https://cran.r-project.org/package=docstring>) also
#>      creates temporary help pages as well but using a different
#>      technical approach (allowing you to view them in the 'RStudio'
#>      help pane). But it creates them from python style 'docstring'-like
#>      comments it then parses into 'roxygen2'. And it does not write to
#>      file so far.

Installation

You can install document from github with:

if (! require("remotes")) install.packages("remotes")
remotes::install_gitlab("fvafrcu/document")
Metadata

Version

4.0.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows