Skip to content

Latest commit

Β 

History

History
89 lines (73 loc) Β· 1.73 KB

README.md

File metadata and controls

89 lines (73 loc) Β· 1.73 KB

Wild HTML

HTML with wild, unclosed tags. Saving you keystrokes β€” one unnecessary dependency at a time. πŸ˜‰

Closing tags are a thing of the past. Use responsible indentation instead, like Pug:

<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Wild Huh?
	<body>
		<div class="wrapper">
			<div class="stuff">
				<h2>Why even bother?
				<ol>
					<li>Cut your tag management in half.
					<li>Add another dependency to your project.
					<li>...There's really no point πŸ˜…

Yes, that's the full snippet (I know, it's weird at first). The Wild HTML processor will expand the above code into:

<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Wild Huh?
		</title>
	</head>
	<body>
		<div class="wrapper">
			<div class="stuff">
				<h2>Why even bother?
				</h2>
				<ol>
					<li>Cut your tag management in half.
					</li>
					<li>Add another dependency to your project.
					</li>
					<li>...There's really no point πŸ˜…
					</li>
				</ol>
			</div>
		</div>
	</body>
</html>

Yuck! Aren't you glad you've made the switch to Wild tags?

Using

So far, it's just a simple library that uses Node streams. You can import the processor and use it like so:

const fs = require('fs');
const { WildProcessor } = require('./wild-html.js');

var processor = new WildProcessor();
fs.createReadStream('./index.whtml')
	.pipe(processor)
	.pipe(fs.createWriteStream('./index.html'));

Known Issues

Only works with tabs at the moment.

Doesn't see manually closed tags.

<title>I closed this tag by myself!</title>

will be translated into

<title>I closed this tag by myself!</title>
</title>

License

ISC (see LICENSE file)