@canopycanopycanopy/b-ber-parser-gallery 3.0.8-nav.0 → 3.0.8-next.61

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 CHANGED
@@ -1,9 +1,23 @@
1
- # `@canopycanopycanopy/b-ber-parser-gallery`
1
+ # b-ber-parser-gallery
2
2
 
3
- The `b-ber-parser-gallery` package is used internally parse the `gallery` custom Markdown extension (directive). More information about b-ber directives can be found in the [All directives](https://github.com/triplecanopy/b-ber/wiki/all-directives) page in the b-ber [Wiki](https://github.com/triplecanopy/b-ber/wiki).
3
+ A markdown-it block-container plugin that parses b-ber `gallery` directives into HTML. It recognises colon-fenced blocks (`:::`) with the name `gallery` and tokenises child items written as inline `:: ::` attribute strings. Each child item is parsed with `b-ber-grammar-attributes` and converted into a `<div class="gallery__item">` containing either an `<img>`, `<video>`, or `<audio>` element plus an optional caption `<div class="figcaption">`. MIME types for media sources are resolved with `mime-types`.
4
4
 
5
- ## Install
5
+ ## Usage
6
6
 
7
+ This plugin is registered on a markdown-it instance by the b-ber build pipeline. A higher-level directive handler supplies `validateOpen` and `render` callbacks:
8
+
9
+ ```js
10
+ import galleryPlugin from '@canopycanopycanopy/b-ber-parser-gallery'
11
+
12
+ md.use(galleryPlugin, 'gallery', { validateOpen, render })
7
13
  ```
8
- $ npm i -g @canopycanopycanopy/b-ber-parser-gallery
14
+
15
+ The plugin is consumed during the `render` build step alongside other block-container parsers.
16
+
17
+ ## Dev
18
+
19
+ ```
20
+ npm test
9
21
  ```
22
+
23
+ The test suite currently contains only a `test.todo` placeholder — no assertions are implemented yet.
package/dist/index.js CHANGED
@@ -211,5 +211,4 @@ const containerPlugin = (md, name, options = {}) => {
211
211
  md.renderer.rules[`container_${name}_open`] = render;
212
212
  md.renderer.rules[`container_${name}_close`] = render;
213
213
  };
214
- var _default = containerPlugin;
215
- exports.default = _default;
214
+ var _default = exports.default = containerPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canopycanopycanopy/b-ber-parser-gallery",
3
- "version": "3.0.8-nav.0+24db1e6b",
3
+ "version": "3.0.8-next.61+2bbec564",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -25,11 +25,11 @@
25
25
  "rimraf": "^2.7.1"
26
26
  },
27
27
  "dependencies": {
28
- "@canopycanopycanopy/b-ber-grammar-attributes": "3.0.8-nav.0+24db1e6b",
29
- "@canopycanopycanopy/b-ber-lib": "3.0.8-nav.0+24db1e6b",
30
- "@canopycanopycanopy/b-ber-logger": "3.0.8-nav.0+24db1e6b",
31
- "@canopycanopycanopy/b-ber-shapes-directives": "3.0.8-nav.0+24db1e6b",
32
- "@canopycanopycanopy/b-ber-templates": "3.0.8-nav.0+24db1e6b",
28
+ "@canopycanopycanopy/b-ber-grammar-attributes": "3.0.8-next.61+2bbec564",
29
+ "@canopycanopycanopy/b-ber-lib": "3.0.8-next.61+2bbec564",
30
+ "@canopycanopycanopy/b-ber-logger": "3.0.8-next.61+2bbec564",
31
+ "@canopycanopycanopy/b-ber-shapes-directives": "3.0.8-next.61+2bbec564",
32
+ "@canopycanopycanopy/b-ber-templates": "3.0.8-next.61+2bbec564",
33
33
  "lodash": "^4.17.21",
34
34
  "mime-types": "^2.1.24",
35
35
  "tar": "^6.1.11"
@@ -51,5 +51,5 @@
51
51
  "url": "https://maxwellsimmer.com"
52
52
  }
53
53
  ],
54
- "gitHead": "24db1e6bb491faae0d52c6dadc09d974a5a31cf5"
54
+ "gitHead": "2bbec5643278f53becb0d2ba1f55edfe379d5587"
55
55
  }