Skip to content

Instantly share code, notes, and snippets.

@schochastics
Last active July 15, 2022 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schochastics/e752b82c5019dcbdd8ede7e8104f2be4 to your computer and use it in GitHub Desktop.
Save schochastics/e752b82c5019dcbdd8ede7e8104f2be4 to your computer and use it in GitHub Desktop.
automatic styling and linking for R packages mentioned in quarto docs
function CRAN(handle)
local output = '<span class="cran-pkg"><a href="https://cran.r-project.org/package=' ..
pandoc.utils.stringify(handle) .. '">'..
pandoc.utils.stringify(handle)..'</a><i class="fa-brands fa-r-project fa-2xs"></i></span>'
return pandoc.RawBlock('html', output)
end
@schochastics
Copy link
Author

schochastics commented Jul 15, 2022

Make sure to install the fontawesome extension
Use with {{< CRAN ggplot2 >}}

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