get_quarto_source | R Documentation |
This is a utility function that I use to point to source code on GitHub for posts on my personal website, located at https://tdunn.ca/. Credit for the idea goes to Danielle Navarro (https://blog.djnavarro.net/).
get_quarto_source( repo = "taylordunn/tdunn-quarto", branch = "main", collection = "posts", date = NULL, slug = NULL, html_tag = TRUE, html_label = "Source code", renv_link = TRUE )
repo |
The GitHub repository, "user/repo-name". |
branch |
Name of the GitHub branch, default "main". |
collection |
Collection to which the post belongs to, default "posts". |
date |
The date of the post. Typically this will be defined as a
notebook parameter via |
slug |
The URL slug of the post. Typically this will be defined as a
notebook parameter via |
html_tag |
Logical. If |
html_label |
If returning a HTML hyperlink, the text label to display. |
renv_link |
Logical. If |
A string of the source code URL, or an HTML hyperlink tag.
date <- "2021-05-18" slug <- "tidytuesday-week-21" get_quarto_source(date = date, slug = slug, html_tag = FALSE) get_quarto_source(date = date, slug = slug, html_tag = TRUE) get_quarto_source(date = date, slug = slug, html_tag = TRUE, html_label = "Custom label")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.