Swiftpack.co -  LambdaDigamma/swift-prosemirror as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
LambdaDigamma/swift-prosemirror
Parse and display prosemirror schema with Swift
.package(url: "https://github.com/LambdaDigamma/swift-prosemirror.git", from: "0.0.1")

ProseMirror

Swift

A ProseMirror schema parser and renderer written in Swift using SwiftUI to render a document

This package ships with a parser which generates type-safe documents that can directly be rendered using the build-in SwiftUI renderer. Rendered documents can also be styled with

Installation

Install swift-prosemirror with Swift Package Manager

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

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
  • Headline (Level 1 to 3)
  • Blockquote
  • Unordered List (disk and dash)
  • CodeBlock

Roadmap

  • ☐ Support all default mark types
  • ☐ Support links with actions
  • ☐ Implement ability to customize styling
  • ☐ Make it easily extendable

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.

GitHub

link
Stars: 2
Last commit: 2 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API