R/para_md.R
para_md.Rd
Create a rich-formatted paragraph using markdown notation for flextable objects
para_md(
...,
h.fonts = rep(flextable::get_flextable_defaults()$font.family, 6),
h.sizes = c(15, 13, 9),
h.colors = c("black", "darkgray"),
strike.color = h.colors[2],
strike.underline = NA,
code.font = "inconsolata",
code.shading = "#f8f8f8",
link.color = "blue",
link.underline = TRUE,
bullet = "·",
autolink = TRUE,
smart = TRUE,
debug = FALSE
)
# S3 method for class 'paragraph'
print(x, ...)
the character strings with markdown formatting
fonts used for the titles (h1-h6)
font sizes for titles
font colors for titles
color for strikethrough text
is strikethrough text converted into underlined text?
font used for code strings
background color (shading) for code strings
color used for URL links
are URL links underlined?
bullet character used for lists
are links automatically constructed when there is an URL in the text?
is smart punctuation detected and replaced?
switch in debug mode
A paragraph object
a flextable paragraph object with its content formatted according to markdown tags
md1 <- paste0("# Heading **1**\n## Heading **2**\n### Heading **3**\n",
"#### Heading **4**\n##### Heading **5**\n###### Heading **6**")
md2 <- paste0("* List 1\n 1. List 1a\n 2. List 1b\n* List 2\n<br />\n",
"*Some text* with super^script^, sub~script~ and ~~color~~{+#F50490}")
tabularise(head(iris)) |>
Stb$add_footer_lines(para_md(md1, md2))
Sepal.Length
Sepal.Width
Petal.Length
Petal.Width
Species
5.1
3.5
1.4
0.2
setosa
4.9
3.0
1.4
0.2
setosa
4.7
3.2
1.3
0.2
setosa
4.6
3.1
1.5
0.2
setosa
5.0
3.6
1.4
0.2
setosa
5.4
3.9
1.7
0.4
setosa
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6* List 1
· List 1a
· List 1b· List 2
*Some text* with superscript, subscript and color