html_types/semantic/
html.rs

1use super::{Body, Head};
2use crate::{
3    attributes::Value,
4    node::{Element, Node},
5};
6
7pub struct Html {
8    pub lang: Value<'static>,
9    pub head: Head,
10    pub body: Body,
11}
12
13impl<'a> From<Html> for Element<'a, Vec<Node<'a>>> {
14    fn from(value: Html) -> Self {
15        let header: Element<Vec<Node<'a>>> = value.head.into();
16        let body: Self = value.body.into();
17        Element::html(value.lang, header, body)
18    }
19}
20
21impl<'a> From<Html> for Node<'a> {
22    fn from(html: Html) -> Self {
23        let el: Element<Vec<Node<'a>>> = html.into();
24        el.into()
25    }
26}