contact-app icon indicating copy to clipboard operation
contact-app copied to clipboard

Non-HTMX branch of code to work from.

Open banillie opened this issue 2 years ago • 6 comments

Hi there. I'm working my way through your excellent hypermedia book and I'm wondering if there could be a non or pre-htmx version/branch of the code to work from as a starting point from which htmx could be coded into by following the steps you describe in the book? Thank you.

banillie avatar Nov 02 '23 17:11 banillie

@banillie, I had a similar problem, so I went ahead and implemented the application in Go with code from individual chapters separated into branches.

The full repository is here: https://github.com/mousedownco/htmx-contact-app

And the code from Chapter 03 - A Web 1.0 Application is here: https://github.com/mousedownco/htmx-contact-app/tree/Ch03-A_Web_1.0_Application

mousedownmike avatar Nov 11 '23 22:11 mousedownmike

@mousedownmike thanks for sharing. Like you I think I'll probably build it from scratch before putting in the htmx examples. I'm not v familiar with flask, so also a good way to learn some of it.

banillie avatar Nov 19 '23 18:11 banillie

@banillie, I struggled a little bit with the missing.css file from missing.style. The version referenced in this repository doesn't appear to exist anymore, but everything seems to mostly work with the latest version 1.1.1.

Good luck with your implementation, it is a great way to learn!

mousedownmike avatar Nov 19 '23 19:11 mousedownmike

@mousedownmike Thanks for pointing out the missing.css v helpful. plus liking the styles!

banillie avatar Jan 23 '24 10:01 banillie

This is a really good idea -- I'm following along in the book, and currently I'm in the Flask / Web 1.0 section, up to the point where they show the table layout and joke about how it's not pretty. aAt that point, they have already left a lot out, including:

  • I had to figure out how to get Flask in the first place, and where to put even the first bits of code (I had to check the final repo to understand it should go a file such as app.py)
  • I also had to look at the Flask docs to understand how to run it with a flask --app app run command
  • The first rendering of the page is styled up in the book's example, even though if you write the code they give, there's no styling
  • If you follow along to the point where you've created an index.html, the app won't work because we never defined Contact

I'm really loving the book so far (I even posted about it), but at this point in the book there's a lot of things left out -- and that's a bummer, because they are so good about explaining things that I wish they'd followed their own steps and realized what was left out.

I hope the htmx version really does go step by step.

jwithington avatar Oct 12 '24 22:10 jwithington

You can use commit c72e01dabdaaafc41e1009b304c8bef467f83e47 (the one before adding the HTMX delete feature) which has the Web1 version of the code as the starting point and work from there? Seems to be working, but I've not tested it fully - I'm just going through the book now and using that as the starting point.

git checkout -b web1-version c72e01dabdaaafc41e1009b304c8bef467f83e47

juanshotyou avatar Nov 27 '24 13:11 juanshotyou