about summary refs log tree commit diff stats
path: root/el/inline.go
diff options
context:
space:
mode:
authorMarkus Wüstenberg2020-10-28 16:16:18 +0100
committerGitHub2020-10-28 16:16:18 +0100
commit18e90339fcac48806a5777766aeb256be2b8c4bc (patch)
tree7b5bd103e15db8a4ed81981e6b83b0d547d34540 /el/inline.go
parent8f17dba6f1268ab8c8810d7940d1484315cdb825 (diff)
downloadgomponents-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/inline.go')
-rw-r--r--el/inline.go29
1 files changed, 0 insertions, 29 deletions
diff --git a/el/inline.go b/el/inline.go
deleted file mode 100644
index e0530d3..0000000
--- a/el/inline.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package el
-
-import (
-	g "github.com/maragudk/gomponents"
-)
-
-func Span(children ...g.Node) g.NodeFunc {
-	return g.El("span", children...)
-}
-
-func A(href string, children ...g.Node) g.NodeFunc {
-	return g.El("a", g.Attr("href", href), g.Group(children))
-}
-
-func B(text string, children ...g.Node) g.NodeFunc {
-	return g.El("b", g.Text(text), g.Group(children))
-}
-
-func Strong(text string, children ...g.Node) g.NodeFunc {
-	return g.El("strong", g.Text(text), g.Group(children))
-}
-
-func I(text string, children ...g.Node) g.NodeFunc {
-	return g.El("i", g.Text(text), g.Group(children))
-}
-
-func Em(text string, children ...g.Node) g.NodeFunc {
-	return g.El("em", g.Text(text), g.Group(children))
-}