faml Specification
New Lines and Paragraphs
A newline is translated into a linebreak. More than one newline is translated into a single paragraph. faml implicitly surrounds the entire input into a paragraph. Carriage returns (\r
) are removed from the input.
Input faml text | Generated HTML |
---|---|
Line One Line Two |
|
Line One Line Two |
HTML & HTML Entities
faml does not allow any HTML. All input is HTML Encoded before it's being parsed. However, HTML Entities are preserved.Input faml text | Generated HTML |
---|---|
It is true that 3<5 and 5>3. <3 Math :) Sad that they depreciated <blink>blink</blink> tags. I liked them. |
|
Clever & Smart & © Æ Ď ¾ ℋ ⅆ ∲ |
Emphasis and Strong Emphasis (Italic and Bold)
Text surrounded with single asterisks is emphasis, usually rendered italic.Text surrounded with double asterisks is strong emphasis, usually rendered bold.
Text surrounded with triple asterisks is emphasized strong emphasis, usually rendered italic and bold.
If you have more than three asterisks, the asterisks are taken as a literal.
Input faml text | Generated HTML |
---|---|
This is *emphasized text*. |
|
This is **strongly emphasized text**. |
|
This is ***strongly emphasized emphasis***. |
|
*****Five Stars!***** |
Escaping
If you need a literal character, prefix it with a backslash. To display a backslash, escape it with another backslash.Input faml text | Generated HTML |
---|---|
This is *Emphasis containing an asterisk, like this: \**. |
|
This is a backslash: \\. |
|
This is a backslash with emphasised text: \\*Hello!*. |
Headings
Up to six levels of headings can be created by starting a line with one to six # (hash) sign, a space, and the text.Input faml text | Generated HTML |
---|---|
# Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 ###### Heading 6 - Inline formatting (like *this*) or [links](http://example.com) are supported #Missing Space |
Code/Pre Blocks
You can include inline code blocks by surrounding it with backticks (`
) - the key left of the 1 on a US Keyboard.
Input faml text | Generated HTML |
---|---|
This is `an inline code block` in the text. |
Input faml text | Generated HTML |
---|---|
``` public class SomeClass { // This is *a comment* public int Id { get; set; } } ``` |
language-
to it, but you can adjust that class name.
Input faml text | Generated HTML |
---|---|
```ruby # Hello World in Ruby :) puts 'Hello world' ``` |
Links
By default, links are automatically hyperlinked. If a link starts withhttp://
, https://
or ftp://
it is a hyperlink.Explicit links can also be specified, including a custom link label and
title
attribute. faml will not make any attempts to validate the correctness of the link.faml will try to deal with parentheses in the URL to find out what is part of the URL. It is recommended to URL Encode parentheses, e.g. %28 for ( and %29 for ).
Input faml text | Generated HTML |
---|---|
This is a link to https://github.com/mstum/faml - you can also read the blog on http://stum.de/ - Does anyone remember ftp://ftp.aminet.net ? |
|
This is [a link to the faml GitHub](https://github.com/mstum/faml). |
|
[Check *this* out!](https://github.com/mstum/faml) |
|
[Link With A Title](https://github.com/mstum/faml "faml Project Site") |
|
We can't dance is an album by [Genesis](http://en.wikipedia.org/wiki/Genesis_(band)) |
|
You can search Wikipedia for [In Held ('Twas) in I](http://en.wikipedia.org/w/index.php?search=In+Held+('Twas)+in+I). That's the name of Transatlantic's cover of the song, parentheses included. |
Blockquotes
Starting a Line with a greater-than sign and space (>
) will create a blockquote. Newlines do not cancel blockquote mode, an empty line is required.
Input faml text | Generated HTML |
---|---|
> It Belongs In a Museum! > *-- Henry Jones Jr., Indiana Jones and the Last Crusade* |
|
> It Belongs In a Museum! *-- Henry Jones Jr., Indiana Jones and the Last Crusade* |
Lists
You can create ordered and unordered lists, with unlimited nesting. Nesting is done by an indent of 2 spaces per level. Unordered Lists have an asterisk as their list item indicator, while ordered lists use a numeral followed by a period. The list item indicator must be the first item in a line, unless it is a nested item. To have two lists follow each other immediately, two empty line is required. A space between the list item indicator and the content is required.Input faml text | Generated HTML |
---|---|
* Unordered List Item One * Unordered List Item Two * Unordered List Item Three |
|
* Another Unordered List Item One * Another Unordered List Item Two * Nested Item Two-One * Nested Item Two-One-One * Nested Item Two-One-Two * Nested Item Two-Two * Another Unordered List Item Three |
|
1. Ordered List Item One 2. Ordered List Item Two 1. Ordered List Item Two-One 3. Ordered List Item Three * Nested Unordered List Item One * Nested Unordered List Item Two 1. Nested Ordered List Item One |
|
8. This list starts with 8. 9. Item Nine 12. Item Ten - ordered lists are sequential after the start! |