Skip to content

Add a committed export showcase and link it from the guides - #8

Merged
cudoment merged 4 commits into
mainfrom
docs/export-showcase
Sep 22, 2026
Merged

cudoment merged 4 commits into
mainfrom
docs/export-showcase

Conversation

@cudoment

Copy link
Copy Markdown
Owner

What

  • examples/export/showcase/: a six-document handbook for a fictional weather API, written in plain Markdown with the constructs the export guide describes (callouts incl. a registered success type, badges, a split list cell, a derived endpoint summary table, an embed reworded with replace, a footnote, an image, a seven-column table, a cudoc-pagebreak fence).
  • examples/export/showcase.config.mjs: one configuration that exports it as a site, per-document PDF and Word files and a bound volume with a cover and a numbered contents page; npm run showcase in examples/export rebuilds it.
  • examples/export/showcase-output/: the committed result (35 files, about 2 MB) so northlight-handbook.pdf and .docx open from GitHub and index.html opens from a clone.
  • Docs (EN + KO): root README "One set of documents, three destinations" links the sample; docs/export.md gains "A complete example"; examples/README.md and tests/scripts/README.md describe it.
  • tests/scripts/export-showcase.mjs: rebuilds the sample into a temporary directory and compares it with the committed copy (text byte for byte, PDF and Word by size). Added as the fourth check in npm run test:scripts; the output directory is excluded from prettier.

Notes

  • page.date is fixed so the output is identical between builds. The HTML carries the generator version, so the sample has to be regenerated at each release; the check fails until it is.
  • Verified: cudoc check on the six documents reports no problems, the freshness check passes on the committed output, npm run format:check passes, and the PDF pages (cover, contents, split table, landscape table, page break, footnote, callouts, summary table) were inspected.

A six-document handbook under examples/export/showcase/ is exported by
showcase.config.mjs into showcase-output/, which is committed so the
HTML, PDF and Word results can be opened without building anything.
The root README, the export guide and the examples README link the
sample and describe what it demonstrates: callouts, badges, split table
cells, a derived summary table, a reworded embed, a footnote, an image,
a landscape table, page breaks, a cover and a numbered contents page.

The page date is fixed so every build produces the same files.
tests/scripts/export-showcase.mjs rebuilds the sample into a temporary
directory and compares it with the committed copy, text outputs byte
for byte and PDF and Word by size, and runs as the fourth check in
npm run test:scripts. The output directory is excluded from prettier.
The site stylesheet keeps `pre code` at `white-space: pre` because a code
block can scroll on screen. That child rule also won on paper, over the
print rule that lets `pre` wrap, so a single code line wider than the page
overflowed it and Chrome scaled the whole document down until the line
fit. In a bound volume every page shrank, the page count no longer matched
the per-document measurements and the build refused to number the contents.

The print rules now make `pre code` inherit the wrapping from `pre`. The
stylesheet fixture is refreshed, a print-styles test guards the rule and
the API reference names the behaviour.
…ADME

The six showcase documents now read like a real handbook: seven endpoints
with parameter and response tables and JSON samples, request samples in
curl, Node.js and Python, a conditional-request example, request costs,
plan changes, an error catalogue with a handling sample, and four dated
releases with an upcoming-changes table. Sections flow within a document
instead of each starting a new page, so the bound volume is twenty-eight
filled pages rather than twenty-six mostly empty ones, and date columns
have a minimum width so they do not wrap.

The cudoc-export README gains a table that links one document and the
bound volume in every format, and the export guide describes the sample
as it now is.
An inline image in the Word output was scaled to the content width alone,
so a tall figure could run past the bottom of the page. The print
stylesheet caps an image at the content height as well; the Word writer
now applies the same bound, keeping the proportions, and the reference
says so.
@cudoment
cudoment merged commit 714f468 into main Sep 22, 2026
cudoment added a commit that referenced this pull request Oct 27, 2026
Add a committed export showcase and link it from the guides
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant