nizel-plugin-footnotes 0.1.0 → 0.1.1
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 +46 -3
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,8 +1,51 @@
|
|
|
1
1
|
# nizel-plugin-footnotes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Footnote references and definitions for [Nizel](https://npmjs.com/package/nizel).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- definitions: `[^id]: Footnote text`
|
|
5
|
+
The plugin converts `[^id]` references into linked superscripts, removes footnote definition lines from the document body, and appends a footnotes section.
|
|
7
6
|
|
|
8
7
|
The browser build exposes `NizelFootnotes` from `dist/footnotes.iife.js`.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install nizel-plugin-footnotes
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { useNizel } from 'nizel';
|
|
19
|
+
import { footnotesPlugin } from 'nizel-plugin-footnotes';
|
|
20
|
+
|
|
21
|
+
const nizel = useNizel({
|
|
22
|
+
plugins: [footnotesPlugin()],
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Syntax
|
|
27
|
+
|
|
28
|
+
```md
|
|
29
|
+
This sentence has a note.[^simple]
|
|
30
|
+
|
|
31
|
+
[^simple]: This is the footnote text.
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Unknown references are left untouched.
|
|
35
|
+
|
|
36
|
+
## Options
|
|
37
|
+
|
|
38
|
+
| Option | Type | Default | Description |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
|
+
| `className` | `string` | `'footnotes'` | CSS class for the generated footnotes section. |
|
|
41
|
+
|
|
42
|
+
## Output
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<sup id="fnref-simple"><a href="#fn-simple" class="footnote-ref">1</a></sup>
|
|
46
|
+
<section class="footnotes"><ol><li id="fn-simple">...</li></ol></section>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nizel-plugin-footnotes",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Footnotes extension plugin for Nizel.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"build:browser": "esbuild src/index.ts --bundle --platform=browser --format=iife --global-name=NizelFootnotes --target=safari14 --outfile=dist/footnotes.iife.js",
|
|
29
29
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
30
30
|
"test": "npm run build && vitest run test/*.mjs",
|
|
31
|
-
"test:watch": "npm run build && vitest test/*.mjs"
|
|
31
|
+
"test:watch": "npm run build && vitest test/*.mjs",
|
|
32
|
+
"test:run": "vitest run test/*.mjs"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"nizel": "^0.1.0"
|