Repository navigation
Releases: nanbu/SwiftDocuments
Release list
SwiftDocuments 1.1.0
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
DocumentMarkdownproduct or the umbrella. Byte inputs requireformat: .markdown;.md/.markdownURL 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.writeorCodecSet.writewithWriteOptions, generated bytes and aggregatedWriteWarnings. Local saves serialize completely before an atomic replacement.strict: truerefuses 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.0tag to the release commit and successfully read Markdown and wrote/read DOCX, DOCM, ODT and Pages body text.
SwiftDocuments 1.0.0
SwiftDocuments 1.0.0 stabilizes the documented reading API for Swift applications.
- Read DOCX/DOCM into format-neutral, Sendable document values, with explicit warnings and access to original parts.
- Inspect packages, scan body blocks, retrieve lazy assets and source XML, and use concurrent async reads or bounded batches.
- Read documented subsets of ODT and modern Pages. Advanced semantics remain partial or raw-only as stated in the support table.
- Use consistent format selection for Data and URL inputs, individual codec products or the umbrella, following SwiftSheets' API conventions.
- Includes fictional producer fixtures, English guides, a generated API inventory and an executable example.
Requires Swift 6.2+, macOS 14+ or iOS 17+. Linux requires system zlib. No external Swift package dependencies.
Writing, conversion, page rendering, legacy DOC and decryption are outside this release. Version 1.0 does not imply complete interpretation of every Office/ODF/Pages element. iOS compilation is verified; device/simulator execution is not yet verified.
Install with .package(url: "https://github.com/nanbu/SwiftDocuments.git", from: "1.0.0").
See the API reference, reading specification and changelog.