@canopycanopycanopy/b-ber-grammar-media 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,20 @@
1
- # `@canopycanopycanopy/b-ber-grammar-media`
1
+ # b-ber-grammar-media
2
2
 
3
- The `b-ber-grammar-media` package renders b-ber's custom `audio` and `video` Markdown extensions (directives) into HTML. 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
+ Handles the `media` and `media-inline` pseudo-directives, which are build-target-aware aliases resolved before the MarkdownIt parse step. Rather than emitting HTML directly, this package performs a text substitution pass over the raw Markdown string: it finds each `media` or `media-inline` directive, looks up the corresponding entry in `state.media` (populated from the project's `media.yml` file), and replaces the directive with the correct concrete directive (e.g. `vimeo`, `audio`, `figure`) for the current build target. The substituted Markdown is then parsed normally by the rest of the grammar pipeline. This allows authors to write a single `media` directive and have it resolve to different embed types per build.
4
4
 
5
- ## Install
5
+ ## Usage
6
6
 
7
+ Called by the Markdown rendering pipeline before MarkdownIt processing:
8
+
9
+ ```js
10
+ import media from '@canopycanopycanopy/b-ber-grammar-media'
11
+ media.render(markdownString) // returns updated Markdown string
7
12
  ```
8
- $ npm i -g @canopycanopycanopy/b-ber-grammar-media
13
+
14
+ ## Dev
15
+
9
16
  ```
17
+ npm test
18
+ ```
19
+
20
+ Tests are in `__tests__/index.test.js`.
package/dist/index.js CHANGED
@@ -129,7 +129,6 @@ function render(data) {
129
129
  }
130
130
  return str;
131
131
  }
132
- var _default = {
132
+ var _default = exports.default = {
133
133
  render
134
- };
135
- exports.default = _default;
134
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canopycanopycanopy/b-ber-grammar-media",
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": {
@@ -26,9 +26,9 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@babel/runtime-corejs3": "^7.10.5",
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",
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
32
  "lodash": "^4.17.21",
33
33
  "tar": "^6.1.11"
34
34
  },
@@ -49,5 +49,5 @@
49
49
  "url": "https://maxwellsimmer.com"
50
50
  }
51
51
  ],
52
- "gitHead": "24db1e6bb491faae0d52c6dadc09d974a5a31cf5"
52
+ "gitHead": "2bbec5643278f53becb0d2ba1f55edfe379d5587"
53
53
  }