add_reference: Add a Markdown file with function references

Description Usage Arguments Details Value Examples

View source: R/reference.R

Description

Add a Markdown file with function references

Usage

1
add_reference(include_internal = FALSE, section_above = NULL, type = "section")

Arguments

include_internal

Boolean indicating if you want to include the documentation of internal (i.e non-exported functions). Default is FALSE. See Details.

section_above

Section that should be above the (sub)section you want to include. In other words, the (sub)section you want to include will be placed just below this section.

type

Section ("section") or subsection ("subsection")

Details

This function is automatically called with init_docsify() by default. However, if you didn't want to create it at the beginning but you changed your mind after having run init_docsify(), you can run it on its own.

If you don't want to include internal functions (i.e functions that are not exported by the package), include "@keywords internal" in the roxygen block of the function concerned, and use include_internal = FALSE.

Value

Creates a Markdown file called "reference.md" in the folder "docs", and edit "_sidebar.md" to add a "Reference" section.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 

library(docsifier)

# Create a test folder and a test package for the example

test_folder <- tempdir()
setwd(test_folder)
devtools::create("dummy")
setwd("dummy")

# Generate the minimal documentation for docsify.js

init_docsify(add_reference = FALSE)

# Generate the "Reference" page in the documentation

add_reference()

## End(Not run)

etiennebacher/docsifier documentation built on Feb. 21, 2022, 2:20 p.m.