plain.htmx


Nameplain.htmx JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/dropseed/plain
SummaryHTMX integration for Plain.
upload_time2024-09-26 19:29:56
maintainerNone
docs_urlNone
authorDave Gaeddert
requires_python<4.0,>=3.11
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- This file is compiled from plain-htmx/plain/htmx/README.md. Do not edit this file directly. -->

# HTMX

Integrate HTMX with templates and views.

The `plain-htmx` package adds a couple of unique features for working with HTMX.
One is [template fragments](#template-fragments) and the other is [view actions](#view-actions).

The combination of these features lets you build HTMX-powered views that focus on server-side rendering and avoid overly complicated URL structures or REST APIs that you may not otherwise need.

The `HTMXViewMixin` is the starting point for the server-side HTMX behavior.
To use these feaures on a view,
simply inherit from the class (yes, this is designed to work with class-based views).

```python
from plain.views import TemplateView

from plain.htmx.views import HTMXViewMixin


class HomeView(HTMXViewMixin, TemplateView):
    template_name = "home.html"
```

In your `base.html` template (or wherever need the HTMX scripts),
you can use the `{% htmx_js %}` template tag:

```html
<!-- base.template.html -->
{% load htmx %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>My Site</title>
    {% htmx_js %}
</head>
<body>
    {% block content %}{% endblock %}
</body>
```

## Installation

```python
INSTALLED_PACKAGES = [
    # ...
    "plain.htmx",
]
```

## Template Fragments

An `{% htmxfragment %}` can be used to render a specific part of your template in HTMX responses.
When you use a fragment, all `hx-get`, `hx-post`, etc. elements inside that fragment will automatically send a request to the current URL,
render *only* the updated content for the fragment,
and swap out the fragment.

Here's an example:

```html
<!-- home.html -->
{% extends "base.html" %}

{% load htmx %}

{% block content %}
<header>
  <h1>Page title</h1>
</header>

<main>
  {% htmxfragment main %}
  <p>The time is {% now "jS F Y H:i" %}</p>

  <button hx-get>Refresh</button>
  {% endhtmxfragment %}
</main>
{% endblock %}
```

Everything inside `{% htmxfragment %}` will automatically update when "Refresh" is clicked.

### Lazy template fragments

If you want to render a fragment lazily,
you can add the `lazy` attribute to the `{% htmxfragment %}` tag.

```html
{% htmxfragment main lazy=True %}
<!-- This content will be fetched with hx-get -->
{% endhtmxfragment %}
```

This pairs nicely with passing a callable function or method as a context variable,
which will only get invoked when the fragment actually gets rendered on the lazy load.

```python
def fetch_items():
    import time
    time.sleep(2)
    return ["foo", "bar", "baz"]


class HomeView(HTMXViewMixin, TemplateView):
    def get_context(self, **kwargs):
        context = super().get_context(**kwargs)
        context["items"] = fetch_items  # Missing () are on purpose!
        return context
```

```html
{% htmxfragment main lazy=True %}
<ul>
  {% for item in items %}
    <li>{{ item }}</li>
  {% endfor %}
</ul>
{% endhtmxfragment %}
```

### How does it work?

When you use the `{% htmxfragment %}` tag,
a standard `div` is output that looks like this:

```html
<div plain-hx-fragment="main" hx-swap="outerHTML" hx-target="this" hx-indicator="this">
  {{ fragment_content }}
</div>
```

The `plain-hx-fragment` is a custom attribute that we've added ("F" is for "Forge"),
but the rest are standard HTMX attributes.

When Plain renders the response to an HTMX request,
it will get the `Plain-HX-Fragment` header,
find the fragment with that name in the template,
and render that for the response.

Then the response content is automatically swapped in to replace the content of your `{% htmxfragment %}` tag.

Note that there is no URL specified on the `hx-get` attribute.
By default, HTMX will send the request to the current URL for the page.
When you're working with fragments, this is typically the behavior you want!
(You're on a page and want to selectively re-render a part of that page.)

The `{% htmxfragment %}` tag is somewhat similar to a `{% block %}` tag --
the fragments on a page should be named and unique,
and you can't use it inside of loops.
For fragment-like behavior inside of a for-loop,
you'll most likely want to set up a dedicated URL that can handle a single instance of the looped items,
and maybe leverage [dedicated templates](#dedicated-templates).

## View Actions

View actions let you define multiple "actions" on a class-based view.
This is an alternative to defining specific API endpoints or form views to handle basic button interactions.

With view actions you can design a single view that renders a single template,
and associate buttons in that template with class methods in the view.

As an example, let's say we have a `PullRequest` model and we want users to be able to open, close, or merge it with a button.

In our template, we would use the `plain-hx-action` attribute to name the action:

```html
{% extends "base.html" %}

{% load htmx %}

{% block content %}
<header>
  <h1>{{ pullrequest }}</h1>
</header>

<main>
  {% htmxfragment pullrequest %}
  <p>State: {{ pullrequest.state }}</p>

  {% if pullrequest.state == "open" %}
    <!-- If it's open, they can close or merge it -->
    <button hx-post plain-hx-action="close">Close</button>
    <button hx-post plain-hx-action="merge">Merge</button>
  {% else if pullrequest.state == "closed" %}
    <!-- If it's closed, it can be re-opened -->
    <button hx-post plain-hx-action="open">Open</button>
  {% endif %}

  {% endhtmxfragment %}
</main>
{% endblock %}
```

Then in the view class, we can define methods for each HTTP method + `plain-hx-action`:

```python
class PullRequestDetailView(HTMXViewMixin, DetailView):
    def get_queryset(self):
        # The queryset will apply to all actions on the view, so "permission" logic can be shared
        return super().get_queryset().filter(users=self.request.user)

    # Action handling methods follow this format:
    # htmx_{method}_{action}
    def htmx_post_open(self):
        self.object = self.get_object()

        if self.object.state != "closed":
            raise ValueError("Only a closed pull request can be opened")

        self.object.state = "closed"
        self.object.save()

        # Render the updated content the standard calls
        # (which will selectively render our fragment if applicable)
        context = self.get_context(object=self.object)
        return self.render_to_response(context)

    def htmx_post_close(self):
        self.object = self.get_object()

        if self.object.state != "open":
            raise ValueError("Only a open pull request can be closed")

        self.object.state = "open"
        self.object.save()

        context = self.get_context(object=self.object)
        return self.render_to_response(context)

    def htmx_post_merge(self):
        self.object = self.get_object()

        if self.object.state != "open":
            raise ValueError("Only a open pull request can be merged")

        self.object.state = "merged"
        self.object.save()

        context = self.get_context(object=self.object)
        return self.render_to_response(context)
```

This can be a matter of preference,
but typically you may end up building out an entire form, API, or set of URLs to handle these behaviors.
If you application is only going to handle these actions via HTMX,
then a single View may be a simpler way to do it.

Note that currently we don't have many helper-functions for parsing or returning HTMX responses --
this can basically all be done through standard request and response headers:

```python
class PullRequestDetailView(HTMXViewMixin, DetailView):
    def get_queryset(self):
        # The queryset will apply to all actions on the view, so "permission" logic can be shared
        return super().get_queryset().filter(users=self.request.user)

    # You can also leave off the "plain-hx-action" attribute and just handle the HTTP method
    def htmx_delete(self):
        self.object = self.get_object()

        self.object.delete()

        # Tell HTMX to do a client-side redirect when it receives the response
        response = HttpResponse(status=204)
        response["HX-Redirect"] = "/"
        return response
```

## Dedicated Templates

A small additional features of `plain-htmx` is that it will automatically find templates named `{template_name}_htmx.html` for HTMX requests.
More than anything, this is just a nice way to formalize a naming scheme for template "partials" dedicated to HTMX.

Because template fragments don't work inside of loops,
for example,
you'll often need to define dedicated URLs to handle the HTMX behaviors for individual items in a loop.
You can sometimes think of these as "pages within a page".

So if you have a template that renders a collection of items,
you can do the initial render using a Django `{% include %}`:

```html
<!-- pullrequests/pullrequest_list.html -->
{% extends "base.html" %}

{% block content %}

{% for pullrequest in pullrequests %}
<div>
  {% include "pullrequests/pullrequest_detail_htmx.html" %}
</div>
{% endfor %}

{% endblock %}
```

And then subsequent HTMX requests/actions on individual items can be handled by a separate URL/View:

```html
<!-- pullrequests/pullrequest_detail_htmx.html -->
<div hx-url="{% url 'pullrequests:detail' pullrequest.uuid %}" hx-swap="outerHTML" hx-target="this">
  <!-- Send all HTMX requests to a URL for single pull requests (works inside of a loop, or on a single detail page) -->
  <h2>{{ pullrequest.title }}</h2>
  <button hx-get>Refresh</button>
  <button hx-post plain-hx-action="update">Update</button>
</div>
```

*If* you need a URL to render an individual item, you can simply include the same template fragment in most cases:

```html
<!-- pullrequests/pullrequest_detail.html -->
{% extends "base.html" %}

{% block content %}

{% include "pullrequests/pullrequest_detail_htmx.html" %}

{% endblock %}
```

```python
# urls.py and views.py
# urls.py
default_namespace = "pullrequests"

urlpatterns = [
  path("<uuid:uuid>/", views.PullRequestDetailView, name="detail"),
]

# views.py
class PullRequestDetailView(HTMXViewMixin, DetailView):
  def htmx_post_update(self):
      self.object = self.get_object()

      self.object.update()

      context = self.get_context(object=self.object)
      return self.render_to_response(context)
```

## Tailwind CSS variant

The standard behavior for `{% htmxfragment %}` is to set `hx-indicator="this"` on the rendered element.
This tells HTMX to add the `htmx-request` class to the fragment element when it is loading.

Since Plain emphasizes using Tailwind CSS,
here's a simple variant you can add to your `tailwind.config.js` to easily style the loading state:

```js
const plugin = require('tailwindcss/plugin')

module.exports = {
  plugins: [
    // Add variants for htmx-request class for loading states
    plugin(({addVariant}) => addVariant('htmx-request', ['&.htmx-request', '.htmx-request &']))
  ],
}
```

You can then prefix any class with `htmx-request:` to decide what it looks like while HTMX requests are being sent:

```html
<!-- The "htmx-request" class will be added to the <form> by default -->
<form hx-post="{{ url }}">
    <!-- Showing an element -->
    <div class="hidden htmx-request:block">
        Loading
    </div>

    <!-- Changing a button's class -->
    <button class="text-white bg-black htmx-request:opacity-50 htmx-request:cursor-wait" type="submit">Submit</button>
</form>
```

## CSRF tokens

We configure CSRF tokens for you with the HTMX JS API.
You don't have to put `hx-headers` on the `<body>` tag, for example.

## Error classes

This app also includes an HTMX extension for adding error classes for failed requests.

- `htmx-error-response` for `htmx:responseError`
- `htmx-error-response-{{ status_code }}` for `htmx:responseError`
- `htmx-error-send` for `htmx:sendError`

To enable them, use `hx-ext="error-classes"`.

You can add the ones you want as Tailwind variants and use them to show error messages.

```js
const plugin = require('tailwindcss/plugin')

module.exports = {
  plugins: [
    // Add variants for htmx-request class for loading states
    plugin(({addVariant}) => addVariant('htmx-error-response-429', ['&.htmx-error-response-429', '.htmx-error-response-429 &']))
  ],
}
```

## CSP

```
<meta name="htmx-config" content='{"includeIndicatorStyles":false}'>
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dropseed/plain",
    "name": "plain.htmx",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": "Dave Gaeddert",
    "author_email": "dave.gaeddert@dropseed.dev",
    "download_url": "https://files.pythonhosted.org/packages/88/bf/533d8295b6a368c45bd8110b82290d1a4254327690e6331a232adcb34968/plain_htmx-0.2.1.tar.gz",
    "platform": null,
    "description": "<!-- This file is compiled from plain-htmx/plain/htmx/README.md. Do not edit this file directly. -->\n\n# HTMX\n\nIntegrate HTMX with templates and views.\n\nThe `plain-htmx` package adds a couple of unique features for working with HTMX.\nOne is [template fragments](#template-fragments) and the other is [view actions](#view-actions).\n\nThe combination of these features lets you build HTMX-powered views that focus on server-side rendering and avoid overly complicated URL structures or REST APIs that you may not otherwise need.\n\nThe `HTMXViewMixin` is the starting point for the server-side HTMX behavior.\nTo use these feaures on a view,\nsimply inherit from the class (yes, this is designed to work with class-based views).\n\n```python\nfrom plain.views import TemplateView\n\nfrom plain.htmx.views import HTMXViewMixin\n\n\nclass HomeView(HTMXViewMixin, TemplateView):\n    template_name = \"home.html\"\n```\n\nIn your `base.html` template (or wherever need the HTMX scripts),\nyou can use the `{% htmx_js %}` template tag:\n\n```html\n<!-- base.template.html -->\n{% load htmx %}\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>My Site</title>\n    {% htmx_js %}\n</head>\n<body>\n    {% block content %}{% endblock %}\n</body>\n```\n\n## Installation\n\n```python\nINSTALLED_PACKAGES = [\n    # ...\n    \"plain.htmx\",\n]\n```\n\n## Template Fragments\n\nAn `{% htmxfragment %}` can be used to render a specific part of your template in HTMX responses.\nWhen you use a fragment, all `hx-get`, `hx-post`, etc. elements inside that fragment will automatically send a request to the current URL,\nrender *only* the updated content for the fragment,\nand swap out the fragment.\n\nHere's an example:\n\n```html\n<!-- home.html -->\n{% extends \"base.html\" %}\n\n{% load htmx %}\n\n{% block content %}\n<header>\n  <h1>Page title</h1>\n</header>\n\n<main>\n  {% htmxfragment main %}\n  <p>The time is {% now \"jS F Y H:i\" %}</p>\n\n  <button hx-get>Refresh</button>\n  {% endhtmxfragment %}\n</main>\n{% endblock %}\n```\n\nEverything inside `{% htmxfragment %}` will automatically update when \"Refresh\" is clicked.\n\n### Lazy template fragments\n\nIf you want to render a fragment lazily,\nyou can add the `lazy` attribute to the `{% htmxfragment %}` tag.\n\n```html\n{% htmxfragment main lazy=True %}\n<!-- This content will be fetched with hx-get -->\n{% endhtmxfragment %}\n```\n\nThis pairs nicely with passing a callable function or method as a context variable,\nwhich will only get invoked when the fragment actually gets rendered on the lazy load.\n\n```python\ndef fetch_items():\n    import time\n    time.sleep(2)\n    return [\"foo\", \"bar\", \"baz\"]\n\n\nclass HomeView(HTMXViewMixin, TemplateView):\n    def get_context(self, **kwargs):\n        context = super().get_context(**kwargs)\n        context[\"items\"] = fetch_items  # Missing () are on purpose!\n        return context\n```\n\n```html\n{% htmxfragment main lazy=True %}\n<ul>\n  {% for item in items %}\n    <li>{{ item }}</li>\n  {% endfor %}\n</ul>\n{% endhtmxfragment %}\n```\n\n### How does it work?\n\nWhen you use the `{% htmxfragment %}` tag,\na standard `div` is output that looks like this:\n\n```html\n<div plain-hx-fragment=\"main\" hx-swap=\"outerHTML\" hx-target=\"this\" hx-indicator=\"this\">\n  {{ fragment_content }}\n</div>\n```\n\nThe `plain-hx-fragment` is a custom attribute that we've added (\"F\" is for \"Forge\"),\nbut the rest are standard HTMX attributes.\n\nWhen Plain renders the response to an HTMX request,\nit will get the `Plain-HX-Fragment` header,\nfind the fragment with that name in the template,\nand render that for the response.\n\nThen the response content is automatically swapped in to replace the content of your `{% htmxfragment %}` tag.\n\nNote that there is no URL specified on the `hx-get` attribute.\nBy default, HTMX will send the request to the current URL for the page.\nWhen you're working with fragments, this is typically the behavior you want!\n(You're on a page and want to selectively re-render a part of that page.)\n\nThe `{% htmxfragment %}` tag is somewhat similar to a `{% block %}` tag --\nthe fragments on a page should be named and unique,\nand you can't use it inside of loops.\nFor fragment-like behavior inside of a for-loop,\nyou'll most likely want to set up a dedicated URL that can handle a single instance of the looped items,\nand maybe leverage [dedicated templates](#dedicated-templates).\n\n## View Actions\n\nView actions let you define multiple \"actions\" on a class-based view.\nThis is an alternative to defining specific API endpoints or form views to handle basic button interactions.\n\nWith view actions you can design a single view that renders a single template,\nand associate buttons in that template with class methods in the view.\n\nAs an example, let's say we have a `PullRequest` model and we want users to be able to open, close, or merge it with a button.\n\nIn our template, we would use the `plain-hx-action` attribute to name the action:\n\n```html\n{% extends \"base.html\" %}\n\n{% load htmx %}\n\n{% block content %}\n<header>\n  <h1>{{ pullrequest }}</h1>\n</header>\n\n<main>\n  {% htmxfragment pullrequest %}\n  <p>State: {{ pullrequest.state }}</p>\n\n  {% if pullrequest.state == \"open\" %}\n    <!-- If it's open, they can close or merge it -->\n    <button hx-post plain-hx-action=\"close\">Close</button>\n    <button hx-post plain-hx-action=\"merge\">Merge</button>\n  {% else if pullrequest.state == \"closed\" %}\n    <!-- If it's closed, it can be re-opened -->\n    <button hx-post plain-hx-action=\"open\">Open</button>\n  {% endif %}\n\n  {% endhtmxfragment %}\n</main>\n{% endblock %}\n```\n\nThen in the view class, we can define methods for each HTTP method + `plain-hx-action`:\n\n```python\nclass PullRequestDetailView(HTMXViewMixin, DetailView):\n    def get_queryset(self):\n        # The queryset will apply to all actions on the view, so \"permission\" logic can be shared\n        return super().get_queryset().filter(users=self.request.user)\n\n    # Action handling methods follow this format:\n    # htmx_{method}_{action}\n    def htmx_post_open(self):\n        self.object = self.get_object()\n\n        if self.object.state != \"closed\":\n            raise ValueError(\"Only a closed pull request can be opened\")\n\n        self.object.state = \"closed\"\n        self.object.save()\n\n        # Render the updated content the standard calls\n        # (which will selectively render our fragment if applicable)\n        context = self.get_context(object=self.object)\n        return self.render_to_response(context)\n\n    def htmx_post_close(self):\n        self.object = self.get_object()\n\n        if self.object.state != \"open\":\n            raise ValueError(\"Only a open pull request can be closed\")\n\n        self.object.state = \"open\"\n        self.object.save()\n\n        context = self.get_context(object=self.object)\n        return self.render_to_response(context)\n\n    def htmx_post_merge(self):\n        self.object = self.get_object()\n\n        if self.object.state != \"open\":\n            raise ValueError(\"Only a open pull request can be merged\")\n\n        self.object.state = \"merged\"\n        self.object.save()\n\n        context = self.get_context(object=self.object)\n        return self.render_to_response(context)\n```\n\nThis can be a matter of preference,\nbut typically you may end up building out an entire form, API, or set of URLs to handle these behaviors.\nIf you application is only going to handle these actions via HTMX,\nthen a single View may be a simpler way to do it.\n\nNote that currently we don't have many helper-functions for parsing or returning HTMX responses --\nthis can basically all be done through standard request and response headers:\n\n```python\nclass PullRequestDetailView(HTMXViewMixin, DetailView):\n    def get_queryset(self):\n        # The queryset will apply to all actions on the view, so \"permission\" logic can be shared\n        return super().get_queryset().filter(users=self.request.user)\n\n    # You can also leave off the \"plain-hx-action\" attribute and just handle the HTTP method\n    def htmx_delete(self):\n        self.object = self.get_object()\n\n        self.object.delete()\n\n        # Tell HTMX to do a client-side redirect when it receives the response\n        response = HttpResponse(status=204)\n        response[\"HX-Redirect\"] = \"/\"\n        return response\n```\n\n## Dedicated Templates\n\nA small additional features of `plain-htmx` is that it will automatically find templates named `{template_name}_htmx.html` for HTMX requests.\nMore than anything, this is just a nice way to formalize a naming scheme for template \"partials\" dedicated to HTMX.\n\nBecause template fragments don't work inside of loops,\nfor example,\nyou'll often need to define dedicated URLs to handle the HTMX behaviors for individual items in a loop.\nYou can sometimes think of these as \"pages within a page\".\n\nSo if you have a template that renders a collection of items,\nyou can do the initial render using a Django `{% include %}`:\n\n```html\n<!-- pullrequests/pullrequest_list.html -->\n{% extends \"base.html\" %}\n\n{% block content %}\n\n{% for pullrequest in pullrequests %}\n<div>\n  {% include \"pullrequests/pullrequest_detail_htmx.html\" %}\n</div>\n{% endfor %}\n\n{% endblock %}\n```\n\nAnd then subsequent HTMX requests/actions on individual items can be handled by a separate URL/View:\n\n```html\n<!-- pullrequests/pullrequest_detail_htmx.html -->\n<div hx-url=\"{% url 'pullrequests:detail' pullrequest.uuid %}\" hx-swap=\"outerHTML\" hx-target=\"this\">\n  <!-- Send all HTMX requests to a URL for single pull requests (works inside of a loop, or on a single detail page) -->\n  <h2>{{ pullrequest.title }}</h2>\n  <button hx-get>Refresh</button>\n  <button hx-post plain-hx-action=\"update\">Update</button>\n</div>\n```\n\n*If* you need a URL to render an individual item, you can simply include the same template fragment in most cases:\n\n```html\n<!-- pullrequests/pullrequest_detail.html -->\n{% extends \"base.html\" %}\n\n{% block content %}\n\n{% include \"pullrequests/pullrequest_detail_htmx.html\" %}\n\n{% endblock %}\n```\n\n```python\n# urls.py and views.py\n# urls.py\ndefault_namespace = \"pullrequests\"\n\nurlpatterns = [\n  path(\"<uuid:uuid>/\", views.PullRequestDetailView, name=\"detail\"),\n]\n\n# views.py\nclass PullRequestDetailView(HTMXViewMixin, DetailView):\n  def htmx_post_update(self):\n      self.object = self.get_object()\n\n      self.object.update()\n\n      context = self.get_context(object=self.object)\n      return self.render_to_response(context)\n```\n\n## Tailwind CSS variant\n\nThe standard behavior for `{% htmxfragment %}` is to set `hx-indicator=\"this\"` on the rendered element.\nThis tells HTMX to add the `htmx-request` class to the fragment element when it is loading.\n\nSince Plain emphasizes using Tailwind CSS,\nhere's a simple variant you can add to your `tailwind.config.js` to easily style the loading state:\n\n```js\nconst plugin = require('tailwindcss/plugin')\n\nmodule.exports = {\n  plugins: [\n    // Add variants for htmx-request class for loading states\n    plugin(({addVariant}) => addVariant('htmx-request', ['&.htmx-request', '.htmx-request &']))\n  ],\n}\n```\n\nYou can then prefix any class with `htmx-request:` to decide what it looks like while HTMX requests are being sent:\n\n```html\n<!-- The \"htmx-request\" class will be added to the <form> by default -->\n<form hx-post=\"{{ url }}\">\n    <!-- Showing an element -->\n    <div class=\"hidden htmx-request:block\">\n        Loading\n    </div>\n\n    <!-- Changing a button's class -->\n    <button class=\"text-white bg-black htmx-request:opacity-50 htmx-request:cursor-wait\" type=\"submit\">Submit</button>\n</form>\n```\n\n## CSRF tokens\n\nWe configure CSRF tokens for you with the HTMX JS API.\nYou don't have to put `hx-headers` on the `<body>` tag, for example.\n\n## Error classes\n\nThis app also includes an HTMX extension for adding error classes for failed requests.\n\n- `htmx-error-response` for `htmx:responseError`\n- `htmx-error-response-{{ status_code }}` for `htmx:responseError`\n- `htmx-error-send` for `htmx:sendError`\n\nTo enable them, use `hx-ext=\"error-classes\"`.\n\nYou can add the ones you want as Tailwind variants and use them to show error messages.\n\n```js\nconst plugin = require('tailwindcss/plugin')\n\nmodule.exports = {\n  plugins: [\n    // Add variants for htmx-request class for loading states\n    plugin(({addVariant}) => addVariant('htmx-error-response-429', ['&.htmx-error-response-429', '.htmx-error-response-429 &']))\n  ],\n}\n```\n\n## CSP\n\n```\n<meta name=\"htmx-config\" content='{\"includeIndicatorStyles\":false}'>\n```\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "HTMX integration for Plain.",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/dropseed/plain",
        "Repository": "https://github.com/dropseed/plain"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aa1d2aa0d15192c1098629f36ba78b14592ab119b443ec73d6a78755a9132ed1",
                "md5": "5731cc2d096eaf63af2d094732431d6f",
                "sha256": "ecd4892f403582a9fa831f9f5d94127f450e4ed007ed2aaf7ae25e3d59a15982"
            },
            "downloads": -1,
            "filename": "plain_htmx-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5731cc2d096eaf63af2d094732431d6f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 197676,
            "upload_time": "2024-09-26T19:29:55",
            "upload_time_iso_8601": "2024-09-26T19:29:55.045424Z",
            "url": "https://files.pythonhosted.org/packages/aa/1d/2aa0d15192c1098629f36ba78b14592ab119b443ec73d6a78755a9132ed1/plain_htmx-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "88bf533d8295b6a368c45bd8110b82290d1a4254327690e6331a232adcb34968",
                "md5": "b5395f11e9892dd016a054a2162ccd4d",
                "sha256": "c101598a05244fbdcec5e3bf52836358989051e2a383e45b758da3033d79456a"
            },
            "downloads": -1,
            "filename": "plain_htmx-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b5395f11e9892dd016a054a2162ccd4d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 181276,
            "upload_time": "2024-09-26T19:29:56",
            "upload_time_iso_8601": "2024-09-26T19:29:56.194164Z",
            "url": "https://files.pythonhosted.org/packages/88/bf/533d8295b6a368c45bd8110b82290d1a4254327690e6331a232adcb34968/plain_htmx-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-26 19:29:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dropseed",
    "github_project": "plain",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "plain.htmx"
}
        
Elapsed time: 0.37930s