@canopycanopycanopy/b-ber-markdown-renderer 3.0.8-next.61 → 3.0.8-next.97

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.
Files changed (191) hide show
  1. package/dist/index.d.ts +14 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +97 -77
  4. package/package.json +28 -28
  5. package/dist/highlightjs/highlight.js +0 -821
  6. package/dist/highlightjs/index.js +0 -191
  7. package/dist/highlightjs/languages/1c.js +0 -216
  8. package/dist/highlightjs/languages/abnf.js +0 -41
  9. package/dist/highlightjs/languages/accesslog.js +0 -41
  10. package/dist/highlightjs/languages/actionscript.js +0 -55
  11. package/dist/highlightjs/languages/ada.js +0 -157
  12. package/dist/highlightjs/languages/angelscript.js +0 -94
  13. package/dist/highlightjs/languages/apache.js +0 -44
  14. package/dist/highlightjs/languages/applescript.js +0 -44
  15. package/dist/highlightjs/languages/arcade.js +0 -108
  16. package/dist/highlightjs/languages/arduino.js +0 -13
  17. package/dist/highlightjs/languages/armasm.js +0 -91
  18. package/dist/highlightjs/languages/asciidoc.js +0 -174
  19. package/dist/highlightjs/languages/aspectj.js +0 -99
  20. package/dist/highlightjs/languages/autohotkey.js +0 -57
  21. package/dist/highlightjs/languages/autoit.js +0 -105
  22. package/dist/highlightjs/languages/avrasm.js +0 -42
  23. package/dist/highlightjs/languages/awk.js +0 -46
  24. package/dist/highlightjs/languages/axapta.js +0 -21
  25. package/dist/highlightjs/languages/bash.js +0 -64
  26. package/dist/highlightjs/languages/basic.js +0 -36
  27. package/dist/highlightjs/languages/bnf.js +0 -26
  28. package/dist/highlightjs/languages/brainfuck.js +0 -29
  29. package/dist/highlightjs/languages/cal.js +0 -65
  30. package/dist/highlightjs/languages/capnproto.js +0 -42
  31. package/dist/highlightjs/languages/ceylon.js +0 -60
  32. package/dist/highlightjs/languages/clean.js +0 -16
  33. package/dist/highlightjs/languages/clojure-repl.js +0 -14
  34. package/dist/highlightjs/languages/clojure.js +0 -69
  35. package/dist/highlightjs/languages/cmake.js +0 -26
  36. package/dist/highlightjs/languages/coffeescript.js +0 -139
  37. package/dist/highlightjs/languages/coq.js +0 -19
  38. package/dist/highlightjs/languages/cos.js +0 -111
  39. package/dist/highlightjs/languages/cpp.js +0 -144
  40. package/dist/highlightjs/languages/crmsh.js +0 -72
  41. package/dist/highlightjs/languages/crystal.js +0 -233
  42. package/dist/highlightjs/languages/cs.js +0 -162
  43. package/dist/highlightjs/languages/csp.js +0 -21
  44. package/dist/highlightjs/languages/css.js +0 -90
  45. package/dist/highlightjs/languages/d.js +0 -213
  46. package/dist/highlightjs/languages/dart.js +0 -84
  47. package/dist/highlightjs/languages/delphi.js +0 -60
  48. package/dist/highlightjs/languages/diff.js +0 -51
  49. package/dist/highlightjs/languages/django.js +0 -39
  50. package/dist/highlightjs/languages/dns.js +0 -28
  51. package/dist/highlightjs/languages/dockerfile.js +0 -17
  52. package/dist/highlightjs/languages/dos.js +0 -38
  53. package/dist/highlightjs/languages/dsconfig.js +0 -48
  54. package/dist/highlightjs/languages/dts.js +0 -92
  55. package/dist/highlightjs/languages/dust.js +0 -31
  56. package/dist/highlightjs/languages/ebnf.js +0 -24
  57. package/dist/highlightjs/languages/elixir.js +0 -85
  58. package/dist/highlightjs/languages/elm.js +0 -77
  59. package/dist/highlightjs/languages/erb.js +0 -14
  60. package/dist/highlightjs/languages/erlang-repl.js +0 -33
  61. package/dist/highlightjs/languages/erlang.js +0 -114
  62. package/dist/highlightjs/languages/excel.js +0 -44
  63. package/dist/highlightjs/languages/fix.js +0 -27
  64. package/dist/highlightjs/languages/flix.js +0 -33
  65. package/dist/highlightjs/languages/fortran.js +0 -38
  66. package/dist/highlightjs/languages/fsharp.js +0 -49
  67. package/dist/highlightjs/languages/gams.js +0 -100
  68. package/dist/highlightjs/languages/gauss.js +0 -147
  69. package/dist/highlightjs/languages/gcode.js +0 -57
  70. package/dist/highlightjs/languages/gherkin.js +0 -31
  71. package/dist/highlightjs/languages/glsl.js +0 -28
  72. package/dist/highlightjs/languages/gml.js +0 -17
  73. package/dist/highlightjs/languages/go.js +0 -44
  74. package/dist/highlightjs/languages/golo.js +0 -14
  75. package/dist/highlightjs/languages/gradle.js +0 -11
  76. package/dist/highlightjs/languages/groovy.js +0 -73
  77. package/dist/highlightjs/languages/haml.js +0 -79
  78. package/dist/highlightjs/languages/handlebars.js +0 -32
  79. package/dist/highlightjs/languages/haskell.js +0 -102
  80. package/dist/highlightjs/languages/haxe.js +0 -125
  81. package/dist/highlightjs/languages/hsp.js +0 -33
  82. package/dist/highlightjs/languages/htmlbars.js +0 -66
  83. package/dist/highlightjs/languages/http.js +0 -49
  84. package/dist/highlightjs/languages/hy.js +0 -73
  85. package/dist/highlightjs/languages/inform7.js +0 -52
  86. package/dist/highlightjs/languages/ini.js +0 -59
  87. package/dist/highlightjs/languages/irpf90.js +0 -43
  88. package/dist/highlightjs/languages/isbl.js +0 -526
  89. package/dist/highlightjs/languages/java.js +0 -75
  90. package/dist/highlightjs/languages/javascript.js +0 -149
  91. package/dist/highlightjs/languages/jboss-cli.js +0 -43
  92. package/dist/highlightjs/languages/json.js +0 -44
  93. package/dist/highlightjs/languages/julia-repl.js +0 -23
  94. package/dist/highlightjs/languages/julia.js +0 -125
  95. package/dist/highlightjs/languages/kotlin.js +0 -167
  96. package/dist/highlightjs/languages/lasso.js +0 -126
  97. package/dist/highlightjs/languages/ldif.js +0 -30
  98. package/dist/highlightjs/languages/leaf.js +0 -33
  99. package/dist/highlightjs/languages/less.js +0 -167
  100. package/dist/highlightjs/languages/lisp.js +0 -101
  101. package/dist/highlightjs/languages/livecodeserver.js +0 -66
  102. package/dist/highlightjs/languages/livescript.js +0 -138
  103. package/dist/highlightjs/languages/llvm.js +0 -54
  104. package/dist/highlightjs/languages/lsl.js +0 -55
  105. package/dist/highlightjs/languages/lua.js +0 -51
  106. package/dist/highlightjs/languages/makefile.js +0 -65
  107. package/dist/highlightjs/languages/markdown.js +0 -111
  108. package/dist/highlightjs/languages/mathematica.js +0 -22
  109. package/dist/highlightjs/languages/matlab.js +0 -70
  110. package/dist/highlightjs/languages/maxima.js +0 -44
  111. package/dist/highlightjs/languages/mel.js +0 -17
  112. package/dist/highlightjs/languages/mercury.js +0 -63
  113. package/dist/highlightjs/languages/mipsasm.js +0 -86
  114. package/dist/highlightjs/languages/mizar.js +0 -8
  115. package/dist/highlightjs/languages/mojolicious.js +0 -25
  116. package/dist/highlightjs/languages/monkey.js +0 -53
  117. package/dist/highlightjs/languages/moonscript.js +0 -108
  118. package/dist/highlightjs/languages/n1ql.js +0 -39
  119. package/dist/highlightjs/languages/nginx.js +0 -100
  120. package/dist/highlightjs/languages/nimrod.js +0 -46
  121. package/dist/highlightjs/languages/nix.js +0 -42
  122. package/dist/highlightjs/languages/nsis.js +0 -73
  123. package/dist/highlightjs/languages/objectivec.js +0 -59
  124. package/dist/highlightjs/languages/ocaml.js +0 -54
  125. package/dist/highlightjs/languages/openscad.js +0 -54
  126. package/dist/highlightjs/languages/oxygene.js +0 -49
  127. package/dist/highlightjs/languages/parser3.js +0 -31
  128. package/dist/highlightjs/languages/perl.js +0 -124
  129. package/dist/highlightjs/languages/pf.js +0 -32
  130. package/dist/highlightjs/languages/pgsql.js +0 -370
  131. package/dist/highlightjs/languages/php.js +0 -97
  132. package/dist/highlightjs/languages/plaintext.js +0 -7
  133. package/dist/highlightjs/languages/pony.js +0 -53
  134. package/dist/highlightjs/languages/powershell.js +0 -77
  135. package/dist/highlightjs/languages/processing.js +0 -15
  136. package/dist/highlightjs/languages/profile.js +0 -28
  137. package/dist/highlightjs/languages/prolog.js +0 -62
  138. package/dist/highlightjs/languages/properties.js +0 -62
  139. package/dist/highlightjs/languages/protobuf.js +0 -33
  140. package/dist/highlightjs/languages/puppet.js +0 -77
  141. package/dist/highlightjs/languages/purebasic.js +0 -51
  142. package/dist/highlightjs/languages/python.js +0 -110
  143. package/dist/highlightjs/languages/q.js +0 -16
  144. package/dist/highlightjs/languages/qml.js +0 -136
  145. package/dist/highlightjs/languages/r.js +0 -56
  146. package/dist/highlightjs/languages/reasonml.js +0 -214
  147. package/dist/highlightjs/languages/rib.js +0 -9
  148. package/dist/highlightjs/languages/roboconf.js +0 -51
  149. package/dist/highlightjs/languages/routeros.js +0 -183
  150. package/dist/highlightjs/languages/rsl.js +0 -23
  151. package/dist/highlightjs/languages/ruby.js +0 -181
  152. package/dist/highlightjs/languages/ruleslanguage.js +0 -21
  153. package/dist/highlightjs/languages/rust.js +0 -91
  154. package/dist/highlightjs/languages/sas.js +0 -49
  155. package/dist/highlightjs/languages/scala.js +0 -96
  156. package/dist/highlightjs/languages/scheme.js +0 -103
  157. package/dist/highlightjs/languages/scilab.js +0 -46
  158. package/dist/highlightjs/languages/scss.js +0 -76
  159. package/dist/highlightjs/languages/shell.js +0 -15
  160. package/dist/highlightjs/languages/smali.js +0 -48
  161. package/dist/highlightjs/languages/smalltalk.js +0 -41
  162. package/dist/highlightjs/languages/sml.js +0 -51
  163. package/dist/highlightjs/languages/sqf.js +0 -50
  164. package/dist/highlightjs/languages/sql.js +0 -40
  165. package/dist/highlightjs/languages/stan.js +0 -56
  166. package/dist/highlightjs/languages/stata.js +0 -28
  167. package/dist/highlightjs/languages/step21.js +0 -41
  168. package/dist/highlightjs/languages/stylus.js +0 -124
  169. package/dist/highlightjs/languages/subunit.js +0 -34
  170. package/dist/highlightjs/languages/swift.js +0 -90
  171. package/dist/highlightjs/languages/taggerscript.js +0 -35
  172. package/dist/highlightjs/languages/tap.js +0 -38
  173. package/dist/highlightjs/languages/tcl.js +0 -38
  174. package/dist/highlightjs/languages/tex.js +0 -56
  175. package/dist/highlightjs/languages/thrift.js +0 -29
  176. package/dist/highlightjs/languages/tp.js +0 -58
  177. package/dist/highlightjs/languages/twig.js +0 -55
  178. package/dist/highlightjs/languages/typescript.js +0 -120
  179. package/dist/highlightjs/languages/vala.js +0 -41
  180. package/dist/highlightjs/languages/vbnet.js +0 -53
  181. package/dist/highlightjs/languages/vbscript-html.js +0 -12
  182. package/dist/highlightjs/languages/vbscript.js +0 -21
  183. package/dist/highlightjs/languages/verilog.js +0 -44
  184. package/dist/highlightjs/languages/vhdl.js +0 -40
  185. package/dist/highlightjs/languages/vim.js +0 -53
  186. package/dist/highlightjs/languages/x86asm.js +0 -110
  187. package/dist/highlightjs/languages/xl.js +0 -55
  188. package/dist/highlightjs/languages/xml.js +0 -128
  189. package/dist/highlightjs/languages/xquery.js +0 -134
  190. package/dist/highlightjs/languages/yaml.js +0 -95
  191. package/dist/highlightjs/languages/zephir.js +0 -77
@@ -0,0 +1,14 @@
1
+ import MarkdownIt from "markdown-it";
2
+
3
+ //#region src/index.d.ts
4
+ declare class MarkdownRenderer {
5
+ fileName: string;
6
+ markdownIt: MarkdownIt;
7
+ constructor();
8
+ template(meta: string): string;
9
+ prepare(data: string): string;
10
+ render(fileName: string, data: string): string;
11
+ }
12
+ declare const markdownRenderer: MarkdownRenderer;
13
+ export = markdownRenderer;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;cAqBM,gBAAA;EACJ,QAAA;EACA,UAAA,EAAY,UAAU;;EAmFtB,QAAA,CAAS,IAAA;EAYT,OAAA,CAAQ,IAAA;EAKR,MAAA,CAAO,QAAA,UAAkB,IAAA;AAAA;AAAA,cAOrB,gBAAA,EAAgB,gBAAyB;AAAA"}
package/dist/index.js CHANGED
@@ -1,78 +1,98 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
10
- var _repeat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/repeat"));
11
- var _markdownIt = _interopRequireDefault(require("markdown-it"));
12
- var _markdownItFrontMatter = _interopRequireDefault(require("markdown-it-front-matter"));
13
- var _bBerParserFootnotes = _interopRequireDefault(require("@canopycanopycanopy/b-ber-parser-footnotes"));
14
- var _bBerGrammarSection = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-section"));
15
- var _bBerGrammarPullquote = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-pullquote"));
16
- var _bBerGrammarLogo = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-logo"));
17
- var _bBerGrammarImage = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-image"));
18
- var _bBerGrammarAudioVideo = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-audio-video"));
19
- var _bBerGrammarVimeo = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-vimeo"));
20
- var _bBerGrammarIframe = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-iframe"));
21
- var _bBerGrammarDialogue = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-dialogue"));
22
- var _bBerGrammarGallery = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-gallery"));
23
- var _bBerGrammarSpread = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-spread"));
24
- var _bBerGrammarFrontmatter = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-frontmatter"));
25
- var _bBerGrammarFootnotes = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-footnotes"));
26
- var _bBerGrammarMedia = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-media"));
27
- var _highlightjs = _interopRequireDefault(require("./highlightjs"));
28
- const LINE_BREAK = '\n';
29
- const SPACE = ' ';
30
- class MarkdownRenderer {
31
- constructor() {
32
- this.fileName = '';
33
-
34
- // Instance of MarkdownIt class
35
- this.markdownIt = new _markdownIt.default({
36
- html: true,
37
- xhtmlOut: true,
38
- breaks: false,
39
- linkify: false,
40
- // Syntax highlighting using highlight.js
41
- highlight: (str, lang) => {
42
- if (lang && _highlightjs.default.getLanguage(lang)) {
43
- try {
44
- return _highlightjs.default.highlight(lang, str).value;
45
- } catch (_) {
46
- // noop
47
- }
48
- }
49
- return '';
50
- }
51
- });
52
- const reference = {
53
- instance: this.markdownIt,
54
- context: this
55
- };
56
- this.markdownIt.use(_bBerGrammarSection.default.plugin, _bBerGrammarSection.default.name, _bBerGrammarSection.default.renderer(reference)).use(_bBerGrammarPullquote.default.plugin, _bBerGrammarPullquote.default.name, _bBerGrammarPullquote.default.renderer(reference)).use(_markdownItFrontMatter.default, (0, _bBerGrammarFrontmatter.default)(this)).use(_bBerParserFootnotes.default, (0, _bBerGrammarFootnotes.default)(this)).use(_bBerGrammarDialogue.default.plugin, _bBerGrammarDialogue.default.name, _bBerGrammarDialogue.default.renderer(reference)).use(_bBerGrammarGallery.default.plugin, _bBerGrammarGallery.default.name, _bBerGrammarGallery.default.renderer(reference)).use(_bBerGrammarSpread.default.plugin, _bBerGrammarSpread.default.name, _bBerGrammarSpread.default.renderer(reference)).use(_bBerGrammarImage.default.plugin, _bBerGrammarImage.default.name, _bBerGrammarImage.default.renderer(reference)).use(_bBerGrammarAudioVideo.default.plugin, _bBerGrammarAudioVideo.default.name, _bBerGrammarAudioVideo.default.renderer(reference)).use(_bBerGrammarVimeo.default.plugin, _bBerGrammarVimeo.default.name, _bBerGrammarVimeo.default.renderer(reference)).use(_bBerGrammarIframe.default.plugin, _bBerGrammarIframe.default.name, _bBerGrammarIframe.default.renderer(reference)).use(_bBerGrammarLogo.default.plugin, _bBerGrammarLogo.default.name, _bBerGrammarLogo.default.renderer(reference));
57
- }
58
- template(meta) {
59
- var _context;
60
- const str = (0, _map.default)(_context = meta.split(LINE_BREAK)).call(_context, value => `${(0, _repeat.default)(SPACE).call(SPACE, 2)}${value}`).join(LINE_BREAK);
61
- return `-${LINE_BREAK}${(0, _repeat.default)(SPACE).call(SPACE, 2)}fileName: ${this.fileName}${LINE_BREAK}${str}${LINE_BREAK}`;
62
- }
63
-
64
- // Runs transformations on the Markdown to prepare it for rendering
65
- // eslint-disable-next-line class-methods-use-this
66
- prepare(data) {
67
- return _bBerGrammarMedia.default.render(data);
68
- }
69
-
70
- // Transforms a markdown file to XHTML
71
- render(fileName, data) {
72
- this.fileName = fileName;
73
- const transformedData = this.prepare(data);
74
- return this.markdownIt.render(transformedData);
75
- }
76
- }
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ let _canopycanopycanopy_b_ber_grammar_audio_video = require("@canopycanopycanopy/b-ber-grammar-audio-video");
24
+ _canopycanopycanopy_b_ber_grammar_audio_video = __toESM(_canopycanopycanopy_b_ber_grammar_audio_video);
25
+ let _canopycanopycanopy_b_ber_grammar_dialogue = require("@canopycanopycanopy/b-ber-grammar-dialogue");
26
+ _canopycanopycanopy_b_ber_grammar_dialogue = __toESM(_canopycanopycanopy_b_ber_grammar_dialogue);
27
+ let _canopycanopycanopy_b_ber_grammar_footnotes = require("@canopycanopycanopy/b-ber-grammar-footnotes");
28
+ _canopycanopycanopy_b_ber_grammar_footnotes = __toESM(_canopycanopycanopy_b_ber_grammar_footnotes);
29
+ let _canopycanopycanopy_b_ber_grammar_frontmatter = require("@canopycanopycanopy/b-ber-grammar-frontmatter");
30
+ _canopycanopycanopy_b_ber_grammar_frontmatter = __toESM(_canopycanopycanopy_b_ber_grammar_frontmatter);
31
+ let _canopycanopycanopy_b_ber_grammar_gallery = require("@canopycanopycanopy/b-ber-grammar-gallery");
32
+ _canopycanopycanopy_b_ber_grammar_gallery = __toESM(_canopycanopycanopy_b_ber_grammar_gallery);
33
+ let _canopycanopycanopy_b_ber_grammar_iframe = require("@canopycanopycanopy/b-ber-grammar-iframe");
34
+ _canopycanopycanopy_b_ber_grammar_iframe = __toESM(_canopycanopycanopy_b_ber_grammar_iframe);
35
+ let _canopycanopycanopy_b_ber_grammar_image = require("@canopycanopycanopy/b-ber-grammar-image");
36
+ _canopycanopycanopy_b_ber_grammar_image = __toESM(_canopycanopycanopy_b_ber_grammar_image);
37
+ let _canopycanopycanopy_b_ber_grammar_logo = require("@canopycanopycanopy/b-ber-grammar-logo");
38
+ _canopycanopycanopy_b_ber_grammar_logo = __toESM(_canopycanopycanopy_b_ber_grammar_logo);
39
+ let _canopycanopycanopy_b_ber_grammar_media = require("@canopycanopycanopy/b-ber-grammar-media");
40
+ _canopycanopycanopy_b_ber_grammar_media = __toESM(_canopycanopycanopy_b_ber_grammar_media);
41
+ let _canopycanopycanopy_b_ber_grammar_pullquote = require("@canopycanopycanopy/b-ber-grammar-pullquote");
42
+ _canopycanopycanopy_b_ber_grammar_pullquote = __toESM(_canopycanopycanopy_b_ber_grammar_pullquote);
43
+ let _canopycanopycanopy_b_ber_grammar_section = require("@canopycanopycanopy/b-ber-grammar-section");
44
+ _canopycanopycanopy_b_ber_grammar_section = __toESM(_canopycanopycanopy_b_ber_grammar_section);
45
+ let _canopycanopycanopy_b_ber_grammar_spread = require("@canopycanopycanopy/b-ber-grammar-spread");
46
+ _canopycanopycanopy_b_ber_grammar_spread = __toESM(_canopycanopycanopy_b_ber_grammar_spread);
47
+ let _canopycanopycanopy_b_ber_grammar_vimeo = require("@canopycanopycanopy/b-ber-grammar-vimeo");
48
+ _canopycanopycanopy_b_ber_grammar_vimeo = __toESM(_canopycanopycanopy_b_ber_grammar_vimeo);
49
+ let _canopycanopycanopy_b_ber_parser_footnotes = require("@canopycanopycanopy/b-ber-parser-footnotes");
50
+ _canopycanopycanopy_b_ber_parser_footnotes = __toESM(_canopycanopycanopy_b_ber_parser_footnotes);
51
+ let highlight_js = require("highlight.js");
52
+ highlight_js = __toESM(highlight_js);
53
+ let markdown_it = require("markdown-it");
54
+ markdown_it = __toESM(markdown_it);
55
+ let markdown_it_front_matter = require("markdown-it-front-matter");
56
+ markdown_it_front_matter = __toESM(markdown_it_front_matter);
57
+ //#region src/index.ts
58
+ const LINE_BREAK = "\n";
59
+ const SPACE = " ";
60
+ var MarkdownRenderer = class {
61
+ fileName;
62
+ markdownIt;
63
+ constructor() {
64
+ this.fileName = "";
65
+ this.markdownIt = new markdown_it.default({
66
+ html: true,
67
+ xhtmlOut: true,
68
+ breaks: false,
69
+ linkify: false,
70
+ highlight: (str, lang) => {
71
+ if (lang && highlight_js.default.getLanguage(lang)) try {
72
+ return highlight_js.default.highlight(str, { language: lang }).value;
73
+ } catch (_) {}
74
+ return "";
75
+ }
76
+ });
77
+ const reference = {
78
+ instance: this.markdownIt,
79
+ context: this
80
+ };
81
+ this.markdownIt.use(_canopycanopycanopy_b_ber_grammar_section.default.plugin, _canopycanopycanopy_b_ber_grammar_section.default.name, _canopycanopycanopy_b_ber_grammar_section.default.renderer(reference)).use(_canopycanopycanopy_b_ber_grammar_pullquote.default.plugin, _canopycanopycanopy_b_ber_grammar_pullquote.default.name, _canopycanopycanopy_b_ber_grammar_pullquote.default.renderer(reference)).use(markdown_it_front_matter.default, (0, _canopycanopycanopy_b_ber_grammar_frontmatter.default)(this)).use(_canopycanopycanopy_b_ber_parser_footnotes.default, (0, _canopycanopycanopy_b_ber_grammar_footnotes.default)(this)).use(_canopycanopycanopy_b_ber_grammar_dialogue.default.plugin, _canopycanopycanopy_b_ber_grammar_dialogue.default.name, _canopycanopycanopy_b_ber_grammar_dialogue.default.renderer(reference)).use(_canopycanopycanopy_b_ber_grammar_gallery.default.plugin, _canopycanopycanopy_b_ber_grammar_gallery.default.name, _canopycanopycanopy_b_ber_grammar_gallery.default.renderer(reference)).use(_canopycanopycanopy_b_ber_grammar_spread.default.plugin, _canopycanopycanopy_b_ber_grammar_spread.default.name, _canopycanopycanopy_b_ber_grammar_spread.default.renderer(reference)).use(_canopycanopycanopy_b_ber_grammar_image.default.plugin, _canopycanopycanopy_b_ber_grammar_image.default.name, _canopycanopycanopy_b_ber_grammar_image.default.renderer(reference)).use(_canopycanopycanopy_b_ber_grammar_audio_video.default.plugin, _canopycanopycanopy_b_ber_grammar_audio_video.default.name, _canopycanopycanopy_b_ber_grammar_audio_video.default.renderer(reference)).use(_canopycanopycanopy_b_ber_grammar_vimeo.default.plugin, _canopycanopycanopy_b_ber_grammar_vimeo.default.name, _canopycanopycanopy_b_ber_grammar_vimeo.default.renderer(reference)).use(_canopycanopycanopy_b_ber_grammar_iframe.default.plugin, _canopycanopycanopy_b_ber_grammar_iframe.default.name, _canopycanopycanopy_b_ber_grammar_iframe.default.renderer(reference)).use(_canopycanopycanopy_b_ber_grammar_logo.default.plugin, _canopycanopycanopy_b_ber_grammar_logo.default.name, _canopycanopycanopy_b_ber_grammar_logo.default.renderer(reference));
82
+ }
83
+ template(meta) {
84
+ const str = meta.split(LINE_BREAK).map((value) => `${SPACE.repeat(2)}${value}`).join(LINE_BREAK);
85
+ return `-${LINE_BREAK}${SPACE.repeat(2)}fileName: ${this.fileName}${LINE_BREAK}${str}${LINE_BREAK}`;
86
+ }
87
+ prepare(data) {
88
+ return _canopycanopycanopy_b_ber_grammar_media.default.render(data);
89
+ }
90
+ render(fileName, data) {
91
+ this.fileName = fileName;
92
+ const transformedData = this.prepare(data);
93
+ return this.markdownIt.render(transformedData);
94
+ }
95
+ };
77
96
  const markdownRenderer = new MarkdownRenderer();
78
- var _default = exports.default = markdownRenderer;
97
+ //#endregion
98
+ module.exports = markdownRenderer;
package/package.json CHANGED
@@ -1,14 +1,12 @@
1
1
  {
2
2
  "name": "@canopycanopycanopy/b-ber-markdown-renderer",
3
- "version": "3.0.8-next.61+2bbec564",
3
+ "version": "3.0.8-next.97+2e9748e6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
6
7
  "scripts": {
7
- "prepare:dist": "BABEL_ENV=production babel --config-file ../../babel.config.js -d dist/ src/ --ignore **/__tests__/**",
8
- "clean": "rimraf dist",
9
- "prepare": "npm run clean && npm run prepare:dist",
10
- "build": "npm run prepare",
11
- "watch": "BABEL_ENV=production babel --config-file ../../babel.config.js -d dist/ src/ --watch src",
8
+ "build": "tsdown",
9
+ "typecheck": "tsc --noEmit",
12
10
  "test": "jest"
13
11
  },
14
12
  "author": "Triple Canopy <b-ber@canopycanopycanopy.com> (https://triplecanopy.github.io/)",
@@ -17,29 +15,31 @@
17
15
  "access": "public"
18
16
  },
19
17
  "devDependencies": {
20
- "@babel/cli": "^7.10.5",
21
- "@babel/core": "^7.10.5",
22
- "@babel/preset-env": "^7.10.4",
23
- "browserslist": "^4.17.4",
24
- "jest": "^26.6.3",
25
- "rimraf": "^2.7.1"
18
+ "@swc/core": "^1.15.40",
19
+ "@swc/jest": "^0.2.39",
20
+ "@types/markdown-it": "^14.1.2",
21
+ "jest": "^29.7.0",
22
+ "rimraf": "^2.7.1",
23
+ "tsdown": "^0.22.1",
24
+ "typescript": "^6.0.3"
26
25
  },
27
26
  "dependencies": {
28
- "@canopycanopycanopy/b-ber-grammar-audio-video": "3.0.8-next.61+2bbec564",
29
- "@canopycanopycanopy/b-ber-grammar-dialogue": "3.0.8-next.61+2bbec564",
30
- "@canopycanopycanopy/b-ber-grammar-footnotes": "3.0.8-next.61+2bbec564",
31
- "@canopycanopycanopy/b-ber-grammar-frontmatter": "3.0.8-next.61+2bbec564",
32
- "@canopycanopycanopy/b-ber-grammar-gallery": "3.0.8-next.61+2bbec564",
33
- "@canopycanopycanopy/b-ber-grammar-iframe": "3.0.8-next.61+2bbec564",
34
- "@canopycanopycanopy/b-ber-grammar-image": "3.0.8-next.61+2bbec564",
35
- "@canopycanopycanopy/b-ber-grammar-logo": "3.0.8-next.61+2bbec564",
36
- "@canopycanopycanopy/b-ber-grammar-media": "3.0.8-next.61+2bbec564",
37
- "@canopycanopycanopy/b-ber-grammar-pullquote": "3.0.8-next.61+2bbec564",
38
- "@canopycanopycanopy/b-ber-grammar-section": "3.0.8-next.61+2bbec564",
39
- "@canopycanopycanopy/b-ber-grammar-spread": "3.0.8-next.61+2bbec564",
40
- "@canopycanopycanopy/b-ber-grammar-vimeo": "3.0.8-next.61+2bbec564",
41
- "@canopycanopycanopy/b-ber-parser-footnotes": "3.0.8-next.61+2bbec564",
42
- "@canopycanopycanopy/b-ber-parser-gallery": "3.0.8-next.61+2bbec564",
27
+ "@canopycanopycanopy/b-ber-grammar-audio-video": "3.0.8-next.97+2e9748e6",
28
+ "@canopycanopycanopy/b-ber-grammar-dialogue": "3.0.8-next.97+2e9748e6",
29
+ "@canopycanopycanopy/b-ber-grammar-footnotes": "3.0.8-next.97+2e9748e6",
30
+ "@canopycanopycanopy/b-ber-grammar-frontmatter": "3.0.8-next.97+2e9748e6",
31
+ "@canopycanopycanopy/b-ber-grammar-gallery": "3.0.8-next.97+2e9748e6",
32
+ "@canopycanopycanopy/b-ber-grammar-iframe": "3.0.8-next.97+2e9748e6",
33
+ "@canopycanopycanopy/b-ber-grammar-image": "3.0.8-next.97+2e9748e6",
34
+ "@canopycanopycanopy/b-ber-grammar-logo": "3.0.8-next.97+2e9748e6",
35
+ "@canopycanopycanopy/b-ber-grammar-media": "3.0.8-next.97+2e9748e6",
36
+ "@canopycanopycanopy/b-ber-grammar-pullquote": "3.0.8-next.97+2e9748e6",
37
+ "@canopycanopycanopy/b-ber-grammar-section": "3.0.8-next.97+2e9748e6",
38
+ "@canopycanopycanopy/b-ber-grammar-spread": "3.0.8-next.97+2e9748e6",
39
+ "@canopycanopycanopy/b-ber-grammar-vimeo": "3.0.8-next.97+2e9748e6",
40
+ "@canopycanopycanopy/b-ber-parser-footnotes": "3.0.8-next.97+2e9748e6",
41
+ "@canopycanopycanopy/b-ber-parser-gallery": "3.0.8-next.97+2e9748e6",
42
+ "highlight.js": "^11.11.1",
43
43
  "lodash": "^4.17.21",
44
44
  "markdown-it": "^8.4.1",
45
45
  "markdown-it-front-matter": "^0.1.2",
@@ -62,5 +62,5 @@
62
62
  "url": "https://maxwellsimmer.com"
63
63
  }
64
64
  ],
65
- "gitHead": "2bbec5643278f53becb0d2ba1f55edfe379d5587"
65
+ "gitHead": "2e9748e6f00446cd35dc8f933e049d8200fc24dd"
66
66
  }