hdoc-tools 0.14.0 → 0.14.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/hdoc-build.js CHANGED
@@ -268,15 +268,17 @@
268
268
  else
269
269
  html_txt = `${fm_header_content}\n${doc_header}\n${html_txt}`;
270
270
 
271
- index_records.push({
272
- relative_path: file_path.relativePath,
273
- index_html: hdoc_index.transform_html_for_index(html_txt),
274
- metadata: metadata,
275
- contributors: contribs,
276
- pdf_size: pdf_size,
277
- md5: file_path.hash,
278
- lastmod: last_commit !== null ? last_commit : file_path.hb_lastmod
279
- });
271
+ if (!inline_content) {
272
+ index_records.push({
273
+ relative_path: file_path.relativePath,
274
+ index_html: hdoc_index.transform_html_for_index(html_txt),
275
+ metadata: metadata,
276
+ contributors: contribs,
277
+ pdf_size: pdf_size,
278
+ md5: file_path.hash,
279
+ lastmod: last_commit !== null ? last_commit : file_path.hb_lastmod
280
+ });
281
+ }
280
282
  // Save HTML into HTML file
281
283
  try {
282
284
  fs.writeFileSync(file_path.path, html_txt);
@@ -508,16 +510,18 @@
508
510
  console.log('Error writing:', target_file, '\n', err);
509
511
  }
510
512
 
511
- const index_details = hdoc_index.transform_html_for_index(html_txt);
512
- index_records.push({
513
- relative_path: relative_path,
514
- index_html: index_details,
515
- metadata: metadata,
516
- contributors: contribs,
517
- pdf_size: pdf_size,
518
- md5: file_path.hash,
519
- lastmod: last_commit !== null ? last_commit : file_path.hb_lastmod
520
- });
513
+ if (!inline_content) {
514
+ const index_details = hdoc_index.transform_html_for_index(html_txt);
515
+ index_records.push({
516
+ relative_path: relative_path,
517
+ index_html: index_details,
518
+ metadata: metadata,
519
+ contributors: contribs,
520
+ pdf_size: pdf_size,
521
+ md5: file_path.hash,
522
+ lastmod: last_commit !== null ? last_commit : file_path.hb_lastmod
523
+ });
524
+ }
521
525
 
522
526
  // Add MD file to delete queue
523
527
  md_files_delete.push(file_path.path)
package/hdoc-serve.js CHANGED
@@ -242,7 +242,6 @@
242
242
  send_file(req, res, file_path);
243
243
  return true;
244
244
  }
245
-
246
245
  if (fs.existsSync(file_path.replace('.html', '.md'))) {
247
246
  if (transform_markdown_and_send_html(req, res, file_path.replace('.html', '.md'))) {
248
247
  return;
@@ -278,6 +277,14 @@
278
277
  res.setHeader('Content-Type', 'text/html');
279
278
  send_content_file(req, res, path.join(file_path + '/index.html'));
280
279
  return;
280
+ } else if (fs.existsSync(path.join(file_path + '.html'))) {
281
+ res.setHeader('Content-Type', 'text/html');
282
+ send_content_file(req, res, path.join(file_path + '.html'));
283
+ return;
284
+ } else if (fs.existsSync(path.join(file_path + '.htm'))) {
285
+ res.setHeader('Content-Type', 'text/html');
286
+ send_content_file(req, res, path.join(file_path + '.htm'));
287
+ return;
281
288
  }
282
289
  } else if (fs.existsSync(file_path)) {
283
290
  send_file(req, res, file_path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {