Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perfectlysoft/perfect-markdown
A solution to convert markdown text into html presentation in Swift, based on GerHobbelt's "upskirt" project.
https://github.com/perfectlysoft/perfect-markdown
html markdown swift
Last synced: 1 day ago
JSON representation
A solution to convert markdown text into html presentation in Swift, based on GerHobbelt's "upskirt" project.
- Host: GitHub
- URL: https://github.com/perfectlysoft/perfect-markdown
- Owner: PerfectlySoft
- License: apache-2.0
- Created: 2017-03-08T18:19:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-12-30T14:45:41.000Z (almost 4 years ago)
- Last Synced: 2024-10-04T20:01:59.724Z (about 1 month ago)
- Topics: html, markdown, swift
- Language: Swift
- Size: 79.1 KB
- Stars: 41
- Watchers: 7
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Perfect-Markdown [įŽäŊä¸æ](README.zh_CN.md)
This project provides a solution to convert markdown text into html presentations.
This package builds with Swift Package Manager and is part of the [Perfect](https://github.com/PerfectlySoft/Perfect) project but can also be used as an independent module.
## Acknowledgement
Perfect-Markdown is directly building on [GerHobbelt's "upskirt"](https://github.com/GerHobbelt/upskirt) project.
## Swift Package Manager
Add dependencies to your Package.swift
``` swift
.package(url: "https://github.com/PerfectlySoft/Perfect-Markdown.git",
from: "3.0.0")// on target section:
.target(
// name: "your project name",
dependencies: ["PerfectMarkdown"]),
```## Import Perfect Markdown Library
Add the following header to your swift source code:
``` swift
import PerfectMarkdown
```## Get HTML from Markdown Text
Once imported, a new String extension `markdownToHTML` would be available:
```
let markdown = "# some blah blah blah markdown text \n\n## with mojo đ¨đŗ đ¨đĻ"guard let html = markdown.markdownToHTML else {
// conversion failed
}//end guardprint(html)
```## Further Information
For more information on the Perfect project, please visit [perfect.org](http://perfect.org).