nizel-plugin-citations 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 +49 -1
- package/package.json +29 -9
package/README.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
1
|
# nizel-plugin-citations
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Citation references and bibliography output for [Nizel](https://npmjs.com/package/nizel).
|
|
4
|
+
|
|
5
|
+
The plugin recognizes inline references such as `[@doe]`, removes citation definition lines from the document body, and appends a bibliography section at the end of the rendered document.
|
|
6
|
+
|
|
7
|
+
The browser build exposes `NizelCitations` from `dist/citations.iife.js`.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install nizel-plugin-citations
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { useNizel } from 'nizel';
|
|
19
|
+
import { citationsPlugin } from 'nizel-plugin-citations';
|
|
20
|
+
|
|
21
|
+
const nizel = useNizel({
|
|
22
|
+
plugins: [citationsPlugin()],
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Syntax
|
|
27
|
+
|
|
28
|
+
```md
|
|
29
|
+
This sentence cites a source [@smith2026].
|
|
30
|
+
|
|
31
|
+
[@smith2026]: Smith, A. Markdown Rendering Notes, 2026.
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Unknown citation IDs are left as text.
|
|
35
|
+
|
|
36
|
+
## Options
|
|
37
|
+
|
|
38
|
+
| Option | Type | Default | Description |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
|
+
| `className` | `string` | `'citations'` | CSS class for the generated bibliography section. |
|
|
41
|
+
|
|
42
|
+
## Output
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<a class="citation" href="#cite-smith2026">[smith2026]</a>
|
|
46
|
+
<section class="citations"><ol><li id="cite-smith2026">...</li></ol></section>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,23 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nizel-plugin-citations",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Citation plugin for Nizel.",
|
|
5
|
-
"repository": {
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/silvandiepen/nizel"
|
|
8
|
+
},
|
|
6
9
|
"type": "module",
|
|
7
10
|
"main": "./dist/index.js",
|
|
8
11
|
"types": "./dist/index.d.ts",
|
|
9
12
|
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./browser": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
}
|
|
12
21
|
},
|
|
13
|
-
"files": [
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
14
26
|
"scripts": {
|
|
15
27
|
"build": "tsc -p tsconfig.json && npm run build:browser",
|
|
16
28
|
"build:browser": "esbuild src/index.ts --bundle --platform=browser --format=iife --global-name=NizelCitations --target=safari14 --outfile=dist/citations.iife.js",
|
|
17
29
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
18
|
-
"test": "npm run build && vitest run test/*.mjs"
|
|
30
|
+
"test": "npm run build && vitest run test/*.mjs",
|
|
31
|
+
"test:run": "vitest run test/*.mjs"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"nizel": "^0.1.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"esbuild": "^0.27.3"
|
|
19
38
|
},
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public",
|
|
41
|
+
"provenance": true
|
|
42
|
+
}
|
|
23
43
|
}
|