Markdown reference guide: Difference between revisions

From diaspora* project wiki
(added markdown code for Image Links)
(Drop i18n template)
 
(2 intermediate revisions by 2 users not shown)
Line 22: Line 22:
== Text formatting ==
== Text formatting ==


<pre>*Italic Text*</pre>
Use asterisks or underscores to make emphasise text:
<pre>*Italic Text* or  _Italic Text_</pre>
becomes &quot;''Italic Text''&quot;.
becomes &quot;''Italic Text''&quot;.


<pre>**Bold Text**</pre>
<pre>**Bold Text** or  __Bold Text__</pre>
becomes &quot;'''Bold Text'''&quot;.
becomes &quot;'''Bold Text'''&quot;.


<pre>***Bold Italic Text***</pre>
<pre>***Bold Italic Text*** or  ___Bold Italic Text___</pre>
becomes &quot;'''''Bold Italic Text'''''&quot;.
becomes &quot;'''''Bold Italic Text'''''&quot;.


Similarly, we can also use &quot;_&quot;:


<pre>___Bold Italic Text___</pre>
This allows for nesting:
This allows for nesting:
<pre>_Italic **Bold** Text_</pre>
<pre>_Italic **Bold** Text_</pre>
becomes &quot;''Italic '''Bold''' Text''&quot;.
becomes &quot;''Italic '''Bold''' Text''&quot;.


If needed, a &quot;*&quot; or &quot;_&quot; inside the text can be escaped with the &quot;\&quot; character:
 
If needed, a &quot;*&quot; or &quot;_&quot; in your text can be escaped with the &quot;\&quot; character:


<pre>__Use Two \_ for Bold Text__</pre>
<pre>__Use Two \_ for Bold Text__</pre>
becomes &quot;'''Use Two _ for Bold Text'''&quot;. Of course, this can also be used to prevent formatting:
becomes &quot;'''Use Two _ for Bold Text'''&quot;. Of course, this can be used to prevent formatting:
 
<pre>\_Italic_ \*\*Bold**</pre>
becomes &quot;_Italic_ **Bold**&quot;.
 


<pre>\_Italic_ \**Bold**</pre>
Use tildes to strike through characters:
becomes &quot;_Italic_ *''Bold''*&quot;.
<pre>~~Strikethrough~~</pre>
becomes &quot;<strike>Strikethrough</strike>&quot;.


== Links ==
== Links ==

Latest revision as of 02:45, 15 October 2018

Diaspora supports a number of ways to format messages. These are basically a part of the description language Markdown.

Paragraphs

Paragraphs are separated by blank lines.

This is one paragraph.

This is another.

Sometimes the line breaks are important, such as when you're entering poetry. To do this, add two spaces to the end of each line.

Roses are red.
Violets are blue.
I am very bad at poetry.

Indenting the lines of a paragraph by four spaces will result in a block of pre-formatted text, which is handy for code samples.

Hey guys, look at my code!

    10 PRINT "HELLO"
    20 GOTO 10

Text formatting

Use asterisks or underscores to make emphasise text:

*Italic Text*  or  _Italic Text_

becomes "Italic Text".

**Bold Text**  or  __Bold Text__

becomes "Bold Text".

***Bold Italic Text***  or  ___Bold Italic Text___

becomes "Bold Italic Text".


This allows for nesting:

_Italic **Bold** Text_

becomes "Italic Bold Text".


If needed, a "*" or "_" in your text can be escaped with the "\" character:

__Use Two \_ for Bold Text__

becomes "Use Two _ for Bold Text". Of course, this can be used to prevent formatting:

\_Italic_ \*\*Bold**

becomes "_Italic_ **Bold**".


Use tildes to strike through characters:

~~Strikethrough~~

becomes "Strikethrough".

Links

Full URLs, for example http://example.org , are automatically converted into links. This also works for ftp:// like ftp://example.org . Furthermore, everything starting with www. is converted into a link, for example www.example.org.

For more control, the Markdown syntax also allows the link to be named. For example

[Official Website](http://example.org)

is Official Website. Key point: square brackets before round.

Images

To embed an image in a post, use the above syntax with an exclamation mark at the beginning:

![Image title](http://example.org/image.jpg)

For this to work, the URL needs to be a direct link to a valid image file (ending in .jpg, .gif, etc), not to a web page containing an image.

Image Links

By combining the Link and Image syntax you can create an Image Link. For example

[![](https://wiki.diasporafoundation.org/skins/common/images/poweredby_mediawiki_88x31.png)](https://www.mediawiki.org/wiki/MediaWiki)

If you are federating with diaspora compatible systems be aware that image links may not be supported on all platforms.