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:

# This is an extremely large header

## Half as big as the one above

### 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:

* Lists Item1
* Lists Item2
* Lists Item3

item one;

- Lists Item1
- Lists Item2
- Lists Item3

item two;

1. Lists Item1
2. Lists Item2
3. Lists Item3

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:

This is normal text introducing your quotation:
      
> This is a quotation.

This is the text following the quotation.

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.

Another way to do this is to start each of your lines of code with four spaces. Adding more spaces will allow for further indenting.

It’s also possible to display code inline, `by starting and ending the snippet with a backtick`.

This is a line of normal text.

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

Then some more more normal text.

    and then a bit more code
      a line of code indented by two spaces

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.

There will be a horizontal rule between this line of text and the next one.

---

And now you can start the next section of your 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 asterisks/underscores in pairs 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 becoming a formatting code!

Special characters

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

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

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

diaspora* tutorials | Getting started in diaspora*