nizel-plugin-details 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 +50 -1
- package/package.json +29 -9
package/README.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
1
|
# nizel-plugin-details
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Disclosure block support for [Nizel](https://npmjs.com/package/nizel).
|
|
4
|
+
|
|
5
|
+
The plugin converts `:::details` fenced blocks into Nizel custom blocks and renders them as native HTML `<details>` / `<summary>` markup.
|
|
6
|
+
|
|
7
|
+
The browser build exposes `NizelDetails` from `dist/details.iife.js`.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install nizel-plugin-details
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { useNizel } from 'nizel';
|
|
19
|
+
import { detailsPlugin } from 'nizel-plugin-details';
|
|
20
|
+
|
|
21
|
+
const nizel = useNizel({
|
|
22
|
+
plugins: [detailsPlugin()],
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Syntax
|
|
27
|
+
|
|
28
|
+
```md
|
|
29
|
+
:::details Click to expand
|
|
30
|
+
Hidden **Markdown** content.
|
|
31
|
+
|
|
32
|
+
- Nested content works
|
|
33
|
+
:::
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If no summary is supplied, the plugin uses `Details`.
|
|
37
|
+
|
|
38
|
+
## Options
|
|
39
|
+
|
|
40
|
+
| Option | Type | Default | Description |
|
|
41
|
+
| --- | --- | --- | --- |
|
|
42
|
+
| `className` | `string` | `'details'` | CSS class for the generated `<details>` element. |
|
|
43
|
+
|
|
44
|
+
## Output
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<details class="details"><summary>Click to expand</summary>...</details>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,23 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nizel-plugin-details",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Details disclosure block 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=NizelDetails --target=safari14 --outfile=dist/details.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
|
}
|