Learn Cadey

Cadey is a simple and minimalistic markdown language. This is an example based tutorial. Let's start with the basics.

Paragraphs

Paragraphs are eliminated with two consecutive newline characters. The following Cadey document:
This is a paragraph.

This is another one,
as you can see two new lines are needed to make a paragraph!
Will be rendered as:
This is a paragraph.
This is another one, as you can see two new lines are needed to make a paragraph!

Macros

Macros are used to generate more advanced content, for example italic or bold text:
[italic This will be italic]
Will be rendered as:
This will be italic
In the above example we're using a Macro named "italic", passing "This will be italic" to it.
Macros can be nested:
[italic italic and [bold bold]]
Will be rendered as:
italic and bold
Macros can be included in paragraphs:
This is a [italic paragraph].

This is another one,
as you can see [bold two] new lines are needed to make a paragraph!
Will be rendered as:
This is a paragraph .
This is another one, as you can see two new lines are needed to make a paragraph!

Named Parameters

Other than text (un-named parameters), you can pass named parameters to Macros as well:
[heading :size 1 Size is one]
[heading :size 2 Size is two]
[heading :size 3 Size is three]
[heading :size 4 Size is four]
[heading :size 5 Size is five]
Will be rendered as:

List Parameters

Let's add a random image to our Cadey document:
[image :alt Jelly :width 300 /img/jelly.jpg]
will be rendered as:
Jelly
To pass several words, or a sentence, as the value of a named parameter, we can use lists:
[image :alt [: Neon Jelly] :width 300 /img/jelly.jpg]
will be rendered as:
Neon Jelly
An alternate form for the above is:
[image [:alt Neon Jelly] :width 300 /img/jelly.jpg]
Lists can be used as un-named variables as well:
[italic [: this is a list]]
will be rendered as:
this is a list

Escaping Special Characters

Some characters have special meaning in Cadey, for example [ and ] and :. If you want to write [ or ] in a paragraph, or in a List or Macro, you will need to escape them with a \:
Escaped \[ and \]
You need to escape : at beginning of words inside Macros:
[italic \:escaped]
These will render as:
Escaped [ and ]
:escaped

Escaped List

Sometimes there are too many special characters in a block of text to escape with \. If that is the case, we can use a Escaped List:
[italic [:[All of [bold this] is escaped]:]]
Will be rendered as:
[All of [bold this] is escaped]

Available Macros

Now that you've learned the basics of Cadey and its syntax, you can learn about the available Macros here.
Generated by Cadey 0.0.2. View source here.