generateMarkup {wyz.code.rdoc}R Documentation

Generate R documentation atomic piece

Description

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

Usage

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

a vector of strings, that is the content to consider

keyword_s_1

a R documentation keyword. See rdocKeywords.

content2_s

a vector of strings that is a second content, useful with some keywords that require two members

inline_b_1

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

useSpace_b_1

a single boolean asking for space insertion. 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 vector of strings that is 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 zero, 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.

See Also

Refer to escapeContent.

Examples

# 0. zero content example
print(generateMarkup(keyword = 'R'))
# "\\R"

# 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}"


[Package wyz.code.rdoc version 1.1.19 Index]