Repository navigation
2.7.0
Footnotes stay with their chapter, number from 1 in each block of notes, and with --footnotes can go at the end of the document or at the foot of the PDF page. EPUBs gain footnotes, nested tables of contents, subtitles, clickable citations and navigation labels in the book's language, and --smart sets typographic quotes, dashes and ellipses.
Footnotes in HTML and PDF (render)
- Notes stay where the source puts them (#158, #160). Footnote definitions are no longer all moved to the end of the document, so each chapter's notes follow that chapter. A document that defines all its notes at the end still gets endnotes.
- Numbering restarts with each block of notes (#167, #169). With several definition blocks, each starts again at 1 ([1] [2] in chapter 1, [1] in chapter 2), as in EPUB output. A single trailing block keeps one count.
--footnotes section|end|page(#168, #175, #176, #177, #181).section, the default, is the placement above.endgathers every note in one block at the end of the document, numbered continuously.pageputs each note at the foot of the PDF page that holds its reference: a block that doesn't fit is split into its child blocks or at the last word break that still fits with its notes (keeping two lines either side), a heading moves to the next page with the text after it, and a note too long for the page continues at the foot of the next one.pageneeds the WebKit engine; with--engine swiftthe notes stay at the end of their section and a warning is printed. A table, code block or image taller than a page still runs over the page break.
EPUB
- Footnotes (#156, #164, #165, #170).
[^id]references become EPUB 3 noterefs. Each chapter file collects its notes in a footnotes section after a separator rule, numbered per chapter, and each note starts with its number as a link back to the reference. The default stylesheet styles the notes and declares theepubnamespace, so--csscan target them. - Nested tables of contents with
--toc-depth(#166, #174). Sub-headings up to that many levels below--chapter-levelare listed under each chapter, in the EPUB 3 nav and in the NCX. The default, 0, leaves books unchanged. Chapter entries now link to the chapter file without a fragment. --subtitle(#178, #180). Shown on the title page between the title and the author, and written to the package metadata as a second title marked as the subtitle.--link-citations(#154, #173). Citation links now work in EPUBs too, as cross-file links (ch003.xhtml#citation-1) when the reference list is in another chapter. DOCX and Pages output print a warning that the flag has no effect there.- Navigation labels follow
--language(#155, #163). The nav page title and the landmark labels (Cover, Title Page, Table of Contents, Beginning) come out in German, French, Spanish, Italian, Dutch or Portuguese for a book in that language;de-ATcounts asde, and other languages fall back to English. - TOC labels no longer run into the next heading (#153, #161). "Teil 1: Wo Sie stehen" is no longer followed by ": Was in der Akte steht"; the sub-heading stays in the chapter. Headings that are only a number label ("1", "Chapter 1", "IV") still take the sub-heading after them.
Typographic punctuation (render --smart)
- Opt-in
--smart(#179, #182). Straight quotes and apostrophes become curly ones in the style of--language(“…” foren, „…“ forde, «…» forfr),--becomes –,---becomes — and...becomes …, in HTML, PDF, EPUB, DOCX and Pages output. Code, URLs, link targets, raw HTML, heading ids and[^id]/[n]markers stay as typed, and characters that are already typographic are left alone.
Fixes
- No blank first page with
--page-break-before(#159, #162). A document that opens with a heading of that level no longer starts with an empty page; later headings still start a new page. - WebKit loads no longer time out intermittently (#171, #172). WebKit throttles timers in an off-screen web view, so the page-capture fallback could fail to fire and a paginated PDF render waited out the whole timeout. The fallback now runs on a Swift timer. A navigation that hasn't committed after 15 s is retried once on a fresh web view, within the same overall timeout, and a timeout error names the load phase that stalled.
render --helpnow names thecitation-nanchor that--link-citationswrites (#151).
API
SmartPunctuation.apply(to:language:).SwiftMarkdownHTMLRenderer.Options.footnotesAtEnd(also onMarkdownToHTML.Options), and acitationFiles:parameter onSwiftMarkdownHTMLRenderer.convert(document:options:citationNumbers:citationFiles:).EpubOptions.tocDepthand.linkCitations, with matchinginitparameters;EpubMetadata.subtitle.WebKitLoadProgress.WebKitBrowserError.timedOutnow carries it astimedOut(seconds:progress:): code that binds the associated values needs the new label, whilecase .timedOut = errorstill matches.