开源软件名称(OpenSource Name):indragiek/MarkdownTextView开源软件地址(OpenSource Url):https://github.com/indragiek/MarkdownTextView开源编程语言(OpenSource Language):Swift 96.1%开源软件介绍(OpenSource Introduction):MarkdownTextViewRich Markdown Editing for iOSMarkdownTextView is an iOS framework for adding rich Markdown editing capabilities. Support for Markdown syntax is implemented inside an easily extensible ScreenshotExample AppCheck out the includeded Example app to try out the text view and to see how MarkdownTextView is integrated into the project. InstallationCocoaPods:Withpod "MarkdownTextView" Carthage:Withgithub "indragiek/MarkdownTextView" Getting StartedThe simplest possible usage is as follows: let textView = MarkdownTextView(frame: CGRectZero)
view.addSubview(textView) This gives you a text view with support for most of the features defined in the original Markdown implementation (strong, emphasis, inline code, code blocks, block quotes, headers) with the default styling provided by the framework. Customizing AppearanceAll of the styling can be customized using standard var attributes = MarkdownTextAttributes()
attributes.strongAttributes = [
NSForegroundColorAttributeName: UIColor.redColor()
]
let textStorage = MarkdownTextStorage(attributes: attributes)
let textView = MarkdownTextView(frame: CGRectZero, textStorage: textStorage)
view.addSubview(textView) Extensions SupportExtension classes conforming to the From Github Flavored Markdown:
Other:
These extensions do not come activated by default. They must manually be added to an instance of let textStorage = MarkdownTextStorage()
var error: NSError?
if let linkHighlighter = LinkHighlighter(errorPtr: &error) {
textStorage.addHighlighter(linkHighlighter)
} else {
assertionFailure("Error initializing LinkHighlighter: \(error)")
}
textStorage.addHighlighter(MarkdownStrikethroughHighlighter())
textStorage.addHighlighter(MarkdownSuperscriptHighlighter())
if let codeBlockAttributes = attributes.codeBlockAttributes {
textStorage.addHighlighter(MarkdownFencedCodeHighlighter(attributes: codeBlockAttributes))
}
let textView = MarkdownTextView(frame: CGRectZero, textStorage: textStorage)
view.addSubview(textView) Credits
Contact
LicenseMarkdownTextView is licensed under the MIT License. See |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论