YamYam
YamYam is a simple kind of markdown compiler.
Syntax
Basic things
# Headline
## Headline 2
Text, *Text with accent*, _more of this_
and even **more**... (and `code`)
* list item
* list item
* list item
[ ] check list item
[X] check list item
( ) radio list item
(*) radio list item
http://www.google.com
[google](http://www.google.com)
a block of code with ```
| A table | B1
| A2 | B2 |
| A3
| B3
YamYam supports annotations in the markdown, which can be used for app-specific things
[section-annotation name="value" name2=value2 name3='value3']
Annotations with following empty line mark sections of the document
[annotation name = value]
[annotation name = value2]
Annotations direct before a element annotated it.
Multiple annotations supported
API
var YamYam = ;// YamYam.parse(source, function(err, result) {// YamYam.parse(source, options, function(err, result) {YamYam;
options
var options =parser:// Nothing yetformat:// Options for the formater// depend on the used formatervar formatOptions = // For HtmlFormater (default)annotations:// maps annotation name to a function proccessing this type// example:{// annotation.name === "@annotation"attrs"class" = annotationparams"class";}block: undefined // specify how sections are handled/*block: falsethe sections are emitted[ { annotations: [ ... ],content: "..." }, ... ]block: 4 // numberonly section number X will be returnedblock: "..." // stringonly sections which has an annotation named "..."block: function(section, number) { ... } // functiontrue, sections is included*/inline: false // true, use only inline tags, no block level/* Tags config:{ tag: "a", href: "http://www.google.com" } // full configor: "a" // only tagnameor: { // things with power: *xx*, `xx`, # xx"1": { tag: "em", ... },"2": "strong","default": "em" // "default" is required!}or: "" // no tag*/// Example for list"list": "ul""listItem" "li"// other tag config options:/*# elementstext: simple textchecklist, checklistItemradiolist, radiolistItemcodecodeContainercodeLinecodeTextheadlineheadlineTexttable, tableBody, tableHeadtableRow, tableCell, tableHeadCellline: a line when multiline is possible (text, tableCell)# InlinetextItemlinkaccentcodeItemimg*//* advanced options:line: { tag:"", _prepend: "<br/>", _prependStart: "" }"checklistItem", {tag: "div", _prependContent: function(buffer, item) {buffer.push(item.checked?"☑":"☐");buffer.push(" ");}}*//* see lib/HtmlFormater.js for defaults */