hdoc-tools 0.57.5 → 0.60.0

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/hdoc-ver.js CHANGED
@@ -1,43 +1,43 @@
1
- (() => {
2
- const fs = require("node:fs");
3
- const path = require("node:path");
4
-
5
- exports.run = (source_path) => {
6
- console.log("Retrieving book version...\n");
7
-
8
- // Get document ID
9
- const hdocbook_project_config_path = path.join(
10
- source_path,
11
- "hdocbook-project.json",
12
- );
13
- let hdocbook_project;
14
- try {
15
- hdocbook_project = require(hdocbook_project_config_path);
16
- } catch (e) {
17
- console.error("File not found: hdocbook-project.json:");
18
- console.log(e, "\n");
19
- console.error("hdoc ver needs to be run in the root of a HDoc Book.\n");
20
- process.exit(1);
21
- }
22
- const doc_id = hdocbook_project.docId;
23
-
24
- const book_path = path.join(source_path, doc_id);
25
- const hdocbook_path = path.join(book_path, "hdocbook.json");
26
-
27
- let hdocbook_config;
28
- try {
29
- hdocbook_config = require(hdocbook_path);
30
- } catch (e) {
31
- console.error("File not found: hdocbook.json");
32
- console.log(e, "\n");
33
- console.error("hdoc ver needs to be run in the root of a HDoc Book.\n");
34
- process.exit(1);
35
- }
36
- if (hdocbook_config.version && hdocbook_config.version !== "") {
37
- console.log(`Book version: ${hdocbook_config.version}\n`);
38
- } else {
39
- console.error("Error - this book has no version defined.\n");
40
- process.exit(1);
41
- }
42
- };
43
- })();
1
+ (() => {
2
+ const fs = require("node:fs");
3
+ const path = require("node:path");
4
+
5
+ exports.run = (source_path) => {
6
+ console.log("Retrieving book version...\n");
7
+
8
+ // Get document ID
9
+ const hdocbook_project_config_path = path.join(
10
+ source_path,
11
+ "hdocbook-project.json",
12
+ );
13
+ let hdocbook_project;
14
+ try {
15
+ hdocbook_project = require(hdocbook_project_config_path);
16
+ } catch (e) {
17
+ console.error("File not found: hdocbook-project.json:");
18
+ console.log(e, "\n");
19
+ console.error("hdoc ver needs to be run in the root of a HDoc Book.\n");
20
+ process.exit(1);
21
+ }
22
+ const doc_id = hdocbook_project.docId;
23
+
24
+ const book_path = path.join(source_path, doc_id);
25
+ const hdocbook_path = path.join(book_path, "hdocbook.json");
26
+
27
+ let hdocbook_config;
28
+ try {
29
+ hdocbook_config = require(hdocbook_path);
30
+ } catch (e) {
31
+ console.error("File not found: hdocbook.json");
32
+ console.log(e, "\n");
33
+ console.error("hdoc ver needs to be run in the root of a HDoc Book.\n");
34
+ process.exit(1);
35
+ }
36
+ if (hdocbook_config.version && hdocbook_config.version !== "") {
37
+ console.log(`Book version: ${hdocbook_config.version}\n`);
38
+ } else {
39
+ console.error("Error - this book has no version defined.\n");
40
+ process.exit(1);
41
+ }
42
+ };
43
+ })();
package/hdoc.js CHANGED
@@ -163,6 +163,7 @@
163
163
  let bump_type = "patch"; // To generate spellcheck exclusions for all files
164
164
  let output_links = true;
165
165
  let onyx_index = false;
166
+ let build_embeddings = true;
166
167
 
167
168
  // Get options from command args
168
169
  for (let x = 0; x < process.argv.length; x++) {
@@ -212,6 +213,8 @@
212
213
  output_links = false;
213
214
  } else if (process.argv[x].toLowerCase() === "--onyx") {
214
215
  onyx_index = true;
216
+ } else if (process.argv[x].toLowerCase() === "--no-embeddings") {
217
+ build_embeddings = false;
215
218
  } else if (process.argv[x].toLowerCase() === "--quiet") {
216
219
  // handled at startup via _quietMode
217
220
  }
@@ -270,7 +273,7 @@
270
273
  gen_exclude,
271
274
  build_version,
272
275
  output_links,
273
- onyx_index,
276
+ build_embeddings,
274
277
  );
275
278
  } else if (command.toLowerCase() === "createdocs") {
276
279
  const creator = require(path.join(__dirname, "hdoc-create.js"));
@@ -285,7 +288,7 @@
285
288
  gen_exclude,
286
289
  build_version,
287
290
  output_links,
288
- onyx_index,
291
+ build_embeddings,
289
292
  );
290
293
  } else if (command.toLowerCase() === "stats") {
291
294
  const stats = require(path.join(__dirname, "hdoc-stats.js"));