Add Wiki.js markdown export option

This commit is contained in:
2026-06-15 13:59:04 -05:00
parent ab280daf63
commit 8cc1ba3532
12 changed files with 207 additions and 93 deletions
+26
View File
@@ -0,0 +1,26 @@
'use strict';
const { DEFAULT_TEMPLATE, renderMarkdownGuide } = require('./markdown-guide');
/**
* Wiki.js markdown exporter. Same step/body structure as the generic
* Markdown exporter, but omits the manual Contents section by default and
* emits Wiki.js-friendly callout blocks.
*/
const WIKIJS_TEMPLATE = {
toc: false,
includeImages: true,
imageMaxWidth: 0,
};
function exportWikiJs(ast, outDir, template = {}) {
return renderMarkdownGuide(ast, outDir, template, {
defaults: WIKIJS_TEMPLATE,
alertStyle: 'wikijs',
tocTitle: 'Contents',
fileExt: '.md',
});
}
module.exports = { exportWikiJs, DEFAULT_TEMPLATE: WIKIJS_TEMPLATE };