Something went wrong. Try again.
A local-first note taking app
Something went wrong. Try again.
TypeScript
123456789101112131415161718/** * Starting content for a note created by following a wikilink. * * A wikilink names the note the author meant to write, so that name is real * information — seeding it as an H1 saves retyping what you just typed, and * gives `useDocumentTitle` a heading to read. Notes created by "New File" are * left empty on purpose: their name is a placeholder (`Untitled`), so an * `# Untitled` heading would be noise the user has to delete. */import { stripMdExtension } from './paths';
export function initialNoteContent(fileName: string): string { const title = stripMdExtension(fileName).trim(); if (!title) return ''; // Trailing blank line so the cursor starts in the body, not on the heading. return `# ${title}\n\n`;}