return_heading {accessrmd}R Documentation

Return a HTML p tag formatted to resemble a heading tag.


Returns a HTML heading p tag formatted with inline css to appear like of any of the available levels (h1, h2, h3 and so on). This approach is in response to review comments regarding headings that contained no text potentially confusing screen reader users. The class selectors applied will always include "toc-ignore", but an additional selector may be included within the class parameter. If an object of length zero is passed to the txt parameter, NULL is returned, allowing for vectorised usage.


return_heading(txt, lvl, class, font_weights = c(h1 = 38, h2 = 30, h3 = 24))



The text to be used as the 'heading' text.


A number indicating the heading level. 1 == tags$h1() and so on.


A character string to use as the first class attribute. Do not include "toc-ignore", this will be added.


A named character vector. Names are heading levels & numeric values to apply as font weight.


null if txt is length 0 or p tag styled to appear as required heading level with class attr applied.

[Package accessrmd version 1.0.0 Index]