`;
const footerHtml = `
Copyright (c) 2017 Laurent Cozic
`;
const screenshotHtml = `
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 ☀️
|
`;
const gaHtml = `
`;
const rootDir = dirname(dirname(__dirname));
function markdownToHtml(md) {
const renderer = new marked.Renderer();
// Remove the header because it's going to be added back as HTML
md = md.replace(/# Joplin/, '');
let output = marked(md, {
gfm: true,
break: true,
renderer: renderer,
});
output = output.replace(//, screenshotHtml);
return headerHtml + output + gaHtml + footerHtml;
}
async function main() {
const md = fs.readFileSync(rootDir + '/README.md', 'utf8');
const html = markdownToHtml(md);
fs.writeFileSync(rootDir + '/index.html', html);
}
main().catch((error) => {
console.error(error);
});