
Last chance! 50% off unlimited learning
Sale ends in
Add a code block into a bsdoc
object.
# S3 method for bsdoc
addCodeBlock(doc, file, text,
par.properties = parProperties(), text.properties = textProperties(color =
"#A7947D"), ...)
bsdoc
object where expressions have to be added
file. Not used if text is provided.
character vector. The text to parse. Not used if file is provided.
code block paragraph properties. An object of class parProperties
code block text properties. An object of class textProperties
further arguments, not used.
an object of class bsdoc
.
# NOT RUN {
#START_TAG_TEST
doc.filename = "addCodeBlock/example.html"
# set default font size to 11
options( "ReporteRs-fontsize" = 11 )
doc = bsdoc( )
doc = addCodeBlock( doc, text = "ls -a\nwhich -a ls" )
# Write the object
writeDoc( doc, file = doc.filename )
#STOP_TAG_TEST
# }
Run the code above in your browser using DataLab