|
1 | 1 | # Makefile for problemreductions |
2 | 2 |
|
3 | | -.PHONY: help build test fmt clippy doc mdbook paper examples clean coverage rust-export compare qubo-testdata export-schemas release run-plan |
| 3 | +.PHONY: help build test fmt clippy doc mdbook paper examples clean coverage rust-export compare qubo-testdata export-schemas release run-plan diagrams |
4 | 4 |
|
5 | 5 | # Default target |
6 | 6 | help: |
|
11 | 11 | @echo " fmt-check - Check code formatting" |
12 | 12 | @echo " clippy - Run clippy lints" |
13 | 13 | @echo " doc - Build mdBook documentation" |
| 14 | + @echo " diagrams - Generate SVG diagrams from Typst (light + dark)" |
14 | 15 | @echo " mdbook - Build and serve mdBook (with live reload)" |
15 | 16 | @echo " paper - Build Typst paper (requires typst)" |
16 | 17 | @echo " coverage - Generate coverage report (requires cargo-llvm-cov)" |
@@ -47,16 +48,26 @@ clippy: |
47 | 48 | # Build mdBook documentation |
48 | 49 | doc: |
49 | 50 | cargo run --example export_graph |
50 | | - cp docs/paper/reduction_graph.json docs/src/reductions/ |
| 51 | + cargo run --example export_schemas |
51 | 52 | mdbook build docs |
52 | 53 | RUSTDOCFLAGS="--default-theme=dark" cargo doc --all-features --no-deps |
53 | 54 | rm -rf docs/book/api |
54 | 55 | cp -r target/doc docs/book/api |
55 | 56 |
|
| 57 | +# Generate SVG diagrams from Typst sources (light + dark themes) |
| 58 | +TYPST_DIAGRAMS := $(wildcard docs/src/static/*.typ) |
| 59 | +diagrams: |
| 60 | + @for src in $(TYPST_DIAGRAMS); do \ |
| 61 | + base=$$(basename $$src .typ); \ |
| 62 | + echo "Compiling $$base..."; \ |
| 63 | + typst compile $$src --input dark=false docs/src/static/$$base.svg; \ |
| 64 | + typst compile $$src --input dark=true docs/src/static/$$base-dark.svg; \ |
| 65 | + done |
| 66 | + |
56 | 67 | # Build and serve mdBook with API docs |
57 | 68 | mdbook: |
58 | 69 | cargo run --example export_graph |
59 | | - cp docs/paper/reduction_graph.json docs/src/reductions/ |
| 70 | + cargo run --example export_schemas |
60 | 71 | RUSTDOCFLAGS="--default-theme=dark" cargo doc --all-features --no-deps |
61 | 72 | mdbook build |
62 | 73 | rm -rf book/api |
@@ -84,7 +95,7 @@ export-schemas: |
84 | 95 | paper: examples |
85 | 96 | cargo run --example export_graph |
86 | 97 | cargo run --example export_schemas |
87 | | - cd docs/paper && typst compile reductions.typ reductions.pdf |
| 98 | + cd docs/paper && typst compile --root .. reductions.typ reductions.pdf |
88 | 99 |
|
89 | 100 | # Generate coverage report (requires: cargo install cargo-llvm-cov) |
90 | 101 | coverage: |
|
0 commit comments