Context. The .md backup (M7) is a write-only safety copy, not meant for
sharing. This is a real "compile for a reader" export, built directly from the
JSON canon — so, unlike the .md backup, paragraph alignment is not lost.
Scope
- New "Экспортировать рукопись" action (Story info view), compiling all
chapters (in chapterOrder) into one document.
- PDF: reuse the existing ProseMirror → HTML/text serialization approach
from ../src/main/markdown.ts as the base extraction of text + marks, map to
a standard-manuscript-format HTML template (readable serif font, double
spacing, page header with title/author/page number, scene dividers
centered), then render via Electron's webContents.printToPDF() from an
offscreen view.
- EPUB: needs a real EPUB-writing dependency (e.g.
epub-gen or similar —
Julia's call on which). Chapter-per-file, reflowable, no cover image in v1.
- Footnotes: render as endnotes per chapter (or a numbered list at chapter
end) rather than inline markers, for both formats.
- Check whether
StoryMeta/settings already carries an author name; if not,
add the field (Story info view) since manuscript format needs it in the header.
Out of scope v1: cover image upload, multiple format presets (e.g. Shunn
vs. house style) — ship one sensible default per format, defer presets.
Acceptance criteria
Context. The
.mdbackup (M7) is a write-only safety copy, not meant forsharing. This is a real "compile for a reader" export, built directly from the
JSON canon — so, unlike the
.mdbackup, paragraph alignment is not lost.Scope
chapters (in
chapterOrder) into one document.from
../src/main/markdown.tsas the base extraction of text + marks, map toa standard-manuscript-format HTML template (readable serif font, double
spacing, page header with title/author/page number, scene dividers
centered), then render via Electron's
webContents.printToPDF()from anoffscreen view.
epub-genor similar —Julia's call on which). Chapter-per-file, reflowable, no cover image in v1.
end) rather than inline markers, for both formats.
StoryMeta/settings already carries an author name; if not,add the field (Story info view) since manuscript format needs it in the header.
Out of scope v1: cover image upload, multiple format presets (e.g. Shunn
vs. house style) — ship one sensible default per format, defer presets.
Acceptance criteria
(bold/italic/strike), scene dividers, and footnotes correctly.
.mdbackup.produces an (expectedly thin) valid file or a clear "нечего
экспортировать" message.