Markdown, flavorless and simplified.
I got no flavor. It's what I deserve, really.
- Michael, The Good Place
No-Flavor is yet another attempt at simplifying, optimizing, and tightening up markdown syntax.
Block-Level Elements
Headers
# One
## Two
### Three
#### Four
##### Five
###### Six
Headers remain unchanged for the most part. Only atx style headers are supported. Setext style headers have been ditched.
Horizontal Rules
- - -
Horizontal rules are defined using three space-delimited hyphens followed by a line-break. Three space-delimited underscore support has been dropped.
Lists
- This
- is
- an unordered
- list.
Unordered lists are defined by a line beginning with a hyphen while not in a paragraph or a line beginning with spaces followed by a hyphen when attempting to nest.
0. This
0. is
0. an ordered
0. list.
Ordered lists are defined within the same parameters, only with a zero folled by a period. Other numbers are not supported.
- This
- is
0. a mixed
- list.
Mixed lists are allowed. Although alternating between two different types within the same level will result in the first-defined level being used.
Code Blocks
let mut x = 0;
let mut y = 1;
std::mem::swap(&mut x, &mut y);
y += 1;
assert_eq!(x, y);
Generic code blocks are defined by beginning a line with four spaces.
Code Fences
```rust
let mut x = 0;
let mut y = 1;
std::mem::swap(&mut x, &mut y);
y += 1;
assert_eq!(x, y);
```
Code fences are defined by beginning a line with three backticks. A language name is supported and optional.
Blockquotes
> I got no flavor, it's what I deserve, really.
Blockquotes are defined by beginning a line with a greater-than sign.
Tables
Tables are where some may think this gets a little ugly. Tables are entirely changed, but their functionality is increased.
|=^ Left aligned col header |= Center aligned header |=$ Right aligned header
|-^ Left aligned row header | Center aligned cell |$ Right aligned cell
|^ Left aligned cell | Center aligned cell |$ Right aligned cell
Tables no longer have a trailing delimiter for the final cell in the row and the properties of each cell is defined by leading flags. The order of the flags are as follows:
- Cell type
=
column header-
row header_
standard cell (default)
- Alignment
^
left$
right_
center (default)
- V-Alignment
t
topm
middleb
bottom_
baseline (default)
- Col-span
- n the number of cells
- default is 1
- Row-span
- ,n the number of cells
- default is 1
Any of these flags can be left out entirely as none of them collide. The _
character can be used to signify the default value for alignment purposes.
The flag design allows for much more robust table definitions as each cell can be defined with individual formatting.
|=^m_,3 Left aligned, 3-row |=$_3,_ Right aligned 3-column
|-^m_,2 Left aligned |=^__,_ Left aligned |_$__,_ Right aligned
|=^__,_ Left aligned |_$__,_ Right aligned
Paragraphs
This is a paragraph.
Paragraphs are everything else.
Inline Elements
Strong
This paragraph has some **strong** words.
Strong text is defined by encapsulating the desired characters with two astericks.
Emphasis
It can be this _or_ this.
Emphasized text is defined by encapsulating the desired characters with a single underscore. Support for a single astericks was dropped.
Deleted
~~This is how you do it.~~ I changed my mind.
Deleted text is defined by encapsulating the desired characters with two tildes.
Inserted
What da ~~hell~~ ++heck++.
Inserted text is defined by encapsulating the desired characters with two plus signs.
Marked
Just gonna highlight ==this== real quick.
Marked text is defined by encapsulating the desired characters with two equals signs.
Superscript
E=mc^2^
Superscript is defined by encapsulating the desired characters with a carrot.
Anchors
# <desired-id>Id'ed Header
Anchors are defined by encapsulating the desired ID with a less-than sign and
a greater-than sign. The above anchor would be parsed into:
<a id="desired-id"></a>
.
Checkboxes
[ ] Incomplete item
[x] Complete item
Checkboxes are inline elements, not special list types. An unchecked checkbox is defined as an open square bracket followed by a space followed by a closed square bracket. Checked checkboxes are defined as an open square bracked followed by an x followed by a closed square bracket.
Links
Please click [here](http://frankiebaffa.com/projects/nfm.html).
Links are defined in two parts. The link text: desired text encapsulated with open/closed square brackets and the link url: desired url encapsulated with open/closed parentheses.
Images
![an image](http://frankiebaffa.com/favicon-16x16.png)
Images are identical to links, only with a leading exclamation point. The
text defines the alt
text property.
Inline Code
Here is `let x: usize = 0;` some code.
Inline code can be defined by encapsulating the desired code with backticks.
Tricks
Footnotes
Using anchors, links, and superscript combined; you can mimic footnotes found
in more bloated feature rich markdown parsers:
This is a fact^[source](#fact)^.
<fact>source: I made it up.