My favorite simple tables look like:
| are | easier | than |
| any | markdown | flavor |
Granted, I don't know of any that allow colspan/rowspan well. And even fewer that support newlines in a cell. Styling can also be annoying. But simple tables are surprisingly annoying in most any of these options.(I should say that I fully agree with you, btw.)
|| are easier | than |
| any | markdown | flavor |
The number of consecutive pipes would increase the colspan value. I think I also had support for rowspan but I don't remember how.The XWiki syntax [1] also supports it by letting you use HTML attributes.
|=Title 1|=(% style="background-color:yellow" %)Title 2
|(% colspan=2 %) Word 1 Word 2
Arguably more clunky and less intuitive, but more powerful I guess.(disclaimer: I work for XWiki)
[1] https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide...
(but I've also read the docs for nearly every minimal markup format I can find, so I might be misremembering... :)
I'm hesitating between using a fully XML compliant code to be able to automatically spot stupid mistakes thanks to the parser, or this. If I'm not validating the XML I don't see much point in writing these extra tags. It's just less data to transfer. Compression is a thing but still.
I do see one point: the version with the extra tags is closer to the actual representation of the document in the browser. You have to explain to newcomers that a full DOM with html, head and body elements will be rendered even if they are not present in the source code, with consequences for CSS and JavaScript to style and manipulate the document. The speech is just easier when the source matches the DOM.
For the missing tag endings, it requires quite deeper knowledge about parsing HTML to read a document. It's clear that it makes taking notes faster, but the code is perhaps less clear to someone who has not read it. Still a bit hesitant on this.
Nitpick: you might need <meta charset=utf8> before the title.
DMark (https://denisdefreyne.github.io/d-mark/) is the only one I've used, but IIRC there are probably ~dozens of these out there (and many eschew furniture more than DMark).
While my syntax is even lighter than this, it's reasonable and DMark seems to be very easy and enjoyable to extend. And I say this as someone who doesn't know Ruby and for whom Ruby hasn't clicked (yet?). I'll definitely have to check it out, either to adopt it or to improve my own thing, ten years later.
Thanks for mentioning it, there's taste in this design. Very nice.
I ended up writing a python parser for it (mainly just to get access to a different css parser), and the author also has a rust parser.
For the better or the worse, when I deal with HTML directly, I usually just copy the HTML pages as they are on the server and have no mandatory Javascript, if at all. It's easier, and it's also "free backup on production".
(Yeah, that's called a pretty printer, but the symmetry is nice.)
Found the person omitting semicolons in Javascript ;-)
I didn't like semicolon omission at first, actually I still prefer with the semicolons and I believe ASI was a mistake, but I mostly don't care.
Rationale - I last did HTML when Netscape Navigator/ Communicator was still around. IIRC, usual discussion among us college students was how MS IE encouraged bad programming practices by ignoring (many?) unclosed tags, whereas Netscape wasn't as forgiving.
I've not seen much HTML since then (I definitely plan to, now). Your comment brought back some fond memories. Thank you! And mind blown.
(table
(tr
(td one)
(td two)
(td three))
(tr
(td another table)
(td with more stuff)))the example s-expression matches that structure and i perceive it as the same because the first element in any list has a special meaning (in lisp itself it is the function name, while the rest are arguments)
to replicate the html5 structure in the top comment without closing tags as s-expressions i would come up with something different:
(table
(tr)
(td) one
(td) two
(td) three
(tr)
(td) another table
(td) with more stuff)To your point, I can see the opening tag as ( and the closing as ), but then that would lead to something more like:
(table
(tr
(td one
(td two
(td three
(tr
(td ...
Which really just highlights how odd it is to see the opening tags without the closing ones. Which probably goes a long way to explaining why I don't like it. :DProbably more natural to have something like:
(html
table
tr
td "one"
td "two"
tr
td "...")
In this way, you could optionally have the closing tags of /td and such. Still looks very weird to me.Sadly they have fallen out of favour.
The markup experience was super nice.
The language is very tolerant to untidy syntax, but most people forgot about that after we went through XHTML, which is anything but.
>Tables become uncluttered:
If I add a tr, does it nest "than" in the first row or does it move to the second row? Surely it can't nest because each tr effectively has a /tr before it.
>Raw html tables
<table>
<tr>
<td> are
<td> easier <tr><td>but ambiguous?
<td> than
<tr>
<td> any
<td> markdown
<td> flavor
</table>
I notice you closed the title, presumably because otherwise it's ambiguous as to whether the paragraph is in the title. It's so easy to make well-formed documents by closing tags intentionally rather than pushing the closing to be inferred by context by different rendering engines I can't see why you would want sloppy mark-up.https://html.spec.whatwg.org/multipage/syntax.html#optional-... is where these are defined. It basically says that a TD remains open until the next sibling td or the tr/tbody/table that it is in is closed.
In fact, the fact that implicit end tags and implicit elements are unambiguous is why they exist as a feature at all. <td> cannot contain <tr>—the idea doesn’t make sense—so <td> followed by <tr> implicitly closes the <td>. <li> can’t contain <li>, so it implicitly closes. <p> can’t contain <p>, and so on. XML doesn’t help at all here: even if you use a strict XML parser, you can make a construct like “<p><p></p></p>”, and it’ll be ostensibly “well‐formed,” but it won’t be valid HTML.
The XML way of “make everything verbose, even when it’s already unambiguous” was a late addition to the language. And it leads to surprise like what’s visible throughout this thread, such as people expecting <div /> to act like <div></div> when it really acts like <div>.
HTML is important enough that it warrants direct investment in tooling and doesn’t need the XML approach.
The idea is to make the language less context-sensitive and more consistent. It's better if the meaning of `<p>` and `<p/>` don't change based on the parent tag. Now, obviously they failed at making the semantic changes necessary to achieve the goal, but a true XML-based language would've been far simpler both for humans and computers than what we've got now. Most of the author's points are entirely valid, but the conclusion really should've been "HTML is bad."
If you need XML: use XML tools.
If you need HTML: use HTML tools.
If you need XHTML... you're writing web content for IE, and IE is dead. XHTML died with it. Feel free to stick with what you know, but that's a pretty ridiculous argument for why you shouldn't use the thing that's used these days instead of the thing we used 15 years ago =)
(hot damn, 15 years. It's been longer than most folks realize).
For the record, anyone who writes `<br />` as `<br>` is...misinformed.
Quoting from the document you linked:
"Omitting an element's start tag in the situations described below does not mean the element is not present; it is implied, but it is still there. For example, an HTML document always has a root html element, even if the string <html> doesn't appear anywhere in the markup."
Of actual practical consequence are optional html5 tags [0]. They allow you to write html by hand as easily as if you wrote markdown. Some graybeards even say that optional html5 tags make markdown entirely unnecessary.
Thus, lists don't need closing item tags:
Tables become uncluttered: And you can even write the entire document in that style: No need for stupid html, header, body elements. They are optional![0] https://html.spec.whatwg.org/multipage/syntax.html#optional-...