MarkdownView
struct MarkdownView: View
SwiftUI View
for a Markdown text
This View is used for Help and is parsing the Documentation Catalog
Note
The first heading is ignored; the Views have to show it themself-
The Help model
Declaration
Swift
private var help
-
The Markdown
String
that will be formattedDeclaration
Swift
let markdown: String
-
The body of the
View
Declaration
Swift
var body: some View
-
The
See morestruct
for a Markdown lineDeclaration
Swift
struct MarkdownLine: Identifiable
-
The
See moreenum
for a Markdown typeDeclaration
Swift
enum MarkdownType
-
Convert a Markdown string into an array of
MarkdownLine
structsDeclaration
Swift
func convertMarkdown(string: String) -> [MarkdownLine]
Parameters
string
a markdown string
Return Value
an array of
MarkdownLine
structs
-
Convert a Markdown heading into seperate components
Declaration
Swift
func convertHeading(text: String) -> (text: String, level: Int)
Parameters
text
a
String
with a Markdown headingReturn Value
a stripped text and the level of the header
-
Format a heading
Declaration
Swift
func formatHeading(text: String, level: Int) -> some View
Parameters
text
the text of the heading
level
the level of the heading
Return Value
the formatted heading in a
Text
view
-
Format a list item
Declaration
Swift
func formatListItem(text: String) -> some View
Parameters
text
the text of the list item
Return Value
a formatted list item in an
HStack
view
-
Format a code block
Declaration
Swift
func formatCodeBlock(text: String) -> some View
Parameters
text
the text of the code block
Return Value
a formatted code block in an
HStack
view
-
Format a string if it has atributes
Declaration
Swift
func formatAttributedString(text: String) -> some View
Parameters
text
the Markdown text
Return Value
the formatted text in a
Text
view
-
Format a quote
Declaration
Swift
func formatQuote(text: String) -> some View
Parameters
text
the Markdown text
Return Value
the formatted text in a
Text
view