@canopycanopycanopy/b-ber-markdown-renderer 2.0.0 → 2.0.3

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 (111) hide show
  1. package/dist/highlightjs/highlight.js +50 -201
  2. package/dist/highlightjs/index.js +1 -1
  3. package/dist/highlightjs/languages/1c.js +91 -46
  4. package/dist/highlightjs/languages/accesslog.js +10 -5
  5. package/dist/highlightjs/languages/ada.js +26 -12
  6. package/dist/highlightjs/languages/angelscript.js +12 -5
  7. package/dist/highlightjs/languages/applescript.js +1 -4
  8. package/dist/highlightjs/languages/arcade.js +1 -4
  9. package/dist/highlightjs/languages/armasm.js +35 -16
  10. package/dist/highlightjs/languages/asciidoc.js +42 -21
  11. package/dist/highlightjs/languages/autohotkey.js +2 -2
  12. package/dist/highlightjs/languages/autoit.js +82 -82
  13. package/dist/highlightjs/languages/avrasm.js +7 -9
  14. package/dist/highlightjs/languages/bash.js +9 -5
  15. package/dist/highlightjs/languages/bnf.js +6 -3
  16. package/dist/highlightjs/languages/cal.js +0 -3
  17. package/dist/highlightjs/languages/capnproto.js +0 -2
  18. package/dist/highlightjs/languages/ceylon.js +4 -7
  19. package/dist/highlightjs/languages/clojure.js +2 -1
  20. package/dist/highlightjs/languages/cmake.js +10 -5
  21. package/dist/highlightjs/languages/coffeescript.js +10 -10
  22. package/dist/highlightjs/languages/cos.js +6 -2
  23. package/dist/highlightjs/languages/cpp.js +4 -4
  24. package/dist/highlightjs/languages/crystal.js +0 -4
  25. package/dist/highlightjs/languages/cs.js +4 -2
  26. package/dist/highlightjs/languages/d.js +34 -29
  27. package/dist/highlightjs/languages/dart.js +4 -3
  28. package/dist/highlightjs/languages/delphi.js +0 -3
  29. package/dist/highlightjs/languages/dns.js +4 -2
  30. package/dist/highlightjs/languages/dos.js +2 -1
  31. package/dist/highlightjs/languages/ebnf.js +2 -1
  32. package/dist/highlightjs/languages/elm.js +7 -2
  33. package/dist/highlightjs/languages/erlang.js +9 -6
  34. package/dist/highlightjs/languages/excel.js +2 -5
  35. package/dist/highlightjs/languages/gams.js +6 -3
  36. package/dist/highlightjs/languages/gauss.js +2 -6
  37. package/dist/highlightjs/languages/gcode.js +0 -3
  38. package/dist/highlightjs/languages/glsl.js +10 -5
  39. package/dist/highlightjs/languages/go.js +0 -1
  40. package/dist/highlightjs/languages/groovy.js +4 -2
  41. package/dist/highlightjs/languages/haml.js +4 -2
  42. package/dist/highlightjs/languages/haskell.js +9 -3
  43. package/dist/highlightjs/languages/hy.js +2 -1
  44. package/dist/highlightjs/languages/inform7.js +8 -4
  45. package/dist/highlightjs/languages/irpf90.js +4 -2
  46. package/dist/highlightjs/languages/isbl.js +292 -148
  47. package/dist/highlightjs/languages/java.js +8 -4
  48. package/dist/highlightjs/languages/javascript.js +3 -6
  49. package/dist/highlightjs/languages/json.js +0 -2
  50. package/dist/highlightjs/languages/julia.js +12 -5
  51. package/dist/highlightjs/languages/kotlin.js +15 -8
  52. package/dist/highlightjs/languages/lasso.js +0 -3
  53. package/dist/highlightjs/languages/less.js +20 -17
  54. package/dist/highlightjs/languages/livecodeserver.js +0 -3
  55. package/dist/highlightjs/languages/livescript.js +8 -9
  56. package/dist/highlightjs/languages/llvm.js +4 -2
  57. package/dist/highlightjs/languages/lua.js +6 -6
  58. package/dist/highlightjs/languages/makefile.js +0 -5
  59. package/dist/highlightjs/languages/markdown.js +18 -9
  60. package/dist/highlightjs/languages/mercury.js +4 -2
  61. package/dist/highlightjs/languages/mipsasm.js +37 -18
  62. package/dist/highlightjs/languages/mojolicious.js +4 -2
  63. package/dist/highlightjs/languages/moonscript.js +5 -8
  64. package/dist/highlightjs/languages/nginx.js +12 -6
  65. package/dist/highlightjs/languages/ocaml.js +3 -8
  66. package/dist/highlightjs/languages/openscad.js +39 -39
  67. package/dist/highlightjs/languages/perl.js +3 -3
  68. package/dist/highlightjs/languages/pgsql.js +128 -72
  69. package/dist/highlightjs/languages/php.js +0 -1
  70. package/dist/highlightjs/languages/pony.js +1 -0
  71. package/dist/highlightjs/languages/powershell.js +5 -8
  72. package/dist/highlightjs/languages/processing.js +2 -1
  73. package/dist/highlightjs/languages/prolog.js +1 -3
  74. package/dist/highlightjs/languages/properties.js +8 -5
  75. package/dist/highlightjs/languages/protobuf.js +0 -1
  76. package/dist/highlightjs/languages/puppet.js +4 -8
  77. package/dist/highlightjs/languages/purebasic.js +9 -5
  78. package/dist/highlightjs/languages/python.js +0 -1
  79. package/dist/highlightjs/languages/qml.js +15 -11
  80. package/dist/highlightjs/languages/reasonml.js +0 -6
  81. package/dist/highlightjs/languages/roboconf.js +8 -4
  82. package/dist/highlightjs/languages/routeros.js +36 -18
  83. package/dist/highlightjs/languages/ruby.js +0 -4
  84. package/dist/highlightjs/languages/ruleslanguage.js +2 -1
  85. package/dist/highlightjs/languages/rust.js +8 -4
  86. package/dist/highlightjs/languages/sas.js +4 -2
  87. package/dist/highlightjs/languages/scala.js +2 -1
  88. package/dist/highlightjs/languages/scheme.js +0 -3
  89. package/dist/highlightjs/languages/scilab.js +2 -4
  90. package/dist/highlightjs/languages/sml.js +2 -6
  91. package/dist/highlightjs/languages/sqf.js +8 -5
  92. package/dist/highlightjs/languages/stan.js +2 -1
  93. package/dist/highlightjs/languages/stylus.js +45 -24
  94. package/dist/highlightjs/languages/swift.js +4 -3
  95. package/dist/highlightjs/languages/tap.js +8 -4
  96. package/dist/highlightjs/languages/thrift.js +0 -1
  97. package/dist/highlightjs/languages/tp.js +1 -3
  98. package/dist/highlightjs/languages/twig.js +0 -3
  99. package/dist/highlightjs/languages/typescript.js +0 -3
  100. package/dist/highlightjs/languages/vala.js +12 -6
  101. package/dist/highlightjs/languages/vbnet.js +12 -27
  102. package/dist/highlightjs/languages/verilog.js +1 -2
  103. package/dist/highlightjs/languages/vhdl.js +8 -5
  104. package/dist/highlightjs/languages/vim.js +6 -3
  105. package/dist/highlightjs/languages/x86asm.js +52 -26
  106. package/dist/highlightjs/languages/xml.js +2 -2
  107. package/dist/highlightjs/languages/xquery.js +12 -7
  108. package/dist/highlightjs/languages/yaml.js +3 -1
  109. package/dist/highlightjs/languages/zephir.js +0 -1
  110. package/dist/index.js +9 -36
  111. package/package.json +17 -17
package/dist/index.js CHANGED
@@ -1,60 +1,37 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
-
5
4
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
6
-
7
5
  _Object$defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
8
  exports.default = void 0;
12
-
13
9
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
14
-
15
10
  var _repeat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/repeat"));
16
-
17
11
  var _markdownIt = _interopRequireDefault(require("markdown-it"));
18
-
19
12
  var _markdownItFrontMatter = _interopRequireDefault(require("markdown-it-front-matter"));
20
-
21
13
  var _bBerParserFootnotes = _interopRequireDefault(require("@canopycanopycanopy/b-ber-parser-footnotes"));
22
-
23
14
  var _bBerGrammarSection = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-section"));
24
-
25
15
  var _bBerGrammarPullquote = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-pullquote"));
26
-
27
16
  var _bBerGrammarLogo = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-logo"));
28
-
29
17
  var _bBerGrammarImage = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-image"));
30
-
31
18
  var _bBerGrammarAudioVideo = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-audio-video"));
32
-
33
19
  var _bBerGrammarVimeo = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-vimeo"));
34
-
35
20
  var _bBerGrammarIframe = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-iframe"));
36
-
37
21
  var _bBerGrammarDialogue = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-dialogue"));
38
-
39
22
  var _bBerGrammarGallery = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-gallery"));
40
-
41
23
  var _bBerGrammarSpread = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-spread"));
42
-
43
24
  var _bBerGrammarFrontmatter = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-frontmatter"));
44
-
45
25
  var _bBerGrammarFootnotes = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-footnotes"));
46
-
47
26
  var _bBerGrammarMedia = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-media"));
48
-
49
27
  var _highlightjs = _interopRequireDefault(require("./highlightjs"));
50
-
51
28
  const LINE_BREAK = '\n';
52
29
  const SPACE = ' ';
53
-
54
30
  class MarkdownRenderer {
55
31
  constructor() {
56
- this.fileName = ''; // Instance of MarkdownIt class
32
+ this.fileName = '';
57
33
 
34
+ // Instance of MarkdownIt class
58
35
  this.markdownIt = new _markdownIt.default({
59
36
  html: true,
60
37
  xhtmlOut: true,
@@ -65,10 +42,10 @@ class MarkdownRenderer {
65
42
  if (lang && _highlightjs.default.getLanguage(lang)) {
66
43
  try {
67
44
  return _highlightjs.default.highlight(lang, str).value;
68
- } catch (_) {// noop
45
+ } catch (_) {
46
+ // noop
69
47
  }
70
48
  }
71
-
72
49
  return '';
73
50
  }
74
51
  });
@@ -78,29 +55,25 @@ class MarkdownRenderer {
78
55
  };
79
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));
80
57
  }
81
-
82
58
  template(meta) {
83
59
  var _context;
84
-
85
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);
86
61
  return `-${LINE_BREAK}${(0, _repeat.default)(SPACE).call(SPACE, 2)}fileName: ${this.fileName}${LINE_BREAK}${str}${LINE_BREAK}`;
87
- } // Runs transformations on the Markdown to prepare it for rendering
88
- // eslint-disable-next-line class-methods-use-this
89
-
62
+ }
90
63
 
64
+ // Runs transformations on the Markdown to prepare it for rendering
65
+ // eslint-disable-next-line class-methods-use-this
91
66
  prepare(data) {
92
67
  return _bBerGrammarMedia.default.render(data);
93
- } // Transforms a markdown file to XHTML
94
-
68
+ }
95
69
 
70
+ // Transforms a markdown file to XHTML
96
71
  render(fileName, data) {
97
72
  this.fileName = fileName;
98
73
  const transformedData = this.prepare(data);
99
74
  return this.markdownIt.render(transformedData);
100
75
  }
101
-
102
76
  }
103
-
104
77
  const markdownRenderer = new MarkdownRenderer();
105
78
  var _default = markdownRenderer;
106
79
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canopycanopycanopy/b-ber-markdown-renderer",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -25,21 +25,21 @@
25
25
  "rimraf": "^2.7.1"
26
26
  },
27
27
  "dependencies": {
28
- "@canopycanopycanopy/b-ber-grammar-audio-video": "2.0.0",
29
- "@canopycanopycanopy/b-ber-grammar-dialogue": "2.0.0",
30
- "@canopycanopycanopy/b-ber-grammar-footnotes": "2.0.0",
31
- "@canopycanopycanopy/b-ber-grammar-frontmatter": "2.0.0",
32
- "@canopycanopycanopy/b-ber-grammar-gallery": "2.0.0",
33
- "@canopycanopycanopy/b-ber-grammar-iframe": "2.0.0",
34
- "@canopycanopycanopy/b-ber-grammar-image": "2.0.0",
35
- "@canopycanopycanopy/b-ber-grammar-logo": "2.0.0",
36
- "@canopycanopycanopy/b-ber-grammar-media": "2.0.0",
37
- "@canopycanopycanopy/b-ber-grammar-pullquote": "2.0.0",
38
- "@canopycanopycanopy/b-ber-grammar-section": "2.0.0",
39
- "@canopycanopycanopy/b-ber-grammar-spread": "2.0.0",
40
- "@canopycanopycanopy/b-ber-grammar-vimeo": "2.0.0",
41
- "@canopycanopycanopy/b-ber-parser-footnotes": "2.0.0",
42
- "@canopycanopycanopy/b-ber-parser-gallery": "2.0.0",
28
+ "@canopycanopycanopy/b-ber-grammar-audio-video": "2.0.3",
29
+ "@canopycanopycanopy/b-ber-grammar-dialogue": "2.0.3",
30
+ "@canopycanopycanopy/b-ber-grammar-footnotes": "2.0.3",
31
+ "@canopycanopycanopy/b-ber-grammar-frontmatter": "2.0.3",
32
+ "@canopycanopycanopy/b-ber-grammar-gallery": "2.0.3",
33
+ "@canopycanopycanopy/b-ber-grammar-iframe": "2.0.3",
34
+ "@canopycanopycanopy/b-ber-grammar-image": "2.0.3",
35
+ "@canopycanopycanopy/b-ber-grammar-logo": "2.0.3",
36
+ "@canopycanopycanopy/b-ber-grammar-media": "2.0.3",
37
+ "@canopycanopycanopy/b-ber-grammar-pullquote": "2.0.3",
38
+ "@canopycanopycanopy/b-ber-grammar-section": "2.0.3",
39
+ "@canopycanopycanopy/b-ber-grammar-spread": "2.0.3",
40
+ "@canopycanopycanopy/b-ber-grammar-vimeo": "2.0.3",
41
+ "@canopycanopycanopy/b-ber-parser-footnotes": "2.0.3",
42
+ "@canopycanopycanopy/b-ber-parser-gallery": "2.0.3",
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": "dbeae192709705f5bc211195ff343cbd999f9caf"
65
+ "gitHead": "f5e6f419af00c5d0c28e7ee202b8184273ca81e3"
66
66
  }