Extended Markdown Syntax - flarom/cohesion GitHub Wiki
Quoted from the Markdown Guide.
To add a table, use three or more hyphens (---
) to create each column’s header, and use pipes (|
) to separate each column
| Syntax | Description |
| ----------- | ----------- |
| Header | Title |
| Paragraph | Text |
The rendered output looks like this:
Syntax | Description |
---|---|
Header | Title |
Paragraph | Text |
Cell widths can vary, as shown below. The rendered output will look the same.
| Syntax | Description |
| --- | ----------- |
| Header | Title |
| Paragraph | Text |
Tip
Creating tables with hyphens and pipes can be tedious. Cohesion provides a table maker via the 📎 Insert menu, you can also format your tables via the context menu by selecting the table.
You can align text in the columns to the left, right, or center by adding a colon (:
) to the left, right, or on both side of the hyphens within the header row.
| Syntax | Description | Test Text |
| :-------- | :---------: | ----------: |
| Header | Title | Here's this |
| Paragraph | Text | And more |
The rendered output looks like this:
Syntax | Description | Test Text |
---|---|---|
Header | Title | Here's this |
Paragraph | Text | And more |
The basic Markdown syntax allows you to create code blocks by indenting lines by four spaces or one tab. If you find that inconvenient, try using fenced code blocks. Depending on your Markdown processor or editor, you’ll use three backticks (```
) or three tildes (~~~
) on the lines before and after the code block. The best part? You don’t have to indent any lines!
```
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
```
The rendered output looks like this:
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
You can also specify a language next to the backticks before the fenced code block.
```json
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
```
The rendered output looks like this:
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
If your codeblock is declared as JavaScript
or JS
you can also use it to run scripts.
You can create expandable sections in your document to hide extra details unless the reader chooses to view them. This is useful for optional information, spoilers, or additional examples.
To create an expandable section, use the following syntax:
:::details[Your title here]
Your hidden content goes here.
:::
The rendered output looks like this:
Your title here
Your hidden content goes here.
To create a definition list, type the term on the first line. On the next line, type a colon followed by a space and the definition.
First Term
: This is the definition of the first term.
Second Term
: This is one definition of the second term.
: This is another definition of the second term.
The rendered output looks like this:
- First Term
- This is the definition of the first term.
- Second Term
- This is one definition of the second term.
- This is another definition of the second term.
To declare a abbreviation, type an asterisk (*
) at the start of the line, followed by the abbreviation between brackets, a colon (:
) and then the abbreviation meaning.
*[HTML]: Hyper Text Markup Language
HTML
The rendered output looks like this:
HTML
You can strikethrough words by putting a horizontal line through the center of them. The result looks like this. This feature allows you to indicate that certain words are a mistake not meant for inclusion in the document. To strikethrough words, use two tilde symbols (~~
) before and after the words.
~~The world is flat.~~ We now know that the world is round.
The rendered output looks like this:
The world is flat. We now know that the world is round.
Task lists allow you to create a list of items with checkboxes. To create a task list, add dashes (-
) and brackets with a space ([ ]
) in front of task list items. To select a checkbox, add an x
in between the brackets ([x]
).
- [x] Write the press release
- [ ] Update the website
- [ ] Contact the media
The rendered output looks like this:
- Write the press release
- Update the website
- Contact the media
Emojis can be inserted via shortcodes in the editor. These begin and end with a colon and include the name of an emoji.
Gone camping! :tent: Be back soon.
That is so funny! :joy:
The rendered output looks like this:
Gone camping! ⛺ Be back soon.
That is so funny! 😂
You can highlight text. The result looks like this. To highlight words, use two equal signs (==
) before and after the words.
I need to highlight these ==very important words==.
The rendered output looks like this:
I need to highlight these very important words.
To create a subscript, use one tilde symbol (~
) before and after the characters.
H~2~O
The rendered output looks like this:
H2O
To create a superscript, use one caret symbol (^
) before and after the characters.
X^2^
The rendered output looks like this:
X2
Ruby text is a way to display small pronunciation guides (typically for East Asian characters like Japanese kanji or Chinese hanzi). These are shown above or alongside characters to help with reading. In Markdown, you can use ruby syntax like this:
[漢字]^(kan ji)
The rendered output looks like this:
漢 字