resolve_refs_html: Resolve figure/table/section references in HTML

View source: R/html.R

resolve_refs_htmlR Documentation

Resolve figure/table/section references in HTML

Description

Post-process the HTML content to resolve references of figures, tables, and sections, etc. The references are written in the form \@ref(key) in the R Markdown source document.

Usage

resolve_refs_html(content, global = FALSE)

Arguments

content

A character vector of the HTML content.

global

Whether to number the elements incrementally throughout the whole document, or number them by the first-level headers. For an R Markdown output format, global = !number_sections is likely to be a reasonable default (i.e., when the sections are numbered, you number figures/tables by sections; otherwise just number them incrementally).

Value

A post-processed character vector of the HTML character.

Examples

library(bookdown)
resolve_refs_html(c("<caption>(#tab:foo) A nice table.</caption>",
    "<p>See Table @ref(tab:foo).</p>"), global = TRUE)

bookdown documentation built on Oct. 17, 2023, 1:08 a.m.