All Projects → EFPrefix → Efmarkdown

EFPrefix / Efmarkdown

Licence: wtfpl
DEPRECATED

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Efmarkdown

Sublimetutor
An interactive in-editor keyboard shortcuts tutorial for Sublime Text 3
Stars: ✭ 336 (-9.19%)
Mutual labels:  markdown
Markdown Preview Plus
Markdown Preview + Community Features
Stars: ✭ 350 (-5.41%)
Mutual labels:  markdown
Insane
😾 Lean and configurable whitelist-oriented HTML sanitizer
Stars: ✭ 360 (-2.7%)
Mutual labels:  markdown
Pico
Pico is a stupidly simple, blazing fast, flat file CMS.
Stars: ✭ 3,494 (+844.32%)
Mutual labels:  markdown
Markup.rocks
Pandoc based document editor and converter in your browser.
Stars: ✭ 348 (-5.95%)
Mutual labels:  markdown
Githuber Md
Markdown editor plugin for WordPress.
Stars: ✭ 353 (-4.59%)
Mutual labels:  markdown
Stackedit
In-browser Markdown editor
Stars: ✭ 18,744 (+4965.95%)
Mutual labels:  markdown
Richtext
Android平台下的富文本解析器,支持Html和Markdown
Stars: ✭ 3,715 (+904.05%)
Mutual labels:  markdown
Marcdown
👻 Lightweight realtime markdown viewer and editor - Simple, clean and beautiful https://liyasthomas.github.io/marcdown
Stars: ✭ 345 (-6.76%)
Mutual labels:  markdown
For Editor
for-editor - A markdown editor based on React
Stars: ✭ 358 (-3.24%)
Mutual labels:  markdown
Prettydoc
Creating Pretty HTML From R Markdown
Stars: ✭ 338 (-8.65%)
Mutual labels:  markdown
J
❌ Multi-format spreadsheet CLI (now merged in http://github.com/sheetjs/js-xlsx )
Stars: ✭ 343 (-7.3%)
Mutual labels:  markdown
Marky
A markdown editor built with Electron and React
Stars: ✭ 355 (-4.05%)
Mutual labels:  markdown
Markdown Loader
markdown loader for webpack
Stars: ✭ 335 (-9.46%)
Mutual labels:  markdown
Notes
✎ Distraction-free notes and writing
Stars: ✭ 363 (-1.89%)
Mutual labels:  markdown
Restapidocs
Templates for documenting REST APIs
Stars: ✭ 327 (-11.62%)
Mutual labels:  markdown
Liandi
📕 一款桌面端的 Markdown 块级引用和双向链接笔记应用,支持 Windows、Mac 和 Linux。A desktop Markdown Block-Reference and Bidirectional-Link note-taking application, supports Windows, Mac and Linux.
Stars: ✭ 354 (-4.32%)
Mutual labels:  markdown
Gatsby Theme Code Notes
A Gatsby theme for publishing code-related notes to your website
Stars: ✭ 370 (+0%)
Mutual labels:  markdown
Marpit
The skinny framework for creating slide deck from Markdown
Stars: ✭ 364 (-1.62%)
Mutual labels:  markdown
Emoji Cheat Sheet
A markdown version emoji cheat sheet
Stars: ✭ 5,957 (+1510%)
Mutual labels:  markdown

EFMarkdown is a lightweight Markdown library in Swift, based on EFCMark, inspired by markdown and Markoff.

中文介绍

Overview

sample1 sample2 sample3 sample4

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Version Needs
0.x XCode 8.0+
Swift 3.0+
iOS 8.0+
4.x XCode 9.0+
Swift 4.0+
iOS 8.0+
5.x XCode 10.2+
Swift 5.0+
iOS 8.0+

Installation

EFMarkdown is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "EFMarkdown"

Usage

1. Markdown to HTML

You can use EFMarkdown to make Markdown string to HTML string easily:

let markdown = "# Hello"
var html = ""
do {
    html = try EFMarkdown().markdownToHTML(markdown, options: EFMarkdownOptions.safe)
    print(html) // This will return "<h1>Hello</h1>\n"
} catch let error as NSError {
    print ("Error: \(error.domain)")
}

2. View Markdown

You can use EFMarkdownView to make a preview of Markdown:

let screenSize = UIScreen.main.bounds
let markView = EFMarkdownView()
markView.frame = CGRect(x: 0, y: 20, width: screenSize.width, height: screenSize.height - 20)
markView.onRendered = {
    [weak self] (height) in
    if let _ = self {
        // Optional: you can know the change of height in this block
        print("onRendered height: \(height ?? 0)")
    }
}
self.view.addSubview(markView)
markView.load(markdown: testMarkdownFileContent(), options: [.default]) {
    [weak self] (_, _) in
    if let _ = self {
        // Optional: you can change font-size with a value of percent here
        markView.setFontSize(percent: 128)
        printLog("load finish!")
    }
}

3. Options

You can pass different options to the underlying cmark library. By default safe is passed.

The available options are:

  • default
  • sourcePos
  • hardBreaks
  • safe
  • noBreaks
  • validateUTF8
  • smart
  • githubPreLang
  • liberalHtmlTag

For more information on the available options, see cmark.

Author

EyreFree, [email protected]

License

EFMarkdown is available under the WTFPL license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].