Skip to content

Support downlit-style auto-linking for R function and package references #235

Open

Description

@cwickham

The downlit R package auto-links package and function references in rendered R content. Two flavors:

  1. Code-block autolinks — function names inside R code blocks become hyperlinks to their docs (rdrr.io for base R / CRAN packages, pkgdown sites for tidyverse-style packages).

    Example:

    <a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a>("bslib")
  2. Prose autolinks — bare-word mentions of "attached" packages in prose link to the package homepage. Triggered by an options(download.attached = c("shiny", "bslib")) chunk in the source .qmd.

    Example: every plain-text bslib mention becomes <a href="https://rstudio.github.io/bslib/">bslib</a>.

The current Hugo site renders neither flavor. Supporting them would benefit ported posts (authored expecting downlit) and any new R-content posts.

Ported posts where downlit-generated links are missing

Post Local Legacy
bslib-dashboards opensource.posit.co shiny.posit.co
bslib-tooltips opensource.posit.co shiny.posit.co
shiny-r-1.8.0 opensource.posit.co shiny.posit.co
shiny-r-1.8.1 opensource.posit.co shiny.posit.co

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions