Skip to content
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
970 changes: 452 additions & 518 deletions Cargo.lock

Large diffs are not rendered by default.

35 changes: 22 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,30 @@ git clone https://github.com/freecomputinglab/rheo.git ../rheo

The `Cargo.toml` path dependencies point to `../rheo/crates/*`.

### 2. Install @rheo/* Typst packages

Some tests require the `@rheo/*` Typst packages (for `#import "@rheo/..."` syntax). Install them:
## CI

```bash
# Clone rheo-packages into the Typst package cache
git clone https://github.com/freecomputinglab/rheo-packages.git ~/.cache/typst/packages/rheo
CI lives entirely in the main rheo repo (`.github/workflows/ci.yml`). rheo-tests has no CI of its own — it is cloned as a sibling by rheo's CI at test time.

### Branch naming convention

# Build the packages (requires pnpm 10+ and Node 22+)
cd ~/.cache/typst/packages/rheo
pnpm install
just build
When a rheo-tests change needs to pair with a rheo PR, name the rheo-tests branch `rheo/<rheo-branch>`. Rheo's CI auto-detects this and clones the paired branch instead of `main`:

```
rheo branch → rheo-tests branch cloned by rheo CI
────────────────────────────────────────────────────────────
feat/typst-v0.15.0 → rheo/feat/typst-v0.15.0 (if exists, else main)
main → main
fix/some-bug → main (no paired branch)
```

### Merge order

When a rheo-tests PR pairs with a rheo PR:

1. Merge the rheo-tests PR first (snapshots land on `main`)
2. Then merge the rheo PR (rheo CI now uses rheo-tests `main`, which already has the updated snapshots)

## Test Structure

```
Expand Down Expand Up @@ -58,10 +68,9 @@ just build
│ │ │ └── epub/
│ │ └── blog_post/
│ └── cases/
├── store/ # Compat test fixtures (committed)
│ └── compat/
│ └── merged-imports/
└── .github/ # CI workflows
└── store/ # Compat test fixtures (committed)
└── compat/
└── merged-imports/
```

## Running Tests
Expand Down
29 changes: 29 additions & 0 deletions cases/math/main.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// @rheo:test
// @rheo:formats html,epub
// @rheo:description Tests MathML output for inline and display math in HTML and EPUB

= Math Test

== Inline Math

The Pythagorean theorem: $a^2 + b^2 = c^2$.

Euler's identity: $e^(i pi) + 1 = 0$.

== Display Math

The quadratic formula:

$ x = (-b plus.minus sqrt(b^2 - 4a c)) / (2a) $

A definite integral:

$ integral_0^1 x^2 dif x = 1/3 $

== Paragraph Grouping

First paragraph.

Second paragraph with #emph[emphasis] and #strong[bold] text.

Third paragraph.
6 changes: 6 additions & 0 deletions cases/math/rheo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version = "0.3.1"
formats = ["html", "epub"]

[html.spine]
title = "Math Test"
vertebrae = ["main.typ"]
19 changes: 19 additions & 0 deletions cases/rheo_package_slides/main.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @rheo:test
// @rheo:formats html
// @rheo:description Tests that @rheo/slides:0.1.0 is downloaded, cached, and compiled correctly

#import "@rheo/slides:0.1.0": template, slide

#show: template.with(title: "Test Slides")

#slide[
== First Slide

Hello from slide one.
]

#slide[
== Second Slide

Hello from slide two.
]
6 changes: 6 additions & 0 deletions cases/rheo_package_slides/rheo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version = "0.3.1"
formats = ["html"]

[html.spine]
title = "Rheo Package Slides"
vertebrae = ["main.typ"]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"filetype": "pdf",
"file_size": 28288,
"file_size": 25565,
"page_count": 1
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"filetype": "pdf",
"file_size": 1239761,
"file_size": 1237240,
"page_count": 2
}
18 changes: 2 additions & 16 deletions ref/examples/cross_directory_links/html/ch1.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.header {
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>.header {
max-height: 40px;
display: flex;
justify-content: center;
Expand Down Expand Up @@ -131,13 +126,4 @@
font-size: 0.9em;
}
}
</style></head>
<body>
<h2>Chapter 1</h2>
<p>This is the first chapter.</p>
<h3>References</h3>
<p>Go back to <a href="../intro.html">the introduction</a>.</p>
<p>Continue to <a href="ch2.html">Chapter 2</a> (sibling).</p>
<p>See <a href="../appendix/notes.html">the appendix notes</a> for additional info.</p>
</body>
</html>
</style></head><body><h2>Chapter 1</h2><p>This is the first chapter.</p><h3>References</h3><p>Go back to <a href="../intro.html">the introduction</a>.</p><p>Continue to <a href="ch2.html">Chapter 2</a> (sibling).</p><p>See <a href="../appendix/notes.html">the appendix notes</a> for additional info.</p></body></html>
19 changes: 2 additions & 17 deletions ref/examples/cross_directory_links/html/ch2.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.header {
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>.header {
max-height: 40px;
display: flex;
justify-content: center;
Expand Down Expand Up @@ -131,14 +126,4 @@
font-size: 0.9em;
}
}
</style></head>
<body>
<h2>Chapter 2</h2>
<p>This is the second chapter.</p>
<h3>Navigation</h3>
<p>Previous: <a href="ch1.html">Chapter 1</a></p>
<p>Root: <a href="../intro.html">Introduction</a></p>
<h3>Content</h3>
<p>Testing cross-directory navigation patterns.</p>
</body>
</html>
</style></head><body><h2>Chapter 2</h2><p>This is the second chapter.</p><h3>Navigation</h3><p>Previous: <a href="ch1.html">Chapter 1</a></p><p>Root: <a href="../intro.html">Introduction</a></p><h3>Content</h3><p>Testing cross-directory navigation patterns.</p></body></html>
17 changes: 2 additions & 15 deletions ref/examples/cross_directory_links/html/intro.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.header {
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>.header {
max-height: 40px;
display: flex;
justify-content: center;
Expand Down Expand Up @@ -131,12 +126,4 @@
font-size: 0.9em;
}
}
</style></head>
<body>
<h2>Introduction</h2>
<p>Welcome to the cross-directory test.</p>
<h3>Overview</h3>
<p>This document links to <a href="chapters/ch1.html">Chapter 1</a>.</p>
<p>See also <a href="chapters/ch2.html">Chapter 2</a> for more details.</p>
</body>
</html>
</style></head><body><h2>Introduction</h2><p>Welcome to the cross-directory test.</p><h3>Overview</h3><p>This document links to <a href="chapters/ch1.html">Chapter 1</a>.</p><p>See also <a href="chapters/ch2.html">Chapter 2</a> for more details.</p></body></html>
19 changes: 2 additions & 17 deletions ref/examples/cross_directory_links/html/notes.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.header {
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>.header {
max-height: 40px;
display: flex;
justify-content: center;
Expand Down Expand Up @@ -131,14 +126,4 @@
font-size: 0.9em;
}
}
</style></head>
<body>
<h2>Appendix: Notes</h2>
<p>Additional notes and references.</p>
<h3>Cross References</h3>
<p>Back to <a href="../chapters/ch1.html">Chapter 1</a>.</p>
<p>Return to <a href="../intro.html">the introduction</a>.</p>
<h3>Details</h3>
<p>Testing links from a different subdirectory.</p>
</body>
</html>
</style></head><body><h2>Appendix: Notes</h2><p>Additional notes and references.</p><h3>Cross References</h3><p>Back to <a href="../chapters/ch1.html">Chapter 1</a>.</p><p>Return to <a href="../intro.html">the introduction</a>.</p><h3>Details</h3><p>Testing links from a different subdirectory.</p></body></html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"filetype": "pdf",
"file_size": 26778,
"file_size": 23644,
"page_count": 1
}
28 changes: 2 additions & 26 deletions ref/examples/index/html/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.header {
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>.header {
max-height: 40px;
display: flex;
justify-content: center;
Expand Down Expand Up @@ -131,23 +126,4 @@
font-size: 0.9em;
}
}
</style></head>
<body>
<h2>Screening the subject</h2>
<p><em>Screening the subject</em> is a blog that analyses content on both the big and small screen in reasonable detail, i.e. episode-by-episode or scene-by-scene. Contact us at <a href="mailto:info@ohrg.org">info@ohrg.org</a> for enquiries.</p>
<ul>
<li><a href="./severance-ep-1.html">Severance, s1/e1</a></li>
<li><a href="./severance-ep-2.html">Severance, s1/e2</a></li>
<li><a href="./severance-ep-3.html">Severance, s1/e3</a></li>
</ul>
<div class>
<p><br></p>
<hr>
<ul class>
<li class><a href="./index.html">Home</a></li>
<li class><a href="https://lachlankermode.com">Learn more</a> about me</li>
<li class><a href="https://ohrg.org">Read other musings</a></li>
</ul>
</div>
</body>
</html>
</style></head><body><h2>Screening the subject</h2><p><em>Screening the subject</em> is a blog that analyses content on both the big and small screen in reasonable detail, i.e. episode-by-episode or scene-by-scene. Contact us at <a href="mailto:info@ohrg.org">info@ohrg.org</a> for enquiries.</p><ul><li><a href="./severance-ep-1.html">Severance, s1/e1</a></li><li><a href="./severance-ep-2.html">Severance, s1/e2</a></li><li><a href="./severance-ep-3.html">Severance, s1/e3</a></li></ul><div class><br><hr><ul class><li class><a href="./index.html">Home</a></li><li class><a href="https://lachlankermode.com">Learn more</a> about me</li><li class><a href="https://ohrg.org">Read other musings</a></li></ul></div></body></html>
2 changes: 1 addition & 1 deletion ref/examples/index/pdf/index.metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"filetype": "pdf",
"file_size": 20019,
"file_size": 17619,
"page_count": 1
}
15 changes: 2 additions & 13 deletions ref/examples/link_path_edge_cases/html/chapter-01.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.header {
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>.header {
max-height: 40px;
display: flex;
justify-content: center;
Expand Down Expand Up @@ -131,10 +126,4 @@
font-size: 0.9em;
}
}
</style></head>
<body>
<h2>Chapter 01</h2>
<p>This filename contains numbers.</p>
<p>Back to <a href="main.html">main</a>.</p>
</body>
</html>
</style></head><body><h2>Chapter 01</h2><p>This filename contains numbers.</p><p>Back to <a href="main.html">main</a>.</p></body></html>
15 changes: 2 additions & 13 deletions ref/examples/link_path_edge_cases/html/file-name.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.header {
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>.header {
max-height: 40px;
display: flex;
justify-content: center;
Expand Down Expand Up @@ -131,10 +126,4 @@
font-size: 0.9em;
}
}
</style></head>
<body>
<h2>File with Hyphen</h2>
<p>This filename contains a hyphen.</p>
<p>Back to <a href="main.html">main</a>.</p>
</body>
</html>
</style></head><body><h2>File with Hyphen</h2><p>This filename contains a hyphen.</p><p>Back to <a href="main.html">main</a>.</p></body></html>
15 changes: 2 additions & 13 deletions ref/examples/link_path_edge_cases/html/file_name.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.header {
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>.header {
max-height: 40px;
display: flex;
justify-content: center;
Expand Down Expand Up @@ -131,10 +126,4 @@
font-size: 0.9em;
}
}
</style></head>
<body>
<h2>File with Underscore</h2>
<p>This filename contains an underscore.</p>
<p>Back to <a href="main.html">main</a>.</p>
</body>
</html>
</style></head><body><h2>File with Underscore</h2><p>This filename contains an underscore.</p><p>Back to <a href="main.html">main</a>.</p></body></html>
21 changes: 2 additions & 19 deletions ref/examples/link_path_edge_cases/html/main.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.header {
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>.header {
max-height: 40px;
display: flex;
justify-content: center;
Expand Down Expand Up @@ -131,16 +126,4 @@
font-size: 0.9em;
}
}
</style></head>
<body>
<h2>Path Edge Cases Test</h2>
<p>This tests unusual but valid filename patterns.</p>
<h3>Links to Edge Case Files</h3>
<p>Hyphen: <a href="file-name.html">file with hyphen</a></p>
<p>Underscore: <a href="file_name.html">file with underscore</a></p>
<p>Dot in name: <a href="version-1.0.html">file with dot</a></p>
<p>Number: <a href="chapter-01.html">file with number</a></p>
<h3>Content</h3>
<p>All these edge cases should transform correctly.</p>
</body>
</html>
</style></head><body><h2>Path Edge Cases Test</h2><p>This tests unusual but valid filename patterns.</p><h3>Links to Edge Case Files</h3><p>Hyphen: <a href="file-name.html">file with hyphen</a></p><p>Underscore: <a href="file_name.html">file with underscore</a></p><p>Dot in name: <a href="version-1.0.html">file with dot</a></p><p>Number: <a href="chapter-01.html">file with number</a></p><h3>Content</h3><p>All these edge cases should transform correctly.</p></body></html>
Loading