We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
output_format_dependency()
Idea from @atusy in rstudio/rmarkdown#2508 following the example shared in
--- title: referring sections output: html_document: keep_md: true --- ```{cat, engine.opts=list(file = "example.lua")} local headers = {} local function collect_header(header) headers["#" .. el.identifier] = header end local function link_header(link) if #link.content == 0 and headers[link.target] then link.content = headers[link.target].content end return link end return { { Header = collect_header }, { Link = link_header }, } ``` ```{r} ref <- function(id) { dep <- rmarkdown::output_format_dependency( name = "example", pandoc = list(lua_filters = "example.lua"), ) rmarkdown:::attach_output_format_dependency(dep) return(sprintf("[](#%s)", id)) } ``` # awesome section {#awesome} see `r ref("brilliant")` # brilliant section {#brilliant} see `r ref("awesome")`
The text was updated successfully, but these errors were encountered:
Example was added in https://blog.atusy.net/2023/08/28/rmarkdown-output-format-dependency/ for now
Sorry, something went wrong.
No branches or pull requests
Idea from @atusy in rstudio/rmarkdown#2508 following the example shared in
The text was updated successfully, but these errors were encountered: