site: the report's two volumes as PDFs, and its page count on the home page; make pdf makes one PDF to a volume Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| @@ -114,15 +114,15 @@ | ||
| 114 | 114 | ./raz -Werror -o build/Doc tools/Doc.raz |
| 115 | 115 | build/Doc man $(LIBDOC:%=lib/%.raz) > $@ |
| 116 | 116 | |
| 117 | -# the report as a PDF, by pandoc and Chromium; not part of check, as | |
| 118 | -# CI has neither | |
| 119 | -pdf: build/raz.pdf | |
| 117 | +# the two volumes of the report as PDFs, by pandoc and Chromium; not | |
| 118 | +# part of check, as CI has neither | |
| 119 | +pdf: build/raz.pdf build/raz-lib.pdf | |
| 120 | 120 | |
| 121 | -build/raz.pdf: doc/raz.md doc/raz-lib.md doc/report.css | build | |
| 122 | - pandoc doc/raz.md doc/raz-lib.md -s --toc --toc-depth=1 --shift-heading-level-by=-1 \ | |
| 121 | +build/%.pdf: doc/%.md doc/report.css | build | |
| 122 | + pandoc doc/$*.md -s --toc --toc-depth=1 --shift-heading-level-by=-1 \ | |
| 123 | 123 | --syntax-highlighting=none -c ../doc/report.css \ |
| 124 | - -o build/raz.html | |
| 125 | - chromium --headless --no-pdf-header-footer --print-to-pdf=$@ build/raz.html 2>/dev/null | |
| 124 | + -o build/$*.html | |
| 125 | + chromium --headless --no-pdf-header-footer --print-to-pdf=$@ build/$*.html 2>/dev/null | |
| 126 | 126 | |
| 127 | 127 | # raz, its library and its tools go together under $(PREFIX)/lib/raz, |
| 128 | 128 | # laid out as in the tarball; the link on PATH works since raz finds |
| @@ -170,7 +170,7 @@ | ||
| 170 | 170 | # "Raz, Set, Go" (whose programs are run here, so the output shown is |
| 171 | 171 | # real), the report and the latest release's tarball. site/build.py |
| 172 | 172 | # says how; it needs ./raz and pandoc. |
| 173 | -site: raz | |
| 173 | +site: raz pdf | |
| 174 | 174 | python3 site/build.py |
| 175 | 175 | |
| 176 | 176 | .PHONY: units tests seed-check seed-bench fixpoint check gdb bench kernels stress fmt loc man pdf dist site clean install uninstall |
| @@ -42,7 +42,7 @@ | ||
| 42 | 42 | | `examples/` | Small programs, each with the output it should give | |
| 43 | 43 | | `tools/Doc.raz` | Prints what a module exports, with its comments | |
| 44 | 44 | | `tools/Pretty.raz` | The formatter: fixes indentation and spacing | |
| 45 | -| `site/` | The website: home page, the tours "Raz, Set, Go" and "More Raz", the report and the latest release's tarball, as plain files in `site/public/`; `make site` rebuilds them | | |
| 45 | +| `site/` | The website: home page, the tours "Raz, Set, Go" and "More Raz", the report and the latest release's tarball, as plain files in `site/public/`; `make site` rebuilds them, with the report's two PDFs (`make pdf`) | | |
| 46 | 46 | | `editor/` | Support for vim and emacs | |
| 47 | 47 | | `conform/` | The conformance suite: what every implementation must do | |
| 48 | 48 | | `test/` | This compiler's own tests, and the scripts that run them | |
| @@ -380,9 +380,12 @@ | ||
| 380 | 380 | text = text.replace("@SNIPPET@", highlight(snippet.rstrip("\n"))) |
| 381 | 381 | text = text.replace("@OUTPUT@", html.escape(stdout.rstrip("\n"))) |
| 382 | 382 | version, name, digest = releases[-1] |
| 383 | + pages = re.search(r"Pages:\s+(\d+)", subprocess.run( | |
| 384 | + ["pdfinfo", os.path.join(ROOT, "build", "raz.pdf")], | |
| 385 | + capture_output=True, text=True, check=True).stdout).group(1) | |
| 383 | 386 | earlier = ", ".join('<a href="download/%s">%s</a>' % (n, v) |
| 384 | 387 | for v, n, _ in reversed(releases[:-1])) |
| 385 | - text = text.replace("@EARLIER@", earlier) | |
| 388 | + text = text.replace("@EARLIER@", earlier).replace("@PAGES@", pages) | |
| 386 | 389 | text = text.replace("@VERSION@", version).replace("@TARBALL@", name) |
| 387 | 390 | text = text.replace("@DIR@", name[:-len(".tar.gz")]).replace("@SHA256@", digest) |
| 388 | 391 | write("index.html", page("raz: a small systems language", text, 0, "home")) |
| @@ -418,6 +421,8 @@ | ||
| 418 | 421 | build_tour(tour, lessons, nxt) |
| 419 | 422 | counts.append(len(lessons)) |
| 420 | 423 | build_spec() |
| 424 | + for pdf in ("raz.pdf", "raz-lib.pdf"): # made by make pdf | |
| 425 | + shutil.copy(os.path.join(ROOT, "build", pdf), OUT) | |
| 421 | 426 | build_home(build_download()) |
| 422 | 427 | print("site/public: %s lessons" % " + ".join(map(str, counts))) |
| 423 | 428 |
| @@ -22,6 +22,7 @@ | ||
| 22 | 22 | <div class="facts"> |
| 23 | 23 | <span><b>~10,700</b> lines of compiler</span> |
| 24 | 24 | <span><b>~500K</b> lines compiled a second</span> |
| 25 | + <span><b>1</b> report, <b>@PAGES@</b> pages</span> | |
| 25 | 26 | <span><b>static</b> executables, no run time to install</span> |
| 26 | 27 | </div> |
| 27 | 28 | |
| @@ -58,8 +59,11 @@ | ||
| 58 | 59 | volatile accesses, atomics and lock-free code, in 18 more.</p> |
| 59 | 60 | |
| 60 | 61 | <h2>The language, in writing</h2> |
| 61 | -<p>The language is defined by <a href="spec.html">the report</a>, in two volumes (the language, then the library), which is | |
| 62 | -short on purpose: whatever it doesn’t allow, raz doesn’t have.</p> | |
| 62 | +<p>The language is defined by <a href="spec.html">the report</a>, which is | |
| 63 | +short on purpose: whatever it doesn’t allow, raz doesn’t have. | |
| 64 | +Its second volume describes the library. Both are on one page, and each is | |
| 65 | +a PDF: <a href="raz.pdf">the language</a> (@PAGES@ pages) and | |
| 66 | +<a href="raz-lib.pdf">the library</a>.</p> | |
| 63 | 67 | |
| 64 | 68 | <h2 id="download">Download</h2> |
| 65 | 69 | <p>raz @VERSION@ is a tarball for x86-64 Linux with the compiler, <code>raz</code>, |
| @@ -1,2 +1,3 @@ | ||
| 1 | +<p><a href="raz.pdf">Volume 1 as a PDF</a> · <a href="raz-lib.pdf">Volume 2 as a PDF</a></p> | |
| 1 | 2 | $if(toc)$$toc$$endif$ |
| 2 | 3 | $body$ |
| @@ -42,6 +42,7 @@ | ||
| 42 | 42 | <div class="facts"> |
| 43 | 43 | <span><b>~10,700</b> lines of compiler</span> |
| 44 | 44 | <span><b>~500K</b> lines compiled a second</span> |
| 45 | + <span><b>1</b> report, <b>26</b> pages</span> | |
| 45 | 46 | <span><b>static</b> executables, no run time to install</span> |
| 46 | 47 | </div> |
| 47 | 48 | |
| @@ -104,8 +105,11 @@ | ||
| 104 | 105 | volatile accesses, atomics and lock-free code, in 18 more.</p> |
| 105 | 106 | |
| 106 | 107 | <h2>The language, in writing</h2> |
| 107 | -<p>The language is defined by <a href="spec.html">the report</a>, in two volumes (the language, then the library), which is | |
| 108 | -short on purpose: whatever it doesn’t allow, raz doesn’t have.</p> | |
| 108 | +<p>The language is defined by <a href="spec.html">the report</a>, which is | |
| 109 | +short on purpose: whatever it doesn’t allow, raz doesn’t have. | |
| 110 | +Its second volume describes the library. Both are on one page, and each is | |
| 111 | +a PDF: <a href="raz.pdf">the language</a> (26 pages) and | |
| 112 | +<a href="raz-lib.pdf">the library</a>.</p> | |
| 109 | 113 | |
| 110 | 114 | <h2 id="download">Download</h2> |
| 111 | 115 | <p>raz 0.11.0 is a tarball for x86-64 Linux with the compiler, <code>raz</code>, |
Binary file; the patch has it.
Binary file; the patch has it.
| @@ -18,7 +18,8 @@ | ||
| 18 | 18 | <body> |
| 19 | 19 | <header><nav><a class="mark" href="index.html"><img src="logo.svg" width="26" height="26" alt="">raz</a><a href="tour/index.html">Raz, Set, Go</a><a href="advanced/index.html">More Raz</a><a href="spec.html" aria-current="page">Report</a><a href="index.html#download">Download</a></nav></header> |
| 20 | 20 | <main> |
| 21 | -<div class="spec"><ul> | |
| 21 | +<div class="spec"><p><a href="raz.pdf">Volume 1 as a PDF</a> · <a href="raz-lib.pdf">Volume 2 as a PDF</a></p> | |
| 22 | +<ul> | |
| 22 | 23 | <li><a href="#a-first-look" id="toc-a-first-look">1. A first look</a></li> |
| 23 | 24 | <li><a href="#words-and-symbols" id="toc-words-and-symbols">2. Words and symbols</a></li> |
| 24 | 25 | <li><a href="#modules" id="toc-modules">3. Modules</a></li> |