Skip to content

SwiftDocuments 1.1.0

Latest

Choose a tag to compare

@nanbu nanbu released this 23 Oct 11:03

SwiftDocuments 1.1.0 adds Markdown subset reading and basic document writing.

  • Read UTF-8 Markdown headings, paragraphs, strong/emphasis, inline code and links, simple lists and fenced code through the new DocumentMarkdown product or the umbrella. Byte inputs require format: .markdown; .md / .markdown URL inputs are recognized without overriding ZIP/OLE signatures. Unsupported constructs remain literal source with warnings.
  • Save basic DOCX, DOCM and ODT documents with paragraphs, basic character formatting, paragraph alignment and outline levels, simple lists, external hyperlinks, tables and basic metadata. Modern Pages writing supports body text, Unicode, paragraphs, tabs and line/page breaks using a sanitized producer-created template.
  • Use sync/async Document.write or CodecSet.write with WriteOptions, generated bytes and aggregated WriteWarnings. Local saves serialize completely before an atomic replacement. strict: true refuses diagnosed writing losses before saving. Body graphs are preflighted for structural/work limits before serialization.
  • Convert documents with swiftdoc convert input.md output.docx (also DOCM, ODT and Pages).
  • Read ODT single/double underline types alongside their explicit styles. Includes specification-based tests, updated API reference and reproducible template/package verification tooling.

Support boundaries

Basic writers regenerate packages from the supported model subset. They do not preserve source images/assets, VBA, signatures, unknown XML, related stories, revision history or advanced formatting. These losses produce warnings; Pages tables, links and formatting become text. ODT inline page/column breaks and nested list levels use diagnosed fallbacks. Markdown writing, lossless package editing, rendering/layout and decryption remain outside this release. See the support table and specification.

Compatibility

DocumentFormat.markdown and the new DocumentError cases require consumers with exhaustive switches to add cases or a default branch. Existing reading-only custom codecs remain source-compatible through the default writing implementation. Requires Swift 6.2+, macOS 14+ or iOS 17+, with system zlib and no external Swift package dependencies. iOS device/simulator execution is not claimed.

Install

.package(url: "https://github.com/nanbu/SwiftDocuments.git", from: "1.1.0")

See the API reference, cookbook and changelog.

Verification

  • The release commit passed macOS and Linux CI, including Swift 6.2.4 and 6.4.1 on Linux. Local macOS validation passed 277 tests and a release build.
  • API reference generation and GitHub Pages deployment passed; the live reference includes the new public API.
  • Generated DOCX/DOCM/ODT were independently read with LibreOffice. The modern Pages body-text probe was opened and checked in Pages Creator Studio 15.4 on macOS. ZIP CRC and package structure checks passed for all generated formats.
  • A fresh SwiftPM consumer resolved the public 1.1.0 tag to the release commit and successfully read Markdown and wrote/read DOCX, DOCM, ODT and Pages body text.