kozan_core/html/html_section_elements.rs
1//! Sectioning and grouping HTML elements.
2//!
3//! Chrome has separate classes for each, but they're all trivial
4//! (no additions over `HTMLElement`). Grouped here for organization.
5//!
6//! # Elements
7//!
8//! - `<section>` — thematic grouping
9//! - `<article>` — self-contained content
10//! - `<nav>` — navigation links
11//! - `<header>` — introductory content
12//! - `<footer>` — footer content
13//! - `<main>` — dominant content
14//! - `<aside>` — tangentially related content
15//! - `<figure>` — self-contained figure
16//! - `<figcaption>` — figure caption
17//! - `<details>` — disclosure widget (future: toggle behavior)
18//! - `<summary>` — details summary (future: click to toggle)
19//! - `<address>` — contact information
20
21use crate::Handle;
22use kozan_macros::Element;
23
24/// `<section>` — a thematic grouping of content.
25#[derive(Copy, Clone, Element)]
26#[element(tag = "section")]
27pub struct HtmlSectionElement(Handle);
28
29/// `<article>` — self-contained content.
30#[derive(Copy, Clone, Element)]
31#[element(tag = "article")]
32pub struct HtmlArticleElement(Handle);
33
34/// `<nav>` — navigation links.
35#[derive(Copy, Clone, Element)]
36#[element(tag = "nav")]
37pub struct HtmlNavElement(Handle);
38
39/// `<header>` — introductory content for a section or page.
40#[derive(Copy, Clone, Element)]
41#[element(tag = "header")]
42pub struct HtmlHeaderElement(Handle);
43
44/// `<footer>` — footer for a section or page.
45#[derive(Copy, Clone, Element)]
46#[element(tag = "footer")]
47pub struct HtmlFooterElement(Handle);
48
49/// `<main>` — the dominant content of the document.
50#[derive(Copy, Clone, Element)]
51#[element(tag = "main")]
52pub struct HtmlMainElement(Handle);
53
54/// `<aside>` — tangentially related content.
55#[derive(Copy, Clone, Element)]
56#[element(tag = "aside")]
57pub struct HtmlAsideElement(Handle);
58
59/// `<figure>` — self-contained figure with optional caption.
60#[derive(Copy, Clone, Element)]
61#[element(tag = "figure")]
62pub struct HtmlFigureElement(Handle);
63
64/// `<figcaption>` — caption for a `<figure>`.
65#[derive(Copy, Clone, Element)]
66#[element(tag = "figcaption")]
67pub struct HtmlFigCaptionElement(Handle);
68
69/// `<details>` — disclosure widget.
70///
71/// Future: toggle behavior via click on `<summary>`.
72#[derive(Copy, Clone, Element)]
73#[element(tag = "details")]
74pub struct HtmlDetailsElement(Handle);
75
76/// `<summary>` — summary for a `<details>` element.
77#[derive(Copy, Clone, Element)]
78#[element(tag = "summary")]
79pub struct HtmlSummaryElement(Handle);
80
81/// `<address>` — contact information.
82#[derive(Copy, Clone, Element)]
83#[element(tag = "address")]
84pub struct HtmlAddressElement(Handle);