From d24dc401643393f5a9613246181b99b3dab0352c Mon Sep 17 00:00:00 2001 From: Arpad Ryszka Date: Tue, 7 Oct 2025 17:22:48 +0200 Subject: [PATCH] add example to readme --- readme.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/readme.md b/readme.md index f99e399..279af29 100644 --- a/readme.md +++ b/readme.md @@ -3,3 +3,29 @@ Package html provides functions for programmatically composing and rendering HTML and HTML templates. Docs: https://godocs.io/code.squareroundforest.org/arpio/html + +Example: + +``` +package main + +import ( + "os" + "code.squareroundforest.org/arpio/html" + . "code.squareroundforest.org/arpio/html/tag" +) + +func main() { + html.RenderIndent( + os.Stdout, + html.Indent(), + Html( + Head(Title("Hello, world!")), + Body( + H1("Hello, world!"), + P("This a sample HTML page."), + ), + ), + ) +} +```