Skip to contents

Take an existing gist, send to carbon, and save the image locally

Usage

gist_to_carbon(
  gist_id,
  file = "code.png",
  bg = getOption("gistillery.bg", default = "#4A90E2"),
  theme = getOption("gistillery.theme", default = "night-owl"),
  font = getOption("gistillery.font", default = "Hack"),
  lang = "auto",
  imgur = TRUE,
  drop_shadow = TRUE,
  width = 680,
  width_auto_adjust = TRUE
)

Arguments

gist_id

the unique id for your existing gist, can be piped from gist_upload() or passed manually.

file

the name of the file for printing, eg code.png

bg

A valid hex code for color, ie #D3D3D3

theme

A valid theme, such as "cobalt", "nord", "night-owl", "monokai" - for all available themes, see `carbon_themes`

font

A valid font ID such as "IBM+Plex+Mono", "Hack", "Fira+Code" - for all available fonts, see `carbon_fonts`

lang

A language for syntax highlighting, ie one of "python", "r", "yaml", "markdown", "text", "auto"

imgur

A logical, should the image also be uploaded to imgur.

drop_shadow

Logical indicating whether to include drop shadow for the screenshot.

width

a number, indicating the width in pixels for screenshot

width_auto_adjust

Logical indicating whether to auto adjust the width for better code-printing

Value

Saves an image to disk and optionally returns the uploaded imgur URL