Repository navigation
GMSetzer v0.6.0
Pre-releaseGMSetzer 0.6.0
Source-only preview of the standalone Swift Markdown library, adding M6
progressive HTML output to 0.5.0. Requires Swift 6.2 or later. APIs may change
before 1.0. This release uses the accepted M6 implementation; M7 speed and
hardening changes are reserved for 0.7 development.
New since 0.5.0
HTMLRenderer.preparecreates complete-document rendering context and
structural groups without rendering their contents eagerly.HTMLRenderPlan.groups,renderGroup(at:)andforEachGroupsupport
on-demand output, reverse-order requests and early stopping. Consumers
control scheduling and how long emitted strings are retained.- Groups preserve whole top-level lists, tables, fences and custom containers,
with snapshot-local ordinals, node indices and original UTF-8 source ranges. - Global links, anchors and extension context remain shared across groups.
FootnotesHTMLRenderer.preparepreserves numbering/backlinks and emits a
deferred footnote appendix; composed M5 rendering remains supported. - Explicit whole-document fallbacks cover allowed raw HTML, root hooks and
document-order hooks. Independent hooks can opt into structural groups. - Throwing checkpoints provide cancellation during emission between renderer
events. Stopping consumption leaves later groups/hooks unrendered.
All 652 CommonMark and 672 pinned GFM examples remain protected. Existing
full-string rendering and M5 APIs remain available. The six SwiftPM products
continue to have no runtime dependencies or Foundation requirement in the
library. Parser/native-provider result identity is 0.6.0.
Swift Package Manager
.package(url: "https://github.com/kerker00/GMSetzer.git", exact: "0.6.0")Add .product(name: "GMSetzer", package: "GMSetzer") to the consuming target.
The version pin becomes resolvable when the tag is published. GitHub supplies
source ZIP/tar.gz downloads; no application or binary build asset is uploaded.
Prepare and consume
let document = MarkdownParser(profile: .gfm).parse(source)
let renderer = HTMLRenderer(includeSourceRanges: true)
let plan = try renderer.prepare(document, maximumSourceBytesPerGroup: 32_768)
try plan.forEachGroup { group, html in
consume(html, sourceRange: group.sourceRange)
return true // false stops before rendering the next group
}Use plan.mode to inspect structural versus whole-document fallback behavior.
Groups belong to that plan's immutable snapshot; consumers retain their own
revision/configuration checks. Independent hook mode is a caller promise about
determinism, ordering and self-contained markup, not automatic hook analysis.
Scope and limitations
The complete Markdown document is parsed before a plan exists. This does not
stream Markdown parsing or provide incremental edits. Preparation and individual
literals/hooks remain synchronous. The grouping budget is a soft source-byte
target, not an HTML-byte, time or memory ceiling; giant blocks stay indivisible.
Plans retain the full source/tree/context. No general peak-memory reduction,
bounded single-block latency or consumer UI/device result is promised.
M6 acceptance and its measured-snapshot limits are documented in
M6Acceptance
and ProgressiveHTML.
Historical timings belong to that snapshot; this identity-only release
preparation makes no fresh performance claim. General parser optimization,
real-M5/hostile-input scaling, broader fuzzing/sanitizers and M8 API/DocC/1.0
work remain separate.