add example to readme
This commit is contained in:
parent
1cdc39a366
commit
d24dc40164
26
readme.md
26
readme.md
@ -3,3 +3,29 @@
|
|||||||
Package html provides functions for programmatically composing and rendering HTML and HTML templates.
|
Package html provides functions for programmatically composing and rendering HTML and HTML templates.
|
||||||
|
|
||||||
Docs: https://godocs.io/code.squareroundforest.org/arpio/html
|
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."),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user