Reference
Markdown
Markdown text rendered as HTML: headings, paragraphs, lists, quotes, code, links, emphasis. The text is escaped first, so HTML in it is shown, not run, and a link or picture whose URL a browser would run is drawn as its words. .inert is for text somebody else wrote.
Markdown(_ text: String, inert: Bool)
Before 5.0
inert
Getting started
Install wf, then:
- write a page in src/pages
- run
wf serveand open it - read the guide when you are stuck
page Home(path: "/", title: "Home") { Heading("Hello").h1 }
Example
Markdown("""
## Getting started
Install `wf`, then:
- write a page in **src/pages**
- run `wf serve` and open it
- read [the guide](/learn) when you are stuck
```wf
page Home(path: "/", title: "Home") { Heading("Hello").h1 }
```
""")
Somebody else's text: entities decoded, links drawn as words
state docs = "Returns `List<T>`, as [the guide](/learn) says."
Markdown(docs).inert
A table
Markdown("""
| Plan | Seats |
|---|--:|
| Free | 1 |
| Pro | 10 |
""")
Props
| Prop | Type | Unset | Meaning |
|---|---|---|---|
text | String (positional) | none | The Markdown, drawn as HTML at build time and live; it is escaped first, so HTML in it is shown, not run |
inert: | Bool | false | Text somebody else wrote, such as a language server's documentation: its entities are decoded, a link is drawn as its words and a picture is left out. Written as a flag, |
Attribute families: global, aria, data. Plus the 22 universal props every element takes: animate:, exit:, speed:, duration:, delay:, easing:, stagger:, on:, count:, shared:, class:, ref:, drag:, dragGroup:, dropValue:, dropAxis:, dropInside:, roving:, trapFocus:, mount:, update:, cleanup:.
Flags and cases
A flag is written after the parentheses with a dot: a Bool prop, or a case of one of the element's enum props. A case the enum lacks is an error with a hint.
.inert
Events
Every element also takes the props, the events and the attribute families listed on every element.
Slots
It takes no slots.
Renders with the class wf-markdown, stable across releases, so a stylesheet may target it.
Codes this can raise
These controls list the props' cases; the example below shows them written.