@shoalrun/cli 0.1.0-alpha.19 → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +15 -5
- package/agent-docs/.well-known/shoalrun/navigation/project-updates-50f26fe22670.txt +5 -3
- package/agent-docs/SNAPSHOT.json +5 -5
- package/agent-docs/about.md +3 -3
- package/agent-docs/author/agent-overview.md +2 -2
- package/agent-docs/author/components/code-blocks.md +46 -1
- package/agent-docs/author/frontmatter-reference.md +1 -0
- package/agent-docs/author/frontmatter-reference.sections/categorize-connect-and-present-the-page.md +1 -0
- package/agent-docs/author/workspace.md +2 -2
- package/agent-docs/author/writing-style.md +9 -3
- package/agent-docs/author/writing-style.sections/adapt-this-example.md +1 -1
- package/agent-docs/author/writing-style.sections/choose-components-by-reader-need.md +2 -2
- package/agent-docs/author/writing-style.sections/evidence-and-uncertainty.md +1 -1
- package/agent-docs/author/writing-style.sections/example-audience-and-scope.md +1 -1
- package/agent-docs/author/writing-style.sections/feature-availability.md +1 -1
- package/agent-docs/author/writing-style.sections/ingredients-recipes-and-cookbooks.md +1 -1
- package/agent-docs/author/writing-style.sections/page-purpose-and-structure.md +2 -2
- package/agent-docs/author/writing-style.sections/procedures-and-examples.md +1 -1
- package/agent-docs/author/writing-style.sections/related-reading.md +1 -1
- package/agent-docs/author/writing-style.sections/release-notes.md +30 -0
- package/agent-docs/author/writing-style.sections/review-a-draft.md +1 -1
- package/agent-docs/author/writing-style.sections/reviewed-writing-examples.md +1 -1
- package/agent-docs/author/writing-style.sections/voice-and-explanations.md +1 -1
- package/agent-docs/changelog/2026-10-16-navigation-layouts.md +1 -1
- package/agent-docs/changelog/pdf-custom-languages.md +48 -0
- package/agent-docs/changelog.md +9 -1
- package/agent-docs/config/examples.md +3 -3
- package/agent-docs/config/examples.sections/feature-showcase.md +3 -3
- package/agent-docs/config/examples.sections/minimal-site.md +2 -2
- package/agent-docs/config/examples.sections/multilingual-help-center.md +2 -2
- package/agent-docs/config/examples.sections/parcel-api-documentation.md +2 -2
- package/agent-docs/config/examples.sections/related-reading.md +2 -2
- package/agent-docs/config/examples.sections/shared-company-preset.md +2 -2
- package/agent-docs/config/outputs.md +33 -12
- package/agent-docs/config/outputs.sections/exports.md +3 -3
- package/agent-docs/config/outputs.sections/metadata.md +3 -3
- package/agent-docs/config/outputs.sections/pdf-output.md +51 -0
- package/agent-docs/config/outputs.sections/related-reading.md +3 -3
- package/agent-docs/configuration.md +2 -2
- package/agent-docs/configuration.sections/build-several-sites-from-shared-content.md +1 -1
- package/agent-docs/configuration.sections/change-inherited-lists-deliberately.md +1 -1
- package/agent-docs/configuration.sections/extract-a-section-with-include.md +1 -1
- package/agent-docs/configuration.sections/inspect-and-validate-changes.md +1 -1
- package/agent-docs/configuration.sections/related-reading.md +1 -1
- package/agent-docs/configuration.sections/separate-config-inheritance-from-page-metadata.md +1 -1
- package/agent-docs/configuration.sections/share-defaults-through-extends.md +1 -1
- package/agent-docs/configuration.sections/start-with-one-working-file.md +2 -2
- package/agent-docs/configuration.sections/understand-the-three-stages.md +1 -1
- package/agent-docs/configuration.sections/understand-where-paths-point.md +1 -1
- package/agent-docs/contribute/agent-skills.md +3 -1
- package/agent-docs/documents.json +510 -251
- package/agent-docs/features.md +4 -1
- package/agent-docs/index.md +2 -2
- package/agent-docs/provenance.json +6 -6
- package/agent-docs/publish/content-export.md +2 -0
- package/agent-docs/publish/content-export.sections/assets-downloads-and-notices.md +2 -0
- package/agent-docs/publish/content-export.sections/check-the-result.md +2 -0
- package/agent-docs/publish/content-export.sections/inspect-the-manifest.md +2 -0
- package/agent-docs/publish/content-export.sections/prerequisites.md +2 -0
- package/agent-docs/publish/content-export.sections/related-reading.md +2 -0
- package/agent-docs/publish/content-export.sections/review-exported-api-material.md +2 -0
- package/agent-docs/publish/content-export.sections/try-the-help-drawer-example.md +2 -0
- package/agent-docs/publish/content-export.sections/what-the-representations-retain.md +2 -0
- package/agent-docs/publish/pdf.md +184 -0
- package/agent-docs/publish/pdf.sections/apply-print-styling.md +65 -0
- package/agent-docs/publish/pdf.sections/check-the-result.md +33 -0
- package/agent-docs/publish/pdf.sections/export-a-page-or-publication.md +61 -0
- package/agent-docs/publish/pdf.sections/html-markdown-and-agents.md +31 -0
- package/agent-docs/publish/pdf.sections/offer-browser-page-printing.md +49 -0
- package/agent-docs/publish/pdf.sections/offer-direct-downloads-through-a-node-server.md +46 -0
- package/agent-docs/publish/pdf.sections/prerequisites.md +37 -0
- package/agent-docs/publish/pdf.sections/publish-an-optional-manual-download.md +39 -0
- package/agent-docs/publish.md +2 -0
- package/agent-docs/reference/agent-skills.md +7 -3
- package/agent-docs/search-index.json +1 -1
- package/agent-docs/start.md +4 -4
- package/agent-docs/start.sections/add-the-page-to-navigation.md +2 -2
- package/agent-docs/start.sections/build-and-check-both-outputs.md +2 -2
- package/agent-docs/start.sections/build-this-site.md +2 -2
- package/agent-docs/start.sections/check-writing-style.md +2 -2
- package/agent-docs/start.sections/create-a-page.md +2 -2
- package/agent-docs/start.sections/make-it-yours.md +2 -2
- package/agent-docs/start.sections/migrating-from-github-packages.md +2 -2
- package/agent-docs/start.sections/prerequisites.md +2 -2
- package/agent-docs/start.sections/related-reading.md +2 -2
- package/agent-docs/start.sections/start-your-own-project.md +4 -4
- package/agent-docs/status.md +7 -5
- package/agent-docs/what-is-shoalrun.md +2 -2
- package/assets/copy-markdown.js +1 -1
- package/assets/print-view.js +165 -0
- package/assets/print.js +63 -0
- package/dist/artifact-bundle.d.ts +1 -0
- package/dist/artifact-bundle.js +2 -0
- package/dist/authoring-snapshot.js +1 -1
- package/dist/browser-print-assets.d.ts +9 -0
- package/dist/browser-print-assets.js +45 -0
- package/dist/compiler.d.ts +4 -2
- package/dist/compiler.js +29 -4
- package/dist/content-export-command.d.ts +77 -1
- package/dist/content-export-command.js +5 -2
- package/dist/content-export-config.d.ts +4 -1
- package/dist/content-export-config.js +10 -5
- package/dist/content-export-render.d.ts +9 -3
- package/dist/content-export-render.js +11 -7
- package/dist/content-export.d.ts +126 -0
- package/dist/content-export.js +267 -124
- package/dist/content-source.d.ts +1 -0
- package/dist/frontmatter.js +5 -2
- package/dist/highlight-languages.d.ts +9 -0
- package/dist/highlight-languages.js +52 -0
- package/dist/highlight.d.ts +4 -1
- package/dist/highlight.js +20 -5
- package/dist/output-commit.d.ts +1 -1
- package/dist/output-commit.js +4 -2
- package/dist/page-renderer.js +6 -1
- package/dist/pdf-button.d.ts +22 -0
- package/dist/pdf-button.js +55 -0
- package/dist/pdf-config.d.ts +28 -0
- package/dist/pdf-config.js +43 -0
- package/dist/pdf-http.d.ts +36 -0
- package/dist/pdf-http.js +132 -0
- package/dist/pdf-project.d.ts +6 -0
- package/dist/pdf-project.js +31 -0
- package/dist/pdf-renderer.d.ts +45 -0
- package/dist/pdf-renderer.js +208 -0
- package/dist/pdf-site.d.ts +37 -0
- package/dist/pdf-site.js +65 -0
- package/dist/pdf-stylesheet.d.ts +1 -0
- package/dist/pdf-stylesheet.js +57 -0
- package/dist/representation-tree.js +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.js +35 -8
- package/dist/vercel.js +6 -0
- package/examples/custom-language/README.md +32 -0
- package/examples/custom-language/content/start.mdx +28 -0
- package/examples/custom-language/docs.config.yaml +18 -0
- package/examples/custom-language/grammars/custompy.tmLanguage.json +7 -0
- package/examples/pdf/README.md +27 -0
- package/examples/pdf/content/operations.mdx +26 -0
- package/examples/pdf/content/start.mdx +28 -0
- package/examples/pdf/docs.config.yaml +29 -0
- package/examples/pdf/print.css +9 -0
- package/package.json +4 -2
- package/skills/shoalrun-author/SKILL.md +2 -0
- package/skills/shoalrun-author/references/pdf-export.md +15 -0
- package/skills/shoalrun-brand/SKILL.md +2 -0
- package/skills/shoalrun-pdf/SKILL.md +49 -0
- package/skills/shoalrun-pdf/assets/print.css +49 -0
- package/skills/shoalrun-pdf/references/print-design.md +75 -0
- package/styles/site.css +3 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: guide.operations
|
|
3
|
+
title: Run daily operations
|
|
4
|
+
summary: Review workspace activity and record an outcome.
|
|
5
|
+
slug: /operations
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Start each review by checking the [workspace setup](doc:guide.start). Record the review date and result with your operating notes.
|
|
9
|
+
|
|
10
|
+
## Review activity
|
|
11
|
+
|
|
12
|
+
Use these example thresholds to decide whether activity needs investigation:
|
|
13
|
+
|
|
14
|
+
| Signal | Expected value | Follow-up |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| Queued work | Below 100 items | Check worker capacity. |
|
|
17
|
+
| Oldest item | Below 10 minutes | Inspect the processing log. |
|
|
18
|
+
| Failed items | Zero | Review the reported failure. |
|
|
19
|
+
|
|
20
|
+
For a completed-work count of 90 out of 100, the completion ratio is:
|
|
21
|
+
|
|
22
|
+
<Math display expression="r = \frac{90}{100} = 0.9" />
|
|
23
|
+
|
|
24
|
+
## Record the outcome
|
|
25
|
+
|
|
26
|
+
Save a brief report with the observed counts and any follow-up action. Link to [the review section](#review-activity) so the next operator can repeat the checks.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: guide.start
|
|
3
|
+
title: Start your workspace
|
|
4
|
+
summary: Configure a workspace and confirm its status.
|
|
5
|
+
slug: /start
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Create a workspace before running daily operations. Keep its configuration in your project so another operator can reproduce the setup.
|
|
9
|
+
|
|
10
|
+
## Configure the workspace
|
|
11
|
+
|
|
12
|
+
Save the following example configuration:
|
|
13
|
+
|
|
14
|
+
```yaml
|
|
15
|
+
workspace:
|
|
16
|
+
name: training
|
|
17
|
+
retentionDays: 30
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Verify the result
|
|
21
|
+
|
|
22
|
+
Confirm that the workspace name is `training` and that retention is 30 days. Continue with [daily operations](doc:guide.operations).
|
|
23
|
+
|
|
24
|
+
<Collapsible title="Configuration checklist">
|
|
25
|
+
|
|
26
|
+
Record the workspace owner, retention period, and expected data source before adding live data.
|
|
27
|
+
|
|
28
|
+
</Collapsible>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
schemaVersion: 1
|
|
2
|
+
site:
|
|
3
|
+
title: Operations documentation
|
|
4
|
+
origin: https://docs.example.com
|
|
5
|
+
frontmatter:
|
|
6
|
+
defaults:
|
|
7
|
+
type: guide
|
|
8
|
+
channel: production
|
|
9
|
+
version: current
|
|
10
|
+
access: { policy: public }
|
|
11
|
+
publications:
|
|
12
|
+
defaults: { channel: production, version: current, language: en }
|
|
13
|
+
channels: { production: {} }
|
|
14
|
+
versions: { current: {} }
|
|
15
|
+
enabled: [{ channel: production, version: current }]
|
|
16
|
+
navigation:
|
|
17
|
+
- { id: start, doc: guide.start }
|
|
18
|
+
- { id: operations, doc: guide.operations }
|
|
19
|
+
outputs:
|
|
20
|
+
pdf:
|
|
21
|
+
stylesheet: ./print.css
|
|
22
|
+
size: A4
|
|
23
|
+
footer: "{title} | {page} / {pages}"
|
|
24
|
+
subtitle: Setup and daily operations
|
|
25
|
+
html:
|
|
26
|
+
pdf:
|
|
27
|
+
mode: print
|
|
28
|
+
label: Print PDF
|
|
29
|
+
placement: after
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shoalrun/cli",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org",
|
|
6
6
|
"access": "public"
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"./authoring": "./dist/authoring-api.js",
|
|
16
16
|
"./*": "./*",
|
|
17
17
|
"./components": "./dist/components.js",
|
|
18
|
-
"./content/server": "./dist/content-rest-server.js"
|
|
18
|
+
"./content/server": "./dist/content-rest-server.js",
|
|
19
|
+
"./pdf/server": "./dist/pdf-http.js"
|
|
19
20
|
},
|
|
20
21
|
"files": [
|
|
21
22
|
"dist",
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
"lucide": "1.47.0",
|
|
71
72
|
"parse5": "8.0.1",
|
|
72
73
|
"pele": "1.6.0",
|
|
74
|
+
"puppeteer-core": "25.16.0",
|
|
73
75
|
"rehype-stringify": "10.0.1",
|
|
74
76
|
"remark-gfm": "4.0.1",
|
|
75
77
|
"remark-mdx": "3.1.1",
|
|
@@ -31,6 +31,8 @@ For SKU-selected or white-label documentation, read [references/customer-edition
|
|
|
31
31
|
|
|
32
32
|
## Record scope and edit
|
|
33
33
|
|
|
34
|
+
For PDF export or page print/download actions, read [references/pdf-export.md](references/pdf-export.md). Keep PDF selection distinct from reader-view controls. Use browser printing on static sites, optional CLI manual downloads, and explicit Node-hosted generation when needed.
|
|
35
|
+
|
|
34
36
|
Before editing, capture the current state with `docs baseline --out <new-baseline> --config <config>`. Put baselines inside the project's excluded `.shoalrun` directory or outside the project. This includes earlier dirty/untracked files rather than comparing with Git HEAD. Retain the corresponding before-content/task diff with your harness; a baseline stores digests, not earlier text. For an existing rendering failure, reproduce its located finding before repairing it.
|
|
35
37
|
|
|
36
38
|
Edit ordinary source files and required companions. Choose a page type and reviewed example for the reader's goal. Preserve stable IDs, routes, original `date` and access policy; set `updated` to the actual edit date. For a new page, use `shoalrun scaffold <template> -n <target> --config <config>` and resolve its prompts. Keep it draft until reviewed; snapshot validation renders affected drafts without changing their publication metadata. API materialization and recipe tasks have focused references/skills when needed.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# PDF export
|
|
2
|
+
|
|
3
|
+
For print design, brand styling, and visual verification, read the [PDF skill](../../shoalrun-pdf/SKILL.md). Its print reference and stylesheet starter accompany the instructions; keep the complete skill folder when installing it.
|
|
4
|
+
|
|
5
|
+
Check the installed CLI's `export --help` and supported output settings before configuring PDFs. Use `export --format pdf --document ID --out DIRECTORY` for one page; omit the document selector for a complete publication. Select exact product/channel/version/language coordinates when more than one publication is enabled. Pass the same customer profile as the site. PDF selection uses the target's contentFilter, otherwise the site's filter; ordinary HTML/Markdown application exports retain their independent filter behavior.
|
|
6
|
+
|
|
7
|
+
Set shared print settings under outputs.pdf and per-target overrides under exports.<target>.pdf. Local stylesheet/font/logo paths resolve relative to their declaring configuration. Register licensed local fonts explicitly; custom CSS cannot import files or load URLs. Body CSS doesn't style Chromium's separate header/footer templates. Their escaped text supports {title}, {page}, and {pages}. The TOC is linked without printed page numbers. Bookmarks/tagging need actual PDF inspection; don't infer accessibility certification.
|
|
8
|
+
|
|
9
|
+
The page action is disabled by default. An enabled outputs.html.pdf mapping defaults to mode:print for static sites: the browser creates a separate branded view and opens its print dialog, with no generated page PDFs or extra print documents. Configure its label, placement before/after Markdown actions, include/exclude IDs, and optional named style target. Shared outputs.pdf styling and assets serve all print views; only a target's PDF settings apply, never its content selection. Page frontmatter pdf:false suppresses the action. Native browser printing remains a fallback using website print CSS. Keep full-manual CLI export and its published download optional.
|
|
10
|
+
|
|
11
|
+
Explicit mode:endpoint prepares private inputs for on-demand generation through a Node host with Chromium. Optional style names an export target's pdf mapping; only its styling applies, never its page/publication/filter selection. Vercel supports browser printing and rejects endpoint mode. Never publish pdf-runtime.json or __shoalrun/pdf-data through a generic static server. A custom handler must use the same authentication boundary as the site. Audience/profile selection isn't visitor authorization.
|
|
12
|
+
|
|
13
|
+
Generation requires an installed Chrome/Chromium executable through SHOALRUN_PDF_BROWSER or outputs.pdf.executablePath. It runs offline with JavaScript disabled and the browser sandbox retained. Missing assets, remote images, missing browser, or rendering failures must be reported; don't substitute a print dialog for a promised PDF download. Preserve existing exports on failure.
|
|
14
|
+
|
|
15
|
+
Verify a page and full publication, their selection/order, excluded content, links, fonts, bookmarks, page breaks, long code/tables, and static component fallbacks. Inspect rendered PDF pages as well as extracted text. Keep PDF manifests separate from content REST representation manifests. Enabling an action doesn't authorize deploying internal/customer PDFs publicly.
|
|
@@ -45,6 +45,8 @@ Check every requested color mode. Normal text needs at least 4.5:1 contrast; lar
|
|
|
45
45
|
|
|
46
46
|
## Validate and preview
|
|
47
47
|
|
|
48
|
+
For branded PDF output, read the [PDF skill](../shoalrun-pdf/SKILL.md). Configure print styling separately from website styling, retain the intended publication/profile selection, and inspect actual rendered PDF pages. A passing HTML build doesn't verify PDF appearance.
|
|
49
|
+
|
|
48
50
|
Validate against the baseline with `shoalrun docs validate --baseline .shoalrun/brand-before.json --config docs.config.yaml`, including the selected profile when applicable. Read the report's findings and coverage. Reuse its captured output with `shoalrun docs preview REPORT --port 0`, or follow the project's required build workflow and serve that output. Rebuild when styles, configuration, or assets change.
|
|
49
51
|
|
|
50
52
|
Inspect a landing page and a representative article at desktop and mobile widths. Check font and image loading, overflow, keyboard navigation, dropdown destinations, and search interactions. Confirm HTML navigation and Markdown twins retain the documentation's meaning. A successful build doesn't establish visual correctness; state any browser checks that couldn't run.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: shoalrun-pdf
|
|
3
|
+
description: Style and export Shoalrun pages or publications as PDFs, including brand typography, covers, print layouts, optional download actions, and visual verification. Use for documentation PDFs rather than ordinary website styling or unrelated PDF editing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Style and export documentation PDFs
|
|
7
|
+
|
|
8
|
+
Inspect the documentation project's instructions, installed CLI, content selection, and existing print assets. Check `shoalrun export --help` before using PDF options; a skill folder alone doesn't establish installed-version support. Use the project's installed CLI and package references without requiring a framework checkout. Preserve existing source, routes, IDs, and unrelated edits.
|
|
9
|
+
|
|
10
|
+
## Choose the publication and output
|
|
11
|
+
|
|
12
|
+
Confirm whether the request covers a page, a selected collection, or a complete publication. Keep product, channel, version, language, audience, and customer profile consistent with the intended site. Pass the same profile to build, export, and preview. PDF selection uses the export target's `contentFilter`, otherwise the site's filter. Reader sections remain complete labeled content; reader views aren't exclusion or authorization controls.
|
|
13
|
+
|
|
14
|
+
For an existing project, capture the required baseline before editing. Keep a separate demo's source and output isolated. Use genuine project facts in customer documentation; label sample content and don't invent product capabilities to fill a design.
|
|
15
|
+
|
|
16
|
+
## Translate the brand into print
|
|
17
|
+
|
|
18
|
+
Read [the print design reference](references/print-design.md) when choosing configuration, selectors, typography, or page behavior. Use supplied brand evidence and suitable local fonts/logo assets; keep customer-specific values in the project and preserve asset notices. Website theme settings aren't automatically a PDF theme.
|
|
19
|
+
|
|
20
|
+
Use `outputs.pdf` for shared print settings and `exports.<target>.pdf` for overrides. Copy [the manual stylesheet starter](assets/print.css) into the project when useful, then adapt its tokens and typography. It supplies a restrained cover, contents, chapter hierarchy, tables, code, and print breaks; it isn't a required visual style. Browser print views reuse these print settings and shared assets. The ordinary browser Print fallback uses website print CSS through `site.customCss` and `@media print`.
|
|
21
|
+
|
|
22
|
+
Design the cover, contents, article pages, tables, and code as one publication. Use physical dimensions for page geometry and keep text/background contrast readable in print. Give headings room without isolating them from their content. Avoid blanket `break-inside: avoid` on chapters, long code, or large tables; it can create blank space or overflow. Don't reduce body type to hide a pagination problem.
|
|
23
|
+
|
|
24
|
+
Register local font files explicitly with accurate families, weights, and styles. Use existing licensed assets rather than copying system fonts into a distributable template. The stylesheet can't import files or load URLs; images must be staged local assets. Keep source paths relative to the configuration that declares them.
|
|
25
|
+
|
|
26
|
+
## Export and offer downloads
|
|
27
|
+
|
|
28
|
+
Use an output directory separate from source. Commands below assume the project directory and its installed CLI:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
shoalrun export docs.config.yaml --format pdf --document guide.start --out pdf/page
|
|
32
|
+
shoalrun export docs.config.yaml --format pdf --out pdf/manual
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Select a named target or explicit publication coordinates when needed. One export contains one publication. Full-publication order follows navigation, with eligible unlisted pages appended and reported; an explicit target document list supplies an order. PDF bundles and manifests are separate from HTML/Markdown application exports and Content REST representations.
|
|
36
|
+
|
|
37
|
+
Enable the optional page action only when requested. Static sites use `mode: print`, which opens the visitor's print dialog without generating page PDFs or extra print documents during builds. Keep whole-manual PDF generation optional through the CLI and publish that download only when requested. Never turn on per-page PDF generation as a static-hosting default.
|
|
38
|
+
|
|
39
|
+
Endpoint generation is an explicit option for a Node host with an installed browser. Label, placement, page inclusion/exclusion, and suppression are configurable. A style target supplies only its PDF settings to a browser print view or endpoint download; it mustn't change the current page's selection. Browser print views have no generation endpoint and use shared CSS/fonts/settings rather than per-page output files. See the reference for configuration and hosting boundaries.
|
|
40
|
+
|
|
41
|
+
## Verify the PDF itself
|
|
42
|
+
|
|
43
|
+
Generate a representative page and full publication when the request affects both. Reuse each artifact until its source, styling, or assets change. Inspect all pages as rendered images or in a PDF viewer, then check extracted text, internal destinations, fonts, and any requested bookmarks. Check cover crop, chapter starts, heading orphans, footer clearance, contrast, long URLs/code, table continuation, and mathematical content. Verify excluded edition content is absent.
|
|
44
|
+
|
|
45
|
+
Check an enabled action against the selected page and publication. For browser printing, verify that it opens the native print dialog with the current page's printable content and creates no build-time PDFs. For a CLI or endpoint download, verify the actual PDF. An HTML preview, successful build, or browser-free test isn't evidence that PDF generation works. Chromium outline/tagging support is experimental; inspect actual output and don't claim PDF/UA compliance from a setting.
|
|
46
|
+
|
|
47
|
+
If rendering is blocked, report the exact failed stage and preserve the prepared content and runnable export command. Don't disable browser sandboxing to make a preview work. A native print-interface fallback can demonstrate styling when appropriate, but identify its renderer/settings and don't report it as a passing automated CLI export. A print dialog isn't an on-demand PDF download endpoint.
|
|
48
|
+
|
|
49
|
+
Deliver the PDF or working preview link with a brief description of the design, checks completed, and remaining limitations. Follow the user's existing authorization for commits, deployment, and publication.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* Copy into the documentation project and adapt to its brand and local fonts. */
|
|
2
|
+
:root {
|
|
3
|
+
--pdf-accent: #234c44;
|
|
4
|
+
--pdf-text: #263e3a;
|
|
5
|
+
--pdf-muted: #62766c;
|
|
6
|
+
--pdf-font: Arial, sans-serif;
|
|
7
|
+
--pdf-code-font: monospace;
|
|
8
|
+
}
|
|
9
|
+
body { font-size: 10.5pt; line-height: 1.6; }
|
|
10
|
+
h1, h2, h3 { break-after: avoid; }
|
|
11
|
+
h1 { font-family: Georgia, serif; font-weight: 400; }
|
|
12
|
+
.pdf-cover {
|
|
13
|
+
position: relative;
|
|
14
|
+
min-height: 220mm;
|
|
15
|
+
padding: 16mm 12mm 26mm;
|
|
16
|
+
color: #f4f1e8;
|
|
17
|
+
background: #234c44;
|
|
18
|
+
border-top: 5pt solid #bbd58a;
|
|
19
|
+
}
|
|
20
|
+
.pdf-cover h1 {
|
|
21
|
+
color: inherit;
|
|
22
|
+
font-size: 38pt;
|
|
23
|
+
line-height: 1.12;
|
|
24
|
+
max-width: 15ch;
|
|
25
|
+
margin: 12mm 0 8mm;
|
|
26
|
+
}
|
|
27
|
+
.pdf-cover .pdf-subtitle { max-width: 30ch; font-size: 13pt; }
|
|
28
|
+
.pdf-cover .pdf-publication {
|
|
29
|
+
color: #e0e9d8;
|
|
30
|
+
font-size: 8pt;
|
|
31
|
+
margin-top: 14mm;
|
|
32
|
+
}
|
|
33
|
+
.pdf-logo { max-width: 40mm; max-height: 20mm; object-fit: contain; }
|
|
34
|
+
.pdf-toc { padding-top: 10mm; }
|
|
35
|
+
.pdf-toc h1 { font-size: 30pt; margin-bottom: 12mm; }
|
|
36
|
+
.pdf-toc ol { padding-left: 7mm; }
|
|
37
|
+
.pdf-toc li { padding: 4mm 0; border-top: .5pt solid #d2ddd2; }
|
|
38
|
+
.pdf-toc a { text-decoration: none; font-size: 13pt; }
|
|
39
|
+
.pdf-chapter { break-before: page; padding-top: 4mm; }
|
|
40
|
+
.pdf-chapter h1 { font-size: 29pt; line-height: 1.15; margin-bottom: 8mm; }
|
|
41
|
+
.pdf-chapter h2 { font-size: 13pt; margin: 8mm 0 3mm; }
|
|
42
|
+
.pdf-chapter > p:first-of-type { color: var(--pdf-muted); font-size: 11.5pt; }
|
|
43
|
+
blockquote { padding: 4mm 5mm; background: #f0f4ea; border-left: 3pt solid #bbd58a; }
|
|
44
|
+
table { font-size: 9pt; margin: 5mm 0; }
|
|
45
|
+
th { padding: 3mm; color: #fff; background: #234c44; }
|
|
46
|
+
td { padding: 3mm; border-color: #d2ddd2; }
|
|
47
|
+
tbody tr:nth-child(even) { background: #f4f6f0; }
|
|
48
|
+
pre { padding: 5mm; font-size: 8.5pt; background: #f0f4ed; border: 0; border-left: 3pt solid #bbd58a; }
|
|
49
|
+
a { text-underline-offset: 2pt; }
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Print design and configuration
|
|
2
|
+
|
|
3
|
+
Use the installed configuration reference as the contract. These examples show PDF settings; retain the rest of the project's configuration.
|
|
4
|
+
|
|
5
|
+
## Shared settings and target overrides
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
outputs:
|
|
9
|
+
pdf:
|
|
10
|
+
stylesheet: ./styles/print.css
|
|
11
|
+
size: A4
|
|
12
|
+
margins: { top: 18mm, right: 18mm, bottom: 20mm, left: 18mm }
|
|
13
|
+
footer: "{title} | {page} / {pages}"
|
|
14
|
+
cover: true
|
|
15
|
+
toc: true
|
|
16
|
+
bookmarks: true
|
|
17
|
+
exports:
|
|
18
|
+
manual:
|
|
19
|
+
formats: [pdf]
|
|
20
|
+
pdf:
|
|
21
|
+
subtitle: Configuration and operations
|
|
22
|
+
size: Letter
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Export the target with `shoalrun export docs.config.yaml --target manual --out pdf/manual`. Use explicit product/channel/version/language coordinates or a target publication when multiple publications are enabled. Add `--profile FILE` for the intended customer edition. Keep internal/customer exports out of public output unless that delivery is intended and authorized.
|
|
26
|
+
|
|
27
|
+
Paper sizes are A4, Letter, Legal, A3, and A5. Margins accept nonnegative mm, cm, in, or px dimensions. `timeout` accepts 1,000–120,000 milliseconds. Browser selection uses `SHOALRUN_PDF_BROWSER`, `PUPPETEER_EXECUTABLE_PATH`, or `executablePath`; configured paths take precedence. Normal installation doesn't download a browser.
|
|
28
|
+
|
|
29
|
+
## Typography and assets
|
|
30
|
+
|
|
31
|
+
Register existing local licensed font files under `outputs.pdf.fonts` with `family`, `source`, and optional `weight`/`style`. Sources support woff, woff2, ttf, and otf. Declare static weights as strings such as `"400"` and `"700"`; don't pretend a regular face is bold. Add `logo` for a local cover image and `subtitle` for cover text.
|
|
32
|
+
|
|
33
|
+
Set the stylesheet's `--pdf-font` and `--pdf-code-font` to the registered families and keep fallbacks. Headings can use a separate registered family. Test missing glyphs, mathematical symbols, and emphasis as well as ordinary prose. Local paths resolve from the declaring configuration, including included files and target overrides.
|
|
34
|
+
|
|
35
|
+
CSS imports, CSS URLs, and remote images aren't fetched by the renderer. Add fonts through their explicit settings and content images through staged assets. Don't copy reference-site scripts, remote font loaders, or analytics into a print theme.
|
|
36
|
+
|
|
37
|
+
## Layout surfaces
|
|
38
|
+
|
|
39
|
+
The print assembly exposes `.pdf-cover`, `.pdf-logo`, `.pdf-subtitle`, `.pdf-publication`, `.pdf-toc`, and `.pdf-chapter`. Headings, paragraphs, tables, blockquotes, and pre/code use ordinary HTML elements. Body colors and typography use `--pdf-accent`, `--pdf-text`, `--pdf-muted`, `--pdf-font`, and `--pdf-code-font`.
|
|
40
|
+
|
|
41
|
+
Keep covers within the printable height after margins; don't assume a browser viewport matches the physical page. Plan enough room for title wrapping, subtitle, logo, and publication identity. Contents links don't have automatically printed page numbers. Default chapter boundaries start new pages; component interactions become labeled static content.
|
|
42
|
+
|
|
43
|
+
The separate `header` and `footer` fields accept escaped text with `{title}`, `{page}`, and `{pages}`. They have fixed small-text typography and don't inherit body CSS. For more elaborate page furniture, use supported print CSS and verify it with the selected browser. Avoid duplicate numbering when combining CSS page-margin content and template footers.
|
|
44
|
+
|
|
45
|
+
Chromium supports CSS margin boxes with page counters; see the [official print-margin reference](https://developer.chrome.com/blog/print-margins). Check the selected browser's support before relying on them. If CSS owns paper dimensions or margins, keep its `@page` settings consistent with the configured PDF geometry.
|
|
46
|
+
|
|
47
|
+
## Optional single-page action
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
outputs:
|
|
51
|
+
html:
|
|
52
|
+
pdf:
|
|
53
|
+
mode: print
|
|
54
|
+
label: Print PDF
|
|
55
|
+
placement: after
|
|
56
|
+
include: [guide.start, guide.configure]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The action is off by default. An enabled mapping defaults to `mode: print`. Omit `include` for all eligible pages; `exclude` removes listed document IDs. `pdf: false` in page frontmatter suppresses the control. The browser action opens a native print dialog; readers can choose Save as PDF. It needs JavaScript for the button, while the browser's own Print command remains available without JavaScript.
|
|
60
|
+
|
|
61
|
+
Browser printing copies semantic content from the current article into a separate passive print view. It uses `outputs.pdf` settings and the same `.pdf-cover`/`.pdf-chapter` theme surfaces as the manual. Optional `outputs.html.pdf.style` supplies a named target's PDF settings without changing page selection. The original page remains unchanged. Reader sections and tab panels remain printable, details become complete static sections, and active elements/controls aren't copied. Browser settings can affect pagination, backgrounds, headers, and footers.
|
|
62
|
+
|
|
63
|
+
For a static site, enable `mode: print` and run the ordinary site build with the intended profile. This adds shared print scripts, theme CSS, settings, and configured fonts/logo, not a PDF or print document for every page. The build doesn't need Chromium for this action. Deploy the normal HTML/assets; the visitor's browser prepares the print view, waits for fonts/images, and opens the native dialog. Allow that view to open if pop-up blocking prevents it. Don't create per-page PDF caches for static hosting. The ordinary browser Print command remains a fallback, using website print CSS.
|
|
64
|
+
|
|
65
|
+
A whole-publication CLI export is a separate artifact. If the user wants it on a static site, add its PDF to the deployment output after the site build and supply a deliberate download link at the correct base path. The compiler doesn't automatically create a whole-manual button or publish CLI export directories. Keep the export outside the site build destination until copying, because a site build replaces its output. Preserve the exact selected publication/profile in that deployment step.
|
|
66
|
+
|
|
67
|
+
Endpoint mode prepares private page inputs and generates a direct PDF download on request through a Node host with Chromium. Configure its same-origin `endpoint` path as needed. Optional `style` names an existing export target's `pdf` mapping without applying that target's documents, publication, or filter. The Vercel adapter supports browser printing and rejects endpoint mode.
|
|
68
|
+
|
|
69
|
+
Keep `pdf-runtime.json` and `__shoalrun/pdf-data` out of public static serving. Use the built-in Node server or a correctly mounted `@shoalrun/cli/pdf/server` handler behind the site's authentication boundary. Don't accept visitor-provided URLs, profiles, or CSS. Build-time audience selection isn't reader authentication. Endpoint downloads use no-store responses and per-instance work limits; they aren't a shared PDF cache.
|
|
70
|
+
|
|
71
|
+
## Verification evidence
|
|
72
|
+
|
|
73
|
+
Record the exact selection, source/style inputs, output file, and browser/renderer. Check the PDF manifest for identity and order. Confirm contents and cross-page links resolve within the PDF when their targets are included. Check font embedding and requested outline destinations with a PDF inspection tool rather than matching visible text alone.
|
|
74
|
+
|
|
75
|
+
Render every page for a small publication. For a large manual, inspect a contact sheet of all pages and full-size views of the cover, chapter boundaries, dense layouts, and any suspected defects. Text extraction can identify omissions, but it can't verify clipping, contrast, or page geometry. Keep native-print demonstrations distinct from automated export verification.
|
package/styles/site.css
CHANGED
|
@@ -503,12 +503,14 @@ button{cursor:pointer}
|
|
|
503
503
|
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
|
|
504
504
|
@media(forced-colors:active){.side a[aria-current=page]{outline:2px solid Highlight}.code-copy{border:1px solid ButtonText}}
|
|
505
505
|
@media print{
|
|
506
|
-
.mast,.side,.page-toc,.navigation-dialog,.page-shortcuts,.region-return,.formats,.code-toolbar,.skip,.heading-anchor{display:none}
|
|
506
|
+
.mast,.side,.page-toc,.navigation-dialog,.page-shortcuts,.region-return,.formats,.code-toolbar,.skip,.heading-anchor,.reader-filter-slot,.reader-outside-view,.doc-tablist,.code-samples-bar{display:none!important}
|
|
507
507
|
.layout,.layout.has-examples{display:flex;flex-direction:column;padding:0}
|
|
508
508
|
.content{max-width:none}
|
|
509
509
|
.page-rail{position:static;max-height:none;overflow:visible;order:2}
|
|
510
510
|
.examples{display:block;position:static;max-height:none;overflow:visible;margin-top:2rem}
|
|
511
511
|
.content pre,.example-body pre{white-space:pre-wrap;overflow-wrap:anywhere;background:white;color:black;border:1px solid #aaa}
|
|
512
|
+
.content .reader-section[hidden],.code-samples-panes>div[hidden]{display:block!important;visibility:visible!important}
|
|
513
|
+
.reader-section[data-reader-print-label]::before{content:attr(data-reader-print-label);display:block;font-weight:650;margin:.8rem 0 .4rem}
|
|
512
514
|
}
|
|
513
515
|
|
|
514
516
|
/* Document cards share their content with the Markdown representation. */
|