ctxr-cli 0.12.0 → 0.13.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/README.md +4 -4
- package/dist/commands/publish-check.d.ts.map +1 -1
- package/dist/commands/publish-check.js +31 -0
- package/dist/commands/publish-check.js.map +1 -1
- package/dist/core/browse/nav.d.ts.map +1 -1
- package/dist/core/browse/nav.js +17 -3
- package/dist/core/browse/nav.js.map +1 -1
- package/dist/core/browse/routes.d.ts +9 -0
- package/dist/core/browse/routes.d.ts.map +1 -1
- package/dist/core/browse/routes.js +7 -1
- package/dist/core/browse/routes.js.map +1 -1
- package/dist/core/browse/tree.d.ts +10 -1
- package/dist/core/browse/tree.d.ts.map +1 -1
- package/dist/core/browse/tree.js +19 -4
- package/dist/core/browse/tree.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/templates/skills/ctxr-publish.md +23 -9
package/README.md
CHANGED
|
@@ -260,11 +260,11 @@ The store's own `.contexture/guidance/mission.md` uses the same write path, but
|
|
|
260
260
|
|
|
261
261
|
```sh
|
|
262
262
|
ctxr publish gather --under resources/ # or --note <path>, or --entity <name>
|
|
263
|
-
ctxr publish new comparison
|
|
264
|
-
ctxr publish check .contexture/publish/comparison
|
|
263
|
+
ctxr publish new resources/comparison # scaffolds the page folder and its sibling README
|
|
264
|
+
ctxr publish check .contexture/publish/resources/comparison/index.html
|
|
265
265
|
```
|
|
266
266
|
|
|
267
|
-
`gather` resolves a subject to its note set — never a hand-picked list, which is how an unintended note slips onto a page unnoticed. `check` runs the structural gates: no external references, viewport meta, a print rule, provenance, the sibling README, script syntax. What a page may *contain*, given who will read it
|
|
267
|
+
A page is filed under the top-level folder its subject's notes live in and named for the subject, so the published-pages navigation reads like the store rather than like one long list. `gather` resolves a subject to its note set — never a hand-picked list, which is how an unintended note slips onto a page unnoticed. `check` runs the structural gates: no external references, viewport meta, a print rule, provenance, the sibling README, script syntax, and that filing location. What a page may *contain*, given who will read it — and which folder a cross-cutting subject belongs under — is a judgment `ctxr-publish` walks you through and no check can make.
|
|
268
268
|
|
|
269
269
|
→ `ctxr-publish`, plus the vendored `frontend-design` and `eli5` skills for the craft contexture supplies none of.
|
|
270
270
|
|
|
@@ -276,7 +276,7 @@ ctxr serve
|
|
|
276
276
|
|
|
277
277
|
Renders notes, catalog sections, the graph document, and published pages as cross-linked HTML. It binds loopback (`127.0.0.1`) by default. `--host` widens that, but note what it does not change: `serve` applies **no per-requester filtering at any bind address**. Widening it exposes the whole store to whatever can reach that address, so only do it behind a front end you've arranged yourself.
|
|
278
278
|
|
|
279
|
-
A published page's navigation label follows its own declared `<title>`, falling back to its folder name when it declares none. The header's light/dark/system links choose a display theme, and the ☰ control shows and hides the navigation — both persist across pages via cookies, and neither requires client-side script. A published page itself is still served byte-verbatim, so neither the theme nor the navigation reaches into it; `ctxr publish new`'s scaffold instead follows the viewer's own system preference on its own.
|
|
279
|
+
A published page's navigation label follows its own declared `<title>`, falling back to its folder name when it declares none. A folder group is labelled with the declared name of the taxonomy layer whose path it matches — so a store's own words for its top-level folders reach the sidebar — and with the bare directory name otherwise; either way a group sits where its directory name sorts, not where its label does. The header's light/dark/system links choose a display theme, and the ☰ control shows and hides the navigation — both persist across pages via cookies, and neither requires client-side script. A published page itself is still served byte-verbatim, so neither the theme nor the navigation reaches into it; `ctxr publish new`'s scaffold instead follows the viewer's own system preference on its own.
|
|
280
280
|
|
|
281
281
|
## Keeping a store current
|
|
282
282
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-check.d.ts","sourceRoot":"","sources":["../../src/commands/publish-check.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAK1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"publish-check.d.ts","sourceRoot":"","sources":["../../src/commands/publish-check.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAK1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAoGD;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CA8C/G"}
|
|
@@ -34,6 +34,36 @@ function checkTitle(html) {
|
|
|
34
34
|
return [];
|
|
35
35
|
return [{ check: 'title', message: 'no non-empty <title> element' }];
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* publish spec / file-published-pages-by-location design.md D1–D2: the page's
|
|
39
|
+
* filing *shape*, and nothing more. It fires only when the page folder is an
|
|
40
|
+
* immediate child of the configured publish path, and never names a parent the
|
|
41
|
+
* page should have had — which grouping directory is correct depends on where
|
|
42
|
+
* the subject's notes live and, for a subject whose sources aren't co-located,
|
|
43
|
+
* on a reading of the subject. Neither is derivable from the file being
|
|
44
|
+
* checked, and this command answers only what is (D1). Depth beyond one
|
|
45
|
+
* grouping directory passes: the publish spec already blesses a slug of any
|
|
46
|
+
* depth, so the check is a floor rather than the convention (D2), which the
|
|
47
|
+
* publish skill states instead.
|
|
48
|
+
*
|
|
49
|
+
* A checked file outside the configured publish path entirely reports nothing
|
|
50
|
+
* here — it is not a published page, so it has no filing to judge.
|
|
51
|
+
*/
|
|
52
|
+
function checkPageLocation(relativePath, publishPath) {
|
|
53
|
+
const publishPrefix = publishPath.split(path.sep).join('/').replace(/\/+$/, '');
|
|
54
|
+
if (!relativePath.startsWith(`${publishPrefix}/`))
|
|
55
|
+
return [];
|
|
56
|
+
const underPublish = relativePath.slice(publishPrefix.length + 1);
|
|
57
|
+
const pageFolder = underPublish.slice(0, Math.max(underPublish.lastIndexOf('/'), 0));
|
|
58
|
+
if (pageFolder.includes('/'))
|
|
59
|
+
return [];
|
|
60
|
+
return [
|
|
61
|
+
{
|
|
62
|
+
check: 'page-location',
|
|
63
|
+
message: `filed directly at the configured publish path ("${publishPrefix}/") — a page belongs inside a grouping directory under it`,
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
}
|
|
37
67
|
function checkProvenanceLine(html) {
|
|
38
68
|
const hasDate = /\d{4}-\d{2}-\d{2}/.test(html);
|
|
39
69
|
const hasReadmeLink = /href\s*=\s*["'][^"']*readme[^"']*["']/i.test(html);
|
|
@@ -94,6 +124,7 @@ export async function execute(store, flags) {
|
|
|
94
124
|
...checkProvenanceLine(html),
|
|
95
125
|
...checkTitle(html),
|
|
96
126
|
...checkTagBalance(html),
|
|
127
|
+
...checkPageLocation(relativePath, store.config.publish.path),
|
|
97
128
|
];
|
|
98
129
|
if (!existsSync(readmePath)) {
|
|
99
130
|
failures.push({ check: 'sibling-readme', message: `no sibling README at "${read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AAC,CAAC,GAAG,YAAY,KAAK,QAAQ,CAAC,MAAM,sBAAsB,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;QACzG,SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../../src/core/browse/nav.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../../src/core/browse/nav.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAsHhF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAMnD;AAED,6FAA6F;AAC7F,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CASzD"}
|
package/dist/core/browse/nav.js
CHANGED
|
@@ -43,7 +43,12 @@ function renderTree(nodes, depth) {
|
|
|
43
43
|
}
|
|
44
44
|
const open = depth === 0 ? ' open' : '';
|
|
45
45
|
const children = renderTree(node.children, depth + 1);
|
|
46
|
-
|
|
46
|
+
// file-published-pages-by-location D7: a directory's label is what it is
|
|
47
|
+
// called; `node.name` is what ordered it, and `compareNodes` already read
|
|
48
|
+
// that. Falling back to the segment is the same "one answer to what this is
|
|
49
|
+
// called" rule a page entry follows for its declared name.
|
|
50
|
+
const summary = escapeHtml(node.label ?? node.name);
|
|
51
|
+
return `<li class="ctxr-tree-dir"><details${open}><summary>${summary}</summary>${children}</details></li>`;
|
|
47
52
|
});
|
|
48
53
|
return `<ul class="ctxr-tree">${items.join('')}</ul>`;
|
|
49
54
|
}
|
|
@@ -53,6 +58,15 @@ function renderFlatList(items, hrefFor) {
|
|
|
53
58
|
const listItems = items.map((item) => `<li class="ctxr-tree-leaf"><a href="${escapeHtml(hrefFor(item))}">${escapeHtml(item)}</a></li>`);
|
|
54
59
|
return `<ul class="ctxr-tree">${listItems.join('')}</ul>`;
|
|
55
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* file-published-pages-by-location D8: both folder trees resolve a group's
|
|
63
|
+
* label the same way, because they render through one primitive into one
|
|
64
|
+
* sidebar — a folder reading `Ctx A` in one area and `ctx-a` in the other,
|
|
65
|
+
* inches apart, is the surprising outcome rather than the smaller one.
|
|
66
|
+
*/
|
|
67
|
+
function groupLabelFor(table) {
|
|
68
|
+
return (directoryPath) => table.groupLabels.get(directoryPath);
|
|
69
|
+
}
|
|
56
70
|
/** The listing for one area, rendered once and used by both the navigation and the index page. */
|
|
57
71
|
function renderAreaContent(table, area) {
|
|
58
72
|
switch (area) {
|
|
@@ -61,14 +75,14 @@ function renderAreaContent(table, area) {
|
|
|
61
75
|
const tree = buildPathTree(pages,
|
|
62
76
|
// serve-page-names-theme-and-nav-toggle D1: a page's declared name, falling back to its
|
|
63
77
|
// directory segment — the same "one answer to what this is called" principle D6 gives notes.
|
|
64
|
-
(page) => table.publishTitles.get(page) ?? lastSegment(page), (page) => `/publish/${encodeURI(page)}/${PUBLISH_INDEX_FILE}
|
|
78
|
+
(page) => table.publishTitles.get(page) ?? lastSegment(page), (page) => `/publish/${encodeURI(page)}/${PUBLISH_INDEX_FILE}`, groupLabelFor(table));
|
|
65
79
|
return renderTree(tree, 0);
|
|
66
80
|
}
|
|
67
81
|
case 'notes': {
|
|
68
82
|
const paths = [...table.notes.keys()].sort();
|
|
69
83
|
const tree = buildPathTree(paths,
|
|
70
84
|
// D6: the same answer the catalog gives to "what is this note called".
|
|
71
|
-
(notePath) => titleFor(table.notes.get(notePath)), (notePath) => `/notes/${encodeURI(notePath)}
|
|
85
|
+
(notePath) => titleFor(table.notes.get(notePath)), (notePath) => `/notes/${encodeURI(notePath)}`, groupLabelFor(table));
|
|
72
86
|
return renderTree(tree, 0);
|
|
73
87
|
}
|
|
74
88
|
case 'catalog':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav.js","sourceRoot":"","sources":["../../../src/core/browse/nav.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAmB,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"nav.js","sourceRoot":"","sources":["../../../src/core/browse/nav.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAmB,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,aAAa,EAAyC,MAAM,WAAW,CAAC;AAEjF;;;;GAIG;AACH,MAAM,KAAK,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AAIhE,MAAM,WAAW,GAAqC;IACpD,OAAO,EAAE,iBAAiB;IAC1B,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,yFAAyF;AACzF,MAAM,YAAY,GAAqC;IACrD,OAAO,EAAE,iBAAiB;IAC1B,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,MAAM,WAAW,GAAG,oCAAoC,CAAC;AAEzD,MAAM,UAAU,GAAG,4CAA4C,CAAC;AAEhE,SAAS,WAAW,CAAC,SAAiB;IACpC,MAAM,SAAS,GAAG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AO,CAAC,IAAI,0BAA0B,CAAC;IAErK,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAClC,MAAM,OAAO,GAAG,WAAW,YAAY,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;QACvF,OAAO,GAAG,OAAO,KAAK,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,qBAAqB,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -19,6 +19,15 @@ export interface RouteTable {
|
|
|
19
19
|
publishFiles: ReadonlyMap<string, PublishFileRoute>;
|
|
20
20
|
/** Keyed by page path (the same key `publishPages` reports); the page's own declared name, when it has one. */
|
|
21
21
|
publishTitles: ReadonlyMap<string, string>;
|
|
22
|
+
/**
|
|
23
|
+
* Keyed by a directory path within either the notes or the published-pages
|
|
24
|
+
* tree; the display name something other than the directory segment gives
|
|
25
|
+
* it. file-published-pages-by-location D5: resolved here and handed to the
|
|
26
|
+
* navigation already flattened to paths and strings, the same shape
|
|
27
|
+
* `publishTitles` has — so `nav.ts` renders labels and resolves none, and
|
|
28
|
+
* stays clear of the taxonomy entirely.
|
|
29
|
+
*/
|
|
30
|
+
groupLabels: ReadonlyMap<string, string>;
|
|
22
31
|
}
|
|
23
32
|
/** The file every published-page directory carries, and the route the navigation links a page to. */
|
|
24
33
|
export declare const PUBLISH_INDEX_FILE = "index.html";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/core/browse/routes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC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,CAAC;IACpD,+GAA+G;IAC/G,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C;;;;;;;OAOG;IACH,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAuBD,qGAAqG;AACrG,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAa/C;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,CAExD;AAyFD;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,CAyBvE"}
|
|
@@ -149,9 +149,15 @@ export async function buildRouteTable(store) {
|
|
|
149
149
|
section.id,
|
|
150
150
|
{ id: section.id, absolutePath: path.join(store.root, store.config.catalog.path, sectionFileName(section)) },
|
|
151
151
|
]));
|
|
152
|
+
// D5: a configured layer's path is store-relative and carries no trailing
|
|
153
|
+
// separator as shipped, but a hand-written contexture.yaml may add one —
|
|
154
|
+
// stripped here so the key matches the tree paths it is looked up against.
|
|
155
|
+
const groupLabels = new Map(store.config.taxonomy.layers
|
|
156
|
+
.map((layer) => [layer.path.replace(/\/+$/, ''), layer.name])
|
|
157
|
+
.filter(([layerPath]) => layerPath.length > 0));
|
|
152
158
|
const publishRoot = path.join(store.root, store.config.publish.path);
|
|
153
159
|
const publishFiles = new Map((await walkFiles(publishRoot)).map((file) => [file.urlPath, file]));
|
|
154
160
|
const publishTitles = await resolvePublishTitles(pagesFromPublishFiles(publishFiles), publishFiles);
|
|
155
|
-
return { notes, catalog, graphDocumentPath: graphDocumentPath(store), publishFiles, publishTitles };
|
|
161
|
+
return { notes, catalog, graphDocumentPath: graphDocumentPath(store), publishFiles, publishTitles, groupLabels };
|
|
156
162
|
}
|
|
157
163
|
//# sourceMappingURL=routes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../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AAM,CAAC,QAAQ,CAAC,MAAM;SACzB,GAAG,CAAC,CAAC,KAAK,EAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;SAC9E,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CACjD,CAAC;IAEF,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACjG,MAAM,aAAa,GAAG,MAAM,oBAAoB,CAAC,qBAAqB,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC,CAAC;IAEpG,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,KAAK,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC;AACnH,CAAC"}
|
|
@@ -20,14 +20,23 @@ export interface TreeDirectory {
|
|
|
20
20
|
name: string;
|
|
21
21
|
/** The full `/`-separated path of this directory, for a stable node key. */
|
|
22
22
|
path: string;
|
|
23
|
+
/**
|
|
24
|
+
* file-published-pages-by-location design.md D7: what this directory is
|
|
25
|
+
* *called*, when its caller knows a name for it other than its own segment.
|
|
26
|
+
* Separate from `name` because `name` is what orders it (see `compareNodes`),
|
|
27
|
+
* and a label must not be able to move a directory.
|
|
28
|
+
*/
|
|
29
|
+
label?: string;
|
|
23
30
|
children: TreeNode[];
|
|
24
31
|
}
|
|
25
32
|
export type TreeNode = TreeDirectory | TreeLeaf;
|
|
33
|
+
/** Answers what a directory at this full tree-relative path is called, or nothing to keep its segment. */
|
|
34
|
+
export type DirectoryLabelFor = (directoryPath: string) => string | undefined;
|
|
26
35
|
/**
|
|
27
36
|
* Groups `paths` by their directory segments, to the full depth they carry.
|
|
28
37
|
* A path with no directory segment becomes a leaf at the top level. The
|
|
29
38
|
* result is deterministic for a given set of paths, whatever order they
|
|
30
39
|
* arrive in.
|
|
31
40
|
*/
|
|
32
|
-
export declare function buildPathTree(paths: readonly string[], labelFor: (path: string) => string, hrefFor: (path: string) => string): TreeNode[];
|
|
41
|
+
export declare function buildPathTree(paths: readonly string[], labelFor: (path: string) => string, hrefFor: (path: string) => string, directoryLabelFor?: DirectoryLabelFor): TreeNode[];
|
|
33
42
|
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../src/core/browse/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../src/core/browse/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,QAAQ,CAAC;AAEhD,0GAA0G;AAC1G,MAAM,MAAM,iBAAiB,GAAG,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;AA2C9E;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAClC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EACjC,iBAAiB,CAAC,EAAE,iBAAiB,GACpC,QAAQ,EAAE,CAqBZ"}
|
package/dist/core/browse/tree.js
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
* Directories before leaves, then by codepoint — the same ordering
|
|
11
11
|
* `listNotes()` and `publishPages()` already produce, so the tree is a
|
|
12
12
|
* regrouping of a sorted enumeration rather than a reordering of it.
|
|
13
|
+
*
|
|
14
|
+
* file-published-pages-by-location D7: this deliberately reads `name` and
|
|
15
|
+
* never `label`. A directory's label is operator-authored display text, and
|
|
16
|
+
* sorting on it would make the tree's order depend on wording rather than on
|
|
17
|
+
* the enumeration it regroups — the same reason a leaf already sorts on its
|
|
18
|
+
* path segment and not on its title. The omission is the decision.
|
|
13
19
|
*/
|
|
14
20
|
function compareNodes(a, b) {
|
|
15
21
|
if (a.kind !== b.kind)
|
|
@@ -20,8 +26,17 @@ function compareNodes(a, b) {
|
|
|
20
26
|
return 1;
|
|
21
27
|
return 0;
|
|
22
28
|
}
|
|
23
|
-
function finalize(builder) {
|
|
24
|
-
const directories = [...builder.directories.entries()].map(([name, child]) => ({
|
|
29
|
+
function finalize(builder, directoryLabelFor) {
|
|
30
|
+
const directories = [...builder.directories.entries()].map(([name, child]) => ({
|
|
31
|
+
kind: 'directory',
|
|
32
|
+
name,
|
|
33
|
+
path: child.path,
|
|
34
|
+
// D6: asked about the directory's full path within the tree, not its last
|
|
35
|
+
// segment, so a caller can label the folder that stands for something and
|
|
36
|
+
// leave a deeper folder that merely shares its name alone.
|
|
37
|
+
label: directoryLabelFor?.(child.path),
|
|
38
|
+
children: finalize(child, directoryLabelFor),
|
|
39
|
+
}));
|
|
25
40
|
return [...directories, ...builder.leaves].sort(compareNodes);
|
|
26
41
|
}
|
|
27
42
|
/**
|
|
@@ -30,7 +45,7 @@ function finalize(builder) {
|
|
|
30
45
|
* result is deterministic for a given set of paths, whatever order they
|
|
31
46
|
* arrive in.
|
|
32
47
|
*/
|
|
33
|
-
export function buildPathTree(paths, labelFor, hrefFor) {
|
|
48
|
+
export function buildPathTree(paths, labelFor, hrefFor, directoryLabelFor) {
|
|
34
49
|
const root = { path: '', directories: new Map(), leaves: [] };
|
|
35
50
|
for (const entryPath of paths) {
|
|
36
51
|
const segments = entryPath.split('/').filter((segment) => segment.length > 0);
|
|
@@ -48,6 +63,6 @@ export function buildPathTree(paths, labelFor, hrefFor) {
|
|
|
48
63
|
}
|
|
49
64
|
node.leaves.push({ kind: 'leaf', name, path: entryPath, label: labelFor(entryPath), href: hrefFor(entryPath) });
|
|
50
65
|
}
|
|
51
|
-
return finalize(root);
|
|
66
|
+
return finalize(root, directoryLabelFor);
|
|
52
67
|
}
|
|
53
68
|
//# sourceMappingURL=tree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../src/core/browse/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../src/core/browse/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAsCH;;;;;;;;;;GAUG;AACH,SAAS,YAAY,CAAC,CAAW,EAAE,CAAW;IAC5C,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;QAAE,OAAO,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI;QAAE,OAAO,CAAC,CAAC,CAAC;IAC/B,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI;QAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,QAAQ,CAAC,OAAyB,EAAE,iBAAqC;IAChF,MAAM,WAAW,GAAG,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CACxD,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAiB,EAAE,CAAC,CAAC;QACjC,IAAI,EAAE,WAAW;QACjB,IAAI;QACJ,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,0EAA0E;QAC1E,0EAA0E;QAC1E,2DAA2D;QAC3D,KAAK,EAAE,iBAAiB,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;QACtC,QAAQ,EAAE,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;KAC7C,CAAC,CACH,CAAC;IACF,OAAO,CAAC,GAAG,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAChE,CAAC;AAGD;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAwB,EACxB,QAAkC,EAClC,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AAE,iBAAiB,CAAC,CAAC;AAC3C,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Kept in sync with package.json's "version" field. */
|
|
2
|
-
export declare const CLI_VERSION = "0.
|
|
2
|
+
export declare const CLI_VERSION = "0.13.0";
|
|
3
3
|
/**
|
|
4
4
|
* The npm package this executable is published as. Bound here, beside the
|
|
5
5
|
* version, because the release check resolves the latest published release by
|
package/dist/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Kept in sync with package.json's "version" field. */
|
|
2
|
-
export const CLI_VERSION = '0.
|
|
2
|
+
export const CLI_VERSION = '0.13.0';
|
|
3
3
|
/**
|
|
4
4
|
* The npm package this executable is published as. Bound here, beside the
|
|
5
5
|
* version, because the release check resolves the latest published release by
|
package/package.json
CHANGED
|
@@ -25,13 +25,27 @@ content belongs in front of this page's intended readers — a page written for
|
|
|
25
25
|
not carry material written about that party, or about anyone else who did not expect to be quoted.
|
|
26
26
|
When you are unsure about a note, leave it out and name it to the operator rather than guessing.
|
|
27
27
|
|
|
28
|
-
## 4. Fix the identity once
|
|
29
|
-
|
|
30
|
-
`ctxr publish new <slug>` creates the page's folder.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
## 4. Fix the identity once, and file it where its subject lives
|
|
29
|
+
|
|
30
|
+
`ctxr publish new <slug>` creates the page's folder. The slug is a path, and its shape carries
|
|
31
|
+
meaning: file the page under the top-level folder its subject's notes live in, and name it for the
|
|
32
|
+
subject — `<top-level-folder>/<subject>`, never `<subject>` alone at the root. Two levels, no more:
|
|
33
|
+
the first says where in the store this belongs, the second says what it is. That is what makes the
|
|
34
|
+
published-pages navigation read like the store instead of like one long list, and
|
|
35
|
+
`ctxr publish check` reports a page filed flat at the publish root as a failing check.
|
|
36
|
+
|
|
37
|
+
When the notes step 2 gathered span more than one top-level folder — or the store's taxonomy declares
|
|
38
|
+
none at all — no folder is derivable and the choice is yours to make and to own: pick the one that
|
|
39
|
+
best names the subject to the reader, write that choice and your reason into the page's README, and
|
|
40
|
+
name it to the operator. Nothing checks this for you, by design. A page whose sources aren't
|
|
41
|
+
co-located is exactly the kind step 1 says most earns a page, and filing it under a word that names
|
|
42
|
+
nothing serves nobody who reads it.
|
|
43
|
+
|
|
44
|
+
A slug starting with a date (`YYYY-` or `YYYY-MM-DD-`) is reserved for a frozen snapshot — never used
|
|
45
|
+
for a page you intend to keep updating. That rule binds the page's own final segment, not the folders
|
|
46
|
+
it is filed under. The command refuses to overwrite an existing folder; if one already exists for
|
|
47
|
+
this subject, edit its files directly rather than re-running `publish new` — a rename or an overwrite
|
|
48
|
+
breaks any link already handed out.
|
|
35
49
|
|
|
36
50
|
## 5. Choose the form, then delegate the craft
|
|
37
51
|
|
|
@@ -58,8 +72,8 @@ lower is the same material in shorter words.
|
|
|
58
72
|
## 6. Verify the output invariants
|
|
59
73
|
|
|
60
74
|
`ctxr publish check <path>` runs the mechanical half of the checklist — no external network address,
|
|
61
|
-
a viewport meta tag, at least one print rule, a provenance line, a sibling README, balanced tags,
|
|
62
|
-
valid syntax in every embedded script. It exits non-zero naming every failing check; fix all of them
|
|
75
|
+
a viewport meta tag, at least one print rule, a provenance line, a sibling README, balanced tags,
|
|
76
|
+
valid syntax in every embedded script, and the page's filing location from step 4. It exits non-zero naming every failing check; fix all of them
|
|
63
77
|
before reporting the page as ready. It answers only what's derivable from the file itself — the DO-test
|
|
64
78
|
in step 1, the form and reader choices in step 5, and factual accuracy stay judgment calls, not checker output.
|
|
65
79
|
|