highmark-cli 0.0.76 → 0.0.78
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/action/publish.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const markdownHTMLOperation = require("../operation/markdownHTML"),
|
|
4
|
+
markdownStylesCSSOperation = require("../operation/markdownStylesCSS");
|
|
5
5
|
|
|
6
6
|
const { executeOperations } = require("../utilities/operation"),
|
|
7
7
|
{ SUCCESSFUL_PUBLISH_MESSAGE, FAILED_PUBLISH_MESSAGE } = require("../messages");
|
|
@@ -10,8 +10,8 @@ function publishAction(inputFilePath, outputFilePath) {
|
|
|
10
10
|
const markdownFilePath = inputFilePath, ///
|
|
11
11
|
htmlFilePath = outputFilePath, ///
|
|
12
12
|
operations = [
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
markdownHTMLOperation,
|
|
14
|
+
markdownStylesCSSOperation
|
|
15
15
|
],
|
|
16
16
|
context = {
|
|
17
17
|
htmlFilePath,
|
package/bin/constants.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const PERIOD = "."
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const PERIOD = ".",
|
|
4
|
+
DOUBLE_SPACE = " ",
|
|
5
|
+
HIGHMARK_CLI = "Highmark-CLI",
|
|
6
|
+
DEFAULT_SELECTOR_STRING = "div",
|
|
7
|
+
DEFAULT_DIVISION_IDENTIFIER = "default";
|
|
7
8
|
|
|
8
9
|
module.exports = {
|
|
9
10
|
PERIOD,
|
|
10
|
-
DEFAULT,
|
|
11
11
|
DOUBLE_SPACE,
|
|
12
|
-
HIGHMARK_CLI
|
|
12
|
+
HIGHMARK_CLI,
|
|
13
|
+
DEFAULT_SELECTOR_STRING,
|
|
14
|
+
DEFAULT_DIVISION_IDENTIFIER
|
|
13
15
|
};
|
|
@@ -5,7 +5,7 @@ const importer = require("../importer");
|
|
|
5
5
|
const { DOUBLE_SPACE } = require("../constants"),
|
|
6
6
|
{ UNABLE_TO_CONVERT_MARKDOWN_TO_HTML_MESSAGE } = require("../messages");
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
function markdownHTMLOperation(proceed, abort, context) {
|
|
9
9
|
const { markdownFilePath } = context,
|
|
10
10
|
filePath = markdownFilePath, ///
|
|
11
11
|
indent = DOUBLE_SPACE,
|
|
@@ -21,11 +21,13 @@ function markdownToHTML(proceed, abort, context) {
|
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
const markdownHTML = html; ///
|
|
25
|
+
|
|
24
26
|
Object.assign(context, {
|
|
25
|
-
|
|
27
|
+
markdownHTML
|
|
26
28
|
});
|
|
27
29
|
|
|
28
30
|
proceed();
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
module.exports =
|
|
33
|
+
module.exports = markdownHTMLOperation;
|
|
@@ -1,40 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const {
|
|
4
|
-
{
|
|
3
|
+
const { filePathUtilities } = require("occam-entities"),
|
|
4
|
+
{ cssUtilities, defaultMarkdownStyle } = require("highmark-markdown-style")
|
|
5
5
|
|
|
6
|
-
const {
|
|
7
|
-
{
|
|
8
|
-
{
|
|
6
|
+
const { readFile, readDirectory } = require("../utilities/fileSystem"),
|
|
7
|
+
{ divisionIdentifierFromFilePath } = require("../utilities/division"),
|
|
8
|
+
{ PERIOD, DEFAULT_SELECTOR_STRING } = require("../constants");
|
|
9
9
|
|
|
10
10
|
const { isFilePathMarkdownStyleFilePath } = filePathUtilities,
|
|
11
11
|
{ cssFromMarkdownStyleAndSelectorString } = cssUtilities;
|
|
12
12
|
|
|
13
|
-
function
|
|
14
|
-
|
|
13
|
+
function markdownStylesCSSOperation(proceed, abort, context) {
|
|
14
|
+
const selectorString = DEFAULT_SELECTOR_STRING,
|
|
15
|
+
markdownStyle = defaultMarkdownStyle, ///
|
|
16
|
+
directoryPath = PERIOD, ///
|
|
17
|
+
css = cssFromMarkdownStyleAndSelectorString(markdownStyle, selectorString);
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
let markdownStylesCSS = css; ///
|
|
17
20
|
|
|
18
21
|
readDirectory(directoryPath, (filePath) => {
|
|
19
22
|
const filePathMarkdownStyleFilePath = isFilePathMarkdownStyleFilePath(filePath);
|
|
20
23
|
|
|
21
24
|
if (filePathMarkdownStyleFilePath) {
|
|
22
25
|
const markdownStyleFilePath = filePath, ///
|
|
26
|
+
selectorString = selectorStringFromMarkdownStyleFilePath(markdownStyleFilePath),
|
|
23
27
|
markdownStyle = markdownStyleFromMarkdownStyleFilePath(markdownStyleFilePath),
|
|
24
|
-
|
|
28
|
+
css = cssFromMarkdownStyleAndSelectorString(markdownStyle, selectorString, markdownStylesCSS); ///
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
markdownStylesCSS = `${markdownStylesCSS}${css}`;
|
|
27
31
|
}
|
|
28
32
|
});
|
|
29
33
|
|
|
30
34
|
Object.assign(context, {
|
|
31
|
-
|
|
35
|
+
markdownStylesCSS
|
|
32
36
|
});
|
|
33
37
|
|
|
34
38
|
proceed();
|
|
35
39
|
}
|
|
36
40
|
|
|
37
|
-
module.exports =
|
|
41
|
+
module.exports = markdownStylesCSSOperation;
|
|
38
42
|
|
|
39
43
|
function markdownStyleFromMarkdownStyleFilePath(markdownStyleFilePath) {
|
|
40
44
|
const filePath = markdownStyleFilePath, ///
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { pathUtilities, arrayUtilities } = require("necessary");
|
|
4
4
|
|
|
5
|
-
const {
|
|
5
|
+
const { DEFAULT_DIVISION_IDENTIFIER } = require("../constants");
|
|
6
6
|
|
|
7
7
|
const { second } = arrayUtilities,
|
|
8
8
|
{ isPathName, bottommostNameFromPath } = pathUtilities;
|
|
@@ -18,7 +18,7 @@ function divisionIdentifierFromFilePath(filePath) {
|
|
|
18
18
|
matches = name.match(/^([^.]+)\..+$/),
|
|
19
19
|
secondMatch = second(matches);
|
|
20
20
|
|
|
21
|
-
if (secondMatch !==
|
|
21
|
+
if (secondMatch !== DEFAULT_DIVISION_IDENTIFIER) {
|
|
22
22
|
divisionIdentifier = secondMatch; ///
|
|
23
23
|
}
|
|
24
24
|
|
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.78",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/highmark-cli",
|
|
7
7
|
"description": "Extensible, styleable Markdown.",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"argumentative": "^2.0.28",
|
|
14
14
|
"highmark-markdown": "^0.0.121",
|
|
15
|
-
"highmark-markdown-style": "^0.0.
|
|
15
|
+
"highmark-markdown-style": "^0.0.172",
|
|
16
16
|
"necessary": "^13.4.2",
|
|
17
17
|
"occam-entities": "^1.0.83"
|
|
18
18
|
},
|