'use strict'; // First-run content for an empty notes folder. const fsp = require('node:fs').promises; const path = require('node:path'); const { today } = require('./vault.cjs'); const GETTING_STARTED = `Everything here is plain Markdown in this folder. No account, no sync, nothing leaves this computer. A quiet place to write. Pages nest like folders, tags live in each file's front matter, and search runs against a local index. ## Write the way you think - Type \`/\` on any line to add a heading, to-do, quote, toggle or code block. - Start a line with \`#\`, \`-\`, \`[]\`, \`>\` or three backticks and it turns into that block as you type. - Hover a block and drag the handle on its left to move it. - Press Ctrl K to search every note or run a command. ## First steps - [x] Pick a folder for your notes - [ ] Write one page, however short - [ ] Try the light theme from the switch in the sidebar
Where do my files actually live? Each page is a \`.md\` file in this folder. A page with sub-pages gets a folder of the same name. The search index sits in \`.notes/index.sqlite\`; delete it any time and it rebuilds on launch.
> Notes are for thinking, not for filing. `; async function isEmpty(dir) { try { const entries = await fsp.readdir(dir); return entries.filter((n) => !n.startsWith('.')).length === 0; } catch (err) { if (err.code === 'ENOENT') return true; throw err; } } async function seedVault(dir) { await fsp.mkdir(dir, { recursive: true }); const fm = `---\nicon: sparkle\ncover: blush\ntags: [guide]\ncreated: ${today()}\n---\n\n`; await fsp.writeFile(path.join(dir, 'Getting started.md'), fm + GETTING_STARTED, 'utf8'); } module.exports = { isEmpty, seedVault, GETTING_STARTED };