nizel-plugin-abbr 0.1.0 → 0.1.2
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-abbr
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Abbreviation definitions for [Nizel](https://npmjs.com/package/nizel).
|
|
4
|
+
|
|
5
|
+
The plugin removes abbreviation definition lines from the Markdown body and renders matching terms as `<abbr title="...">...</abbr>` in paragraphs, headings, lists, blockquotes, and custom blocks.
|
|
6
|
+
|
|
7
|
+
The browser build exposes `NizelAbbr` from `dist/abbr.iife.js`.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install nizel-plugin-abbr
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { useNizel } from 'nizel';
|
|
19
|
+
import { abbrPlugin } from 'nizel-plugin-abbr';
|
|
20
|
+
|
|
21
|
+
const nizel = useNizel({
|
|
22
|
+
plugins: [abbrPlugin()],
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Syntax
|
|
27
|
+
|
|
28
|
+
```md
|
|
29
|
+
*[HTML]: HyperText Markup Language
|
|
30
|
+
*[CSS]: Cascading Style Sheets
|
|
31
|
+
|
|
32
|
+
HTML and CSS work together.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Definitions can also be supplied from options when the source document should not contain definition lines.
|
|
36
|
+
|
|
37
|
+
## Options
|
|
38
|
+
|
|
39
|
+
| Option | Type | Default | Description |
|
|
40
|
+
| --- | --- | --- | --- |
|
|
41
|
+
| `definitions` | `Record<string, string>` | `{}` | Additional abbreviation definitions merged with document definitions. |
|
|
42
|
+
|
|
43
|
+
## Output
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<p><abbr title="HyperText Markup Language">HTML</abbr> is a markup language.</p>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,23 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nizel-plugin-abbr",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Abbreviation 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=NizelAbbr --target=safari14 --outfile=dist/abbr.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
|
}
|