Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update webr and devcontainer setup #3

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .devcontainer/Dockerfile

This file was deleted.

63 changes: 11 additions & 52 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,28 @@
// For format details, see https://aka.ms/devcontainer.json.
// Base image from https://github.com/devcontainers/images/tree/main/src/base-ubuntu.
{
"name": "Quarto",
// "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",
"build": {
"dockerfile": "./Dockerfile",
"context": ".",
"args": {
"VARIANT": "jammy"
}
},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"name": "Quarto Codespaces",
"image": "ghcr.io/mcanouil/quarto-codespaces:latest",
"remoteUser": "vscode",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
// Setup a non-root user. Note that UID and GID will be updated with local user values.
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
// To latest the latest build of Git.
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
// To install the latest RIG v1.*.
"ghcr.io/rocker-org/devcontainer-features/r-rig:1": {
"version": "release", // To install the latest R version (default) and other.
"vscodeRSupport": "full",
"installDevTools": "false",
"installREnv": "false",
"installRMarkdown": "false"
},
// To install the latest Python
// "ghcr.io/devcontainers/features/python:1": {
// "version": "latest"
// },
// To install the latest Quarto v1.*.
"ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {
"version": "prerelease",
"installTinyTex": "false",
"installChromium": "true"
}
// "ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {
// "version": "prerelease",
// "installTinyTex": "false",
// "installChromium": "false"
// }
},

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"quarto.quarto",
"REditorSupport.r",
"usernamehw.errorlens"
"REditorSupport.r"
],
"settings": {
"r.rterm.option": [
"--no-save",
"--no-restore-data",
"--quiet"
]
],
"r.useRenvLibPath": true
}
}
},
}
}
2 changes: 1 addition & 1 deletion _extensions/coatless/webr/_extension.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: webr
title: Embedded webr code cells
author: James Joseph Balamuta
version: 0.3.6
version: 0.3.9
quarto-required: ">=1.2.198"
contributes:
filters:
Expand Down
2 changes: 1 addition & 1 deletion _extensions/coatless/webr/webr-serviceworker.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
importScripts('https://webr.r-wasm.org/v0.2.1/webr-serviceworker.js');
importScripts('https://webr.r-wasm.org/v0.2.2/webr-serviceworker.js');
2 changes: 1 addition & 1 deletion _extensions/coatless/webr/webr-worker.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
importScripts('https://webr.r-wasm.org/v0.2.1/webr-worker.js');
importScripts('https://webr.r-wasm.org/v0.2.2/webr-worker.js');
19 changes: 14 additions & 5 deletions _extensions/coatless/webr/webr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local hasDoneWebRSetup = false
-- https://docs.r-wasm.org/webr/latest/api/js/interfaces/WebR.WebROptions.html

-- Define a base compatibile version
local baseVersionWebR = "0.2.1"
local baseVersionWebR = "0.2.2"

-- Define where WebR can be found
local baseUrl = "https://webr.r-wasm.org/v".. baseVersionWebR .."/"
Expand All @@ -33,6 +33,9 @@ local showHeaderMessage = "false"

-- Define an empty string if no packages need to be installed.
local installRPackagesList = "''"

-- Define whether R packages should automatically be loaded
local autoloadRPackages = "true"
----

--- Setup variables for tracking number of code cells
Expand Down Expand Up @@ -105,9 +108,9 @@ function setWebRInitializationOptions(meta)
-- https://docs.r-wasm.org/webr/latest/api/js/interfaces/WebR.WebROptions.html#channeltype
if not is_variable_empty(webr["channel-type"]) then
channelType = convertMetaChannelTypeToWebROption(pandoc.utils.stringify(webr["channel-type"]))
if not (channelType == "ChannelType.Automatic" and channelType == "ChannelType.ServiceWorker") then
hasServiceWorkerFiles = false
end

-- Starting from webR v0.2.2, service workers are only deployed when explicitly requested.
hasServiceWorkerFiles = (channelType == "ChannelType.ServiceWorker")
end

-- The base URL from where to load JavaScript worker scripts when loading webR
Expand Down Expand Up @@ -150,6 +153,11 @@ function setWebRInitializationOptions(meta)
end

installRPackagesList = table.concat(package_list, ", ")

if not is_variable_empty(webr['autoload-packages']) then
autoloadRPackages = pandoc.utils.stringify(webr["autoload-packages"])
end

end


Expand Down Expand Up @@ -292,7 +300,8 @@ function initializationWebR()
["CHANNELTYPE"] = channelType,
["SERVICEWORKERURL"] = serviceWorkerUrl,
["HOMEDIR"] = homeDir,
["INSTALLRPACKAGESLIST"] = installRPackagesList
["INSTALLRPACKAGESLIST"] = installRPackagesList,
["AUTOLOADRPACKAGES"] = autoloadRPackages
-- ["VERSION"] = baseVersionWebR
}

Expand Down
Binary file modified assets/images/pandoc-org.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-chocolatey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-get-started-jupyter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-get-started-neovim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-get-started-rstudio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-get-started-text-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-get-started-vscode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-org.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-project-blog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-project-book.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-project-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-project-manuscript.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-project-website.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-visual-editor-rstudio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/quarto-visual-editor-vscode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion demo/Blog/posts/post-with-code/index.qmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Post With Code"
author: "Harlow Malloc"
date: "2023-10-20"
date: "2023-11-22"
categories: [news, code, analysis]
image: "image.jpg"
---
Expand Down
2 changes: 1 addition & 1 deletion demo/Blog/posts/welcome/index.qmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Welcome To My Blog"
author: "Tristan O'Malley"
date: "2023-10-17"
date: "2023-11-19"
categories: [news]
---

Expand Down
2 changes: 1 addition & 1 deletion demo/Book/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project:
book:
title: "Book"
author: "Norah Jones"
date: "10/20/2023"
date: "11/22/2023"
chapters:
- index.qmd
- intro.qmd
Expand Down
2 changes: 2 additions & 0 deletions gentle-intro-to-quarto.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ filters:
resources:
- webr-serviceworker.js
- webr-worker.js
webr:
show-startup-message: false
---

::: {.content-visible when-profile="rlille"}
Expand Down
3 changes: 2 additions & 1 deletion poster.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ webshot2::webshot(
url = "gentle-intro-to-quarto.html",
file = "gentle-intro-to-quarto.png",
vwidth = 1920,
vheight = 1080
vheight = 1080,
delay = 1
)
1 change: 1 addition & 0 deletions quarto-extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
quarto add mcanouil/quarto-revealjs-coeos@v1.3.0
quarto add mcanouil/quarto-iconify@v1.0.7
quarto add quarto-ext/attribution@main
quarto add coatless/quarto-webr@0.3.9
2 changes: 1 addition & 1 deletion webr-serviceworker.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
importScripts('https://webr.r-wasm.org/v0.2.1/webr-serviceworker.js');
importScripts('https://webr.r-wasm.org/v0.2.2/webr-serviceworker.js');
2 changes: 1 addition & 1 deletion webr-worker.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
importScripts('https://webr.r-wasm.org/v0.2.1/webr-worker.js');
importScripts('https://webr.r-wasm.org/v0.2.2/webr-worker.js');