highmark-cli 0.0.179 → 0.0.181
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 +2 -2
- package/bin/abbreviations.js +3 -3
- package/bin/action/help.js +2 -2
- package/bin/action/publish.js +5 -5
- package/bin/action/server.js +2 -2
- package/bin/defaults.js +2 -2
- package/bin/main.js +5 -5
- package/bin/operation/indexHTML.js +49 -0
- package/bin/operation/server.js +3 -3
- package/bin/operation/watch.js +3 -3
- package/bin/options.js +2 -2
- package/package.json +2 -2
- package/template/index.html +64 -0
- package/bin/operation/html.js +0 -11
package/README.md
CHANGED
|
@@ -48,10 +48,10 @@ Options:
|
|
|
48
48
|
|
|
49
49
|
--watch|-w Watch for changes to the client file and in the output directory
|
|
50
50
|
|
|
51
|
-
--server|-s Start a server to view the output file
|
|
52
|
-
|
|
53
51
|
--copy-fonts|-f Copy the fonts to a fonts folder next to the output file
|
|
54
52
|
|
|
53
|
+
--start-server|-s Start a server to view the output file
|
|
54
|
+
|
|
55
55
|
--input-file-path|-i The input file path, the default being 'default.md'
|
|
56
56
|
|
|
57
57
|
--copy-client-files|-c Copy the bundled client files next to the output file
|
package/bin/abbreviations.js
CHANGED
|
@@ -5,10 +5,10 @@ const options = require("./options");
|
|
|
5
5
|
const { HELP_OPTION,
|
|
6
6
|
PORT_OPTION,
|
|
7
7
|
WATCH_OPTION,
|
|
8
|
-
SERVER_OPTION,
|
|
9
8
|
VERSION_OPTION,
|
|
10
9
|
QUIETLY_OPTION,
|
|
11
10
|
COPY_FONTS_OPTION,
|
|
11
|
+
START_SERVER_OPTION,
|
|
12
12
|
INPUT_FILE_PATH_OPTION,
|
|
13
13
|
COPY_CLIENT_FILES_OPTION,
|
|
14
14
|
OUTPUT_DIRECTORY_PATH_OPTION } = options;
|
|
@@ -16,10 +16,10 @@ const { HELP_OPTION,
|
|
|
16
16
|
const h = HELP_OPTION,
|
|
17
17
|
p = PORT_OPTION,
|
|
18
18
|
w = WATCH_OPTION,
|
|
19
|
-
s = SERVER_OPTION,
|
|
20
19
|
v = VERSION_OPTION,
|
|
21
20
|
q = QUIETLY_OPTION,
|
|
22
21
|
f = COPY_FONTS_OPTION,
|
|
22
|
+
s = START_SERVER_OPTION,
|
|
23
23
|
i = INPUT_FILE_PATH_OPTION,
|
|
24
24
|
c = COPY_CLIENT_FILES_OPTION,
|
|
25
25
|
o = OUTPUT_DIRECTORY_PATH_OPTION;
|
|
@@ -28,10 +28,10 @@ module.exports = {
|
|
|
28
28
|
h,
|
|
29
29
|
p,
|
|
30
30
|
w,
|
|
31
|
-
s,
|
|
32
31
|
v,
|
|
33
32
|
q,
|
|
34
33
|
f,
|
|
34
|
+
s,
|
|
35
35
|
i,
|
|
36
36
|
c,
|
|
37
37
|
o
|
package/bin/action/help.js
CHANGED
|
@@ -23,10 +23,10 @@ Options:
|
|
|
23
23
|
|
|
24
24
|
--watch|-w Watch for changes to the client file and in the output directory
|
|
25
25
|
|
|
26
|
-
--server|-s Start a server to view the output file
|
|
27
|
-
|
|
28
26
|
--copy-fonts|-f Copy the fonts to a fonts folder next to the output file
|
|
29
27
|
|
|
28
|
+
--start-server|-s Start a server to view the output file
|
|
29
|
+
|
|
30
30
|
--input-file-path|-i The input file path, the default being 'default.md'
|
|
31
31
|
|
|
32
32
|
--copy-client-files|-c Copy the bundled client files next to the output file
|
package/bin/action/publish.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
watchOperation = require("../operation/watch"),
|
|
3
|
+
const watchOperation = require("../operation/watch"),
|
|
5
4
|
serverOperation = require("../operation/server"),
|
|
6
5
|
copyFontsOperation = require("../operation/copyFonts"),
|
|
6
|
+
indexHTMLOperation = require("../operation/indexHTML"),
|
|
7
7
|
markdownHTMLOperation = require("../operation/markdownHTML"),
|
|
8
8
|
copyClientFilesOperation = require("../operation/copyClientFiles"),
|
|
9
9
|
markdownStylesCSSOperation = require("../operation/markdownStylesCSS");
|
|
@@ -11,22 +11,22 @@ const htmlOperation = require("../operation/html"),
|
|
|
11
11
|
const { executeOperations } = require("../utilities/operation"),
|
|
12
12
|
{ SUCCESSFUL_PUBLISH_MESSAGE, FAILED_PUBLISH_MESSAGE } = require("../messages");
|
|
13
13
|
|
|
14
|
-
function publishAction(port, watch,
|
|
14
|
+
function publishAction(port, watch, quietly, copyFonts, startServer, inputFilePath, copyClientFiles, outputDirectoryPath) {
|
|
15
15
|
const operations = [
|
|
16
16
|
markdownHTMLOperation,
|
|
17
17
|
markdownStylesCSSOperation,
|
|
18
18
|
copyClientFilesOperation,
|
|
19
19
|
copyFontsOperation,
|
|
20
|
-
|
|
20
|
+
indexHTMLOperation,
|
|
21
21
|
serverOperation,
|
|
22
22
|
watchOperation
|
|
23
23
|
],
|
|
24
24
|
context = {
|
|
25
25
|
port,
|
|
26
26
|
watch,
|
|
27
|
-
server,
|
|
28
27
|
quietly,
|
|
29
28
|
copyFonts,
|
|
29
|
+
startServer,
|
|
30
30
|
inputFilePath,
|
|
31
31
|
copyClientFiles,
|
|
32
32
|
outputDirectoryPath
|
package/bin/action/server.js
CHANGED
|
@@ -6,7 +6,7 @@ const watchOperation = require("../operation/watch"),
|
|
|
6
6
|
const { executeOperations } = require("../utilities/operation"),
|
|
7
7
|
{ SUCCESSFUL_SERVER_MESSAGE, FAILED_SERVER_MESSAGE } = require("../messages");
|
|
8
8
|
|
|
9
|
-
function serverAction(port, watch,
|
|
9
|
+
function serverAction(port, watch, quietly, startServer, outputDirectoryPath) {
|
|
10
10
|
const operations = [
|
|
11
11
|
serverOperation,
|
|
12
12
|
watchOperation
|
|
@@ -14,8 +14,8 @@ function serverAction(port, watch, server, quietly, outputDirectoryPath) {
|
|
|
14
14
|
context = {
|
|
15
15
|
port,
|
|
16
16
|
watch,
|
|
17
|
-
server,
|
|
18
17
|
quietly,
|
|
18
|
+
startServer,
|
|
19
19
|
outputDirectoryPath
|
|
20
20
|
};
|
|
21
21
|
|
package/bin/defaults.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
const DEFAULT_PORT = 8888,
|
|
4
4
|
DEFAULT_WATCH = false,
|
|
5
|
-
DEFAULT_SERVER = false,
|
|
6
5
|
DEFAULT_QUIETLY = false,
|
|
7
6
|
DEFAULT_COPY_FONTS = false,
|
|
7
|
+
DEFAULT_START_SERVER = false,
|
|
8
8
|
DEFAULT_INPUT_FILE_PATH = "default.md",
|
|
9
9
|
DEFAULT_COPY_CLIENT_FILES = false,
|
|
10
10
|
DEFAULT_OUTPUT_DIRECTORY_PATH = ".";
|
|
@@ -12,9 +12,9 @@ const DEFAULT_PORT = 8888,
|
|
|
12
12
|
module.exports = {
|
|
13
13
|
DEFAULT_PORT,
|
|
14
14
|
DEFAULT_WATCH,
|
|
15
|
-
DEFAULT_SERVER,
|
|
16
15
|
DEFAULT_QUIETLY,
|
|
17
16
|
DEFAULT_COPY_FONTS,
|
|
17
|
+
DEFAULT_START_SERVER,
|
|
18
18
|
DEFAULT_INPUT_FILE_PATH,
|
|
19
19
|
DEFAULT_COPY_CLIENT_FILES,
|
|
20
20
|
DEFAULT_OUTPUT_DIRECTORY_PATH
|
package/bin/main.js
CHANGED
|
@@ -9,9 +9,9 @@ const { HELP_OPTION, SERVER_OPTION, VERSION_OPTION } = require("./options"),
|
|
|
9
9
|
{ HELP_COMMAND, SERVER_COMMAND, VERSION_COMMAND } = require("./commands"),
|
|
10
10
|
{ DEFAULT_PORT,
|
|
11
11
|
DEFAULT_WATCH,
|
|
12
|
-
DEFAULT_SERVER,
|
|
13
12
|
DEFAULT_QUIETLY,
|
|
14
13
|
DEFAULT_COPY_FONTS,
|
|
14
|
+
DEFAULT_START_SERVER,
|
|
15
15
|
DEFAULT_INPUT_FILE_PATH,
|
|
16
16
|
DEFAULT_COPY_CLIENT_FILES,
|
|
17
17
|
DEFAULT_OUTPUT_DIRECTORY_PATH } = require("./defaults");
|
|
@@ -23,9 +23,9 @@ function main(command, argument, options) {
|
|
|
23
23
|
versionOptionPresent = options.hasOwnProperty(VERSION_OPTION),
|
|
24
24
|
{ port = DEFAULT_PORT,
|
|
25
25
|
watch = DEFAULT_WATCH,
|
|
26
|
-
server = DEFAULT_SERVER,
|
|
27
26
|
quietly = DEFAULT_QUIETLY,
|
|
28
27
|
copyFonts = DEFAULT_COPY_FONTS,
|
|
28
|
+
startServer = DEFAULT_START_SERVER,
|
|
29
29
|
inputFilePath = DEFAULT_INPUT_FILE_PATH,
|
|
30
30
|
copyClientFiles = DEFAULT_COPY_CLIENT_FILES,
|
|
31
31
|
outputDirectoryPath = DEFAULT_OUTPUT_DIRECTORY_PATH } = options;
|
|
@@ -52,9 +52,9 @@ function main(command, argument, options) {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
case SERVER_COMMAND: {
|
|
55
|
-
const
|
|
55
|
+
const startServer = true;
|
|
56
56
|
|
|
57
|
-
serverAction(port, watch,
|
|
57
|
+
serverAction(port, watch, quietly, startServer, outputDirectoryPath);
|
|
58
58
|
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
@@ -66,7 +66,7 @@ function main(command, argument, options) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
default: {
|
|
69
|
-
publishAction(port, watch,
|
|
69
|
+
publishAction(port, watch, quietly, copyFonts, startServer, inputFilePath, copyClientFiles, outputDirectoryPath);
|
|
70
70
|
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { liveReloadSnippet } = require("lively-cli"),
|
|
4
|
+
{ pathUtilities, packageUtilities, templateUtilities } = require("necessary"),
|
|
5
|
+
{ computerModernStyle: computerModernStyleCSS } = require("highmark-fonts");
|
|
6
|
+
|
|
7
|
+
const { writeFile } = require("../utilities/fileSystem"),
|
|
8
|
+
{ INDEX_HTML_FILE_NAME, INDEX_TEMPLATE_FILE_PATH } = require("../constants");
|
|
9
|
+
|
|
10
|
+
const { parseFile } = templateUtilities,
|
|
11
|
+
{ getPackagePath } = packageUtilities,
|
|
12
|
+
{ concatenatePaths } = pathUtilities;
|
|
13
|
+
|
|
14
|
+
function indexHTMLOperation(proceed, abort, context) {
|
|
15
|
+
const { copyClientFiles } = context;
|
|
16
|
+
|
|
17
|
+
if (copyClientFiles) {
|
|
18
|
+
proceed();
|
|
19
|
+
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const { outputDirectoryPath } = context,
|
|
24
|
+
indexHTML = createIndexHTML(context),
|
|
25
|
+
indexHTMLFilePath = concatenatePaths(outputDirectoryPath, INDEX_HTML_FILE_NAME),
|
|
26
|
+
filePath = indexHTMLFilePath, ///
|
|
27
|
+
content = indexHTML; ///
|
|
28
|
+
|
|
29
|
+
writeFile(filePath, content);
|
|
30
|
+
|
|
31
|
+
proceed();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
module.exports = indexHTMLOperation;
|
|
35
|
+
|
|
36
|
+
function createIndexHTML(context) {
|
|
37
|
+
const { markdownHTML, markdownStylesCSS } = context,
|
|
38
|
+
packagePath = getPackagePath(),
|
|
39
|
+
indexTemplateFilePath = concatenatePaths(packagePath, INDEX_TEMPLATE_FILE_PATH),
|
|
40
|
+
args = {
|
|
41
|
+
markdownHTML,
|
|
42
|
+
markdownStylesCSS,
|
|
43
|
+
liveReloadSnippet,
|
|
44
|
+
computerModernStyleCSS
|
|
45
|
+
},
|
|
46
|
+
indexHTML = parseFile(indexTemplateFilePath, args);
|
|
47
|
+
|
|
48
|
+
return indexHTML;
|
|
49
|
+
}
|
package/bin/operation/server.js
CHANGED
|
@@ -6,15 +6,15 @@ const { ERROR } = require("../constants"),
|
|
|
6
6
|
{ UNABLE_TO_START_SERVER_MESSAGE } = require("../messages");
|
|
7
7
|
|
|
8
8
|
function serverOperation(proceed, abort, context) {
|
|
9
|
-
let {
|
|
9
|
+
let { startServer } = context;
|
|
10
10
|
|
|
11
|
-
if (!
|
|
11
|
+
if (!startServer) {
|
|
12
12
|
proceed();
|
|
13
13
|
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
server = express(); ///
|
|
17
|
+
const server = express(); ///
|
|
18
18
|
|
|
19
19
|
Object.assign(context, {
|
|
20
20
|
server
|
package/bin/operation/watch.js
CHANGED
|
@@ -8,9 +8,9 @@ const { LIVE_RELOAD_PATH, INDEX_HTML_FILE_NAME } = require("../constants");
|
|
|
8
8
|
const { concatenatePaths } = pathUtilities;
|
|
9
9
|
|
|
10
10
|
function watchOperation(proceed, abort, context) {
|
|
11
|
-
const {
|
|
11
|
+
const { startServer } = context;
|
|
12
12
|
|
|
13
|
-
if (
|
|
13
|
+
if (!startServer) {
|
|
14
14
|
proceed();
|
|
15
15
|
|
|
16
16
|
return;
|
|
@@ -19,7 +19,7 @@ function watchOperation(proceed, abort, context) {
|
|
|
19
19
|
const { watch } = context;
|
|
20
20
|
|
|
21
21
|
if (watch) {
|
|
22
|
-
const { quietly, outputDirectoryPath } = context,
|
|
22
|
+
const { server, quietly, outputDirectoryPath } = context,
|
|
23
23
|
indexHTMLFilePath = concatenatePaths(outputDirectoryPath, INDEX_HTML_FILE_NAME),
|
|
24
24
|
watchPattern = indexHTMLFilePath, ///
|
|
25
25
|
liveReloadHandler = createLiveReloadHandler(watchPattern, quietly);
|
package/bin/options.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
const HELP_OPTION = "help",
|
|
4
4
|
PORT_OPTION = "port",
|
|
5
5
|
WATCH_OPTION = "watch",
|
|
6
|
-
SERVER_OPTION = "server",
|
|
7
6
|
VERSION_OPTION = "version",
|
|
8
7
|
QUIETLY_OPTION = "quietly",
|
|
9
8
|
COPY_FONTS_OPTION = "copy-fonts",
|
|
9
|
+
START_SERVER_OPTION = "start-server",
|
|
10
10
|
INPUT_FILE_PATH_OPTION = "input-file-path",
|
|
11
11
|
COPY_CLIENT_FILES_OPTION = "copy-client-files",
|
|
12
12
|
OUTPUT_DIRECTORY_PATH_OPTION = "output-directory-path";
|
|
@@ -15,10 +15,10 @@ module.exports = {
|
|
|
15
15
|
HELP_OPTION,
|
|
16
16
|
PORT_OPTION,
|
|
17
17
|
WATCH_OPTION,
|
|
18
|
-
SERVER_OPTION,
|
|
19
18
|
VERSION_OPTION,
|
|
20
19
|
QUIETLY_OPTION,
|
|
21
20
|
COPY_FONTS_OPTION,
|
|
21
|
+
START_SERVER_OPTION,
|
|
22
22
|
INPUT_FILE_PATH_OPTION,
|
|
23
23
|
COPY_CLIENT_FILES_OPTION,
|
|
24
24
|
OUTPUT_DIRECTORY_PATH_OPTION
|
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.181",
|
|
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
|
"express": "^4.19.2",
|
|
15
|
-
"highmark-client": "^0.0.
|
|
15
|
+
"highmark-client": "^0.0.17",
|
|
16
16
|
"highmark-fonts": "^1.0.43",
|
|
17
17
|
"highmark-markdown": "^0.0.245",
|
|
18
18
|
"lively-cli": "^2.0.59",
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
|
|
7
|
+
<link rel="preload" href="font/cmunbbx.woff2" as="font" type="font/woff2" crossorigin />
|
|
8
|
+
<link rel="preload" href="font/cmunbi.woff2" as="font" type="font/woff2" crossorigin />
|
|
9
|
+
<link rel="preload" href="font/cmunbmo.woff2" as="font" type="font/woff2" crossorigin />
|
|
10
|
+
<link rel="preload" href="font/cmunbmr.woff2" as="font" type="font/woff2" crossorigin />
|
|
11
|
+
<link rel="preload" href="font/cmunbx.woff2" as="font" type="font/woff2" crossorigin />
|
|
12
|
+
<link rel="preload" href="font/cmunbxo.woff2" as="font" type="font/woff2" crossorigin />
|
|
13
|
+
<link rel="preload" href="font/cmunit.woff2" as="font" type="font/woff2" crossorigin />
|
|
14
|
+
<link rel="preload" href="font/cmunobi.woff2" as="font" type="font/woff2" crossorigin />
|
|
15
|
+
<link rel="preload" href="font/cmunobx.woff2" as="font" type="font/woff2" crossorigin />
|
|
16
|
+
<link rel="preload" href="font/cmunorm.woff2" as="font" type="font/woff2" crossorigin />
|
|
17
|
+
<link rel="preload" href="font/cmunoti.woff2" as="font" type="font/woff2" crossorigin />
|
|
18
|
+
<link rel="preload" href="font/cmunrm.woff2" as="font" type="font/woff2" crossorigin />
|
|
19
|
+
<link rel="preload" href="font/cmunsi.woff2" as="font" type="font/woff2" crossorigin />
|
|
20
|
+
<link rel="preload" href="font/cmunso.woff2" as="font" type="font/woff2" crossorigin />
|
|
21
|
+
<link rel="preload" href="font/cmunss.woff2" as="font" type="font/woff2" crossorigin />
|
|
22
|
+
<link rel="preload" href="font/cmunsx.woff2" as="font" type="font/woff2" crossorigin />
|
|
23
|
+
<link rel="preload" href="font/cmuntb.woff2" as="font" type="font/woff2" crossorigin />
|
|
24
|
+
<link rel="preload" href="font/cmunti.woff2" as="font" type="font/woff2" crossorigin />
|
|
25
|
+
<link rel="preload" href="font/cmuntt.woff2" as="font" type="font/woff2" crossorigin />
|
|
26
|
+
<link rel="preload" href="font/cmuntx.woff2" as="font" type="font/woff2" crossorigin />
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
|
|
30
|
+
*,
|
|
31
|
+
*::after,
|
|
32
|
+
*::before {
|
|
33
|
+
border: 0;
|
|
34
|
+
margin: 0;
|
|
35
|
+
padding: 0;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
html,
|
|
40
|
+
html > body {
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
</style>
|
|
46
|
+
<style>
|
|
47
|
+
|
|
48
|
+
${computerModernStyleCSS}
|
|
49
|
+
|
|
50
|
+
</style>
|
|
51
|
+
<style>
|
|
52
|
+
|
|
53
|
+
${markdownStylesCSS}
|
|
54
|
+
|
|
55
|
+
</style>
|
|
56
|
+
</head>
|
|
57
|
+
<body>
|
|
58
|
+
|
|
59
|
+
${markdownHTML}
|
|
60
|
+
|
|
61
|
+
${liveReloadSnippet}
|
|
62
|
+
|
|
63
|
+
</body>
|
|
64
|
+
</html>
|