Skip to content
CAI
Software that uses CAICheck a score

swiftlang/swift-markdown

57.1

Adequate · 30 September 2026

8.6k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Swift Markdown is a library for parsing, representing, and formatting Markdown content in Swift. It provides core parsing capabilities that support standard Markdown syntax, inline attributes, and Doxygen commands, while offering formatters to convert markup trees into HTML. The system includes a command-line tool for these conversions and is built using CMake to support multiple platforms and architectures.

Features

Added Swift code snippets for Markdown API usage

Added a collection of Swift code examples in the Snippets directory demonstrating how to use the Markdown library. These include formatting options (such as autolinks, line prefixes, emphasis markers, and list styles), parsing documents from strings or files, querying the markup tree, rewriting elements, and converting to XML.

Snippets · high confidence

New HTML conversion tool and Doxygen parsing support in markdown-tool

The markdown-tool now includes a new 'print-html' command that converts Markdown content into HTML, supporting options to parse block quotes as asides and inline attributes as classes. Additionally, the tool adds experimental support for parsing a minimal set of Doxygen commands via the '--experimental-parse-doxygen-commands' flag in the dump-tree command. Under the hood, UTF-8 decoding has been modernized to use Swift's 'String(decoding:as:)' initializer, and the tool's entry point has been updated to use the '@main' attribute.

Tools · high confidence

Swift Markdown adds Doxygen command support and HTML formatting

Swift Markdown now parses and represents Doxygen commands (\\abstract, \\discussion, \\note, \\param, and \\returns) as structured markup nodes, allowing them to be processed alongside standard Markdown. An HTML formatter has been added to convert markup trees into HTML, including support for parsing blockquotes as asides and handling inline attributes. The library also introduces custom inline attributes, allows unnamed first arguments in block directive syntax, and marks core types as Sendable for thread safety.

Sources · high confidence

Behavioural changes

Automated documentation publishing and enhanced source code validation

A new script, bin/update-gh-pages-documentation-site, has been added to automate the generation and deployment of documentation to the GitHub Pages site using Swift Package Manager's DocC tooling. Additionally, the bin/check-source script now validates license headers in Swift snippet files, excludes Tools/.build from checks, and accepts copyright years through 2025.

bin · high confidence

Introduce CMake-based build system with expanded architecture support

The project now uses CMake for building, replacing the previous build method. This change adds support for several new architectures, including RISC-V 64-bit (riscv64), FreeBSD powerpc64le and powerpc64, and Windows ARM64, by recognizing these processors in the build configuration. It also refines how build-tree exports are handled, ensuring that SwiftMarkdown targets are only exported when it is the top-level project to avoid dragging in unnecessary transitive dependencies for subprojects. Additionally, the build system now correctly handles Swift module installation for non-Darwin platforms.

cmake · high confidence

Migration to swiftlang organization and addition of CMake build system

Swift Markdown has moved to the swiftlang GitHub organization, updating all repository URLs and dependency references (such as swift-syntax and swift-markdown) from the previous apple/swift-markdown location. The project now supports building via CMake (minimum version 3.29) in addition to Swift Package Manager, introducing a new build configuration that fetches dependencies like ArgumentParser and cmark-gfm. Documentation and contributing guides have been updated to reflect the new GitHub Issues workflow and point to the new documentation site, while the README has been streamlined to remove detailed API examples in favor of external documentation links.

(repo-wide) · high confidence

Test coverage

Expanded test coverage for Markdown parsing and formatting

Added and updated tests in the test suite to verify correct behavior across several areas: source location tracking for non-ASCII characters, inline attributes (including JSON5 support), backtick parsing in code voice, Doxygen command parsing (discussion, abstract, note, param, returns), HTML formatting (including asides and tables), MarkupVisitor primary associated types, table cell spans, hard line breaks, autolinks, link titles, multiline symbol links, aside conversion strategies, block directive arguments, and metadata consistency for child nodes.

Tests · high confidence

Dependencies

Swift 6.2 upgrade and dependency restructuring

The project upgrades its minimum Swift version to 6.2 and updates the \swift-cmark\ dependency URL to the \swiftlang\ organization. The \swift-argument-parser\ dependency is removed from the main library, and a new \Tools\ package is introduced to provide a standalone \markdown-tool\ executable that includes this parser. Additionally, the main package now conditionally includes the \swift-docc-plugin\ for Swift 5.6+ environments and excludes \CMakeLists.txt\ from the Markdown target.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 56 → 57 (+1.1)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 93 → 93 (-0.3)
  • Architecture 100 → 93 (-6.8)
  • Maturity 54 → 54 (+0.5)
  • Readiness 32 → 38 (+5.4)
  • Security 100 → 100 (+0.0)

Resolved (4)

  • Documentation: no contributor guidance (README.md)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Hotspot: Sources/Markdown/Parser/CommonMarkConverter.swift (Sources/Markdown/Parser/CommonMarkConverter.swift)

New (14)

  • Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established
  • Duplicated block (6 lines × 3) (Sources/Markdown/Block Nodes/Block Container Blocks/ListItem.swift)
  • Duplicated block (6 lines × 3) (Sources/Markdown/Inline Nodes/Inline Containers/Emphasis.swift)
  • Duplicated block (6 lines × 4) (Sources/Markdown/Block Nodes/Leaf Blocks/CodeBlock.swift)
  • Duplicated block (6 lines × 4) (Sources/Markdown/Block Nodes/Leaf Blocks/CodeBlock.swift)
  • Floating branch dependency: swift-cmark
  • Inconsistent naming for index-based access. The method child(at:) uses the standard Swift collection accessor pattern, while child(through:) is used for path-based or range-based access. This creates a confusing API surface where accessing a single child by index has a different verb than accessing via a path or element, despite both being retrieval operations.
  • Low coverage: Sources/Markdown/Infrastructure/Replacement.swift (Sources/Markdown/Infrastructure/Replacement.swift)
  • Low coverage: Sources/Markdown/Inline Nodes/Inline Containers/Strikethrough.swift (Sources/Markdown/Inline Nodes/Inline Containers/Strikethrough.swift)
  • Low coverage: Sources/Markdown/Structural Restrictions/BasicInlineContainer.swift (Sources/Markdown/Structural Restrictions/BasicInlineContainer.swift)
  • Low coverage: Sources/Markdown/Utility/CharacterExtensions.swift (Sources/Markdown/Utility/CharacterExtensions.swift)
  • Low coverage: Sources/Markdown/Utility/StringExtensions.swift (Sources/Markdown/Utility/StringExtensions.swift)
  • No Package.resolved committed (Tools/Package.swift)
  • Projects may be oversized for their cohesion

Changes since last survey

  • 1 commits — 1 feature/other, 0 fixes

By area

  • (root) — 1 commit

Notable commits

  • change: Update minimum CMake version to 3.29 (#293)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

swiftlang/swift-markdown was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 392b73b858efe3dacec0e8a91c6e7fd19af0bb98 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.