Skip to main content

kozan_core/html/
html_text_elements.rs

1//! Inline text-level HTML elements.
2//!
3//! Simple elements that affect text styling/semantics. Most are trivial
4//! (no additions over `HTMLElement`). Grouped here for organization.
5//!
6//! Chrome has separate files for each, but they all inherit `HTMLElement`
7//! with minimal additions.
8
9use crate::Handle;
10use kozan_macros::Element;
11
12/// `<em>` — emphasis (typically italic).
13#[derive(Copy, Clone, Element)]
14#[element(tag = "em")]
15pub struct HtmlEmElement(Handle);
16
17/// `<strong>` — strong importance (typically bold).
18#[derive(Copy, Clone, Element)]
19#[element(tag = "strong")]
20pub struct HtmlStrongElement(Handle);
21
22/// `<b>` — bring attention (bold).
23#[derive(Copy, Clone, Element)]
24#[element(tag = "b")]
25pub struct HtmlBElement(Handle);
26
27/// `<i>` — alternate voice (italic).
28#[derive(Copy, Clone, Element)]
29#[element(tag = "i")]
30pub struct HtmlIElement(Handle);
31
32/// `<u>` — unarticulated annotation (underline).
33#[derive(Copy, Clone, Element)]
34#[element(tag = "u")]
35pub struct HtmlUElement(Handle);
36
37/// `<s>` — strikethrough (no longer accurate).
38#[derive(Copy, Clone, Element)]
39#[element(tag = "s")]
40pub struct HtmlSElement(Handle);
41
42/// `<small>` — side comment (smaller text).
43#[derive(Copy, Clone, Element)]
44#[element(tag = "small")]
45pub struct HtmlSmallElement(Handle);
46
47/// `<mark>` — highlighted text.
48#[derive(Copy, Clone, Element)]
49#[element(tag = "mark")]
50pub struct HtmlMarkElement(Handle);
51
52/// `<code>` — code fragment (monospace).
53#[derive(Copy, Clone, Element)]
54#[element(tag = "code")]
55pub struct HtmlCodeElement(Handle);
56
57/// `<kbd>` — keyboard input (monospace).
58#[derive(Copy, Clone, Element)]
59#[element(tag = "kbd")]
60pub struct HtmlKbdElement(Handle);
61
62/// `<pre>` — preformatted text (monospace, whitespace preserved).
63#[derive(Copy, Clone, Element)]
64#[element(tag = "pre")]
65pub struct HtmlPreElement(Handle);
66
67/// `<blockquote>` — block quotation.
68#[derive(Copy, Clone, Element)]
69#[element(tag = "blockquote")]
70pub struct HtmlBlockquoteElement(Handle);
71
72/// `<br>` — line break.
73#[derive(Copy, Clone, Element)]
74#[element(tag = "br")]
75pub struct HtmlBrElement(Handle);
76
77/// `<hr>` — thematic break (horizontal rule).
78#[derive(Copy, Clone, Element)]
79#[element(tag = "hr")]
80pub struct HtmlHrElement(Handle);
81
82/// `<abbr>` — abbreviation.
83#[derive(Copy, Clone, Element)]
84#[element(tag = "abbr")]
85pub struct HtmlAbbrElement(Handle);
86
87/// `<cite>` — citation reference.
88#[derive(Copy, Clone, Element)]
89#[element(tag = "cite")]
90pub struct HtmlCiteElement(Handle);
91
92/// `<q>` — inline quotation.
93#[derive(Copy, Clone, Element)]
94#[element(tag = "q")]
95pub struct HtmlQElement(Handle);
96
97/// `<time>` — date/time.
98#[derive(Copy, Clone, Element)]
99#[element(tag = "time")]
100pub struct HtmlTimeElement(Handle);
101
102/// `<sub>` — subscript.
103#[derive(Copy, Clone, Element)]
104#[element(tag = "sub")]
105pub struct HtmlSubElement(Handle);
106
107/// `<sup>` — superscript.
108#[derive(Copy, Clone, Element)]
109#[element(tag = "sup")]
110pub struct HtmlSupElement(Handle);
111
112/// `<var>` — variable.
113#[derive(Copy, Clone, Element)]
114#[element(tag = "var")]
115pub struct HtmlVarElement(Handle);
116
117/// `<wbr>` — word break opportunity.
118#[derive(Copy, Clone, Element)]
119#[element(tag = "wbr")]
120pub struct HtmlWbrElement(Handle);