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/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();
|
||||
Reference in New Issue
Block a user