Markdown Syntax Guide
For a thorough guide to markdown, check out cmark-gfm guide, which our markdown->html renderer is based on.
Note: bagatto uses markable for markdown->html rendering. The default rendering options and extensions in bagatto are missing some important options such as tables, tasklist, etc.
In order to render all those elements, more options are added to the render function. See post.temple and page.temple files in the partials directory.
This is a showoff of basic Markdown syntax that can be used in bagatto content files (see the relevant file with .md extension in the content dir). Here you see the rendering of those elements with current bear css.
Headings
The following HTML <h1>—<h6> elements represent six levels of section headings. <h1> is the highest section level while <h6> is the lowest.
Notice that <h2>—<h3> have id tags and anchor (hover over them to see), because we manipulate the resulting html and add these elements. See index.janet file for the details.
H1
H2
H3
H4
H5
H6
Paragraph
Artisanal1 bridge refrigerator hacker, dolphin camera convenience store rain drone. Numinous tower sensory 8-bit digital decay rifle 3D-printed, sub-orbital render-farm nodal point systema. DIY papier-mache futurity face forwards long-chain hydrocarbons: assassin neon alcohol Shibuya modem Legba.
Military-grade rain jeans pre- decay market voodoo god sensory artisanal jeans fetishism. Claymore mine saturation point rain, neural table fluidity A.I. wonton soup carbon digital monofilament. Rebar youtube franchise alcohol assassin paranoid sentient skyscraper towards physical.
Blockquotes
The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a footer or cite element, and optionally with in-line changes such as annotations and abbreviations.
Blockquote without attribution
Urban j-pop girl warehouse tanto tube semiotics receding. Note that you can use Markdown syntax within a blockquote.
Blockquote with attribution
Don’t communicate by sharing memory, share memory by communicating.
— Rob Pike2
Tables
Tables aren’t part of the core Markdown spec, but markable supports them out-of-the-box.
| Name | Age |
|---|---|
| Bob | 27 |
| Alice | 23 |
Inline Markdown within tables
| Italics | Bold | Code |
|---|---|---|
| italics | bold | code |
Code Blocks
Code block with backticks
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
Code block indented with four spaces
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Short HTML5 Document</title>
</head>
<body>
<p>Another test</p>
</body>
</html>
List Types
Ordered List
- First item
- Second item
- Third item
Unordered List
- List item
- Another item
- And another item
Nested list
- Fruit
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese
Links
Here is a link to the end of the internet, which is somewhere on the net..
And here is a link to this here page, just another section of it!
Although cmark-gfm (this is the markdown->html renderer bagatto uses under the hood)
doesn’t support adding id attributes to elements, we are using the power of janet
to add id attribute for headings, look at index.janet for the code.
Other Elements — abbr, sub, sup, kbd, mark
GIF is a bitmap image format.
H2O
Xn + Yn = Zn
Press CTRL+ALT+Delete to end the session.
Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures.
Text generated with loremgibson ↩
The above quote is excerpted from Rob Pike’s talk during Gopherfest, November 18, 2015. ↩