hdoc-tools 0.8.15 → 0.8.17

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-build.js CHANGED
@@ -261,9 +261,6 @@
261
261
  }
262
262
  }
263
263
 
264
- // Remove the first <h1>title</h1> from the HTML as we'll ass that in the document header
265
- html_txt = html_txt.replace(/(<h1.*?>)\s*.*\s*(.*<\/h1>)/, '');
266
-
267
264
  // Does frontmatter tag contain a reading-time property
268
265
  if (!fm_contains_reading_time) {
269
266
  const read_time_mins = hdoc.get_html_read_time(html_txt);
@@ -275,9 +272,13 @@
275
272
  }
276
273
 
277
274
  // Get contributor data from Github, if exists
278
- if (hdocbook_config.publicSource && hdocbook_config.publicSource !== '') {
275
+ if (hdocbook_config.publicSource && hdocbook_config.publicSource !== '' && hdocbook_config.publicSource.includes('github.com/Hornbill-Docs')) {
276
+ // Remove the first <h1>title</h1> from the HTML as we'll add that in the document header
277
+ html_txt = html_txt.replace(/(<h1.*?>)\s*.*\s*(.*<\/h1>)/, '');
278
+
279
279
  const github_paths = hdoc.get_github_api_path(hdocbook_config.publicSource, file_path.relativePath);
280
280
  const contributors = hdoc.get_github_contributors(github_paths.api_path, git_token);
281
+
281
282
  if (!contributors.success) {
282
283
  console.log(`Error retrieving contributors from Github: ${contributors.error}`);
283
284
  } else {
@@ -305,11 +306,9 @@
305
306
  }
306
307
  }
307
308
 
308
- // Build doc header from template and frontmatter tags
309
- const doc_header = process_doc_header(fm_headers, file_path.relativePath);
310
-
309
+
311
310
  // Add frontmatter tags as comment to front of HTML
312
-
311
+
313
312
  let fm_header = '<!--[[FRONTMATTER\n';
314
313
  if (fm_headers.length > 0) {
315
314
  for (let i = 0; i < fm_headers.length; i++) {
@@ -317,8 +316,16 @@
317
316
  }
318
317
  }
319
318
  fm_header += ']]-->';
319
+
320
+ if (hdocbook_config.publicSource.includes('github.com/Hornbill-Docs')) {
321
+ // Build doc header from template and frontmatter tags
322
+ const doc_header = process_doc_header(fm_headers, file_path.relativePath);
323
+ html_txt = `${fm_header}\n${doc_header}\n${html_txt}`;
324
+ } else {
325
+ html_txt = `${fm_header}\n${html_txt}`;
326
+ }
320
327
 
321
- html_txt = `${fm_header}\n${doc_header}\n${html_txt}`;
328
+
322
329
 
323
330
  // Save HTML into HTML file
324
331
  const target_file = file_path.path.replace(path.extname(file_path.path), '.html');
package/hdoc.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  (function () {
4
4
  'use strict';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.8.15",
3
+ "version": "0.8.17",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {
package/LICENSE DELETED
@@ -1,21 +0,0 @@
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.