diaspora* tutorials

Formatting text

On diaspora* it’s possible to format your text in status messages, comments and conversations using a simplified mark-up system called Markdown. This page gives an introduction to the codes used to create this formatting.

The first thing to note is that you must use two line breaks between paragraphs (except items in a list), otherwise the paragraps will run together. If you really want just one line break between two paragraphs, add two spaces at the end of the first paragraph.

This is where the Preview button comes in really handy. Try some formatting, preview it, work out what isn’t right, fix it, and preview again, until you’re happy! In the examples below, you can copy the text in the grey areas and paste it into the publisher in diaspora* and use the Preview button to try out some formatting.

Headings

You can add first-, second- and third-level headings to your message by placing a hash symbol (#) at the start of a line, as follows:

 

# 1. An extremely large header


## 2. Half as big as the one above


### 3. Twice the size of normal text

1. An extremely large header

2. Half as big as the one above

3. Twice the size of normal text

Make sure to leave a space between the hashes and your text, to avoid creating a #tag instead of a heading. The heading ends once you hit enter to proceed to the next line.

Lists

To create an bulleted list, place either *, + or - in front of each line you want as part of the list.

It’s also possible to make numbered lists by placing “1.”, “2.”, etc. in front of the list items. To create a numbered list, the numbers must have periods/full stops after them.

Again, make sure to leave a space between the “bullet” character and the text on each line, and to leave a line space between the list and any preceding/following text, otherwise it will not work.

This is how to create a bulleted list:

* item one;
* item two;
* item three.

This will become another bulleted list:

- item one;
- item two;
- item three.

And this will be a numbered list:

1. item one;
2. item two;
3. item three.

This is how to create a bulleted list:

  • item one;
  • item two;
  • item three.

This will become another bulleted list:

  • item one;
  • item two;
  • item three.

And this will be a numbered list:

  1. item one;
  2. item two;
  3. item three.

Quotation

When you want to quote an extract of an article or another comment, you can conveniently format your text by starting the line or the paragraph by the “>” character followed by a space:

This is normal text introducing your quotation:
      
> This is a quotation.
> And a second paragraph of the quotation.

This is the text following the quotation.

This is normal text introducing your quotation:

This is a quotation.
And a second paragraph of the quotation.

This is the text following the quotation.

Preformatted text

To insert “preformatted” text, which appears in a monospaced font and respects paragraph indentations and other things, start each line of text with four spaces. Adding more spaces will allow for further indenting.

This is a line of normal text.

    This will be a preformatted block.
    The block continues on this line,
      and then another line, indented by two spaces.

Then back to normal text.

This is a line of normal text.

This will be a preformatted block.
The block continues on this line,
  and then another line, indented by two spaces.

Then back to normal text.

Code blocks

If you are a developer you may be interested in code blocks. To create a code block, start your text/code with four backticks ( ` ` ` ` ). To return to normal text, close the code block with another four.

It’s also possible to display code inline, by marking the start and end of the snippet with a single backtick.

This is a line of normal text.

````this will be a code block````

Then some more more normal text.

````More code in this block,
  and a line of code indented by two spaces````

This line contains `a code snippet` in the middle.

This is a line of normal text.

this will be a code block

Then some more more normal text.

More code in this block,
  and a line of code indented by two spaces

This line contains a code snippet in the middle.

Horizontal line

To create a horizontal line, use at least three - - -, _ _ _ or * * * on a separate line. Any number above three will do the same thing and spaces between the characters do not matter.

A line of text above the horizontal rule.

---

The start of the next section of text.

A line of text above the horizontal rule.


The start of the next section of text.

Italics and bold

Place either asterisks or underscores either side of a word or words to make them italic, bold or bold italic.

  • Italics: *word* or _word_
  • Bold: **word** or __word__
  • Bold italics: ***word*** or ___word___

You must of course match the number of asterisks/underscores either side of words for the formatting to work. Typing “I want to display this as a **bold* word” won’t display the word in bold.

Inline links

To create an inline link, use the following code:

[displayed text here](http://link.address.here "alt text")

The “alt text” is optional, and is displayed as a tool-tip when the cursor is moved over the link.

Images

To add external images to your post, comment or private message, use the same code as for a link, but with an exclamation point at the front:

![Alt text](http://website.com/image.jpg "optional title")

For this to work, you must provide a direct link to a valid image file, not to a web page with an image or images on it.

The alternative text in the square brackets is displayed if the image cannot be loaded, and the optional title is displayed as a tool-tip when the cursor is moved over the image; both are useful but not essential.

Escape

If you want your message to include a character which is also used in Markdown coding, you can prevent it from being read by Markdown as a formatting code by “escaping” it. To do this, place a backslash ( \ ) in front of the character. For example, typing

this \_ is an underscore

prevents Markdown from reading the underscore as a Markdown code and allows diaspora* to display the underscore rather than creating italic text.

You can, however, type “diaspora*” or “D*” without the asterisk being interpreted as a formatting code!

Special characters

You can create the following symbols and other special characters using a combination of characters:

  • "->" = "→" ; "<-" = "←" ; "<->" = "↔"
  • "(c)" = "©" ; "(r)" = "®" ; "(tm)" = ™
  • "<3" = "♥"
  • "(p)" = "§"
  • "x^2^" = "x²"

There’s a more detailed description of Markdown’s syntax on this page.

diaspora* tutorials | Getting started in diaspora*