Building and Distribution
Relevant source files
The following files were used as context for generating this wiki page:
The Writer project is a macOS application built using the SwiftUI framework and the Observation state management system. Building the application requires the Xcode development environment, while distribution is governed by the GNU General Public License version 3 (GPLv3). Beyond binary distribution, the application includes several modules dedicated to the distribution of user content via various export formats.
Sources: CLAUDE.md:1-12, LICENSE.md:1-10
Development Build Process
The application is structured as a standard macOS Xcode project. It utilizes Apple's Markdown framework for rendering and the Observation framework for state management across the application.
Build Requirements and Commands
To build the application for local development or debugging, developers utilize the following standard Xcode workflows:
| Action | Command / Shortcut | Description |
|---|---|---|
| Open Project | open Writer.xcodeproj | Opens the project in the Xcode IDE. |
| Build | Product -> Build (⌘B) | Compiles the Swift source code and links dependencies. |
| Run | Product -> Run (⌘R) | Launches the compiled binary on the macOS system. |
Sources: CLAUDE.md:10-18, Writer/WriterApp.swift:1-10
Legal Distribution (GPLv3)
The software is distributed under the GNU General Public License v3.0. This license ensures that all versions of the program remain free software for all users.
Terms of Conveyance
Under the GPLv3, "conveying" refers to any propagation that enables other parties to make or receive copies. Key requirements for distributing modified or verbatim copies include:
- Source Code Availability: The "Corresponding Source" must be made available when conveying object code forms. This includes all source code needed to generate, install, and run the object code.
- License Preservation: All copies must carry the original copyright notices and a copy of the GPLv3 license.
- Modification Notices: Modified versions must carry prominent notices stating that they have been altered and the date of change.
Sources: LICENSE.md:1-30, LICENSE.md:120-150, LICENSE.md:195-210
Content Distribution & Export Systems
Writer provides specialized modules for distributing user-created content into portable formats. These "Exporter" components transform the internal Markdown representation into standard distribution formats like HTML, PDF, and RTF.
Export Architecture
The export process follows a centralized pipeline where Markdown text is first processed by the MarkdownRenderer before being passed to specific format handlers.
The diagram shows the data flow from the central document state through the renderer to the various export utility classes.
Sources: Writer/WriterApp.swift:17-64, Writer/HTMLExporter.swift, Writer/PDFExporter.swift, Writer/RTFExporter.swift
Supported Distribution Formats
| Format | Component | Implementation Detail |
|---|---|---|
| HTML | HTMLExporter | Generates a standalone document with inline CSS derived from the PreviewTheme. |
PDFExporter | Uses a hidden WKWebView to render HTML, then utilizes webView.pdf() to generate US Letter (612x792pt) output. | |
| RTF | RTFExporter | Converts HTML to NSAttributedString and writes the resulting data as Rich Text Format. |
Sources: Writer/HTMLExporter.swift:8-15, Writer/PDFExporter.swift:11-25, Writer/RTFExporter.swift:9-15
Export Execution Flow
The WriterApp manages the UI-to-Logic bridge for distribution through asynchronous tasks that interact with NSSavePanel.
The sequence illustrates the interaction between the application's main entry point, the specific exporter utility, and the macOS system panels.
Sources: Writer/WriterApp.swift:17-64, Writer/HTMLExporter.swift:23-40
Conclusion
Building the Writer application is a standard Xcode-driven process. Distribution of the software itself is governed by the GPLv3, ensuring open access to the "Corresponding Source." For end-users, distribution of work is facilitated by a robust export system that leverages the MarkdownRenderer to produce HTML, PDF, and RTF files through asynchronous service classes.