๐Ÿ“ฆ Lakr233 / MarkdownView

โ˜… 106 stars โ‘‚ 19 forks ๐Ÿ‘ 106 watching โš–๏ธ Other
๐Ÿ“ฅ Clone https://github.com/Lakr233/MarkdownView.git
HTTPS git clone https://github.com/Lakr233/MarkdownView.git
SSH git clone git@github.com:Lakr233/MarkdownView.git
CLI gh repo clone Lakr233/MarkdownView
Loading files...
๐Ÿ“„ README.md

MarkdownView

A powerful pure UIKit framework for rendering Markdown documents with real-time parsing and rendering capabilities. Battle tested in FlowDown.

Preview

Preview%20-%202025-05-27%20at%2003.03.27.png)

Features

  • ๐Ÿš€ Real-time Rendering: Live Markdown parsing and rendering as you type
  • ๐Ÿ–ฅ๏ธ Specialized for Mobile Display: Optimized layout that extracts complex elements from lists for better readability
  • ๐ŸŽจ Syntax Highlighting: Beautiful code syntax highlighting with Splash
  • ๐Ÿ“Š Math Rendering: LaTeX math formula rendering with SwiftMath
  • ๐Ÿ“ฑ Cross-Platform: Native support for iOS, macOS, Mac Catalyst, and visionOS

Installation

Add the following to your Package.swift file:

dependencies: [
    .package(url: "https://github.com/Lakr233/MarkdownView", from: "3.6.0"),
]

Platform compatibility:

  • iOS 16.0+
  • macOS 13.0+
  • Mac Catalyst 16.0+
  • visionOS 1.0+

Usage

SwiftUI

import MarkdownView

struct ContentView: View {
    var body: some View {
        MarkdownView("# Hello World")
    }
}

With custom theme:

MarkdownView("# Hello World", theme: .default)

UIKit / AppKit

import MarkdownView
import MarkdownParser

let markdownTextView = MarkdownTextView()
let parser = MarkdownParser()
let result = parser.parse("# Hello World")
let content = MarkdownTextView.PreprocessedContent(parserResult: result, theme: .default)
markdownTextView.setMarkdown(content)

Example

Check out the included example project to see MarkdownView in action:

cd Example
open Example.xcodeproj

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

This project includes code adapted from swift-markdown-ui by Guillermo Gonzalez, used under the MIT License.


Copyright 2025 ยฉ Lakr Aream. All rights reserved.