smu

Simple markup processor
git clone https://git.sinitax.com/codemadness/smu
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

README (4180B)


      1smu - a Simple Markup Language
      2==============================
      3
      4_smu_ is a very simple and minimal markup language. It is designed for use in
      5wiki-like environments. smu makes it very easy to write your documents on the
      6fly and convert them into HTML.
      7
      8smu is capable of parsing very large documents. It scales just great as long
      9as you avoid a huge amount of indents (this will be fixed in future releases
     10of smu).
     11
     12Syntax
     13======
     14
     15smu was started as a rewrite of
     16[markdown](http://daringfireball.net/projects/markdown/) but became something
     17more lightweight and consistent. The biggest difference between markdown and smu
     18is that smu doesn't support _reference style links_
     19
     20Inline pattern
     21--------------
     22
     23There are several pattern you can use to highlight your text:
     24
     25* Emphasis
     26  * Surround your text with `*` or `_` to get *emphasised* text:
     27    	This *is* cool.
     28    	This _is_ cool, too.
     29  * Surround your text with `**` or `__` to get **strong** text:
     30    	This **is** cool.
     31    	This __is__ cool, too.
     32  * Surround your text with `***` or `___` to get ***strong and emphasised*** text:
     33    	This ***is*** cool.
     34    	This ___is___ cool, too.
     35  * But this example won't work as expected:
     36    	***Hello** you*
     37    This is a wontfix bug because it would make the source too complex.
     38    Use this instead:
     39    	***Hello*** *you*
     40
     41* inline Code
     42
     43  You can produce inline code with surrounding `\`` or `\`\``
     44
     45  	Use `rm -rf /` if you're a N00b.
     46
     47  	Use ``rm -rf /`` if you're a N00b.
     48
     49  `\`\`ABC\`\`` makes it possible to use Backticks without backslashing them.
     50
     51
     52Titles
     53------
     54
     55Creating titles in smu is very easy. There are two different syntax styles. The
     56first is underlining:
     57
     58	Heading
     59	=======
     60	
     61	Topic
     62	-----
     63
     64This is very intuitive and self explaining. The resulting sourcecode looks like
     65this:
     66
     67	<h1>Heading</h1>
     68	<h2>Topic</h2>
     69
     70Use the following prefixes if you don't like underlining:
     71
     72	# h1
     73	## h2
     74	### h3
     75	#### h4
     76	##### h5
     77	###### h6
     78
     79Links
     80-----
     81
     82The simplest way to define a link is with simple `<>`.
     83
     84	<http://s01.de>
     85
     86You can do the same for E-Mail addresses:
     87
     88	<yourname@s01.de>
     89
     90If you want to define a label for the url, you have to use a different syntax
     91
     92	[smu - simple mark up](http://s01.de/~gottox/index.cgi/proj_smu)
     93
     94The resulting HTML-Code
     95
     96	<a href="http://s01.de/~gottox/index.cgi/proj_smu">smu - simple mark up</a></p>
     97
     98Lists
     99-----
    100
    101Defining lists is very straightforward:
    102
    103	* Item 1
    104	* Item 2
    105	* Item 3
    106
    107Result:
    108
    109	<ul>
    110	<li>Item 1</li>
    111	<li>Item 2</li>
    112	<li>Item 3</li>
    113	</ul>
    114
    115Defining ordered lists is also very easy:
    116
    117	1. Item 1
    118	2. Item 2
    119	3. Item 3
    120
    121It is possible to use any leading number you want. So if you don't want to keep
    122your list synchronised, you simple can use any number. In this case it's
    123recommended to use `0.`, but it isn't mandatory.
    124
    125	0. Item 1
    126	0. Item 2
    127	0. Item 3
    128
    129Both examples will cause the same result. Even this is possible:
    130
    131	1000. Item 1
    132	432.  Item 2
    133	0.    Item 3
    134
    135This will be the result in these example:
    136
    137	<ol>
    138	<li>Item 1</li>
    139	<li>Item 2</li>
    140	<li>Item 3</li>
    141	</ol>
    142
    143Code & Blockquote
    144-----------------
    145
    146Use the `> ` as a line prefix for defining blockquotes. Blockquotes are
    147interpreted as well. This makes it possible to embed links, headings and even
    148other quotes into a quote:
    149
    150	> Hello
    151	> This is a quote with a [link](http://s01.de/~gottox)
    152
    153Result:
    154	<blockquote><p>
    155	Hello
    156	This is a quote with a <a href="http://s01.de/~gottox">link</a></p>
    157	</blockquote>
    158
    159
    160You can define block code with a leading Tab or with __3__ leading spaces
    161
    162		this.is(code)
    163	
    164	   this.is(code, too)
    165
    166Result:
    167	<pre><code>this.is(code)</code></pre>
    168	<pre><code>this.is(code, too)
    169	</code></pre>
    170
    171Please note that you can't use HTML or smu syntax in a code block.
    172
    173Other interesting stuff
    174-----------------------
    175
    176* to insert a horizontal rule simple add `- - -` into an empty line:
    177
    178  	Hello
    179  	- - -
    180  	Hello2
    181
    182  Result:
    183  	<p>
    184  	Hello
    185  	<hr />
    186  	
    187  	Hello2</p>
    188
    189* You can escape the following pattern to avoid them from being interpreted:
    190
    191  	\ ` * _ { } [ ] ( ) # + - . !
    192
    193* To force a linebreak simple add two spaces to the end of the line:
    194
    195  	No linebreak
    196  	here.
    197  	But here is  
    198  	one.
    199
    200embed HTML
    201----------