MaDer
Title: MaDer -- Yet Another Markdown Extension author: Andy Pan, Yu-Ren Pan
By Andy Pan. Specification proposed by Yu-Ren Pan.
「讀我點媽的。」~WF, 2016
This extension is part of a project of mine in pursuit of more precise markups and better structured Markdown documents. Enjoy :)
Spec is inherited from CommonMark, with the following additional syntax.
Usually we need to style or infer the content but Markdown don't provide us with class specification on all styled text, let alone customized elements. We extend the syntax to allow either block or inline elements. They are unstyled as default, but you can do it later with <style>
blocks or by templates.
Note that we don't restrict whether generic elements "display" like an "inline" or a "block" one. They only differ from representation and default tag name choice.
::
To enclose a block of text with a tag (div
if not specified), an optional id, and class names, a block with a line starting with exactly 2 colons form a generic block, and the content starts from the next line.
Example:
:: p#id.class
the content is placed here.
:: p#nested.another-class
nestable: implemented as normal indentions
To escape, escape the first colon like \::
.
::{ ... }
To enclose a piece of text, you can specify a tag name (span
if not specified), etc.
::{span#id.class Hello world}
To escape within the markup, escape the }
character; to escape the syntax, escape the first colon character :
.
Taking adventage of the YAML front matter as <meta>
tags or shortands to global layout property.
title
, author
, subjects
, keywords
, date
, generator
.layout
object.
Brings the sweet candy of C macros to Markdown.
[!define]: alert(y) <div class="alert">y</div>
will transform
alert(hello)
to
<div class="alert">hello</div>
(ISSUE: what content should be treated as parameters to be replaced?)
Replace the statement by including a file as its content.
Some original spec may break with new features added. This list is some modifications made to be compatible with it.
...
Written with StackEdit.