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 +23 -19
- package/hdoc-serve.js +8 -1
- package/package.json +1 -1
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
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
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
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
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);
|