diff options
author | Markus Wüstenberg | 2020-10-28 16:16:18 +0100 |
---|---|---|
committer | GitHub | 2020-10-28 16:16:18 +0100 |
commit | 18e90339fcac48806a5777766aeb256be2b8c4bc (patch) | |
tree | 7b5bd103e15db8a4ed81981e6b83b0d547d34540 /el/section.go | |
parent | 8f17dba6f1268ab8c8810d7940d1484315cdb825 (diff) | |
download | gomponents-18e90339fcac48806a5777766aeb256be2b8c4bc.tar.lz gomponents-18e90339fcac48806a5777766aeb256be2b8c4bc.tar.zst gomponents-18e90339fcac48806a5777766aeb256be2b8c4bc.zip |
Add element helpers and refactor (#34)
This change adds a lot of element helpers, and refactors: - helpers into simple, text, and other helpers - most tests into table-driven tests, so they're easier to read Thanks to @oderwat for pushing me to improve the tests. 😉
Diffstat (limited to 'el/section.go')
-rw-r--r-- | el/section.go | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/el/section.go b/el/section.go deleted file mode 100644 index f49a39c..0000000 --- a/el/section.go +++ /dev/null @@ -1,80 +0,0 @@ -package el - -import ( - g "github.com/maragudk/gomponents" -) - -// Address returns an element with name "address" and the given children. -func Address(children ...g.Node) g.NodeFunc { - return g.El("address", children...) -} - -// Article returns an element with name "article" and the given children. -func Article(children ...g.Node) g.NodeFunc { - return g.El("article", children...) -} - -// Aside returns an element with name "aside" and the given children. -func Aside(children ...g.Node) g.NodeFunc { - return g.El("aside", children...) -} - -// Footer returns an element with name "footer" and the given children. -func Footer(children ...g.Node) g.NodeFunc { - return g.El("footer", children...) -} - -// Header returns an element with name "header" and the given children. -func Header(children ...g.Node) g.NodeFunc { - return g.El("header", children...) -} - -// H1 returns an element with name "h1", the given text content, and the given children. -func H1(text string, children ...g.Node) g.NodeFunc { - return g.El("h1", g.Text(text), g.Group(children)) -} - -// H2 returns an element with name "h2", the given text content, and the given children. -func H2(text string, children ...g.Node) g.NodeFunc { - return g.El("h2", g.Text(text), g.Group(children)) -} - -// H3 returns an element with name "h3", the given text content, and the given children. -func H3(text string, children ...g.Node) g.NodeFunc { - return g.El("h3", g.Text(text), g.Group(children)) -} - -// H4 returns an element with name "h4", the given text content, and the given children. -func H4(text string, children ...g.Node) g.NodeFunc { - return g.El("h4", g.Text(text), g.Group(children)) -} - -// H5 returns an element with name "h5", the given text content, and the given children. -func H5(text string, children ...g.Node) g.NodeFunc { - return g.El("h5", g.Text(text), g.Group(children)) -} - -// H6 returns an element with name "h6", the given text content, and the given children. -func H6(text string, children ...g.Node) g.NodeFunc { - return g.El("h6", g.Text(text), g.Group(children)) -} - -// HGroup returns an element with name "hgroup" and the given children. -func HGroup(children ...g.Node) g.NodeFunc { - return g.El("hgroup", children...) -} - -// Main returns an element with name "main" and the given children. -func Main(children ...g.Node) g.NodeFunc { - return g.El("main", children...) -} - -// Nav returns an element with name "nav" and the given children. -func Nav(children ...g.Node) g.NodeFunc { - return g.El("nav", children...) -} - -// Section returns an element with name "section" and the given children. -func Section(children ...g.Node) g.NodeFunc { - return g.El("section", children...) -} |