Examples from the book Hypermedia Systems.
The code here is slightly different from the book, as I try to use types where I can, and check for them using Mypy, a static type checker for Python.
PyTest is used for testing. While inside an example directory simply run pytest
to run the tests for that example.
Clone the repo...
git clone https://github.com/juliojimenez/hypermedia.systems
Go to an example...
cd chapter-3/1-simple-hello-world/
And run it...
pip3 install -r requirements.txt
python3 app.py
Each example runs on a different port. Run multiple examples simultaneously and compare them in the browser!
- Simple Hello World
- Simple Hello World to a Redirect
- Showing a Searchable List of Contacts
- Adding a New Contact
- Viewing the Details of a Contact
- Editing a Contact
- Deleting a Contact
- Installing HTMX as a Third Party Dependency
- Triggering HTTP Requests
- HTMX vs. Plain HTML Responses
- Targeting Other Elements
- Swap Styles
- Using Events
- Passing Request Parameters
- History Support
- Installing HTMX as a Vendored Dependency
- Adding hx-boost to Contacts.app
- A Second Step: Deleting Contacts With HTTP DELETE
- Next Steps: Validating Contact Emails
- Another Application Improvement: Paging
Python 3.11+