hdoc-tools 0.7.22 → 0.7.24

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/hdoc-build.js CHANGED
@@ -8,6 +8,7 @@
8
8
  validate = require(path.join(__dirname, 'hdoc-validate.js')),
9
9
  hdoc = require(path.join(__dirname, 'hdoc-module.js')),
10
10
  zipper = require('zip-local');
11
+
11
12
 
12
13
  let conversion_attempted = 0,
13
14
  conversion_success = 0,
@@ -36,12 +37,32 @@
36
37
  }
37
38
  }
38
39
 
40
+ const mdfm = require('markdown-it-front-matter');
41
+ const md = require('markdown-it')({
42
+ // enable everything
43
+ html: true,
44
+ linkify: true,
45
+ typographer: true,
46
+ // highlight: function (str, lang) {
47
+ // if (lang && hljs.getLanguage(lang)) {
48
+ // try {
49
+ // return hljs.highlight(lang, str, true).value;
50
+ // } catch (__) {}
51
+ // }
52
+ // }
53
+ });
54
+
55
+ var frontmatter_content = "";
56
+ md.use(mdfm, function (fm) {
57
+ frontmatter_content = fm;
58
+ console.log("FM:", fm);
59
+ });
60
+
39
61
  // Render markdown into HTML
40
- frontmatter_content = "";
41
62
  var html_txt = md.render(md_txt.toString());
42
63
 
43
64
  if (frontmatter_content.length) {
44
- html_txt = "<!--[[FRONTMATTER\r\n" + frontmatter_content + "]]-->\r\n" + html_txt;
65
+ html_txt = "<!--[[FRONTMATTER\r\n" + frontmatter_content + "\r\n]]-->\r\n" + html_txt;
45
66
  }
46
67
 
47
68
  // Save HTML into HTML file
package/hdoc-serve.js CHANGED
@@ -6,6 +6,9 @@
6
6
  path = require('path'),
7
7
  hdoc = require(path.join(__dirname, 'hdoc-module.js')),
8
8
  stream = require('stream');
9
+
10
+ const yaml = require('js-yaml');
11
+ const mdfm = require('markdown-it-front-matter');
9
12
 
10
13
  let port = 3000;
11
14
  let docId;
@@ -88,7 +91,28 @@
88
91
  console.log(`Includes injected into document: ${includes_processed.success}`);
89
92
  }
90
93
  }
91
-
94
+
95
+ const mdfm = require('markdown-it-front-matter');
96
+ const md = require('markdown-it')({
97
+ // enable everything
98
+ html: true,
99
+ linkify: true,
100
+ typographer: true,
101
+ // highlight: function (str, lang) {
102
+ // if (lang && hljs.getLanguage(lang)) {
103
+ // try {
104
+ // return hljs.highlight(lang, str, true).value;
105
+ // } catch (__) {}
106
+ // }
107
+ // }
108
+ });
109
+
110
+ var frontmatter_content = "";
111
+ md.use(mdfm, function (fm) {
112
+ frontmatter_content = fm;
113
+ console.log("FM:", fm);
114
+ });
115
+
92
116
  // Render markdown into HTML
93
117
  var html_txt = md.render(md_txt.toString());
94
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.7.22",
3
+ "version": "0.7.24",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {