about summary refs log tree commit diff stats
path: root/examples
Commit message (Collapse)AuthorAgeLines
* Fix TailwindCSS CDN URL in example (#76)Markus Wüstenberg2021-05-11-4/+4
| | | | | The CSS style URLs from unpkg.com redirected to a different page, but the first request set a `Content-Type` header of `text/plain`. Using the direct URLs fixes this. Fixes #75. Thanks to @gedw99 for reporting.
* Add more complex example using TailwindCSS (#71)Markus Wüstenberg2021-05-07-0/+125
|
* Streamline HTML element API (#66)Markus Wüstenberg2021-05-05-1/+1
| | | | | There were a lot of elements previously, like `Em`, `H1`, and a lot more, that took a string as the first argument previously. This was weird when you wanted to mix elements to output html like `<strong><em>…</em></strong>` or `<h1>Something <em>something</em> something</h1>`. gomponents is not an HTML validator, so I want people to be able to use elements however they please, also without text content. This also means that all elements now have the same API.
* Change main example to be the dot-import version (#56)Markus Wüstenberg2020-12-10-86/+43
|
* Simplify available elements (#55)Markus Wüstenberg2020-12-10-2/+2
| | | | | | | `a`, `form`, `img`, `input`, `label`, `option`, `progress`, `select`, and `textarea` are now just regular elements (without helper parameters), because: - Sometimes the use case doesn't fit (`a` as anchor without href, for example) - There's no reason these are special among the others, so streamlining them makes sense Also added new attributes `action`, `alt`, `for`, `method` that I had somehow missed.
* Rename Document to Doctype (#54)Markus Wüstenberg2020-12-10-1/+1
|
* Move elements and attributes into html package (#52)Markus Wüstenberg2020-12-10-33/+40
| | | | | This makes it easier to use dot-imports. Also updated the readme and examples with new usage, and move the `Classes` helper into the `components` package.
* Add example with dot imports (#47)Markus Wüstenberg2020-11-17-0/+37
|
* Add Map function (#40)Markus Wüstenberg2020-11-02-6/+6
| | | `Map` makes it easier to build lists of elements without having to iterate.
* Render to Writer instead of string (#39)Markus Wüstenberg2020-11-02-8/+9
| | | | | | | The Render function has been changed to take a `Writer` instead of returning a string. This makes it possible to generate documents without having the whole content in memory. This also removes the `gomponents.Write` function, which is now redundant. Furthermore, the `el.Document` function has been changed to only take one child, as multiple children never make sense for it. (It's not even a child, more a sibling.)
* Add attribute helpers (#35)Markus Wüstenberg2020-10-28-19/+14
| | | Also refactor tests to be table-driven, for readability.
* Add br and hr element helpers (#30)Hans Raaf2020-10-23-0/+1
|
* Remove "fmt" import in readme example (#31)Hans Raaf2020-10-23-2/+6
| | | Also style menu in simple example slightly.
* Add simple example (#13)Markus Wüstenberg2020-09-21-0/+70