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
Stringthat will be formattedDeclaration
Swift
let markdown: String -
The body of the
ViewDeclaration
Swift
var body: some View
-
The
See morestructfor a Markdown lineDeclaration
Swift
struct MarkdownLine: Identifiable -
The
See moreenumfor a Markdown typeDeclaration
Swift
enum MarkdownType -
Convert a Markdown string into an array of
MarkdownLinestructsDeclaration
Swift
func convertMarkdown(string: String) -> [MarkdownLine]Parameters
stringa markdown string
Return Value
an array of
MarkdownLinestructs
-
Convert a Markdown heading into seperate components
Declaration
Swift
func convertHeading(text: String) -> (text: String, level: Int)Parameters
texta
Stringwith 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 ViewParameters
textthe text of the heading
levelthe level of the heading
Return Value
the formatted heading in a
Textview
-
Format a list item
Declaration
Swift
func formatListItem(text: String) -> some ViewParameters
textthe text of the list item
Return Value
a formatted list item in an
HStackview
-
Format a code block
Declaration
Swift
func formatCodeBlock(text: String) -> some ViewParameters
textthe text of the code block
Return Value
a formatted code block in an
HStackview
-
Format a string if it has atributes
Declaration
Swift
func formatAttributedString(text: String) -> some ViewParameters
textthe Markdown text
Return Value
the formatted text in a
Textview
-
Format a quote
Declaration
Swift
func formatQuote(text: String) -> some ViewParameters
textthe Markdown text
Return Value
the formatted text in a
Textview
View on GitHub