From af3c2deb7f42c729d54b5ac755e5c3b80864cfc0 Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 2 Dec 2024 18:56:41 +0100 Subject: [PATCH] Improve documentation of html, svg, mathml modules --- src/html.rs | 7 ++++--- src/mathml.rs | 7 ++++--- src/svg.rs | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/html.rs b/src/html.rs index 9267394..e5b8221 100644 --- a/src/html.rs +++ b/src/html.rs @@ -1,6 +1,5 @@ -//! Definitions for all non-deprecated HTML elements. -//! -//! +//! Definitions for all non-deprecated HTML elements +//! ([MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element)). use crate::{Element, ElementComponent, ElementKind}; @@ -9,6 +8,8 @@ macro_rules! element { element!($name, ElementKind::Normal); }; ( $name:ident, $kind:expr ) => { + #[doc = concat!("The `<", stringify!($name), ">` tag")] + #[doc = concat!("([MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/", stringify!($name), ")).")] pub fn $name(c: impl ElementComponent) -> Element { Element::new(stringify!($name), $kind).with(c) } diff --git a/src/mathml.rs b/src/mathml.rs index 6bfa113..2e761a0 100644 --- a/src/mathml.rs +++ b/src/mathml.rs @@ -1,6 +1,5 @@ -//! Definitions for all non-deprecated MathML elements. -//! -//! +//! Definitions for all non-deprecated MathML elements +//! ([MDN](https://developer.mozilla.org/en-US/docs/Web/MathML/Element)). use crate::{Element, ElementComponent, ElementKind}; @@ -9,6 +8,8 @@ macro_rules! element { element!($name, stringify!($name)); }; ( $name:ident, $tag:expr ) => { + #[doc = concat!("The `<", $tag, ">` tag")] + #[doc = concat!("([MDN](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/", $tag, ")).")] pub fn $name(c: impl ElementComponent) -> Element { Element::new($tag, ElementKind::Foreign).with(c) } diff --git a/src/svg.rs b/src/svg.rs index 7acffbd..578249a 100644 --- a/src/svg.rs +++ b/src/svg.rs @@ -1,6 +1,5 @@ -//! Definitions for all non-deprecated SVG elements. -//! -//! +//! Definitions for all non-deprecated SVG elements +//! ([MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Element)). use crate::{Element, ElementComponent, ElementKind}; @@ -9,6 +8,8 @@ macro_rules! element { element!($name, stringify!($name)); }; ( $name:ident, $tag:expr ) => { + #[doc = concat!("The `<", $tag, ">` tag")] + #[doc = concat!("([MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/", $tag, ")).")] pub fn $name(c: impl ElementComponent) -> Element { Element::new($tag, ElementKind::Foreign).with(c) }