Skip to content

docs(#13): documentation overhaul - #209

Merged
yaakovLowenstein merged 13 commits into
masterfrom
audit2/docs-overhaul
Jul 9, 2026
Merged

docs(#13): documentation overhaul#209
yaakovLowenstein merged 13 commits into
masterfrom
audit2/docs-overhaul

Conversation

@yaakovLowenstein

Copy link
Copy Markdown
Owner

Audit round 2, item #13. Stacked PR 6 of 6, base audit2/test-suite-improvements. One commit per fix:

  • Tutorials work under the default auth gate; fix FormHxRequest import, GET_block, and the get_or_create tuple.
  • Correct hx_kwargs name, context-refresh hook names, the OOB dict-blocks warning, the more_how_tos form_invalid example, and the modal how-to (selector, class name, broken ref).
  • Fix stale DeleteHxRequest/ModalHxRequest docstrings and an assortment of small doc inaccuracies (header names, get_initial self, is_hx_request semantics, W001 MRO caveat, config defaults, truncated CHANGELOG note).
  • Document undocumented public features: install/version floors, HX_REQUESTS_BIND_TOKEN_TO_PATH, {% hx_url %}, and the phase-keyed trigger dict.

Note: the tutorial-auth fix is adapted to this 0.51.0 base (which excludes #201); revisit once per-handler auth lands.

🤖 Generated with Claude Code

@yaakovLowenstein
yaakovLowenstein force-pushed the audit2/test-suite-improvements branch 2 times, most recently from 4e8782d to 1cf31ed Compare July 9, 2026 17:14
Base automatically changed from audit2/test-suite-improvements to master July 9, 2026 17:16
yaakovLowenstein and others added 13 commits July 9, 2026 13:19
Both tutorials issue requests as an anonymous user, but HX_REQUESTS_REQUIRE_AUTH
defaults to True, so the first click 404'd. Add a settings step relaxing the
gate (pointing at the securing how-to for real setups). Also fix a stale
cross-reference to the messages how-to ("How To Use Messages" -> the actual
"How To Set Messages" title).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- `blocks = "content"` is not an attribute; the block attribute is GET_block.
- get_or_create returns a (user, created) tuple, so context["user"] held the
  tuple and {{ user.username }} rendered nothing -- unpack the user.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
`from hx_requests import FormHxRequest` raises ImportError -- the package
__init__ only exposes __version__. Import from hx_requests.hx_requests, as
the basic tutorial already does for BaseHxRequest.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
With kwargs_as_context = False the kwargs are placed in the context under
hx_kwargs (get_context_data), not kwargs. Fix the prose and the template
snippet (and a "tmeplate" typo).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There is no self.messages attribute; messages go through Django's
messages.error(self.request, ...). Also fix the hook signature
(form_invalid(self, **kwargs)) and the super() call (**kwargs).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Both pages named get_post_context_data / refresh_views_context_on_post
(neither exists). The actual names are get_context_on_POST and
refresh_views_context_on_POST.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The old warning said setting GET_template to an empty string suppresses the
view's template. It does not: a falsy GET_template falls back to the view's
template, and the dict-blocks render path always appends the resolved
template in full after the blocks. Rewrite the warning to describe the
append behavior and set the example to a real target template.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- HX_REQUESTS_MODAL_BODY_ID is a CSS selector used as the HX-Retarget value,
  so its default is #hx_modal_body; the docs showed hx_modal_body (missing #),
  which breaks form-error retargeting.
- closeHxModal is triggered by FormModalHxRequest, not the nonexistent
  HxModalHxRequest.
- Fix the malformed FormHxRequest cross-reference.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
These publish via autoapi. DeleteHxRequest said to override handle_delete;
the hook is delete. ModalHxRequest claimed a classless 'hx-modal' usage that
was never registered; describe the real usage (subclass it, set name and
GET_template).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- add_headers: header names are HX-Trigger/HX-Redirect/HX-Refresh (not
  Hx-Triggers); the dynamic-redirect example called super().form_invalid(form)
  with an undefined `form` -> **kwargs.
- add_form_kwargs: get_initial was missing self.
- detect_hx_request: is_hx_request checks the signature only, not that the
  name is registered.
- how_hx_requests_works: note the MRO-ordering caveat (W001) -- auth mixins
  must precede HtmxViewMixin to gate the handoff path.
- config: HX_REQUESTS_GLOBAL_ALLOW / HX_REQUESTS_UNAUTHENTICATED_ALLOW default
  to None, not [] / {}.
- CHANGELOG: complete the truncated v0.48.0 breaking-change note.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- README: add an Installation section noting the Python 3.11+ / Django 4.2+
  floors.
- config: document HX_REQUESTS_BIND_TOKEN_TO_PATH (the path-binding kill
  switch), which was missing from the settings reference.
- hx_tags reference: document the {% hx_url %} tag (returns just the signed
  URL for building custom request attributes).
- add_headers: document the phase-keyed get_triggers dict
  (HX-Trigger / -After-Settle / -After-Swap) and trigger_header_map.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The test-suite design spec was an internal working document that slipped
into the published docs tree (it was never in any toctree). Remove it and
gitignore docs/superpowers/ and .claude/ so local agent/spec working files
don't get committed again.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The serialization explanation still described the old scheme where each
kwarg was ``___``-prefixed inside the signed token. The code stores kwargs
under their real names in the token's ``kwargs`` sub-dict with no prefix
(serialize_kwargs / deserialize_kwargs). Update the explanation and the two
stale ``___``-prefixed examples (detect_hx_request, securing_hx_requests),
and correct the "two ways to register" count to match the three documented
approaches.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@yaakovLowenstein
yaakovLowenstein merged commit 977ee66 into master Jul 9, 2026
2 checks passed
@yaakovLowenstein
yaakovLowenstein deleted the audit2/docs-overhaul branch July 9, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant