Html
struct HtmlA page being written.
Implements Movable, Writable
- Fields
out: String
__init__
def __init__(out self) raw
def raw[*Ts: Writable](mut self, *parts: *Ts.values) Markup, written as it is. Only ever literals of this module's callers, never a value from the database or a request.
text
def text[*Ts: Writable](mut self, *values: *Ts.values) Values, each written and then escaped.
link
def link(mut self, href: StringSpan, label: StringSpan) <a href="href">label</a>, both escaped.
link_out
def link_out(mut self, href: StringSpan, label: StringSpan) A link that opens in a new tab: to code, or another site.
code
def code(mut self, href: StringSpan, label: StringSpan, commit: StringSpan) A link to source code on its host, set apart from links inside orca: an icon, label (where, as file.mojo:26) in monospace, and โ; it opens in a new tab, and its title names the commit.
code_named
def code_named(mut self, href: StringSpan, name: StringSpan, at: StringSpan, commit: StringSpan) code's link labelled with the function's name; where it is (at, as file.mojo:26) goes in the title, after the commit.
cell
def cell[*Ts: Writable](mut self, *values: *Ts.values) One <td> holding the values, escaped.
mono
def mono[*Ts: Writable](mut self, *values: *Ts.values) A <td> in the monospace font: an id, a partition, a time.
num
def num[*Ts: Writable](mut self, *values: *Ts.values) A <td> of a count, right-aligned in tabular figures.
chip
def chip(mut self, href: StringSpan, label: StringSpan) A link to a run, as a small chip of its number.
status
def status(mut self, s: StringSpan) A status as a badge, its class named after it (a space in the status is a hyphen in the class), with what it means on hover or keyboard focus (orca.ui.terms).
help
def help(mut self, id: String, key: String, text: StringSpan[ImmStaticOrigin], docs: StringSpan[ImmStaticOrigin] = StringSpan("")) A "?" after a fact's or a column's name that shows text, then a link to the docs (docs: a section of the docs page, or a URL) if there is one. CSS shows it on hover and keyboard focus, so it needs no script; to a screen reader the text is the button's description. id is unique in the page.
term
def term(mut self, kind: StringSpan, value: StringSpan) value, one of a fixed set (kind in orca.ui.terms): dotted underlined, with what it means on hover, keyboard focus or a tap; plain text if the set doesn't know it.
finish
def finish(deinit self) -> String The page written.
write_to
def write_to(self, mut writer: T)