swift-markdown

0.50800.0

A Swift package for parsing, building, editing, and analyzing Markdown documents.
SDGGiesbrecht/swift-markdown

What's New

Swift 5.8

2023-04-10T05:04:35Z

This release corresponds to Swift 5.7, which has no tagged semantic version upstream (yet).

The following minor modifications have been made:

  • Dependency version requirements have been adjusted:
    • The cmark dependency has been redirected to a fork with tagged a semantic version of its own, since it also has no upstream version available.
    • Several other dependencies which were already pointing at semantic versions have had their requirements loosened from .upToNextMinor(from: x) to from: x.

Swift Markdown

Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

The parser is powered by GitHub-flavored Markdown's cmark-gfm implementation, so it follows the spec closely. As the needs of the community change, the effective dialect implemented by this library may change.

The markup tree provided by this package is comprised of immutable/persistent, thread-safe, copy-on-write value types that only copy substructure that has changed. Other examples of the main strategy behind this library can be seen in Swift's lib/Syntax and its Swift bindings, SwiftSyntax.

Getting Started Using Markup

In your Package.swift Swift Package Manager manifest, add the following dependency to your dependencies argument:

.package(url: "https://github.com/apple/swift-markdown.git", .branch("main")),

Add the dependency to any targets you've declared in your manifest:

.target(name: "MyTarget", dependencies: ["Markdown"]),

To parse a document, use Document(parsing:), supplying a String or URL:

import Markdown

let source = "This is a markup *document*."
let document = Document(parsing: source)
print(document.debugDescription())
// Document
// └─ Paragraph
//    ├─ Text "This is a markup "
//    ├─ Emphasis
//    │  └─ Text "document"
//    └─ Text "."

Please see Swift Markdown's documentation site for more detailed information about the library.

Getting Involved

Submitting a Bug Report

Swift Markdown tracks all bug reports with GitHub Issues. You can use the "Swift-Markdown" component for issues and feature requests specific to Swift Markdown. When you submit a bug report we ask that you follow the Swift Bug Reporting guidelines and provide as many details as possible.

Submitting a Feature Request

For feature requests, please feel free to file a GitHub issue or start a discussion on the Swift Forums.

Don't hesitate to submit a feature request if you see a way Swift Markdown can be improved to better meet your needs.

Contributing to Swift Markdown

Please see the contributing guide for more information.

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

Last updated: Fri Apr 26 2024 02:30:10 GMT-0900 (Hawaii-Aleutian Daylight Time)