require('source-map-support').install(); require('babel-plugin-transform-runtime'); import fs from 'fs-extra'; import { fileExtension, basename, dirname } from 'lib/path-utils.js'; import { _, setLocale, languageCode } from 'lib/locale.js'; import marked from 'lib/marked.js'; const headerHtml = ` Joplin - a free, open source, note taking and todo application with synchronisation capabilities

oplin

A free, open source, note taking and todo application with synchronisation capabilities.

`; 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); });