// Mobile // | //// Command line // | //
---|---|
// // | //
//
// joplin:/My notebook$ ls -n 12
// [ ] 8am conference call ☎
// [ ] Make vet appointment
// [ ] Go pick up parcel
// [ ] Pay flat rent 💸
// [X] Book ferry 🚢
// [X] Deploy Joplin app
// Open source stuff
// Swimming pool time table 🏊
// Grocery shopping list 📝
// Work itinerary
// Tuesday random note
// Vacation plans ☀
//
// |
//
' + tocHtml_ + '
';
return tocHtml_;
}
function renderMdToHtml(md, targetPath, params) {
// Remove the header because it's going to be added back as HTML
md = md.replace(/# Joplin\n/, '');
params.baseUrl = 'https://joplin.cozic.net';
params.imageBaseUrl = params.baseUrl + '/images';
params.tocHtml = tocHtml();
const html = Mustache.render(markdownToHtml(md), params);
fs.writeFileSync(targetPath, html);
}
function renderFileToHtml(sourcePath, targetPath, params) {
const md = fs.readFileSync(sourcePath, 'utf8');
return renderMdToHtml(md, targetPath, params);
}
function makeHomePageMd() {
let md = fs.readFileSync(rootDir + '/README.md', 'utf8');
md = md.replace(tocRegex_, '');
return md;
}
async function main() {
tocMd();
renderMdToHtml(makeHomePageMd(), rootDir + '/docs/index.html', {});
renderFileToHtml(rootDir + '/readme/changelog.md', rootDir + '/docs/changelog/index.html', {});
renderFileToHtml(rootDir + '/readme/clipper.md', rootDir + '/docs/clipper/index.html', {});
renderFileToHtml(rootDir + '/readme/debugging.md', rootDir + '/docs/debugging/index.html', {});
renderFileToHtml(rootDir + '/readme/desktop.md', rootDir + '/docs/desktop/index.html', {});
renderFileToHtml(rootDir + '/readme/donate.md', rootDir + '/docs/donate/index.html', {});
renderFileToHtml(rootDir + '/readme/e2ee.md', rootDir + '/docs/e2ee/index.html', {});
renderFileToHtml(rootDir + '/readme/faq.md', rootDir + '/docs/faq/index.html', {});
renderFileToHtml(rootDir + '/readme/mobile.md', rootDir + '/docs/mobile/index.html', {});
renderFileToHtml(rootDir + '/readme/spec.md', rootDir + '/docs/spec/index.html', {});
renderFileToHtml(rootDir + '/readme/stats.md', rootDir + '/docs/stats/index.html', {});
renderFileToHtml(rootDir + '/readme/terminal.md', rootDir + '/docs/terminal/index.html', {});
}
main().catch((error) => {
console.error(error);
});