37 lines
972 B
Swift
37 lines
972 B
Swift
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
var body: some View {
|
|
VStack {
|
|
Image(systemName: "doc.text")
|
|
.font(.system(size: 80))
|
|
.foregroundColor(.secondary)
|
|
Text("Markdown Viewer")
|
|
.font(.largeTitle)
|
|
.fontWeight(.medium)
|
|
Text("Open markdown files from the File menu")
|
|
.foregroundColor(.secondary)
|
|
.padding(.top, 8)
|
|
Text("⌘O")
|
|
.foregroundColor(.secondary)
|
|
.font(.caption)
|
|
.padding(.top, 4)
|
|
}
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
}
|
|
}
|
|
|
|
struct MarkdownDocumentView: View {
|
|
let content: String
|
|
let fileName: String
|
|
|
|
var body: some View {
|
|
MarkdownRenderer(content: content)
|
|
.navigationTitle(fileName)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
ContentView()
|
|
} |