8
Lemmy Markdown Text Formatting Guide - SFFA
sffa.community# Lemmy Markdown Formatting Guide This post explains how to format Markdown with
Lemmy and details it’s nuances as best as possible. ## Important Notes on
Markdown with Lemmy Lemmy parses Markdown using CommonMark, but with some
additional features namely spoilers. NOTE: Lemmy cares about the number of
newlines between paragraphs. If you want to have a new paragraph, you need to
have at least one newline between the two paragraphs. Or else, Lemmy will treat
it as a single paragraph. You can see this in the example below. ::: spoiler
Newline spacing example ### Correct #### Format md This is a paragraph. Imagine
it's a bit longer. This is another paragraph. Again, imagine it's a bit longer.
#### Result This is a paragraph. Imagine it’s a bit longer. This is another
paragraph. Again, imagine it’s a bit longer. ### Incorrect #### Format md This
is a paragraph. Imagine it's a bit longer. This is another paragraph. Again,
imagine it's a bit longer. #### Result This is a paragraph. Imagine it’s a bit
longer. This is another paragraph. Again, imagine it’s a bit longer. ::: ## Text
Formatting ### Paragraph Text | Format | Alternate | Result | | :—: | :—: | :—:
| | _italic_ | *italic* | italic | | **bold** | __bold__ | bold | | **_bold
italic_** | __*bold italic*__ | bold italic | | ~~strikethrough~~ | |
strikethrough | | ^superscript^ | | superscript | | ~subscript~ | | subscript |
### Headings Headings are denoted by a # at the beginning of a line. The number
of #s determines the heading level up to 6. The alternate format is to have the
heading text on the line below and underline it with = for heading 1 and - for
heading 2. ::: spoiler Heading examples #### Heading Format md # Heading 1 ##
Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 ###### Heading 6 ####
Heading Result # Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 #####
Heading 5 ###### Heading 6 #### Alternate Format md Heading 1 ========= Heading
2 --------- #### Alternate Result Heading 1 ========= Heading 2 --------- :::
### Blockquotes Blockquotes are simply a > at the beginning of a line. ####
Blockquote Format md > This is a blockquote. > This is > > a multiline > >
blockquote. > This is > not a multiline > blockquote. #### Blockquote Result >
This is a blockquote. > This is > > a multiline > > blockquote. > This is > not
a multiline > blockquote. ## Lists Lists can be ordered or unordered. Ordered
lists are numbered, unordered lists are bulleted. You can nest lists by
indenting them with 4 spaces or a tab, and you can mix ordered and unordered
lists by indenting them differently. ::: spoiler List examples ### Unordered
List Format md - Item 1 - Item 2 - Item 2.1 - Item 2.2 - Item 3 ### Unordered
List Result - Item 1 - Item 2 - Item 2.1 - Item 2.2 - Item 3 #### Ordered List
Format md 1. Item 1 2. Item 2 1. Item 2.1 2. Item 2.2 3. Item 3 #### Ordered
List Result 1. Item 1 2. Item 2 1. Item 2.1 2. Item 2.2 3. Item 3 #### Mixed
List Format md - Item 1 - Item 2 1. Item 2.1 2. Item 2.2 - Item 2.2.1 - Item 3
#### Mixed List Result - Item 1 - Item 2 1. Item 2.1 2. Item 2.2 - Item 2.2.1 -
Item 2.2.2 - Item 3 ::: ### Code Blocks Code blocks are denoted by 3 backticks
(```) on the line before and after the code block. Currently no syntax
highlighting is supported. You can also do inline code blocks by using a single
backtick (`) on either side of the code. ::: spoiler Code block examples ####
Code Block Format NOTE: Ignore the backslashes, they are only there to escape
the backticks. md \`\`\` python def hello_world(): print("Hello World!") \`\`\`
#### Code Block Result python def hello_world(): print("Hello World!") ::: :::
spoiler Inline code example #### Inline Code Format md This is a paragraph with
some `inline code` in it. #### Inline Code Result This is a paragraph with some
inline code in it. ::: ### Links Links are denoted by [link text](link url). You
can also do reference links by doing [link text][link id] and then [link id]:
link url somewhere else in the post, preferably at the bottom. ::: spoiler Link
examples #### Link Formats md [SFFA](https://sffa.community) [SFFA][sffa-wiki]
... somewhere down at the bottom of the post ... [sffa-wiki]:
https://sffa.community #### Link Results SFFA [https://sffa.community]
[SFFA][sffa-wiki] … somewhere down at the bottom of the post … [sffa-wiki]:
https://sffa.community [https://sffa.community] ::: ### Images Images are
denoted by ![alt text](image url). You can also do reference images by doing
![alt text][image id] and then [image id]: image url somewhere else in the post,
preferably at the bottom of the post like with reference links. ::: spoiler
Image examples #### Image Formats md ![Lemmy from
Motörhead]https://upload.wikimedia.org/wikipedia/commons/8/84/Lemmy-02.jpg)
![Lemmy from Motörhead][lemmy] ... somewhere down at the bottom of the post ...
[lemmy]: https://upload.wikimedia.org/wikipedia/commons/8/84/Lemmy-02.jpg ####
Image Results Lemmy from Motörhead
[https://upload.wikimedia.org/wikipedia/commons/8/84/Lemmy-02.jpg] ![Lemmy from
Motörhead][lemmy] … somewhere down at the bottom of the post … [lemmy]:
https://upload.wikimedia.org/wikipedia/commons/8/84/Lemmy-02.jpg
[https://upload.wikimedia.org/wikipedia/commons/8/84/Lemmy-02.jpg] ::: ###
Tables Tables are denoted by |s and -s. The first row is the header row, and the
second row is the alignment row. The alignment row is optional, and if it is not
included, the table will default to left alignment. The alignment row can be
left aligned with :---, right aligned with ---:, or center aligned with :---:.
The alignment row can also be omitted entirely, in which case the table will
default to left alignment. ::: spoiler Table examples #### Table Format md |
Header 1 | Header 2 | Header 3 | | :--- | :---: | ---: | | Left | Center | Right
| | Left | Center | Right | #### Table Result | Header 1 | Header 2 | Header 3 |
| :— | :—: | —: | | Left | Center | Right | | Left | Center | Right | ::: ###
Horizontal Rules Horizontal rules are denoted by 3 or more -s on a line by
themselves and require blank new lines above and below. ::: spoiler Horizontal
rule example #### Horizontal Rule Format md some text --- some more text ####
Horizontal Rule Result some text — some more text ::: ### Spoilers Spoilers are
denoted by ::: spoiler and ::: around a block of text or other markdown
elements. You can give the spoiler a title by putting it after ::: spoiler like
::: spoiler Spoiler Title. You CAN’T nest spoilers inside of each other. ####
Spoiler Format NOTE: Ignore the backslashes, they are only there to escape the
colons. md Some paragraph text. \::: spoiler Spoiler Title Some spoiler or
_other_ markdown elements. \::: Other paragraph text. #### Spoiler Result Some
paragraph text. ::: spoiler Spoiler Title Some spoiler or other markdown
elements. ::: Other paragraph text.
Just wanted to reach out to mention I think the linked page may be missing an opening (
in the image example:
![Lemmy from Motörhead]https://upload.wikimedia.org/wikipedia/commons/8/84/Lemmy-02.jpg)
great documentation by the way!
You must log in or # to comment.
You can open a pull request to fix it yourself! I have done it myself for the documentation, actually. They were missing a command for the docker installation guide.
If you need help figuring out how to do it, let me know.