I am an HTML extremist. There’s this argument I often hear: “But HTML is cumbersome to write!” Wrong, as many other myths about HTML. In this post, I’m detailing how I write my dialect of HTML and why it’s easy.
This Pidgin HTML dialect is intimately tied to my website setup: I’m using ed(1) as my Static Site Generator. Which means the setup is:
This setup is no rocket science, doing sloppy tags, regex substitutions, and shell scripts. And yet it results in a dialect of HTML that’s easy/er to write. And almost standard/conventional. Here’s a set of engines I’m testing my markup with:
So yeah, it does work everywhere, even as the raw source form.
You can see the initial Pidgin HTML for this post rendered at pidgin.htm, and download it to preview the text behind it. On to the quirks then!
HTML links are slightly painful to type out. So I made my own syntax, knowing that my build regex will expand it for me:
<a just.htm>local link to other post</a> <a //something.com>Scheme-relative link</a> <a aartaka.me>Arbitrary link without https:// formalities</a>
There’s a bunch of other tags, like
I think this is the heritage of sloppy HTML 1/2/3 programming.
You know, with shortcuts following authors’ practice.
The primordial chaos reigning in the early Internet.
Long story short, you don’t have to close
You may’ve noticed the
Having these, I can generate sensible HTML with ed(1) scripts.
While having the convenience of shortcuts in standard HTML.
All according to the spec!
Here’s a fun one: HTML spec forbids putting anything into closing tags (anything after
I mean, it’s not a caption per se.
And it renders as plain
A thing partially related to closing tag contents: HTML allows anything as attributes.
This previous sentence might work well as an attribute set:
I’m using that for e.g. tables and
And I’m using
In case you ever opened the inspector
on some major site,
you might’ve seen these
These are useless in the modern post-IE world.
That’s why I’m exploiting them to generate format-specific content.
Say, making a link footer when generating Gemtext from this Pidgin HTML:
Another point of reference might be
Server Side Includes.
Initially Apache-specific format of commands embedded into HTML (or, rather .shtml) pages.
Allowing file inclusion, conditional expansion, shell/CGI command execution etc.
A much needed logic-ful HTML extension.
So I’m using SSI as an inspiration, making my own
This is recognized as a mere starting tag.
Or, in case of the SSI version, as a comment.
Harmless.
Let this post be a praise to
Pidgin HTML is made possible by sloppiness of the standard/quirks HTML.
It’s still valid HTML, but one that is much easier to write.
Good for authoring as a hypertext alternative to Markdown.
And other Lightweight Markup Languages.
Don’t be afraid of HTML.
Write Pidgin HTML.
Implied End Tags
<p>
hello
<p>
another hello
<ul> one
<li> two
<li> wait, it’s not an ordered list?
</ul>
Closing Tag Space
<pre html>
<!-- ... -->
</pre Example of closing tag captions>
Arbitrary Attributes
<span HTML allows anything as attributes>...</span>
<!-- turns into -->
<span HTML="" allows="" anything="" as="" attributes="">...</span>
<details this ul...>
You may’ve noticed the ...
</details>
Magic IE Comments and Server Side Includes
<!--[if IE 9]>
<script src="https://www.mozilla.org/media/js/lib-ie.cf16e08599c3.js"></script>
<![endif]-->
<!--[if GMI]>
=> index.gmi Back to home page
=> about.gmi About & Contacts
=> uses.gmi Tech I Use
=> projects.gmi My projects
<![endif]-->
<include template/footer>
as a shorthand for
<!--#include file="template/footer" -->
Pidgin HTML is Still HTML
shortcuts of HTML,