Dash XML
“ It’s too simple — let’s turn it complex! ”
Introduction
This is one example about how Dash Markup can be used in practice.
Short proof of concept:
img - src res/dash-markup.svg --br --a - href //unseen-site.fun - target _blank -i -- Unseen-Site.Fun ---
<img src="res/dash-markup.svg" /><br /><a href="//unseen-site.fun" target="_blank"><i>Unseen-Site.Fun</i></a>
With Dash Markup, your eyes & fingers will (hopefully) strain less on the syntax 😄
Basic Rules
- The word before the first single dash is treated as an XML tag.
-
For words between single dashes,
- the first word is attribute name,
- and the rest are together as attribute value.
-
For a Dash Markup line that ends with a single dash,
- if there is a tag, this line will become an open tag;
- if this is a bare single dash, this line will close the previous tag.
-
For a Dash Markup line that ends with a double dash,
- if there is another double dash in line, words and dashes after that will become content of the current XML tag, and the tag is closed afterwards;
- otherwise, the tag will close itself as a void element.
-
Special cases for tags:
-
If the “tag” is
!--, this line will become XML comment (<!-- -->) -
If this “tag” starts with
!, it’s an Entity , closing will omit the slash. -
If this “tag” starts with
?, it’s a Declaration , will close with?>. -
Typically:
!-- Comment --!doctype - html --?xml - version 1.0 - encoding UTF-8 - standalone no --<!-- Comment --><!doctype html><?xml version="1.0" encoding="UTF-8" standalone="no"?>
-
If the “tag” is
- Entity definition not supported intentionally due to complexity and security problems.
How do I use it?
At the moment,
omnisrv
supports Dash XML, in plain text files (
.txt
).
There’s also a implementation in JavaScript/TypeScript in this repository . Note that the code is probably obsolete.
You can also try to write your own implementation by hand.