Skip to content

Instantly share code, notes, and snippets.

@parallelist
Created October 2, 2013 22:13
Show Gist options
  • Save parallelist/6801274 to your computer and use it in GitHub Desktop.
Save parallelist/6801274 to your computer and use it in GitHub Desktop.
This:
"<!DOCTYPE html>"
<html
<!-- this is a comment, just as normal html -->
<// This comment lasts for a line and doesn’t make it into the output
</* This comment lasts for more
than one line and ends like this: */>
<head <title "Page title">
<meta(charset:UTF-8)>
<body(id:"example", class:more pylons)
<h1 "Page title">
<section
<nav <ol <li <a(href:foo.html) "foo">>
<li <a(href:bar.html) "bar">>>>>
<p "Here is a pargraph with lots of text placed
on more than one line. OK, not lots of text
but more than a little">>>
Becomes:
<!DOCTYPE html>
<html>
<!-- this is a comment, just as normal html -->
<head>
<title>Page title</title>
<meta charset="UTF-8"/>
</head>
<body id="example" class="more pylons">
<h1>Page title</h1>
<section>
<nav>
<ol>
<li><a href="foo.html">Foo</a></li>
<li><a href="bar.html">Bar</a></li>
</ol>
</nav>
</section>
<p>Here is a pargraph with lots of text placed
on more than one line. OK, not lots of text
but more than a little
</p>
</body>
</html>
Notes:
Quoting in most places is optional:
<x(foo:bar, zim:gir)> => <x foo="bar" zim="gir"/>
<x("foo":"bar", "zim":"gir")> => <x foo="bar" zim="gir"/>
But is when you want to include a comma or a less-than sign:
<x(foo:"<\",") => <x foo="&lt;&quot;,"/>
These things are all true for text nodes:
<p some text> => <p>some text</p>
<p "some text with <strange> \"things\" in it">
=> <p>some text with &lt;strange&gt; "things" in it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment