@u1f992/vivliostyle-index 0.1.0 → 0.2.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 +19 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -34
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/.github/workflows/publish.yml +0 -36
- package/tsconfig.json +0 -44
- package/u1f992-vivliostyle-index-0.1.0.tgz +0 -0
package/README.md
CHANGED
|
@@ -3,3 +3,22 @@
|
|
|
3
3
|
[unified](https://github.com/unifiedjs/unified) plugin that integrates automatic index generation into [Vivliostyle CLI](https://github.com/vivliostyle/vivliostyle-cli) workflows.
|
|
4
4
|
|
|
5
5
|
This project seeks to align with the requirements presented in 藤田節子's『[本の索引の作り方](http://www.chijinshokan.co.jp/Books/ISBN978-4-8052-0932-5.htm)』(地人書館) and [SIST 13 索引作成](https://jipsti.jst.go.jp/sist/handbook/sist13/sist13_m.htm).
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
The basic concept is to embed index manipulation commands in the `data-index` attribute using the format `func,args...`.
|
|
10
|
+
|
|
11
|
+
The command body is a YAML list with top-level brackets omitted. Token and escaping rules follow YAML conventions, plus HTML attribute character encoding. For most words as headings, simply use `foobar`, but for example, to make `null` a heading word, write `"null"`, which becomes `"null"`.
|
|
12
|
+
|
|
13
|
+
| Format | Description |
|
|
14
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `(page,)<id>,<heading>` | Adds a locator (page). Creates the index and heading specified by `<id>` and `<heading>` if they don't exist (`(page,)` must always be omitted). |
|
|
16
|
+
| `page!,<id>,<heading>` | Adds a high-importance locator (page). Creates the index and heading specified by `<id>` and `<heading>` if they don't exist. |
|
|
17
|
+
| `range,<id>,<heading>,<rangeId>` | Starts a locator (range). Not added to the index until properly closed. |
|
|
18
|
+
| `range!,<id>,<heading>,<rangeId>` | Starts a high-importance locator (range). Not added to the index until properly closed. |
|
|
19
|
+
| `/range,<rangeId>` | Closes the corresponding locator (range) and adds it to the index. Creates the index and heading specified by `<id>` and `<heading>` from `range`/`range!` if they don't exist. |
|
|
20
|
+
| `see,<id>,<heading>,<target>` | Adds a "see" reference. Creates the index and heading specified by `<id>` and `<heading>` if they don't exist, but `<target>` is not automatically created. |
|
|
21
|
+
| `seeAlso,<id>,<heading>,<target>` | Adds a "see also" reference. Creates the index and heading specified by `<id>` and `<heading>` if they don't exist, but `<target>` is not automatically created. |
|
|
22
|
+
| `expand,<id>` | Expands the index specified by `<id>` as a child of this element. |
|
|
23
|
+
|
|
24
|
+
Furthermore, `<heading>` and `<target>` follow the format `[Key, Key] | [Key, Key, Key]` where `type Key = null | string | [null, string] | [string, string]`. The basic form of `Key` is a tuple consisting of the heading's innerHTML (JSON representation of `hast.Element.children: hast.ElementContent[]`) and reading for sorting. When the heading is `null`, the innerHTML of the element with the `data-index` attribute is used. `null | string` should be considered as a tuple with the reading omitted. In this case, after collecting all index items, the reading is supplemented from existing items with matching [innerText](https://github.com/syntax-tree/hast-util-to-text), or if none exist, the innerText of `key[0]` is used as the reading. Taking two `Key`s corresponds to group heading and main heading, while three `Key`s correspond to group heading, main heading, and subheading.
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,15 @@ import type * as unified from "unified";
|
|
|
2
2
|
import { byLocales, byListedOrder, type Comparators } from "./sort.js";
|
|
3
3
|
export { byLocales, byListedOrder };
|
|
4
4
|
export declare function defaultComparator(locales?: Intl.LocalesArgument): Comparators[string];
|
|
5
|
+
type Entry = {
|
|
6
|
+
path: string;
|
|
7
|
+
ignoreUpdate: boolean;
|
|
8
|
+
};
|
|
5
9
|
export type Config = {
|
|
10
|
+
entryProcessor: unified.Processor;
|
|
6
11
|
entryContext?: string;
|
|
7
12
|
indexEntryMap: Readonly<{
|
|
8
|
-
[index: string]: readonly string[];
|
|
13
|
+
[index: string]: readonly (string | Entry)[];
|
|
9
14
|
}>;
|
|
10
15
|
comparators: Comparators;
|
|
11
16
|
};
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AAexC,OAAO,EAAQ,SAAS,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;AAEpC,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,GAC7B,WAAW,CAAC,MAAM,CAAC,CAYrB;AA0CD,MAAM,MAAM,MAAM,GAAG;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,QAAQ,CAAC;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AAexC,OAAO,EAAQ,SAAS,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;AAEpC,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,GAC7B,WAAW,CAAC,MAAM,CAAC,CAYrB;AA0CD,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAAC;AAErD,MAAM,MAAM,MAAM,GAAG;IACnB,cAAc,EAAE,OAAO,CAAC,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,QAAQ,CAAC;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG,KAAK,CAAC,EAAE,CAAA;KAAE,CAAC,CAAC;IAC1E,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAqHpD,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -49,22 +49,27 @@ function processEntry(root, indexes, relPath) {
|
|
|
49
49
|
// @ts-expect-error branded
|
|
50
50
|
data, indexes, root, elem, relPath));
|
|
51
51
|
}
|
|
52
|
-
export const index =
|
|
52
|
+
export const index = ({ entryProcessor, entryContext, indexEntryMap, comparators, }) => {
|
|
53
53
|
const ctx = upath.resolve(process.cwd(), entryContext ?? ".");
|
|
54
|
-
|
|
54
|
+
const normalizedIndexEntryMap = new Map(Object.entries(indexEntryMap).map(([index, entries]) => [
|
|
55
55
|
upath.resolve(ctx, index),
|
|
56
|
-
entries.map((
|
|
56
|
+
entries.map((ent) => typeof ent === "string"
|
|
57
|
+
? { entryPath: upath.resolve(ctx, ent), ignoreUpdate: false }
|
|
58
|
+
: {
|
|
59
|
+
entryPath: upath.resolve(ctx, ent.path),
|
|
60
|
+
ignoreUpdate: ent.ignoreUpdate,
|
|
61
|
+
}),
|
|
57
62
|
]));
|
|
58
|
-
const entryIndexMap =
|
|
59
|
-
entries.forEach((
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
const entryIndexMap = normalizedIndexEntryMap.entries().reduce((map, [indexPath, entries]) => {
|
|
64
|
+
entries.forEach(({ entryPath, ignoreUpdate }) => {
|
|
65
|
+
if (!map.has(entryPath)) {
|
|
66
|
+
map.set(entryPath, []);
|
|
67
|
+
}
|
|
68
|
+
map.get(entryPath).push({ indexPath, ignoreUpdate });
|
|
69
|
+
});
|
|
70
|
+
return map;
|
|
71
|
+
}, new Map());
|
|
64
72
|
return (tree, file) => {
|
|
65
|
-
if (this.data()["vfmIndex"]) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
73
|
const root = tree;
|
|
69
74
|
const rawPath = file.path;
|
|
70
75
|
if (typeof rawPath === "undefined") {
|
|
@@ -72,37 +77,37 @@ export const index = function ({ entryContext, indexEntryMap, comparators }) {
|
|
|
72
77
|
return;
|
|
73
78
|
}
|
|
74
79
|
const filePath = upath.resolve(rawPath);
|
|
75
|
-
|
|
80
|
+
const affects = entryIndexMap.get(filePath);
|
|
81
|
+
if (affects) {
|
|
76
82
|
processEntry(root, [], null);
|
|
77
83
|
// trigger hot reload
|
|
78
|
-
|
|
84
|
+
affects
|
|
85
|
+
.filter(({ indexPath, ignoreUpdate }) => indexPath !== filePath && !ignoreUpdate)
|
|
86
|
+
.forEach(({ indexPath }) => touchSync(indexPath));
|
|
79
87
|
}
|
|
80
|
-
|
|
88
|
+
const dependsOn = normalizedIndexEntryMap.get(filePath);
|
|
89
|
+
if (dependsOn) {
|
|
81
90
|
const indexes = [];
|
|
82
91
|
const baseDir = upath.dirname(filePath);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
92
|
+
dependsOn
|
|
93
|
+
.map(({ entryPath }) => ({
|
|
94
|
+
entryPath,
|
|
95
|
+
contents: fs.readFileSync(entryPath, {
|
|
86
96
|
encoding: "utf-8",
|
|
87
97
|
}),
|
|
88
98
|
}))
|
|
89
|
-
.map(({
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
delete this.data()["vfmIndex"];
|
|
100
|
-
}
|
|
101
|
-
return { path, root: fromHtml(file.toString()) };
|
|
102
|
-
})
|
|
103
|
-
.forEach(({ path, root }) => processEntry(root, indexes, filePath === path
|
|
99
|
+
.map(({ entryPath, contents }) => ({
|
|
100
|
+
entryPath,
|
|
101
|
+
root: fromHtml(entryProcessor
|
|
102
|
+
.processSync({
|
|
103
|
+
contents,
|
|
104
|
+
path: entryPath,
|
|
105
|
+
})
|
|
106
|
+
.toString()),
|
|
107
|
+
}))
|
|
108
|
+
.forEach(({ entryPath, root }) => processEntry(root, indexes, filePath === entryPath
|
|
104
109
|
? null
|
|
105
|
-
: upath.relative(baseDir, upath.changeExt(
|
|
110
|
+
: upath.relative(baseDir, upath.changeExt(entryPath, ".html"))));
|
|
106
111
|
deleteRangeStore(indexes);
|
|
107
112
|
const resolved = sort(resolve(indexes), comparators);
|
|
108
113
|
selectAll("[data-index]", root)
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAgB,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAoB,MAAM,WAAW,CAAC;AAC7E,OAAO,EAAE,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ION: ${{ github.ref_name }}
|
|
13
|
-
permissions:
|
|
14
|
-
contents: write # to generate release note
|
|
15
|
-
steps:
|
|
16
|
-
- uses: actions/checkout@v4
|
|
17
|
-
- uses: actions/setup-node@v4
|
|
18
|
-
with:
|
|
19
|
-
node-version: "22"
|
|
20
|
-
registry-url: "https://registry.npmjs.org"
|
|
21
|
-
cache: "npm"
|
|
22
|
-
- run: |
|
|
23
|
-
npm ci
|
|
24
|
-
npm run build
|
|
25
|
-
npm pack
|
|
26
|
-
npm publish --dry-run
|
|
27
|
-
- run: |
|
|
28
|
-
gh release create "${VERSION}" --title "${VERSION}" --generate-notes
|
|
29
|
-
gh release upload "${VERSION}" *.tgz
|
|
30
|
-
env:
|
|
31
|
-
GH_TOKEN: ${{ github.token }}
|
|
32
|
-
- run: |
|
|
33
|
-
npm whoami
|
|
34
|
-
npm publish --access public
|
|
35
|
-
env:
|
|
36
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/tsconfig.json
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
// File Layout
|
|
5
|
-
"rootDir": "./src",
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
|
|
8
|
-
// Environment Settings
|
|
9
|
-
// See also https://aka.ms/tsconfig/module
|
|
10
|
-
"module": "nodenext",
|
|
11
|
-
"target": "esnext",
|
|
12
|
-
// "types": [],
|
|
13
|
-
// For nodejs:
|
|
14
|
-
"lib": ["esnext"],
|
|
15
|
-
"types": ["node"],
|
|
16
|
-
// and npm install -D @types/node
|
|
17
|
-
|
|
18
|
-
// Other Outputs
|
|
19
|
-
"sourceMap": true,
|
|
20
|
-
"declaration": true,
|
|
21
|
-
"declarationMap": true,
|
|
22
|
-
|
|
23
|
-
// Stricter Typechecking Options
|
|
24
|
-
"noUncheckedIndexedAccess": true,
|
|
25
|
-
"exactOptionalPropertyTypes": true,
|
|
26
|
-
|
|
27
|
-
// Style Options
|
|
28
|
-
// "noImplicitReturns": true,
|
|
29
|
-
// "noImplicitOverride": true,
|
|
30
|
-
// "noUnusedLocals": true,
|
|
31
|
-
// "noUnusedParameters": true,
|
|
32
|
-
// "noFallthroughCasesInSwitch": true,
|
|
33
|
-
// "noPropertyAccessFromIndexSignature": true,
|
|
34
|
-
|
|
35
|
-
// Recommended Options
|
|
36
|
-
"strict": true,
|
|
37
|
-
"jsx": "react-jsx",
|
|
38
|
-
"verbatimModuleSyntax": true,
|
|
39
|
-
"isolatedModules": true,
|
|
40
|
-
"noUncheckedSideEffectImports": true,
|
|
41
|
-
"moduleDetection": "force",
|
|
42
|
-
"skipLibCheck": true,
|
|
43
|
-
}
|
|
44
|
-
}
|
|
Binary file
|