htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Automatically generate Web Types for the package based on current documentation

Open piotrtomiak opened this issue 11 months ago • 1 comments

Description

This change adds a build step, which will regenerate web-types based on existing documentation. Special support for htmx-on: has been added as well.

untitled8-1 – sdsad html 2024-12-12 12-28-54

Checklist

  • [x] I have read the contribution guidelines
  • [x] I have targeted this PR against the correct branch (master for website changes, dev for source changes)
  • [ ] This is either a bugfix, a documentation update, or a new feature that has been explicitly approved via an issue
  • [x] I ran the test suite locally (npm run test) and verified that it succeeded

piotrtomiak avatar Dec 12 '24 11:12 piotrtomiak

It would be great if you can provide an SVG 32x32 with the HTMX icon. I could then set the icon for all of HTMX attributes, css classes and events.

piotrtomiak avatar Dec 12 '24 13:12 piotrtomiak

Heya @piotrtomiak thank you very much for this contribution. I am not really qualified to review it, but I will ask if anyone on the core team feels like they can. If not, I will pluck up the courage to look at it. :)

There is a (dark mode) svg icon for htmx here:

https://bestofjs.org/logos/htmx.dark.svg

1cg avatar Feb 25 '25 23:02 1cg

@1cg - thanks! The code doesn't touch any of the HTMX code, it just adds a build script to generate the web-types file based on the available documentation, so I guess it's a new stuff for anyone reviewing ;) I'll update the PR with the icon soon.

piotrtomiak avatar Feb 28 '25 12:02 piotrtomiak

@1cg - I've added default icon, so all of the HTMX symbol are going to have the HTMX icon:

untitled97 – test html 2025-03-04 13-27-15

piotrtomiak avatar Mar 04 '25 12:03 piotrtomiak

One thing I am not sure is whether the web-types file should be checked in. Since it's generated, it would be natural to not check it in, but on the other hand, if something goes wrong with generation, you wouldn't notice that. So I think it's better to check it in.

piotrtomiak avatar Mar 04 '25 12:03 piotrtomiak

@1cg - any chance you could review this?

piotrtomiak avatar Mar 14 '25 15:03 piotrtomiak

Hi @piotrtomiak sorry for such a long delay on this. I am going to merge it. Can I ask that you be available for any maintenance issues on it, because I don't know how web types work at all. Is it possible to add a canary test that will alert us if something has gone wrong?

1cg avatar Jun 02 '25 17:06 1cg

This functionality looks fantastic, by the way.

1cg avatar Jun 02 '25 17:06 1cg

@1cg - thanks for merging that! There are two kinds of problems, which may arise:

  1. The build fails, which is pretty easy to spot ;)
  2. Something goes wrong with the generated contents.

The second one is slightly harder to notice, but since the file is being checked in into the repo, you can verify that the updates are OK. This would mainly arise if you drastically change how you structure your documentation files.

In any case I am available for help.

piotrtomiak avatar Jun 03 '25 06:06 piotrtomiak

Oh, and it would be good to regenerate the file each time you change documentation, just to have the current version checked in into the repo.

piotrtomiak avatar Jun 03 '25 07:06 piotrtomiak