highmark-cli 0.0.104 → 0.0.105

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/bin/constants.js CHANGED
@@ -4,7 +4,6 @@ const FONT = "font",
4
4
  ERROR = "error",
5
5
  PERIOD = ".",
6
6
  EMPTY_STRING = "",
7
- DOUBLE_SPACE = " ",
8
7
  HIGHMARK_CLI = "Highmark-CLI",
9
8
  TEMPLATE_FILE_PATH = "template/default.html",
10
9
  DEFAULT_SELECTOR_STRING = "div",
@@ -15,7 +14,6 @@ module.exports = {
15
14
  ERROR,
16
15
  PERIOD,
17
16
  EMPTY_STRING,
18
- DOUBLE_SPACE,
19
17
  HIGHMARK_CLI,
20
18
  TEMPLATE_FILE_PATH,
21
19
  DEFAULT_SELECTOR_STRING,
package/bin/importer.js CHANGED
@@ -4,9 +4,7 @@ const { readFile } = require("./utilities/fileSystem"),
4
4
  { divisionClassNameFromFilePath } = require("./utilities/division"),
5
5
  { nodeFromTokens, tokensFromContent } = require("./utilities/markdown");
6
6
 
7
- function importer(filePath, indent, context) {
8
- let html = null;
9
-
7
+ function importer(filePath, context) {
10
8
  const content = readFile(filePath);
11
9
 
12
10
  if (content !== null) {
@@ -15,16 +13,18 @@ function importer(filePath, indent, context) {
15
13
  node = nodeFromTokens(tokens);
16
14
 
17
15
  if (node !== null) {
16
+ const importedNode = node, ///
17
+ importedTokens = tokens, ///
18
+ divisionMarkdownNode = node; ///
19
+
20
+ divisionMarkdownNode.setDivisionClassName(divisionClassName);
21
+
18
22
  Object.assign(context, {
19
- tokens,
20
- divisionClassName
23
+ importedNode,
24
+ importedTokens
21
25
  });
22
-
23
- html = node.asHTML(indent, context);
24
26
  }
25
27
  }
26
-
27
- return html;
28
28
  }
29
29
 
30
30
  module.exports = importer;
@@ -2,23 +2,21 @@
2
2
 
3
3
  const importer = require("../importer");
4
4
 
5
- const { DOUBLE_SPACE } = require("../constants"),
6
- { UNABLE_TO_CONVERT_MARKDOWN_TO_HTML_MESSAGE } = require("../messages");
5
+ const { UNABLE_TO_CONVERT_MARKDOWN_TO_HTML_MESSAGE } = require("../messages");
7
6
 
8
7
  function markdownHTMLOperation(proceed, abort, context) {
9
8
  const { inputFilePath } = context,
10
- filePath = inputFilePath, ///
11
- indent = DOUBLE_SPACE,
12
- title = null;
9
+ filePath = inputFilePath; ///
13
10
 
14
11
  Object.assign(context, {
15
- title,
16
12
  importer
17
13
  });
18
14
 
19
- const html = importer(filePath, indent, context);
15
+ importer(filePath, context);
20
16
 
21
- if (html === null) {
17
+ const { importedNode = null, importedTokens = null } = context;
18
+
19
+ if (importedNode === null) {
22
20
  const message = UNABLE_TO_CONVERT_MARKDOWN_TO_HTML_MESSAGE;
23
21
 
24
22
  console.log(message);
@@ -28,7 +26,26 @@ function markdownHTMLOperation(proceed, abort, context) {
28
26
  return;
29
27
  }
30
28
 
31
- const markdownHTML = html; ///
29
+ delete context.importedNode;
30
+ delete context.importedTokens;
31
+
32
+ const node = importedNode, ///
33
+ tokens = importedTokens, ///
34
+ parentNode = null,
35
+ divisionMarkdownNode = node; ///
36
+
37
+ Object.assign(context, {
38
+ tokens
39
+ });
40
+
41
+ divisionMarkdownNode.resolveImports(parentNode, context);
42
+
43
+ divisionMarkdownNode.createContents(context);
44
+
45
+ divisionMarkdownNode.createFootnotes(context);
46
+
47
+ const html = divisionMarkdownNode.asHTML(context),
48
+ markdownHTML = html; ///
32
49
 
33
50
  Object.assign(context, {
34
51
  markdownHTML
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "highmark-cli",
3
3
  "author": "James Smith",
4
- "version": "0.0.104",
4
+ "version": "0.0.105",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/highmark-cli",
7
7
  "description": "Extensible, styleable Markdown.",
@@ -13,8 +13,8 @@
13
13
  "argumentative": "^2.0.28",
14
14
  "express": "^4.19.2",
15
15
  "highmark-fonts": "^1.0.36",
16
- "highmark-markdown": "^0.0.164",
17
- "highmark-markdown-style": "^0.0.199",
16
+ "highmark-markdown": "^0.0.166",
17
+ "highmark-markdown-style": "^0.0.200",
18
18
  "lively-cli": "^2.0.55",
19
19
  "necessary": "^13.6.1",
20
20
  "occam-entities": "^1.0.90"