diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-27 20:40:20 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-28 13:07:41 -0400 |
| commit | b254c23c56a113bdcdb89f1f7917352baaa1cf0a (patch) | |
| tree | 5103af47460c1a6f0f593177bd1fae76f248bcff /src/sisudoc/ocda | |
| parent | flags: --ocda-db and matching --ocda-db-round-trip (diff) | |
typst output --typist & --pdf that makes the pdf
typst provides a new pdf build path replacing latex as the primary pdf
builder.
--typst (--typ) writes the .typ;
--pdf writes the .typ and compiles it by spawning `typst compile`.
(--pdf is redefined, being typst to pdf rather than latex).
--latex is unchanged and writes the .tex;
One .typ per document-language (not one per paper size). The paper and
the orientation are read from sys.inputs with a default, so the same
file compiles to every paper --set-papersize asks for, the pdfs keep
their original names.
Spine's paper names (derived from what suited latex) and typst's are
different vocabularies and are mapped; a paper typst does not have is
named and skipped.
With the flag --pdf spine invokes a typesetter to generate the pdf
output directly, which is new (the latex path writes a .tex and leaves
xelatex to the caller). If typst is not available on the machine it is
reported absent, naming the binary and printing the command, and the run
continues, the .typ is written.
Several useful features of an object-centric pdf are easily met, usually
being a few lines each.
- The object number goes in the margin as one `place` at a coordinate
inside the object's own block, carrying the label every citation
points at.
- A note is a real footnote at the point of reference, with the
document's own number and one link back to the object.
- The table of contents locates by object number rather than by page, so
it holds true across every paper and every setting.
That typst compiles silently across the sample set means every internal
link in every document resolves (--pdf over the collection with two
paper sizes gives 144 pdfs, none skipped and none failed, each the page
size its name claims and each tagged).
paths: .typ, pdf named in same way as .tex based built pdfs so site
linkage works either way
flake.nix: added a typst dev shell, for .typ pdf typesetter
- dsh-typst-pdf providing a pdf typsetter for spine's .typ.
- dsh-latex-pdf provides xelatex for .tex which can still be written.
(assisted by Claude-Code)
Diffstat (limited to 'src/sisudoc/ocda')
| -rw-r--r-- | src/sisudoc/ocda/meta/rgx.d | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sisudoc/ocda/meta/rgx.d b/src/sisudoc/ocda/meta/rgx.d index 125fb52..f418582 100644 --- a/src/sisudoc/ocda/meta/rgx.d +++ b/src/sisudoc/ocda/meta/rgx.d @@ -226,6 +226,10 @@ static template spineRgxIn() { static br_line = ctRegex!(`\s*┘\s*`, "mg"); static br_line_inline = ctRegex!(`\s*┙\s*`, "mg"); static br_line_spaced = ctRegex!(`\s*┚\s*`, "mg"); + /+ ↓ the line break the markup asked for with a trailing " \\\\". xhtml writers + carry their own copy of this in rgx_xhtml may be needed by other writers + +/ + static line_break = ctRegex!(` [\\]{2}`, "m"); /+ inline markup footnotes endnotes +/ static inline_notes_al = ctRegex!(`【(?:[*+]\s+|\s*)(.+?)】`, "mg"); static inline_notes_al_special = ctRegex!(`【(?:[*+]\s+)(.+?)】`, "mg"); // TODO remove match when special footnotes are implemented @@ -258,6 +262,11 @@ static template spineRgxIn() { static inline_link_clean = ctRegex!(`┤(?:.+?)├|[┥┝]`, "mg"); static inline_link_toc_to_backmatter = ctRegex!(`┤#(?P<link>endnotes|bibliography|bookindex|glossary|blurb)├`, "mg"); static find_bookindex_ocn_link_and_comma = ctRegex!(`[, ]*┥.+?┝┤#?\S+?├`, "mg"); + /+ ↓ an internal link target on its own, with or without the segment prefix a segmented output uses. Read where the + *target* is the question and the surrounding link may be malformed: gpl3`s copyright line nests one link inside + another, which the flat markers cannot express, so the target is there and the pair around it is not + +/ + static any_internal_target = ctRegex!(`┤(?:¤.+?\.fnSuffix)?#(?P<frag>[^├]+)├`, "mg"); static url = ctRegex!(`https?://`, "mg"); static uri = ctRegex!(`(?:https?|git)://`, "mg"); static uri_identify_components = ctRegex!(`(?P<type>(?:https?|git)://)(?P<path>\S+?/)(?P<file>[^/]+)$`, "mg"); |
