gh_link: Produce Github link in Markdown

View source: R/utils.R

gh_linkR Documentation

Description

Useful for linking to files on Github that live in a local clone of a repo

Usage

gh_link(
  text = NULL,
  path,
  repo,
  user = "petrbouchal",
  remote = NULL,
  branch = "main"
)

Arguments

text

Link text

path

path to file (the bit that goes after /tree/branch, so presumably the local path from project root)

repo

repo name; used if 'remote' is not provided.

user

Github user; used if 'remote' is not provided. Defaults to '"petrbouchal"'

remote

remote in the form of user/repo.

branch

branch. Default '"main"'

Value

character vector of same length as inputs

Inputs are recycled if not all of the same length


petrbouchal/ptrr documentation built on Oct. 10, 2024, 7:21 a.m.