@canopycanopycanopy/b-ber-grammar-footnotes 3.0.8-next.61 → 3.0.8-next.97
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/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -58
- package/package.json +12 -14
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";iBAEwB,wBAAA,CAAyB,IAAA,SACxB,MAAM;AAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,59 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = markdownItFootnotePlugin;
|
|
9
|
-
var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
10
|
-
var _State = _interopRequireDefault(require("@canopycanopycanopy/b-ber-lib/State"));
|
|
1
|
+
let _canopycanopycanopy_b_ber_lib = require("@canopycanopycanopy/b-ber-lib");
|
|
2
|
+
//#region src/index.ts
|
|
11
3
|
function markdownItFootnotePlugin(self) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const notes = self.markdownIt.renderer.render(tokens, 0, {
|
|
51
|
-
reference: `${fileName}.xhtml`
|
|
52
|
-
});
|
|
53
|
-
_State.default.add('footnotes', {
|
|
54
|
-
fileName,
|
|
55
|
-
title,
|
|
56
|
-
notes
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
}
|
|
4
|
+
return function plugin(tokens) {
|
|
5
|
+
const { fileName } = self;
|
|
6
|
+
const title = _canopycanopycanopy_b_ber_lib.State.find("spine.flattened", { fileName })?.title || fileName;
|
|
7
|
+
tokens.unshift({
|
|
8
|
+
type: "block",
|
|
9
|
+
tag: "section",
|
|
10
|
+
attrs: [["class", "footnotes break-after"]],
|
|
11
|
+
nesting: 1,
|
|
12
|
+
block: true
|
|
13
|
+
}, {
|
|
14
|
+
type: "block",
|
|
15
|
+
tag: "h1",
|
|
16
|
+
nesting: 1,
|
|
17
|
+
block: true
|
|
18
|
+
}, {
|
|
19
|
+
type: "text",
|
|
20
|
+
block: false,
|
|
21
|
+
content: title
|
|
22
|
+
}, {
|
|
23
|
+
type: "block",
|
|
24
|
+
tag: "h1",
|
|
25
|
+
nesting: -1
|
|
26
|
+
});
|
|
27
|
+
tokens.push({
|
|
28
|
+
type: "block",
|
|
29
|
+
tag: "section",
|
|
30
|
+
nesting: -1
|
|
31
|
+
});
|
|
32
|
+
const notes = self.markdownIt.renderer.render(tokens, 0, { reference: `${fileName}.xhtml` });
|
|
33
|
+
_canopycanopycanopy_b_ber_lib.State.add("footnotes", {
|
|
34
|
+
fileName,
|
|
35
|
+
title,
|
|
36
|
+
notes
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
module.exports = markdownItFootnotePlugin;
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canopycanopycanopy/b-ber-grammar-footnotes",
|
|
3
|
-
"version": "3.0.8-next.
|
|
3
|
+
"version": "3.0.8-next.97+2e9748e6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"prepare": "npm run clean && npm run prepare:dist",
|
|
10
|
-
"build": "npm run prepare",
|
|
11
|
-
"watch": "BABEL_ENV=production babel --config-file ../../babel.config.js -d dist/ src/ --watch src",
|
|
7
|
+
"build": "tsdown",
|
|
8
|
+
"typecheck": "tsc --noEmit",
|
|
12
9
|
"test": "jest"
|
|
13
10
|
},
|
|
14
11
|
"author": "Triple Canopy <b-ber@canopycanopycanopy.com> (https://triplecanopy.github.io/)",
|
|
@@ -17,15 +14,15 @@
|
|
|
17
14
|
"access": "public"
|
|
18
15
|
},
|
|
19
16
|
"devDependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
17
|
+
"@swc/core": "^1.15.40",
|
|
18
|
+
"@swc/jest": "^0.2.39",
|
|
19
|
+
"jest": "^29.7.0",
|
|
20
|
+
"rimraf": "^2.7.1",
|
|
21
|
+
"tsdown": "^0.22.1",
|
|
22
|
+
"typescript": "^6.0.3"
|
|
26
23
|
},
|
|
27
24
|
"dependencies": {
|
|
28
|
-
"@canopycanopycanopy/b-ber-lib": "3.0.8-next.
|
|
25
|
+
"@canopycanopycanopy/b-ber-lib": "3.0.8-next.97+2e9748e6",
|
|
29
26
|
"lodash": "^4.17.21",
|
|
30
27
|
"lodash.find": "latest",
|
|
31
28
|
"tar": "^6.1.11"
|
|
@@ -47,5 +44,6 @@
|
|
|
47
44
|
"url": "https://maxwellsimmer.com"
|
|
48
45
|
}
|
|
49
46
|
],
|
|
50
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "2e9748e6f00446cd35dc8f933e049d8200fc24dd",
|
|
48
|
+
"types": "dist/index.d.ts"
|
|
51
49
|
}
|