Skip to content

Commit e461168

Browse files
committed
Add tests website
1 parent 5f9172a commit e461168

File tree

6 files changed

+104
-1
lines changed

6 files changed

+104
-1
lines changed

.github/workflows/publish-docs.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,24 @@ jobs:
3636
with:
3737
path: "demos/readme/index.qmd"
3838

39+
- name: Render test suite
40+
uses: quarto-dev/quarto-actions/render@v2
41+
with:
42+
path: "tests"
43+
3944
# Collect the output into the staging/ directory
4045
- name: Copy documentation portal & demos into the staging directory
4146
run: |
4247
mkdir -p staging/{demos,tests} && \
4348
cp -rp docs/_site/* staging/ && \
49+
cp -rp tests/_site/* staging/tests/ && \
4450
cp -rp demos/readme/ staging/demos/readme
4551
4652
# Remove symlinks
4753
- name: Delete symlinks
4854
run: |
49-
rm -rf staging/demos/*/_extensions
55+
rm -rf staging/demos/*/_extensions && \
56+
rm -rf staging/tests/_extensions
5057
5158
# Publish the docs directory onto gh-pages
5259
- name: Deploy 🚀

docs/_quarto.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ website:
1818
- section: "Getting Started"
1919
- section: "Support"
2020
contents:
21+
- href: qpyodide-faq.qmd
22+
text: "Frequently Asked Questions"
2123
- href: https://github.com/coatless-quarto/pyodide/issues/new
2224
text: Submit an issue
2325
- section: "Demos"

tests/_extensions

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../_extensions

tests/_quarto.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
project:
2+
type: website
3+
4+
website:
5+
title: "Test Suite for quarto-pyodide"
6+
search: true
7+
reader-mode: true
8+
sidebar:
9+
style: "floating"
10+
contents:
11+
- href: index.qmd
12+
text: Home
13+
- href: ../../
14+
text: Main Website
15+
- section: "Tests"
16+
contents:
17+
- auto: "*test*.qmd"
18+
19+
20+
page-footer:
21+
left: "Test suite for quarto-webr."
22+
right:
23+
- icon: github
24+
href: https://github.com/coatless-quarto/pyodide
25+
26+
# Set the language that should be used for Quarto websites
27+
# https://github.com/quarto-dev/quarto-cli/tree/main/src/resources/language
28+
# lang: en
29+
30+
# Attach pyodide to every page
31+
filters:
32+
- pyodide

tests/index.qmd

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: "quarto-pyodide Test Website"
3+
subtitle: "Extension Test Suite"
4+
---
5+
6+
# Welcome
7+
8+
Welcome to the test suite website for the [`quarto-pyodide`](https://github.com/coatless-quarto/pyodide). This website is meant to examine how different features of the extension are working or not working across different browsers.
9+
10+
```{webr-r}
11+
print("Welcome to behind the scenes of quarto-pyodide!")
12+
```

tests/qpyodide-internal-cell.qmd

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: "Test: Cell Context Options"
3+
format: html
4+
filters:
5+
- pyodide
6+
---
7+
8+
Test page for verifying cell context options set explicitly with `context`.
9+
10+
## Interactive
11+
12+
### Static
13+
```{pyodide-python}
14+
#| context: interactive
15+
1 + 1
16+
```
17+
18+
### Autorun
19+
20+
```{pyodide-python}
21+
#| context: interactive
22+
#| autorun: true
23+
1 + 1
24+
```
25+
26+
## Setup
27+
28+
Hidden cell that sets `x` and `y` vector values.
29+
30+
```{pyodide-python}
31+
#| context: setup
32+
x = c(1, 5, 3, -2)
33+
y = c(-5, 8, 9, 4)
34+
```
35+
36+
## Output
37+
38+
Hidden cell that retrieves previously set `x` and `y` vector values and displays the data.
39+
40+
```{pyodide-python}
41+
#| context: output
42+
cat("x: ")
43+
print(x)
44+
45+
cat("y: ")
46+
print(y)
47+
48+
plot(x, y)
49+
```

0 commit comments

Comments
 (0)