26 lines
1.8 KiB
Plaintext
26 lines
1.8 KiB
Plaintext
## HTML Reader Writer (H-RW)
|
|
|
|
The goal is to be able to load html into swift from a file, manipulate it, then spit out html while retaining the benefits of a type safe language which serves as an alternative to templating. A BindingPlugin is also provided, this will analyze the html files and produce a swift file that will let you access html elements with IDs while retaining type infomation. Similar to Android's ViewBinding.
|
|
|
|
#### Thoughts
|
|
|
|
I suppose I wanted to be able to use plain html as is. In hindsight, it was too much effort for the payoff. This is mostly so I can build multipage websites with swift without the use of JS as a silly experiment.
|
|
|
|
There is also a HTML library called Plot that also lets you manipulate html, but it doesn't let you load it in from a file and treats HTML generations similarly to SwiftUI.
|
|
|
|
Perhaps this project can be repurposed as an LSP for html, but that's not much of an interest to me. It could also possibly be used to implement a renderer or translate html into a different UI format. However, I did not really take security into consideration when building this.
|
|
|
|
There is also an HTML parser in LadyBird thats partially written in Swift. It seems to call into c++ for a handful of things, so it doesn't seem to be reusable without that.
|
|
|
|
## License
|
|
|
|
The license is a modified version of the PolyForm Noncommercial License (1.0.0) to add more non-commercial and non-ai use stipulations. Basically, if you're not making money then it's free to use. Depending on the project, I am open to distributing this source under a different license.
|
|
|
|
## Contributions
|
|
|
|
All contributors must agree to the CLA within. It is primarily based on Apache's ICLA.
|
|
|
|
By signing off your git commits you are agreeing the CLA within the repository inside the file CLA.txt.
|
|
|
|
You can sign off your commits via the signoff flag `git commit --signoff`
|