From c4773eb94f81673754175ae537eb8af6eb15d33d Mon Sep 17 00:00:00 2001 From: Arpad Ryszka Date: Mon, 3 Nov 2025 02:56:53 +0100 Subject: [PATCH] update documentation --- lib.go | 9 +++++++++ readme.md | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib.go b/lib.go index b543582..3bed3d4 100644 --- a/lib.go +++ b/lib.go @@ -348,6 +348,9 @@ func Void(t Tag) Tag { // Non-tag child nodes are rendered via fmt.Sprint. Consecutive spaces are considered to be so on purpose, and // are converted into  . Spaces around tags, in special cases, can behave different from when using // unindented rendering. +// +// It returns an error only when either one or more tags are invalid, or the underlying writer returns an +// error. func WriteIndent(out io.Writer, indent Indentation, t ...Tag) error { if indent.PWidth < indent.MinPWidth { indent.PWidth = indent.MinPWidth @@ -383,11 +386,17 @@ func WriteIndent(out io.Writer, indent Indentation, t ...Tag) error { // Write renders html with t as the root nodes with the default indentation and wrapping. Tabs are used as // indentation string, and a paragraph with of 120. The minimum paragraph width is 60. Indentation and width // concerns only the HTML text, not the displayed document. +// +// It returns an error only when either one or more tags are invalid, or the underlying writer returns an +// error. func Write(out io.Writer, t ...Tag) error { return WriteIndent(out, Indentation{Indent: "\t"}, t...) } // WriteRaw renders html with t as the root nodes without indentation or wrapping. +// +// It returns an error only when either one or more tags are invalid, or the underlying writer returns an +// error. func WriteRaw(out io.Writer, t ...Tag) error { return WriteIndent(out, Indentation{}, t...) } diff --git a/readme.md b/readme.md index 9b62871..26143f8 100644 --- a/readme.md +++ b/readme.md @@ -19,7 +19,7 @@ import ( ) func main() { - html.RenderIndent( + html.Write( os.Stdout, html.Indent(), Doctype("html"),