hatmill/internal/codegen/README.md

22 lines
770 B
Markdown
Raw Normal View History

2019-03-24 19:28:36 +00:00
# codegen
codegen reads simple descriptions of HTML elements and attributes from
`elements.txt` and `attribs.txt`, respectively, and generates Go functions to
create them.
The files contains one description per line. Each attribute description is in
the form
```
attribute-name attribute-type
```
where `attribute-name` is the lowercase name of the attribute, and
`attribute-type` is either `string` for normal attributes (e.g. `id`, 'style')
or `bool` for boolean attributes (e.g. `disabled`). Each element description is
in the form
```
tag-name element-type
```
where `tag-name` is the lowercase name of the element, and `element-type` is
either `empty` for empty elements (e.g. `img`, 'br') or `parent` for elements
that can have child nodes (e.g. 'div', 'body').