MarkdownView alternatives and similar libraries
Based on the "Text" category.
Alternatively, view MarkdownView alternatives based on common mentions on social networks and blogs.
-
YYText
Powerful text framework for iOS to display and edit rich text. -
Nimbus
The iOS framework that grows only as fast as its documentation -
PhoneNumberKit
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber. -
ZSSRichTextEditor
A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view -
Twitter Text Obj
Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform. -
FontAwesomeKit
Icon font library for iOS. Currently supports Font-Awesome, Foundation icons, Zocial, and ionicons. -
SwiftRichString
👩🎨 Elegant Attributed String composition in Swift sauce -
TwitterTextEditor
A standalone, flexible API that provides a full-featured rich text editor for iOS applications. -
libPhoneNumber-iOS
iOS port from libphonenumber (Google's phone number handling library) -
RichEditorView
RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing. -
Down
Blazing fast Markdown / CommonMark rendering in Swift, built upon cmark. -
TextAttributes
An easier way to compose attributed strings -
SwiftyMarkdown
Converts Markdown files and strings into NSAttributedStrings with lots of customisation options. -
FontAwesome.swift
Use FontAwesome in your Swift projects -
SwiftString
A comprehensive, lightweight string extension for Swift -
Iconic
:art: Auto-generated icon font library for iOS, watchOS and tvOS -
MMMarkdown
An Objective-C framework for converting Markdown to HTML. -
Atributika
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement. -
CocoaMarkdown
Markdown parsing and rendering for iOS and OS X -
SwiftIconFont
Icons fonts for iOS (Font Awesome 5, Iconic, Ionicon, Octicon, Themify, MapIcon, MaterialIcon, Foundation 3, Elegant Icon, Captain Icon) -
FontBlaster
Programmatically load custom fonts into your iOS, macOS and tvOS app. -
Notepad
[iOS] A fully themeable markdown editor with live syntax highlighting. -
MarkdownKit
A simple and customizable Markdown Parser for Swift -
fuse-swift
A lightweight fuzzy-search library, with zero dependencies -
FormatterKit
stringWithFormat: for the sophisticated hacker set -
AztecEditor-iOS
A reusable native iOS visual HTML text editor component. -
NSStringEmojize
A category on NSString to convert Emoji Cheat Sheet codes to their equivalent Unicode characters -
Mustard
🌭 Mustard is a Swift library for tokenizing strings when splitting by whitespace doesn't cut it. -
Guitar
A Cross-Platform String and Regular Expression Library written in Swift. -
Translucid
Lightweight library to set an Image as text background. Written in swift. -
GoogleMaterialDesignIcons
Google Material Design Icons Font for iOS -
Heimdall
Heimdall is a wrapper around the Security framework for simple encryption/decryption operations. -
AttributedTextView
Easiest way to create an attributed UITextView (with support for multiple links and from html)
WorkOS - The modern identity platform for B2B SaaS
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of MarkdownView or a related project?
README
MarkdownView
MarkdownView is a WKWebView based UI element, and internally use markdown-it, highlight-js.
How to use
UIViewController
import MarkdownView
let md = MarkdownView()
md.load(markdown: "# Hello World!")
SwiftUI
import SwiftUI
import MarkdownView
struct SampleUI: View {
var body: some View {
ScrollView {
MarkdownUI(body: markdown)
.onTouchLink { link in
print(link)
return false
}
.onRendered { height in
print(height)
}
}
}
private var markdown: String {
let path = Bundle.main.path(forResource: "sample", ofType: "md")!
let url = URL(fileURLWithPath: path)
return try! String(contentsOf: url, encoding: String.Encoding.utf8)
}
}
Options
md.isScrollEnabled = false
// called when rendering finished
md.onRendered = { [weak self] height in
self?.mdViewHeight.constant = height
self?.view.setNeedsLayout()
}
// called when user touch link
md.onTouchLink = { [weak self] request in
guard let url = request.url else { return false }
if url.scheme == "file" {
return false
} else if url.scheme == "https" {
let safari = SFSafariViewController(url: url)
self?.navigationController?.pushViewController(safari, animated: true)
return false
} else {
return false
}
}
Experimental Features
This is not stable :bow:
Custom CSS Styling
Please check Example/ViewController/CustomCss.swift.
Plugins
Please check Example/ViewController/Plugins.swift. Each plugin should be self-contained, with no external dependent plugins.
Here is a sample project that builds markdown-it-new-katex
as a compatible library.
Requirements
Target | Version |
---|---|
iOS | => 13.0 |
Swift | => 5.2 |
Installation
MarkdownView is available through Swift Package Manager or CocoaPods or Carthage.
Swift Package Manager
dependencies: [
.package(url: "https://github.com/keitaoouchi/MarkdownView.git", from: "1.7.1")
]
Alternatively, you can add the package directly via Xcode.
CocoaPods
pod "MarkdownView"
Carthage
github "keitaoouchi/MarkdownView"
for detail, please follow the Carthage Instruction
Author
keita.oouchi, [email protected]
License
bootstrap is licensed under MIT license.
highlight.js is licensed under BSD-3-Clause license.
markdown-it is licensed under MIT license.
MarkdownView is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the MarkdownView README section above
are relevant to that project's source code only.