Added formmethod attribute helper

This commit is contained in:
Brandon Dyck 2019-05-29 20:01:37 -06:00
parent ae85431082
commit d24afba75c
3 changed files with 23 additions and 3 deletions

View File

@ -1,5 +1,13 @@
# Changelog # Changelog
## [unreleased]
- `attribute.Formmethod` helper function
### Changed
- Formatted code identifiers in Changelog
## [0.0.4] - 2019-05-27 ## [0.0.4] - 2019-05-27
### Added ### Added
@ -9,22 +17,25 @@
### Changed ### Changed
- Element and attribute specs can define custom function doc comments. - Element and attribute specs can define custom function doc comments.
- element.A and attribute.Accept specs have comments. - `element.A` and `attribute.Accept` specs have comments.
## [0.0.3] - 2019-05-11 ## [0.0.3] - 2019-05-11
### Added ### Added
- Benchmark against `html/template` - Benchmark against `html/template`
## [0.0.2] - 2019-04-28 ## [0.0.2] - 2019-04-28
### Added ### Added
- Changelog - Changelog
- `hatmill.Terms` type for representing lists of nodes - `hatmill.Terms` type for representing lists of nodes
### Changed ### Changed
- Attrib.WriteTo replaces special characters in Value with HTML entities.
- Text.WriteTo replaces special characters with HTML entities. - `Attrib.WriteTo` replaces special characters in `Value` with HTML entities.
- `Text.WriteTo` replaces special characters with HTML entities.
## [0.0.1] - 2019-04-28 ## [0.0.1] - 2019-04-28

View File

@ -270,6 +270,14 @@ func Formaction(value string) hatmill.Attrib {
} }
} }
// Formmethod creates a "formmethod" attribute
func Formmethod(value string) hatmill.Attrib {
return hatmill.Attrib{
Key: "formmethod",
Value: value,
}
}
// Headers creates a "headers" attribute // Headers creates a "headers" attribute
func Headers(value string) hatmill.Attrib { func Headers(value string) hatmill.Attrib {
return hatmill.Attrib{ return hatmill.Attrib{

View File

@ -34,6 +34,7 @@
{"name": "for", "type": "string"}, {"name": "for", "type": "string"},
{"name": "form", "type": "string"}, {"name": "form", "type": "string"},
{"name": "formaction", "type": "string"}, {"name": "formaction", "type": "string"},
{"name": "formmethod", "type": "string"},
{"name": "headers", "type": "string"}, {"name": "headers", "type": "string"},
{"name": "height", "type": "int"}, {"name": "height", "type": "int"},
{"name": "hidden", "type": "bool"}, {"name": "hidden", "type": "bool"},