This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swagger_viewer <- function(json_doc) { | |
folder_path <- fs::path_temp("swagger") | |
if (!fs::dir_exists(folder_path)) { | |
fs::dir_copy(swagger::swagger_path(), folder_path) | |
} | |
fs::file_copy(json_doc, folder_path) | |
index <- xfun::read_utf8(fs::path_temp("swagger", "index.html")) | |
index_new <- gsub("http://petstore.swagger.io/v2/swagger.json", json_doc, index) | |
xfun::write_utf8(index_new, fs::path_temp("swagger", "index.html")) | |
rstudioapi::viewer(fs::path_temp("swagger", "index.html")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "test" | |
output: | |
html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = FALSE) | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) 2018 C. Dervieux | |
# Licence MIT - https://spdx.org/licenses/MIT.html | |
#' Update git remote url from R | |
#' | |
#' If git remote server is migrated and url is changed, this function allows to easily update | |
#' the url of local git repo to the new git remote url. | |
#' | |
#' This function need `git2r`, `urltools` and `glue` to work. | |
#' |
BINPREF
must be set toC:/Rtools/mingw_$(WIN)/bin/
(/
are important)- Rtools must be on the path:
C:\\Rtools\\bin\\;
(/
less important)
This will make installation ok no matter the 📦 (like remotes
)
install.packages
in rstudio is not directly utils::install.packages()
. There is some things set after some verification. Like setting BINPREF
.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on issue https://github.com/RLesur/crrri/issues/30 | |
# from Rlesur/crrri@feature/build-on-cdp-session | |
# tested with 59747341 | |
devtools::load_all() | |
# launch | |
work_dir <- chr_new_data_dir() | |
chrome <- chr_launch(work_dir = work_dir, headless = TRUE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Programmatically create a document" | |
date: "`r Sys.Date()`" | |
output: | |
pagedown::html_paged: | |
toc: true | |
# change to true for a self-contained document, but it'll be a litte slower for Pandoc to render | |
self_contained: false | |
--- |
- Advanced R markdown workshop: https://arm.rbind.io/
inspired from https://gitlab.pagedmedia.org/tools/pagedjs-cli/blob/master/index.js
This implement a Printer class that extend EventEmitter which does:
- browser = puppeteer.launch()
- page = browser.newPage()
- Serving the paged html locally
/print
the website/polyfill
les scripts js
- page.goto(
http://localhost:${port}/print/${basename}
) locally served files