githubify_images: Replace local links to files with the expected github...

Description Usage Arguments Details Value See Also

View source: R/githubify_images.R

Description

The function will look for capitalised environmental variables of the same name as the argument set in an .Renviron

Usage

1
2
3
4
5
6
7
githubify_images(
  article_string,
  local_image_path = Sys.getenv(x = "LOCAL_IMAGE_PATH"),
  github_user = Sys.getenv(x = "GITHUB_USER"),
  github_repo = Sys.getenv(x = "GITHUB_REPO"),
  github_branch = Sys.getenv(x = "GITHUB_BRANCH")
)

Arguments

article_string

The article as a string, e.g. from 'readr::read_file'

local_image_path

The local path to the images, Default: Sys.getenv(x = "LOCAL_IMAGE_PATH")

github_user

Your github username, Default: Sys.getenv(x = "GITHUB_USER")

github_repo

The github repo hosting the article and image, Default: Sys.getenv(x = "GITHUB_REPO")

github_branch

The branch on the github repo to publish from, Default: Sys.getenv(x = "GITHUB_BRANCH")

Details

At no point does dev.to.ol check that the image is at the expected path, so remember to push your work, and double check the paths are set correctly. setup_environ can help with this.

Value

The article string with the image paths changed from a local path to an expected location on GitHub.

See Also

read_file glue


DaveParr/dev.to.ol documentation built on Aug. 8, 2020, 4:31 p.m.