Code: Inside a document pipeline: doctree, MyST, reST and fonts
Inside a document pipeline: the code
The programs behind the slides. Run each from this folder with Jennifer 0.27.0 (jennifer run <file>.j); they use only the modules bundled with the interpreter. Programs that write files put them in the current folder: book.j writes notes.pdf, unicode.j writes unicode.pdf, glyphs.j writes kern.svg. Those are build output and not part of this folder; run the program to regenerate them.
Fonts are not shipped here. metrics.j, glyphs.j, unicode.j and badfont.j read DejaVu Sans from /usr/share/fonts/TTF/DejaVuSans.ttf (the ttf-dejavu package; Bitstream Vera licence, DejaVu changes in the public domain, see /usr/share/licenses/ttf-dejavu/LICENSE). badfont.j also reads /usr/share/fonts/cantarell/Cantarell-VF.otf (SIL Open Font License) to show a variable CFF2 font being refused. Change the paths for other systems.
walk.j: dumps the treemarkdown.parsebuilds and tries the selectors ("Looking at a tree", "Selectors are paths, not searches").same.j: one admonition in Markdown, MyST and rST, the same node and HTML ("Three readers, one tree").directives.j: MyST targets, directives and roles, the tree andcheck("MyST: directives, roles, targets").restructured.j: the same document in rST,rst.titleandrst.check("reStructuredText: the same shapes").number.j: the two-pass figure-numbering transform ("A transform: value semantics shape it", "Pass 2: rebuild with numbers").toc.j: a table-of-contents transform ("A table of contents in the tree").book.jwithnotes.md: a MyST file to an A4 PDF with fills, bookmarks and a page footer ("PDF: PdfOptions", "The page it produced"). The slide image was made withpdftoppm -f 1 -l 1 -r 80 -x 0 -y 0 -W 662 -H 360 -png notes.pdf crop.unicode.j: Polish, Greek and Russian text in an embedded TrueType font ("Why Unicode text needs an embedded font"); image:pdftoppm -r 100 -png unicode.pdf uni.metrics.j: font metrics, glyph ids, kerning, an outline ("The font module").glyphs.j: a word as SVG outlines, without and with kerning ("Outlines and kerning, by hand"); image:rsvg-convert -w 440 -b white kern.svg -o kern.png.hostile.jandbadfont.j: nesting caps of the three readers and a truncated font ("Hostile input: caps, and kind limit").quotes.j,inline.jandguard.j: the 0.26.0 PDF quote-fill slowdown, the silent 32-level emphasis cap, and a depth guard ("Sharp edges in 0.26.0").quotes.jtakes several seconds.big.j: times parse, HTML and PDF of a 41 KiB document ("Performance: measure a big document"). Profile it withjennifer profile big.jandjennifer profile --allocs big.j.
| File | Size | |
|---|---|---|
| LICENSE | 899 B | raw |
| README.md | 2.6 KiB | raw |
| badfont.j | 525 B | raw |
| big.j | 862 B | raw |
| book.j | 1.0 KiB | raw |
| directives.j | 754 B | raw |
| glyphs.j | 1.0 KiB | raw |
| guard.j | 831 B | raw |
| hostile.j | 914 B | raw |
| inline.j | 299 B | raw |
| metrics.j | 679 B | raw |
| notes.md | 481 B | raw |
| number.j | 1.5 KiB | raw |
| quotes.j | 564 B | raw |
| restructured.j | 840 B | raw |
| same.j | 557 B | raw |
| toc.j | 1.2 KiB | raw |
| unicode.j | 773 B | raw |
| walk.j | 759 B | raw |