Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/calebkleveter/SwiftMark
[⚠️Not a complete implementation] A Markdown renderer written in Swift.
https://github.com/calebkleveter/SwiftMark
cocoapods markdown markdown-parser pure-swift renderer spm swift
Last synced: 3 months ago
JSON representation
[⚠️Not a complete implementation] A Markdown renderer written in Swift.
- Host: GitHub
- URL: https://github.com/calebkleveter/SwiftMark
- Owner: calebkleveter
- License: mit
- Created: 2017-03-10T14:31:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-03T16:49:00.000Z (over 5 years ago)
- Last Synced: 2024-07-25T12:44:44.073Z (4 months ago)
- Topics: cocoapods, markdown, markdown-parser, pure-swift, renderer, spm, swift
- Language: Swift
- Homepage: https://calebkleveter.github.io/SwiftMarkSite/
- Size: 419 KB
- Stars: 77
- Watchers: 4
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwiftMark
[![Build Status](https://travis-ci.org/calebkleveter/SwiftMark.svg?branch=master)](https://travis-ci.org/calebkleveter/SwiftMark)
SwiftMark is a Markdown to HTML renderer built in Swift.
\#pureswift
## Usage
SwiftMark is a SwiftPM package (though versions 1.0.0 to 1.3.0 also work as a CocoaPod). Add this line to your dependencies array in your `Package.swift`:
```swift
Package(url: "https://github.com/calebkleveter/SwiftMark.git", majorVersion: 1)
```Using SwiftMark is very simple. Just create a renderer, call `render`, and pass in the Markdown text.
```swift
do {
let renderer = MarkdownRenderer()
let html = try renderer.render(markdownText)
} catch let rror {
print(error)
}
```The result of the `.render()` method is the HTML form of the Markdown text passed in.
## License
The whole SwiftMark package is under the MIT license agreement.
## Attribution
Thanks to @matthewcheok and his tutorial on [Writing a Lexer in Swift](http://blog.matthewcheok.com/writing-a-lexer-in-swift/).