Smark language-overview

Getting the Smark-Parser

Current Version 1.0.6 (25.01.2019)
The original Smark-Parser written in PHP can be seen using following link: Smark PHP-Parser. Instructions how to use the parser are included in this file, feel free to add Smark to your personal projects.

Inline formatting

Markup-Code Formatted Result
++inverse text++ inverse text
**bold text** bold text
__underlined text__ underlined text
--striked text-- striked text
^^supertext^^ supertext
~~subtext~~ subtext
°°small text°° small text
??marked text?? marked text
@@html-code@@ html-code


Markup-Code Formatted Result
# Headline 1

Headline 1

## Headline 2

Headline 2

### Headline 3

Headline 3

#### Headline 4

Headline 4

##### Headline 5
Headline 5
###### Headline 6
Headline 6

Headline 1 Alternative

Headline 1


Markup-Code Formatted Result
http://www.example.com http://www.example.com
Link [http://www.example.com::Example-Text] Example-Text
[![rootURL]!] set up a root-url for wiki-style-links
[[WikiStylePage]] Creates a Wiki-Style Link
[[WikiStylePage::Wiki Style Page]] Creates a named Wiki-Style Link
[^ AnchorID::Anchor Link Text] Creates the Anchor Link
[^ AnchorID] DesinationMarkup for Anchor-Link


Image-, video- and audio-files will be recognized automatically, no additional markup is required to embed these files into your documents. Simply place the file-name (file-URL) where you want to display your media-file into your document. Following types are supported:
Type Extensions
Image jpg, png, gif
Video mp4
Audio mp3


Markup-Code Formatted Result
+quote+ Quote-Block +endquote+
+quote:By John Doe+ Quote-Block with Source +endquote+
By John DoeQuote-Block with Source
+code+ Code-Block +endcode+ Code-Block
+span+ Span-Element +endspan+ Span-Element
+div+ Div-Container +enddiv+
+para+ Paragraph +endpara+


Adding CSS-Styles, -Classes and -IDs to Block-Markup

+quote|class="myClass" id="myID"+

Quote with source and style
+quote:By John Doe|class="myClass"+ Quote-Block



Example :
:: term-1 : definition 1 : Definition 2
:: term-2
: Definition 1 for Term 2
: Definition 2 for Term 2
with an extra Line of Text
: Definition 3 for Term 2
:: term-3 : End definition-list with a blank line


Create Tables
Tables are enclosed with the +table+ +endtable+ markup.
The table-head is enclosed with the +tablehead+ +endtablehead+ markup. Cells within this markup will be enclosed by the HTML-markup <thead>. Adding a table-head to your tables is optional.
The table-foot is enclosed with the +tablefoot+ +endtablefoot+ markup. Cells within this markup will be enclosed by the HTML-markup <tfoot>. Adding a table-foot to your tables is optional.
The table-body is enclosed with the +tablebody+ +endtablebody+ markup. Cells within this markup will be enclosed by the HTML-markup <tbody>. Using the table-body-markup in your tables is optional and only necessary if you want an addional layer of style for your tables.
You can add a caption to your tables using the +caption
Your caption-text+ markup. This markup can placed anywhere in your table with the condition this markup need a sole line. Adding a caption to your table is optional.
Create normal cells
In normal formatting-mode for tables, write each cell in a single line in your text. To create a new row in your table, add a blank line between your cells.
By prepending a !! before your cells, the cell will be enclosed with the HTML-markup <th> instead of <td>

Example simple Smark-Table:
+caption:The caption of the table+
!! Line
first cell
second cell
!! First line
First normal cell first line
Second normal cell first line

!! Second line
First normal cell second line
Second normal cell second line

Adding styles, classes, ids to tables and cells
Adding styles, classes, ids to your cells works the same way it does for block-formatting.
+table|style="background-color: blue; color:yellow;"+
First Cell
Second cell

To add styles etc. to your cells, write those into the line before the actual line
First cell
Second Cell

colspan="2" style="background-color:white; color:black; text-align:center; font-weight:bold;"
Double cell

Normal cell
align="right" width="50%"
call with text-align\="right"

Compact table-formatting
Instead of using single lines for your cells, you have the option to use your own cell-separator. The markup: +table:[separator-sign]
When specifying a separator, the sign ; should be avoided when creating tables using words with special-characters like ä ö ü etc.. However, you can also use more complex separators like #-$-# to separate cells

first cell | second cell | third cell
!! first cell | !! second cell | !! third cell
style="background-color:red;" | first cell | style="background-color:blue" | second cell | style="background-color: green" | third cell


Markup: ==The text displayed as Reference==. All references will be collected and can be displayed anywhere in your text using the markup: +showreferences+

Line-Breaks, Paragraphs

Line-breaks and paragraphs are automatically generated. However you can place your own paragraph-blocks by using the +para+text+endpara+ markup. See Block-Formatting for more details


Entities (special characters) will be automatically converted, no extra efforts neccessary


Following Characters can be escaped with a prepending \ : \ * _ { } ( ) [ ] > # . ! + - : $ @ =
Example: \* to escape the * symbol. Using escape you prevent Smark from parsing these very characters.


The markup is : +html+ Your HTML-Code +endhtml+ . All text between the markup won't be parsed.


Add a $-sign at the start of a line to comment it out. Subsequent lines will also be commented. To end a comment-block, insert a blank line.


To add a HTML-Comment-Block use the markup: +comment+ text +endcomment+.

Deprecated Markup

These markups still work, but are considered deprecated. Using those should be avoided.

Smark 1 Markup Smark 2 Markup
*****underlined, strong and inverted text***** Use __**++text++**__ instead
****strong and inverted text**** Use **++text**++ instead
***underlined text*** use __text__ instead
+color=green/white+text+endcolor+ use +span|style="color:green; background-color:white;"+test+endspan+ instead
[Display Text](http://www.example.con "Alt Text") use [http://www.example.con::Display Text] instead
some *inverse text* use ++text++ instead
+column+some text+endcolumn+ use +div|class="yourColumnClass"+some text+enddiv+ instead
+column:3+some text+endcolumn+ use +div|class="yourColumnClass"+some text+enddiv+ instead
+ref+Reference-Text+endref+ use ==Reference-Text== instead
[^ AnchorID (AnchorLinkTest)] use [^ AnchorID::AnchroLinkTest] instead