hdoc-tools 0.26.4 → 0.27.1
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 -0
- package/hdoc-help.js +52 -48
- package/hdoc.js +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
@@ -47,6 +47,8 @@ If the -v switch is provided, then a more verbose output is provided, which incl
|
|
47
47
|
|
48
48
|
Use the --set-version argument to set the version number of the built book.
|
49
49
|
|
50
|
+
Use the --no-color argument to remove any color control characters from the output.
|
51
|
+
|
50
52
|
### validate
|
51
53
|
|
52
54
|
Performs a minimum local build of the book, then validates the links and static content are present and correct.
|
@@ -55,6 +57,8 @@ If the -v switch is provided, then a more verbose output is provided, which incl
|
|
55
57
|
|
56
58
|
Use the --set-version argument to set the version number of the built book.
|
57
59
|
|
60
|
+
Use the --no-color argument to remove any color control characters from the output.
|
61
|
+
|
58
62
|
### serve
|
59
63
|
|
60
64
|
Starts a local web server on port 3000, serving the book content.
|
package/hdoc-help.js
CHANGED
@@ -1,48 +1,52 @@
|
|
1
|
-
(() => {
|
2
|
-
exports.run = () => {
|
3
|
-
// STEVE: The purpose of this function is to output information about hdoc arguments
|
4
|
-
const helpText = `
|
5
|
-
Command Line Usage
|
6
|
-
|
7
|
-
hdoc <command> [switches]
|
8
|
-
|
9
|
-
Commands
|
10
|
-
|
11
|
-
- build
|
12
|
-
Performs a local build of the book, and outputs as a ZIP file.
|
13
|
-
|
14
|
-
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
1
|
+
(() => {
|
2
|
+
exports.run = () => {
|
3
|
+
// STEVE: The purpose of this function is to output information about hdoc arguments
|
4
|
+
const helpText = `
|
5
|
+
Command Line Usage
|
6
|
+
|
7
|
+
hdoc <command> [switches]
|
8
|
+
|
9
|
+
Commands
|
10
|
+
|
11
|
+
- build
|
12
|
+
Performs a local build of the book, and outputs as a ZIP file.
|
13
|
+
- Use the '--set-version 1.2.3' argument to set the version number of the built book.
|
14
|
+
- Use the '--no-color' argument to remove any color control characters from the output.
|
15
|
+
|
16
|
+
- createDocs
|
17
|
+
Creates folder structure and markdown documents as defined in the HDocBook navigation item links
|
18
|
+
|
19
|
+
- help
|
20
|
+
Outputs available arguments and switches
|
21
|
+
|
22
|
+
- init
|
23
|
+
Initializes a new HDocBook project from a template, using runtime input variables
|
24
|
+
|
25
|
+
- serve
|
26
|
+
Starts a local web server on port 3000, serving the content. Supports a -port N to use a different port
|
27
|
+
|
28
|
+
- stats
|
29
|
+
Returns statistics regarding the book you are working on. Supports a -v switch for verbose output.
|
30
|
+
The book statistics do not include counts for any externally hosted content injected into the book content using the [[INCLUDE]] tags.
|
31
|
+
|
32
|
+
- validate
|
33
|
+
Validates the book content.
|
34
|
+
- Use the '--set-version 1.2.3' argument to set the version number of the built book.
|
35
|
+
- Use the '--no-color' argument to remove any color control characters from the output.
|
36
|
+
|
37
|
+
- bump
|
38
|
+
Updates the semantic version number of the current book. If no options are specified, then the default of patch is applied:
|
39
|
+
- major - updates the major version of the book. i.e. - 1.4.5 would become 2.0.0
|
40
|
+
- minor - updates the minor version of the book. i.e. - 1.4.5 would become 1.5.0
|
41
|
+
- patch (default) - updates the patch version of the book. i.e. - 1.4.5 would become 1.4.6
|
42
|
+
|
43
|
+
- ver
|
44
|
+
Returns the version of the current book
|
45
|
+
|
46
|
+
Example
|
47
|
+
|
48
|
+
hdoc stats -v
|
49
|
+
`;
|
50
|
+
console.log(helpText);
|
51
|
+
};
|
52
|
+
})();
|
package/hdoc.js
CHANGED
@@ -7,12 +7,18 @@
|
|
7
7
|
|
8
8
|
const packageFile = path.join(__dirname, "package.json");
|
9
9
|
|
10
|
+
let console_color = true;
|
11
|
+
|
10
12
|
const { info, error } = console;
|
11
13
|
console.info = (arg) => {
|
12
|
-
|
14
|
+
if (console_color)
|
15
|
+
info.call(console, `\x1b[33m${arg}\x1b[0m`);
|
16
|
+
else info.call(console, arg);
|
13
17
|
};
|
14
18
|
console.error = (arg) => {
|
15
|
-
|
19
|
+
if (console_color)
|
20
|
+
error.call(console, `\x1b[31m${arg}\x1b[0m`);
|
21
|
+
else error.call(console, arg);
|
16
22
|
};
|
17
23
|
|
18
24
|
const getHdocPackageVersion = (packagePath) => {
|
@@ -84,6 +90,8 @@
|
|
84
90
|
}
|
85
91
|
} else if (process.argv[x].toLowerCase() === "-e") {
|
86
92
|
gen_exclude = true;
|
93
|
+
} else if (process.argv[x].toLowerCase() === "--no-color") {
|
94
|
+
console_color = false;
|
87
95
|
}
|
88
96
|
}
|
89
97
|
source_path = trueCasePathSync(source_path);
|