highmark-cli 0.0.113 → 0.0.114
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/importer.js +5 -10
- package/bin/utilities/division.js +5 -5
- package/package.json +3 -3
package/bin/importer.js
CHANGED
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { readFile } = require("./utilities/fileSystem"),
|
|
4
|
-
{
|
|
4
|
+
{ classNameFromFilePath } = require("./utilities/division"),
|
|
5
5
|
{ nodeFromTokens, tokensFromContent } = require("./utilities/markdown");
|
|
6
6
|
|
|
7
7
|
function importer(filePath, context) {
|
|
8
8
|
const content = readFile(filePath);
|
|
9
9
|
|
|
10
10
|
if (content !== null) {
|
|
11
|
-
const
|
|
11
|
+
const className = classNameFromFilePath(filePath),
|
|
12
12
|
tokens = tokensFromContent(content),
|
|
13
13
|
node = nodeFromTokens(tokens);
|
|
14
14
|
|
|
15
15
|
if (node !== null) {
|
|
16
|
-
const importedNode = node, ///
|
|
17
|
-
importedTokens = tokens, ///
|
|
18
|
-
divisionMarkdownNode = node; ///
|
|
19
|
-
|
|
20
|
-
divisionMarkdownNode.setDivisionClassName(divisionClassName);
|
|
21
|
-
|
|
22
16
|
Object.assign(context, {
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
node,
|
|
18
|
+
tokens,
|
|
19
|
+
className
|
|
25
20
|
});
|
|
26
21
|
}
|
|
27
22
|
}
|
|
@@ -7,8 +7,8 @@ const { DEFAULT_DIVISION_IDENTIFIER } = require("../constants");
|
|
|
7
7
|
const { second } = arrayUtilities,
|
|
8
8
|
{ isPathName, bottommostNameFromPath } = pathUtilities;
|
|
9
9
|
|
|
10
|
-
function
|
|
11
|
-
let
|
|
10
|
+
function classNameFromFilePath(filePath) {
|
|
11
|
+
let className = null;
|
|
12
12
|
|
|
13
13
|
const path = filePath,
|
|
14
14
|
pathName = isPathName(path),
|
|
@@ -19,12 +19,12 @@ function divisionClassNameFromFilePath(filePath) {
|
|
|
19
19
|
secondMatch = second(matches);
|
|
20
20
|
|
|
21
21
|
if (secondMatch !== DEFAULT_DIVISION_IDENTIFIER) {
|
|
22
|
-
|
|
22
|
+
className = secondMatch; ///
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
return
|
|
25
|
+
return className;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
module.exports = {
|
|
29
|
-
|
|
29
|
+
classNameFromFilePath
|
|
30
30
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "highmark-cli",
|
|
3
3
|
"author": "James Smith",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.114",
|
|
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.
|
|
17
|
-
"highmark-markdown-style": "^0.0.
|
|
16
|
+
"highmark-markdown": "^0.0.189",
|
|
17
|
+
"highmark-markdown-style": "^0.0.211",
|
|
18
18
|
"lively-cli": "^2.0.55",
|
|
19
19
|
"necessary": "^13.6.1",
|
|
20
20
|
"occam-entities": "^1.0.90"
|