hdoc-tools 0.8.17 → 0.8.18

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/hdoc-build.js +9 -5
  3. package/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Hornbill Docs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/hdoc-build.js CHANGED
@@ -105,7 +105,7 @@
105
105
  });
106
106
  } else {
107
107
  // No header tag, no frontmatter title, output a warning
108
- console.log(`No frontmatter title property, or ${h_tags_to_search.join(', ')} tags detected in ${file_path.path}`);
108
+ console.log(`[WARNING] No frontmatter title property, or ${h_tags_to_search.join(', ')} tags detected in ${file_path.path}`);
109
109
  }
110
110
  }
111
111
  } else {
@@ -121,7 +121,7 @@
121
121
  });
122
122
  } else {
123
123
  // No header tag, no frontmatter title, output a warning
124
- console.log(`No frontmatter title property, or ${h_tags_to_search.join(', ')} tags detected in ${file_path.path}`);
124
+ console.log(`[WARNING] No frontmatter title property, or ${h_tags_to_search.join(', ')} tags detected in ${file_path.path}`);
125
125
  }
126
126
 
127
127
  // Add the reading time
@@ -257,7 +257,7 @@
257
257
  doc_title = html_heading[0].children[0].data.trim();
258
258
  } else {
259
259
  // No header tag, no frontmatter title, output a warning
260
- console.log(`No frontmatter title property, or h1, h2 or h3 header tags detected in ${file_path}`);
260
+ console.log(`[WARNING] No frontmatter title property, or h1, h2 or h3 header tags detected in ${file_path.path}`);
261
261
  }
262
262
  }
263
263
 
@@ -387,8 +387,12 @@
387
387
  const logical_path = doc_path.replace(path.extname(doc_path), '');
388
388
  const bc_for_path = bc[logical_path];
389
389
  let bc_tags = '\n';
390
- for (let i = 0; i < bc_for_path.length - 1; i++) {
391
- bc_tags += `\t\t\t\t<li class="mt-0 nav-bar-item"><a href="${bc_for_path[i].link}" class="ps-0 pe-0 text-decoration-none">${bc_for_path[i].text}</a></li>\n`;
390
+ if (bc_for_path) {
391
+ for (let i = 0; i < bc_for_path.length - 1; i++) {
392
+ bc_tags += `\t\t\t\t<li class="mt-0 nav-bar-item"><a href="${bc_for_path[i].link}" class="ps-0 pe-0 text-decoration-none">${bc_for_path[i].text}</a></li>\n`;
393
+ }
394
+ } else {
395
+ console.log(`[WARNING] Path is not present in navigation items: ${logical_path}`);
392
396
  }
393
397
  bc_tags += '\t\t\t';
394
398
  wip_doc_header = wip_doc_header.replaceAll('{{breadcrumbs}}', bc_tags);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.8.17",
3
+ "version": "0.8.18",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {