https://github.com/iankoex/markdown
SwiftUI Markdown
https://github.com/iankoex/markdown
ios ipados macos markdown swiftui
Last synced: about 1 year ago
JSON representation
SwiftUI Markdown
- Host: GitHub
- URL: https://github.com/iankoex/markdown
- Owner: iankoex
- Created: 2022-09-18T15:18:43.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-14T11:22:21.000Z (over 1 year ago)
- Last Synced: 2025-03-23T17:12:51.915Z (over 1 year ago)
- Topics: ios, ipados, macos, markdown, swiftui
- Language: Swift
- Homepage:
- Size: 62.5 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MarkDown
Adapted from of Talaxy's [RoomTime](https://github.com/RainbowTalaxy/RoomTime.git)
# Requirements
- iOS 15 or newer
- macOS 12 or newer
- tvOS 14 or newer (not tested)
- watchOS 7 or newer (not tested)
# Installation
Use Swift Package Manager
# Usage
Here is a brief usage:
```swift
import Markdown
struct MarkdownDemo: View {
let text: String
var body: some View {
ScrollView {
MarkdownView(text: text) { element in
ElementView(element: element)
}
.padding(.horizontal)
}
}
}
```
### Syntax support
* header 1-6
* quote
* order or unorder list
* indent or block code
* border
* table
* images
## Test
This text shows the capabilities of Markdown
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
**Bold**
``italics``
~~Strike~~
# List
Unorder list
- apple
+ banana
* strawberry
Order list
1. eat
2. code!
3. sleep
You can also specify the offset:
11. eat
2. code!
3. sleep
# Quote
> An apple a day keeps the doctor away.
> An apple a day keeps the doctor away.
>> Quote can also be nested.
> > > and spaces are allowed between arrows.
# Code
Supports indent code:
var name = "Talaxy"
and code block syntax:
```swift
// example
struct Demo: View {
var body: some View {
Text("Hello world!")
}
}
```
# Border
---
* * *
__ ___ ____
Alignment syntax is supported.
| Property | Type | Description |
|:-------- |:------:| ----------------------:|
| title | String | The title of the news. |
| date | Date | The date of the news. |
| author | String | The author ... |
[ Apple](https://www.apple.com)

# SwiftUI
Declare the user interface and behavior for your app on every platform.
---
## Overview
SwiftUI provides views, controls, and layout structures
for declaring your app’s user interface.
---
― From Apple Developer Documentation