Showing preview only (362K chars total). Download the full file or copy to clipboard to get everything.
Repository: yonicd/carbonate
Branch: master
Commit: 071a9f828e40
Files: 85
Total size: 339.3 KB
Directory structure:
gitextract_2w4rwpo4/
├── .Rbuildignore
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── Bug_report.md
│ │ ├── Feature_request.md
│ │ ├── Question.md
│ │ └── Tips.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── stale.yml
│ └── weekly-digest.yml
├── .gitignore
├── .travis.yml
├── CRAN-RELEASE
├── DESCRIPTION
├── LICENSE
├── NAMESPACE
├── R/
│ ├── carbon.R
│ ├── carbon_fields.R
│ ├── carbonate.R
│ ├── helpers.R
│ ├── selenium_functions.R
│ ├── set_get_functions.R
│ └── uri_functions.R
├── README.Rmd
├── README.md
├── _pkgdown.yml
├── carbonate.Rproj
├── codecov.yml
├── cran-comments.md
├── docs/
│ ├── 404.html
│ ├── LICENSE-text.html
│ ├── PULL_REQUEST_TEMPLATE.html
│ ├── articles/
│ │ ├── index.html
│ │ └── tests_and_coverage.html
│ ├── authors.html
│ ├── bootstrap-toc.css
│ ├── bootstrap-toc.js
│ ├── docsearch.css
│ ├── docsearch.js
│ ├── index.html
│ ├── pkgdown.css
│ ├── pkgdown.js
│ ├── pkgdown.yml
│ ├── reference/
│ │ ├── browse.html
│ │ ├── carbon.html
│ │ ├── carbon_chrome.html
│ │ ├── carbon_fields.html
│ │ ├── carbon_gecko.html
│ │ ├── carbon_selenium.html
│ │ ├── carbonate.html
│ │ ├── encode.html
│ │ ├── get_carbon.html
│ │ ├── index.html
│ │ ├── options.html
│ │ ├── reprex_to_carbon_browser.html
│ │ ├── rtweet.html
│ │ ├── set_carbon.html
│ │ ├── tiny.html
│ │ ├── tinyurl.html
│ │ └── uri.html
│ └── sitemap.xml
├── hextools/
│ └── create_hex.R
├── inst/
│ └── rstudio/
│ └── addins.dcf
├── man/
│ ├── browse.Rd
│ ├── carbon.Rd
│ ├── carbon_chrome.Rd
│ ├── carbon_fields.Rd
│ ├── carbon_gecko.Rd
│ ├── carbon_selenium.Rd
│ ├── carbonate.Rd
│ ├── encode.Rd
│ ├── get_carbon.Rd
│ ├── options.Rd
│ ├── rtweet.Rd
│ ├── set_carbon.Rd
│ ├── tiny.Rd
│ ├── tinyurl.Rd
│ └── uri.Rd
├── tests/
│ ├── README.md
│ ├── testthat/
│ │ ├── helpers.R
│ │ ├── test-port.R
│ │ ├── test-set.R
│ │ ├── test-uri.R
│ │ └── test-yml.R
│ └── testthat.R
└── vignettes/
├── .gitignore
└── tests_and_coverage.Rmd
================================================
FILE CONTENTS
================================================
================================================
FILE: .Rbuildignore
================================================
^data-raw$
^.*\.Rproj$
^\.Rproj\.user$
^README.Rmd$
^_pkgdown\.yml$
^docs$
^\.travis\.yml$
^codecov\.yml$
^cran-comments\.md$
^\.github$
hextools
^CRAN-RELEASE$
================================================
FILE: .github/ISSUE_TEMPLATE/Bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
```yaml
contents of your carbon.yml file
```
**Expected behavior**
A clear and concise description of what you expected to happen.
**Environment (please complete the following information):**
<details open>
<summary> Session Info </summary>
```r
# paste here the output of devtools::session_info()
```
</details>
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/Feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/ISSUE_TEMPLATE/Question.md
================================================
---
name: Question
about: General Usage Question
---
**The problem**
A clear and concise description of what the problem is. I'm trying to do [...]
**Describe solutions you've considered**
A clear and concise description of any alternative solutions you've considered.
- [ ] I have looked in Stack Overflow for the solution already
**Environment (please complete the following information):**
<details open>
<summary> Session Info </summary>
```r
# paste here the output of devtools::session_info()
```
</details>
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/Tips.md
================================================
---
name: Tips
about: Pro tips to help others
---
**The tip**
A clear and concise description of what you are solving. I'm trying to do [...]
**Reproducible Solution**
```r
# paste here the output of your reprex code
```
**Environment (please complete the following information):**
<details open>
<summary> Session Info </summary>
```r
# paste here the output of devtools::session_info()
```
</details>
**Additional context**
Add any other context about the tip here.
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
Hi, thanks for contributing!
Please make sure you read our CONTRIBUTING guide.
Please fill the fields above:
<!-- If applied, this commit will... -->
<!-- Why is this change being made? -->
<!-- # Provide links to any relevant tickets, URLs or other resources -->
================================================
FILE: .github/stale.yml
================================================
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
================================================
FILE: .github/weekly-digest.yml
================================================
# Configuration for weekly-digest - https://github.com/apps/weekly-digest
publishDay: sun
canPublishIssues: true
canPublishPullRequests: true
canPublishContributors: true
canPublishStargazers: true
canPublishCommits: true
================================================
FILE: .gitignore
================================================
# History files
.Rhistory
.Rapp.history
# Session Data files
.RData
# Example code in package build process
*-Ex.R
# Output files from R CMD build
/*.tar.gz
# Output files from R CMD check
/*.Rcheck/
# RStudio files
.Rproj.user/
# produced vignettes
vignettes/*.html
vignettes/*.pdf
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth
# knitr and R markdown default cache directories
/*_cache/
/cache/
# Temporary files created by R markdown
*.utf8.md
*.knit.md
# Shiny token, see https://shiny.rstudio.com/articles/shinyapps.html
rsconnect/
.Rproj.user
*.DS_Store
hextools/hex
inst/doc
================================================
FILE: .travis.yml
================================================
language: R
sudo: false
cache: packages
addons:
apt:
packages:
- libmagick++-dev
- xclip
after_success:
- Rscript -e 'covr::codecov()'
- Rscript -e 'devtools::install(); covrpage::covrpage_ci(update_badge=FALSE)'
- Rscript -e 'pkgdown::build_article("tests_and_coverage")'
r_github_packages:
- yonicd/covrpage
- yonicd/pkgdown
deploy:
provider: pages
skip-cleanup: true
github-token: "$GITHUB_PAT"
keep-history: true
local-dir: docs
on:
branch: master
env:
global:
secure: paX28Bf7HldCoa6ZPJOJmSrzTqaBKRDhQEVLk6+F1U5G54e+T2JuO6HcV3S61LXAAp31ZfrF9+uCpAhJvpSSjet/vYxJM/CdqII4DkHRbhGRE0KZ+mlVTj4tl56/N19sUsBX7TmTirudwQg1jXLOoDgtYafDFODdYIDI27XlSWbUwuub9tMVeEju+/Cx1nWgU9ABnnmow9Toio06kVNHc1dYAtE1Jhvp7COCzOKQAOS4UYcxvTMTCmEFG9uXzFQSUfr6pQ6lHNX8lSpqUVvDZbDHZEE6AyjG9Gnj0zA0CZWNEQ0HVXuXFPjYOPUVLpJmB6kHbbGuulERw2QZzPVSUFq9SGw3DnpqkexSPp+jVdkS3FGOeLoaItn3mcVyOgmc3KwMTaVUE3J46fUKWHtjqT6X6N1Fx8S5Z2HzPrAdiZGrT3FRXepmorqzzLcn59sDly0tvUJs2oxlVtIQxBKEpWVT/s3YNzfdxfYvVQdXWBFHsbRMU0yYSqKpUmQvE5Lgl8f8QGKas3z2sBd/YCXxGmB5YF+clw8xUx5O0nWUE6rLownlx68NOKRc0/AC4w2ryDOFJp5/5dg49dbLkxe5EsexesLNMvpNZ4vV+72TEpLjvhSyKN4s/QoKlQoZrlS9712j/u7mE6vBOlq+8GYR2XK/xejT3mNV/NWlcsU4fc0=
================================================
FILE: CRAN-RELEASE
================================================
This package was submitted to CRAN on 2020-02-06.
Once it is accepted, delete this file and tag the release (commit 597e31c4a6).
================================================
FILE: DESCRIPTION
================================================
Package: carbonate
Title: Interact with 'carbon.js'
Version: 0.1.4
Authors@R:
person(given = "Jonathan",
family = "Sidi",
role = c("aut", "cre"),
email = "yonicd@gmail.com",
comment = c(ORCID = "0000-0002-4222-1819"))
Description: Create beautiful images of source code using
'carbon.js'<https://carbon.now.sh/about>.
License: MIT + file LICENSE
URL: https://github.com/yonicd/carbonate
BugReports: https://github.com/yonicd/carbonate/issues
Depends:
R (>= 3.2.0)
Imports:
clipr,
details,
httpuv,
httr,
magick,
R6,
RSelenium,
rtweet,
utils,
wdman,
jsonlite,
yaml
Suggests:
covr,
knitr,
rmarkdown,
testthat
VignetteBuilder:
knitr
RdMacros:
details
Encoding: UTF-8
Roxygen: list(markdown = TRUE,old_usage = TRUE,r6 = FALSE)
RoxygenNote: 7.2.1
================================================
FILE: LICENSE
================================================
YEAR: 2018
COPYRIGHT HOLDER: Jonathan Sidi
================================================
FILE: NAMESPACE
================================================
# Generated by roxygen2: do not edit by hand
export(carbon)
export(tinyurl)
importFrom(R6,R6Class)
importFrom(RSelenium,makeFirefoxProfile)
importFrom(RSelenium,rsDriver)
importFrom(clipr,read_clip)
importFrom(clipr,write_clip)
importFrom(details,details)
importFrom(httpuv,randomPort)
importFrom(httr,GET)
importFrom(httr,content)
importFrom(httr,http_error)
importFrom(jsonlite,parse_json)
importFrom(magick,image_read)
importFrom(magick,image_write)
importFrom(rtweet,post_tweet)
importFrom(utils,browseURL)
importFrom(utils,capture.output)
importFrom(wdman,chrome)
importFrom(wdman,gecko)
importFrom(yaml,as.yaml)
importFrom(yaml,read_yaml)
================================================
FILE: R/carbon.R
================================================
#' @title Carbon R6 class
#' @description The Carbon generator creates a new `Carbon`-object, which is the class containing
#' all the app logic. The class is based on the [R6][R6::R6Class] OO-system and
#' is thus reference-based with methods and data attached to each object, in
#' contrast to the more well known S3 and S4 systems.
#' @format NULL
#' @usage NULL
#' @section Initialization:
#' A new 'Carbon'-object is initialized using the `new()` method on the generator:
#'
#' \tabular{l}{
#' `x <- carbon$new(code = clipr::read_clip())`
#' }
#'
#'
#' @section Fields:
#'
#' \foldstart{Public Fields}
#'
#' Description of fields of the R6 object that can be set by the user can be found
#' in the following [page][carbonate::carbon-fields].
#'
#' \foldend
#'
#' @section Methods:
#'
#' \foldstart{Interacting with Browser}
#'
#' \tabular{ll}{
#' [$carbonate][carbonate::carbon-carbonate] \tab Using RSelenium fetch the carbon image output \cr
#' [$browse][carbonate::.browse] \tab open [$uri][carbonate::carbon-uri] in the browser
#' }
#'
#' \foldend
#'
#'
#' \foldstart{ Aesthetics }
#'
#' \tabular{ll}{
#' [$set_template][carbonate::carbon-set-fields] \tab set $template \cr
#' [$get_templates][carbonate::carbon-get-fields] \tab get a list of possible templates \cr
#' [$set_window_control_theme][carbonate::carbon-set-fields] \tab set $windows_control_theme \cr
#' [$get_windows_control_themes][carbonate::carbon-get-fields] \tab get a list of possible window control themes\cr
#' [$set_font_family][carbonate::carbon-set-fields] \tab set $font_family\cr
#' [$get_font_families][carbonate::carbon-get-fields] \tab get a list of possible fonts
#' }
#'
#' \foldend
#'
#' \foldstart{ URI Building }
#'
#' \tabular{ll}{
#' [$uri][carbonate::carbon-uri] \tab construct valid carbon.js uri \cr
#' [$options][carbonate::carbon-options] \tab return all current carbon options\cr
#' [$encode][carbonate::carbon-encode] \tab URL encode a string for the $uri \cr
#' [$tiny][carbonate::carbon-tinyurl] \tab Create tinyurl from [$uri][carbonate::carbon-uri] \cr
#' [$rtweet][carbonate::carbon-rtweet] \tab Send tweets containing media generated from carbon
#' }
#'
#' \foldend
#'
#' \foldstart{ Webdriver Settings }
#'
#' \tabular{ll}{
#' [$chromeOptions][carbonate::carbon-chrome] \tab construct a chromeOptions object \cr
#' [$chrome_start][carbonate::carbon-chrome] \tab start a chrome session \cr
#' [$chrome_stop][carbonate::carbon-chrome] \tab stop a chrome session \cr
#' [$start][carbonate::carbon-selenium] \tab start a RSelenium session \cr
#' [$stop][carbonate::carbon-selenium] \tab stop a RSelenium session \cr
#' [$stop_all][carbonate::carbon-selenium] \tab stop all active RSelenium sessions \cr
#' [$get_port][carbonate::carbon-selenium] \tab Get active port \cr
#' [$set_port][carbonate::carbon-selenium] \tab Set new port
#' }
#'
#' \foldend
#'
#' @rdname carbon
#' @export
#' @importFrom R6 R6Class
#' @importFrom clipr read_clip
#' @importFrom details details
carbon <- R6::R6Class(
classname = "Carbon",
public = list(
initialize = function(code = clipr::read_clip(), yml = "~/carbon.yml", silent_yml = FALSE) {
self$code <- code
private$parse_yml(yml, silent = silent_yml)
self$set_port()
},
code = NULL,
palette = c(r = 171, g = 184, b = 195, a = 1),
template = "seti",
window_control_theme = "none",
language = "r",
add_drop_shadow = TRUE,
drop_shadow_offset_y = 20,
drop_shadow_blur_radius = 68,
add_window_control = TRUE,
auto_adjust_width = TRUE,
padding_vertical = 48,
padding_horizontal = 32,
add_line_number = FALSE,
font_family = "Hack",
font_size = 14,
line_height_percent = 133,
square_image = FALSE,
relative_export_size = 1,
add_watermark = FALSE,
add_tinyurl = FALSE,
tinyurl_location = "southeast",
tweet = FALSE,
tweet_status = "Created in R using the Carbonate \U0001f4e6",
add_timestamp = FALSE,
maxiter = 20,
carbons = list(),
download_path = tempdir(),
chrome_args = c("--disable-gpu", "--window-size=1280,800"),
chrome_pref = list(
"profile.default_content_settings.popups" = 0L,
"download.prompt_for_download" = FALSE,
"download.directory_upgrade" = TRUE,
"safebrowsing.enabled" = TRUE,
"download.default_directory" = tempdir()
),
firefox_args = c('--width=1280','--height=800','--memory 1024mb','--headless'),
firefox_pref = list(
'browser.download.dir' = tempdir(),
'browser.helperApps.neverAsk.saveToDisk' = 'image/png',
'browser.download.folderList' = 2L,
'browser.download.manager.showWhenStarting' = FALSE
),
rD = NULL,
cDrv = NULL,
set_template = function(template = self$get_templates()[16]) {
.set_template(self, private, template)
},
set_window_control_theme = function(theme = self$get_windows_control_themes()[1]) {
.set_window_control_theme(self, private, theme)
},
set_font_family = function(family = self$get_font_families()[6]) {
.set_font_family(self, private, family)
},
get_windows_control_themes = function() {
.get_windows_control_themes(self, private)
},
get_font_families = function() {
.get_font_families(self, private)
},
get_templates = function() {
.get_templates(self, private)
},
options = function(code = self$code) {
.options(self, private, code)
},
uri = function(code = self$code) {
.uri(self, private, code)
},
browse = function() {
.browse(self, private)
},
chromeOptions = function() {
.chromeOptions(self, private)
},
firefoxOptions = function() {
.firefoxOptions(self, private)
},
driver = 'firefox',
driver_start = function(driver = self$driver) {
.driver_start(self, private, driver)
},
driver_stop = function() {
.driver_stop(self, private)
},
start = function(driver = self$driver) {
obj <- eval(parse(text = sprintf('self$%sOptions()',driver)))
.start(self, private, eCap = obj, driver = driver)
},
stop = function() {
.stop(self, private)
},
stop_all = function() {
.stop_all(self, private)
},
carbonate = function(file = "rcarbon.png", path = self$download_path, code = self$code, rD = self$rD, driver = self$driver) {
.carbonate(self, private, file, path, code, rD, driver)
},
encode = function(URL, reserved = FALSE, repeated = FALSE) {
.encode(self, private, URL, reserved, repeated)
},
tiny = function(clip = FALSE) {
.tiny(self, private, clip)
},
rtweet = function(media, status = self$tweet_status, media_format = c("png", "gif"), ...) {
.rtweet(self, private, media, status, media_format = media_format, ...)
},
set_port = function(port = NULL){
.set_port(self,private,port)
},
get_port = function(){
.get_port(self,private)
}
),
private = list(
temp_dir = tempdir(),
px_vars = c(
"drop_shadow_offset_y",
"drop_shadow_blur_radius",
"padding_vertical",
"padding_horizontal",
"font_size"
),
logical_vars = c(
"add_drop_shadow",
"add_window_control",
"auto_adjust_width",
"add_line_number",
"square_image",
"add_watermark",
"add_timestamp"
),
var_names = c(
palette = "bg",
template = "t",
window_control_theme = "wt",
language = "l",
add_drop_shadow = "ds",
drop_shadow_offset_y = "dsyoff",
drop_shadow_blur_radius = "dsblur",
add_window_control = "wc",
auto_adjust_width = "wa",
padding_vertical = "pv",
padding_horizontal = "ph",
add_line_number = "ln",
font_family = "fm",
font_size = "fs",
line_height_percent = "lh",
square_image = "si",
relative_export_size = "es",
add_watermark = "wm",
add_timestamp = "ts"
),
port = NULL,
rgba = function(x) {
.rgba(self, private, x)
},
add_unit = function(x, unit = "px") {
.add_unit(self, private, x, unit)
},
map_name = function(name) {
.map_name(self, private, name)
},
add_percent = function(value) {
.add_percent(self, private, value)
},
convert_logical = function(value) {
.convert_logical(self, private, value)
},
map = function() {
.map(self, private)
},
parse_yml = function(yml, silent_yml) {
.parse_yml(self, private, yml, silent_yml)
}
)
)
================================================
FILE: R/carbon_fields.R
================================================
#' @title Carbon object fields
#' @description Fields that can be changed in the [Carbon][carbonate::carbon] object
#' @usage NULL
#' @param code character, script to embbed, Default: NULL
#' @param palette numeric, layout pallete, Default: c(r=171,g=184,b=195,a=1)
#' @param template character, layout template, Default: 'seti'
#' @param add_window_control boolean, add/remove window controls (circles on top left corner),
#' Default: TRUE
#' @param window_control_theme character, change window control themes, Default: 'none'
#' @param language character, language, Default: 'r'
#' @param add_drop_shadow boolean, add/remove dropshadow, Default: TRUE
#' @param drop_shadow_offset_y numeric, shadow vertical offset (px), Default: 20
#' @param drop_shadow_blur_radius numeric, shadow blur radius (px), Default: 68
#' @param auto_adjust_width boolean, auto-audjust output width, Default: TRUE
#' @param padding_vertical numeric, vertical padding (px), Default: 48
#' @param padding_horizontal numeric, horizontal padding (px), Default: 32
#' @param add_line_number boolean, add/remove line numbers, Default: FALSE
#' @param font_family character, layout font family, Default: 'Hack'
#' @param font_size numeric, font size (px), Default: 14
#' @param line_height_percent numeric, relative space between lines (percent), Default: 133
#' @param square_image boolean, output image is square, Default: FALSE
#' @param relative_export_size numeric, image size in export relative to what is in
#' the preview (1,2 or 4), Default: 1
#' @param add_watermark boolean, add official carbon.js watermark, Default: FALSE
#' @param add_tinyurl boolean, add tinyurl link to image directing to the carbon page that
#' created the image, Default: FALSE
#' @param tinyurl_location character, string with [gravity][magick::options] value to place the annotate tinyurl
#' address on image, Default: 'southeast'
#' @param tweet boolean, tweet out the image using [post_tweet][rtweet::post_tweet]
#' @param tweet_status character, status to add to the tweet. If add_tinyurl is TRUE then
#' a link to the url will be appended to the status automatically,
#' Default: 'Created in R using the Carbonate (Package Icon)'
#' @param add_timestamp boolean, add timestamp to output filename, Default: FALSE
#' @param carbons list, storage of rendered carbon images, Default: NULL
#' @param download_path character, path to download the images, Default: tempdir()
#' @param chrome_args character, arguments passed to chrome browser, Default:
#' c('--disable-gpu', '--window-size=1280,800')
#' @param chrome_pref list, preferences passed to chrome browser, Default:
#' list("profile.default_content_settings.popups" = 0L,"download.prompt_for_download" = FALSE,"download.default_directory" = tempdir())
#' @param rD RSelenium Driver object
#' @param cDrv Chrome Driver object from wdman
#' @name carbon_fields
#' @rdname carbon_fields
#' @aliases carbon-fields
#' @seealso
#' [carbon][carbonate::carbon]
NULL
================================================
FILE: R/carbonate.R
================================================
#' @title Carbonate script lines to a carbon image
#' @description Main function of the package that invokes RSelenium to open
#' a browser to the carbon.js uri, create an image and download the file.
#' @param self carbon self object
#' @param private carbon private object
#' @param file character, name of file to save image as
#' @param path character, path to save the image
#' @param code character, lines of script to make carbon image from
#' @param rD RSelenium driver
#' @param driver character, select either 'firefox' or 'chrome' driver
#' @details Script is passed to <https://carbon.now.sh/> is downloaded to the `tempdir()` and appended to the list [$carbons][carbonate::carbon-fields] using RSelenium and Chrome.
#' @return image object
#' @examples
#' if(interactive()){
#' x <- carbon$new('x <- 1')
#' x$carbonate()
#' }
#' @seealso
#' [carbon][carbonate::carbon], [rsDriver][RSelenium::rsDriver]
#' @rdname carbonate
#' @aliases carbon-carbonate carbonate
#' @importFrom magick image_read
#' @importFrom utils capture.output
#' @importFrom rtweet post_tweet
.carbonate <- function(self, private, file, path, code, rD, driver) {
this_uri <- self$uri(code = code)
path <- normalizePath(path,mustWork = FALSE)
device <- gsub("^(.*?)\\.", "", basename(file))
if(!dir.exists(path)){
message(sprintf('creating directory: %s', path))
dir.create(path)
}
if (file.exists(file.path(path, sprintf("carbon.%s", device)))) {
unlink(file.path(path, sprintf("carbon.%s", device)), force = TRUE)
}
if (is.null(rD)) {
message(sprintf("starting %s session...", driver))
self$start()
rD <- self$rD
}
if (length(rD$client$getSessions()) == 0) {
invisible(utils::capture.output(rD$client$open()))
}
on.exit({
rD$client$close()
}, add = TRUE)
remDr <- rD$client
# remDr$queryRD(
# ipAddr = file.path(remDr$serverURL,"session",
# remDr$sessionInfo[["id"]],
# "chromium/send_command"),
# method = "POST",
# qdata = list(
# cmd = "Page.setDownloadBehavior",
# params = list(
# behavior = "allow",
# downloadPath = path
# )
# )
# )
remDr$navigate(this_uri)
asyncr(remDr,
using = "xpath",
value = '//*[@id="export-menu"]',
maxiter = self$maxiter
)
asyncr(remDr,
using = "xpath",
value = sprintf('//*[@id="export-%s"]', device),
maxiter = self$maxiter
)
file.timeout(private$temp_dir,device)
if (file.exists(file.path(private$temp_dir, sprintf("rcarbon.%s", device)))) {
unlink(file.path(private$temp_dir, sprintf("rcarbon.%s", device)), force = TRUE)
}
file.rename(file.path(private$temp_dir, sprintf("carbon.%s", device)), file.path(private$temp_dir, sprintf("rcarbon.%s", device)))
file.rename(file.path(private$temp_dir, sprintf("rcarbon.%s", device)), file.path(path, file))
img <- magick::image_read(file.path(path, file))
if (self$add_tinyurl) {
tiny_uri <- self$tiny()
img <- magick::image_annotate(img, text = tiny_uri, gravity = self$tinyurl_location)
magick::image_write(img, file.path(path, file))
self$tweet_status <- sprintf("%s\nCheck out this script at \U0001f517 %s", self$tweet_status, tiny_uri)
}
if (self$tweet) {
if (length(Sys.getenv("TWITTER_SCREEN_NAME")) == 0) {
message("missing Environment Variable: 'TWITTER_SCREEN_NAME'\nskipping tweet \U0001f622")
} else {
self$rtweet(media = file.path(path, file))
}
}
self$carbons <- append(self$carbons, img)
print(img, info = FALSE)
}
================================================
FILE: R/helpers.R
================================================
# @title create rgba call for carbon
# @description combines rbga vector into a string
# @param self carbon self object
# @param private carbon private object
# @param x named character vector
# @return character
.rgba <- function(self, private, x) {
sprintf("rgba(%s,%s,%s,%s)", x[["r"]], x[["g"]], x[["b"]], x[["a"]])
}
# @title make a unit character
# @description combines a number with a unit
# @param self carbon self object
# @param private carbon private object
# @param x numeric, value
# @param unit character, the unit
# @return character
.add_unit <- function(self, private, x, unit) {
sprintf("%s%s", x, unit)
}
# @title map carbon R6 field to uri field
# @description map the field used in the R6 object into the uri field
# carbon.js uses.
# @param self carbon self object
# @param private carbon private object
# @param name name of carbon R6 field
# @return character
.map_name <- function(self, private, name) {
private$var_names[[name]]
}
# @title escape percent for carbon
# @description suffix string with %25
# @param self carbon self object
# @param private carbon private object
# @param value character, character to combine string to
.add_percent <- function(self, private, value) {
sprintf("%s%%25", value)
}
# @title convert logical to carbon logical
# @description convert logical to lower case character
# @param self carbon self object
# @param private carbon private object
# @param value boolean, value to lower
# @return character
.convert_logical <- function(self, private, value) {
tolower(as.character(value))
}
# @title map name to function
# @description map name of private method to constructors
# @param self carbon self object
# @param private carbon private object
# @return list
.map <- function(self, private) {
l <- lapply(names(private$var_names), function(x) {
val <- self[[x]]
if (x == "template") {
if (!self[[x]] %in% self$get_templates()) {
stop(sprintf(
"template not valid: %s\nUse the method get_templates() to choose a valid one",
self[[x]]
))
}
val <- gsub("\\s", "%20", self[[x]])
}
if (x == "font_family") {
val <- gsub("\\s", "%20", self[[x]])
}
if (x == "palette") {
val <- gsub("[,]", "%2C", private$rgba(self[[x]]))
}
if (x == "line_height_percent") {
val <- private$add_percent(self[[x]])
}
if (x %in% "relative_export_size") {
val <- private$add_unit(self[[x]], unit = "x")
}
if (x %in% private$px_vars) {
val <- private$add_unit(self[[x]])
}
if (x %in% private$logical_vars) {
val <- private$convert_logical(self[[x]])
}
assign(private$var_names[[x]], value = val)
})
names(l) <- unlist(private$var_names)
l
}
# https://goo.gl/jFqKfS
asyncr <- function(remDr, using, value, action = NULL, maxiter = 20) {
elem <- NULL
i <- 0
while (is.null(elem) & (i <= maxiter)) {
elem <- tryCatch({
remDr$findElement(using = using, value = value)
},
error = function(e) {
NULL
}
)
Sys.sleep(0.02 * (i + 1))
i <- i + 1
}
if (is.null(elem) && i >= maxiter) {
# assuming this means timed out
stop("attempt to fetch image from carbon servers failed,
please check network connectivity and try again",
call. = FALSE
)
}
elem$clickElement()
}
file.timeout <- function(path, device, maxiter = 20) {
file_found <- FALSE
i <- 0
while (!file_found & (i <= maxiter)) {
file_found <- file.exists(file.path(path, sprintf("carbon.%s", device)))
Sys.sleep(0.02 * (i + 1))
i <- i + 1
}
if (i >= maxiter) {
# assuming this means timed out
stop("Could not find file in download path,
please check network connectivity and try again",
call. = FALSE
)
}
}
#' @importFrom yaml read_yaml as.yaml
.parse_yml <- function(self, private, yml = "~/carbon.yml", silent = FALSE) {
if (!is.null(yml)) {
if (file.exists(yml)) {
y <- yaml::read_yaml(yml)
ny <- names(y)
idx <- which(ny %in% names(self))
if (length(idx) > 0) {
if ("palette" %in% ny) {
y[["palette"]] <- check_palette_yml(x = y[["palette"]], self)
}
y <- check_get(y, self, silent = silent)
ny <- names(y)
idx <- which(ny %in% names(self))
y <- y[idx]
for (i in seq_along(y)) {
self[[ny[i]]] <- y[[i]]
}
if (!silent) {
cat(sprintf("Set via '%s'\n", yml), yaml::as.yaml(y), sep = "")
}
}
}
}
}
check_palette_yml <- function(x, self = self) {
x <- unlist(x, use.names = TRUE)
if (is.null(names(x))) {
names(x) <- c("r", "g", "b", "a")[1:length(x)]
}
np <- names(x)
x <- x[np %in% c("r", "g", "b", "a")]
sp <- self[["palette"]]
sp[np] <- x
x <- sp
}
check_get <- function(y, self = self, silent = FALSE) {
rmx <- c()
for (x in c("template", "font_family", "windows_control_theme")) {
if (x %in% names(y)) {
if (!y[[x]] %in% self[[find_get(x, self)]]()) {
y[[x]] <- NULL
rmx <- c(rmx, x)
}
}
}
if (length(rmx) > 0) {
if (!silent) {
message(sprintf(
"invalid value for the fields in the yml (ignored on load):\n%s",
paste0(rmx, collapse = ", ")
))
}
}
return(y)
}
find_get <- function(x, self = self) {
names(self)[startsWith(names(self), sprintf("get_%s", gsub("_(.*?)$", "", x)))]
}
#' @importFrom httpuv randomPort
.random_port <- function(self = self, private = private) {
httpuv::randomPort()
}
#' @importFrom jsonlite parse_json
query_defaults <- function(type = "FONTS") {
con_lines <- readLines('https://raw.githubusercontent.com/carbon-app/carbon/main/lib/constants.js')
# Collapse to single string
con_lines_collapse <- paste0(con_lines, collapse = "")
con_lines_collapse <- gsub(",\\]", "\\]", con_lines_collapse)
# Find and extract type
l_matches <- gregexpr(sprintf("\\b%s\\b(.*?)\\]", type), con_lines_collapse)
l_raw <- regmatches(con_lines_collapse, l_matches)[[1]][[1]]
l_raw <- gsub(sprintf("%s(.*?)= ", type), "", l_raw)
# Clean up trailing commas and whitespaces
l_raw <- gsub("\\s+", " ", l_raw)
l_raw <- gsub("\\}, \\}", "\\}\\}", l_raw)
l_raw <- gsub(",\\s*", ",", l_raw)
l_raw <- gsub(",\\s*\\}", "\\}", l_raw)
l_raw <- gsub("\\{\\s", "\\{", l_raw)
# Replace name of elements with quoted names
find_l <- regmatches(l_raw,gregexpr("[{,](.*?):", l_raw))
old_chr <- unique(gsub("[ {:,]", "", find_l[[1]]))
new_chr <- sprintf('"%s":', old_chr)
block_chr <- sprintf("\\b%s\\b:", old_chr)
l_out <- l_raw
for(i in seq(length(old_chr))) {
l_out <- gsub(block_chr[i], new_chr[i], l_out)
}
#Fix syntax problems
l_out <- gsub("' :", '" :', l_out)
l_out <- gsub(": '", ': "', l_out)
l_out <- gsub("\\{ '", '\\{ "', l_out)
l_out <- gsub("' \\}", '" \\}', l_out)
l_out <- gsub("'\\}", '"\\}', l_out)
l_out <- gsub("',", '",', l_out)
l_out <- gsub(",'", ',"', l_out)
l_out <- gsub(":'", ':"', l_out)
l_out <- gsub('-"', "-", l_out)
l_out <- gsub('""', '"', l_out)
# Convert to list
jsonlite::parse_json(l_out)
}
================================================
FILE: R/selenium_functions.R
================================================
#' @title chrome webdriver functions
#' @description Functions to open,close,set chrome webdriver
#' @param self carbon self object
#' @param private carbon private object
#' @rdname carbon_chrome
#' @aliases carbon-chrome
#' @seealso
#' [carbon][carbonate::carbon], [chrome][wdman::chrome]
.chromeOptions <- function(self, private) {
list(chromeOptions = list(args = self$chrome_args, prefs = self$chrome_pref))
}
#' @title gecko webdriver functions
#' @description Functions to open,close,set gecko webdriver
#' @param self carbon self object
#' @param private carbon private object
#' @rdname carbon_gecko
#' @aliases carbon-gecko
#' @seealso
#' [carbon][carbonate::carbon], [gecko][wdman::gecko]
.firefoxOptions <- function(self, private) {
append(
RSelenium::makeFirefoxProfile(self$firefox_pref),
list( "moz:firefoxOptions" = list(args = self$firefox_args))
)
}
#' @title RSelenium webdriver functions
#' @description Functions to open,stop, stop_all RSelenium sessions
#' @param self carbon self object
#' @param private carbon private object
#' @param eCap chromeOptions passed into [rsDriver][RSelenium::rsDriver]
#' @param driver character, select either 'firefox' or 'chrome' driver
#' @rdname carbon_selenium
#' @aliases carbon-selenium
#' @seealso
#' [carbon][carbonate::carbon]
#' @importFrom RSelenium rsDriver makeFirefoxProfile
.start <- function(self, private, eCap, driver = c("firefox", "chrome")) {
driver <- match.arg(driver, c("firefox", "chrome"))
if (is.null(self$cDrv)) {
self$driver_start(driver)
}
self$rD <- RSelenium::rsDriver(
browser = driver,
verbose = FALSE,
port = private$port,
extraCapabilities = eCap
)
}
#' @rdname carbon_selenium
#' @importFrom wdman gecko chrome
.driver_start <- function(self, private, driver = c("chrome", "firefox")) {
driver <- match.arg(driver, c("chrome", "firefox"))
self$cDrv <- switch(driver,
chrome = wdman::chrome(port = private$port),
firefox = wdman::gecko(port = private$port)
)
}
#' @rdname carbon_selenium
.driver_stop <- function(self, private) {
self$cDrv$stop()
}
#' @rdname carbon_selenium
.stop <- function(self, private) {
self$rD$client$close()
self$driver_stop()
}
#' @rdname carbon_selenium
.stop_all <- function(self, private) {
self$rD$client$closeall()
self$driver_stop()
}
#' @rdname carbon_selenium
#' @param port integer, port for the [rsDriver][RSelenium::rsDriver] to use,
#' if NULL then a random port is selected
.set_port <- function(self, private, port = NULL){
if(!is.null(private$port))
private$port
if(is.null(port)){
private$port <- .random_port(self, private)
}else{
private$port <- as.integer(port)
}
}
#' @rdname carbon_selenium
.get_port <- function(self, private){
private$port
}
================================================
FILE: R/set_get_functions.R
================================================
#' @title carbon set functions
#' @description function that set the aesthetics of the carbon image output
#' @param self carbon self object
#' @param private carbon private object
#' @param template character, name of template to set [$template][carbonate::carbon-fields] to
#' @param theme character, theme to set [$theme][carbonate::carbon-fields] to
#' @param family character, font family to set [$font_family][carbonate::carbon-fields] to
#' @rdname set_carbon
#' @aliases carbon-set-fields
#' @seealso
#' [carbon][carbonate::carbon]
.set_template <- function(self, private, template) {
self$template <- template
}
#' @rdname set_carbon
.set_window_control_theme <- function(self, private, theme) {
self$window_control_theme <- theme
}
#' @rdname set_carbon
.set_font_family <- function(self, private, family) {
self$font_family <- family
}
#' @title carbon get functions
#' @description function that gets the available list of aesthetic values of fields
#' @param self carbon self object
#' @param private carbon private object
#' @rdname get_carbon
#' @aliases carbon-get-fields
#' @seealso
#' [carbon][carbonate::carbon]
.get_windows_control_themes <- function(self, private) {
c("none", "sharp", "bw")
}
#' @rdname get_carbon
.get_font_families <- function(self, private) {
# c("Anonymous Pro", "Droid Sans Mono", "Fantasque Sans Mono",
# "Fira Code", "Hack", "IBM Plex Mono", "Inconsolata", "Iosevka",
# "JetBrains Mono", "Monoid", "Source Code Pro", "Space Mono",
# "Ubuntu Mono")
sapply(query_defaults('FONTS'),'[[',2)
}
#' @rdname get_carbon
.get_templates <- function(self, private) {
# c("3024-night", "a11y-dark", "blackboard", "base16-dark", "base16-light",
# "cobalt", "dracula", "duotone-dark", "hopscotch", "lucario",
# "material", "monokai", "night-owl", "nord", "oceanic-next", "one-light",
# "one-dark", "panda-syntax", "paraiso-dark", "seti", "shades-of-purple",
# "solarized dark", "solarized light", "synthwave-84", "twilight",
# "verminal", "vscode", "yeti", "zenburn")
sapply(query_defaults('THEMES'),'[[',1)
}
================================================
FILE: R/uri_functions.R
================================================
#' @title concatenate the carbon options to a string
#' @description combine all the carbon options into a carbon.js valid string
#' @param self carbon self object
#' @param private carbon private object
#' @param code character, script to embbed into the uri
#' @return OUTPUT_DESCRIPTION
#' @rdname options
#' @aliases carbon-options
#' @seealso
#' [carbon][carbonate::carbon]
.options <- function(self, private, code) {
l <- private$map()
s <- paste0(sapply(names(l), function(x) sprintf("%s=%s", x, l[[x]])), collapse = "&")
code <- paste0(code, collapse = "\n")
sprintf("%s&code=%s", s, self$encode(code))
}
#' @title URI constructor
#' @description Function that is called in a carbon object to construct valid uri to send to browser
#' @param self carbon self object
#' @param private carbon private object
#' @param code character, script to embbed into the uri
#' @examples
#' if(interactive()){
#'
#' x <- carbon$new('x <- 1')
#'
#' # populate from self$code
#' x$uri()
#'
#' # enter manually
#' x$uri(code = 'x <- y + 3')
#'
#' }
#' @rdname uri
#' @aliases carbon-uri
#' @seealso
#' [carbon][carbonate::carbon]
.uri <- function(self, private, code) {
sprintf("https://carbon.now.sh/?%s", self$options(code = code))
}
#' @title open $uri to in browser window
#' @description opens the uri address in [$uri][carbonate::carbon-uri] in the browser window.
#' @param self carbon self object
#' @param private carbon private object
#' @examples
#' x <- carbon$new('x <- 1')
#' if(interactive())
#' x$browse()
#'
#' @rdname browse
#' @aliases carbon-browse
#' @importFrom utils browseURL
#' @seealso
#' [carbon][carbonate::carbon]
.browse <- function(self, private) {
utils::browseURL(self$uri())
}
#' @title encode uri for carbon.js
#' @description encode uri string for carbon.js.
#' Augmented version of than [URLencode][utils::URLencode]
#' @param self carbon self object
#' @param private carbon private object
#' @param URL character, uri string to url encode
#' @param reserved boolean, should ‘reserved’ characters be encoded?
#' @param repeated boolean, should apparently already-encoded URLs be encoded again?
#' @return character
#' @seealso [URLencode][utils::URLencode], [carbon][carbonate::carbon]
#' @rdname encode
#' @aliases carbon-encode
.encode <- function(self, private, URL, reserved, repeated) {
if (!repeated && grepl("%[[:xdigit:]]{2}", URL, useBytes = TRUE)) {
return(URL)
}
OK <- paste0(
"[^", if (!reserved) {
"][!();?"
} , "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz0123456789._~-",
"]"
)
x <- strsplit(URL, "")[[1L]]
z <- grep(OK, x)
z <- sort(c(z, which(x %in% c("[", "]"))))
if (length(z)) {
y <- sapply(x[z], function(x) paste0("%25", toupper(as.character(charToRaw(x))),
collapse = ""
))
y <- gsub("%2527", "%27", y)
x[z] <- y
}
paste(x, collapse = "")
}
#' @title convert carbon uri to tinyurl
#' @description convert carbon uri to tinyurl with option to attach to clipboard.
#' @param self carbon self object
#' @param private carbon private object
#' @param clip boolean, write tinyurl to clipboard, Default: FALSE
#' @details If clip is set to TRUE [write_clip][clipr::write_clip] will put the
#' tinyurl on the clipboard.
#' @return character
#' @importFrom clipr write_clip
#' @rdname tiny
#' @aliases carbon-tinyurl
.tiny <- function(self, private, clip = FALSE) {
RET <- tinyurl(self$uri())
if (clip) {
clipr::write_clip(RET)
}
return(RET)
}
#' @title send tweets using carbonate outputs
#' @description wrapper for [post_tweet][rtweet::post_tweet] to send
#' tweets with media created using carbonate.
#' @param self carbon self object
#' @param private carbon private object
#' @param media magick-image object or path to image
#' @param status character, status to attach to post, Default: self$tweet_status
#' @param media_format character, type of media to tweet, Default: c('png','gif')
#' @param \dots arguments to pass to [post_tweet][rtweet::post_tweet]
#' @return outcome from rtweet
#' @details If multiple images are passed they can be either converted to a gif by
#' setting media_format to 'gif' or attached each one to the post.
#' @examples
#' \dontrun{
#' x <- carbonate::carbon$new()
#' x$carbonate(code = readLines(system.file('DESCRIPTION',package='carbonate')))
#' x$carbonate(code = 'x+2')
#'
#' # using default status value (x$tweet_status)
#' x$rtweet(system.file('figures/hex_black_small.png',package='carbonate'))
#'
#' x$rtweet(status = 'these are two pngs',media = x$carbons,media_format='png')
#' x$rtweet(status = 'this is a gif', media = x$carbons,media_format='gif')
#'
#' }
#' @seealso
#' [image_write][magick::image_write]
#' [post_tweet][rtweet::post_tweet]
#' @rdname rtweet
#' @aliases carbon-rtweet
#' @importFrom magick image_write
#' @importFrom rtweet post_tweet
.rtweet <- function(self,
private,
media,
status = self$tweet_status,
media_format = c("png", "gif"),
...) {
td <- file.path(tempdir(), "rtweet_media")
mf <- match.arg(media_format)
dir.create(td, showWarnings = FALSE)
on.exit(unlink(td, recursive = TRUE, force = TRUE), add = TRUE)
if (inherits(media, "magick-image")) {
if (mf == "gif") {
anim <- magick::image_animate(media, fps = 1)
magick::image_write(
image = anim,
path = file.path(td, sprintf("img01.%s", mf)),
format = mf
)
} else {
invisible(
lapply(seq_along(media), function(x) {
magick::image_write(
image = media[x],
path = file.path(td, sprintf("img%02d.%s", x, mf)),
format = mf
)
})
)
}
tds <- list.files(td, full.names = TRUE)
} else {
tds <- media
}
rtweet::post_tweet(status = status, media = tds, ...)
}
#' @title convert uri to tinyurl
#' @description convert uri to tinyurl.
#' @param uri character, the uri to convert
#' @return character
#' @importFrom httr http_error content GET
#' @export
tinyurl <- function(uri){
host <- 'tinyurl.com'
if(!httr::http_error(host)){
base <- sprintf('http://%s/api-create.php',host)
uri <- httr::content(httr::GET(sprintf('%s?url=%s',base,uri)))
}
uri
}
================================================
FILE: README.Rmd
================================================
---
output: github_document
always_allow_html: yes
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE,message=FALSE,warning=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/"
)
library(magick)
```
[](https://cran.r-project.org/package=carbonate)
[](https://cran.r-project.org/package=carbonate)
[](https://travis-ci.org/yonicd/carbonate)
[](https://codecov.io/github/yonicd/carbonate?branch=master)
[](https://goo.gl/gNRcCb)
"[carbon.js](https://carbon.now.sh/about) is the easiest way to create beautiful images of your source code."
This package uses an `R6` api to interact with carbon.js and create directly from the console carbon images.
Like the image below:
```{r,include=FALSE}
library(carbonate)
x <- carbon$new(readLines('DESCRIPTION'))
x$carbonate(file = 'myfile.png',path = 'man/figures')
```
```{r, echo=FALSE}
x$carbons
```
## Installation
```{r,eval= FALSE}
#remotes::install_github('yonicd/carbonate')
install.packages('carbonate')
```
## Usage
### Initialize new carbon object
```{r,eval = FALSE}
library(carbonate)
```
The default code in the carbon object is taken from the clipboard.
```{r,eval = FALSE}
x <- carbon$new()
```
But can also be defined inline. Code can be a character object of any length.
```{r, eval = FALSE}
x <- carbon$new(readLines('DESCRIPTION'))
```
The code is kept in the object and can be changed at any time.
```{r}
x$code
```
The main job of the R6 object is to convert all the options into a uri that is sent to the carbon url page, where it is processed.
```{r}
x$uri()
```
Click the [link](`r x$uri()`) to see the URI works.
### Manipulate carbon object
Aesthetics of the carbon object that can be manipulated
|Carbon Variable |Carbonate Variable |Description | Default |
|:------:|:-----------------------|:-----------|:----:|
|l |language |language |r|
|bg |palette |layout pallete (vector with c(r,g,b,a)|c(r=171,g=184,b=195,a=1)|
|t |template |layout template (listed in get_templates()) |'seti'|
|wc |add_window_control |add/remove window controls (circles on top left corner) |TRUE|
|wt |window_control_theme |change window control themes (listed in get_windows_control_themes()) |'none'|
|ds |add_drop_shadow |add/remove dropshadow |TRUE|
|dsyoff |drop_shadow_offset_y |shadow vertical offset (px) |20|
|dsblur |drop_shadow_blur_radius |shadow blur radius (px) |68|
|wa |auto_adjust_width |auto-audjust output width |TRUE|
|pv |padding_vertical |vertical padding (px) |48|
|ph |padding_horizontal |horizontal padding (px) |32|
|ln |add_line_number |add/remove line numbers |FALSE|
|fm |font_family |layout font family (listed in get_font_families()) |'Hack'|
|fs |font_size |font size (px) |14|
|lh |line_height_percent |relative space between lines (percent) |133|
|si |square_image |output image is square |FALSE|
|es |relative_export_size |image size in export relative to what is in the preview (1,2 or 4) |1|
|wm |add_watermark |add official carbon.js watermark |FALSE|
```{r}
x$get_templates()
```
```{r}
x$get_font_families()
```
```{r}
x$get_windows_control_themes()
```
### Personal Configuration
Users can use a file called `carbon.yml` and place it in their home directory (`~`) to override the packages defaults in order to create a session peristent carbon template they like. The config file controls all the [public carbon object fields](#manipulate-carbon-object). The following is an example of such a configuration file.
These fields will set
- The palette (rgba) `g` and `a` fields to 175 and 0.7 respectively
- The template will be set to `panda-syntax`
- The font to `Fira Code`
- The padding around the output will be made tighter than the system defaults 11px and 14px.
```yml
palette:
- g: 175.0
- a: 0.7
template: panda-syntax
font_family: Fira Code
padding_vertical: 11
padding_horizontal: 14
```
### Open carbon code in browser
```{r,eval=FALSE}
x$browse()
```
### Set the download directory
```{r,eval = FALSE}
x$download_path <- file.path('README_files/download')
```
### Carbonate code directly to file
This function depends on RSelenium
```{r,eval = FALSE}
x$carbonate(file = 'myfile.png')
```
```{r, echo=FALSE}
x$carbons
```
```{r,echo=FALSE}
Sys.sleep(2)
```
```{r}
x$template <-'cobalt'
x$carbonate(file = 'new_template.png')
```
```{r,echo=FALSE}
Sys.sleep(2)
```
```{r}
x$font_family <-'IBM Plex Mono'
x$carbonate(file = 'new_font.png')
```
### Carbonate code directly to file in specific directory
```{r,echo=FALSE}
Sys.sleep(2)
```
### Closing Browsers
Closing all instances of open browsers used by RSelenium.
```r
x$stop_all()
```
### Sharing
<details><summary>Tinyurl</summary>
You can also put a tinyurl link as a watermark on the image produced that will open to the carbon.now.sh page that has the code in the image.
```{r,echo=FALSE}
Sys.sleep(2)
```
```{r}
x$add_tinyurl <- TRUE
x$carbonate(file = 'tiny_url.png')
```
If you just want the tinyurl link without the image to use in a tweet you can create it using
```{r}
x$tiny()
```
Or you can put the link directly on your clipboard
```{r, eval = interactive()}
x$tiny(clip = TRUE)
clipr::read_clip()
```
</details>
<details><summary>Twitter</summary>
##### Direct
You can also directly tweet the image. An automatic status is created with two options
- Default
- `r 'Created in R using the Carbonate \U0001f4e6'`
- When `add_tinyurl <- TRUE`
- `r sprintf('%s\nCheck out this script at \U0001f517 %s', 'Created in R using the Carbonate \U0001f4e6', x$tiny())`
- Manual
- Using `tweet_status` you can write your own status.
```{r,eval=FALSE}
x <- carbonate::carbon$new()
x$tweet <- TRUE
x$carbonate()
```
##### Post process (Batch)
If you have images stored in `x$carbons` you can post them also in a tweet using.
```{r,eval = FALSE}
# for multiple png attachments
x$rtweet(x$carbons,media_type = 'png') #using default status
# subsets of images
x$rtweet(status='These are images',x$carbons[c(1,3)],media_type = 'png')
# for gifs
x$rtweet(status='This is a gif', x$carbons,media_type = 'gif')
```
</details>
### Post image processing
All carbon outputs are collected and saved in the list `x$carbons`
<details><summary>Combining</summary>
```{r}
x$carbons%>%
magick::image_scale('300')%>%
magick::image_append()
x$carbons%>%
magick::image_scale('300')%>%
magick::image_append(stack = TRUE)
```
</details>
<details><summary>GIFs</summary>
```{r}
x$carbons%>%
magick::image_animate(fps = 1)
```
</details>
================================================
FILE: README.md
================================================
<!-- README.md is generated from README.Rmd. Please edit that file -->
[](https://cran.r-project.org/package=carbonate)
[](https://cran.r-project.org/package=carbonate)
[](https://travis-ci.org/yonicd/carbonate)
[](https://codecov.io/github/yonicd/carbonate?branch=master)
[](https://goo.gl/gNRcCb)
“[carbon.js](https://carbon.now.sh/about) is the easiest way to create
beautiful images of your source code.”
This package uses an `R6` api to interact with carbon.js and create
directly from the console carbon images.
Like the image below:
<!-- -->
## Installation
``` r
#remotes::install_github('yonicd/carbonate')
install.packages('carbonate')
```
## Usage
### Initialize new carbon object
``` r
library(carbonate)
```
The default code in the carbon object is taken from the clipboard.
``` r
x <- carbon$new()
```
But can also be defined inline. Code can be a character object of any
length.
``` r
x <- carbon$new(readLines('DESCRIPTION'))
```
The code is kept in the object and can be changed at any time.
``` r
x$code
#> [1] "Package: carbonate"
#> [2] "Title: Interact with 'carbon.js'"
#> [3] "Version: 0.1.4"
#> [4] "Authors@R: "
#> [5] " person(given = \"Jonathan\","
#> [6] " family = \"Sidi\","
#> [7] " role = c(\"aut\", \"cre\"),"
#> [8] " email = \"yonicd@gmail.com\","
#> [9] " comment = c(ORCID = \"0000-0002-4222-1819\"))"
#> [10] "Description: Create beautiful images of source code using"
#> [11] " 'carbon.js'<https://carbon.now.sh/about>."
#> [12] "License: MIT + file LICENSE"
#> [13] "URL: https://github.com/yonicd/carbonate"
#> [14] "BugReports: https://github.com/yonicd/carbonate/issues"
#> [15] "Depends: "
#> [16] " R (>= 3.2.0)"
#> [17] "Imports: "
#> [18] " clipr,"
#> [19] " details,"
#> [20] " httpuv,"
#> [21] " httr,"
#> [22] " magick,"
#> [23] " R6,"
#> [24] " RSelenium,"
#> [25] " rtweet,"
#> [26] " utils,"
#> [27] " wdman,"
#> [28] " jsonlite,"
#> [29] " yaml"
#> [30] "Suggests: "
#> [31] " covr,"
#> [32] " knitr,"
#> [33] " rmarkdown,"
#> [34] " testthat"
#> [35] "VignetteBuilder: "
#> [36] " knitr"
#> [37] "RdMacros: "
#> [38] " details"
#> [39] "Encoding: UTF-8"
#> [40] "Roxygen: list(markdown = TRUE,old_usage = TRUE,r6 = FALSE)"
#> [41] "RoxygenNote: 7.2.1"
```
The main job of the R6 object is to convert all the options into a uri
that is sent to the carbon url page, where it is processed.
``` r
x$uri()
#> [1] "https://carbon.now.sh/?bg=rgba(171%2C175%2C195%2C0.7)&t=panda-syntax&wt=none&l=r&ds=true&dsyoff=20px&dsblur=68px&wc=true&wa=true&pv=11px&ph=14px&ln=false&fm=Fira%20Code&fs=14px&lh=133%25&si=false&es=1x&wm=false&ts=false&code=Package%253A%2520carbonate%250ATitle%253A%2520Interact%2520with%2520%27carbon.js%27%250AVersion%253A%25200.1.4%250AAuthors%2540R%253A%2520%250A%2520%2520%2520%2520person(given%2520%253D%2520%2522Jonathan%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520family%2520%253D%2520%2522Sidi%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520role%2520%253D%2520c(%2522aut%2522%252C%2520%2522cre%2522)%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520email%2520%253D%2520%2522yonicd%2540gmail.com%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520comment%2520%253D%2520c(ORCID%2520%253D%2520%25220000-0002-4222-1819%2522))%250ADescription%253A%2520Create%2520beautiful%2520images%2520of%2520source%2520code%2520using%250A%2520%2520%2520%2520%27carbon.js%27%253Chttps%253A%252F%252Fcarbon.now.sh%252Fabout%253E.%250ALicense%253A%2520MIT%2520%252B%2520file%2520LICENSE%250AURL%253A%2520https%253A%252F%252Fgithub.com%252Fyonicd%252Fcarbonate%250ABugReports%253A%2520https%253A%252F%252Fgithub.com%252Fyonicd%252Fcarbonate%252Fissues%250ADepends%253A%2520%250A%2520%2520%2520%2520R%2520(%253E%253D%25203.2.0)%250AImports%253A%2520%250A%2520%2520%2520%2520clipr%252C%250A%2520%2520%2520%2520details%252C%250A%2520%2520%2520%2520httpuv%252C%250A%2520%2520%2520%2520httr%252C%250A%2520%2520%2520%2520magick%252C%250A%2520%2520%2520%2520R6%252C%250A%2520%2520%2520%2520RSelenium%252C%250A%2520%2520%2520%2520rtweet%252C%250A%2520%2520%2520%2520utils%252C%250A%2520%2520%2520%2520wdman%252C%250A%2520%2520%2520%2520jsonlite%252C%250A%2520%2520%2520%2520yaml%250ASuggests%253A%2520%250A%2520%2520%2520%2520covr%252C%250A%2520%2520%2520%2520knitr%252C%250A%2520%2520%2520%2520rmarkdown%252C%250A%2520%2520%2520%2520testthat%250AVignetteBuilder%253A%2520%250A%2520%2520%2520%2520knitr%250ARdMacros%253A%2520%250A%2520%2520%2520%2520details%250AEncoding%253A%2520UTF-8%250ARoxygen%253A%2520list(markdown%2520%253D%2520TRUE%252Cold_usage%2520%253D%2520TRUE%252Cr6%2520%253D%2520FALSE)%250ARoxygenNote%253A%25207.2.1"
```
Click the
[link](https://carbon.now.sh/?bg=rgba(171%2C175%2C195%2C0.7)&t=panda-syntax&wt=none&l=r&ds=true&dsyoff=20px&dsblur=68px&wc=true&wa=true&pv=11px&ph=14px&ln=false&fm=Fira%20Code&fs=14px&lh=133%25&si=false&es=1x&wm=false&ts=false&code=Package%253A%2520carbonate%250ATitle%253A%2520Interact%2520with%2520%27carbon.js%27%250AVersion%253A%25200.1.4%250AAuthors%2540R%253A%2520%250A%2520%2520%2520%2520person(given%2520%253D%2520%2522Jonathan%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520family%2520%253D%2520%2522Sidi%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520role%2520%253D%2520c(%2522aut%2522%252C%2520%2522cre%2522)%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520email%2520%253D%2520%2522yonicd%2540gmail.com%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520comment%2520%253D%2520c(ORCID%2520%253D%2520%25220000-0002-4222-1819%2522))%250ADescription%253A%2520Create%2520beautiful%2520images%2520of%2520source%2520code%2520using%250A%2520%2520%2520%2520%27carbon.js%27%253Chttps%253A%252F%252Fcarbon.now.sh%252Fabout%253E.%250ALicense%253A%2520MIT%2520%252B%2520file%2520LICENSE%250AURL%253A%2520https%253A%252F%252Fgithub.com%252Fyonicd%252Fcarbonate%250ABugReports%253A%2520https%253A%252F%252Fgithub.com%252Fyonicd%252Fcarbonate%252Fissues%250ADepends%253A%2520%250A%2520%2520%2520%2520R%2520(%253E%253D%25203.2.0)%250AImports%253A%2520%250A%2520%2520%2520%2520clipr%252C%250A%2520%2520%2520%2520details%252C%250A%2520%2520%2520%2520httpuv%252C%250A%2520%2520%2520%2520httr%252C%250A%2520%2520%2520%2520magick%252C%250A%2520%2520%2520%2520R6%252C%250A%2520%2520%2520%2520RSelenium%252C%250A%2520%2520%2520%2520rtweet%252C%250A%2520%2520%2520%2520utils%252C%250A%2520%2520%2520%2520wdman%252C%250A%2520%2520%2520%2520jsonlite%252C%250A%2520%2520%2520%2520yaml%250ASuggests%253A%2520%250A%2520%2520%2520%2520covr%252C%250A%2520%2520%2520%2520knitr%252C%250A%2520%2520%2520%2520rmarkdown%252C%250A%2520%2520%2520%2520testthat%250AVignetteBuilder%253A%2520%250A%2520%2520%2520%2520knitr%250ARdMacros%253A%2520%250A%2520%2520%2520%2520details%250AEncoding%253A%2520UTF-8%250ARoxygen%253A%2520list(markdown%2520%253D%2520TRUE%252Cold_usage%2520%253D%2520TRUE%252Cr6%2520%253D%2520FALSE)%250ARoxygenNote%253A%25207.2.1)
to see the URI works.
### Manipulate carbon object
Aesthetics of the carbon object that can be manipulated
| Carbon Variable | Carbonate Variable | Description | Default |
|:---------------:|:------------------------|:----------------------------------------------------------------------|:------------------------:|
| l | language | language | r |
| bg | palette | layout pallete (vector with c(r,g,b,a) | c(r=171,g=184,b=195,a=1) |
| t | template | layout template (listed in get_templates()) | ‘seti’ |
| wc | add_window_control | add/remove window controls (circles on top left corner) | TRUE |
| wt | window_control_theme | change window control themes (listed in get_windows_control_themes()) | ‘none’ |
| ds | add_drop_shadow | add/remove dropshadow | TRUE |
| dsyoff | drop_shadow_offset_y | shadow vertical offset (px) | 20 |
| dsblur | drop_shadow_blur_radius | shadow blur radius (px) | 68 |
| wa | auto_adjust_width | auto-audjust output width | TRUE |
| pv | padding_vertical | vertical padding (px) | 48 |
| ph | padding_horizontal | horizontal padding (px) | 32 |
| ln | add_line_number | add/remove line numbers | FALSE |
| fm | font_family | layout font family (listed in get_font_families()) | ‘Hack’ |
| fs | font_size | font size (px) | 14 |
| lh | line_height_percent | relative space between lines (percent) | 133 |
| si | square_image | output image is square | FALSE |
| es | relative_export_size | image size in export relative to what is in the preview (1,2 or 4) | 1 |
| wm | add_watermark | add official carbon.js watermark | FALSE |
``` r
x$get_templates()
#> [1] "3024-night" "a11y-dark" "blackboard" "base16-dark"
#> [5] "base16-light" "cobalt" "dracula" "duotone-dark"
#> [9] "hopscotch" "lucario" "material" "monokai"
#> [13] "night-owl" "nord" "oceanic-next" "one-light"
#> [17] "one-dark" "panda-syntax" "paraiso-dark" "seti"
#> [21] "shades-of-purple" "solarized dark" "solarized light" "synthwave-84"
#> [25] "twilight" "verminal" "vscode" "yeti"
#> [29] "zenburn"
```
``` r
x$get_font_families()
#> [1] "Anonymous Pro" "Cascadia Code" "Droid Sans Mono"
#> [4] "Fantasque Sans Mono" "Fira Code" "Hack"
#> [7] "IBM Plex Mono" "Inconsolata" "JetBrains Mono"
#> [10] "Monoid" "Source Code Pro" "Space Mono"
#> [13] "Ubuntu Mono"
```
``` r
x$get_windows_control_themes()
#> [1] "none" "sharp" "bw"
```
### Personal Configuration
Users can use a file called `carbon.yml` and place it in their home
directory (`~`) to override the packages defaults in order to create a
session peristent carbon template they like. The config file controls
all the [public carbon object fields](#manipulate-carbon-object). The
following is an example of such a configuration file.
These fields will set
- The palette (rgba) `g` and `a` fields to 175 and 0.7 respectively
- The template will be set to `panda-syntax`
- The font to `Fira Code`
- The padding around the output will be made tighter than the system
defaults 11px and 14px.
``` yml
palette:
- g: 175.0
- a: 0.7
template: panda-syntax
font_family: Fira Code
padding_vertical: 11
padding_horizontal: 14
```
### Open carbon code in browser
``` r
x$browse()
```
### Set the download directory
``` r
x$download_path <- file.path('README_files/download')
```
### Carbonate code directly to file
This function depends on RSelenium
``` r
x$carbonate(file = 'myfile.png')
```
<!-- -->
``` r
x$template <-'cobalt'
x$carbonate(file = 'new_template.png')
```
<!-- -->
``` r
x$font_family <-'IBM Plex Mono'
x$carbonate(file = 'new_font.png')
```
<!-- -->
### Carbonate code directly to file in specific directory
### Closing Browsers
Closing all instances of open browsers used by RSelenium.
``` r
x$stop_all()
```
### Sharing
<details>
<summary>
Tinyurl
</summary>
You can also put a tinyurl link as a watermark on the image produced
that will open to the carbon.now.sh page that has the code in the image.
``` r
x$add_tinyurl <- TRUE
x$carbonate(file = 'tiny_url.png')
```
<!-- -->
If you just want the tinyurl link without the image to use in a tweet
you can create it using
``` r
x$tiny()
#> [1] "https://tinyurl.com/2n72r6pk"
```
Or you can put the link directly on your clipboard
``` r
x$tiny(clip = TRUE)
clipr::read_clip()
```
</details>
<details>
<summary>
Twitter
</summary>
##### Direct
You can also directly tweet the image. An automatic status is created
with two options
- Default
- Created in R using the Carbonate 📦
- When `add_tinyurl <- TRUE`
- Created in R using the Carbonate 📦 Check out this script at 🔗
<https://tinyurl.com/2n72r6pk>
- Manual
- Using `tweet_status` you can write your own status.
``` r
x <- carbonate::carbon$new()
x$tweet <- TRUE
x$carbonate()
```
##### Post process (Batch)
If you have images stored in `x$carbons` you can post them also in a
tweet using.
``` r
# for multiple png attachments
x$rtweet(x$carbons,media_type = 'png') #using default status
# subsets of images
x$rtweet(status='These are images',x$carbons[c(1,3)],media_type = 'png')
# for gifs
x$rtweet(status='This is a gif', x$carbons,media_type = 'gif')
```
</details>
### Post image processing
All carbon outputs are collected and saved in the list `x$carbons`
<details>
<summary>
Combining
</summary>
``` r
x$carbons%>%
magick::image_scale('300')%>%
magick::image_append()
```
<!-- -->
``` r
x$carbons%>%
magick::image_scale('300')%>%
magick::image_append(stack = TRUE)
```
<!-- -->
</details>
<details>
<summary>
GIFs
</summary>
``` r
x$carbons%>%
magick::image_animate(fps = 1)
```
<!-- -->
</details>
================================================
FILE: _pkgdown.yml
================================================
hexURL:
https://github.com/yonicd/carbonate/blob/master/hextools/hex.gif?raw=true
================================================
FILE: carbonate.Rproj
================================================
Version: 1.0
RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace,vignette
QuitChildProcessesOnExit: Yes
================================================
FILE: codecov.yml
================================================
comment: false
================================================
FILE: cran-comments.md
================================================
## Test environments
* local OS X install, R 3.5.1
* ubuntu 12.04 (on travis-ci), R 3.5.1
* win-builder (devel and release)
## R CMD check results
0 errors | 0 warnings | 1 note
* This is a new release.
## Reverse dependencies
This is a new release, so there are no reverse dependencies.
---
* I have run R CMD check on the NUMBER downstream dependencies.
(Summary at ...).
* FAILURE SUMMARY
* All revdep maintainers were notified of the release on RELEASE DATE.
================================================
FILE: docs/404.html
================================================
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page not found (404) • carbonate</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="bootstrap-toc.css">
<script src="bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><meta property="og:title" content="Page not found (404)">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#toc">
<div class="container template-title-body">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">carbonate</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/tests_and_coverage.html">Tests and Coverage</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/yonicd/carbonate/" class="external-link">
<span class="fab fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="contents col-md-9">
<div class="page-header">
<h1>Page not found (404)</h1>
</div>
Content not found. Please use links in the navbar.
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top"><h2 data-toc-skip>Contents</h2>
</nav>
</div>
</div>
<footer><div class="copyright">
<p></p>
<p>Developed by Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p></p>
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/LICENSE-text.html
================================================
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>License • carbonate</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="bootstrap-toc.css"><script src="bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet"><script src="pkgdown.js"></script><meta property="og:title" content="License"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--></head><body data-spy="scroll" data-target="#toc">
<div class="container template-title-body">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">carbonate</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav"><li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu"><li>
<a href="articles/tests_and_coverage.html">Tests and Coverage</a>
</li>
</ul></li>
</ul><ul class="nav navbar-nav navbar-right"><li>
<a href="https://github.com/yonicd/carbonate/" class="external-link">
<span class="fab fa-github fa-lg"></span>
</a>
</li>
</ul></div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header><div class="row">
<div class="contents col-md-9">
<div class="page-header">
<h1>License</h1>
</div>
<pre>YEAR: 2018
COPYRIGHT HOLDER: Jonathan Sidi
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top"><h2 data-toc-skip>Contents</h2>
</nav></div>
</div>
<footer><div class="copyright">
<p></p><p>Developed by Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
</div>
</footer></div>
</body></html>
================================================
FILE: docs/PULL_REQUEST_TEMPLATE.html
================================================
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>NA • carbonate</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="bootstrap-toc.css"><script src="bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet"><script src="pkgdown.js"></script><meta property="og:title" content="NA"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--></head><body data-spy="scroll" data-target="#toc">
<div class="container template-title-body">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">carbonate</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav"><li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu"><li>
<a href="articles/tests_and_coverage.html">Tests and Coverage</a>
</li>
</ul></li>
</ul><ul class="nav navbar-nav navbar-right"><li>
<a href="https://github.com/yonicd/carbonate/" class="external-link">
<span class="fab fa-github fa-lg"></span>
</a>
</li>
</ul></div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header><div class="row">
<div class="contents col-md-9">
<div class="page-header">
<h1>NA</h1>
</div>
<p>Hi, thanks for contributing!</p>
<p>Please make sure you read our CONTRIBUTING guide.</p>
<p>Please fill the fields above:</p>
<p><!-- If applied, this commit will... --></p>
<p><!-- Why is this change being made? --></p>
<p><!-- # Provide links to any relevant tickets, URLs or other resources --></p>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top"><h2 data-toc-skip>Contents</h2>
</nav></div>
</div>
<footer><div class="copyright">
<p></p><p>Developed by Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
</div>
</footer></div>
</body></html>
================================================
FILE: docs/articles/index.html
================================================
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Articles • carbonate</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Articles"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--></head><body data-spy="scroll" data-target="#toc">
<div class="container template-article-index">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">carbonate</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav"><li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu"><li>
<a href="../articles/tests_and_coverage.html">Tests and Coverage</a>
</li>
</ul></li>
</ul><ul class="nav navbar-nav navbar-right"><li>
<a href="https://github.com/yonicd/carbonate/" class="external-link">
<span class="fab fa-github fa-lg"></span>
</a>
</li>
</ul></div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Articles</h1>
</div>
<div class="section ">
<h3>All vignettes</h3>
<p class="section-desc"></p>
<dl><dt><a href="tests_and_coverage.html">Tests and Coverage</a></dt>
<dd>
</dd></dl></div>
</div>
</div>
<footer><div class="copyright">
<p></p><p>Developed by Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
</div>
</footer></div>
</body></html>
================================================
FILE: docs/articles/tests_and_coverage.html
================================================
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tests and Coverage • carbonate</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css">
<script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Tests and Coverage">
<meta property="og:description" content="carbonate">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#toc">
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">carbonate</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/tests_and_coverage.html">Tests and Coverage</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/yonicd/carbonate/" class="external-link">
<span class="fab fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1 data-toc-skip>Tests and Coverage</h1>
<h4 data-toc-skip class="date">21 August, 2022 21:06:53</h4>
<small class="dont-index">Source: <a href="https://github.com/yonicd/carbonate/blob/HEAD/vignettes/tests_and_coverage.Rmd" class="external-link"><code>vignettes/tests_and_coverage.Rmd</code></a></small>
<div class="hidden name"><code>tests_and_coverage.Rmd</code></div>
</div>
<!--- Placeholder for tests/README.md Do Not Edit--->
<p>This output is created by <a href="https://github.com/metrumresearchgroup/covrpage" class="external-link">covrpage</a>.</p>
<div class="section level2">
<h2 id="coverage">Coverage<a class="anchor" aria-label="anchor" href="#coverage"></a>
</h2>
<p>Coverage summary is created using the <a href="https://github.com/r-lib/covr" class="external-link">covr</a> package.</p>
<table class="table">
<colgroup>
<col width="81%">
<col width="18%">
</colgroup>
<thead><tr class="header">
<th align="left">Object</th>
<th align="center">Coverage (%)</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left">carbonate</td>
<td align="center">48.58</td>
</tr>
<tr class="even">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/R/carbonate.R" class="external-link">R/carbonate.R</a></td>
<td align="center">0.00</td>
</tr>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/R/selenium_functions.R" class="external-link">R/selenium_functions.R</a></td>
<td align="center">0.00</td>
</tr>
<tr class="even">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/R/uri_functions.R" class="external-link">R/uri_functions.R</a></td>
<td align="center">52.63</td>
</tr>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/R/carbon.R" class="external-link">R/carbon.R</a></td>
<td align="center">64.29</td>
</tr>
<tr class="even">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/R/helpers.R" class="external-link">R/helpers.R</a></td>
<td align="center">70.09</td>
</tr>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/R/set_get_functions.R" class="external-link">R/set_get_functions.R</a></td>
<td align="center">100.00</td>
</tr>
</tbody>
</table>
<p><br></p>
</div>
<div class="section level2">
<h2 id="unit-tests">Unit Tests<a class="anchor" aria-label="anchor" href="#unit-tests"></a>
</h2>
<p>Unit Test summary is created using the <a href="https://github.com/r-lib/testthat" class="external-link">testthat</a> package.</p>
<table class="table">
<colgroup>
<col width="47%">
<col width="2%">
<col width="7%">
<col width="7%">
<col width="8%">
<col width="10%">
<col width="10%">
<col width="5%">
</colgroup>
<thead><tr class="header">
<th align="left">file</th>
<th align="right">n</th>
<th align="right">time</th>
<th align="right">error</th>
<th align="right">failed</th>
<th align="right">skipped</th>
<th align="right">warning</th>
<th align="left">icon</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-set.R" class="external-link">test-set.R</a></td>
<td align="right">3</td>
<td align="right">0.013</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-uri.R" class="external-link">test-uri.R</a></td>
<td align="right">8</td>
<td align="right">1.352</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="right">1</td>
<td align="right">0</td>
<td align="left">🔶</td>
</tr>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-yml.R" class="external-link">test-yml.R</a></td>
<td align="right">6</td>
<td align="right">0.017</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="left"></td>
</tr>
</tbody>
</table>
<details open><summary>
Show Detailed Test Results
</summary><table style="width:100%;" class="table">
<colgroup>
<col width="35%">
<col width="6%">
<col width="40%">
<col width="6%">
<col width="1%">
<col width="4%">
<col width="3%">
</colgroup>
<thead><tr class="header">
<th align="left">file</th>
<th align="left">context</th>
<th align="left">test</th>
<th align="left">status</th>
<th align="right">n</th>
<th align="right">time</th>
<th align="left">icon</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-set.R#L8" class="external-link">test-set.R</a></td>
<td align="left">set_</td>
<td align="left">set functions: set_template</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.011</td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-set.R#L13" class="external-link">test-set.R</a></td>
<td align="left">set_</td>
<td align="left">set functions: set_font_family</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.001</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-set.R#L18" class="external-link">test-set.R</a></td>
<td align="left">set_</td>
<td align="left">set functions: set_windows_control_theme</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.001</td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-uri.R#L9" class="external-link">test-uri.R</a></td>
<td align="left">uri</td>
<td align="left">options: benchmark</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.002</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-uri.R#L17" class="external-link">test-uri.R</a></td>
<td align="left">uri</td>
<td align="left">uri: benchmark</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.002</td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-uri.R#L21" class="external-link">test-uri.R</a></td>
<td align="left">uri</td>
<td align="left">uri: 200</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.721</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-uri.R#L27" class="external-link">test-uri.R</a></td>
<td align="left">uri</td>
<td align="left">encode: encode character</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.002</td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-uri.R#L31" class="external-link">test-uri.R</a></td>
<td align="left">uri</td>
<td align="left">encode: no encode character</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.001</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-uri.R#L37" class="external-link">test-uri.R</a></td>
<td align="left">uri</td>
<td align="left">tiny: valid tiny</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.620</td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-uri.R#L42" class="external-link">test-uri.R</a></td>
<td align="left">uri</td>
<td align="left">tiny: clipboard</td>
<td align="left">SKIPPED</td>
<td align="right">1</td>
<td align="right">0.001</td>
<td align="left">🔶</td>
</tr>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-uri.R#" class="external-link">test-uri.R</a></td>
<td align="left">uri</td>
<td align="left">bad template: error uri</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.003</td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-yml.R#L24" class="external-link">test-yml.R</a></td>
<td align="left">yml</td>
<td align="left">yaml fields: rgba</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.006</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-yml.R#L29" class="external-link">test-yml.R</a></td>
<td align="left">yml</td>
<td align="left">yaml fields: template</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.003</td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-yml.R#L34" class="external-link">test-yml.R</a></td>
<td align="left">yml</td>
<td align="left">yaml fields: bad font family</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.002</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-yml.R#L39" class="external-link">test-yml.R</a></td>
<td align="left">yml</td>
<td align="left">yaml fields: pv</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.002</td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-yml.R#L44" class="external-link">test-yml.R</a></td>
<td align="left">yml</td>
<td align="left">yaml fields: ph</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.002</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left"><a href="https://github.com/yonicd/carbonate/tree/master/tests/testthat/test-yml.R#L59" class="external-link">test-yml.R</a></td>
<td align="left">yml</td>
<td align="left">namesless palette: fill in palette</td>
<td align="left">PASS</td>
<td align="right">1</td>
<td align="right">0.002</td>
<td align="left"></td>
</tr>
</tbody>
</table>
<table class="table">
<thead><tr class="header">
<th align="left">Failed</th>
<th align="left">Warning</th>
<th align="left">Skipped</th>
</tr></thead>
<tbody><tr class="odd">
<td align="left">🛑</td>
<td align="left">⚠️</td>
<td align="left">🔶</td>
</tr></tbody>
</table></details><details><summary>
Session Info
</summary><table class="table">
<thead><tr class="header">
<th align="left">Field</th>
<th align="left">Value</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left">Version</td>
<td align="left">R version 3.5.1 (2018-07-02)</td>
</tr>
<tr class="even">
<td align="left">Platform</td>
<td align="left">x86_64-apple-darwin15.6.0 (64-bit)</td>
</tr>
<tr class="odd">
<td align="left">Running</td>
<td align="left">macOS 10.14.2</td>
</tr>
<tr class="even">
<td align="left">Language</td>
<td align="left">en_US</td>
</tr>
<tr class="odd">
<td align="left">Timezone</td>
<td align="left">America/Chicago</td>
</tr>
</tbody>
</table>
<table class="table">
<thead><tr class="header">
<th align="left">Package</th>
<th align="left">Version</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left">testthat</td>
<td align="left">2.0.0.9000</td>
</tr>
<tr class="even">
<td align="left">covr</td>
<td align="left">3.2.0</td>
</tr>
<tr class="odd">
<td align="left">covrpage</td>
<td align="left">0.0.69</td>
</tr>
</tbody>
</table></details><!--- Final Status : skipped/warning --->
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc"><h2 data-toc-skip>Contents</h2>
</nav>
</div>
</div>
<footer><div class="copyright">
<p></p>
<p>Developed by Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p></p>
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/authors.html
================================================
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Authors and Citation • carbonate</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="bootstrap-toc.css"><script src="bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet"><script src="pkgdown.js"></script><meta property="og:title" content="Authors and Citation"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--></head><body data-spy="scroll" data-target="#toc">
<div class="container template-citation-authors">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">carbonate</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav"><li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu"><li>
<a href="articles/tests_and_coverage.html">Tests and Coverage</a>
</li>
</ul></li>
</ul><ul class="nav navbar-nav navbar-right"><li>
<a href="https://github.com/yonicd/carbonate/" class="external-link">
<span class="fab fa-github fa-lg"></span>
</a>
</li>
</ul></div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header><div class="row">
<div class="contents col-md-9">
<div class="section level2 authors-section">
<div class="page-header">
<h1>Authors</h1>
</div>
<ul class="list-unstyled"><li>
<p><strong>Jonathan Sidi</strong>. Author, maintainer. <a href="https://orcid.org/0000-0002-4222-1819" target="orcid.widget" aria-label="ORCID" class="external-link"><span class="fab fa-orcid orcid" aria-hidden="true"></span></a>
</p>
</li>
</ul></div>
<div class="section level2 citation-section">
<div>
<h1 id="citation">Citation</h1>
<small class="dont-index">Source: <a href="https://github.com/yonicd/carbonate/blob/HEAD/DESCRIPTION" class="external-link"><code>DESCRIPTION</code></a></small>
</div>
</div>
<p>Sidi J (2022).
<em>carbonate: Interact with 'carbon.js'</em>.
R package version 0.2.0, <a href="https://github.com/yonicd/carbonate" class="external-link">https://github.com/yonicd/carbonate</a>.
</p>
<pre>@Manual{,
title = {carbonate: Interact with 'carbon.js'},
author = {Jonathan Sidi},
year = {2022},
note = {R package version 0.2.0},
url = {https://github.com/yonicd/carbonate},
}</pre>
</div>
</div>
<footer><div class="copyright">
<p></p><p>Developed by Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
</div>
</footer></div>
</body></html>
================================================
FILE: docs/bootstrap-toc.css
================================================
/*!
* Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/)
* Copyright 2015 Aidan Feldman
* Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */
/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */
/* All levels of nav */
nav[data-toggle='toc'] .nav > li > a {
display: block;
padding: 4px 20px;
font-size: 13px;
font-weight: 500;
color: #767676;
}
nav[data-toggle='toc'] .nav > li > a:hover,
nav[data-toggle='toc'] .nav > li > a:focus {
padding-left: 19px;
color: #563d7c;
text-decoration: none;
background-color: transparent;
border-left: 1px solid #563d7c;
}
nav[data-toggle='toc'] .nav > .active > a,
nav[data-toggle='toc'] .nav > .active:hover > a,
nav[data-toggle='toc'] .nav > .active:focus > a {
padding-left: 18px;
font-weight: bold;
color: #563d7c;
background-color: transparent;
border-left: 2px solid #563d7c;
}
/* Nav: second level (shown on .active) */
nav[data-toggle='toc'] .nav .nav {
display: none; /* Hide by default, but at >768px, show it */
padding-bottom: 10px;
}
nav[data-toggle='toc'] .nav .nav > li > a {
padding-top: 1px;
padding-bottom: 1px;
padding-left: 30px;
font-size: 12px;
font-weight: normal;
}
nav[data-toggle='toc'] .nav .nav > li > a:hover,
nav[data-toggle='toc'] .nav .nav > li > a:focus {
padding-left: 29px;
}
nav[data-toggle='toc'] .nav .nav > .active > a,
nav[data-toggle='toc'] .nav .nav > .active:hover > a,
nav[data-toggle='toc'] .nav .nav > .active:focus > a {
padding-left: 28px;
font-weight: 500;
}
/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */
nav[data-toggle='toc'] .nav > .active > ul {
display: block;
}
================================================
FILE: docs/bootstrap-toc.js
================================================
/*!
* Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/)
* Copyright 2015 Aidan Feldman
* Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */
(function() {
'use strict';
window.Toc = {
helpers: {
// return all matching elements in the set, or their descendants
findOrFilter: function($el, selector) {
// http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/
// http://stackoverflow.com/a/12731439/358804
var $descendants = $el.find(selector);
return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])');
},
generateUniqueIdBase: function(el) {
var text = $(el).text();
var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-');
return anchor || el.tagName.toLowerCase();
},
generateUniqueId: function(el) {
var anchorBase = this.generateUniqueIdBase(el);
for (var i = 0; ; i++) {
var anchor = anchorBase;
if (i > 0) {
// add suffix
anchor += '-' + i;
}
// check if ID already exists
if (!document.getElementById(anchor)) {
return anchor;
}
}
},
generateAnchor: function(el) {
if (el.id) {
return el.id;
} else {
var anchor = this.generateUniqueId(el);
el.id = anchor;
return anchor;
}
},
createNavList: function() {
return $('<ul class="nav"></ul>');
},
createChildNavList: function($parent) {
var $childList = this.createNavList();
$parent.append($childList);
return $childList;
},
generateNavEl: function(anchor, text) {
var $a = $('<a></a>');
$a.attr('href', '#' + anchor);
$a.text(text);
var $li = $('<li></li>');
$li.append($a);
return $li;
},
generateNavItem: function(headingEl) {
var anchor = this.generateAnchor(headingEl);
var $heading = $(headingEl);
var text = $heading.data('toc-text') || $heading.text();
return this.generateNavEl(anchor, text);
},
// Find the first heading level (`<h1>`, then `<h2>`, etc.) that has more than one element. Defaults to 1 (for `<h1>`).
getTopLevel: function($scope) {
for (var i = 1; i <= 6; i++) {
var $headings = this.findOrFilter($scope, 'h' + i);
if ($headings.length > 1) {
return i;
}
}
return 1;
},
// returns the elements for the top level, and the next below it
getHeadings: function($scope, topLevel) {
var topSelector = 'h' + topLevel;
var secondaryLevel = topLevel + 1;
var secondarySelector = 'h' + secondaryLevel;
return this.findOrFilter($scope, topSelector + ',' + secondarySelector);
},
getNavLevel: function(el) {
return parseInt(el.tagName.charAt(1), 10);
},
populateNav: function($topContext, topLevel, $headings) {
var $context = $topContext;
var $prevNav;
var helpers = this;
$headings.each(function(i, el) {
var $newNav = helpers.generateNavItem(el);
var navLevel = helpers.getNavLevel(el);
// determine the proper $context
if (navLevel === topLevel) {
// use top level
$context = $topContext;
} else if ($prevNav && $context === $topContext) {
// create a new level of the tree and switch to it
$context = helpers.createChildNavList($prevNav);
} // else use the current $context
$context.append($newNav);
$prevNav = $newNav;
});
},
parseOps: function(arg) {
var opts;
if (arg.jquery) {
opts = {
$nav: arg
};
} else {
opts = arg;
}
opts.$scope = opts.$scope || $(document.body);
return opts;
}
},
// accepts a jQuery object, or an options object
init: function(opts) {
opts = this.helpers.parseOps(opts);
// ensure that the data attribute is in place for styling
opts.$nav.attr('data-toggle', 'toc');
var $topContext = this.helpers.createChildNavList(opts.$nav);
var topLevel = this.helpers.getTopLevel(opts.$scope);
var $headings = this.helpers.getHeadings(opts.$scope, topLevel);
this.helpers.populateNav($topContext, topLevel, $headings);
}
};
$(function() {
$('nav[data-toggle="toc"]').each(function(i, el) {
var $nav = $(el);
Toc.init($nav);
});
});
})();
================================================
FILE: docs/docsearch.css
================================================
/* Docsearch -------------------------------------------------------------- */
/*
Source: https://github.com/algolia/docsearch/
License: MIT
*/
.algolia-autocomplete {
display: block;
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1
}
.algolia-autocomplete .ds-dropdown-menu {
width: 100%;
min-width: none;
max-width: none;
padding: .75rem 0;
background-color: #fff;
background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, .1);
box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175);
}
@media (min-width:768px) {
.algolia-autocomplete .ds-dropdown-menu {
width: 175%
}
}
.algolia-autocomplete .ds-dropdown-menu::before {
display: none
}
.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] {
padding: 0;
background-color: rgb(255,255,255);
border: 0;
max-height: 80vh;
}
.algolia-autocomplete .ds-dropdown-menu .ds-suggestions {
margin-top: 0
}
.algolia-autocomplete .algolia-docsearch-suggestion {
padding: 0;
overflow: visible
}
.algolia-autocomplete .algolia-docsearch-suggestion--category-header {
padding: .125rem 1rem;
margin-top: 0;
font-size: 1.3em;
font-weight: 500;
color: #00008B;
border-bottom: 0
}
.algolia-autocomplete .algolia-docsearch-suggestion--wrapper {
float: none;
padding-top: 0
}
.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column {
float: none;
width: auto;
padding: 0;
text-align: left
}
.algolia-autocomplete .algolia-docsearch-suggestion--content {
float: none;
width: auto;
padding: 0
}
.algolia-autocomplete .algolia-docsearch-suggestion--content::before {
display: none
}
.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header {
padding-top: .75rem;
margin-top: .75rem;
border-top: 1px solid rgba(0, 0, 0, .1)
}
.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column {
display: block;
padding: .1rem 1rem;
margin-bottom: 0.1;
font-size: 1.0em;
font-weight: 400
/* display: none */
}
.algolia-autocomplete .algolia-docsearch-suggestion--title {
display: block;
padding: .25rem 1rem;
margin-bottom: 0;
font-size: 0.9em;
font-weight: 400
}
.algolia-autocomplete .algolia-docsearch-suggestion--text {
padding: 0 1rem .5rem;
margin-top: -.25rem;
font-size: 0.8em;
font-weight: 400;
line-height: 1.25
}
.algolia-autocomplete .algolia-docsearch-footer {
width: 110px;
height: 20px;
z-index: 3;
margin-top: 10.66667px;
float: right;
font-size: 0;
line-height: 0;
}
.algolia-autocomplete .algolia-docsearch-footer--logo {
background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 130 18' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient x1='-36.868%' y1='134.936%' x2='129.432%' y2='-27.7%' id='a'><stop stop-color='%2300AEFF' offset='0%'/><stop stop-color='%233369E7' offset='100%'/></linearGradient></defs><g fill='none' fill-rule='evenodd'><path d='M59.399.022h13.299a2.372 2.372 0 0 1 2.377 2.364V15.62a2.372 2.372 0 0 1-2.377 2.364H59.399a2.372 2.372 0 0 1-2.377-2.364V2.381A2.368 2.368 0 0 1 59.399.022z' fill='url(%23a)'/><path d='M66.257 4.56c-2.815 0-5.1 2.272-5.1 5.078 0 2.806 2.284 5.072 5.1 5.072 2.815 0 5.1-2.272 5.1-5.078 0-2.806-2.279-5.072-5.1-5.072zm0 8.652c-1.983 0-3.593-1.602-3.593-3.574 0-1.972 1.61-3.574 3.593-3.574 1.983 0 3.593 1.602 3.593 3.574a3.582 3.582 0 0 1-3.593 3.574zm0-6.418v2.664c0 .076.082.131.153.093l2.377-1.226c.055-.027.071-.093.044-.147a2.96 2.96 0 0 0-2.465-1.487c-.055 0-.11.044-.11.104l.001-.001zm-3.33-1.956l-.312-.311a.783.783 0 0 0-1.106 0l-.372.37a.773.773 0 0 0 0 1.101l.307.305c.049.049.121.038.164-.011.181-.245.378-.479.597-.697.225-.223.455-.42.707-.599.055-.033.06-.109.016-.158h-.001zm5.001-.806v-.616a.781.781 0 0 0-.783-.779h-1.824a.78.78 0 0 0-.783.779v.632c0 .071.066.12.137.104a5.736 5.736 0 0 1 1.588-.223c.52 0 1.035.071 1.534.207a.106.106 0 0 0 .131-.104z' fill='%23FFF'/><path d='M102.162 13.762c0 1.455-.372 2.517-1.123 3.193-.75.676-1.895 1.013-3.44 1.013-.564 0-1.736-.109-2.673-.316l.345-1.689c.783.163 1.819.207 2.361.207.86 0 1.473-.174 1.84-.523.367-.349.548-.866.548-1.553v-.349a6.374 6.374 0 0 1-.838.316 4.151 4.151 0 0 1-1.194.158 4.515 4.515 0 0 1-1.616-.278 3.385 3.385 0 0 1-1.254-.817 3.744 3.744 0 0 1-.811-1.351c-.192-.539-.29-1.504-.29-2.212 0-.665.104-1.498.307-2.054a3.925 3.925 0 0 1 .904-1.433 4.124 4.124 0 0 1 1.441-.926 5.31 5.31 0 0 1 1.945-.365c.696 0 1.337.087 1.961.191a15.86 15.86 0 0 1 1.588.332v8.456h-.001zm-5.954-4.206c0 .893.197 1.885.592 2.299.394.414.904.621 1.528.621.34 0 .663-.049.964-.142a2.75 2.75 0 0 0 .734-.332v-5.29a8.531 8.531 0 0 0-1.413-.18c-.778-.022-1.369.294-1.786.801-.411.507-.619 1.395-.619 2.223zm16.12 0c0 .719-.104 1.264-.318 1.858a4.389 4.389 0 0 1-.904 1.52c-.389.42-.854.746-1.402.975-.548.229-1.391.36-1.813.36-.422-.005-1.26-.125-1.802-.36a4.088 4.088 0 0 1-1.397-.975 4.486 4.486 0 0 1-.909-1.52 5.037 5.037 0 0 1-.329-1.858c0-.719.099-1.411.318-1.999.219-.588.526-1.09.92-1.509.394-.42.865-.741 1.402-.97a4.547 4.547 0 0 1 1.786-.338 4.69 4.69 0 0 1 1.791.338c.548.229 1.019.55 1.402.97.389.42.69.921.909 1.509.23.588.345 1.28.345 1.999h.001zm-2.191.005c0-.921-.203-1.689-.597-2.223-.394-.539-.948-.806-1.654-.806-.707 0-1.26.267-1.654.806-.394.539-.586 1.302-.586 2.223 0 .932.197 1.558.592 2.098.394.545.948.812 1.654.812.707 0 1.26-.272 1.654-.812.394-.545.592-1.166.592-2.098h-.001zm6.962 4.707c-3.511.016-3.511-2.822-3.511-3.274L113.583.926l2.142-.338v10.003c0 .256 0 1.88 1.375 1.885v1.792h-.001zm3.774 0h-2.153V5.072l2.153-.338v9.534zm-1.079-10.542c.718 0 1.304-.578 1.304-1.291 0-.714-.581-1.291-1.304-1.291-.723 0-1.304.578-1.304 1.291 0 .714.586 1.291 1.304 1.291zm6.431 1.013c.707 0 1.304.087 1.786.262.482.174.871.42 1.156.73.285.311.488.735.608 1.182.126.447.186.937.186 1.476v5.481a25.24 25.24 0 0 1-1.495.251c-.668.098-1.419.147-2.251.147a6.829 6.829 0 0 1-1.517-.158 3.213 3.213 0 0 1-1.178-.507 2.455 2.455 0 0 1-.761-.904c-.181-.37-.274-.893-.274-1.438 0-.523.104-.855.307-1.215.208-.36.487-.654.838-.883a3.609 3.609 0 0 1 1.227-.49 7.073 7.073 0 0 1 2.202-.103c.263.027.537.076.833.147v-.349c0-.245-.027-.479-.088-.697a1.486 1.486 0 0 0-.307-.583c-.148-.169-.34-.3-.581-.392a2.536 2.536 0 0 0-.915-.163c-.493 0-.942.06-1.353.131-.411.071-.75.153-1.008.245l-.257-1.749c.268-.093.668-.185 1.183-.278a9.335 9.335 0 0 1 1.66-.142l-.001-.001zm.181 7.731c.657 0 1.145-.038 1.484-.104v-2.168a5.097 5.097 0 0 0-1.978-.104c-.241.033-.46.098-.652.191a1.167 1.167 0 0 0-.466.392c-.121.169-.175.267-.175.523 0 .501.175.79.493.981.323.196.75.289 1.293.289h.001zM84.109 4.794c.707 0 1.304.087 1.786.262.482.174.871.42 1.156.73.29.316.487.735.608 1.182.126.447.186.937.186 1.476v5.481a25.24 25.24 0 0 1-1.495.251c-.668.098-1.419.147-2.251.147a6.829 6.829 0 0 1-1.517-.158 3.213 3.213 0 0 1-1.178-.507 2.455 2.455 0 0 1-.761-.904c-.181-.37-.274-.893-.274-1.438 0-.523.104-.855.307-1.215.208-.36.487-.654.838-.883a3.609 3.609 0 0 1 1.227-.49 7.073 7.073 0 0 1 2.202-.103c.257.027.537.076.833.147v-.349c0-.245-.027-.479-.088-.697a1.486 1.486 0 0 0-.307-.583c-.148-.169-.34-.3-.581-.392a2.536 2.536 0 0 0-.915-.163c-.493 0-.942.06-1.353.131-.411.071-.75.153-1.008.245l-.257-1.749c.268-.093.668-.185 1.183-.278a8.89 8.89 0 0 1 1.66-.142l-.001-.001zm.186 7.736c.657 0 1.145-.038 1.484-.104v-2.168a5.097 5.097 0 0 0-1.978-.104c-.241.033-.46.098-.652.191a1.167 1.167 0 0 0-.466.392c-.121.169-.175.267-.175.523 0 .501.175.79.493.981.318.191.75.289 1.293.289h.001zm8.682 1.738c-3.511.016-3.511-2.822-3.511-3.274L89.461.926l2.142-.338v10.003c0 .256 0 1.88 1.375 1.885v1.792h-.001z' fill='%23182359'/><path d='M5.027 11.025c0 .698-.252 1.246-.757 1.644-.505.397-1.201.596-2.089.596-.888 0-1.615-.138-2.181-.414v-1.214c.358.168.739.301 1.141.397.403.097.778.145 1.125.145.508 0 .884-.097 1.125-.29a.945.945 0 0 0 .363-.779.978.978 0 0 0-.333-.747c-.222-.204-.68-.446-1.375-.725-.716-.29-1.221-.621-1.515-.994-.294-.372-.44-.82-.44-1.343 0-.655.233-1.171.698-1.547.466-.376 1.09-.564 1.875-.564.752 0 1.5.165 2.245.494l-.408 1.047c-.698-.294-1.321-.44-1.869-.44-.415 0-.73.09-.945.271a.89.89 0 0 0-.322.717c0 .204.043.379.129.524.086.145.227.282.424.411.197.129.551.299 1.063.51.577.24.999.464 1.268.671.269.208.466.442.591.704.125.261.188.569.188.924l-.001.002zm3.98 2.24c-.924 0-1.646-.269-2.167-.808-.521-.539-.782-1.281-.782-2.226 0-.97.242-1.733.725-2.288.483-.555 1.148-.833 1.993-.833.784 0 1.404.238 1.858.714.455.476.682 1.132.682 1.966v.682H7.357c.018.577.174 1.02.467 1.329.294.31.707.465 1.241.465.351 0 .678-.033.98-.099a5.1 5.1 0 0 0 .975-.33v1.026a3.865 3.865 0 0 1-.935.312 5.723 5.723 0 0 1-1.08.091l.002-.001zm-.231-5.199c-.401 0-.722.127-.964.381s-.386.625-.432 1.112h2.696c-.007-.491-.125-.862-.354-1.115-.229-.252-.544-.379-.945-.379l-.001.001zm7.692 5.092l-.252-.827h-.043c-.286.362-.575.608-.865.739-.29.131-.662.196-1.117.196-.584 0-1.039-.158-1.367-.473-.328-.315-.491-.761-.491-1.337 0-.612.227-1.074.682-1.386.455-.312 1.148-.482 2.079-.51l1.026-.032v-.317c0-.38-.089-.663-.266-.851-.177-.188-.452-.282-.824-.282-.304 0-.596.045-.876.134a6.68 6.68 0 0 0-.806.317l-.408-.902a4.414 4.414 0 0 1 1.058-.384 4.856 4.856 0 0 1 1.085-.132c.756 0 1.326.165 1.711.494.385.329.577.847.577 1.552v4.002h-.902l-.001-.001zm-1.88-.859c.458 0 .826-.128 1.104-.384.278-.256.416-.615.416-1.077v-.516l-.763.032c-.594.021-1.027.121-1.297.298s-.406.448-.406.814c0 .265.079.47.236.615.158.145.394.218.709.218h.001zm7.557-5.189c.254 0 .464.018.628.054l-.124 1.176a2.383 2.383 0 0 0-.559-.064c-.505 0-.914.165-1.227.494-.313.329-.47.757-.47 1.284v3.105h-1.262V7.218h.988l.167 1.047h.064c.197-.354.454-.636.771-.843a1.83 1.83 0 0 1 1.023-.312h.001zm4.125 6.155c-.899 0-1.582-.262-2.049-.787-.467-.525-.701-1.277-.701-2.259 0-.999.244-1.767.733-2.304.489-.537 1.195-.806 2.119-.806.627 0 1.191.116 1.692.349l-.381 1.015c-.534-.208-.974-.312-1.321-.312-1.028 0-1.542.682-1.542 2.046 0 .666.128 1.166.384 1.501.256.335.631.502 1.125.502a3.23 3.23 0 0 0 1.595-.419v1.101a2.53 2.53 0 0 1-.722.285 4.356 4.356 0 0 1-.932.086v.002zm8.277-.107h-1.268V9.506c0-.458-.092-.8-.277-1.026-.184-.226-.477-.338-.878-.338-.53 0-.919.158-1.168.475-.249.317-.373.848-.373 1.593v2.949h-1.262V4.801h1.262v2.122c0 .34-.021.704-.064 1.09h.081a1.76 1.76 0 0 1 .717-.666c.306-.158.663-.236 1.072-.236 1.439 0 2.159.725 2.159 2.175v3.873l-.001-.001zm7.649-6.048c.741 0 1.319.269 1.732.806.414.537.62 1.291.62 2.261 0 .974-.209 1.732-.628 2.275-.419.542-1.001.814-1.746.814-.752 0-1.336-.27-1.751-.811h-.086l-.231.704h-.945V4.801h1.262v1.987l-.021.655-.032.553h.054c.401-.591.992-.886 1.772-.886zm-.328 1.031c-.508 0-.875.149-1.098.448-.224.299-.339.799-.346 1.501v.086c0 .723.115 1.247.344 1.571.229.324.603.486 1.123.486.448 0 .787-.177 1.018-.532.231-.354.346-.867.346-1.536 0-1.35-.462-2.025-1.386-2.025l-.001.001zm3.244-.924h1.375l1.209 3.368c.183.48.304.931.365 1.354h.043c.032-.197.091-.436.177-.717.086-.281.541-1.616 1.364-4.004h1.364l-2.541 6.73c-.462 1.235-1.232 1.853-2.31 1.853-.279 0-.551-.03-.816-.091v-.999c.19.043.406.064.65.064.609 0 1.037-.353 1.284-1.058l.22-.559-2.385-5.941h.001z' fill='%231D3657'/></g></svg>");
background-repeat: no-repeat;
background-position: 50%;
background-size: 100%;
overflow: hidden;
text-indent: -9000px;
width: 100%;
height: 100%;
display: block;
transform: translate(-8px);
}
.algolia-autocomplete .algolia-docsearch-suggestion--highlight {
color: #FF8C00;
background: rgba(232, 189, 54, 0.1)
}
.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight {
box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5)
}
.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content {
background-color: rgba(192, 192, 192, .15)
}
================================================
FILE: docs/docsearch.js
================================================
$(function() {
// register a handler to move the focus to the search bar
// upon pressing shift + "/" (i.e. "?")
$(document).on('keydown', function(e) {
if (e.shiftKey && e.keyCode == 191) {
e.preventDefault();
$("#search-input").focus();
}
});
$(document).ready(function() {
// do keyword highlighting
/* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */
var mark = function() {
var referrer = document.URL ;
var paramKey = "q" ;
if (referrer.indexOf("?") !== -1) {
var qs = referrer.substr(referrer.indexOf('?') + 1);
var qs_noanchor = qs.split('#')[0];
var qsa = qs_noanchor.split('&');
var keyword = "";
for (var i = 0; i < qsa.length; i++) {
var currentParam = qsa[i].split('=');
if (currentParam.length !== 2) {
continue;
}
if (currentParam[0] == paramKey) {
keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20"));
}
}
if (keyword !== "") {
$(".contents").unmark({
done: function() {
$(".contents").mark(keyword);
}
});
}
}
};
mark();
});
});
/* Search term highlighting ------------------------------*/
function matchedWords(hit) {
var words = [];
var hierarchy = hit._highlightResult.hierarchy;
// loop to fetch from lvl0, lvl1, etc.
for (var idx in hierarchy) {
words = words.concat(hierarchy[idx].matchedWords);
}
var content = hit._highlightResult.content;
if (content) {
words = words.concat(content.matchedWords);
}
// return unique words
var words_uniq = [...new Set(words)];
return words_uniq;
}
function updateHitURL(hit) {
var words = matchedWords(hit);
var url = "";
if (hit.anchor) {
url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor;
} else {
url = hit.url + '?q=' + escape(words.join(" "));
}
return url;
}
================================================
FILE: docs/index.html
================================================
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Interact with carbon.js • carbonate</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="bootstrap-toc.css">
<script src="bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><meta property="og:title" content="Interact with carbon.js">
<meta property="og:description" content="Create beautiful images of source code using
carbon.js<https://carbon.now.sh/about>.">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#toc">
<div class="container template-home">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">carbonate</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/tests_and_coverage.html">Tests and Coverage</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/yonicd/carbonate/" class="external-link">
<span class="fab fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="contents col-md-9">
<p>“<a href="https://carbon.now.sh/about" class="external-link">carbon.js</a> is the easiest way to create beautiful images of your source code.”</p>
<p>This package uses an <code>R6</code> api to interact with carbon.js and create directly from the console carbon images.</p>
<p>Like the image below:</p>
<p><img src="reference/figures/unnamed-chunk-3-1.png"><!-- --></p>
<div class="section level2">
<h2 id="installation">Installation<a class="anchor" aria-label="anchor" href="#installation"></a>
</h2>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co">#remotes::install_github('yonicd/carbonate')</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span><span class="st">'carbonate'</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level2">
<h2 id="usage">Usage<a class="anchor" aria-label="anchor" href="#usage"></a>
</h2>
<div class="section level3">
<h3 id="initialize-new-carbon-object">Initialize new carbon object<a class="anchor" aria-label="anchor" href="#initialize-new-carbon-object"></a>
</h3>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/yonicd/carbonate" class="external-link">carbonate</a></span><span class="op">)</span></span></code></pre></div>
<p>The default code in the carbon object is taken from the clipboard.</p>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span> <span class="op"><-</span> <span class="va"><a href="reference/carbon.html">carbon</a></span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
<p>But can also be defined inline. Code can be a character object of any length.</p>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span> <span class="op"><-</span> <span class="va"><a href="reference/carbon.html">carbon</a></span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/readLines.html" class="external-link">readLines</a></span><span class="op">(</span><span class="st">'DESCRIPTION'</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<p>The code is kept in the object and can be changed at any time.</p>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="va">code</span></span>
<span><span class="co">#> [1] "Package: carbonate" </span></span>
<span><span class="co">#> [2] "Title: Interact with 'carbon.js'" </span></span>
<span><span class="co">#> [3] "Version: 0.2.0" </span></span>
<span><span class="co">#> [4] "Authors@R: " </span></span>
<span><span class="co">#> [5] " person(given = \"Jonathan\"," </span></span>
<span><span class="co">#> [6] " family = \"Sidi\"," </span></span>
<span><span class="co">#> [7] " role = c(\"aut\", \"cre\")," </span></span>
<span><span class="co">#> [8] " email = \"yonicd@gmail.com\"," </span></span>
<span><span class="co">#> [9] " comment = c(ORCID = \"0000-0002-4222-1819\"))" </span></span>
<span><span class="co">#> [10] "Description: Create beautiful images of source code using" </span></span>
<span><span class="co">#> [11] " 'carbon.js'<https://carbon.now.sh/about>." </span></span>
<span><span class="co">#> [12] "License: MIT + file LICENSE" </span></span>
<span><span class="co">#> [13] "URL: https://github.com/yonicd/carbonate" </span></span>
<span><span class="co">#> [14] "BugReports: https://github.com/yonicd/carbonate/issues" </span></span>
<span><span class="co">#> [15] "Depends: " </span></span>
<span><span class="co">#> [16] " R (>= 3.2.0)" </span></span>
<span><span class="co">#> [17] "Imports: " </span></span>
<span><span class="co">#> [18] " clipr," </span></span>
<span><span class="co">#> [19] " details," </span></span>
<span><span class="co">#> [20] " httpuv," </span></span>
<span><span class="co">#> [21] " httr," </span></span>
<span><span class="co">#> [22] " magick," </span></span>
<span><span class="co">#> [23] " R6," </span></span>
<span><span class="co">#> [24] " reprex," </span></span>
<span><span class="co">#> [25] " RSelenium," </span></span>
<span><span class="co">#> [26] " rtweet," </span></span>
<span><span class="co">#> [27] " utils," </span></span>
<span><span class="co">#> [28] " wdman," </span></span>
<span><span class="co">#> [29] " jsonlite," </span></span>
<span><span class="co">#> [30] " yaml" </span></span>
<span><span class="co">#> [31] "Suggests: " </span></span>
<span><span class="co">#> [32] " covr," </span></span>
<span><span class="co">#> [33] " knitr," </span></span>
<span><span class="co">#> [34] " rmarkdown," </span></span>
<span><span class="co">#> [35] " testthat" </span></span>
<span><span class="co">#> [36] "VignetteBuilder: " </span></span>
<span><span class="co">#> [37] " knitr" </span></span>
<span><span class="co">#> [38] "RdMacros: " </span></span>
<span><span class="co">#> [39] " details" </span></span>
<span><span class="co">#> [40] "Encoding: UTF-8" </span></span>
<span><span class="co">#> [41] "LazyData: true" </span></span>
<span><span class="co">#> [42] "Roxygen: list(markdown = TRUE,old_usage = TRUE,r6 = FALSE)"</span></span>
<span><span class="co">#> [43] "RoxygenNote: 7.2.1"</span></span></code></pre></div>
<p>The main job of the R6 object is to convert all the options into a uri that is sent to the carbon url page, where it is processed.</p>
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="fu">uri</span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co">#> [1] "https://carbon.now.sh/?bg=rgba(171%2C175%2C195%2C0.7)&t=panda-syntax&wt=none&l=r&ds=true&dsyoff=20px&dsblur=68px&wc=true&wa=true&pv=11px&ph=14px&ln=false&fm=Fira%20Code&fs=14px&lh=133%25&si=false&es=1x&wm=false&ts=false&code=Package%253A%2520carbonate%250ATitle%253A%2520Interact%2520with%2520%27carbon.js%27%250AVersion%253A%25200.2.0%250AAuthors%2540R%253A%2520%250A%2520%2520%2520%2520person(given%2520%253D%2520%2522Jonathan%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520family%2520%253D%2520%2522Sidi%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520role%2520%253D%2520c(%2522aut%2522%252C%2520%2522cre%2522)%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520email%2520%253D%2520%2522yonicd%2540gmail.com%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520comment%2520%253D%2520c(ORCID%2520%253D%2520%25220000-0002-4222-1819%2522))%250ADescription%253A%2520Create%2520beautiful%2520images%2520of%2520source%2520code%2520using%250A%2520%2520%2520%2520%27carbon.js%27%253Chttps%253A%252F%252Fcarbon.now.sh%252Fabout%253E.%250ALicense%253A%2520MIT%2520%252B%2520file%2520LICENSE%250AURL%253A%2520https%253A%252F%252Fgithub.com%252Fyonicd%252Fcarbonate%250ABugReports%253A%2520https%253A%252F%252Fgithub.com%252Fyonicd%252Fcarbonate%252Fissues%250ADepends%253A%2520%250A%2520%2520%2520%2520R%2520(%253E%253D%25203.2.0)%250AImports%253A%2520%250A%2520%2520%2520%2520clipr%252C%250A%2520%2520%2520%2520details%252C%250A%2520%2520%2520%2520httpuv%252C%250A%2520%2520%2520%2520httr%252C%250A%2520%2520%2520%2520magick%252C%250A%2520%2520%2520%2520R6%252C%250A%2520%2520%2520%2520reprex%252C%250A%2520%2520%2520%2520RSelenium%252C%250A%2520%2520%2520%2520rtweet%252C%250A%2520%2520%2520%2520utils%252C%250A%2520%2520%2520%2520wdman%252C%250A%2520%2520%2520%2520jsonlite%252C%250A%2520%2520%2520%2520yaml%250ASuggests%253A%2520%250A%2520%2520%2520%2520covr%252C%250A%2520%2520%2520%2520knitr%252C%250A%2520%2520%2520%2520rmarkdown%252C%250A%2520%2520%2520%2520testthat%250AVignetteBuilder%253A%2520%250A%2520%2520%2520%2520knitr%250ARdMacros%253A%2520%250A%2520%2520%2520%2520details%250AEncoding%253A%2520UTF-8%250ALazyData%253A%2520true%250ARoxygen%253A%2520list(markdown%2520%253D%2520TRUE%252Cold_usage%2520%253D%2520TRUE%252Cr6%2520%253D%2520FALSE)%250ARoxygenNote%253A%25207.2.1"</span></span></code></pre></div>
<p>Click the <a href="https://carbon.now.sh/?bg=rgba(171%2C175%2C195%2C0.7)&t=panda-syntax&wt=none&l=r&ds=true&dsyoff=20px&dsblur=68px&wc=true&wa=true&pv=11px&ph=14px&ln=false&fm=Fira%20Code&fs=14px&lh=133%25&si=false&es=1x&wm=false&ts=false&code=Package%253A%2520carbonate%250ATitle%253A%2520Interact%2520with%2520%27carbon.js%27%250AVersion%253A%25200.2.0%250AAuthors%2540R%253A%2520%250A%2520%2520%2520%2520person(given%2520%253D%2520%2522Jonathan%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520family%2520%253D%2520%2522Sidi%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520role%2520%253D%2520c(%2522aut%2522%252C%2520%2522cre%2522)%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520email%2520%253D%2520%2522yonicd%2540gmail.com%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520comment%2520%253D%2520c(ORCID%2520%253D%2520%25220000-0002-4222-1819%2522))%250ADescription%253A%2520Create%2520beautiful%2520images%2520of%2520source%2520code%2520using%250A%2520%2520%2520%2520%27carbon.js%27%253Chttps%253A%252F%252Fcarbon.now.sh%252Fabout%253E.%250ALicense%253A%2520MIT%2520%252B%2520file%2520LICENSE%250AURL%253A%2520https%253A%252F%252Fgithub.com%252Fyonicd%252Fcarbonate%250ABugReports%253A%2520https%253A%252F%252Fgithub.com%252Fyonicd%252Fcarbonate%252Fissues%250ADepends%253A%2520%250A%2520%2520%2520%2520R%2520(%253E%253D%25203.2.0)%250AImports%253A%2520%250A%2520%2520%2520%2520clipr%252C%250A%2520%2520%2520%2520details%252C%250A%2520%2520%2520%2520httpuv%252C%250A%2520%2520%2520%2520httr%252C%250A%2520%2520%2520%2520magick%252C%250A%2520%2520%2520%2520R6%252C%250A%2520%2520%2520%2520reprex%252C%250A%2520%2520%2520%2520RSelenium%252C%250A%2520%2520%2520%2520rtweet%252C%250A%2520%2520%2520%2520utils%252C%250A%2520%2520%2520%2520wdman%252C%250A%2520%2520%2520%2520jsonlite%252C%250A%2520%2520%2520%2520yaml%250ASuggests%253A%2520%250A%2520%2520%2520%2520covr%252C%250A%2520%2520%2520%2520knitr%252C%250A%2520%2520%2520%2520rmarkdown%252C%250A%2520%2520%2520%2520testthat%250AVignetteBuilder%253A%2520%250A%2520%2520%2520%2520knitr%250ARdMacros%253A%2520%250A%2520%2520%2520%2520details%250AEncoding%253A%2520UTF-8%250ALazyData%253A%2520true%250ARoxygen%253A%2520list(markdown%2520%253D%2520TRUE%252Cold_usage%2520%253D%2520TRUE%252Cr6%2520%253D%2520FALSE)%250ARoxygenNote%253A%25207.2.1" class="external-link">link</a> to see the URI works.</p>
</div>
<div class="section level3">
<h3 id="manipulate-carbon-object">Manipulate carbon object<a class="anchor" aria-label="anchor" href="#manipulate-carbon-object"></a>
</h3>
<p>Aesthetics of the carbon object that can be manipulated</p>
<table class="table">
<colgroup>
<col width="12%">
<col width="17%">
<col width="51%">
<col width="18%">
</colgroup>
<thead><tr class="header">
<th align="center">Carbon Variable</th>
<th align="left">Carbonate Variable</th>
<th align="left">Description</th>
<th align="center">Default</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">l</td>
<td align="left">language</td>
<td align="left">language</td>
<td align="center">r</td>
</tr>
<tr class="even">
<td align="center">bg</td>
<td align="left">palette</td>
<td align="left">layout pallete (vector with c(r,g,b,a)</td>
<td align="center">c(r=171,g=184,b=195,a=1)</td>
</tr>
<tr class="odd">
<td align="center">t</td>
<td align="left">template</td>
<td align="left">layout template (listed in get_templates())</td>
<td align="center">‘seti’</td>
</tr>
<tr class="even">
<td align="center">wc</td>
<td align="left">add_window_control</td>
<td align="left">add/remove window controls (circles on top left corner)</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">wt</td>
<td align="left">window_control_theme</td>
<td align="left">change window control themes (listed in get_windows_control_themes())</td>
<td align="center">‘none’</td>
</tr>
<tr class="even">
<td align="center">ds</td>
<td align="left">add_drop_shadow</td>
<td align="left">add/remove dropshadow</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">dsyoff</td>
<td align="left">drop_shadow_offset_y</td>
<td align="left">shadow vertical offset (px)</td>
<td align="center">20</td>
</tr>
<tr class="even">
<td align="center">dsblur</td>
<td align="left">drop_shadow_blur_radius</td>
<td align="left">shadow blur radius (px)</td>
<td align="center">68</td>
</tr>
<tr class="odd">
<td align="center">wa</td>
<td align="left">auto_adjust_width</td>
<td align="left">auto-audjust output width</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">pv</td>
<td align="left">padding_vertical</td>
<td align="left">vertical padding (px)</td>
<td align="center">48</td>
</tr>
<tr class="odd">
<td align="center">ph</td>
<td align="left">padding_horizontal</td>
<td align="left">horizontal padding (px)</td>
<td align="center">32</td>
</tr>
<tr class="even">
<td align="center">ln</td>
<td align="left">add_line_number</td>
<td align="left">add/remove line numbers</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">fm</td>
<td align="left">font_family</td>
<td align="left">layout font family (listed in get_font_families())</td>
<td align="center">‘Hack’</td>
</tr>
<tr class="even">
<td align="center">fs</td>
<td align="left">font_size</td>
<td align="left">font size (px)</td>
<td align="center">14</td>
</tr>
<tr class="odd">
<td align="center">lh</td>
<td align="left">line_height_percent</td>
<td align="left">relative space between lines (percent)</td>
<td align="center">133</td>
</tr>
<tr class="even">
<td align="center">si</td>
<td align="left">square_image</td>
<td align="left">output image is square</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">es</td>
<td align="left">relative_export_size</td>
<td align="left">image size in export relative to what is in the preview (1,2 or 4)</td>
<td align="center">1</td>
</tr>
<tr class="even">
<td align="center">wm</td>
<td align="left">add_watermark</td>
<td align="left">add official carbon.js watermark</td>
<td align="center">FALSE</td>
</tr>
</tbody>
</table>
<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="fu">get_templates</span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co">#> [1] "3024-night" "a11y-dark" "blackboard" </span></span>
<span><span class="co">#> [4] "base16-dark" "base16-light" "cobalt" </span></span>
<span><span class="co">#> [7] "dracula" "duotone-dark" "hopscotch" </span></span>
<span><span class="co">#> [10] "lucario" "material" "monokai" </span></span>
<span><span class="co">#> [13] "night-owl" "nord" "oceanic-next" </span></span>
<span><span class="co">#> [16] "one-light" "one-dark" "panda-syntax" </span></span>
<span><span class="co">#> [19] "paraiso-dark" "seti" "shades-of-purple"</span></span>
<span><span class="co">#> [22] "solarized dark" "solarized light" "synthwave-84" </span></span>
<span><span class="co">#> [25] "twilight" "verminal" "vscode" </span></span>
<span><span class="co">#> [28] "yeti" "zenburn"</span></span></code></pre></div>
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="fu">get_font_families</span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co">#> [1] "Anonymous Pro" "Cascadia Code" "Droid Sans Mono" </span></span>
<span><span class="co">#> [4] "Fantasque Sans Mono" "Fira Code" "Hack" </span></span>
<span><span class="co">#> [7] "IBM Plex Mono" "Inconsolata" "JetBrains Mono" </span></span>
<span><span class="co">#> [10] "Monoid" "Source Code Pro" "Space Mono" </span></span>
<span><span class="co">#> [13] "Ubuntu Mono"</span></span></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="fu">get_windows_control_themes</span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co">#> [1] "none" "sharp" "bw"</span></span></code></pre></div>
</div>
<div class="section level3">
<h3 id="personal-configuration">Personal Configuration<a class="anchor" aria-label="anchor" href="#personal-configuration"></a>
</h3>
<p>Users can use a file called <code>carbon.yml</code> and place it in their home directory (<code>~</code>) to override the packages defaults in order to create a session peristent carbon template they like. The config file controls all the <a href="#manipulate-carbon-object">public carbon object fields</a>. The following is an example of such a configuration file.</p>
<p>These fields will set</p>
<ul>
<li>The palette (rgba) <code>g</code> and <code>a</code> fields to 175 and 0.7 respectively</li>
<li>The template will be set to <code>panda-syntax</code>
</li>
<li>The font to <code>Fira Code</code>
</li>
<li>The padding around the output will be made tighter than the system defaults 11px and 14px.</li>
</ul>
<div class="sourceCode" id="cb10"><pre class="sourceCode yml"><code class="sourceCode yaml"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">palette</span><span class="kw">:</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a><span class="kw">-</span><span class="at"> </span><span class="fu">g</span><span class="kw">:</span><span class="at"> </span><span class="fl">175.0</span></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a><span class="kw">-</span><span class="at"> </span><span class="fu">a</span><span class="kw">:</span><span class="at"> </span><span class="fl">0.7</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a><span class="fu">template</span><span class="kw">:</span><span class="at"> panda-syntax</span></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a><span class="fu">font_family</span><span class="kw">:</span><span class="at"> Fira Code</span></span>
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a><span class="fu">padding_vertical</span><span class="kw">:</span><span class="at"> </span><span class="dv">11</span></span>
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a><span class="fu">padding_horizontal</span><span class="kw">:</span><span class="at"> </span><span class="dv">14</span></span></code></pre></div>
</div>
<div class="section level3">
<h3 id="open-carbon-code-in-browser">Open carbon code in browser<a class="anchor" aria-label="anchor" href="#open-carbon-code-in-browser"></a>
</h3>
<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="fu">browse</span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level3">
<h3 id="set-the-download-directory">Set the download directory<a class="anchor" aria-label="anchor" href="#set-the-download-directory"></a>
</h3>
<div class="sourceCode" id="cb12"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="va">download_path</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/file.path.html" class="external-link">file.path</a></span><span class="op">(</span><span class="st">'README_files/download'</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level3">
<h3 id="carbonate-code-directly-to-file">Carbonate code directly to file<a class="anchor" aria-label="anchor" href="#carbonate-code-directly-to-file"></a>
</h3>
<p>This function depends on RSelenium</p>
<div class="sourceCode" id="cb13"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="fu">carbonate</span><span class="op">(</span>file <span class="op">=</span> <span class="st">'myfile.png'</span><span class="op">)</span></span></code></pre></div>
<p><img src="reference/figures/unnamed-chunk-16-1.png"><!-- --></p>
<div class="sourceCode" id="cb14"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="va">template</span> <span class="op"><-</span><span class="st">'cobalt'</span></span>
<span><span class="va">x</span><span class="op">$</span><span class="fu">carbonate</span><span class="op">(</span>file <span class="op">=</span> <span class="st">'new_template.png'</span><span class="op">)</span></span></code></pre></div>
<p><img src="reference/figures/unnamed-chunk-18-1.png"><!-- --></p>
<div class="sourceCode" id="cb15"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="va">font_family</span> <span class="op"><-</span><span class="st">'IBM Plex Mono'</span></span>
<span><span class="va">x</span><span class="op">$</span><span class="fu">carbonate</span><span class="op">(</span>file <span class="op">=</span> <span class="st">'new_font.png'</span><span class="op">)</span></span></code></pre></div>
<p><img src="reference/figures/unnamed-chunk-20-1.png"><!-- --></p>
</div>
<div class="section level3">
<h3 id="carbonate-code-directly-to-file-in-specific-directory">Carbonate code directly to file in specific directory<a class="anchor" aria-label="anchor" href="#carbonate-code-directly-to-file-in-specific-directory"></a>
</h3>
</div>
<div class="section level3">
<h3 id="closing-browsers">Closing Browsers<a class="anchor" aria-label="anchor" href="#closing-browsers"></a>
</h3>
<p>Closing all instances of open browsers used by RSelenium.</p>
<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="fu">stop_all</span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level3">
<h3 id="sharing">Sharing<a class="anchor" aria-label="anchor" href="#sharing"></a>
</h3>
<details><summary>
Tinyurl
</summary><p>You can also put a tinyurl link as a watermark on the image produced that will open to the carbon.now.sh page that has the code in the image.</p>
<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="va">add_tinyurl</span> <span class="op"><-</span> <span class="cn">TRUE</span></span>
<span><span class="va">x</span><span class="op">$</span><span class="fu">carbonate</span><span class="op">(</span>file <span class="op">=</span> <span class="st">'tiny_url.png'</span><span class="op">)</span></span></code></pre></div>
<p><img src="reference/figures/unnamed-chunk-23-1.png"><!-- --></p>
<p>If you just want the tinyurl link without the image to use in a tweet you can create it using</p>
<div class="sourceCode" id="cb18"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="fu">tiny</span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co">#> [1] "https://tinyurl.com/2kvjyzlx"</span></span></code></pre></div>
<p>Or you can put the link directly on your clipboard</p>
<div class="sourceCode" id="cb19"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="fu">tiny</span><span class="op">(</span>clip <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
<span><span class="co">#> [1] "https://tinyurl.com/2kvjyzlx"</span></span>
<span><span class="fu">clipr</span><span class="fu">::</span><span class="fu"><a href="http://matthewlincoln.net/clipr/reference/read_clip.html" class="external-link">read_clip</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co">#> [1] "https://tinyurl.com/2kvjyzlx"</span></span></code></pre></div>
</details><details><summary>
Twitter
</summary><div class="section level5">
<h5 id="direct">Direct<a class="anchor" aria-label="anchor" href="#direct"></a>
</h5>
<p>You can also directly tweet the image. An automatic status is created with two options</p>
<ul>
<li>Default
<ul>
<li>Created in R using the Carbonate 📦</li>
</ul>
</li>
<li>When <code>add_tinyurl <- TRUE</code>
<ul>
<li>Created in R using the Carbonate 📦 Check out this script at 🔗 <a href="https://tinyurl.com/2kvjyzlx" class="external-link uri">https://tinyurl.com/2kvjyzlx</a>
</li>
</ul>
</li>
<li>Manual
<ul>
<li>Using <code>tweet_status</code> you can write your own status.</li>
</ul>
</li>
</ul>
<div class="sourceCode" id="cb20"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span> <span class="op"><-</span> <span class="fu">carbonate</span><span class="fu">::</span><span class="va"><a href="reference/carbon.html">carbon</a></span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="op">)</span></span>
<span><span class="va">x</span><span class="op">$</span><span class="va">tweet</span> <span class="op"><-</span> <span class="cn">TRUE</span></span>
<span><span class="va">x</span><span class="op">$</span><span class="fu">carbonate</span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level5">
<h5 id="post-process-batch">Post process (Batch)<a class="anchor" aria-label="anchor" href="#post-process-batch"></a>
</h5>
<p>If you have images stored in <code>x$carbons</code> you can post them also in a tweet using.</p>
<div class="sourceCode" id="cb21"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># for multiple png attachments</span></span>
<span><span class="va">x</span><span class="op">$</span><span class="fu">rtweet</span><span class="op">(</span><span class="va">x</span><span class="op">$</span><span class="va">carbons</span>,media_type <span class="op">=</span> <span class="st">'png'</span><span class="op">)</span> <span class="co">#using default status</span></span>
<span></span>
<span><span class="co"># subsets of images</span></span>
<span><span class="va">x</span><span class="op">$</span><span class="fu">rtweet</span><span class="op">(</span>status<span class="op">=</span><span class="st">'These are images'</span>,<span class="va">x</span><span class="op">$</span><span class="va">carbons</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">1</span>,<span class="fl">3</span><span class="op">)</span><span class="op">]</span>,media_type <span class="op">=</span> <span class="st">'png'</span><span class="op">)</span></span>
<span></span>
<span><span class="co"># for gifs</span></span>
<span><span class="va">x</span><span class="op">$</span><span class="fu">rtweet</span><span class="op">(</span>status<span class="op">=</span><span class="st">'This is a gif'</span>, <span class="va">x</span><span class="op">$</span><span class="va">carbons</span>,media_type <span class="op">=</span> <span class="st">'gif'</span><span class="op">)</span></span></code></pre></div>
</div>
</details>
</div>
<div class="section level3">
<h3 id="post-image-processing">Post image processing<a class="anchor" aria-label="anchor" href="#post-image-processing"></a>
</h3>
<p>All carbon outputs are collected and saved in the list <code>x$carbons</code></p>
<details><summary>
Combining
</summary><div class="sourceCode" id="cb22"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="va">carbons</span><span class="op">%>%</span></span>
<span> <span class="fu">magick</span><span class="fu">::</span><span class="fu"><a href="https://docs.ropensci.org/magick/reference/transform.html" class="external-link">image_scale</a></span><span class="op">(</span><span class="st">'300'</span><span class="op">)</span><span class="op">%>%</span></span>
<span> <span class="fu">magick</span><span class="fu">::</span><span class="fu"><a href="https://docs.ropensci.org/magick/reference/animation.html" class="external-link">image_append</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
<p><img src="reference/figures/unnamed-chunk-28-1.png"><!-- --></p>
<div class="sourceCode" id="cb23"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span></span>
<span><span class="va">x</span><span class="op">$</span><span class="va">carbons</span><span class="op">%>%</span></span>
<span> <span class="fu">magick</span><span class="fu">::</span><span class="fu"><a href="https://docs.ropensci.org/magick/reference/transform.html" class="external-link">image_scale</a></span><span class="op">(</span><span class="st">'300'</span><span class="op">)</span><span class="op">%>%</span></span>
<span> <span class="fu">magick</span><span class="fu">::</span><span class="fu"><a href="https://docs.ropensci.org/magick/reference/animation.html" class="external-link">image_append</a></span><span class="op">(</span>stack <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div>
<p><img src="reference/figures/unnamed-chunk-28-2.png"><!-- --></p>
</details><details><summary>
GIFs
</summary><div class="sourceCode" id="cb24"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x</span><span class="op">$</span><span class="va">carbons</span><span class="op">%>%</span></span>
<span> <span class="fu">magick</span><span class="fu">::</span><span class="fu"><a href="https://docs.ropensci.org/magick/reference/animation.html" class="external-link">image_animate</a></span><span class="op">(</span>fps <span class="op">=</span> <span class="fl">1</span><span class="op">)</span></span></code></pre></div>
<p><img src="reference/figures/unnamed-chunk-29-1.gif"><!-- --></p>
</details>
</div>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<div class="links">
<h2 data-toc-skip>Links</h2>
<ul class="list-unstyled">
<li><a href="https://cloud.r-project.org/package=carbonate" class="external-link">View on CRAN</a></li>
<li><a href="https://github.com/yonicd/carbonate/" class="external-link">Browse source code</a></li>
<li><a href="https://github.com/yonicd/carbonate/issues" class="external-link">Report a bug</a></li>
</ul>
</div>
<div class="license">
<h2 data-toc-skip>License</h2>
<ul class="list-unstyled">
<li>
<a href="https://opensource.org/licenses/mit-license.php" class="external-link">MIT</a> + file <a href="LICENSE-text.html">LICENSE</a>
</li>
</ul>
</div>
<div class="citation">
<h2 data-toc-skip>Citation</h2>
<ul class="list-unstyled">
<li><a href="authors.html#citation">Citing carbonate</a></li>
</ul>
</div>
<div class="developers">
<h2 data-toc-skip>Developers</h2>
<ul class="list-unstyled">
<li>Jonathan Sidi <br><small class="roles"> Author, maintainer </small> <a href="https://orcid.org/0000-0002-4222-1819" target="orcid.widget" aria-label="ORCID" class="external-link"><span class="fab fa-orcid orcid" aria-hidden="true"></span></a> </li>
</ul>
</div>
<div class="dev-status">
<h2 data-toc-skip>Dev status</h2>
<ul class="list-unstyled">
<li><a href="https://cran.r-project.org/package=carbonate" class="external-link"><img src="http://www.r-pkg.org/badges/version/carbonate" alt="CRAN_Status_Badge"></a></li>
<li><a href="https://cran.r-project.org/package=carbonate" class="external-link"><img src="https://cranlogs.r-pkg.org/badges/carbonate"></a></li>
<li><a href="https://travis-ci.org/yonicd/carbonate" class="external-link"><img src="https://travis-ci.org/yonicd/carbonate.svg?branch=master" alt="Travis-CI Build Status"></a></li>
<li><a href="https://codecov.io/github/yonicd/carbonate?branch=master" class="external-link"><img src="https://img.shields.io/codecov/c/github/yonicd/carbonate/master.svg" alt="Coverage Status"></a></li>
<li><a href="https://goo.gl/gNRcCb" class="external-link"><img src="https://img.shields.io/badge/covrpage-Last_Build_2022_08_21-yellowgreen.svg" alt="Covrpage Summary"></a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p></p>
<p>Developed by Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p></p>
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/pkgdown.css
================================================
/* Sticky footer */
/**
* Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/
* Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css
*
* .Site -> body > .container
* .Site-content -> body > .container .row
* .footer -> footer
*
* Key idea seems to be to ensure that .container and __all its parents__
* have height set to 100%
*
*/
html, body {
height: 100%;
}
body {
position: relative;
}
body > .container {
display: flex;
height: 100%;
flex-direction: column;
}
body > .container .row {
flex: 1 0 auto;
}
footer {
margin-top: 45px;
padding: 35px 0 36px;
border-top: 1px solid #e5e5e5;
color: #666;
display: flex;
flex-shrink: 0;
}
footer p {
margin-bottom: 0;
}
footer div {
flex: 1;
}
footer .pkgdown {
text-align: right;
}
footer p {
margin-bottom: 0;
}
img.icon {
float: right;
}
/* Ensure in-page images don't run outside their container */
.contents img {
max-width: 100%;
height: auto;
}
/* Fix bug in bootstrap (only seen in firefox) */
summary {
display: list-item;
}
/* Typographic tweaking ---------------------------------*/
.contents .page-header {
margin-top: calc(-60px + 1em);
}
dd {
margin-left: 3em;
}
/* Section anchors ---------------------------------*/
a.anchor {
display: none;
margin-left: 5px;
width: 20px;
height: 20px;
background-image: url(./link.svg);
background-repeat: no-repeat;
background-size: 20px 20px;
background-position: center center;
}
h1:hover .anchor,
h2:hover .anchor,
h3:hover .anchor,
h4:hover .anchor,
h5:hover .anchor,
h6:hover .anchor {
display: inline-block;
}
/* Fixes for fixed navbar --------------------------*/
.contents h1, .contents h2, .contents h3, .contents h4 {
padding-top: 60px;
margin-top: -40px;
}
/* Navbar submenu --------------------------*/
.dropdown-submenu {
position: relative;
}
.dropdown-submenu>.dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #cccccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #ffffff;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left>.dropdown-menu {
left: -100%;
margin-left: 10px;
border-radius: 6px 0 6px 6px;
}
/* Sidebar --------------------------*/
#pkgdown-sidebar {
margin-top: 30px;
position: -webkit-sticky;
position: sticky;
top: 70px;
}
#pkgdown-sidebar h2 {
font-size: 1.5em;
margin-top: 1em;
}
#pkgdown-sidebar h2:first-child {
margin-top: 0;
}
#pkgdown-sidebar .list-unstyled li {
margin-bottom: 0.5em;
}
/* bootstrap-toc tweaks ------------------------------------------------------*/
/* All levels of nav */
nav[data-toggle='toc'] .nav > li > a {
padding: 4px 20px 4px 6px;
font-size: 1.5rem;
font-weight: 400;
color: inherit;
}
nav[data-toggle='toc'] .nav > li > a:hover,
nav[data-toggle='toc'] .nav > li > a:focus {
padding-left: 5px;
color: inherit;
border-left: 1px solid #878787;
}
nav[data-toggle='toc'] .nav > .active > a,
nav[data-toggle='toc'] .nav > .active:hover > a,
nav[data-toggle='toc'] .nav > .active:focus > a {
padding-left: 5px;
font-size: 1.5rem;
font-weight: 400;
color: inherit;
border-left: 2px solid #878787;
}
/* Nav: second level (shown on .active) */
nav[data-toggle='toc'] .nav .nav {
display: none; /* Hide by default, but at >768px, show it */
padding-bottom: 10px;
}
nav[data-toggle='toc'] .nav .nav > li > a {
padding-left: 16px;
font-size: 1.35rem;
}
nav[data-toggle='toc'] .nav .nav > li > a:hover,
nav[data-toggle='toc'] .nav .nav > li > a:focus {
padding-left: 15px;
}
nav[data-toggle='toc'] .nav .nav > .active > a,
nav[data-toggle='toc'] .nav .nav > .active:hover > a,
nav[data-toggle='toc'] .nav .nav > .active:focus > a {
padding-left: 15px;
font-weight: 500;
font-size: 1.35rem;
}
/* orcid ------------------------------------------------------------------- */
.orcid {
font-size: 16px;
color: #A6CE39;
/* margins are required by official ORCID trademark and display guidelines */
margin-left:4px;
margin-right:4px;
vertical-align: middle;
}
/* Reference index & topics ----------------------------------------------- */
.ref-index th {font-weight: normal;}
.ref-index td {vertical-align: top; min-width: 100px}
.ref-index .icon {width: 40px;}
.ref-index .alias {width: 40%;}
.ref-index-icons .alias {width: calc(40% - 40px);}
.ref-index .title {width: 60%;}
.ref-arguments th {text-align: right; padding-right: 10px;}
.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px}
.ref-arguments .name {width: 20%;}
.ref-arguments .desc {width: 80%;}
/* Nice scrolling for wide elements --------------------------------------- */
table {
display: block;
overflow: auto;
}
/* Syntax highlighting ---------------------------------------------------- */
pre, code, pre code {
background-color: #f8f8f8;
color: #333;
}
pre, pre code {
white-space: pre-wrap;
word-break: break-all;
overflow-wrap: break-word;
}
pre {
border: 1px solid #eee;
}
pre .img, pre .r-plt {
margin: 5px 0;
}
pre .img img, pre .r-plt img {
background-color: #fff;
}
code a, pre a {
color: #375f84;
}
a.sourceLine:hover {
text-decoration: none;
}
.fl {color: #1514b5;}
.fu {color: #000000;} /* function */
.ch,.st {color: #036a07;} /* string */
.kw {color: #264D66;} /* keyword */
.co {color: #888888;} /* comment */
.error {font-weight: bolder;}
.warning {font-weight: bolder;}
/* Clipboard --------------------------*/
.hasCopyButton {
position: relative;
}
.btn-copy-ex {
position: absolute;
right: 0;
top: 0;
visibility: hidden;
}
.hasCopyButton:hover button.btn-copy-ex {
visibility: visible;
}
/* headroom.js ------------------------ */
.headroom {
will-change: transform;
transition: transform 200ms linear;
}
.headroom--pinned {
transform: translateY(0%);
}
.headroom--unpinned {
transform: translateY(-100%);
}
/* mark.js ----------------------------*/
mark {
background-color: rgba(255, 255, 51, 0.5);
border-bottom: 2px solid rgba(255, 153, 51, 0.3);
padding: 1px;
}
/* vertical spacing after htmlwidgets */
.html-widget {
margin-bottom: 10px;
}
/* fontawesome ------------------------ */
.fab {
font-family: "Font Awesome 5 Brands" !important;
}
/* don't display links in code chunks when printing */
/* source: https://stackoverflow.com/a/10781533 */
@media print {
code a:link:after, code a:visited:after {
content: "";
}
}
/* Section anchors ---------------------------------
Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71
*/
div.csl-bib-body { }
div.csl-entry {
clear: both;
}
.hanging-indent div.csl-entry {
margin-left:2em;
text-indent:-2em;
}
div.csl-left-margin {
min-width:2em;
float:left;
}
div.csl-right-inline {
margin-left:2em;
padding-left:1em;
}
div.csl-indent {
margin-left: 2em;
}
================================================
FILE: docs/pkgdown.js
================================================
/* http://gregfranko.com/blog/jquery-best-practices/ */
(function($) {
$(function() {
$('.navbar-fixed-top').headroom();
$('body').css('padding-top', $('.navbar').height() + 10);
$(window).resize(function(){
$('body').css('padding-top', $('.navbar').height() + 10);
});
$('[data-toggle="tooltip"]').tooltip();
var cur_path = paths(location.pathname);
var links = $("#navbar ul li a");
var max_length = -1;
var pos = -1;
for (var i = 0; i < links.length; i++) {
if (links[i].getAttribute("href") === "#")
continue;
// Ignore external links
if (links[i].host !== location.host)
continue;
var nav_path = paths(links[i].pathname);
var length = prefix_length(nav_path, cur_path);
if (length > max_length) {
max_length = length;
pos = i;
}
}
// Add class to parent <li>, and enclosing <li> if in dropdown
if (pos >= 0) {
var menu_anchor = $(links[pos]);
menu_anchor.parent().addClass("active");
menu_anchor.closest("li.dropdown").addClass("active");
}
});
function paths(pathname) {
var pieces = pathname.split("/");
pieces.shift(); // always starts with /
var end = pieces[pieces.length - 1];
if (end === "index.html" || end === "")
pieces.pop();
return(pieces);
}
// Returns -1 if not found
function prefix_length(needle, haystack) {
if (needle.length > haystack.length)
return(-1);
// Special case for length-0 haystack, since for loop won't run
if (haystack.length === 0) {
return(needle.length === 0 ? 0 : -1);
}
for (var i = 0; i < haystack.length; i++) {
if (needle[i] != haystack[i])
return(i);
}
return(haystack.length);
}
/* Clipboard --------------------------*/
function changeTooltipMessage(element, msg) {
var tooltipOriginalTitle=element.getAttribute('data-original-title');
element.setAttribute('data-original-title', msg);
$(element).tooltip('show');
element.setAttribute('data-original-title', tooltipOriginalTitle);
}
if(ClipboardJS.isSupported()) {
$(document).ready(function() {
var copyButton = "<button type='button' class='btn btn-primary btn-copy-ex' type = 'submit' title='Copy to clipboard' aria-label='Copy to clipboard' data-toggle='tooltip' data-placement='left auto' data-trigger='hover' data-clipboard-copy><i class='fa fa-copy'></i></button>";
$("div.sourceCode").addClass("hasCopyButton");
// Insert copy buttons:
$(copyButton).prependTo(".hasCopyButton");
// Initialize tooltips:
$('.btn-copy-ex').tooltip({container: 'body'});
// Initialize clipboard:
var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', {
text: function(trigger) {
return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, "");
}
});
clipboardBtnCopies.on('success', function(e) {
changeTooltipMessage(e.trigger, 'Copied!');
e.clearSelection();
});
clipboardBtnCopies.on('error', function() {
changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy');
});
});
}
})(window.jQuery || window.$)
================================================
FILE: docs/pkgdown.yml
================================================
pandoc: '2.18'
pkgdown: 2.0.6
pkgdown_sha: ~
articles:
tests_and_coverage: tests_and_coverage.html
last_built: 2022-08-22T01:06Z
================================================
FILE: docs/reference/browse.html
================================================
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>open $uri to in browser window — .browse • carbonate</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="open $uri to in browser window — .browse"><meta property="og:description" content="opens the uri address in $uri in the browser window."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--></head><body data-spy="scroll" data-target="#toc">
<div class="container template-reference-topic">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">carbonate</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav"><li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu"><li>
<a href="../articles/tests_and_coverage.html">Tests and Coverage</a>
</li>
</ul></li>
</ul><ul class="nav navbar-nav navbar-right"><li>
<a href="https://github.com/yonicd/carbonate/" class="external-link">
<span class="fab fa-github fa-lg"></span>
</a>
</li>
</ul></div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>open $uri to in browser window</h1>
<small class="dont-index">Source: <a href="https://github.com/yonicd/carbonate/blob/HEAD/R/uri_functions.R" class="external-link"><code>R/uri_functions.R</code></a></small>
<div class="hidden name"><code>browse.Rd</code></div>
</div>
<div class="ref-description">
<p>opens the uri address in <a href="uri.html">$uri</a> in the browser window.</p>
</div>
<div id="ref-usage">
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">.browse</span><span class="op">(</span><span class="va">self</span>, <span class="va">private</span><span class="op">)</span></span></code></pre></div>
</div>
<div id="arguments">
<h2>Arguments</h2>
<dl><dt>self</dt>
<dd><p>carbon self object</p></dd>
<dt>private</dt>
<dd><p>carbon private object</p></dd>
</dl></div>
<div id="see-also">
<h2>See also</h2>
<div class="dont-index"><p><a href="carbon.html">carbon</a></p></div>
</div>
<div id="ref-examples">
<h2>Examples</h2>
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">x</span> <span class="op"><-</span> <span class="va"><a href="carbon.html">carbon</a></span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="st">'x <- 1'</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#></span> Set via '~/carbon.yml'</span>
<span class="r-out co"><span class="r-pr">#></span> palette:</span>
<span class="r-out co"><span class="r-pr">#></span> - 171.0</span>
<span class="r-out co"><span class="r-pr">#></span> - 175.0</span>
<span class="r-out co"><span class="r-pr">#></span> - 195.0</span>
<span class="r-out co"><span class="r-pr">#></span> - 0.7</span>
<span class="r-out co"><span class="r-pr">#></span> template: panda-syntax</span>
<span class="r-out co"><span class="r-pr">#></span> font_family: Fira Code</span>
<span class="r-out co"><span class="r-pr">#></span> padding_vertical: 11</span>
<span class="r-out co"><span class="r-pr">#></span> padding_horizontal: 14</span>
<span class="r-out co"><span class="r-pr">#></span> language: r</span>
<span class="r-in"><span><span class="kw">if</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/interactive.html" class="external-link">interactive</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span> <span class="va">x</span><span class="op">$</span><span class="fu">browse</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
</code></pre></div>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top"><h2 data-toc-skip>Contents</h2>
</nav></div>
</div>
<footer><div class="copyright">
<p></p><p>Developed by Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
</div>
</footer></div>
</body></html>
================================================
FILE: docs/reference/carbon.html
================================================
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Carbon R6 class — carbon • carbonate</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Carbon R6 class — carbon"><meta property="og:description" content="The Carbon generator creates a new Carbon-object, which is the class containing
all the app logic. The class is based on the R6 OO-system and
is thus reference-based with methods and data attached to each object, in
contrast to the more well known S3 and S4 systems."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--></head><body data-spy="scroll" data-target="#toc">
<div class="container template-reference-topic">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">carbonate</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav"><li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu"><li>
<a href="../articles/tests_and_coverage.html">Tests and Coverage</a>
</li>
</ul></li>
</ul><ul class="nav navbar-nav navbar-right"><li>
<a href="https://github.com/yonicd/carbonate/" class="external-link">
<span class="fab fa-github fa-lg"></span>
</a>
</li>
</ul></div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Carbon R6 class</h1>
<small class="dont-index">Source: <a href="https://github.com/yonicd/carbonate/blob/HEAD/R/carbon.R" class="external-link"><code>R/carbon.R</code></a></small>
<div class="hidden name"><code>carbon.Rd</code></div>
</div>
<div class="ref-description">
<p>The Carbon generator creates a new <code>Carbon</code>-object, which is the class containing
all the app logic. The class is based on the <a href="https://r6.r-lib.org/reference/R6Class.html" class="external-link">R6</a> OO-system and
is thus reference-based with methods and data attached to each object, in
contrast to the more well known S3 and S4 systems.</p>
</div>
<div id="initialization">
<h2>Initialization</h2>
<p>A new 'Carbon'-object is initialized using the <code>new()</code> method on the generator:</p>
<table class="table table"><tr><td><code>x <- carbon$new(code = clipr::read_clip())</code></td></tr></table></div>
<div id="fields">
<h2>Fields</h2>
<p><br><details><summary><span title="Click to Expand"> Public Fields </span> </summary></details></p>
<p>Description of fields of the R6 object that can be set by the user can be found
in the following <a href="carbon_fields.html">page</a>.</p>
<p></p>
</div>
<div id="methods">
<h2>Methods</h2>
<p><br><details><summary><span title="Click to Expand"> Interacting with Browser </span> </summary></details></p>
<table class="table table"><tr><td><a href="carbonate.ht
gitextract_2w4rwpo4/
├── .Rbuildignore
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── Bug_report.md
│ │ ├── Feature_request.md
│ │ ├── Question.md
│ │ └── Tips.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── stale.yml
│ └── weekly-digest.yml
├── .gitignore
├── .travis.yml
├── CRAN-RELEASE
├── DESCRIPTION
├── LICENSE
├── NAMESPACE
├── R/
│ ├── carbon.R
│ ├── carbon_fields.R
│ ├── carbonate.R
│ ├── helpers.R
│ ├── selenium_functions.R
│ ├── set_get_functions.R
│ └── uri_functions.R
├── README.Rmd
├── README.md
├── _pkgdown.yml
├── carbonate.Rproj
├── codecov.yml
├── cran-comments.md
├── docs/
│ ├── 404.html
│ ├── LICENSE-text.html
│ ├── PULL_REQUEST_TEMPLATE.html
│ ├── articles/
│ │ ├── index.html
│ │ └── tests_and_coverage.html
│ ├── authors.html
│ ├── bootstrap-toc.css
│ ├── bootstrap-toc.js
│ ├── docsearch.css
│ ├── docsearch.js
│ ├── index.html
│ ├── pkgdown.css
│ ├── pkgdown.js
│ ├── pkgdown.yml
│ ├── reference/
│ │ ├── browse.html
│ │ ├── carbon.html
│ │ ├── carbon_chrome.html
│ │ ├── carbon_fields.html
│ │ ├── carbon_gecko.html
│ │ ├── carbon_selenium.html
│ │ ├── carbonate.html
│ │ ├── encode.html
│ │ ├── get_carbon.html
│ │ ├── index.html
│ │ ├── options.html
│ │ ├── reprex_to_carbon_browser.html
│ │ ├── rtweet.html
│ │ ├── set_carbon.html
│ │ ├── tiny.html
│ │ ├── tinyurl.html
│ │ └── uri.html
│ └── sitemap.xml
├── hextools/
│ └── create_hex.R
├── inst/
│ └── rstudio/
│ └── addins.dcf
├── man/
│ ├── browse.Rd
│ ├── carbon.Rd
│ ├── carbon_chrome.Rd
│ ├── carbon_fields.Rd
│ ├── carbon_gecko.Rd
│ ├── carbon_selenium.Rd
│ ├── carbonate.Rd
│ ├── encode.Rd
│ ├── get_carbon.Rd
│ ├── options.Rd
│ ├── rtweet.Rd
│ ├── set_carbon.Rd
│ ├── tiny.Rd
│ ├── tinyurl.Rd
│ └── uri.Rd
├── tests/
│ ├── README.md
│ ├── testthat/
│ │ ├── helpers.R
│ │ ├── test-port.R
│ │ ├── test-set.R
│ │ ├── test-uri.R
│ │ └── test-yml.R
│ └── testthat.R
└── vignettes/
├── .gitignore
└── tests_and_coverage.Rmd
SYMBOL INDEX (5 symbols across 2 files)
FILE: docs/docsearch.js
function matchedWords (line 54) | function matchedWords(hit) {
function updateHitURL (line 73) | function updateHitURL(hit) {
FILE: docs/pkgdown.js
function paths (line 42) | function paths(pathname) {
function prefix_length (line 53) | function prefix_length(needle, haystack) {
function changeTooltipMessage (line 72) | function changeTooltipMessage(element, msg) {
Condensed preview — 85 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (370K chars).
[
{
"path": ".Rbuildignore",
"chars": 161,
"preview": "^data-raw$\n^.*\\.Rproj$\n^\\.Rproj\\.user$\n^README.Rmd$\n^_pkgdown\\.yml$\n^docs$\n^\\.travis\\.yml$\n^codecov\\.yml$\n^cran-comments"
},
{
"path": ".github/ISSUE_TEMPLATE/Bug_report.md",
"chars": 619,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\n---\n \n**Describe the bug**\n \n A clear and concise desc"
},
{
"path": ".github/ISSUE_TEMPLATE/Feature_request.md",
"chars": 566,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\n---\n \n**Is your feature request related to a problem?"
},
{
"path": ".github/ISSUE_TEMPLATE/Question.md",
"chars": 616,
"preview": "---\nname: Question\nabout: General Usage Question\n---\n \n**The problem**\n A clear and concise description of what the pr"
},
{
"path": ".github/ISSUE_TEMPLATE/Tips.md",
"chars": 515,
"preview": "---\nname: Tips\nabout: Pro tips to help others\n---\n \n**The tip** \n A clear and concise description of what you are sol"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 293,
"preview": " \n Hi, thanks for contributing!\n \n Please make sure you read our CONTRIBUTING guide.\n\nPlease fill the fields above:\n "
},
{
"path": ".github/stale.yml",
"chars": 683,
"preview": "# Number of days of inactivity before an issue becomes stale\ndaysUntilStale: 60\n# Number of days of inactivity before a "
},
{
"path": ".github/weekly-digest.yml",
"chars": 221,
"preview": "# Configuration for weekly-digest - https://github.com/apps/weekly-digest\npublishDay: sun\ncanPublishIssues: true\ncanPubl"
},
{
"path": ".gitignore",
"chars": 617,
"preview": "# History files\n.Rhistory\n.Rapp.history\n\n# Session Data files\n.RData\n# Example code in package build process\n*-Ex.R\n# Ou"
},
{
"path": ".travis.yml",
"chars": 1194,
"preview": "language: R\nsudo: false\ncache: packages\naddons:\n apt:\n packages:\n - libmagick++-dev\n - xclip\nafter_success:\n- "
},
{
"path": "CRAN-RELEASE",
"chars": 129,
"preview": "This package was submitted to CRAN on 2020-02-06.\nOnce it is accepted, delete this file and tag the release (commit 597e"
},
{
"path": "DESCRIPTION",
"chars": 875,
"preview": "Package: carbonate\nTitle: Interact with 'carbon.js'\nVersion: 0.1.4\nAuthors@R: \n person(given = \"Jonathan\",\n "
},
{
"path": "LICENSE",
"chars": 43,
"preview": "YEAR: 2018\nCOPYRIGHT HOLDER: Jonathan Sidi\n"
},
{
"path": "NAMESPACE",
"chars": 646,
"preview": "# Generated by roxygen2: do not edit by hand\n\nexport(carbon)\nexport(tinyurl)\nimportFrom(R6,R6Class)\nimportFrom(RSelenium"
},
{
"path": "R/carbon.R",
"chars": 8561,
"preview": "#' @title Carbon R6 class\n#' @description The Carbon generator creates a new `Carbon`-object, which is the class contain"
},
{
"path": "R/carbon_fields.R",
"chars": 2981,
"preview": "#' @title Carbon object fields\n#' @description Fields that can be changed in the [Carbon][carbonate::carbon] object\n#' @"
},
{
"path": "R/carbonate.R",
"chars": 3606,
"preview": "#' @title Carbonate script lines to a carbon image\n#' @description Main function of the package that invokes RSelenium t"
},
{
"path": "R/helpers.R",
"chars": 7302,
"preview": "# @title create rgba call for carbon\n# @description combines rbga vector into a string\n# @param self carbon self object\n"
},
{
"path": "R/selenium_functions.R",
"chars": 2799,
"preview": "#' @title chrome webdriver functions\n#' @description Functions to open,close,set chrome webdriver\n#' @param self carbon "
},
{
"path": "R/set_get_functions.R",
"chars": 2104,
"preview": "#' @title carbon set functions\n#' @description function that set the aesthetics of the carbon image output\n#' @param sel"
},
{
"path": "R/uri_functions.R",
"chars": 6358,
"preview": "#' @title concatenate the carbon options to a string\n#' @description combine all the carbon options into a carbon.js val"
},
{
"path": "README.Rmd",
"chars": 7271,
"preview": "---\noutput: github_document\nalways_allow_html: yes\n---\n\n<!-- README.md is generated from README.Rmd. Please edit that fi"
},
{
"path": "README.md",
"chars": 16601,
"preview": "\n<!-- README.md is generated from README.Rmd. Please edit that file -->\n\n[, R 3.5.1\n* win-builder (devel and relea"
},
{
"path": "docs/404.html",
"chars": 5086,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type"
},
{
"path": "docs/LICENSE-text.html",
"chars": 5023,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/PULL_REQUEST_TEMPLATE.html",
"chars": 5261,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/articles/index.html",
"chars": 5025,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/articles/tests_and_coverage.html",
"chars": 16952,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type"
},
{
"path": "docs/authors.html",
"chars": 5918,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/bootstrap-toc.css",
"chars": 1843,
"preview": "/*!\n * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/)\n * Copyright 2015 Aidan Feldman\n * Lic"
},
{
"path": "docs/bootstrap-toc.js",
"chars": 4764,
"preview": "/*!\n * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/)\n * Copyright 2015 Aidan Feldman\n * Lic"
},
{
"path": "docs/docsearch.css",
"chars": 11758,
"preview": "/* Docsearch -------------------------------------------------------------- */\n/*\n Source: https://github.com/algolia/d"
},
{
"path": "docs/docsearch.js",
"chars": 2018,
"preview": "$(function() {\n\n // register a handler to move the focus to the search bar\n // upon pressing shift + \"/\" (i.e. \"?\")\n "
},
{
"path": "docs/index.html",
"chars": 40339,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type"
},
{
"path": "docs/pkgdown.css",
"chars": 7308,
"preview": "/* Sticky footer */\n\n/**\n * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/\n * Details"
},
{
"path": "docs/pkgdown.js",
"chars": 3248,
"preview": "/* http://gregfranko.com/blog/jquery-best-practices/ */\n(function($) {\n $(function() {\n\n $('.navbar-fixed-top').head"
},
{
"path": "docs/pkgdown.yml",
"chars": 132,
"preview": "pandoc: '2.18'\npkgdown: 2.0.6\npkgdown_sha: ~\narticles:\n tests_and_coverage: tests_and_coverage.html\nlast_built: 2022-08"
},
{
"path": "docs/reference/browse.html",
"chars": 7883,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/carbon.html",
"chars": 9337,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/carbon_chrome.html",
"chars": 6204,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/carbon_fields.html",
"chars": 9075,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/carbon_gecko.html",
"chars": 6199,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/carbon_selenium.html",
"chars": 8176,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/carbonate.html",
"chars": 8331,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/encode.html",
"chars": 6697,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/get_carbon.html",
"chars": 6526,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/index.html",
"chars": 8719,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/options.html",
"chars": 6338,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/reprex_to_carbon_browser.html",
"chars": 9576,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/rtweet.html",
"chars": 10660,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/set_carbon.html",
"chars": 6904,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/tiny.html",
"chars": 6433,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/tinyurl.html",
"chars": 5877,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/reference/uri.html",
"chars": 7736,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" "
},
{
"path": "docs/sitemap.xml",
"chars": 1461,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n <url>\n <loc>/40"
},
{
"path": "hextools/create_hex.R",
"chars": 2328,
"preview": "library(progress)\n\nf <- function (r = 1, ...) \n{\n user <- par(\"usr\")\n pin <- par(\"pin\")\n sy <- user[4] - user[3]\n sx"
},
{
"path": "inst/rstudio/addins.dcf",
"chars": 286,
"preview": "Name: Browse carbonated Reprex\nDescription: Opens the browser for the current reprex in Carbon\nBinding: reprex_to_carbon"
},
{
"path": "man/browse.Rd",
"chars": 498,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/uri_functions.R\n\\name{.browse}\n\\alias{.bro"
},
{
"path": "man/carbon.Rd",
"chars": 2661,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/carbon.R\n\\name{carbon}\n\\alias{carbon}\n\\tit"
},
{
"path": "man/carbon_chrome.Rd",
"chars": 451,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/selenium_functions.R\n\\name{.chromeOptions}"
},
{
"path": "man/carbon_fields.Rd",
"chars": 2991,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/carbon_fields.R\n\\name{carbon_fields}\n\\alia"
},
{
"path": "man/carbon_gecko.Rd",
"chars": 449,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/selenium_functions.R\n\\name{.firefoxOptions"
},
{
"path": "man/carbon_selenium.Rd",
"chars": 1030,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/selenium_functions.R\n\\name{.start}\n\\alias{"
},
{
"path": "man/carbonate.Rd",
"chars": 1142,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/carbonate.R\n\\name{.carbonate}\n\\alias{.carb"
},
{
"path": "man/encode.Rd",
"chars": 723,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/uri_functions.R\n\\name{.encode}\n\\alias{.enc"
},
{
"path": "man/get_carbon.Rd",
"chars": 597,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/set_get_functions.R\n\\name{.get_windows_con"
},
{
"path": "man/options.Rd",
"chars": 522,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/uri_functions.R\n\\name{.options}\n\\alias{.op"
},
{
"path": "man/rtweet.Rd",
"chars": 1476,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/uri_functions.R\n\\name{.rtweet}\n\\alias{.rtw"
},
{
"path": "man/set_carbon.Rd",
"chars": 836,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/set_get_functions.R\n\\name{.set_template}\n\\"
},
{
"path": "man/tiny.Rd",
"chars": 590,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/uri_functions.R\n\\name{.tiny}\n\\alias{.tiny}"
},
{
"path": "man/tinyurl.Rd",
"chars": 295,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/uri_functions.R\n\\name{tinyurl}\n\\alias{tiny"
},
{
"path": "man/uri.Rd",
"chars": 616,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/uri_functions.R\n\\name{.uri}\n\\alias{.uri}\n\\"
},
{
"path": "tests/README.md",
"chars": 5230,
"preview": "Tests and Coverage\n================\n25 August, 2022 20:24:56\n\n- <a href=\"#coverage\" id=\"toc-coverage\">Coverage</a>\n- "
},
{
"path": "tests/testthat/helpers.R",
"chars": 726,
"preview": "# taken from https://github.com/tidyverse/reprex/blob/master/tests/testthat/helper.R\n\n## used to make clipboard unavaila"
},
{
"path": "tests/testthat/test-port.R",
"chars": 405,
"preview": "testthat::context(\"port\")\n\ncarb <- carbonate::carbon$new(code='123')\np <- carb$get_port()\n\ntestthat::describe(\"port\", {\n"
},
{
"path": "tests/testthat/test-set.R",
"chars": 594,
"preview": "testthat::context(\"set_\")\n\nx <- carbonate::carbon$new(code = \"abc\", yml = NULL)\n\ntestthat::describe(\"set functions\", {\n "
},
{
"path": "tests/testthat/test-uri.R",
"chars": 1495,
"preview": "testthat::context(\"uri\")\n\nx <- carbonate::carbon$new(code = \"abc\", yml = NULL)\n\ntestthat::describe(\"options\", {\n bench "
},
{
"path": "tests/testthat/test-yml.R",
"chars": 1645,
"preview": "testthat::context(\"yml\")\n\nthis <-\n \"palette:\\n- g: 175.0\\n- a: 0.7\\ntemplate: panda-syntax\\nfont_family: Fira Cod\\npadd"
},
{
"path": "tests/testthat.R",
"chars": 62,
"preview": "library(testthat)\nlibrary(carbonate)\n\ntest_check(\"carbonate\")\n"
},
{
"path": "vignettes/.gitignore",
"chars": 11,
"preview": "*.html\n*.R\n"
},
{
"path": "vignettes/tests_and_coverage.Rmd",
"chars": 7295,
"preview": "---\ntitle: \"Tests and Coverage\"\ndate: \"`r format(Sys.time(), '%d %B, %Y %H:%M:%S')`\"\noutput: rmarkdown::html_vignette\nvi"
}
]
About this extraction
This page contains the full source code of the yonicd/carbonate GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 85 files (339.3 KB), approximately 109.4k tokens, and a symbol index with 5 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.