highmark-cli 1.3.14 → 1.3.16
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/README.md +4 -6
- package/bin/abbreviations.js +9 -12
- package/bin/action/help.js +4 -6
- package/bin/action/publish.js +3 -4
- package/bin/defaults.js +4 -6
- package/bin/main.js +7 -9
- package/bin/operation/copyClientFiles.js +4 -4
- package/bin/operation/copyFonts.js +5 -5
- package/bin/operation/createClientHTML.js +2 -2
- package/bin/operation/markdownStylesCSS.js +5 -5
- package/bin/options.js +6 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -75,19 +75,17 @@ Options:
|
|
|
75
75
|
|
|
76
76
|
--port|-p The server port, the default being 8888
|
|
77
77
|
|
|
78
|
+
--fonts|-f Copy the fonts to a fonts folder next to the output file
|
|
79
|
+
|
|
78
80
|
--watch|-w Watch for changes to the client file and in the output directory
|
|
79
81
|
|
|
82
|
+
--client|-c Copy the bundled client and supporting files next to the output file
|
|
83
|
+
|
|
80
84
|
--server|-s Run a server to view the output file
|
|
81
85
|
|
|
82
86
|
--quietly|-q Run with almost no console logging
|
|
83
87
|
|
|
84
|
-
--no-client|-n Do not include references to the client files in the output file
|
|
85
|
-
|
|
86
|
-
--copy-fonts|-f Copy the fonts to a fonts folder next to the output file
|
|
87
|
-
|
|
88
88
|
--input-file-name|-i The input file name, the default being 'default.md'
|
|
89
|
-
|
|
90
|
-
--copy-client-files|-c Copy the client files next to the output file
|
|
91
89
|
```
|
|
92
90
|
|
|
93
91
|
## Contact
|
package/bin/abbreviations.js
CHANGED
|
@@ -4,35 +4,32 @@ const options = require("./options");
|
|
|
4
4
|
|
|
5
5
|
const { HELP_OPTION,
|
|
6
6
|
PORT_OPTION,
|
|
7
|
+
FONTS_OPTION,
|
|
7
8
|
WATCH_OPTION,
|
|
9
|
+
CLIENT_OPTION,
|
|
8
10
|
SERVER_OPTION,
|
|
9
11
|
VERSION_OPTION,
|
|
10
12
|
QUIETLY_OPTION,
|
|
11
|
-
|
|
12
|
-
COPY_FONTS_OPTION,
|
|
13
|
-
INPUT_FILE_NAME_OPTION,
|
|
14
|
-
COPY_CLIENT_FILES_OPTION } = options;
|
|
13
|
+
INPUT_FILE_NAME_OPTION, } = options;
|
|
15
14
|
|
|
16
15
|
const h = HELP_OPTION,
|
|
17
16
|
p = PORT_OPTION,
|
|
17
|
+
f = FONTS_OPTION,
|
|
18
18
|
w = WATCH_OPTION,
|
|
19
|
+
c = CLIENT_OPTION,
|
|
19
20
|
s = SERVER_OPTION,
|
|
20
21
|
v = VERSION_OPTION,
|
|
21
22
|
q = QUIETLY_OPTION,
|
|
22
|
-
|
|
23
|
-
f = COPY_FONTS_OPTION,
|
|
24
|
-
i = INPUT_FILE_NAME_OPTION,
|
|
25
|
-
c = COPY_CLIENT_FILES_OPTION;
|
|
23
|
+
i = INPUT_FILE_NAME_OPTION;
|
|
26
24
|
|
|
27
25
|
module.exports = {
|
|
28
26
|
h,
|
|
29
27
|
p,
|
|
28
|
+
f,
|
|
30
29
|
w,
|
|
31
30
|
v,
|
|
32
31
|
q,
|
|
33
|
-
|
|
34
|
-
f,
|
|
32
|
+
c,
|
|
35
33
|
s,
|
|
36
|
-
i
|
|
37
|
-
c
|
|
34
|
+
i
|
|
38
35
|
};
|
package/bin/action/help.js
CHANGED
|
@@ -27,20 +27,18 @@ Options:
|
|
|
27
27
|
|
|
28
28
|
--port|-p The server port, the default being 8888
|
|
29
29
|
|
|
30
|
+
--fonts|-f Copy the fonts to a fonts folder next to the output file
|
|
31
|
+
|
|
30
32
|
--watch|-w Watch for changes to the client file and in the output directory
|
|
31
33
|
|
|
34
|
+
--client|-c Copy the bundled client and supporting files next to the output file
|
|
35
|
+
|
|
32
36
|
--server|-s Run a server to view the output file
|
|
33
37
|
|
|
34
38
|
--quietly|-q Run with almost no console logging
|
|
35
39
|
|
|
36
|
-
--no-client|-n Do not include references to the client files in the output file
|
|
37
|
-
|
|
38
|
-
--copy-fonts|-f Copy the fonts to a fonts folder next to the output file
|
|
39
|
-
|
|
40
40
|
--input-file-name|-i The input file name, the default being 'default.md'
|
|
41
41
|
|
|
42
|
-
--copy-client-files|-c Copy the client files next to the output file
|
|
43
|
-
|
|
44
42
|
Further information:
|
|
45
43
|
|
|
46
44
|
Please see the readme file on GitHub:
|
package/bin/action/publish.js
CHANGED
|
@@ -11,7 +11,7 @@ const indexOptions = require("../indexOptions"),
|
|
|
11
11
|
const { executeOperations } = require("../utilities/operation"),
|
|
12
12
|
{ SUCCESSFUL_PUBLISH_MESSAGE, FAILED_PUBLISH_MESSAGE } = require("../messages");
|
|
13
13
|
|
|
14
|
-
function publishAction(port,
|
|
14
|
+
function publishAction(port, fonts, watch, client, quietly, inputFileName, projectDirectoryName) {
|
|
15
15
|
const operations = [
|
|
16
16
|
markdownHTMLOperation,
|
|
17
17
|
markdownStylesCSSOperation,
|
|
@@ -22,13 +22,12 @@ function publishAction(port, watch, quietly, noClient, copyFonts, inputFileName,
|
|
|
22
22
|
],
|
|
23
23
|
context = {
|
|
24
24
|
port,
|
|
25
|
+
fonts,
|
|
25
26
|
watch,
|
|
27
|
+
client,
|
|
26
28
|
quietly,
|
|
27
|
-
noClient,
|
|
28
|
-
copyFonts,
|
|
29
29
|
indexOptions,
|
|
30
30
|
inputFileName,
|
|
31
|
-
copyClientFiles,
|
|
32
31
|
projectDirectoryName
|
|
33
32
|
};
|
|
34
33
|
|
package/bin/defaults.js
CHANGED
|
@@ -2,30 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
const DEFAULT_HELP = false,
|
|
4
4
|
DEFAULT_PORT = 8888,
|
|
5
|
+
DEFAULT_FONTS = false,
|
|
5
6
|
DEFAULT_WATCH = false,
|
|
7
|
+
DEFAULT_CLIENT = true,
|
|
6
8
|
DEFAULT_SERVER = false,
|
|
7
9
|
DEFAULT_QUIETLY = false,
|
|
8
10
|
DEFAULT_VERSION = false,
|
|
9
|
-
DEFAULT_NO_CLIENT = false,
|
|
10
|
-
DEFAULT_COPY_FONTS = false,
|
|
11
11
|
DEFAULT_LINES_PER_PAGE = Infinity,
|
|
12
12
|
DEFAULT_CONTENTS_DEPTH = 2,
|
|
13
13
|
DEFAULT_INPUT_FILE_NAME = "default.md",
|
|
14
|
-
DEFAULT_COPY_CLIENT_FILES = false,
|
|
15
14
|
DEFAULT_CHARACTERS_PER_LINE = 75;
|
|
16
15
|
|
|
17
16
|
module.exports = {
|
|
18
17
|
DEFAULT_HELP,
|
|
19
18
|
DEFAULT_PORT,
|
|
19
|
+
DEFAULT_FONTS,
|
|
20
20
|
DEFAULT_WATCH,
|
|
21
|
+
DEFAULT_CLIENT,
|
|
21
22
|
DEFAULT_SERVER,
|
|
22
23
|
DEFAULT_QUIETLY,
|
|
23
24
|
DEFAULT_VERSION,
|
|
24
|
-
DEFAULT_NO_CLIENT,
|
|
25
|
-
DEFAULT_COPY_FONTS,
|
|
26
25
|
DEFAULT_LINES_PER_PAGE,
|
|
27
26
|
DEFAULT_CONTENTS_DEPTH,
|
|
28
27
|
DEFAULT_INPUT_FILE_NAME,
|
|
29
|
-
DEFAULT_COPY_CLIENT_FILES,
|
|
30
28
|
DEFAULT_CHARACTERS_PER_LINE
|
|
31
29
|
};
|
package/bin/main.js
CHANGED
|
@@ -10,21 +10,19 @@ const helpAction = require("./action/help"),
|
|
|
10
10
|
const { NO_COMMAND_GIVEN_MESSAGE, COMMAND_NOT_RECOGNISED_MESSAGE } = require("./messages"),
|
|
11
11
|
{ HELP_COMMAND, SERVER_COMMAND, VERSION_COMMAND, PUBLISH_COMMAND, INITIALISE_COMMAND, SET_OPTIONS_COMMAND } = require("./commands"),
|
|
12
12
|
{ DEFAULT_PORT,
|
|
13
|
+
DEFAULT_FONTS,
|
|
13
14
|
DEFAULT_WATCH,
|
|
15
|
+
DEFAULT_CLIENT,
|
|
14
16
|
DEFAULT_QUIETLY,
|
|
15
|
-
|
|
16
|
-
DEFAULT_COPY_FONTS,
|
|
17
|
-
DEFAULT_INPUT_FILE_NAME,
|
|
18
|
-
DEFAULT_COPY_CLIENT_FILES } = require("./defaults");
|
|
17
|
+
DEFAULT_INPUT_FILE_NAME } = require("./defaults");
|
|
19
18
|
|
|
20
19
|
function main(command, argument, options) {
|
|
21
20
|
const { port = DEFAULT_PORT,
|
|
21
|
+
fonts = DEFAULT_FONTS,
|
|
22
22
|
watch = DEFAULT_WATCH,
|
|
23
|
+
client = DEFAULT_CLIENT,
|
|
23
24
|
quietly = DEFAULT_QUIETLY,
|
|
24
|
-
|
|
25
|
-
copyFonts = DEFAULT_COPY_FONTS,
|
|
26
|
-
inputFileName = DEFAULT_INPUT_FILE_NAME,
|
|
27
|
-
copyClientFiles = DEFAULT_COPY_CLIENT_FILES } = options;
|
|
25
|
+
inputFileName = DEFAULT_INPUT_FILE_NAME } = options;
|
|
28
26
|
|
|
29
27
|
switch (command) {
|
|
30
28
|
case null: {
|
|
@@ -56,7 +54,7 @@ function main(command, argument, options) {
|
|
|
56
54
|
case PUBLISH_COMMAND: {
|
|
57
55
|
const projectDirectoryName = argument; ///
|
|
58
56
|
|
|
59
|
-
publishAction(port,
|
|
57
|
+
publishAction(port, fonts, watch, client, quietly, inputFileName, projectDirectoryName);
|
|
60
58
|
|
|
61
59
|
break;
|
|
62
60
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const { copyFiles } = require("highmark-client");
|
|
3
|
+
const { copyFiles: copyClientFiles } = require("highmark-client");
|
|
4
4
|
|
|
5
5
|
function copyClientFilesOperation(proceed, abort, context) {
|
|
6
|
-
const {
|
|
6
|
+
const { client } = context;
|
|
7
7
|
|
|
8
|
-
if (
|
|
8
|
+
if (client) {
|
|
9
9
|
const { projectDirectoryName } = context,
|
|
10
10
|
targetDirectoryPath = projectDirectoryName; ///
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
copyClientFiles(targetDirectoryPath);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
proceed();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const {
|
|
4
|
-
{
|
|
3
|
+
const { copyFonts } = require("highmark-client"),
|
|
4
|
+
{ pathUtilities } = require("necessary");
|
|
5
5
|
|
|
6
6
|
const { FONT } = require("../constants");
|
|
7
7
|
|
|
8
8
|
const { concatenatePaths } = pathUtilities;
|
|
9
9
|
|
|
10
10
|
function copyFontsOperation(proceed, abort, context) {
|
|
11
|
-
const {
|
|
11
|
+
const { fonts } = context;
|
|
12
12
|
|
|
13
|
-
if (!
|
|
13
|
+
if (!fonts) {
|
|
14
14
|
proceed();
|
|
15
15
|
|
|
16
16
|
return;
|
|
@@ -19,7 +19,7 @@ function copyFontsOperation(proceed, abort, context) {
|
|
|
19
19
|
const { projectDirectoryPath } = context,
|
|
20
20
|
fontDirectoryPath = concatenatePaths(projectDirectoryPath, FONT);
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
copyFonts(fontDirectoryPath);
|
|
23
23
|
|
|
24
24
|
proceed();
|
|
25
25
|
}
|
|
@@ -9,8 +9,8 @@ const { concatenatePaths } = pathUtilities,
|
|
|
9
9
|
{ INDEX_HTML_FILE_NAME } = constants;
|
|
10
10
|
|
|
11
11
|
function createClientHTMLOperation(proceed, abort, context) {
|
|
12
|
-
const {
|
|
13
|
-
html = createHTML(markdownHTML, markdownStylesCSS,
|
|
12
|
+
const { client, markdownHTML, markdownStylesCSS, projectDirectoryName } = context,
|
|
13
|
+
html = createHTML(markdownHTML, markdownStylesCSS, client),
|
|
14
14
|
content = html, ///
|
|
15
15
|
filePath = concatenatePaths(projectDirectoryName, INDEX_HTML_FILE_NAME);
|
|
16
16
|
|
|
@@ -13,7 +13,7 @@ const { DIVS_SELECTOR_STRING: CLIENT_DIVS_SELECTOR_STRING } = constants,
|
|
|
13
13
|
{ isFilePathMarkdownStyleFilePath, isFilePathDefaultMarkdownStyleFilePath } = filePathUtilities;
|
|
14
14
|
|
|
15
15
|
function markdownStylesCSSOperation(proceed, abort, context) {
|
|
16
|
-
const {
|
|
16
|
+
const { client, projectDirectoryName } = context,
|
|
17
17
|
projectDirectoryPath = projectDirectoryName, ///
|
|
18
18
|
markdownStyleFilePaths = [];
|
|
19
19
|
|
|
@@ -30,7 +30,7 @@ function markdownStylesCSSOperation(proceed, abort, context) {
|
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
const selectorString =
|
|
33
|
+
const selectorString = client ?
|
|
34
34
|
CLIENT_DIVS_SELECTOR_STRING :
|
|
35
35
|
DIVS_SELECTOR_STRING,
|
|
36
36
|
markdownStyle = defaultMarkdownStyle, ///
|
|
@@ -39,7 +39,7 @@ function markdownStylesCSSOperation(proceed, abort, context) {
|
|
|
39
39
|
let markdownStylesCSS = defaultCSS; ///
|
|
40
40
|
|
|
41
41
|
markdownStyleFilePaths.forEach((markdownStyleFilePath) => {
|
|
42
|
-
const selectorString =
|
|
42
|
+
const selectorString = selectorStringFromMarkdownStyleFilePathAndClient(markdownStyleFilePath, client),
|
|
43
43
|
markdownStyle = markdownStyleFromMarkdownStyleFilePath(markdownStyleFilePath),
|
|
44
44
|
css = cssFromMarkdownStyleAndSelectorString(markdownStyle, selectorString, markdownStylesCSS); ///
|
|
45
45
|
|
|
@@ -63,8 +63,8 @@ function markdownStyleFromMarkdownStyleFilePath(markdownStyleFilePath) {
|
|
|
63
63
|
return markdownStyle;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
function
|
|
67
|
-
let selectorString =
|
|
66
|
+
function selectorStringFromMarkdownStyleFilePathAndClient(markdownStyleFilePath, client) {
|
|
67
|
+
let selectorString = client ?
|
|
68
68
|
CLIENT_DIVS_SELECTOR_STRING :
|
|
69
69
|
DIVS_SELECTOR_STRING;
|
|
70
70
|
|
package/bin/options.js
CHANGED
|
@@ -2,24 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
const HELP_OPTION = "help",
|
|
4
4
|
PORT_OPTION = "port",
|
|
5
|
+
FONTS_OPTION = "fonts",
|
|
5
6
|
WATCH_OPTION = "watch",
|
|
7
|
+
CLIENT_OPTION = "client",
|
|
6
8
|
SERVER_OPTION = "server",
|
|
7
9
|
VERSION_OPTION = "version",
|
|
8
10
|
QUIETLY_OPTION = "quietly",
|
|
9
|
-
|
|
10
|
-
COPY_FONTS_OPTION = "copy-fonts",
|
|
11
|
-
INPUT_FILE_NAME_OPTION = "input-file-name",
|
|
12
|
-
COPY_CLIENT_FILES_OPTION = "copy-client-files";
|
|
11
|
+
INPUT_FILE_NAME_OPTION = "input-file-name";
|
|
13
12
|
|
|
14
13
|
module.exports = {
|
|
15
14
|
HELP_OPTION,
|
|
16
15
|
PORT_OPTION,
|
|
16
|
+
FONTS_OPTION,
|
|
17
17
|
WATCH_OPTION,
|
|
18
|
+
CLIENT_OPTION,
|
|
18
19
|
SERVER_OPTION,
|
|
19
20
|
VERSION_OPTION,
|
|
20
21
|
QUIETLY_OPTION,
|
|
21
|
-
|
|
22
|
-
COPY_FONTS_OPTION,
|
|
23
|
-
INPUT_FILE_NAME_OPTION,
|
|
24
|
-
COPY_CLIENT_FILES_OPTION
|
|
22
|
+
INPUT_FILE_NAME_OPTION
|
|
25
23
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "highmark-cli",
|
|
3
3
|
"author": "James Smith",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.16",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/highmark-cli",
|
|
7
7
|
"description": "Highmark's LIC tool.",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"argumentative": "^2.0.28",
|
|
14
14
|
"express": "^4.19.2",
|
|
15
|
-
"highmark-client": "^0.0.
|
|
16
|
-
"highmark-markdown": "^0.0.
|
|
15
|
+
"highmark-client": "^0.0.104",
|
|
16
|
+
"highmark-markdown": "^0.0.447",
|
|
17
17
|
"lively-cli": "^2.0.65",
|
|
18
18
|
"necessary": "^14.0.1",
|
|
19
19
|
"occam-entities": "^1.0.123"
|