Skip to content

Commit f96e11f

Browse files
committed
Compile readmes
1 parent 2ab5f31 commit f96e11f

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

bolt-htmx/README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!-- This file is compiled from bolt-htmx/bolt/htmx/README.md. Do not edit this file directly. -->
22

3-
# bolt-htmx
3+
# HTMX
44

55
Integrate HTMX with templates and views.
66

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

1010
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.
@@ -43,14 +43,6 @@ you can use the `{% htmx_js %}` template tag:
4343

4444
## Installation
4545

46-
You can install `bolt-htmx` with any Django project:
47-
48-
```sh
49-
pip install bolt-htmx
50-
```
51-
52-
Then add `bolt.htmx` to `settings.py`:
53-
5446
```python
5547
INSTALLED_PACKAGES = [
5648
# ...
@@ -142,7 +134,7 @@ a standard `div` is output that looks like this:
142134
The `bolt-hx-fragment` is a custom attribute that we've added ("F" is for "Forge"),
143135
but the rest are standard HTMX attributes.
144136

145-
When Django renders the response to an HTMX request,
137+
When Bolt renders the response to an HTMX request,
146138
it will get the `Bolt-HX-Fragment` header,
147139
find the fragment with that name in the template,
148140
and render that for the response.
@@ -211,7 +203,7 @@ class PullRequestDetailView(HTMXViewMixin, DetailView):
211203

212204
# Action handling methods follow this format:
213205
# htmx_{method}_{action}
214-
def htmx_post_open(self, request, *args, **kwargs):
206+
def htmx_post_open(self):
215207
self.object = self.get_object()
216208

217209
if self.object.state != "closed":
@@ -225,7 +217,7 @@ class PullRequestDetailView(HTMXViewMixin, DetailView):
225217
context = self.get_context(object=self.object)
226218
return self.render_to_response(context)
227219

228-
def htmx_post_close(self, request, *args, **kwargs):
220+
def htmx_post_close(self):
229221
self.object = self.get_object()
230222

231223
if self.object.state != "open":
@@ -237,7 +229,7 @@ class PullRequestDetailView(HTMXViewMixin, DetailView):
237229
context = self.get_context(object=self.object)
238230
return self.render_to_response(context)
239231

240-
def htmx_post_merge(self, request, *args, **kwargs):
232+
def htmx_post_merge(self):
241233
self.object = self.get_object()
242234

243235
if self.object.state != "open":
@@ -265,7 +257,7 @@ class PullRequestDetailView(HTMXViewMixin, DetailView):
265257
return super().get_queryset().filter(users=self.request.user)
266258

267259
# You can also leave off the "bolt-hx-action" attribute and just handle the HTTP method
268-
def htmx_delete(self, request, *args, **kwargs):
260+
def htmx_delete(self):
269261
self.object = self.get_object()
270262

271263
self.object.delete()
@@ -340,7 +332,7 @@ urlpatterns = [
340332

341333
# views.py
342334
class PullRequestDetailView(HTMXViewMixin, DetailView):
343-
def htmx_post_update(self, request, *args, **kwargs):
335+
def htmx_post_update(self):
344336
self.object = self.get_object()
345337

346338
self.object.update()

0 commit comments

Comments
 (0)