generateMarkup: Generate R documentation atomic piece

Description Usage Arguments Details Value Author(s) References Examples

View source: R/generateMarkup.R

Description

Generate R documentation atomic pieces, managing various parameters to fulfil R documentation requirements.

Usage

1
2
3
4
5
generateMarkup(content_s, keyword_s_1 = NA_character_,
               content2_s = NA_character_,
               inline_b_1 = TRUE, useSpace_b_1 = FALSE,
               escapeBraces_b_1 = FALSE,
               content3_s = NA_character_)

Arguments

content_s

the content to consider

keyword_s_1

a R documentation keyword. See rdocKeywords.

content2_s

a second content, useful with some keywords that require two members

inline_b_1

should the printed result be on a single line or not?

useSpace_b_1

when dealing with documentation keywords that requires two members, some may require a space in between to work properly. This parameters allows you to ask for this.

escapeBraces_b_1

when TRUE, braces characters are escaped

content3_s

a third content, useful with some keywords that require three members

Details

Very convenient function, to customize your R documentation output.

Might be used programmatically to generate pieces or full documentation.

Tested thoroughly with one, two and three contents to cover all the markups of R documentation.

See examples below.

Value

A single string, containing one or several lines of text. Provided content is processed by function escapeContent.

Author(s)

Fabien Gelineau <neonira@gmail.com>

Maintainer: Fabien Gelineau <neonira@gmail.com>

References

Refer to Writing R extensions to know more about R documentation requirements.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 1. one content example
print(generateMarkup('a title', 'title'))
# "\\title{a title}"

# 2. Two contents examples
print(generateMarkup('https://neonira.github.io/offensiveProgrammingBook/',
'href', 'Offensive Programming Book'))
# "\\href{https://neonira.github.io/offensiveProgrammingBook/}{Offensive Programming Book}"

print(generateMarkup('a', 'item', 'description of a', useSpace_b_1 = TRUE))
# "\\item{a} {description of a}"

print(generateMarkup('a', 'item', 'description of a', useSpace_b_1 = FALSE))
"\\item{a}{description of a}"

# 3. Three contents example
print(generateMarkup('content_1', 'ifelse', 'content_2', content3_s = 'content_3'))
# "\\ifelse{content_1}{content_2}{content_3}"

neonira/wyz.code.rdoc documentation built on Feb. 19, 2020, 12:47 p.m.