raz / commit 1de77d7b

commit
1de77d7befacf43b1f746645b6cf9fdce14f92c7
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
5f52a746
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>

patch · log

9 files changed, +30 -15

Makefile (history) modified +8 -8

@@ -114,15 +114,15 @@
114114 ./raz -Werror -o build/Doc tools/Doc.raz
115115 build/Doc man $(LIBDOC:%=lib/%.raz) > $@
116116
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
120120
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 \
123123 --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
126126
127127 # raz, its library and its tools go together under $(PREFIX)/lib/raz,
128128 # laid out as in the tarball; the link on PATH works since raz finds
@@ -170,7 +170,7 @@
170170 # "Raz, Set, Go" (whose programs are run here, so the output shown is
171171 # real), the report and the latest release's tarball. site/build.py
172172 # says how; it needs ./raz and pandoc.
173-site: raz
173+site: raz pdf
174174 python3 site/build.py
175175
176176 .PHONY: units tests seed-check seed-bench fixpoint check gdb bench kernels stress fmt loc man pdf dist site clean install uninstall

README.md (history) modified +1 -1

@@ -42,7 +42,7 @@
4242 | `examples/` | Small programs, each with the output it should give |
4343 | `tools/Doc.raz` | Prints what a module exports, with its comments |
4444 | `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`) |
4646 | `editor/` | Support for vim and emacs |
4747 | `conform/` | The conformance suite: what every implementation must do |
4848 | `test/` | This compiler's own tests, and the scripts that run them |

site/build.py modified +6 -1

@@ -380,9 +380,12 @@
380380 text = text.replace("@SNIPPET@", highlight(snippet.rstrip("\n")))
381381 text = text.replace("@OUTPUT@", html.escape(stdout.rstrip("\n")))
382382 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)
383386 earlier = ", ".join('<a href="download/%s">%s</a>' % (n, v)
384387 for v, n, _ in reversed(releases[:-1]))
385- text = text.replace("@EARLIER@", earlier)
388+ text = text.replace("@EARLIER@", earlier).replace("@PAGES@", pages)
386389 text = text.replace("@VERSION@", version).replace("@TARBALL@", name)
387390 text = text.replace("@DIR@", name[:-len(".tar.gz")]).replace("@SHA256@", digest)
388391 write("index.html", page("raz: a small systems language", text, 0, "home"))
@@ -418,6 +421,8 @@
418421 build_tour(tour, lessons, nxt)
419422 counts.append(len(lessons))
420423 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)
421426 build_home(build_download())
422427 print("site/public: %s lessons" % " + ".join(map(str, counts)))
423428

site/content/home.html (history) modified +6 -2

@@ -22,6 +22,7 @@
2222 <div class="facts">
2323 <span><b>~10,700</b> lines of compiler</span>
2424 <span><b>~500K</b> lines compiled a second</span>
25+ <span><b>1</b> report, <b>@PAGES@</b> pages</span>
2526 <span><b>static</b> executables, no run time to install</span>
2627 </div>
2728
@@ -58,8 +59,11 @@
5859 volatile accesses, atomics and lock-free code, in 18 more.</p>
5960
6061 <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&rsquo;t allow, raz doesn&rsquo;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&rsquo;t allow, raz doesn&rsquo;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>
6367
6468 <h2 id="download">Download</h2>
6569 <p>raz @VERSION@ is a tarball for x86-64 Linux with the compiler, <code>raz</code>,

site/content/spec.tmpl (history) modified +1 -0

@@ -1,2 +1,3 @@
1+<p><a href="raz.pdf">Volume 1 as a PDF</a> &middot; <a href="raz-lib.pdf">Volume 2 as a PDF</a></p>
12 $if(toc)$$toc$$endif$
23 $body$

site/public/index.html (history) modified +6 -2

@@ -42,6 +42,7 @@
4242 <div class="facts">
4343 <span><b>~10,700</b> lines of compiler</span>
4444 <span><b>~500K</b> lines compiled a second</span>
45+ <span><b>1</b> report, <b>26</b> pages</span>
4546 <span><b>static</b> executables, no run time to install</span>
4647 </div>
4748
@@ -104,8 +105,11 @@
104105 volatile accesses, atomics and lock-free code, in 18 more.</p>
105106
106107 <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&rsquo;t allow, raz doesn&rsquo;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&rsquo;t allow, raz doesn&rsquo;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>
109113
110114 <h2 id="download">Download</h2>
111115 <p>raz 0.11.0 is a tarball for x86-64 Linux with the compiler, <code>raz</code>,

site/public/raz-lib.pdf (history) added

Binary file; the patch has it.

site/public/raz.pdf (history) added

Binary file; the patch has it.

site/public/spec.html (history) modified +2 -1

@@ -18,7 +18,8 @@
1818 <body>
1919 <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>
2020 <main>
21-<div class="spec"><ul>
21+<div class="spec"><p><a href="raz.pdf">Volume 1 as a PDF</a> &middot; <a href="raz-lib.pdf">Volume 2 as a PDF</a></p>
22+<ul>
2223 <li><a href="#a-first-look" id="toc-a-first-look">1. A first look</a></li>
2324 <li><a href="#words-and-symbols" id="toc-words-and-symbols">2. Words and symbols</a></li>
2425 <li><a href="#modules" id="toc-modules">3. Modules</a></li>