diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-21 09:35:37 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-22 13:48:19 -0400 |
| commit | 4c766a8455d05bdf6a9793946f7839a01f179b65 (patch) | |
| tree | 487d35a29c6bf1004019acd7421a0569fa67fd91 /src/sisudoc/spine.d | |
| parent | pod: read when zstd-wrapped (diff) | |
pod: write <doc>.sisupod (single zstd frame)
The pod archive spine writes is now named .sisupod and carries the
same archive inside one zstd frame. The reader has accepted both
since the previous commit, so every pod already published stays
readable and this changes only what is written.
free_culture 2863504 -> 1100180
live-manual 6972418 -> 692942 10.06x
The wrap is at the pod call site and not in createZipFile, which
also writes every epub and every odt.
Best compression from whole-stream (rather than per-member compression).
(for live-manual per-member deflate manages about 3x compared to 10x for
whole pod content compression).
The suffix is named as pod_archive_suffix.
--pod-compression sets the level, 19 by default: a pod is written once
and fetched many times (692942 bytes at 19, 837703 at 9, 2054365 at 1).
(A value that is not a number warns and the default is used).
Output built from a written .sisupod is byte identical to output built
from the markup it came from.
(assisted by Claude-Code)
Diffstat (limited to 'src/sisudoc/spine.d')
| -rw-r--r-- | src/sisudoc/spine.d | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/sisudoc/spine.d b/src/sisudoc/spine.d index 07f04be..9013c3e 100644 --- a/src/sisudoc/spine.d +++ b/src/sisudoc/spine.d @@ -214,6 +214,7 @@ string program_name = "spine"; ]; string[string] settings = [ "output" : "", + "pod-compression" : "", "ssp-round-trip" : "", "db-round-trip" : "", "abstraction-source" : "", @@ -317,6 +318,7 @@ string program_name = "spine"; "source", "document markup source", &opts["source"], "silent", "output to terminal", &opts["vox_is0"], "set-digest", "default hash digest type (e.g. sha256)", &settings["set-digest"], + "pod-compression", "pod archive compression level, zstd 1 to 19 (default 19)", &settings["pod-compression"], "set-papersize", "default papersize (latex pdf eg. a4 or a5 or b4 or letter)", &settings["set-papersize"], "set-textwrap", "default textwrap (e.g. 80 (characters)", &settings["set-textwrap"], "skel", "skel (dummy outline)", &opts["skel"], @@ -800,6 +802,23 @@ string program_name = "spine"; @trusted string text_wrap() { return settings["set-textwrap"]; } + /+ ↓ the zstd level a pod archive is written at. 19 by default: a pod + is written once and fetched many times, and there is a significant gain + (live-manual 675970 bytes at 19 against 786683 at 9). Lower it where + build time matters more than the bytes do. + +/ + @trusted int pod_compression() { + import std.conv : to; + if (settings["pod-compression"].length > 0) { + try { + return settings["pod-compression"].to!int; + } catch (Exception) { + writeln("WARNING --pod-compression is not a number, using 19: ", + settings["pod-compression"]); + } + } + return 19; + } @trusted string latex_papersize() { return settings["set-papersize"]; } |
