2 Commits

Author SHA1 Message Date
86defea3c1 Add scripts to README
Also prep for release
2022-01-06 21:31:36 -05:00
9a9f159cab Add script functions
Also bump version to match htmx
2022-01-04 12:54:36 -05:00
5 changed files with 30 additions and 2 deletions

View File

@@ -63,6 +63,8 @@ Some attributes have known values, such as `hx-trigger` and `hx-swap`; for these
] ]
``` ```
If you want to load htmx from unpkg, `Htmx.Script.minified` or `Htmx.Script.unminified` can be used to load the script in your HTML trees.
## Feedback / Help ## Feedback / Help
The author hangs out in the #htmx-general channel of the [htmx Discord server](https://htmx.org/discord) and the #web channel of the [F# Software Foundation's Slack server](https://fsharp.org/guides/slack/). The author hangs out in the #htmx-general channel of the [htmx Discord server](https://htmx.org/discord) and the #web channel of the [F# Software Foundation's Slack server](https://fsharp.org/guides/slack/).

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?> <?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<VersionPrefix>0.9.3</VersionPrefix> <VersionPrefix>1.6.1</VersionPrefix>
<PackageReleaseNotes>Add support for HX-Retarget header (added in htmx 1.6.1)</PackageReleaseNotes> <PackageReleaseNotes>Initial production-ready release</PackageReleaseNotes>
<Authors>danieljsummers</Authors> <Authors>danieljsummers</Authors>
<Company>Bit Badger Solutions</Company> <Company>Bit Badger Solutions</Company>
<PackageProjectUrl>https://github.com/bit-badger/Giraffe.Htmx</PackageProjectUrl> <PackageProjectUrl>https://github.com/bit-badger/Giraffe.Htmx</PackageProjectUrl>

View File

@@ -2,6 +2,8 @@
This package enables server-side support for [htmx](https://htmx.org) within [Giraffe](https://giraffe.wiki) and ASP.NET's `HttpContext`. This package enables server-side support for [htmx](https://htmx.org) within [Giraffe](https://giraffe.wiki) and ASP.NET's `HttpContext`.
**htmx version: 1.6.1**
### Setup ### Setup
1. Install the package. 1. Install the package.

View File

@@ -212,3 +212,23 @@ module HtmxAttrs =
let _hxVals = attr "hx-vals" let _hxVals = attr "hx-vals"
/// Establishes a WebSocket or sends information to one /// Establishes a WebSocket or sends information to one
let _hxWs = attr "hx-ws" let _hxWs = attr "hx-ws"
/// Script tags to pull htmx into an web page
module Script =
/// Script tag to load the minified version from unpkg.com
let minified =
script [
_src "https://unpkg.com/htmx.org@1.6.1"
_integrity "sha384-tvG/2mnCFmGQzYC1Oh3qxQ7CkQ9kMzYjWZSNtrRZygHPDDqottzEJsqS4oUVodhW"
_crossorigin "anonymous"
] []
/// Script tag to load the unminified version from unpkg.com
let unminified =
script [
_src "https://unpkg.com/htmx.org@1.6.1/dist/htmx.js"
_integrity "sha384-7G9OE6gS4pBnBGH74HojjPQ8xOEGrdBeQc7JJOc58k6LG/YVfKXARd91w9715AYG"
_crossorigin "anonymous"
] []

View File

@@ -2,6 +2,8 @@
This package enables [htmx](https://htmx.org) support within the [Giraffe](https://giraffe.wiki) view engine. This package enables [htmx](https://htmx.org) support within the [Giraffe](https://giraffe.wiki) view engine.
**htmx version: 1.6.1**
### Setup ### Setup
1. Install the package. 1. Install the package.
@@ -25,6 +27,8 @@ Support modules include:
- `HxTrigger` - `HxTrigger`
- `HxVals` - `HxVals`
There are two `XmlNode`s that will load the htmx script from unpkg; `Htmx.Script.minified` loads the minified version, and `Htmx.Script.unminified` loads the unminified version (useful for debugging).
### Learn ### Learn
htmx's attributes and these attribute functions map one-to-one. The lone exception is `_hxBoost`, which implies `true`; use `_hxNoBoost` to set it to `false`. The support modules contain named properties for known values (as illustrated with `HxTrigger.Load` above). A few of the modules are more than collections of names, though: htmx's attributes and these attribute functions map one-to-one. The lone exception is `_hxBoost`, which implies `true`; use `_hxNoBoost` to set it to `false`. The support modules contain named properties for known values (as illustrated with `HxTrigger.Load` above). A few of the modules are more than collections of names, though: