https://github.com/snowy1803/pulsrmarkdown
A simple markdown parser, with support for ||spoilers|| (or >!spoilers!<)
https://github.com/snowy1803/pulsrmarkdown
ios swift swift-package swiftpackage uikit uikit-components
Last synced: 2 months ago
JSON representation
A simple markdown parser, with support for ||spoilers|| (or >!spoilers!<)
- Host: GitHub
- URL: https://github.com/snowy1803/pulsrmarkdown
- Owner: Snowy1803
- License: mit
- Created: 2021-04-18T15:47:09.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-03T18:15:47.000Z (almost 4 years ago)
- Last Synced: 2025-03-02T06:47:49.855Z (3 months ago)
- Topics: ios, swift, swift-package, swiftpackage, uikit, uikit-components
- Language: Swift
- Homepage:
- Size: 53.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# PulsrMarkdown
Provides a markdown to NSAttributedString lightweight converter. Requires UIKit, and works on iOS 13+, Mac Catalyst 13+ and watchOS 6+.
It also provides `UIView`s to show and edit markdown on iOS (with special support for spoilers).
Supports:
- bold, italic, underline, strikethrough, spoilers, code (inline)
- blockquotes, header titles, code (blocks)## Get started
If you want to use it with UIKit, `import PulsrMarkdownViews` and use `MarkdownEditorView(generator:)` to make an editable markdown text view, and `MarkdownRenderedTextView(generator:)` to show the result. You pass a generator, which include the set of `MarkdownRule` to apply (replacements and markdown attributes).
If you only need the UIKit-compatible `NSAttributedString` and want to implement the view yourself (or on watchOS), use `MarkdownGenerator.generate(string:)` (or `MarkdownGenerator.generate(string:tappedIds)` if you need spoiler support)