From c6e25797328a167c986f9e8503b028157a0105aa Mon Sep 17 00:00:00 2001 From: Hayleigh Thompson Date: Thu, 20 Jul 2023 21:39:39 +0100 Subject: :recycle: Rename terse 'h' and 't' to 'element' and 'text'. --- src/lustre/element.gleam | 4 +- src/lustre/html.gleam | 234 ++++++++++++++++++++--------------------- test/examples/components.gleam | 10 +- test/examples/counter.gleam | 10 +- test/examples/input.gleam | 10 +- 5 files changed, 134 insertions(+), 134 deletions(-) diff --git a/src/lustre/element.gleam b/src/lustre/element.gleam index 3a803dc..02fb41d 100644 --- a/src/lustre/element.gleam +++ b/src/lustre/element.gleam @@ -18,7 +18,7 @@ pub opaque type Element(msg) { /// /// -pub fn h( +pub fn element( tag: String, attrs: List(Attribute(msg)), children: List(Element(msg)), @@ -28,7 +28,7 @@ pub fn h( /// /// -pub fn t(content: String) -> Element(msg) { +pub fn text(content: String) -> Element(msg) { Text(content) } diff --git a/src/lustre/html.gleam b/src/lustre/html.gleam index d5b7b4c..f925d95 100644 --- a/src/lustre/html.gleam +++ b/src/lustre/html.gleam @@ -1,6 +1,6 @@ // IMPORTS --------------------------------------------------------------------- -import lustre/element.{Element, h, t} +import lustre/element.{Element, element, text} import lustre/attribute.{Attribute} // The doc comments (and order) for functions in this module are taken from the @@ -19,7 +19,7 @@ pub fn html( attrs: List(Attribute(msg)), children: List(Element(msg)), ) -> Element(msg) { - h("html", attrs, children) + element("html", attrs, children) } // HTML ELEMENTS: DOCUMENT METADATA -------------------------------------------- @@ -28,14 +28,14 @@ pub fn html( /// be only one such element in a document. /// pub fn base(attrs: List(Attribute(msg))) -> Element(msg) { - h("base", attrs, []) + element("base", attrs, []) } /// Contains machine-readable information (metadata) about the document, like its /// title, scripts, and style sheets. /// pub fn head(attrs: List(Attribute(msg))) -> Element(msg) { - h("head", attrs, []) + element("head", attrs, []) } /// Specifies relationships between the current document and an external resource. @@ -44,28 +44,28 @@ pub fn head(attrs: List(Attribute(msg))) -> Element(msg) { /// on mobile devices) among other things. /// pub fn link(attrs: List(Attribute(msg))) -> Element(msg) { - h("link", attrs, []) + element("link", attrs, []) } /// Represents metadata that cannot be represented by other HTML meta-related /// elements, like , ,