Skip to content

LambdaDigamma/swift-prosemirror

Repository files navigation

ProseMirror

Swift

A native Swift implementation for parsing and rendering ProseMirror schema documents using SwiftUI.

Features
📝 Parse ProseMirror schema into type-safe Swift models
🎨 Render documents directly with SwiftUI (proof-of-concept)

Installation

Install swift-prosemirror with Swift Package Manager

dependencies: [
    .package(name: "ProseMirror", url: "https://github.com/lambdadigamma/swift-prosemirror", .upToNextMajor(from: "0.0.7")),
    ...
]

Documentation

Parsing ProseMirror schema with the build-in parser to retrieve a type-safe parsed document:

import ProseMirror

let proseMirrorInput = "..."

let parser = Parser()
let document = try parser.parse(proseMirrorInput)

You can render a document to a SwiftUI View using:

document.render()

Currently Supported Elements

  • Text
  • Hard Break
  • Paragraph
  • Links
  • Headline (Level 1 to 3)
  • Blockquote
  • Unordered List (disk and dash)

Roadmap

  • Support all default mark types
  • Support links with actions
  • Implement ability to customize styling
  • Make it easily extendable
  • Headlines in ordered and unordered lists

Changelog

Please see CHANGELOG.md for more information what has changed recently.

Contributing

Contributions are always welcome!

License

swift-prosemirror is available under the MIT license. See the LICENSE.md file for more info.

About

Parse and display prosemirror schema with Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages