ezhtml is my quickly-defunct VSCode Extension made during my time studying at JMU. Initially it was intended to be a way to run arbitrary, pre-defined JavaScript functions to modify text in an HTML file, somewhat as a way to generate static webpage content with functions up front without the use of PHP or a separate runtime for site generation. This would leverage both the fact JS is an interpreted language as well as the fact VSCode runs as a pseudo-browser through Electron, with extensions running on a NodeJS backend, to interpret saved text as a JS Function object and run it. The functions would be paired with a user-defined tag which would be parsed by VSCode's built-in HTML language server to get its contained text and pass that text to the tag's associated function. Whatever text is then output by that function would then replace the tag and its contents, essentially allowing one-time static generation of HTML using JS functions.
For example, if I were to specify a tag and function pair to be:
| User-Defined `(tagname, function)` Pair |
|---|
(upper, (text) => { return text.toUpperCase(); }) |
the following conversion should take place once expansion is requested:
| Before | After |
|---|---|
<div><p><upper>This is some inner text!</upper></p></div> |
<div><p>THIS IS SOME INNER TEXT!</p></div> |
This project slowly became less and less useful for me as time went on and I discovered a much more painless and consistent workflow for static site generation in PHP and automation scripts. On top of that, I became increasingly aware during my time programming how difficult it was to interface with VSCode's bundled HTML language server and Emmet, with some aspects being seemingly impossible to actually use without running my own instance of the HTML language server. These reasons coupled with schoolwork to make me desert the project entirely after creating a simple working prototype.
Through my time programming this extension I learned a lot about reading open source code and API documentation due to interfacing with various aspects of VSCode's built-in tools. This also was one of my first personal projects which I completely determined by own path for, grading criteria or textbook to help guide me. While it was inevitably abandoned (the first of many projects), it was a great way to learn some about programming on my own, and, somewhat most importantly, when to move on from a project which is going nowhere and just eating up time for no real gain.