about summary refs log tree commit diff stats
path: root/html
diff options
context:
space:
mode:
Diffstat (limited to 'html')
-rw-r--r--html/elements.go6
-rw-r--r--html/elements_test.go6
2 files changed, 6 insertions, 6 deletions
diff --git a/html/elements.go b/html/elements.go
index 8045561..4f1a0ec 100644
--- a/html/elements.go
+++ b/html/elements.go
@@ -14,13 +14,13 @@ func A(href string, children ...g.Node) g.NodeFunc {
 	return g.El("a", g.Attr("href", href), g.Group(children))
 }
 
-// Document returns an special kind of Node that prefixes its child with the string "<!doctype html>".
-func Document(child g.Node) g.NodeFunc {
+// Doctype returns a special kind of Node that prefixes its sibling with the string "<!doctype html>".
+func Doctype(sibling g.Node) g.NodeFunc {
 	return func(w io.Writer) error {
 		if _, err := w.Write([]byte("<!doctype html>")); err != nil {
 			return err
 		}
-		return child.Render(w)
+		return sibling.Render(w)
 	}
 }
 
diff --git a/html/elements_test.go b/html/elements_test.go
index e550bfe..f89919d 100644
--- a/html/elements_test.go
+++ b/html/elements_test.go
@@ -16,13 +16,13 @@ func (w *erroringWriter) Write(p []byte) (n int, err error) {
 	return 0, errors.New("don't want to write")
 }
 
-func TestDocument(t *testing.T) {
+func TestDoctype(t *testing.T) {
 	t.Run("returns doctype and children", func(t *testing.T) {
-		assert.Equal(t, `<!doctype html><html></html>`, Document(g.El("html")))
+		assert.Equal(t, `<!doctype html><html></html>`, Doctype(g.El("html")))
 	})
 
 	t.Run("errors on write error in Render", func(t *testing.T) {
-		err := Document(g.El("html")).Render(&erroringWriter{})
+		err := Doctype(g.El("html")).Render(&erroringWriter{})
 		assert.Error(t, err)
 	})
 }