Skip to content

Commit

Permalink
docs: document experimental templ packages (#868)
Browse files Browse the repository at this point in the history
Co-authored-by: Adrian Hesketh <adrianhesketh@hushmail.com>
  • Loading branch information
garrettladley and a-h authored Aug 11, 2024
1 parent 5d41a6b commit 7012baa
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 2 deletions.
14 changes: 14 additions & 0 deletions docs/docs/13-experimental/01-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Experimental packages

Experimental Packages for templ are available at https://github.com/templ-go/x/

:::warning
- Packages in this module are experimental and may be removed at any time.
- There is no guarantee of compatibility with future versions.
- There is no guarantee of stability.
- Use at your own risk.
:::

## Approval Process

As of right now, there is no formal approval process for packages to be stabilized and moved into https://github.com/a-h/templ. Feel free to contribute via GitHub discussions at https://github.com/a-h/templ/discussions
31 changes: 31 additions & 0 deletions docs/docs/13-experimental/02-urlbuilder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# urlbuilder

A simple URL builder to construct a `templ.SafeURL`.

```templ title="component.templ"
import (
"github.com/templ-go/x/urlbuilder"
"strconv"
"strings"
)
templ component(o Order) {
<a
href={ urlbuilder.New("https", "example.com").
Path("orders").
Path(o.ID).
Path("line-items").
Query("page", strconv.Itoa(1)).
Query("limit", strconv.Itoa(10)).
Build() }
>
{ strings.ToUpper(o.Name) }
</a>
}
```

See [URL Attribures](/syntax-and-usage/attributes#url-attributes) for more information.

## Feedback

Please leave your feedback on this feature at https://github.com/a-h/templ/discussions/867
4 changes: 4 additions & 0 deletions docs/docs/13-experimental/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"position": 13,
"label": "Experimental"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"position": 13,
"position": 14,
"label": "Help and community"
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"position": 14,
"position": 15,
"label": "FAQ"
}
File renamed without changes.

0 comments on commit 7012baa

Please sign in to comment.