snapshot of https://github.com/mattermost/mattermost.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
This commit is contained in:
124
docs/pdf/README.md
Normal file
124
docs/pdf/README.md
Normal file
@@ -0,0 +1,124 @@
|
||||
# Phase 2 — PDF pipeline
|
||||
|
||||
Builds brand-aligned PDF books from the docs site using headless Chromium + a print-only stylesheet.
|
||||
|
||||
## What's here
|
||||
|
||||
```
|
||||
pdf/
|
||||
├── books/ # Spine config: ordered list of URLs per book
|
||||
│ └── api.json
|
||||
├── scripts/
|
||||
│ ├── build-page-pdf.mjs # Capture a single page → PDF (the on-demand primitive)
|
||||
│ └── build-book-pdf.mjs # Concatenate a section's pages → branded book PDF
|
||||
├── styles/
|
||||
│ └── print.css # Brand-aligned print stylesheet (cover, headers, page numbers)
|
||||
├── build/ # Output (gitignored)
|
||||
└── package.json # Puppeteer
|
||||
```
|
||||
|
||||
## Pipeline
|
||||
|
||||
```
|
||||
docs site (npm start | npm run serve)
|
||||
│
|
||||
│ HTTP fetches per spine entry
|
||||
▼
|
||||
build-book-pdf.mjs
|
||||
│
|
||||
├── fetches each <article> via Puppeteer page navigation
|
||||
├── prepends a brand-aligned cover (denim + marigold + Mission in Motion)
|
||||
├── composes static HTML, includes Google Fonts + the docs site's bundled CSS
|
||||
├── overrides everything for paper via styles/print.css (only thing the print pass cares about)
|
||||
▼
|
||||
Puppeteer page.pdf({ format: 'A4', preferCSSPageSize: true })
|
||||
│
|
||||
▼
|
||||
build/mattermost-api.pdf
|
||||
```
|
||||
|
||||
The print stylesheet does:
|
||||
- `@page` rules for A4 size, margins, and running headers/footers
|
||||
- `string-set: chapter content()` on h1 → fed into `@top-right` for chapter names
|
||||
- `counter(page) " / " counter(pages)` in `@bottom-right` for page numbers
|
||||
- Hides every site-chrome element (navbar, sidebar, footer, breadcrumbs, edit-this-page, OpenAPI right panel)
|
||||
- Brand-aligned typography (Archivo Black headlines, Inter body, JetBrains Mono code)
|
||||
- Page-break controls (`page-break-before: always` on h1, `page-break-inside: avoid` on figures/code/tables)
|
||||
- Print-mode treatments for every branded MDX component (Hero flattens, Callouts get a thin denim left bar, StatStrip becomes a 4-up grid, CardGrid becomes a list)
|
||||
|
||||
## Usage
|
||||
|
||||
### Single-page (on-demand) PDF
|
||||
|
||||
```bash
|
||||
# Pre-req: docs site is running on port 3000 (npm start in docs-site/)
|
||||
node pdf/scripts/build-page-pdf.mjs http://localhost:3000/api pdf/build/api-overview.pdf
|
||||
```
|
||||
|
||||
Suitable as the unit primitive for the eventual "Download PDF" button on every page (CF Worker calls this against the production URL).
|
||||
|
||||
### Multi-page book
|
||||
|
||||
```bash
|
||||
node pdf/scripts/build-book-pdf.mjs --book api
|
||||
# → pdf/build/mattermost-api.pdf
|
||||
```
|
||||
|
||||
Spine controlled by `pdf/books/api.json` — add/remove URL paths to change what's in the book. Future work auto-generates the spine from the OpenAPI tag list.
|
||||
|
||||
## Current state
|
||||
|
||||
| Capability | Status |
|
||||
| --- | --- |
|
||||
| Single-page PDF capture | ✓ Working |
|
||||
| Multi-page book with cover | ✓ Working |
|
||||
| Brand-aligned cover (denim + marigold + Mission in Motion + version + date) | ✓ Working |
|
||||
| Running header (chapter name on right) | ✓ Working |
|
||||
| Running footer (page X / N) | ✓ Working |
|
||||
| Page-break-before on each chapter (h1) | ✓ Working |
|
||||
| Branded typography (Archivo Black headlines) | ✓ Working |
|
||||
| Branded MDX components in print mode | ✓ Working |
|
||||
|
||||
| Coming in v1.1 / future | |
|
||||
| --- | --- |
|
||||
| Auto-generated TOC with page numbers | Needs Paged.js (target-counter) — see §below |
|
||||
| Cross-reference page numbers ("see chapter X on page N") | Needs Paged.js |
|
||||
| Watermarked customer PDFs (per-buyer "Provided to …") | CF Worker injecting watermark via page.evaluate before page.pdf |
|
||||
| Auto-generated index | Needs Paged.js + index plugin |
|
||||
| All sections, all versions (per PLAN.md §6.1) | Needs spine generators per OpenAPI / per RST tree |
|
||||
|
||||
## Paged.js — when to add
|
||||
|
||||
Puppeteer's native `page.pdf()` covers the basic book layout (cover, headers, footers, page breaks) using just `@page` rules. We use that today.
|
||||
|
||||
Paged.js adds:
|
||||
- TOC generation via `target-counter()` (the printed page number a heading lands on)
|
||||
- "Continued on page N" bridges
|
||||
- Automatic figure / table cross-references
|
||||
- Better break-balancing across columns
|
||||
|
||||
Add Paged.js when we hit a real need for any of those — likely Phase 5 (main docs migration, where the admin guide is 100+ pages and a good TOC matters more). For now, the cover + chapter breaks + page numbers are sufficient.
|
||||
|
||||
To add: load `pagedjs` from npm or CDN, mount it via `Paged.Previewer().preview(content, stylesheets, container)` before calling `page.pdf`.
|
||||
|
||||
## On-demand Worker (deferred)
|
||||
|
||||
The on-demand per-page "Download PDF" button (PLAN.md §6.2) is the same `build-page-pdf.mjs` primitive, hosted on a Cloudflare Worker:
|
||||
|
||||
```
|
||||
User clicks "Download PDF" on /docs/11.0/admin/saml-config
|
||||
▼
|
||||
CF Worker /api/pdf?url=…
|
||||
▼
|
||||
Browser Rendering API loads the URL, applies print.css, returns PDF stream
|
||||
▼
|
||||
Worker streams PDF back with Content-Disposition: attachment
|
||||
```
|
||||
|
||||
This is straightforward to add once production is up (Browser Rendering API needs a domain). Defer to Phase 6 (cut first release branch) or later.
|
||||
|
||||
## Costs
|
||||
|
||||
Local: free. Headless Chromium runs on your machine.
|
||||
|
||||
Production (CF Browser Rendering API): ~$0.001–0.005 per render. At 1000 PDFs/day (per PLAN.md §6.2), ~$50–150/mo.
|
||||
112
docs/pdf/books/administration-guide.json
Normal file
112
docs/pdf/books/administration-guide.json
Normal file
@@ -0,0 +1,112 @@
|
||||
{
|
||||
"title": "Mattermost Administration Guide",
|
||||
"subtitle": "Configure, manage, scale, secure, and comply.",
|
||||
"eyebrow": "ADMINISTRATION",
|
||||
"version": "unreleased",
|
||||
"spine": [
|
||||
"/administration-guide/administration-guide-index",
|
||||
"/administration-guide/comply/comply-index",
|
||||
"/administration-guide/upgrade/upgrade-index",
|
||||
"/administration-guide/comply/compliance-export",
|
||||
"/administration-guide/comply/custom-terms-of-service",
|
||||
"/administration-guide/comply/data-retention-policy",
|
||||
"/administration-guide/comply/electronic-discovery",
|
||||
"/administration-guide/comply/export-mattermost-channel-data",
|
||||
"/administration-guide/comply/legal-hold",
|
||||
"/administration-guide/configure/agents-admin-guide",
|
||||
"/administration-guide/configure/bleve-search",
|
||||
"/administration-guide/configure/cloud-billing-account-settings",
|
||||
"/administration-guide/configure/configuration-in-your-database",
|
||||
"/administration-guide/configure/configuration-settings",
|
||||
"/administration-guide/configure/configure-index",
|
||||
"/administration-guide/configure/custom-branding-tools",
|
||||
"/administration-guide/configure/customize-mattermost",
|
||||
"/administration-guide/configure/enabling-chinese-japanese-korean-search",
|
||||
"/administration-guide/configure/environment-variables",
|
||||
"/administration-guide/configure/install-boards",
|
||||
"/administration-guide/configure/manage-user-surveys",
|
||||
"/administration-guide/configure/self-hosted-account-settings",
|
||||
"/administration-guide/configure/smtp-email",
|
||||
"/administration-guide/configure/system-attributes",
|
||||
"/administration-guide/manage/cloud-byok",
|
||||
"/administration-guide/manage/cloud-data-residency",
|
||||
"/administration-guide/manage/cloud-ip-filtering",
|
||||
"/administration-guide/manage/cloud-workspace-management",
|
||||
"/administration-guide/manage/code-signing-custom-builds",
|
||||
"/administration-guide/manage/command-line-tools",
|
||||
"/administration-guide/manage/configure-health-check-probes",
|
||||
"/administration-guide/manage/feature-labels",
|
||||
"/administration-guide/manage/in-product-notices",
|
||||
"/administration-guide/manage/mmctl-command-line-tool",
|
||||
"/administration-guide/manage/product-limits",
|
||||
"/administration-guide/manage/request-server-health-check",
|
||||
"/administration-guide/manage/statistics",
|
||||
"/administration-guide/manage/system-wide-notifications",
|
||||
"/administration-guide/manage/team-channel-members",
|
||||
"/administration-guide/manage/telemetry",
|
||||
"/administration-guide/manage/user-satisfaction-surveys",
|
||||
"/administration-guide/manage/admin/abac-channel-access-rules",
|
||||
"/administration-guide/manage/admin/abac-system-wide-policies",
|
||||
"/administration-guide/manage/admin/attribute-based-access-control",
|
||||
"/administration-guide/manage/admin/autotranslation",
|
||||
"/administration-guide/manage/admin/content-flagging",
|
||||
"/administration-guide/manage/admin/customize-branding",
|
||||
"/administration-guide/manage/admin/error-codes",
|
||||
"/administration-guide/manage/admin/installing-license-key",
|
||||
"/administration-guide/manage/admin/migration",
|
||||
"/administration-guide/manage/admin/postgres-migration",
|
||||
"/administration-guide/manage/admin/postgres-migration-assist-tool",
|
||||
"/administration-guide/manage/admin/manual-postgres-migration",
|
||||
"/administration-guide/manage/admin/fips-migration",
|
||||
"/administration-guide/manage/admin/monitoring-and-performance",
|
||||
"/administration-guide/manage/admin/self-hosted-billing",
|
||||
"/administration-guide/manage/admin/server-maintenance",
|
||||
"/administration-guide/manage/admin/user-attributes",
|
||||
"/administration-guide/manage/admin/user-management",
|
||||
"/administration-guide/onboard/ad-ldap",
|
||||
"/administration-guide/onboard/advanced-permissions",
|
||||
"/administration-guide/onboard/certificate-based-authentication",
|
||||
"/administration-guide/onboard/connected-workspaces",
|
||||
"/administration-guide/onboard/convert-oauth20-service-providers-to-openidconnect",
|
||||
"/administration-guide/onboard/guest-accounts",
|
||||
"/administration-guide/onboard/managing-team-channel-membership-using-ad-ldap-sync-groups",
|
||||
"/administration-guide/onboard/migrate-from-slack",
|
||||
"/administration-guide/onboard/migrate-gitlab-omnibus",
|
||||
"/administration-guide/onboard/migrating-to-mattermost",
|
||||
"/administration-guide/onboard/migration-announcement-email",
|
||||
"/administration-guide/onboard/multi-factor-authentication",
|
||||
"/administration-guide/onboard/onboard-index",
|
||||
"/administration-guide/onboard/ssl-client-certificate",
|
||||
"/administration-guide/onboard/sso-entraid",
|
||||
"/administration-guide/onboard/sso-gitlab",
|
||||
"/administration-guide/onboard/sso-google",
|
||||
"/administration-guide/onboard/sso-openidconnect",
|
||||
"/administration-guide/onboard/sso-saml-adfs-msws2016",
|
||||
"/administration-guide/onboard/sso-saml-adfs",
|
||||
"/administration-guide/onboard/sso-saml-entraid",
|
||||
"/administration-guide/onboard/sso-saml-keycloak",
|
||||
"/administration-guide/onboard/sso-saml-okta",
|
||||
"/administration-guide/onboard/sso-saml-technical",
|
||||
"/administration-guide/onboard/sso-saml",
|
||||
"/administration-guide/onboard/user-provisioning-workflows",
|
||||
"/administration-guide/scale/collect-performance-metrics",
|
||||
"/administration-guide/scale/deploy-grafana-loki-for-centralized-logging",
|
||||
"/administration-guide/scale/deploy-prometheus-grafana-for-performance-monitoring",
|
||||
"/administration-guide/scale/ensuring-releases-perform-at-scale",
|
||||
"/administration-guide/scale/performance-alerting",
|
||||
"/administration-guide/scale/performance-monitoring-metrics",
|
||||
"/administration-guide/scale/push-notification-health-targets",
|
||||
"/administration-guide/upgrade/admin-onboarding-tasks",
|
||||
"/administration-guide/upgrade/communicate-scheduled-maintenance",
|
||||
"/administration-guide/upgrade/downgrading-mattermost-server",
|
||||
"/administration-guide/upgrade/enterprise-install-upgrade",
|
||||
"/administration-guide/upgrade/enterprise-roll-out-checklist",
|
||||
"/administration-guide/upgrade/notify-admin",
|
||||
"/administration-guide/upgrade/open-source-components",
|
||||
"/administration-guide/upgrade/prepare-to-upgrade-mattermost",
|
||||
"/administration-guide/upgrade/upgrade-mattermost-kubernetes-ha",
|
||||
"/administration-guide/upgrade/upgrading-mattermost-server",
|
||||
"/administration-guide/upgrade/upgrading-postgres",
|
||||
"/administration-guide/upgrade/welcome-email-to-end-users"
|
||||
]
|
||||
}
|
||||
22
docs/pdf/books/api.json
Normal file
22
docs/pdf/books/api.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"title": "Mattermost API",
|
||||
"subtitle": "REST API v4 — every endpoint, generated from the canonical OpenAPI specification.",
|
||||
"eyebrow": "API REFERENCE",
|
||||
"version": "v4",
|
||||
"spine": [
|
||||
"/api/",
|
||||
"/api/examples",
|
||||
"/api/reference/login",
|
||||
"/api/reference/create-user",
|
||||
"/api/reference/get-users",
|
||||
"/api/reference/create-channel",
|
||||
"/api/reference/add-channel-member",
|
||||
"/api/reference/get-channels-for-team",
|
||||
"/api/reference/create-post",
|
||||
"/api/reference/get-post",
|
||||
"/api/reference/update-post",
|
||||
"/api/reference/delete-post",
|
||||
"/api/reference/upload-file",
|
||||
"/api/reference/save-reaction"
|
||||
]
|
||||
}
|
||||
95
docs/pdf/books/deployment-guide.json
Normal file
95
docs/pdf/books/deployment-guide.json
Normal file
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"title": "Mattermost Deployment Guide",
|
||||
"subtitle": "Plan, provision, and ship a production Mattermost deployment.",
|
||||
"eyebrow": "DEPLOYMENT",
|
||||
"version": "unreleased",
|
||||
"spine": [
|
||||
"/deployment-guide/deployment-guide-index",
|
||||
"/deployment-guide/quick-start-evaluation",
|
||||
"/deployment-guide/deployment-scenarios/deployment-scenarios-index",
|
||||
"/deployment-guide/deployment-scenarios/deploy-oob",
|
||||
"/deployment-guide/deployment-scenarios/deploy-mission-partner",
|
||||
"/deployment-guide/deployment-scenarios/deploy-ddil-operations",
|
||||
"/deployment-guide/deployment-scenarios/deploy-sovereign-collaboration",
|
||||
"/deployment-guide/deployment-scenarios/air-gapped-deployment",
|
||||
"/deployment-guide/server/server-deployment-planning",
|
||||
"/deployment-guide/application-architecture",
|
||||
"/deployment-guide/deployment-architecture",
|
||||
"/deployment-guide/software-hardware-requirements",
|
||||
"/deployment-guide/server/orchestration",
|
||||
"/deployment-guide/server/preparations",
|
||||
"/deployment-guide/server/setup-nginx-proxy",
|
||||
"/deployment-guide/server/setup-tls",
|
||||
"/deployment-guide/server/prepare-mattermost-mysql-database",
|
||||
"/deployment-guide/server/image-proxy",
|
||||
"/deployment-guide/server/pre-authentication-secrets",
|
||||
"/deployment-guide/server/deploy-linux",
|
||||
"/deployment-guide/server/linux/deploy-ubuntu",
|
||||
"/deployment-guide/server/linux/deploy-rhel",
|
||||
"/deployment-guide/server/linux/deploy-tar",
|
||||
"/deployment-guide/server/linux/deploy-azure-native-vm",
|
||||
"/deployment-guide/server/deploy-kubernetes",
|
||||
"/deployment-guide/server/kubernetes/deploy-k8s",
|
||||
"/deployment-guide/server/kubernetes/deploy-k8s-oke",
|
||||
"/deployment-guide/server/deploy-containers",
|
||||
"/deployment-guide/server/containers/fips-stig",
|
||||
"/deployment-guide/encryption-options",
|
||||
"/deployment-guide/transport-encryption",
|
||||
"/deployment-guide/scale/scaling-for-enterprise",
|
||||
"/deployment-guide/scale/scale-to-200-users",
|
||||
"/deployment-guide/scale/scale-to-2000-users",
|
||||
"/deployment-guide/scale/scale-to-15000-users",
|
||||
"/deployment-guide/scale/scale-to-30000-users",
|
||||
"/deployment-guide/scale/scale-to-50000-users",
|
||||
"/deployment-guide/scale/scale-to-80000-users",
|
||||
"/deployment-guide/scale/scale-to-90000-users",
|
||||
"/deployment-guide/scale/scale-to-100000-users",
|
||||
"/deployment-guide/scale/scale-to-200000-users",
|
||||
"/deployment-guide/scale/high-availability-cluster-based-deployment",
|
||||
"/deployment-guide/scale/additional-ha-considerations",
|
||||
"/deployment-guide/scale/server-architecture",
|
||||
"/deployment-guide/scale/estimated-storage-per-user-per-month",
|
||||
"/deployment-guide/scale/lifetime-storage",
|
||||
"/deployment-guide/scale/backing-storage-benchmarks",
|
||||
"/deployment-guide/scale/enterprise-search",
|
||||
"/deployment-guide/scale/elasticsearch-setup",
|
||||
"/deployment-guide/scale/opensearch-setup",
|
||||
"/deployment-guide/scale/common-configure-mattermost-for-enterprise-search",
|
||||
"/deployment-guide/scale/redis",
|
||||
"/deployment-guide/backup-disaster-recovery",
|
||||
"/deployment-guide/disaster-recovery-aws",
|
||||
"/deployment-guide/air-gapped-operations/index",
|
||||
"/deployment-guide/air-gapped-operations/quick-start-runbook",
|
||||
"/deployment-guide/air-gapped-operations/mirror-package-repositories",
|
||||
"/deployment-guide/air-gapped-operations/disable-phone-home-features",
|
||||
"/deployment-guide/calls/calls-deployment-guide",
|
||||
"/deployment-guide/calls/calls-rtcd-setup",
|
||||
"/deployment-guide/calls/calls-offloader-setup",
|
||||
"/deployment-guide/calls/calls-kubernetes",
|
||||
"/deployment-guide/calls/calls-logging",
|
||||
"/deployment-guide/calls/calls-metrics-monitoring",
|
||||
"/deployment-guide/desktop/desktop-app-deployment",
|
||||
"/deployment-guide/desktop/linux-desktop-install",
|
||||
"/deployment-guide/desktop/distribute-a-custom-desktop-app",
|
||||
"/deployment-guide/desktop/silent-windows-desktop-distribution",
|
||||
"/deployment-guide/desktop/desktop-msi-installer-and-group-policy-install",
|
||||
"/deployment-guide/desktop/desktop-custom-dictionaries",
|
||||
"/deployment-guide/desktop/desktop-app-managed-resources",
|
||||
"/deployment-guide/mobile/mobile-app-deployment",
|
||||
"/deployment-guide/mobile/deploy-mobile-apps-using-emm-provider",
|
||||
"/deployment-guide/mobile/configure-microsoft-intune-mam",
|
||||
"/deployment-guide/mobile/distribute-custom-mobile-apps",
|
||||
"/deployment-guide/mobile/host-your-own-push-proxy-service",
|
||||
"/deployment-guide/mobile/consider-mobile-vpn-options",
|
||||
"/deployment-guide/mobile/mobile-security-features",
|
||||
"/deployment-guide/mobile/secure-mobile-file-storage",
|
||||
"/deployment-guide/mobile/mobile-faq",
|
||||
"/deployment-guide/deployment-troubleshooting",
|
||||
"/deployment-guide/server/troubleshooting",
|
||||
"/deployment-guide/server/docker-troubleshooting",
|
||||
"/deployment-guide/server/trouble-postgres",
|
||||
"/deployment-guide/server/trouble_mysql",
|
||||
"/deployment-guide/desktop/desktop-troubleshooting",
|
||||
"/deployment-guide/mobile/mobile-troubleshooting"
|
||||
]
|
||||
}
|
||||
94
docs/pdf/books/end-user-guide.json
Normal file
94
docs/pdf/books/end-user-guide.json
Normal file
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"title": "Mattermost End User Guide",
|
||||
"subtitle": "Everything users need to know to collaborate in Mattermost.",
|
||||
"eyebrow": "END USER GUIDE",
|
||||
"version": "unreleased",
|
||||
"spine": [
|
||||
"/end-user-guide/agents",
|
||||
"/end-user-guide/end-user-guide-index",
|
||||
"/end-user-guide/collaborate/collaborate-index",
|
||||
"/end-user-guide/preferences/preferences-index",
|
||||
"/end-user-guide/project-management/project-management-index",
|
||||
"/end-user-guide/workflow-automation/workflow-automation-index",
|
||||
"/end-user-guide/access/access-your-workspace",
|
||||
"/end-user-guide/access/install-android-app",
|
||||
"/end-user-guide/access/install-desktop-app",
|
||||
"/end-user-guide/access/install-ios-app",
|
||||
"/end-user-guide/access/log-out",
|
||||
"/end-user-guide/collaborate/agents-context-management",
|
||||
"/end-user-guide/collaborate/archive-unarchive-channels",
|
||||
"/end-user-guide/collaborate/audio-and-screensharing",
|
||||
"/end-user-guide/collaborate/autotranslate-messages",
|
||||
"/end-user-guide/collaborate/browse-channels",
|
||||
"/end-user-guide/collaborate/channel-header-purpose",
|
||||
"/end-user-guide/collaborate/channel-naming-conventions",
|
||||
"/end-user-guide/collaborate/channel-types",
|
||||
"/end-user-guide/collaborate/collaborate-within-channels",
|
||||
"/end-user-guide/collaborate/collaborate-within-connected-microsoft-teams",
|
||||
"/end-user-guide/collaborate/communicate-with-messages",
|
||||
"/end-user-guide/collaborate/convert-group-messages",
|
||||
"/end-user-guide/collaborate/convert-public-channels",
|
||||
"/end-user-guide/collaborate/create-channels",
|
||||
"/end-user-guide/collaborate/display-channel-banners",
|
||||
"/end-user-guide/collaborate/extend-mattermost-with-integrations",
|
||||
"/end-user-guide/collaborate/favorite-channels",
|
||||
"/end-user-guide/collaborate/flag-messages",
|
||||
"/end-user-guide/collaborate/forward-messages",
|
||||
"/end-user-guide/collaborate/invite-people",
|
||||
"/end-user-guide/collaborate/join-leave-channels",
|
||||
"/end-user-guide/collaborate/learn-about-roles",
|
||||
"/end-user-guide/collaborate/manage-channel-bookmarks",
|
||||
"/end-user-guide/collaborate/manage-channel-members",
|
||||
"/end-user-guide/collaborate/mark-channels-unread",
|
||||
"/end-user-guide/collaborate/mark-messages-unread",
|
||||
"/end-user-guide/collaborate/mention-people",
|
||||
"/end-user-guide/collaborate/message-priority",
|
||||
"/end-user-guide/collaborate/message-reminders",
|
||||
"/end-user-guide/collaborate/navigate-between-channels",
|
||||
"/end-user-guide/collaborate/organize-conversations",
|
||||
"/end-user-guide/collaborate/organize-using-custom-user-groups",
|
||||
"/end-user-guide/collaborate/organize-using-teams",
|
||||
"/end-user-guide/collaborate/react-with-emojis-gifs",
|
||||
"/end-user-guide/collaborate/rename-channels",
|
||||
"/end-user-guide/collaborate/reply-to-messages",
|
||||
"/end-user-guide/collaborate/save-pin-messages",
|
||||
"/end-user-guide/collaborate/schedule-messages",
|
||||
"/end-user-guide/collaborate/search-for-messages",
|
||||
"/end-user-guide/collaborate/send-messages",
|
||||
"/end-user-guide/collaborate/share-files-in-messages",
|
||||
"/end-user-guide/collaborate/share-links",
|
||||
"/end-user-guide/collaborate/team-settings",
|
||||
"/end-user-guide/collaborate/view-system-information",
|
||||
"/end-user-guide/preferences/connect-multiple-workspaces",
|
||||
"/end-user-guide/preferences/customize-desktop-app-experience",
|
||||
"/end-user-guide/preferences/customize-your-channel-sidebar",
|
||||
"/end-user-guide/preferences/customize-your-theme",
|
||||
"/end-user-guide/preferences/manage-advanced-options",
|
||||
"/end-user-guide/preferences/manage-your-channel-specific-notifications",
|
||||
"/end-user-guide/preferences/manage-your-desktop-notifications",
|
||||
"/end-user-guide/preferences/manage-your-display-options",
|
||||
"/end-user-guide/preferences/manage-your-mentions-keywords-notifications",
|
||||
"/end-user-guide/preferences/manage-your-mobile-notifications",
|
||||
"/end-user-guide/preferences/manage-your-plugin-preferences",
|
||||
"/end-user-guide/preferences/manage-your-sidebar-options",
|
||||
"/end-user-guide/preferences/manage-your-thread-reply-notifications",
|
||||
"/end-user-guide/preferences/manage-your-web-notifications",
|
||||
"/end-user-guide/preferences/troubleshoot-notifications",
|
||||
"/end-user-guide/project-management/boards-settings",
|
||||
"/end-user-guide/project-management/calculations",
|
||||
"/end-user-guide/project-management/groups-filter-sort",
|
||||
"/end-user-guide/project-management/migrate-to-boards",
|
||||
"/end-user-guide/project-management/navigate-boards",
|
||||
"/end-user-guide/project-management/work-with-boards",
|
||||
"/end-user-guide/project-management/work-with-cards",
|
||||
"/end-user-guide/project-management/work-with-views",
|
||||
"/end-user-guide/workflow-automation/interact-with-playbooks",
|
||||
"/end-user-guide/workflow-automation/learn-about-playbooks",
|
||||
"/end-user-guide/workflow-automation/metrics-and-goals",
|
||||
"/end-user-guide/workflow-automation/notifications-and-updates",
|
||||
"/end-user-guide/workflow-automation/share-and-collaborate",
|
||||
"/end-user-guide/workflow-automation/work-with-playbooks",
|
||||
"/end-user-guide/workflow-automation/work-with-runs",
|
||||
"/end-user-guide/workflow-automation/work-with-tasks"
|
||||
]
|
||||
}
|
||||
12
docs/pdf/books/get-help.json
Normal file
12
docs/pdf/books/get-help.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"title": "Mattermost Get Help",
|
||||
"subtitle": "Channels for help, escalation, and feedback.",
|
||||
"eyebrow": "SUPPORT",
|
||||
"version": "unreleased",
|
||||
"spine": [
|
||||
"/get-help/community-chat",
|
||||
"/get-help/community-for-mattermost",
|
||||
"/get-help/contribute-to-documentation",
|
||||
"/get-help/get-help-index"
|
||||
]
|
||||
}
|
||||
28
docs/pdf/books/integrations-guide.json
Normal file
28
docs/pdf/books/integrations-guide.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"title": "Mattermost Integrations Guide",
|
||||
"subtitle": "Bring your tools into Mattermost — from webhooks to platform plugins.",
|
||||
"eyebrow": "INTEGRATIONS",
|
||||
"version": "unreleased",
|
||||
"spine": [
|
||||
"/integrations-guide/built-in-slash-commands",
|
||||
"/integrations-guide/faq",
|
||||
"/integrations-guide/github",
|
||||
"/integrations-guide/gitlab",
|
||||
"/integrations-guide/incoming-webhooks",
|
||||
"/integrations-guide/integrations-guide-index",
|
||||
"/integrations-guide/jira",
|
||||
"/integrations-guide/mattermost-mission-collaboration-for-m365",
|
||||
"/integrations-guide/microsoft-calendar",
|
||||
"/integrations-guide/microsoft-teams-meetings",
|
||||
"/integrations-guide/microsoft-teams-sync",
|
||||
"/integrations-guide/no-code-automation",
|
||||
"/integrations-guide/outgoing-webhooks",
|
||||
"/integrations-guide/plugins",
|
||||
"/integrations-guide/restful-api",
|
||||
"/integrations-guide/run-slash-commands",
|
||||
"/integrations-guide/servicenow",
|
||||
"/integrations-guide/slash-commands",
|
||||
"/integrations-guide/webhook-integrations",
|
||||
"/integrations-guide/zoom"
|
||||
]
|
||||
}
|
||||
43
docs/pdf/books/product-overview.json
Normal file
43
docs/pdf/books/product-overview.json
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"title": "Mattermost Product Overview",
|
||||
"subtitle": "Editions, plans, releases, and the platform at a glance.",
|
||||
"eyebrow": "PRODUCT OVERVIEW",
|
||||
"version": "unreleased",
|
||||
"spine": [
|
||||
"/product-overview/accessibility-compliance-policy",
|
||||
"/product-overview/cloud-dedicated",
|
||||
"/product-overview/cloud-shared",
|
||||
"/product-overview/cloud-supported-integrations",
|
||||
"/product-overview/cloud-vpc-private-connectivity",
|
||||
"/product-overview/common-esr-support-rst",
|
||||
"/product-overview/common-esr-support-upgrade",
|
||||
"/product-overview/common-esr-support",
|
||||
"/product-overview/corporate-directory-integration",
|
||||
"/product-overview/deprecated-features",
|
||||
"/product-overview/desktop-app-changelog",
|
||||
"/product-overview/desktop",
|
||||
"/product-overview/editions-and-offerings",
|
||||
"/product-overview/faq-enterprise",
|
||||
"/product-overview/faq-federal-procurement",
|
||||
"/product-overview/faq-general",
|
||||
"/product-overview/faq-mattermost-source-available-license",
|
||||
"/product-overview/frequently-asked-questions",
|
||||
"/product-overview/mattermost-desktop-releases",
|
||||
"/product-overview/mattermost-mobile-releases",
|
||||
"/product-overview/mattermost-server-releases",
|
||||
"/product-overview/mattermost-v10-changelog",
|
||||
"/product-overview/mattermost-v11-changelog",
|
||||
"/product-overview/mobile-app-changelog",
|
||||
"/product-overview/mobile",
|
||||
"/product-overview/non-profit-subscriptions",
|
||||
"/product-overview/product-overview-index",
|
||||
"/product-overview/release-policy",
|
||||
"/product-overview/releases-lifecycle",
|
||||
"/product-overview/self-hosted-subscriptions",
|
||||
"/product-overview/server",
|
||||
"/product-overview/subscription",
|
||||
"/product-overview/ui-ada-changelog",
|
||||
"/product-overview/unsupported-legacy-releases",
|
||||
"/product-overview/version-archive"
|
||||
]
|
||||
}
|
||||
16
docs/pdf/books/security-guide.json
Normal file
16
docs/pdf/books/security-guide.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"title": "Mattermost Security Guide",
|
||||
"subtitle": "Security architecture, threat model, and hardening guidance.",
|
||||
"eyebrow": "SECURITY",
|
||||
"version": "unreleased",
|
||||
"spine": [
|
||||
"/security-guide/security-updates",
|
||||
"/security-guide/cmmc-compliance",
|
||||
"/security-guide/finra-compliance",
|
||||
"/security-guide/hipaa-compliance",
|
||||
"/security-guide/mobile-security",
|
||||
"/security-guide/secure-mattermost",
|
||||
"/security-guide/security-guide-index",
|
||||
"/security-guide/zero-trust"
|
||||
]
|
||||
}
|
||||
18
docs/pdf/books/use-case-guide.json
Normal file
18
docs/pdf/books/use-case-guide.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"title": "Mattermost Use Case Guide",
|
||||
"subtitle": "Mission-critical scenarios served by Mattermost.",
|
||||
"eyebrow": "USE CASES",
|
||||
"version": "unreleased",
|
||||
"spine": [
|
||||
"/use-case-guide/devops-collaboration",
|
||||
"/use-case-guide/integrated-security-operations",
|
||||
"/use-case-guide/maximize-microsoft-investments",
|
||||
"/use-case-guide/mission-ready-mobile",
|
||||
"/use-case-guide/on-prem-skype-for-business-replacement",
|
||||
"/use-case-guide/out-of-band-incident-response",
|
||||
"/use-case-guide/purpose-built-collaboration",
|
||||
"/use-case-guide/secure-command-and-control",
|
||||
"/use-case-guide/self-sovereign-collaboration",
|
||||
"/use-case-guide/use-cases-index"
|
||||
]
|
||||
}
|
||||
1137
docs/pdf/package-lock.json
generated
Normal file
1137
docs/pdf/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
15
docs/pdf/package.json
Normal file
15
docs/pdf/package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "pdf",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"description": "",
|
||||
"dependencies": {
|
||||
"puppeteer": "^24.43.0"
|
||||
}
|
||||
}
|
||||
215
docs/pdf/scripts/build-book-pdf.mjs
Normal file
215
docs/pdf/scripts/build-book-pdf.mjs
Normal file
@@ -0,0 +1,215 @@
|
||||
#!/usr/bin/env node
|
||||
/*
|
||||
* Concatenate a section's pages into a single book PDF.
|
||||
*
|
||||
* Strategy:
|
||||
* 1. Load the configured "spine" (an ordered list of URLs to include).
|
||||
* 2. For each URL, fetch via Puppeteer and pull out just the article
|
||||
* content (.theme-doc-markdown).
|
||||
* 3. Inject a brand-aligned cover page at the top.
|
||||
* 4. Inject the concatenated content into a single static HTML page.
|
||||
* 5. Apply the print CSS, render to PDF.
|
||||
*
|
||||
* For Mattermost API v4, the spine is generated from the OpenAPI tags
|
||||
* — overview + examples + each tag's landing + each endpoint within.
|
||||
* For a smaller demo, the API "Overview" + "Examples" + the first
|
||||
* tag's endpoints is a reasonable target.
|
||||
*
|
||||
* Usage:
|
||||
* node pdf/scripts/build-book-pdf.mjs --book api # default
|
||||
* node pdf/scripts/build-book-pdf.mjs --book api --base http://localhost:3000
|
||||
*
|
||||
* Configurable via pdf/books/<book>.json — see pdf/books/api.json.
|
||||
*/
|
||||
|
||||
import puppeteer from 'puppeteer';
|
||||
import {readFileSync, mkdirSync, statSync} from 'node:fs';
|
||||
import {dirname, resolve} from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
|
||||
const HERE = dirname(fileURLToPath(import.meta.url));
|
||||
const PDF_ROOT = resolve(HERE, '..');
|
||||
|
||||
function arg(name, fallback) {
|
||||
const i = process.argv.indexOf(`--${name}`);
|
||||
if (i === -1) return fallback;
|
||||
return process.argv[i + 1] ?? fallback;
|
||||
}
|
||||
|
||||
function loadSpine(book) {
|
||||
const path = resolve(PDF_ROOT, 'books', `${book}.json`);
|
||||
const cfg = JSON.parse(readFileSync(path, 'utf8'));
|
||||
return cfg;
|
||||
}
|
||||
|
||||
function coverHtml(cfg) {
|
||||
const buildDate = new Date().toISOString().slice(0, 10);
|
||||
return `
|
||||
<section class="mm-print-cover">
|
||||
<div>
|
||||
<div class="cover-meta">${cfg.eyebrow}</div>
|
||||
<h1 class="cover-title">${cfg.title}</h1>
|
||||
<div class="cover-subtitle">${cfg.subtitle}</div>
|
||||
</div>
|
||||
<div class="cover-bottom">
|
||||
<div class="cover-version">${cfg.version} · ${buildDate}</div>
|
||||
<div class="cover-tagline">Mission in Motion</div>
|
||||
</div>
|
||||
</section>
|
||||
`;
|
||||
}
|
||||
|
||||
async function fetchArticle(page, url, index) {
|
||||
await page.goto(url, {waitUntil: 'networkidle0', timeout: 60_000});
|
||||
await page.evaluateHandle('document.fonts.ready');
|
||||
// Pull just the article body so the book doesn't carry navbar / sidebar / footer.
|
||||
// Also extract heading metadata so the book builder can compose a ToC.
|
||||
return page.evaluate((idx) => {
|
||||
const article = document.querySelector('article') || document.querySelector('.theme-doc-markdown');
|
||||
if (!article) {
|
||||
return {html: '<!-- no article found -->', title: 'Untitled', subsections: []};
|
||||
}
|
||||
const clone = article.cloneNode(true);
|
||||
const chapterId = `mm-chapter-${idx}`;
|
||||
clone.setAttribute('id', chapterId);
|
||||
const h1 = clone.querySelector('h1');
|
||||
const title = (h1 && h1.textContent.trim()) || document.title || 'Untitled';
|
||||
// Anchor the H1 itself so the ToC entry jumps to the start of the chapter.
|
||||
if (h1 && !h1.id) h1.id = chapterId + '-title';
|
||||
const subsections = Array.from(clone.querySelectorAll('h2')).map((h, i) => {
|
||||
if (!h.id) h.id = `${chapterId}-h2-${i}`;
|
||||
return {text: h.textContent.trim().replace(//g, ''), id: h.id};
|
||||
});
|
||||
return {html: clone.outerHTML, title, subsections};
|
||||
}, index);
|
||||
}
|
||||
|
||||
function escapeHtml(s) {
|
||||
return String(s).replace(/[&<>"']/g, (c) => ({'&': '&', '<': '<', '>': '>', '"': '"', "'": '''}[c]));
|
||||
}
|
||||
|
||||
function tocHtml(articles) {
|
||||
const items = articles.map((a, i) => {
|
||||
const sub = a.subsections.length
|
||||
? `<ol class="toc-sub">${a.subsections
|
||||
.map((s) => `<li><a href="#${s.id}"><span class="toc-text">${escapeHtml(s.text)}</span><span class="toc-leader"></span><span class="toc-page" data-href="#${s.id}"></span></a></li>`)
|
||||
.join('')}</ol>`
|
||||
: '';
|
||||
return `<li class="toc-chapter">
|
||||
<a href="#mm-chapter-${i}">
|
||||
<span class="toc-num">${String(i + 1).padStart(2, '0')}</span>
|
||||
<span class="toc-text">${escapeHtml(a.title)}</span>
|
||||
<span class="toc-leader"></span>
|
||||
<span class="toc-page" data-href="#mm-chapter-${i}"></span>
|
||||
</a>
|
||||
${sub}
|
||||
</li>`;
|
||||
}).join('');
|
||||
return `
|
||||
<section class="mm-print-toc">
|
||||
<header class="toc-header">
|
||||
<div class="toc-eyebrow">Contents</div>
|
||||
<h1 class="toc-heading">Table of Contents</h1>
|
||||
</header>
|
||||
<ol class="toc-list">${items}</ol>
|
||||
</section>
|
||||
`;
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const bookName = arg('book', 'api');
|
||||
const base = arg('base', 'http://localhost:3000');
|
||||
const output = arg('out', resolve(PDF_ROOT, 'build', `mattermost-${bookName}.pdf`));
|
||||
|
||||
const cfg = loadSpine(bookName);
|
||||
console.log(`[book] ${cfg.title} · ${cfg.spine.length} pages from ${base}`);
|
||||
|
||||
const printCss = readFileSync(resolve(PDF_ROOT, 'styles', 'print.css'), 'utf8');
|
||||
mkdirSync(dirname(resolve(output)), {recursive: true});
|
||||
|
||||
const browser = await puppeteer.launch({
|
||||
headless: 'new',
|
||||
args: ['--no-sandbox', '--font-render-hinting=none'],
|
||||
});
|
||||
|
||||
try {
|
||||
const fetcher = await browser.newPage();
|
||||
fetcher.on('pageerror', (e) => console.error(`[book:browser-error] ${e.message}`));
|
||||
|
||||
const articles = [];
|
||||
for (let i = 0; i < cfg.spine.length; i++) {
|
||||
const path = cfg.spine[i];
|
||||
const url = base + path;
|
||||
console.log(`[book] ${path}`);
|
||||
articles.push(await fetchArticle(fetcher, url, i));
|
||||
}
|
||||
|
||||
// Compose the book document. We let Docusaurus's built CSS load too
|
||||
// (so MDX components keep their layout); the print CSS overrides
|
||||
// what's needed for paper.
|
||||
const stylesUrl = `${base}/assets/css/styles.css`;
|
||||
const htmlPath = resolve(PDF_ROOT, 'build', `${bookName}-book.html`);
|
||||
const html = `<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>${cfg.title}</title>
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap">
|
||||
<style id="print-stylesheet">${printCss}</style>
|
||||
</head>
|
||||
<body>
|
||||
${coverHtml(cfg)}
|
||||
${tocHtml(articles)}
|
||||
${articles.map((a) => a.html).join('\n<hr class="mm-page-break"/>\n')}
|
||||
</body>
|
||||
</html>`;
|
||||
const fs = await import('node:fs/promises');
|
||||
await fs.writeFile(htmlPath, html);
|
||||
|
||||
const printer = await browser.newPage();
|
||||
printer.on('console', (m) => {
|
||||
if (m.type() === 'error') console.error(`[book:browser-error] ${m.text()}`);
|
||||
});
|
||||
await printer.goto(`file://${htmlPath}`, {waitUntil: 'networkidle0'});
|
||||
await printer.emulateMediaType('print');
|
||||
await printer.evaluateHandle('document.fonts.ready');
|
||||
|
||||
// Rewrite the OpenAPI dev-server URL prefix to a generic example
|
||||
// so the printed reference doesn't carry "http://localhost:8065"
|
||||
// through to readers. This applies only to print captures; the
|
||||
// live dev site keeps the localhost default for "Send API Request"
|
||||
// testing convenience.
|
||||
await printer.evaluate(() => {
|
||||
const REPLACEMENT = 'https://your-mattermost-server.com';
|
||||
const PATTERN = /https?:\/\/localhost:\d+/g;
|
||||
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
|
||||
let n;
|
||||
while ((n = walker.nextNode())) {
|
||||
if (n.nodeValue && PATTERN.test(n.nodeValue)) {
|
||||
n.nodeValue = n.nodeValue.replace(PATTERN, REPLACEMENT);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
console.log(`[book] rendering → ${output}`);
|
||||
await printer.pdf({
|
||||
path: resolve(output),
|
||||
format: 'A4',
|
||||
printBackground: true,
|
||||
preferCSSPageSize: true,
|
||||
displayHeaderFooter: false,
|
||||
});
|
||||
|
||||
const {size} = statSync(resolve(output));
|
||||
const pages = Math.ceil(size / 25_000); // very rough estimate — replace with PDF probe later
|
||||
console.log(`[book] done — ${(size / 1024).toFixed(1)} KB (~${pages} pages estimated)`);
|
||||
} finally {
|
||||
await browser.close();
|
||||
}
|
||||
}
|
||||
|
||||
main().catch((e) => {
|
||||
console.error('[book] fatal:', e);
|
||||
process.exit(1);
|
||||
});
|
||||
75
docs/pdf/scripts/build-page-pdf.mjs
Normal file
75
docs/pdf/scripts/build-page-pdf.mjs
Normal file
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env node
|
||||
/*
|
||||
* Capture a single docs page to PDF, applying the brand-aligned print
|
||||
* stylesheet. Used both for on-demand single-page PDF (the per-page
|
||||
* "Download PDF" button) and as the unit primitive that the book
|
||||
* builder concatenates.
|
||||
*
|
||||
* Usage:
|
||||
* node pdf/scripts/build-page-pdf.mjs <url> <output.pdf>
|
||||
* node pdf/scripts/build-page-pdf.mjs http://localhost:3000/api pdf/build/api-overview.pdf
|
||||
*
|
||||
* Pre-req: the docs site is built (npm run build) and being served
|
||||
* either by `npm run serve` or some other static server. Pass the URL
|
||||
* the page is reachable at.
|
||||
*/
|
||||
|
||||
import puppeteer from 'puppeteer';
|
||||
import {readFileSync, mkdirSync, existsSync} from 'node:fs';
|
||||
import {dirname, resolve} from 'node:path';
|
||||
|
||||
async function main() {
|
||||
const [url, output] = process.argv.slice(2);
|
||||
if (!url || !output) {
|
||||
console.error('usage: build-page-pdf.mjs <url> <output.pdf>');
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
const printCss = readFileSync(new URL('../styles/print.css', import.meta.url), 'utf8');
|
||||
mkdirSync(dirname(resolve(output)), {recursive: true});
|
||||
|
||||
console.log(`[pdf] launching headless Chromium…`);
|
||||
const browser = await puppeteer.launch({
|
||||
headless: 'new',
|
||||
args: ['--no-sandbox', '--font-render-hinting=none'],
|
||||
});
|
||||
|
||||
try {
|
||||
const page = await browser.newPage();
|
||||
page.on('console', (m) => console.log(`[pdf:browser] ${m.type()}: ${m.text()}`));
|
||||
page.on('pageerror', (e) => console.error(`[pdf:browser-error] ${e.message}`));
|
||||
|
||||
console.log(`[pdf] loading ${url}`);
|
||||
await page.goto(url, {waitUntil: 'networkidle0', timeout: 60_000});
|
||||
|
||||
// Apply the print stylesheet (so it lays out for paper while still
|
||||
// running with media:screen — works around quirks where some
|
||||
// Docusaurus chrome only renders for screen).
|
||||
await page.addStyleTag({content: printCss});
|
||||
await page.emulateMediaType('print');
|
||||
|
||||
// Give web fonts time to settle so headlines don't fall back.
|
||||
await page.evaluateHandle('document.fonts.ready');
|
||||
|
||||
console.log(`[pdf] rendering PDF → ${output}`);
|
||||
await page.pdf({
|
||||
path: resolve(output),
|
||||
format: 'A4',
|
||||
printBackground: true,
|
||||
preferCSSPageSize: true,
|
||||
margin: {top: '22mm', right: '18mm', bottom: '24mm', left: '18mm'},
|
||||
displayHeaderFooter: false, // headers/footers come from @page in print.css
|
||||
});
|
||||
|
||||
const fs = await import('node:fs/promises');
|
||||
const {size} = await fs.stat(resolve(output));
|
||||
console.log(`[pdf] done — ${(size / 1024).toFixed(1)} KB`);
|
||||
} finally {
|
||||
await browser.close();
|
||||
}
|
||||
}
|
||||
|
||||
main().catch((e) => {
|
||||
console.error('[pdf] fatal:', e);
|
||||
process.exit(1);
|
||||
});
|
||||
124
docs/pdf/scripts/gen-main-docs-books.mjs
Normal file
124
docs/pdf/scripts/gen-main-docs-books.mjs
Normal file
@@ -0,0 +1,124 @@
|
||||
#!/usr/bin/env node
|
||||
// Generate book spines for each main-docs section from the Documentation
|
||||
// sidebar config. One JSON per section under pdf/books/, consumable by
|
||||
// build-book-pdf.mjs.
|
||||
//
|
||||
// Sources:
|
||||
// site/sidebars/documentation.generated.json (already authoritative)
|
||||
//
|
||||
// Outputs:
|
||||
// pdf/books/product-overview.json
|
||||
// pdf/books/use-case-guide.json
|
||||
// ... etc. (one per top-level section that exists)
|
||||
//
|
||||
// Usage: node pdf/scripts/gen-main-docs-books.mjs
|
||||
|
||||
import {readFileSync, writeFileSync, mkdirSync} from 'node:fs';
|
||||
import {resolve, dirname} from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
|
||||
const HERE = dirname(fileURLToPath(import.meta.url));
|
||||
const PDF_ROOT = resolve(HERE, '..');
|
||||
const REPO_ROOT = resolve(PDF_ROOT, '..');
|
||||
const SIDEBAR = resolve(REPO_ROOT, 'site/sidebars/documentation.generated.json');
|
||||
const BOOKS_DIR = resolve(PDF_ROOT, 'books');
|
||||
|
||||
// Mapping from sidebar category label → book metadata (eyebrow/version).
|
||||
// The label must match the top-level category's `label` in the sidebar JSON.
|
||||
const BOOK_META = {
|
||||
'Product Overview': {
|
||||
file: 'product-overview',
|
||||
eyebrow: 'PRODUCT OVERVIEW',
|
||||
subtitle: 'Editions, plans, releases, and the platform at a glance.',
|
||||
},
|
||||
'Use Case Guide': {
|
||||
file: 'use-case-guide',
|
||||
eyebrow: 'USE CASES',
|
||||
subtitle: 'Mission-critical scenarios served by Mattermost.',
|
||||
},
|
||||
'Deployment Guide': {
|
||||
file: 'deployment-guide',
|
||||
eyebrow: 'DEPLOYMENT',
|
||||
subtitle: 'Plan, provision, and ship a production Mattermost deployment.',
|
||||
},
|
||||
'Administration Guide': {
|
||||
file: 'administration-guide',
|
||||
eyebrow: 'ADMINISTRATION',
|
||||
subtitle: 'Configure, manage, scale, secure, and comply.',
|
||||
},
|
||||
'Security Guide': {
|
||||
file: 'security-guide',
|
||||
eyebrow: 'SECURITY',
|
||||
subtitle: 'Security architecture, threat model, and hardening guidance.',
|
||||
},
|
||||
'End User Guide': {
|
||||
file: 'end-user-guide',
|
||||
eyebrow: 'END USER GUIDE',
|
||||
subtitle: 'Everything users need to know to collaborate in Mattermost.',
|
||||
},
|
||||
'Integrations Guide': {
|
||||
file: 'integrations-guide',
|
||||
eyebrow: 'INTEGRATIONS',
|
||||
subtitle: 'Bring your tools into Mattermost — from webhooks to platform plugins.',
|
||||
},
|
||||
'Get Help': {
|
||||
file: 'get-help',
|
||||
eyebrow: 'SUPPORT',
|
||||
subtitle: 'Channels for help, escalation, and feedback.',
|
||||
},
|
||||
};
|
||||
|
||||
function collectDocIds(node, out = []) {
|
||||
if (!node) return out;
|
||||
if (Array.isArray(node)) { node.forEach((n) => collectDocIds(n, out)); return out; }
|
||||
if (node.type === 'doc') out.push(node.id);
|
||||
if (node.type === 'category') {
|
||||
// Prepend the category's link if it points at a doc (the IA's landing
|
||||
// page for that branch — naturally first in print order).
|
||||
if (node.link && node.link.type === 'doc') out.push(node.link.id);
|
||||
if (node.items) collectDocIds(node.items, out);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
function spineFromCategory(cat) {
|
||||
return collectDocIds(cat).map((id) => '/' + id.replace(/^\/+/, ''));
|
||||
}
|
||||
|
||||
function getVersion() {
|
||||
// Try to read from a VERSION file or fall back to today's date.
|
||||
try {
|
||||
return readFileSync(resolve(REPO_ROOT, 'VERSION'), 'utf8').trim() || 'unreleased';
|
||||
} catch {
|
||||
return 'unreleased';
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
const sidebar = JSON.parse(readFileSync(SIDEBAR, 'utf8'));
|
||||
mkdirSync(BOOKS_DIR, {recursive: true});
|
||||
const version = getVersion();
|
||||
|
||||
let written = 0;
|
||||
for (const node of sidebar) {
|
||||
if (node.type !== 'category') continue;
|
||||
const meta = BOOK_META[node.label];
|
||||
if (!meta) continue;
|
||||
const spine = spineFromCategory(node);
|
||||
if (!spine.length) continue;
|
||||
const config = {
|
||||
title: `Mattermost ${node.label}`,
|
||||
subtitle: meta.subtitle,
|
||||
eyebrow: meta.eyebrow,
|
||||
version,
|
||||
spine,
|
||||
};
|
||||
const out = resolve(BOOKS_DIR, `${meta.file}.json`);
|
||||
writeFileSync(out, JSON.stringify(config, null, 2));
|
||||
console.log(`[book] ${out} (${spine.length} pages)`);
|
||||
written++;
|
||||
}
|
||||
console.log(`\n[book] wrote ${written} book configs to ${BOOKS_DIR}`);
|
||||
}
|
||||
|
||||
main();
|
||||
739
docs/pdf/styles/print.css
Normal file
739
docs/pdf/styles/print.css
Normal file
@@ -0,0 +1,739 @@
|
||||
/*
|
||||
* Print stylesheet for Mattermost docs PDF capture.
|
||||
*
|
||||
* Loaded by the PDF builder (pdf/scripts/build-*.mjs) via:
|
||||
* page.addStyleTag({ path: 'pdf/styles/print.css' })
|
||||
* before printing.
|
||||
*
|
||||
* Why this lives here instead of docs/site/src/css:
|
||||
* The docs site is media-screen first; print is a publishing artifact
|
||||
* produced by a separate pipeline. Keeping the print CSS next to the
|
||||
* PDF builder makes the dependency obvious and lets us iterate on
|
||||
* pagination without touching the live site CSS.
|
||||
*
|
||||
* If you need to move it back into the docs site (e.g., to enable a
|
||||
* "Download PDF" button that does in-browser print-preview), drop it
|
||||
* into docs/site/src/css/ and add a `<link rel="stylesheet"
|
||||
* media="print" …>` reference.
|
||||
*/
|
||||
|
||||
/* ============================================================
|
||||
* @page rules
|
||||
* ========================================================== */
|
||||
|
||||
@page {
|
||||
size: A4;
|
||||
margin: 22mm 18mm 24mm 18mm;
|
||||
@bottom-left { content: "Mattermost · API v4"; font-family: 'Inter', system-ui, sans-serif; font-size: 8pt; color: #5B77B1; }
|
||||
@bottom-right { content: counter(page) " / " counter(pages); font-family: 'Inter', system-ui, sans-serif; font-size: 8pt; color: #5B77B1; }
|
||||
@top-right { content: string(chapter); font-family: 'Archivo Black', 'Trade Gothic Next Heavy', system-ui, sans-serif; font-size: 8pt; letter-spacing: 0.1em; text-transform: uppercase; color: #1E325C; }
|
||||
}
|
||||
|
||||
@page :first {
|
||||
margin: 0;
|
||||
@top-right { content: none; }
|
||||
@bottom-left { content: none; }
|
||||
@bottom-right { content: none; }
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
* Hide on print: non-content site chrome
|
||||
* ========================================================== */
|
||||
|
||||
.navbar,
|
||||
.theme-doc-sidebar-container,
|
||||
.theme-doc-toc-mobile,
|
||||
.theme-doc-toc-desktop,
|
||||
.table-of-contents,
|
||||
.theme-doc-breadcrumbs,
|
||||
.theme-edit-this-page,
|
||||
.pagination-nav,
|
||||
.theme-back-to-top-button,
|
||||
nav[aria-label="Breadcrumbs"],
|
||||
.footer,
|
||||
button[aria-label*="navigation"],
|
||||
button[aria-label*="theme"],
|
||||
.openapi-tabs__container,
|
||||
.openapi-right-panel__container,
|
||||
.mm-cta {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
* Article container — reset to print-friendly column
|
||||
* ========================================================== */
|
||||
|
||||
html, body {
|
||||
background: #FFFFFF !important;
|
||||
color: #1B1D22 !important;
|
||||
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
||||
font-size: 10pt;
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
main,
|
||||
.docMainContainer_TBSr,
|
||||
[class*='docMainContainer'],
|
||||
.docItemContainer_Djhp,
|
||||
[class*='docItemContainer'],
|
||||
article,
|
||||
.theme-doc-markdown {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
max-width: none !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.theme-doc-markdown > * { max-width: none !important; }
|
||||
|
||||
/* ============================================================
|
||||
* Headings — Trade Gothic Heavy in denim, with running-header binding
|
||||
* ========================================================== */
|
||||
|
||||
h1, h2, h3, h4 {
|
||||
font-family: 'Archivo Black', 'Trade Gothic Next Heavy', 'Helvetica Neue', system-ui, sans-serif;
|
||||
color: #1E325C;
|
||||
letter-spacing: -0.015em;
|
||||
line-height: 1.1;
|
||||
page-break-after: avoid;
|
||||
break-after: avoid;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 26pt;
|
||||
margin: 0 0 8pt;
|
||||
padding-bottom: 6pt;
|
||||
border-bottom: 2pt solid #FFBC1F;
|
||||
string-set: chapter content(); /* feeds @top-right via @page */
|
||||
page-break-before: always;
|
||||
break-before: page;
|
||||
}
|
||||
|
||||
h1:first-of-type {
|
||||
page-break-before: avoid;
|
||||
break-before: avoid;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 16pt;
|
||||
margin: 18pt 0 6pt;
|
||||
padding-top: 8pt;
|
||||
border-top: 1pt solid #D6DDEC;
|
||||
}
|
||||
|
||||
h3 { font-size: 12pt; margin: 12pt 0 4pt; color: #182849; }
|
||||
h4 { font-size: 10.5pt; margin: 10pt 0 3pt; color: #182849; text-transform: uppercase; letter-spacing: 0.06em; }
|
||||
|
||||
/* ============================================================
|
||||
* Body type
|
||||
* ========================================================== */
|
||||
|
||||
p, li {
|
||||
orphans: 3;
|
||||
widows: 3;
|
||||
}
|
||||
p { margin: 0 0 6pt; }
|
||||
ul, ol { margin: 0 0 8pt 18pt; padding: 0; }
|
||||
li { margin-bottom: 2pt; }
|
||||
|
||||
a {
|
||||
color: #1E325C;
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 2px;
|
||||
}
|
||||
|
||||
strong, b { color: #182849; }
|
||||
|
||||
/* ============================================================
|
||||
* Code blocks
|
||||
* ========================================================== */
|
||||
|
||||
code {
|
||||
background: #EEF1F8;
|
||||
border: 0.5pt solid #D6DDEC;
|
||||
border-radius: 2pt;
|
||||
padding: 0.5pt 3pt;
|
||||
font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
|
||||
font-size: 8.5pt;
|
||||
color: #182849;
|
||||
}
|
||||
|
||||
pre, .theme-code-block {
|
||||
background: #EEF1F8 !important;
|
||||
border: 0.5pt solid #D6DDEC !important;
|
||||
border-radius: 3pt;
|
||||
padding: 8pt 10pt;
|
||||
margin: 6pt 0 10pt;
|
||||
font-size: 8.5pt;
|
||||
line-height: 1.45;
|
||||
overflow: visible !important;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
page-break-inside: avoid;
|
||||
break-inside: avoid;
|
||||
}
|
||||
|
||||
pre code, .theme-code-block code {
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
padding: 0 !important;
|
||||
color: #1B1D22;
|
||||
}
|
||||
|
||||
.copyButton, .clean-btn { display: none !important; }
|
||||
|
||||
/* ============================================================
|
||||
* Tables
|
||||
* ========================================================== */
|
||||
|
||||
table {
|
||||
width: 100% !important;
|
||||
border-collapse: collapse;
|
||||
margin: 8pt 0 12pt;
|
||||
page-break-inside: auto;
|
||||
font-size: 9pt;
|
||||
}
|
||||
thead { background: #1E325C; color: #FFFFFF; }
|
||||
thead th {
|
||||
font-family: 'Archivo Black', 'Trade Gothic Next Heavy', system-ui, sans-serif;
|
||||
font-size: 7.5pt;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
text-align: left;
|
||||
padding: 5pt 7pt;
|
||||
border: none !important;
|
||||
}
|
||||
tbody td { padding: 4pt 7pt; border-bottom: 0.4pt solid #D6DDEC; vertical-align: top; }
|
||||
tbody tr:nth-child(even) { background: #F8FAFD; }
|
||||
tbody tr { page-break-inside: avoid; }
|
||||
|
||||
/* ============================================================
|
||||
* Branded MDX components
|
||||
* ========================================================== */
|
||||
|
||||
/* Hero — flatten in print (no full-bleed band, no hex camo). The hero
|
||||
* was a screen marketing surface; in print it just becomes a section
|
||||
* intro. */
|
||||
.mm-hero {
|
||||
background: transparent !important;
|
||||
color: #1B1D22 !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 0 8pt !important;
|
||||
border: none !important;
|
||||
border-bottom: 2pt solid #FFBC1F !important;
|
||||
}
|
||||
.mm-hero * { color: #1B1D22 !important; }
|
||||
.mm-hero [class*="ctaPrimary"],
|
||||
.mm-hero [class*="ctaGhost"] { display: none !important; }
|
||||
.mm-hero [class*="pillars"] { border-top-color: #D6DDEC !important; }
|
||||
|
||||
/* Eyebrow — use as a section marker. Stays small, marigold-bordered. */
|
||||
[class*="eyebrow"] {
|
||||
display: inline-block;
|
||||
font-family: 'Archivo Black', system-ui, sans-serif;
|
||||
font-size: 7.5pt;
|
||||
letter-spacing: 0.18em;
|
||||
text-transform: uppercase;
|
||||
color: #B27F00 !important;
|
||||
border-bottom: 1pt solid #FFBC1F;
|
||||
padding-bottom: 1pt;
|
||||
margin-bottom: 6pt;
|
||||
}
|
||||
|
||||
/* Callouts — denim left bar + label, no shadow, page-break-avoid */
|
||||
[class*="callout"] {
|
||||
border: 0.5pt solid #D6DDEC !important;
|
||||
border-left: 4pt solid #1E325C !important;
|
||||
border-radius: 2pt;
|
||||
padding: 6pt 9pt;
|
||||
margin: 6pt 0 10pt;
|
||||
page-break-inside: avoid;
|
||||
break-inside: avoid;
|
||||
background: #F8FAFD;
|
||||
}
|
||||
[class*="callout"] [class*="bar"] { display: none !important; }
|
||||
[class*="callout"] [class*="label"] {
|
||||
font-family: 'Archivo Black', system-ui, sans-serif;
|
||||
font-size: 7.5pt;
|
||||
letter-spacing: 0.16em;
|
||||
text-transform: uppercase;
|
||||
color: #1E325C;
|
||||
margin-bottom: 3pt;
|
||||
}
|
||||
|
||||
/* StatStrip — wrap as a 4-up grid in print */
|
||||
[class*="strip"] {
|
||||
display: grid !important;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 6pt 12pt;
|
||||
margin: 8pt 0 12pt;
|
||||
padding: 8pt 0;
|
||||
border-top: 1pt solid #FFBC1F;
|
||||
border-bottom: 0.5pt solid #D6DDEC;
|
||||
list-style: none !important;
|
||||
}
|
||||
[class*="strip"] [class*="stat"] { display: flex !important; flex-direction: column; }
|
||||
[class*="strip"] [class*="value"] { font-family: 'Archivo Black', system-ui, sans-serif; font-size: 18pt; color: #1E325C; }
|
||||
[class*="strip"] [class*="label"] { font-family: 'Archivo Black', system-ui, sans-serif; font-size: 7pt; letter-spacing: 0.16em; text-transform: uppercase; color: #5B77B1; margin-top: 2pt; }
|
||||
[class*="strip"] [class*="hint"] { font-size: 7.5pt; color: #5B77B1; margin-top: 1pt; }
|
||||
|
||||
/* MethodLegend — render flat in print */
|
||||
[class*="legend"] {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 4pt 0 10pt;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4pt 10pt;
|
||||
font-size: 8pt;
|
||||
}
|
||||
[class*="legend"] [class*="badge"] {
|
||||
display: inline-block;
|
||||
font-family: 'JetBrains Mono', monospace;
|
||||
font-size: 7pt;
|
||||
font-weight: 600;
|
||||
padding: 1pt 4pt;
|
||||
border-radius: 2pt;
|
||||
color: #FFF;
|
||||
margin-right: 3pt;
|
||||
}
|
||||
|
||||
/* CardGrid — collapse to a clean list in print */
|
||||
[class*="grid"] {
|
||||
display: block !important;
|
||||
}
|
||||
[class*="card"] {
|
||||
display: block !important;
|
||||
margin: 4pt 0 !important;
|
||||
padding: 6pt 8pt !important;
|
||||
border: 0.5pt solid #D6DDEC !important;
|
||||
border-left: 3pt solid #FFBC1F !important;
|
||||
border-radius: 2pt !important;
|
||||
background: #FFFFFF !important;
|
||||
box-shadow: none !important;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
[class*="card"] [class*="title"] {
|
||||
font-family: 'Archivo Black', system-ui, sans-serif;
|
||||
font-size: 10pt;
|
||||
color: #1E325C !important;
|
||||
}
|
||||
[class*="card"] [class*="description"] {
|
||||
font-size: 9pt;
|
||||
color: #1B1D22 !important;
|
||||
margin: 2pt 0;
|
||||
}
|
||||
[class*="card"] [class*="meta"] {
|
||||
font-family: 'JetBrains Mono', monospace;
|
||||
font-size: 7.5pt;
|
||||
color: #B27F00 !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
[class*="card"] [class*="arrow"] { display: none !important; }
|
||||
[class*="card"] [class*="icon"] { display: none !important; }
|
||||
|
||||
/* CardGrid compact variant — hashed class names are `chip_*`, so the
|
||||
* `[class*="card"]` rules above don't reach it. Collapse to the same
|
||||
* list, one weight down. */
|
||||
[class*="chipRow"] {
|
||||
display: block !important;
|
||||
}
|
||||
[class*="chip_"] {
|
||||
display: block !important;
|
||||
margin: 3pt 0 !important;
|
||||
padding: 4pt 8pt !important;
|
||||
border: 0.5pt solid #D6DDEC !important;
|
||||
border-radius: 2pt !important;
|
||||
background: #FFFFFF !important;
|
||||
box-shadow: none !important;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
[class*="chipTitle"] {
|
||||
font-family: 'Archivo Black', system-ui, sans-serif;
|
||||
font-size: 9.5pt;
|
||||
color: #1E325C !important;
|
||||
}
|
||||
[class*="chipDescription"] {
|
||||
font-size: 8.5pt;
|
||||
color: #1B1D22 !important;
|
||||
}
|
||||
[class*="chipArrow"] { display: none !important; }
|
||||
|
||||
/* ============================================================
|
||||
* OpenAPI plugin — print-specific overrides
|
||||
* ========================================================== */
|
||||
|
||||
/* Method endpoint header: render the verb badge + path inline.
|
||||
* (On screen the plugin uses a <pre> with a block-level <h2> child,
|
||||
* which stacks vertically when print CSS resets. Force a flex row.) */
|
||||
pre.openapi__method-endpoint {
|
||||
display: flex !important;
|
||||
align-items: baseline;
|
||||
flex-wrap: wrap;
|
||||
gap: 8pt;
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 0 12pt !important;
|
||||
font-family: 'Inter', sans-serif !important;
|
||||
white-space: normal !important;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
.openapi__method-endpoint .badge {
|
||||
flex: 0 0 auto;
|
||||
display: inline-block;
|
||||
padding: 2pt 7pt !important;
|
||||
border-radius: 2pt !important;
|
||||
font-family: 'JetBrains Mono', monospace !important;
|
||||
font-size: 8pt !important;
|
||||
font-weight: 600 !important;
|
||||
letter-spacing: 0.06em !important;
|
||||
color: #FFFFFF !important;
|
||||
border: none !important;
|
||||
}
|
||||
.openapi__method-endpoint .badge--success { background: #2C7A4F !important; }
|
||||
.openapi__method-endpoint .badge--info,
|
||||
.openapi__method-endpoint .badge--primary { background: #2D7BD2 !important; }
|
||||
.openapi__method-endpoint .badge--warning { background: #A86A1F !important; }
|
||||
.openapi__method-endpoint .badge--danger { background: #8B1F1F !important; }
|
||||
.openapi__method-endpoint .badge--secondary { background: #6B4FA0 !important; }
|
||||
|
||||
.openapi__method-endpoint-path {
|
||||
flex: 1 1 auto !important;
|
||||
font-family: 'JetBrains Mono', monospace !important;
|
||||
font-size: 11pt !important;
|
||||
font-weight: 600 !important;
|
||||
color: #1B1D22 !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
border: none !important;
|
||||
/* This is an h2; break my generic h2 styling. */
|
||||
padding-top: 0 !important;
|
||||
border-top: none !important;
|
||||
page-break-before: avoid !important;
|
||||
break-before: avoid !important;
|
||||
}
|
||||
.openapi__method-endpoint-path::before {
|
||||
display: none !important; /* kill the h2::before marigold rule */
|
||||
}
|
||||
.openapi__divider { display: none; }
|
||||
|
||||
/* Hide tab pickers — interactive only. The tab CONTENT below them
|
||||
* stays visible (we just don't show the buttons since you can't click
|
||||
* in a PDF). */
|
||||
ul[role="tablist"],
|
||||
.openapi-tabs__mime-list-container,
|
||||
.openapi-tabs__schema-list-container,
|
||||
.openapi-tabs__response-list-container,
|
||||
.openapi-tabs__code-list-container {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Tab panels: show only the active one (others stay rendered as DOM
|
||||
* but are aria-hidden). The plugin sets `hidden` attribute on
|
||||
* inactive panels — we just lean on that. */
|
||||
[role="tabpanel"][hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* The right-side interactive panel ("Authorization", "Request" form,
|
||||
* "Send API Request" button) — meaningless in print. */
|
||||
.openapi-right-panel__container {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Schema parameter rows — add spacing between name / type / required */
|
||||
.openapi-schema__container {
|
||||
display: block !important;
|
||||
padding: 4pt 0 !important;
|
||||
border-bottom: 0.4pt dotted #D6DDEC;
|
||||
margin-bottom: 0 !important;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
.openapi-schema__property {
|
||||
font-family: 'JetBrains Mono', monospace !important;
|
||||
font-size: 9pt !important;
|
||||
font-weight: 600 !important;
|
||||
color: #1B1D22 !important;
|
||||
}
|
||||
.openapi-schema__name {
|
||||
display: inline-block;
|
||||
margin-left: 6pt !important;
|
||||
font-family: 'Inter', sans-serif !important;
|
||||
font-size: 8.5pt !important;
|
||||
font-style: italic !important;
|
||||
color: #5B77B1 !important;
|
||||
font-weight: 400 !important;
|
||||
}
|
||||
.openapi-schema__required {
|
||||
display: inline-block;
|
||||
margin-left: 6pt !important;
|
||||
font-family: 'Archivo Black', system-ui, sans-serif !important;
|
||||
font-size: 7pt !important;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: #8B1F1F !important;
|
||||
font-weight: 900 !important;
|
||||
}
|
||||
.openapi-schema__divider { display: none !important; }
|
||||
|
||||
/* The expandable "▼" caret next to nested schemas — irrelevant on paper */
|
||||
[class*='collapsibleHeader'] svg,
|
||||
.openapi-schema__list-item button svg,
|
||||
[class*='SchemaItem'] svg { display: none !important; }
|
||||
|
||||
/* The collapsible content is always visible in print (no toggling) */
|
||||
[class*='collapsibleContent'] {
|
||||
height: auto !important;
|
||||
overflow: visible !important;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
/* Section headings inside endpoint pages (Request, Responses) — make
|
||||
* them stand out with a marigold underline like other content h2s,
|
||||
* but tighter. */
|
||||
.openapi-tabs__heading,
|
||||
.openapi-tabs__response-header {
|
||||
font-family: 'Archivo Black', system-ui, sans-serif !important;
|
||||
font-size: 13pt !important;
|
||||
color: #1E325C !important;
|
||||
margin: 14pt 0 6pt !important;
|
||||
padding: 0 0 3pt !important;
|
||||
border-bottom: 1pt solid #D6DDEC !important;
|
||||
border-top: none !important;
|
||||
page-break-before: avoid;
|
||||
page-break-after: avoid;
|
||||
break-after: avoid;
|
||||
}
|
||||
.openapi-tabs__heading::before,
|
||||
.openapi-tabs__response-header::before { display: none !important; }
|
||||
|
||||
/* Response code chips (200, 400, 401) when shown in body */
|
||||
.openapi-tabs__response-code-item.active {
|
||||
font-family: 'JetBrains Mono', monospace !important;
|
||||
font-weight: 600 !important;
|
||||
font-size: 8pt !important;
|
||||
color: #FFFFFF !important;
|
||||
background: #2C7A4F;
|
||||
padding: 1pt 6pt !important;
|
||||
border-radius: 2pt !important;
|
||||
margin-right: 6pt;
|
||||
}
|
||||
|
||||
/* Each endpoint page's h1 should start a new page (already covered by
|
||||
* the generic h1 rule) — but we make the h1 itself tighter for endpoints. */
|
||||
.docs-doc-id-reference h1:first-child,
|
||||
.docs-doc-id-reference\/login h1:first-child,
|
||||
[class*='docs-doc-id-reference'] h1:first-child {
|
||||
font-size: 22pt !important;
|
||||
margin-bottom: 4pt !important;
|
||||
padding-bottom: 4pt !important;
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
* Cover page (rendered as the first .mm-print-cover element on the page)
|
||||
* ========================================================== */
|
||||
|
||||
.mm-print-cover {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
page-break-after: always;
|
||||
break-after: page;
|
||||
background: #1E325C;
|
||||
color: #FFFFFF;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding: 30mm 24mm;
|
||||
box-sizing: border-box;
|
||||
margin: -22mm -18mm 22mm -18mm;
|
||||
}
|
||||
.mm-print-cover .cover-meta {
|
||||
font-family: 'Archivo Black', system-ui, sans-serif;
|
||||
font-size: 9pt;
|
||||
letter-spacing: 0.18em;
|
||||
text-transform: uppercase;
|
||||
color: #FFBC1F;
|
||||
}
|
||||
.mm-print-cover .cover-title {
|
||||
font-family: 'Archivo Black', system-ui, sans-serif;
|
||||
font-size: 56pt;
|
||||
line-height: 0.95;
|
||||
letter-spacing: -0.025em;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.mm-print-cover .cover-subtitle {
|
||||
font-size: 14pt;
|
||||
line-height: 1.4;
|
||||
color: rgba(255,255,255,0.75);
|
||||
margin-top: 10mm;
|
||||
max-width: 60ch;
|
||||
}
|
||||
.mm-print-cover .cover-bottom {
|
||||
border-top: 2pt solid #FFBC1F;
|
||||
padding-top: 6mm;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
}
|
||||
.mm-print-cover .cover-version {
|
||||
font-family: 'Archivo Black', system-ui, sans-serif;
|
||||
font-size: 12pt;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.mm-print-cover .cover-tagline {
|
||||
font-family: 'Archivo Black', system-ui, sans-serif;
|
||||
font-size: 9pt;
|
||||
letter-spacing: 0.18em;
|
||||
text-transform: uppercase;
|
||||
color: #FFBC1F;
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
* Table of Contents (rendered after the cover, before chapter 1)
|
||||
* ========================================================== */
|
||||
|
||||
.mm-print-toc {
|
||||
page-break-before: always;
|
||||
page-break-after: always;
|
||||
break-before: page;
|
||||
break-after: page;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
/* Suppress the running chapter title until the first real article. */
|
||||
string-set: chapter "";
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-header {
|
||||
margin-bottom: 14mm;
|
||||
padding-bottom: 6pt;
|
||||
border-bottom: 2pt solid #FFBC1F;
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-eyebrow {
|
||||
font-family: 'Archivo Black', system-ui, sans-serif;
|
||||
font-size: 8pt;
|
||||
letter-spacing: 0.18em;
|
||||
text-transform: uppercase;
|
||||
color: #B27F00;
|
||||
margin-bottom: 4pt;
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-heading {
|
||||
font-family: 'Archivo Black', 'Trade Gothic Next Heavy', system-ui, sans-serif;
|
||||
font-size: 32pt;
|
||||
color: #1E325C;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
letter-spacing: -0.02em;
|
||||
/* Override the article H1 rules so the ToC heading doesn't force a new page
|
||||
* or feed the running header with "Table of Contents". */
|
||||
page-break-before: avoid !important;
|
||||
break-before: avoid !important;
|
||||
string-set: chapter "";
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
counter-reset: toc-chapter;
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-chapter {
|
||||
margin: 0 0 8pt;
|
||||
padding: 0;
|
||||
page-break-inside: avoid;
|
||||
break-inside: avoid;
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-chapter > a {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 6pt;
|
||||
text-decoration: none;
|
||||
color: #1E325C;
|
||||
font-family: 'Archivo Black', system-ui, sans-serif;
|
||||
font-size: 11pt;
|
||||
line-height: 1.3;
|
||||
padding: 3pt 0;
|
||||
border-bottom: 0.4pt solid #EEF1F8;
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-num {
|
||||
flex: 0 0 auto;
|
||||
font-family: 'Archivo Black', system-ui, sans-serif;
|
||||
font-size: 9pt;
|
||||
color: #B27F00;
|
||||
letter-spacing: 0.08em;
|
||||
min-width: 22pt;
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-text {
|
||||
flex: 0 1 auto;
|
||||
color: #1E325C;
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-leader {
|
||||
flex: 1 1 auto;
|
||||
border-bottom: 0.4pt dotted #B9C3D9;
|
||||
position: relative;
|
||||
top: -2pt;
|
||||
margin: 0 4pt;
|
||||
min-width: 12pt;
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-page {
|
||||
flex: 0 0 auto;
|
||||
font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
|
||||
font-size: 9pt;
|
||||
color: #5B77B1;
|
||||
min-width: 18pt;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-page::after {
|
||||
content: target-counter(attr(data-href), page);
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-sub {
|
||||
list-style: none;
|
||||
margin: 2pt 0 4pt 28pt;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-sub li {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-sub a {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 6pt;
|
||||
text-decoration: none;
|
||||
font-family: 'Inter', system-ui, sans-serif;
|
||||
font-size: 9.5pt;
|
||||
color: #182849;
|
||||
padding: 1.5pt 0;
|
||||
}
|
||||
|
||||
.mm-print-toc .toc-sub .toc-text { color: #182849; font-weight: 500; }
|
||||
.mm-print-toc .toc-sub .toc-page { color: #5B77B1; }
|
||||
.mm-print-toc .toc-sub .toc-leader { border-bottom-color: #D6DDEC; }
|
||||
|
||||
/* ============================================================
|
||||
* Page-break helpers
|
||||
* ========================================================== */
|
||||
|
||||
img, figure, .mm-no-break {
|
||||
page-break-inside: avoid;
|
||||
break-inside: avoid;
|
||||
max-width: 100% !important;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
hr { display: none; } /* most hr's are visual section breaks; redundant in print */
|
||||
Reference in New Issue
Block a user