Discover a texrra-web sibling checkout

The repository is checked out as texrra-engine next to texrra-web, but
find_web_root only looked for ../web and ./web, so a plain
`cargo run --release -- serve examples/hello.tex 4174` served the "frontend not
found" page. The search now also accepts ../texrra-web and ./texrra-web, and the
startup warning names the sibling checkout. README and STATUS document the
accepted layouts.

Verified without TEXRRA_WEB_DIR: the server printed "Serving the web frontend
from ../texrra-web" and GET / returned the editor index.
This commit is contained in:
gloamxun committed 2026-10-27 12:56:13 +08:00
1 parent 254fd4a9a1
commit fab26234fc
3 files changed
+12 -6

No files matched your search

+4 -3
View File
@@ -12,12 +12,13 @@ Clone both repositories as siblings so the engine can discover the frontend:
``` ```
texrra/ texrra/
engine/ # this repository: Rust engine and HTTP server texrra-engine/ # this repository: Rust engine and HTTP server
web/ # texrra-web: static editor frontend texrra-web/ # texrra-web: static editor frontend
``` ```
The server resolves the frontend from `TEXRRA_WEB_DIR` when set, otherwise from The server resolves the frontend from `TEXRRA_WEB_DIR` when set, otherwise from
`../web` and then `./web`. It serves `index.html`, `styles.css`, `app.js`, and a sibling `web` or `texrra-web` directory (`./web`, `./texrra-web` and their
`../` forms). It serves `index.html`, `styles.css`, `app.js`, and
`favicon.svg`; preview font faces are generated by the engine at `/fonts.css` `favicon.svg`; preview font faces are generated by the engine at `/fonts.css`
and `/fonts/*.ttf`. and `/fonts/*.ttf`.
+1 -1
View File
@@ -2,7 +2,7 @@
The project is split into two repositories: `texrra-engine` (this Rust engine The project is split into two repositories: `texrra-engine` (this Rust engine
and HTTP server) and `texrra-web` (the static editor frontend). The engine and HTTP server) and `texrra-web` (the static editor frontend). The engine
discovers the frontend through `TEXRRA_WEB_DIR`, `../web`, or `./web`. discovers the frontend through `TEXRRA_WEB_DIR`, or a sibling `web` / `texrra-web` directory.
Rust-native, Typst-inspired incremental LaTeX engine. No external XeLaTeX is Rust-native, Typst-inspired incremental LaTeX engine. No external XeLaTeX is
invoked. The live server keeps compiled documents cached and only rebuilds when invoked. The live server keeps compiled documents cached and only rebuilds when
+7 -2
View File
@@ -66,7 +66,7 @@ fn run() -> Result<(), String> {
match &web_root { match &web_root {
Some(path) => println!("Serving the web frontend from {}", path.display()), Some(path) => println!("Serving the web frontend from {}", path.display()),
None => println!( None => println!(
"warning: no web frontend found; clone texrra-web and set TEXRRA_WEB_DIR to its directory" "warning: no web frontend found; clone texrra-web next to this checkout, or set TEXRRA_WEB_DIR to its directory"
), ),
} }
@@ -273,7 +273,12 @@ fn find_web_root() -> Result<Option<PathBuf>, String> {
} }
return Ok(Some(path)); return Ok(Some(path));
} }
for candidate in [Path::new("../web"), Path::new("web")] { for candidate in [
Path::new("../web"),
Path::new("web"),
Path::new("../texrra-web"),
Path::new("texrra-web"),
] {
if candidate.join("index.html").is_file() { if candidate.join("index.html").is_file() {
return Ok(Some(candidate.to_path_buf())); return Ok(Some(candidate.to_path_buf()));
} }