Skip to content

Instantly share code, notes, and snippets.

@augustt198
Last active November 2, 2015 13:48
Show Gist options
  • Save augustt198/8db89b86087c23ccd296 to your computer and use it in GitHub Desktop.
Save augustt198/8db89b86087c23ccd296 to your computer and use it in GitHub Desktop.

New Markup Langauge Specification

A markup language designed for simplicity

Plain text

A line will be evaluated as plaintext if the first character does not start with !, :, or ~. To start a plaintext line with those characters, the first character must be escaped.

Example:

This is plaintext
\!This is also plaintext
\:And this
\~Also this

Is rendered as:

This is plaintext
This is also plaintext
And this
Also this

Elements

All elements start with !. The word following ! is the element name.

Example:

!strong
renders as
<strong></strong>

All attributes are placed in a pair of parenthesis directly after the element name. If no attributes are used, this can be omitted. Example:

!div(.row #banner data-color("evaluated as code " + (2 + 2)) data-text[evaluated as plaintext])
rendered as
<div class="row" id="banner" data-color="evaluated as code 4" data-text="evaluated as plaintext"></div>

If the element name is ommitted, it is assumed to be a div.

Example:

!(.column #products-col)
rendered as
<div class="column" id="products-col"></div>

Inline Code

A line starting with : or an element with a : after the closing attribute parenthesis will output the evaluated code.

Example

: 2 + 2
rendered as
4

!a(href[#]): 3 + 3
rendered as
<a href="#">6</a>

A line starting with ~ will be evaluated silently.

Example

~ variable = 2
~ variable += 2
: variable
rendered as
4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment