@baiyibai-antora/extensions 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.adoc +6 -0
- package/README.adoc +9 -1
- package/dist/extensions/attribute-distiller/index.d.ts +88 -0
- package/dist/extensions/attribute-distiller/index.d.ts.map +1 -0
- package/dist/extensions/attribute-distiller/index.js +436 -0
- package/dist/extensions/attribute-distiller/index.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.adoc
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
All notable changes to this project will be documented in this file.
|
|
5
5
|
|
|
6
|
+
== [1.5.0] - 2026-07-23
|
|
7
|
+
|
|
8
|
+
=== Added
|
|
9
|
+
|
|
10
|
+
* attribute-distiller: a new extension that distills a shared attribute source into per-module generated files listing only the attributes each module's pages reference, and inlines a plain relative include into each impacted page, so references render on the site, in PDF assembly, and in repository file viewers. Write mode is gated to local git worktrees; verify mode reports missing includes and stale generated files for CI, with `fail_on_stale` escalation. The source defaults to the asciidoctorconfig catalog partial, with a repo path as the `source` opt-in; the generated file records the source and the commit hash of its last change; builds regenerate on hash drift and are byte-idempotent otherwise
|
|
11
|
+
|
|
6
12
|
== [1.4.1] - 2026-07-21
|
|
7
13
|
|
|
8
14
|
=== Fixed
|
package/README.adoc
CHANGED
|
@@ -10,7 +10,7 @@ https://baiyibai-antora.gitlab.io
|
|
|
10
10
|
|
|
11
11
|
== Overview
|
|
12
12
|
|
|
13
|
-
This package provides
|
|
13
|
+
This package provides eight Antora extensions:
|
|
14
14
|
|
|
15
15
|
[cols="1,3"]
|
|
16
16
|
|===
|
|
@@ -34,6 +34,9 @@ This package provides seven Antora extensions:
|
|
|
34
34
|
|<<asciidoctorconfig>>
|
|
35
35
|
|Copies `.asciidoctorconfig` files from content catalog to project root
|
|
36
36
|
|
|
37
|
+
|<<attribute-distiller>>
|
|
38
|
+
|Distills a shared attribute source into per-module shortlists and inlines relative includes into pages
|
|
39
|
+
|
|
37
40
|
|<<trademark-it>>
|
|
38
41
|
|Scans catalog source files for trademark terms and injects a filtered declaration table partial
|
|
39
42
|
|===
|
|
@@ -159,6 +162,11 @@ include::docs/modules/ROOT/pages/vale-integration.adoc[tags=reference,leveloffse
|
|
|
159
162
|
|
|
160
163
|
include::docs/modules/ROOT/pages/asciidoctorconfig.adoc[tags=reference,leveloffset=+2]
|
|
161
164
|
|
|
165
|
+
[[attribute-distiller]]
|
|
166
|
+
=== attribute-distiller
|
|
167
|
+
|
|
168
|
+
include::docs/modules/ROOT/pages/attribute-distiller.adoc[tags=reference,leveloffset=+2]
|
|
169
|
+
|
|
162
170
|
== Vendorization
|
|
163
171
|
|
|
164
172
|
To vendorize extensions into your project:
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @baiyibai-antora/extensions - attribute-distiller
|
|
3
|
+
*
|
|
4
|
+
* Distills a shared attribute source down to per-module generated files
|
|
5
|
+
* listing only the attributes each module's pages reference, and inlines a
|
|
6
|
+
* plain relative include into each impacted page. The relative include
|
|
7
|
+
* resolves in Antora and in repository file viewers alike, so attribute
|
|
8
|
+
* references render everywhere the source is read.
|
|
9
|
+
*
|
|
10
|
+
* Configuration in the playbook:
|
|
11
|
+
*
|
|
12
|
+
* antora:
|
|
13
|
+
* extensions:
|
|
14
|
+
* - require: '@baiyibai-antora/extensions/dist/extensions/attribute-distiller'
|
|
15
|
+
* attribute_distiller:
|
|
16
|
+
* enabled: true
|
|
17
|
+
* quiet: true
|
|
18
|
+
* mode: 'write' # write | verify | off
|
|
19
|
+
* source_component: 'asciidoctorconfig' # catalog partial mode, the default
|
|
20
|
+
* source_module: 'ROOT'
|
|
21
|
+
* source_partial: 'asciidoctorconfig.adoc'
|
|
22
|
+
* source: '' # repo path mode when set, overriding the partial
|
|
23
|
+
* generated_relative: 'partials/_generated-attributes.adoc'
|
|
24
|
+
* fail_on_stale: false
|
|
25
|
+
*
|
|
26
|
+
* Write mode mutates page files, only ever inside a local git worktree; a
|
|
27
|
+
* page in a remote origin is treated as verify. The extension writes two
|
|
28
|
+
* file shapes and nothing else: the generated attribute file and one
|
|
29
|
+
* include line per impacted page. It never deletes a file.
|
|
30
|
+
*/
|
|
31
|
+
interface DistillerConfig {
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
quiet: boolean;
|
|
34
|
+
mode: 'write' | 'verify' | 'off';
|
|
35
|
+
source: string;
|
|
36
|
+
source_component: string;
|
|
37
|
+
source_module: string;
|
|
38
|
+
source_partial: string;
|
|
39
|
+
generated_relative: string;
|
|
40
|
+
fail_on_stale: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface AntoraLogger {
|
|
43
|
+
debug?: (msg: string) => void;
|
|
44
|
+
info?: (msg: string) => void;
|
|
45
|
+
warn?: (msg: string) => void;
|
|
46
|
+
error?: (msg: string) => void;
|
|
47
|
+
}
|
|
48
|
+
interface Origin {
|
|
49
|
+
worktree?: string | null;
|
|
50
|
+
startPath?: string;
|
|
51
|
+
url?: string;
|
|
52
|
+
}
|
|
53
|
+
interface AggregateFile {
|
|
54
|
+
path: string;
|
|
55
|
+
contents: Buffer;
|
|
56
|
+
src?: {
|
|
57
|
+
path?: string;
|
|
58
|
+
abspath?: string;
|
|
59
|
+
basename?: string;
|
|
60
|
+
origin?: Origin;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
interface AggregateBucket {
|
|
64
|
+
name: string;
|
|
65
|
+
version?: string;
|
|
66
|
+
files: AggregateFile[];
|
|
67
|
+
}
|
|
68
|
+
interface ExtensionEntry {
|
|
69
|
+
require?: string;
|
|
70
|
+
attribute_distiller?: Partial<DistillerConfig>;
|
|
71
|
+
attributeDistiller?: Partial<DistillerConfig>;
|
|
72
|
+
}
|
|
73
|
+
interface Playbook {
|
|
74
|
+
dir?: string;
|
|
75
|
+
antora?: {
|
|
76
|
+
extensions?: ExtensionEntry[];
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
interface Registry {
|
|
80
|
+
getLogger?: (name: string) => AntoraLogger;
|
|
81
|
+
once: (event: string, callback: (context: {
|
|
82
|
+
playbook: Playbook;
|
|
83
|
+
contentAggregate?: AggregateBucket[];
|
|
84
|
+
}) => Promise<void>) => void;
|
|
85
|
+
}
|
|
86
|
+
export declare function register(context: Registry): void;
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/attribute-distiller/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAOH,UAAU,eAAe;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,UAAU,YAAY;IACpB,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AASD,UAAU,MAAM;IACd,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE;QACJ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB;AAED,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/C,kBAAkB,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC/C;AAED,UAAU,QAAQ;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,cAAc,EAAE,CAAA;KAAE,CAAC;CAC5C;AAED,UAAU,QAAQ;IAChB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,YAAY,CAAC;IAC3C,IAAI,EAAE,CACJ,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,CAAC,OAAO,EAAE;QAAE,QAAQ,EAAE,QAAQ,CAAC;QAAC,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,KAC/F,IAAI,CAAC;CACX;AA0MD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI,CAoLhD"}
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @baiyibai-antora/extensions - attribute-distiller
|
|
4
|
+
*
|
|
5
|
+
* Distills a shared attribute source down to per-module generated files
|
|
6
|
+
* listing only the attributes each module's pages reference, and inlines a
|
|
7
|
+
* plain relative include into each impacted page. The relative include
|
|
8
|
+
* resolves in Antora and in repository file viewers alike, so attribute
|
|
9
|
+
* references render everywhere the source is read.
|
|
10
|
+
*
|
|
11
|
+
* Configuration in the playbook:
|
|
12
|
+
*
|
|
13
|
+
* antora:
|
|
14
|
+
* extensions:
|
|
15
|
+
* - require: '@baiyibai-antora/extensions/dist/extensions/attribute-distiller'
|
|
16
|
+
* attribute_distiller:
|
|
17
|
+
* enabled: true
|
|
18
|
+
* quiet: true
|
|
19
|
+
* mode: 'write' # write | verify | off
|
|
20
|
+
* source_component: 'asciidoctorconfig' # catalog partial mode, the default
|
|
21
|
+
* source_module: 'ROOT'
|
|
22
|
+
* source_partial: 'asciidoctorconfig.adoc'
|
|
23
|
+
* source: '' # repo path mode when set, overriding the partial
|
|
24
|
+
* generated_relative: 'partials/_generated-attributes.adoc'
|
|
25
|
+
* fail_on_stale: false
|
|
26
|
+
*
|
|
27
|
+
* Write mode mutates page files, only ever inside a local git worktree; a
|
|
28
|
+
* page in a remote origin is treated as verify. The extension writes two
|
|
29
|
+
* file shapes and nothing else: the generated attribute file and one
|
|
30
|
+
* include line per impacted page. It never deletes a file.
|
|
31
|
+
*/
|
|
32
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
33
|
+
if (k2 === undefined) k2 = k;
|
|
34
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
35
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
36
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
37
|
+
}
|
|
38
|
+
Object.defineProperty(o, k2, desc);
|
|
39
|
+
}) : (function(o, m, k, k2) {
|
|
40
|
+
if (k2 === undefined) k2 = k;
|
|
41
|
+
o[k2] = m[k];
|
|
42
|
+
}));
|
|
43
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
44
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
45
|
+
}) : function(o, v) {
|
|
46
|
+
o["default"] = v;
|
|
47
|
+
});
|
|
48
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
49
|
+
var ownKeys = function(o) {
|
|
50
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
51
|
+
var ar = [];
|
|
52
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
53
|
+
return ar;
|
|
54
|
+
};
|
|
55
|
+
return ownKeys(o);
|
|
56
|
+
};
|
|
57
|
+
return function (mod) {
|
|
58
|
+
if (mod && mod.__esModule) return mod;
|
|
59
|
+
var result = {};
|
|
60
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
61
|
+
__setModuleDefault(result, mod);
|
|
62
|
+
return result;
|
|
63
|
+
};
|
|
64
|
+
})();
|
|
65
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
+
exports.register = register;
|
|
67
|
+
const fs = __importStar(require("node:fs"));
|
|
68
|
+
const path = __importStar(require("node:path"));
|
|
69
|
+
const node_child_process_1 = require("node:child_process");
|
|
70
|
+
const node_crypto_1 = require("node:crypto");
|
|
71
|
+
let quietMode = true;
|
|
72
|
+
function makeLogger(hostLogger) {
|
|
73
|
+
const log = hostLogger || console;
|
|
74
|
+
return {
|
|
75
|
+
debug: (m) => { if (!quietMode)
|
|
76
|
+
(log.debug ? log.debug(m) : console.debug(m)); },
|
|
77
|
+
info: (m) => { if (!quietMode)
|
|
78
|
+
(log.info ? log.info(m) : console.log(m)); },
|
|
79
|
+
warn: (m) => { (log.warn ? log.warn(m) : console.warn(m)); },
|
|
80
|
+
error: (m) => { (log.error ? log.error(m) : console.error(m)); },
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function pick(obj, keys, def) {
|
|
84
|
+
for (const k of keys) {
|
|
85
|
+
if (obj && obj[k] !== undefined)
|
|
86
|
+
return obj[k];
|
|
87
|
+
}
|
|
88
|
+
return def;
|
|
89
|
+
}
|
|
90
|
+
function readConfig(playbook) {
|
|
91
|
+
const defaults = {
|
|
92
|
+
enabled: true,
|
|
93
|
+
quiet: true,
|
|
94
|
+
mode: 'write',
|
|
95
|
+
source: '',
|
|
96
|
+
source_component: 'asciidoctorconfig',
|
|
97
|
+
source_module: 'ROOT',
|
|
98
|
+
source_partial: 'asciidoctorconfig.adoc',
|
|
99
|
+
generated_relative: 'partials/_generated-attributes.adoc',
|
|
100
|
+
fail_on_stale: false,
|
|
101
|
+
};
|
|
102
|
+
const entries = playbook?.antora?.extensions || [];
|
|
103
|
+
const me = entries.find((e) => String(e?.require || '').includes('attribute-distiller')) || {};
|
|
104
|
+
// The playbook builder camelizes configuration keys, so the block arrives
|
|
105
|
+
// as attributeDistiller from a real playbook and as attribute_distiller
|
|
106
|
+
// from direct invocation; both forms read the same.
|
|
107
|
+
const rawEntry = me.attribute_distiller ?? me.attributeDistiller;
|
|
108
|
+
const raw = (rawEntry && typeof rawEntry === 'object' ? rawEntry : {});
|
|
109
|
+
// The catalog partial is the default source: it is tracked content, where
|
|
110
|
+
// the root artifact the editor reads is generated and may be absent.
|
|
111
|
+
// Setting `source` without naming a component opts into path mode.
|
|
112
|
+
const explicitComponent = raw.source_component !== undefined || raw.sourceComponent !== undefined;
|
|
113
|
+
const explicitSource = raw.source !== undefined;
|
|
114
|
+
const componentValue = explicitComponent
|
|
115
|
+
? pick(raw, ['source_component', 'sourceComponent'], '')
|
|
116
|
+
: (explicitSource ? '' : defaults.source_component);
|
|
117
|
+
return {
|
|
118
|
+
enabled: pick(raw, ['enabled'], defaults.enabled),
|
|
119
|
+
quiet: pick(raw, ['quiet'], defaults.quiet),
|
|
120
|
+
mode: pick(raw, ['mode'], defaults.mode),
|
|
121
|
+
source: pick(raw, ['source'], defaults.source),
|
|
122
|
+
source_component: componentValue,
|
|
123
|
+
source_module: pick(raw, ['source_module', 'sourceModule'], defaults.source_module),
|
|
124
|
+
source_partial: pick(raw, ['source_partial', 'sourcePartial'], defaults.source_partial),
|
|
125
|
+
generated_relative: pick(raw, ['generated_relative', 'generatedRelative'], defaults.generated_relative),
|
|
126
|
+
fail_on_stale: pick(raw, ['fail_on_stale', 'failOnStale'], defaults.fail_on_stale),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
// Attribute definitions parse from `:name: value` lines; unset entries and
|
|
130
|
+
// names outside the reference grammar are ignored. Order is preserved so
|
|
131
|
+
// generated files stay stable.
|
|
132
|
+
function parseDefinitions(text) {
|
|
133
|
+
const defs = new Map();
|
|
134
|
+
for (const line of text.split('\n')) {
|
|
135
|
+
const m = /^:([a-z0-9_][a-z0-9_-]*):(?:\s+(.*))?$/.exec(line.trimEnd());
|
|
136
|
+
if (m)
|
|
137
|
+
defs.set(m[1], (m[2] || '').trim());
|
|
138
|
+
}
|
|
139
|
+
return defs;
|
|
140
|
+
}
|
|
141
|
+
// The freshness stamp: the last commit touching the source file, or a
|
|
142
|
+
// content digest when the file has no committed history.
|
|
143
|
+
function sourceStamp(sourceAbs, contents) {
|
|
144
|
+
try {
|
|
145
|
+
const out = (0, node_child_process_1.execFileSync)('git', ['log', '-1', '--format=%H', '--', path.basename(sourceAbs)], {
|
|
146
|
+
cwd: path.dirname(sourceAbs),
|
|
147
|
+
encoding: 'utf8',
|
|
148
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
149
|
+
}).trim();
|
|
150
|
+
if (out)
|
|
151
|
+
return out;
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
// not a repository, or git unavailable; fall through to the digest
|
|
155
|
+
}
|
|
156
|
+
return 'content-' + (0, node_crypto_1.createHash)('sha1').update(contents).digest('hex').slice(0, 12);
|
|
157
|
+
}
|
|
158
|
+
// References use the resolved grammar: lowercase names in curly braces, not
|
|
159
|
+
// preceded by a backslash escape.
|
|
160
|
+
function referencedNames(text) {
|
|
161
|
+
const found = new Set();
|
|
162
|
+
const re = /(?<!\\)\{([a-z0-9_][a-z0-9_-]*)\}/g;
|
|
163
|
+
let m;
|
|
164
|
+
while ((m = re.exec(text)))
|
|
165
|
+
found.add(m[1]);
|
|
166
|
+
return found;
|
|
167
|
+
}
|
|
168
|
+
// A page's references include those made by the files it includes: prose
|
|
169
|
+
// often lives in partials, and a reference there must pull its definition
|
|
170
|
+
// into the including page. Include targets resolve within the module, in
|
|
171
|
+
// the relative and family-coordinate forms; cross-component targets are
|
|
172
|
+
// out of reach here and their references stay the target component's
|
|
173
|
+
// concern. Cycles and runaway depth stop the walk, never the build.
|
|
174
|
+
const INCLUDE_RE = /^\s*include::([^[\]]+)\[[^\]]*\]\s*$/;
|
|
175
|
+
function resolveIncludeTarget(target, fromDir, moduleDir) {
|
|
176
|
+
const family = /^(partial|page|example)\$(.+)$/.exec(target);
|
|
177
|
+
if (family) {
|
|
178
|
+
const dirByFamily = { partial: 'partials', page: 'pages', example: 'examples' };
|
|
179
|
+
return path.posix.join(moduleDir, dirByFamily[family[1]], family[2]);
|
|
180
|
+
}
|
|
181
|
+
// Resource IDs naming a module or component, and targets built from
|
|
182
|
+
// attribute references, resolve outside this module's file set.
|
|
183
|
+
if (target.includes(':') || target.includes('{'))
|
|
184
|
+
return null;
|
|
185
|
+
return path.posix.normalize(path.posix.join(fromDir, target));
|
|
186
|
+
}
|
|
187
|
+
function collectReferences(file, filesByPath, moduleDir, visited, depth) {
|
|
188
|
+
const text = file.contents.toString();
|
|
189
|
+
const found = referencedNames(text);
|
|
190
|
+
if (depth >= 10)
|
|
191
|
+
return found;
|
|
192
|
+
for (const line of text.split('\n')) {
|
|
193
|
+
const m = INCLUDE_RE.exec(line);
|
|
194
|
+
if (!m)
|
|
195
|
+
continue;
|
|
196
|
+
const targetPath = resolveIncludeTarget(m[1].trim(), path.posix.dirname(file.path), moduleDir);
|
|
197
|
+
if (!targetPath || visited.has(targetPath))
|
|
198
|
+
continue;
|
|
199
|
+
visited.add(targetPath);
|
|
200
|
+
const target = filesByPath.get(targetPath);
|
|
201
|
+
if (!target)
|
|
202
|
+
continue;
|
|
203
|
+
for (const name of collectReferences(target, filesByPath, moduleDir, visited, depth + 1))
|
|
204
|
+
found.add(name);
|
|
205
|
+
}
|
|
206
|
+
return found;
|
|
207
|
+
}
|
|
208
|
+
function inspectHeader(lines, includeRe) {
|
|
209
|
+
const info = { titleIndex: -1, pageDefs: new Set(), includeIndex: -1 };
|
|
210
|
+
let i = 0;
|
|
211
|
+
// Leading comment lines and blank lines may precede the doctitle; a
|
|
212
|
+
// byte-order mark on the first line is part of the encoding, not the
|
|
213
|
+
// title.
|
|
214
|
+
while (i < lines.length && (lines[i].trim() === '' || lines[i].replace(/^\uFEFF/, '').startsWith('//')))
|
|
215
|
+
i++;
|
|
216
|
+
if (i < lines.length && /^\uFEFF?= \S/.test(lines[i])) {
|
|
217
|
+
info.titleIndex = i;
|
|
218
|
+
// The header runs to the first blank line.
|
|
219
|
+
for (let j = i + 1; j < lines.length && lines[j].trim() !== ''; j++) {
|
|
220
|
+
const attr = /^:([a-z0-9_][a-z0-9_-]*)!?:/.exec(lines[j]);
|
|
221
|
+
if (attr)
|
|
222
|
+
info.pageDefs.add(attr[1]);
|
|
223
|
+
if (includeRe.test(lines[j]))
|
|
224
|
+
info.includeIndex = j;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
else if (lines.length && includeRe.test(lines[0])) {
|
|
228
|
+
info.includeIndex = 0;
|
|
229
|
+
}
|
|
230
|
+
return info;
|
|
231
|
+
}
|
|
232
|
+
function generatedContent(sourceLabel, stamp, names, defs) {
|
|
233
|
+
const lines = [
|
|
234
|
+
`// Generated by attribute-distiller from ${sourceLabel}`,
|
|
235
|
+
`// source commit: ${stamp}`,
|
|
236
|
+
'// Do not edit; definitions regenerate on the next build.',
|
|
237
|
+
];
|
|
238
|
+
for (const name of names) {
|
|
239
|
+
const value = defs.get(name) || '';
|
|
240
|
+
// Plain entries: attributes set by the playbook or the CLI are hard by
|
|
241
|
+
// default and already override document entries, so playbook control
|
|
242
|
+
// needs no modifier here; a trailing at-sign would be literal text.
|
|
243
|
+
lines.push(value ? `:${name}: ${value}` : `:${name}:`);
|
|
244
|
+
}
|
|
245
|
+
return lines.join('\n') + '\n';
|
|
246
|
+
}
|
|
247
|
+
function fileAbsPath(file) {
|
|
248
|
+
if (file.src?.abspath)
|
|
249
|
+
return file.src.abspath;
|
|
250
|
+
const origin = file.src?.origin;
|
|
251
|
+
if (origin?.worktree)
|
|
252
|
+
return path.join(origin.worktree, origin.startPath || '', file.path);
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
function writable(file, mode) {
|
|
256
|
+
return mode === 'write' && Boolean(file.src?.origin?.worktree);
|
|
257
|
+
}
|
|
258
|
+
function register(context) {
|
|
259
|
+
const antoraLogger = context.getLogger ? context.getLogger('attribute-distiller') : undefined;
|
|
260
|
+
const logger = makeLogger(antoraLogger);
|
|
261
|
+
context.once('contentAggregated', async ({ playbook, contentAggregate }) => {
|
|
262
|
+
const cfg = readConfig(playbook);
|
|
263
|
+
quietMode = cfg.quiet;
|
|
264
|
+
if (!cfg.enabled || cfg.mode === 'off')
|
|
265
|
+
return;
|
|
266
|
+
if (!contentAggregate) {
|
|
267
|
+
logger.warn('contentAggregate not available');
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
// Resolve the attribute source: a catalog partial when a component is
|
|
271
|
+
// named, a repo path relative to the playbook directory otherwise.
|
|
272
|
+
let sourceText = null;
|
|
273
|
+
let sourceLabel = '';
|
|
274
|
+
let stamp = '';
|
|
275
|
+
if (cfg.source_component) {
|
|
276
|
+
const partialPath = `modules/${cfg.source_module}/partials/${cfg.source_partial}`;
|
|
277
|
+
for (const bucket of contentAggregate) {
|
|
278
|
+
if (bucket.name !== cfg.source_component)
|
|
279
|
+
continue;
|
|
280
|
+
const file = bucket.files.find((f) => f.path === partialPath);
|
|
281
|
+
if (file) {
|
|
282
|
+
sourceText = file.contents.toString();
|
|
283
|
+
sourceLabel = `${cfg.source_component}::partial$${cfg.source_partial}`;
|
|
284
|
+
const abs = fileAbsPath(file);
|
|
285
|
+
stamp = abs ? sourceStamp(abs, sourceText) : 'content-' + (0, node_crypto_1.createHash)('sha1').update(sourceText).digest('hex').slice(0, 12);
|
|
286
|
+
break;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (sourceText == null) {
|
|
290
|
+
logger.warn(`attribute source ${cfg.source_component}::partial$${cfg.source_partial} not found; nothing distilled`);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
const abs = path.resolve(playbook.dir || process.cwd(), cfg.source || '.asciidoctorconfig.adoc');
|
|
296
|
+
try {
|
|
297
|
+
sourceText = fs.readFileSync(abs, 'utf8');
|
|
298
|
+
}
|
|
299
|
+
catch {
|
|
300
|
+
logger.warn(`attribute source ${abs} not readable; nothing distilled`);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
sourceLabel = cfg.source || '.asciidoctorconfig.adoc';
|
|
304
|
+
stamp = sourceStamp(abs, sourceText);
|
|
305
|
+
}
|
|
306
|
+
const defs = parseDefinitions(sourceText);
|
|
307
|
+
if (!defs.size) {
|
|
308
|
+
logger.warn(`attribute source ${sourceLabel} defines no attributes; nothing distilled`);
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
const defOrder = [...defs.keys()];
|
|
312
|
+
const generatedBase = cfg.generated_relative.replace(/^\/+|\/+$/g, '');
|
|
313
|
+
const includeRe = new RegExp(`^include::(?:\\.\\./)+${generatedBase.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\[\\]$`);
|
|
314
|
+
const stats = { modulesWritten: 0, pagesUpdated: 0, staleFindings: [] };
|
|
315
|
+
for (const bucket of contentAggregate) {
|
|
316
|
+
// Group pages by module; index every file for include resolution.
|
|
317
|
+
const modules = new Map();
|
|
318
|
+
const filesByPath = new Map();
|
|
319
|
+
for (const file of bucket.files) {
|
|
320
|
+
filesByPath.set(file.path, file);
|
|
321
|
+
const m = /^modules\/([^/]+)\/pages\/.+\.adoc$/.exec(file.path);
|
|
322
|
+
if (!m)
|
|
323
|
+
continue;
|
|
324
|
+
const list = modules.get(m[1]) || [];
|
|
325
|
+
list.push(file);
|
|
326
|
+
modules.set(m[1], list);
|
|
327
|
+
}
|
|
328
|
+
for (const [moduleName, pages] of modules) {
|
|
329
|
+
const moduleDir = `modules/${moduleName}`;
|
|
330
|
+
const generatedPath = `${moduleDir}/${generatedBase}`;
|
|
331
|
+
const wantedByPage = new Map();
|
|
332
|
+
const moduleWanted = new Set();
|
|
333
|
+
for (const page of pages) {
|
|
334
|
+
const text = page.contents.toString();
|
|
335
|
+
const lines = text.split('\n');
|
|
336
|
+
const header = inspectHeader(lines, includeRe);
|
|
337
|
+
const refs = collectReferences(page, filesByPath, moduleDir, new Set([generatedPath, page.path]), 0);
|
|
338
|
+
const wanted = defOrder.filter((n) => refs.has(n) && !header.pageDefs.has(n));
|
|
339
|
+
wantedByPage.set(page, wanted);
|
|
340
|
+
for (const n of wanted)
|
|
341
|
+
moduleWanted.add(n);
|
|
342
|
+
}
|
|
343
|
+
const existing = bucket.files.find((f) => f.path === generatedPath);
|
|
344
|
+
const names = defOrder.filter((n) => moduleWanted.has(n));
|
|
345
|
+
const nextContent = generatedContent(sourceLabel, stamp, names, defs);
|
|
346
|
+
// The generated file: create or refresh when the module references
|
|
347
|
+
// anything; an existing file for a module that no longer references
|
|
348
|
+
// anything is emptied of definitions, never deleted.
|
|
349
|
+
if (names.length || existing) {
|
|
350
|
+
const current = existing ? existing.contents.toString() : null;
|
|
351
|
+
if (current !== nextContent) {
|
|
352
|
+
if (existing ? writable(existing, cfg.mode) : writable(pages[0], cfg.mode)) {
|
|
353
|
+
if (existing) {
|
|
354
|
+
existing.contents = Buffer.from(nextContent);
|
|
355
|
+
const abs = fileAbsPath(existing);
|
|
356
|
+
if (abs)
|
|
357
|
+
fs.writeFileSync(abs, nextContent);
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
const sibling = pages[0];
|
|
361
|
+
const origin = sibling.src?.origin;
|
|
362
|
+
const abs = origin?.worktree
|
|
363
|
+
? path.join(origin.worktree, origin.startPath || '', generatedPath)
|
|
364
|
+
: null;
|
|
365
|
+
if (abs) {
|
|
366
|
+
fs.mkdirSync(path.dirname(abs), { recursive: true });
|
|
367
|
+
fs.writeFileSync(abs, nextContent);
|
|
368
|
+
}
|
|
369
|
+
bucket.files.push({
|
|
370
|
+
path: generatedPath,
|
|
371
|
+
contents: Buffer.from(nextContent),
|
|
372
|
+
src: {
|
|
373
|
+
path: generatedPath,
|
|
374
|
+
...(abs ? { abspath: abs } : {}),
|
|
375
|
+
basename: path.posix.basename(generatedPath),
|
|
376
|
+
...(origin ? { origin } : {}),
|
|
377
|
+
},
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
stats.modulesWritten++;
|
|
381
|
+
logger.info(`distilled ${names.length} attribute(s) into ${bucket.name}/${generatedPath}`);
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
stats.staleFindings.push(`${bucket.name}/${generatedPath} is ${existing ? 'stale' : 'missing'}`);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
// The include line per page: inserted after the doctitle when the
|
|
389
|
+
// page references distilled attributes, removed when it references
|
|
390
|
+
// none, left alone when already current.
|
|
391
|
+
for (const page of pages) {
|
|
392
|
+
const wanted = wantedByPage.get(page) || [];
|
|
393
|
+
const text = page.contents.toString();
|
|
394
|
+
const lines = text.split('\n');
|
|
395
|
+
const header = inspectHeader(lines, includeRe);
|
|
396
|
+
const depth = path.posix.relative(path.posix.dirname(page.path), moduleDir);
|
|
397
|
+
const includeLine = `include::${depth}/${generatedBase}[]`;
|
|
398
|
+
let nextLines = null;
|
|
399
|
+
if (wanted.length && header.includeIndex < 0) {
|
|
400
|
+
nextLines = [...lines];
|
|
401
|
+
nextLines.splice(header.titleIndex + 1, 0, includeLine);
|
|
402
|
+
}
|
|
403
|
+
else if (!wanted.length && header.includeIndex >= 0) {
|
|
404
|
+
nextLines = lines.filter((_, i) => i !== header.includeIndex);
|
|
405
|
+
}
|
|
406
|
+
else if (wanted.length && header.includeIndex >= 0 && lines[header.includeIndex] !== includeLine) {
|
|
407
|
+
nextLines = [...lines];
|
|
408
|
+
nextLines[header.includeIndex] = includeLine;
|
|
409
|
+
}
|
|
410
|
+
if (!nextLines)
|
|
411
|
+
continue;
|
|
412
|
+
if (writable(page, cfg.mode)) {
|
|
413
|
+
const nextText = nextLines.join('\n');
|
|
414
|
+
page.contents = Buffer.from(nextText);
|
|
415
|
+
const abs = fileAbsPath(page);
|
|
416
|
+
if (abs)
|
|
417
|
+
fs.writeFileSync(abs, nextText);
|
|
418
|
+
stats.pagesUpdated++;
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
stats.staleFindings.push(`${bucket.name}/${page.path} needs its attribute include ${wanted.length ? 'inserted' : 'removed'}`);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
if (stats.modulesWritten || stats.pagesUpdated) {
|
|
427
|
+
logger.info(`attribute-distiller: ${stats.modulesWritten} generated file(s), ${stats.pagesUpdated} page(s) updated`);
|
|
428
|
+
}
|
|
429
|
+
for (const finding of stats.staleFindings)
|
|
430
|
+
logger.warn(`attribute-distiller: ${finding}`);
|
|
431
|
+
if (stats.staleFindings.length && cfg.fail_on_stale) {
|
|
432
|
+
throw new Error(`attribute-distiller: ${stats.staleFindings.length} stale finding(s) with fail_on_stale enabled`);
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/attribute-distiller/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;;;;;;;;;;;;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