Add descriptions for /headers/* and /api (#3221)

* Add descriptions for /headers/* and /api

* Add a missing space in a description
This commit is contained in:
William Jackson 2025-03-05 21:58:38 -06:00 committed by GitHub
parent 103c72ed74
commit efcc6b2211
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 19 additions and 1 deletions

View File

@ -1,5 +1,9 @@
+++
title = "Javascript API"
description = """\
This documentation describes the JavaScript API for htmx, including methods and properties for configuring the \
behavior of htmx, working with CSS classes, AJAX requests, event handling, and DOM manipulation. The API provides \
helper functions primarily intended for extension development and event management."""
+++
While it is not a focus of the library, htmx does provide a small API of helper methods, intended mainly for [extension development](https://htmx.org/extensions) or for working with [events](@/events.md).

View File

@ -1,7 +1,7 @@
+++
title = "An interview with Leonard Richardson"
description = """\
In this interview, Leonard Richardson, creator of the Richardson Maturity Model for RESTful web services discusses\
In this interview, Leonard Richardson, creator of the Richardson Maturity Model for RESTful web services discusses \
the history of REST, interoperability in APIs and his impression of newer approaches such as GraphQL."""
date = 2025-02-19
updated = 2025-02-19

View File

@ -1,5 +1,7 @@
+++
title = "HX-Location Response Header"
description = """\
Use the HX-Location response header in htmx to trigger a client-side redirection without reloading the whole page."""
+++
This response header can be used to trigger a client side redirection without reloading the whole page. Instead of changing the page's location it will act like following a [`hx-boost` link](@/attributes/hx-boost.md), creating a new history entry, issuing an ajax request to the value of the header and pushing the path into history.

View File

@ -1,5 +1,7 @@
+++
title = "HX-Push-Url Response Header"
description = """\
Use the HX-Push-Url response header in htmx to push a URL into the browser location history."""
+++
The `HX-Push-Url` header allows you to push a URL into the browser [location history](https://developer.mozilla.org/en-US/docs/Web/API/History_API).

View File

@ -1,5 +1,7 @@
+++
title = "HX-Push Response Header (Deprecated)"
description = """\
The HX-Push response header in htmx is deprecated. Use HX-Push-Url instead."""
+++
The `HX-Push` header has been replaced by [`HX-Push-Url`](@/headers/hx-push-url.md)

View File

@ -1,5 +1,8 @@
+++
title = "HX-Redirect Response Header"
description = """\
Use the HX-Redirect response header in htmx to trigger a client-side redirection that will perform a full page \
reload."""
+++
This response header can be used to trigger a client side redirection to a new url that will do a full reload of the whole page. It uses the browser to redirect to the new location which can be useful when redirecting to non htmx endpoints that may contain different HTML `head` content or scripts. See [`HX-Location`](@/headers/hx-location.md) if you want more control over the redirect or want to use ajax requests instead of full browser reloads.

View File

@ -1,5 +1,8 @@
+++
title = "HX-Replace-Url Response Header"
description = """\
Use the HX-Replace-Url response header in htmx to replace the current URL in the browser location history without \
creating a new history entry."""
+++
The `HX-Replace-Url` header allows you to replace the current URL in the browser [location history](https://developer.mozilla.org/en-US/docs/Web/API/History_API).

View File

@ -1,5 +1,7 @@
+++
title = "HX-Trigger Response Headers"
description = """\
Use the HX-Trigger family of response headers in htmx to trigger client-side actions from an htmx response."""
+++
These response headers can be used to trigger client side actions on the target element within a response to htmx. You