The engine · formatter_v2
Traditional formatters look at font names. BookForge360 looks at intent — running each paragraph through a six-stage semantic pipeline before a single glyph hits the page.
§ 01 — The classifier
Six stages, each falling through to the next if inconclusive. By the time the renderer sees a block, it has been evaluated against label patterns, Word styles, workbook heuristics, shape signals, sequence context, and colon-intro list runs.
High-confidence regex table catches Chapter/Part labels (digits, Roman numerals, and spelled-out numbers 1-99), named callouts (RN Insight, Bedside Example), and front/back-matter markers.
Heading 1-3 styles combined with a ≤12-word length ceiling classify short paragraphs as chapter titles or section headings — even when the label pattern misses.
Reflection prompts, exercises, and generic callouts caught by lead-phrase heuristics — before falling through to body paragraph.
Short (2-8 words) title-case standalone paragraphs get promoted to SECTION_HEADING even when the source lacks any Word Heading styling.
Neighbour context refines borderline classifications, catching TOC blocks, back-matter transitions, and stray label ambiguity.
Body paragraphs ending in ':' followed by 2+ short single-sentence lines get promoted to BULLET_ITEM — 768 bullets promoted in a single 22-chapter manuscript run.
§ 02 — Typography spec
This is how a masterfully formatted page looks. The first paragraph drops indent entirely after headings — a classic trade convention that gives readers a clean visual reset at every section break.
Every paragraph following has a 1.25em first-line indentation applied seamlessly by the compiler. Line height sits at a golden 1.4 ratio for optimal readability across print and screen.
After the callout, the body prose continues with its standard indent — the aside floats inside the reading flow without breaking rhythm.
§ 03 — Container callouts
RN Insights, Bedside Examples, and any custom named callout wrap into styled aside blocks with soft grey backdrops and elegant left-border rules. Page-break-inside: avoid keeps them from splitting mid-container across page turns.
page-break-inside: avoid keeps every callout intact across page turns in the PDF export.
The same aside renders as a Quote-styled paragraph in DOCX and a themed div in EPUB — one source, three formats.
Bullet lists, sub-headings, and inline images all render inside the callout body while staying inside the aside.