Skip to content

Commit e85939d

Browse files
committed
add rankings and shinylive
1 parent b98dee8 commit e85939d

File tree

13 files changed

+1398
-0
lines changed

13 files changed

+1398
-0
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Shinylive package methods
2+
3+
## Methods
4+
5+
### R
6+
7+
Interaction:
8+
9+
```
10+
Rscript -e 'shinylive:::quarto_ext()' [methods] [args]
11+
```
12+
13+
### Python
14+
15+
Interaction:
16+
17+
```
18+
shinylive [methods] [args]
19+
```
20+
21+
## CLI Methods
22+
23+
* `extension info`
24+
* Package, version, asset version, and script paths information
25+
* `extension base-htmldeps`
26+
* Quarto html dependencies for the base shinylive integration
27+
* `extension language-resources`
28+
* Language specific resource files for the quarto html dependency named `shinylive`
29+
* `extension app-resources`
30+
* App specific resource files for the quarto html dependency named `shinylive`
31+
32+
### CLI Interface
33+
* `extension info`
34+
* Prints information about the extension including:
35+
* `version`: The version of the R package
36+
* `assets_version`: The version of the web assets
37+
* `scripts`: A list of paths scripts that are used by the extension,
38+
mainly `codeblock-to-json`
39+
* Example
40+
```
41+
{
42+
"version": "0.1.0",
43+
"assets_version": "0.2.0",
44+
"scripts": {
45+
"codeblock-to-json": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/scripts/codeblock-to-json.js"
46+
}
47+
}
48+
```
49+
* `extension base-htmldeps`
50+
* Prints the language agnostic quarto html dependencies as a JSON array.
51+
* The first html dependency is the `shinylive` service workers.
52+
* The second html dependency is the `shinylive` base dependencies. This
53+
dependency will contain the core `shinylive` asset scripts (JS files
54+
automatically sourced), stylesheets (CSS files that are automatically
55+
included), and resources (additional files that the JS and CSS files can
56+
source).
57+
* Example
58+
```
59+
[
60+
{
61+
"name": "shinylive-serviceworker",
62+
"version": "0.2.0",
63+
"meta": { "shinylive:serviceworker_dir": "." },
64+
"serviceworkers": [
65+
{
66+
"source": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive-sw.js",
67+
"destination": "/shinylive-sw.js"
68+
}
69+
]
70+
},
71+
{
72+
"name": "shinylive",
73+
"version": "0.2.0",
74+
"scripts": [{
75+
"name": "shinylive/load-shinylive-sw.js",
76+
"path": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/load-shinylive-sw.js",
77+
"attribs": { "type": "module" }
78+
}],
79+
"stylesheets": [{
80+
"name": "shinylive/shinylive.css",
81+
"path": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/shinylive.css"
82+
}],
83+
"resources": [
84+
{
85+
"name": "shinylive/shinylive.js",
86+
"path": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/shinylive.js"
87+
},
88+
... # [ truncated ]
89+
]
90+
}
91+
]
92+
```
93+
* `extension language-resources`
94+
* Prints the language-specific resource files as JSON that should be added to the quarto html dependency.
95+
* For r-shinylive, this includes the webr resource files
96+
* For py-shinylive, this includes the pyodide and pyright resource files.
97+
* Example
98+
```
99+
[
100+
{
101+
"name": "shinylive/webr/esbuild.d.ts",
102+
"path": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/webr/esbuild.d.ts"
103+
},
104+
{
105+
"name": "shinylive/webr/libRblas.so",
106+
"path": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/webr/libRblas.so"
107+
},
108+
... # [ truncated ]
109+
]
110+
* `extension app-resources`
111+
* Prints app-specific resource files as JSON that should be added to the `"shinylive"` quarto html dependency.
112+
* Currently, r-shinylive does not return any resource files.
113+
* Example
114+
```
115+
[
116+
{
117+
"name": "shinylive/pyodide/anyio-3.7.0-py3-none-any.whl",
118+
"path": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/pyodide/anyio-3.7.0-py3-none-any.whl"
119+
},
120+
{
121+
"name": "shinylive/pyodide/appdirs-1.4.4-py2.py3-none-any.whl",
122+
"path": "/<ASSETS_CACHE_DIR>/shinylive-0.2.0/shinylive/pyodide/appdirs-1.4.4-py2.py3-none-any.whl"
123+
},
124+
... # [ truncated ]
125+
]
126+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: shinylive
2+
title: Embedded Shinylive applications
3+
author: Winston Chang
4+
version: 0.2.0
5+
quarto-required: ">= 1.2.198"
6+
contributes:
7+
filters:
8+
- shinylive.lua
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
div.output-content,
2+
div.shinylive-wrapper {
3+
background-color: rgba(250, 250, 250, 0.65);
4+
border: 1px solid rgba(233, 236, 239, 0.65);
5+
border-radius: 0.5rem;
6+
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.04), 0px 3px 7px rgba(0, 0, 0, 0.04),
7+
0px 12px 30px rgba(0, 0, 0, 0.07);
8+
margin-top: 32px;
9+
margin-bottom: 32px;
10+
}
11+
12+
div.shinylive-wrapper {
13+
margin: 1em 0;
14+
border-radius: 8px;
15+
}
16+
17+
.shinylive-container {
18+
background-color: #eeeff2;
19+
min-height: auto;
20+
}
21+
22+
.shinylive-container > div {
23+
box-shadow: none;
24+
}
25+
26+
.editor-container .cm-editor .cm-scroller {
27+
font-size: 13px;
28+
line-height: 1.5;
29+
}
30+
31+
iframe.app-frame {
32+
/* Override the default margin from Bootstrap */
33+
margin-bottom: 0;
34+
}

0 commit comments

Comments
 (0)