diff --git a/jdr/sheet.go b/jdr/sheet.go
index d94f566..277fcfa 100644
--- a/jdr/sheet.go
+++ b/jdr/sheet.go
@@ -9,10 +9,13 @@ import (
"os"
)
+// Page represents a page of a character sheet.
type Page struct {
Items []SheetItem
}
+// ToHTML transforms a Page into a HTML code.
+// This HTML code is embeddable into the character sheet webpage
func (page *Page) ToHTML() template.HTML {
ret := ""
@@ -23,20 +26,25 @@ func (page *Page) ToHTML() template.HTML {
return template.HTML(ret)
}
+// SheetItem represents an item in the character sheet (either a structural element or a value)
type SheetItem interface {
Name() string
ToHTML() template.HTML
}
+// Block represents a SheetItem that contains other SheetItems.
+// It is used as a structural element to group values together.
type Block struct {
name string
Items []SheetItem
}
+// Name of the block (possibly empty if the block is unnamed)
func (block *Block) Name() string {
return block.name
}
+// ToHTML transforms a Block into a HTML code.
func (block *Block) ToHTML() template.HTML {
begin := `