@lvl99dotcom/edaha-plugin-toc 0.3.0 → 0.4.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 +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -36,13 +36,13 @@ Headings nest by level: a heading goes under the nearest heading before it with
|
|
|
36
36
|
| `number-depth` | its parent's marker, then its number, e.g. 1.1. or b.2. |
|
|
37
37
|
| `alpha` | a. b. c. |
|
|
38
38
|
| `number-roman` | i. ii. iii. |
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
39
|
+
| `disc` | • |
|
|
40
|
+
| `circle` | ◦ |
|
|
41
41
|
| `square` | ▪ |
|
|
42
42
|
| `diamond` | ⬩ |
|
|
43
43
|
|
|
44
44
|
By default: `level1` number, `level2` and `level3` number-depth, `level4` alpha, `level5` number-roman, `level6` circle.
|
|
45
45
|
|
|
46
|
-
Your layout template needs `{% embedHead %}` before `</head>` (the default theme has it). The editor's embed frames show one block on its own, so they show a note instead of the list; previews show it. See [Embeds](https://
|
|
46
|
+
Your layout template needs `{% embedHead %}` before `</head>` (the default theme has it). The editor's embed frames show one block on its own, so they show a note instead of the list; previews show it. See [Embeds](https://edaha.md/docs/07-embeds/) in the docs.
|
|
47
47
|
|
|
48
48
|
Licensed under the [Apache License 2.0](LICENSE).
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export declare const LIST_STYLES: {
|
|
|
5
5
|
readonly "number-depth": "Number with its parents' (1.1.)";
|
|
6
6
|
readonly alpha: "Letter (a.)";
|
|
7
7
|
readonly "number-roman": "Roman numeral (i.)";
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
8
|
+
readonly disc: "Disc (•)";
|
|
9
|
+
readonly circle: "Circle (◦)";
|
|
10
10
|
readonly square: "Square (▪)";
|
|
11
11
|
readonly diamond: "Diamond (⬩)";
|
|
12
12
|
};
|
|
@@ -33,7 +33,7 @@ export declare const romanNumber: (position: number) => string;
|
|
|
33
33
|
/** A heading in the table of contents, with its marker and the headings under it */
|
|
34
34
|
export interface TocItem {
|
|
35
35
|
heading: EmbedHeading;
|
|
36
|
-
/** What it is marked with, e.g. "b.1." or "
|
|
36
|
+
/** What it is marked with, e.g. "b.1." or "◦" */
|
|
37
37
|
marker: string;
|
|
38
38
|
/** Whether the marker is only decoration (a bullet), so screen readers skip it */
|
|
39
39
|
bullet: boolean;
|
|
@@ -47,7 +47,7 @@ export interface TocItem {
|
|
|
47
47
|
*
|
|
48
48
|
* @example
|
|
49
49
|
* tocMarker("number-depth", 2, "b"); // { marker: "b.2.", bullet: false, prefix: "b.2" }
|
|
50
|
-
* tocMarker("circle", 2, "b"); // { marker: "
|
|
50
|
+
* tocMarker("circle", 2, "b"); // { marker: "◦", bullet: true, prefix: "b" }
|
|
51
51
|
*/
|
|
52
52
|
export declare const tocMarker: (style: ListStyle, position: number, parentPrefix: string) => Pick<TocItem, "marker" | "bullet" | "prefix">;
|
|
53
53
|
/**
|
package/dist/index.js
CHANGED
|
@@ -6,15 +6,15 @@ export const LIST_STYLES = {
|
|
|
6
6
|
"number-depth": "Number with its parents' (1.1.)",
|
|
7
7
|
alpha: "Letter (a.)",
|
|
8
8
|
"number-roman": "Roman numeral (i.)",
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
disc: "Disc (•)",
|
|
10
|
+
circle: "Circle (◦)",
|
|
11
11
|
square: "Square (▪)",
|
|
12
12
|
diamond: "Diamond (⬩)",
|
|
13
13
|
};
|
|
14
|
-
/** The marks of the list styles that aren't counted */
|
|
14
|
+
/** The marks of the list styles that aren't counted: disc, circle and square as browsers mark nested bulleted lists */
|
|
15
15
|
const BULLETS = {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
disc: "•",
|
|
17
|
+
circle: "◦",
|
|
18
18
|
square: "▪",
|
|
19
19
|
diamond: "⬩",
|
|
20
20
|
};
|
|
@@ -77,7 +77,7 @@ export const romanNumber = (position) => {
|
|
|
77
77
|
*
|
|
78
78
|
* @example
|
|
79
79
|
* tocMarker("number-depth", 2, "b"); // { marker: "b.2.", bullet: false, prefix: "b.2" }
|
|
80
|
-
* tocMarker("circle", 2, "b"); // { marker: "
|
|
80
|
+
* tocMarker("circle", 2, "b"); // { marker: "◦", bullet: true, prefix: "b" }
|
|
81
81
|
*/
|
|
82
82
|
export const tocMarker = (style, position, parentPrefix) => {
|
|
83
83
|
const bullet = BULLETS[style];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvl99dotcom/edaha-plugin-toc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Tables of contents of articles' headings in edaha.md sites.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"edaha.md",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@lvl99dotcom/edaha.md": "^0.
|
|
41
|
+
"@lvl99dotcom/edaha.md": "^0.4.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@lvl99dotcom/edaha.md": "^0.
|
|
44
|
+
"@lvl99dotcom/edaha.md": "^0.4.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "node ../edaha/scripts/build-plugin.ts"
|