Tools for the Forum. Markdown, BBCode and HTML formatting

Most of the time, the editors buttons are all we need to format the text we write on the forum. But there are many other options you can use to embellish your posts, add clarity to your texts or change the layout of your posts.

So here’s a list of tags and codes you need to format your text manually, or to insert those other options.

NOTE: I still have content to add to the list. After I’m done I’ll give credit to all the sites where I found the documentation for this page.


Table of Content

Mardown & BBCode formating
Text Formatting
Font color
Headings
Lists
Tables
Blockquotes
Codes Formatting
Horizontal line

Additional features, using HTML tags
Table of Content
Mimic keyboard keys or buttons
Small text
Abbreviations
Insertions and deletions
Non-breaking space
Tabulation
 


Text Formatting

    BOLD

    Syntax Result
    **bold** = bold
    __bold__ = bold

    ITALIC

    Syntax Result
    *italic* = italic
    _italic_ = italic

    BOLD & ITALIC combo

    Syntax Result
    _**italic and bold**_ = italic and bold

    STRIKE-THROUGH

    Syntax Result
    ~~strike-through~~ = strike-through

    Alternatively, BBCode syntax can be used

    Syntax Result
    [b]bold[/b] bold
    [i]italic[/i] italic
    [u]underline[/u] underline
    [s]strike-through[/s] strike-through

 

Back to Table of Content ▲


Font color

Font color is not natively supported by the forum.

 

Back to Table of Content ▲


Headings

    Syntax:

    # H1
    ## H2
    ### H3
    #### H4
    ##### H5
    ###### H6

    Results:

    H1

    H2

    H3

    H4

    H5
    H6

 

Back to Table of Content ▲


Lists

  Unordered list

    Syntax
    Example of unordered list
    * Item one
    * item two
    * Item three

    OR

    Example of unordered list
    - Item one
    - item two
    - Item three

    Result
    Example of unordered list

    • Item one
    • item two
    • Item three

  Ordered list

    Syntax:

    Example of ordered list
    1. Item one
    2. Item two
       * Sub-item one (sub-lists are offset by three spaces)
       * Sub-item two
    3. Item three
    4. Item four

    Result:
    Example of ordered list

    1. Item one
    2. Item two
      • Sub-item one (sub-lists are offset by three spaces)
      • Sub-item two
    3. Item three
    4. Item four

 

Back to Table of Content ▲


Tables

NOTE - The easiest way to get a table into the forum is to create a table in an spreadsheet, then copy & paste that table into the editor window. Discourse (the forum) natively handles the format change and makes creating a table much easier. Excel and Google Sheets work great using this method.

    A table needs at least these first two lines to exist:

    • First line = Column tittles.
    • Second line = Separator.

    Syntax:

    |Name|Occupation|Brith place|
    |-|-|-|
    |John|Taxi driver|Chicago|
    |Andrea|Writer|Milan|
    |Guillaume|Developer|Paris|

    Result:

    Name Occupation Place of birth
    John Taxi driver Chicago
    Andrea Writer Milan
    Guillaume Developer Paris

 

Back to Table of Content ▲


Blockquotes

You can manually create quotes by adding a greater than sign (>) in front of a line.

    Example #1 - Short line of text:

    Syntax
    > This is a quote.

    Result

    This is a quote.

    Example #2 - Long line of text (without line breaks):

    Syntax:
    > This is a long line of text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eget laoreet nulla, a viverra sapien. Quisque ante libero, commodo vel erat nec, dictum aliquet lorem. Aliquam id lorem non nibh tempus blandit gravida eget massa. Vestibulum tristique imperdiet tincidunt. Fusce dignissim suscipit convallis.

    Result:

    This is a long line of text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eget laoreet nulla, a viverra sapien. Quisque ante libero, commodo vel erat nec, dictum aliquet lorem. Aliquam id lorem non nibh tempus blandit gravida eget massa. Vestibulum tristique imperdiet tincidunt. Fusce dignissim suscipit convallis.

 

Back to Table of Content ▲


Code Formatting

  Inline code formatting
  Use backticks (`) before and after a section of codes
  Do Alt+NumPad 9+NumPad 6 to type a backtick.

    Syntax:
    ˋfor (var i = 0; i < 6; i ++)ˋ
    Result:
    for (var i = 0; i < 6; i ++)

    Variant - Inside a normal line of text:

    Syntax:
    normal text ˋpreformat textˋ. normal text
    Result
    normal text preformat text normal text.

    NOTE: If you use it for an entire paragraph or a long line of text or code, the width of the text will not exceed the width of the page and will be displayed on multiple lines. Like this:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer in maximus felis, ut tempor augue. Nunc sit amet nulla quis enim posuere aliquam eleifend vel diam.

    To show the entire text in one single line (with a scroll bar), instead of using the backticks, create an blank line, then place 4 blank spaces before the text. It will look like this:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer in maximus felis, ut tempor augue. Nunc sit amet nulla quis enim posuere aliquam eleifend vel diam.
    

  
  Block of code with multiple lines
  Insert 3 backticks before and 3 backticks after your lines of code

    Syntax:
    ˋˋˋ
    p { font-family: ‘Arial’; color: #ffffff; }
    table { border-width: 0px; border-color:#000000; }
    td { border-width: 1px; border-color:#000000; }
    ˋˋˋ

    Result:

    p { font-family: 'Arial'; color: #ffffff; }
    table { border-width: 0px; border-color:#000000; }
    td { border-width: 1px; border-color:#000000; }
    

 

Back to Table of Content ▲


Horizontal line

Three consecutive dashes `---`, asterisks `***` or underscores `___` placed under a blank line will create a horizontal line

 

Back to Table of Content ▲


 

Additional features, using HTML tags.

Add a Table of Content

This is not a native feature of the Discourse forums, but you can manually create a table of content by using HTML headings and ID instead of the `##` Markup heading syntax. Make sure the ID is always prefixed with *heading- -*

    Example of a table of content

    Syntax

    ### The Hobbit: Table of Content
    [Chapter 1 - An Unexpected Party](#heading--first-header)
    [Chapter 2 - Roast Mutton](#heading--second-header)
    [Chapter 3 - A Short Rest](#heading--third-header)
    [Chapter 4 - Over Hill and Under Hill](#heading--fourth-header)
    <h3 id="heading--first-header">Chapter 1 - An Unexpected Party</h3>
    Bla bla bla
    <h3 id="heading--second-header">Chapter 2 - Roast Mutton</h3>
    Bla bla bla
    <h3 id="heading--third-header">Chapter 3 - A Short Rest</h3>
    Bla bla bla, and bla
    <h3 id="heading--fourth-header">Chapter 4 - Over Hill and Under Hill</h3>
    Bla bla end

    Result:

    The Hobbit: Table of Content

    Chapter 1 - An Unexpected Party
    Chapter 2 - Roast Mutton
    Chapter 3 - A Short Rest
    Chapter 4 - Over Hill and Under Hill

    Chapter 1 - An Unexpected Party

    Bla bla bla

    Chapter 2 - Roast Mutton

    Bla bla bla

    Chapter 3 - A Short Rest

    Bla bla bla, and bla

    Chapter 4 - Over Hill and Under Hill

    Bla bla end

 

Back to Table of Content ▲


Mimic keyboard keys or buttons

    Syntax Result
    <kbd>A</kbd> A
    <kbd>Shift</kbd> Shift
    <kbd>Ctrl</kbd>+<kbd>C</kbd> Ctrl+C

 

Back to Table of Content ▲


Small text

    Syntax Result
    Normal text Normal text
    <small>Small text</small> Small text

 

Back to Table of Content ▲


Abbreviations

This tag allows to define abbreviations, and the long form will be shown when hovering over the text.

    Syntax
    The new <abbr title="Video User Interface">VUI</abbr> is very useful.
    Result
    The new VUI is very useful.

 

Back to Table of Content ▲


Insertions and deletions.

Used to explicitly show changes made to a text or to propose change to a text. I guess this can be used also to highlight text. It has nothing to do with a post’s edit history feature.

    Syntax
    A Shotcut project is saved as a <del>.mtl</del> <ins>.mlt</ins> file
    Result
    A Shotcut project is saved as a .mtl .mlt file

 

Back to Table of Content ▲


Non-breaking space

    Useful to create blank spaces inside your text, or vertical space when placed on its own line.

    Syntax
    &nbsp;&nbsp; Line starting with two blank spaces
    &nbsp; Line starting with one blank space
    Line with no blank space
    Result
       Line starting with two blank spaces
      Line starting with one blank space
    Line with no blank space

 

Back to Table of Content ▲


Tabulation

Mimic tabulation by using list tags like <ul></ul> or <ol></ol> without their <li> elements. This is useful to indent an entire paragraph or an image.

    NOTE: Always put a blank line under <ul> and under </ul>

    Syntax
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum maximus tristique nisl, vulputate mattis lacus molestie vel. Vivamus vulputate elit nibh, id finibus purus egestas sit amet.
    <ul>

    Vestibulum venenatis mollis varius. Nullam eleifend sollicitudin odio, viverra venenatis ante venenatis ac.
    </ul>

    Pellentesque eleifend magna id metus vestibulum porta.

    Result
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum maximus tristique nisl, vulputate mattis lacus molestie vel. Vivamus vulputate elit nibh, id finibus purus egestas sit amet.

      Vestibulum venenatis mollis varius. Nullam eleifend sollicitudin odio, viverra venenatis ante venenatis ac convallis mauris.

    Pellentesque eleifend magna id metus vestibulum porta. Etiam tincidunt, est et pellentesque gravida, lacus urna convallis mauris, non condimentum mauris lorem quis ligula.

 

Back to Table of Content ▲


6 Likes

Amazing, I was just looking for this to mark up a post I plan to release tomorrow. This is a huge help.

There was also a code to create a triangle that rolls open some hidden text when clicked, like a drill-down bullet point. What’s the code for that?

@Hudson555x has also written documentation with a table of contents on the side, and it would be nice to know how to do that too.

2 Likes

Wow, this is SOOO useful, especially for regular posters. I’ve noticed in the past, @musicalbox, that your posts are always impeccably formatted. Bravo for providing this list. :+1:

2 Likes

The last button in the editor bars (the gear icon) open it and click the Hide details option

Click to learn more

Made you look ! :slight_smile:

2 Likes

I will add the steps to make a table of content. Give me a few minutes.

2 Likes

@MusicalBox - Apologies if I missed it (I just scanned briefly through your list) but did you mention that if you put four spaces at the beginning of each line of long text (especially useful for HTML code) you get the content of the code with scroll bars appearing if necessary:

Normal text:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum maximus tristique nisl, vulputate mattis lacus molestie vel. Vivamus vulputate elit nibh, id finibus purus egestas sit amet. This is a long line of text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eget laoreet nulla, a viverra sapien. Quisque ante libero, commodo vel erat nec, dictum aliquet lorem. Aliquam id lorem non nibh tempus blandit gravida eget massa. Vestibulum tristique imperdiet tincidunt. Fusce dignissim suscipit convallis.

With four spaces:

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Vestibulum venenatis mollis varius. Nullam eleifend sollicitudin odio, 
viverra venenatis ante venenatis ac convallis mauris. This is a long line of text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eget laoreet nulla, a viverra sapien. 
Quisque ante libero, commodo vel erat nec, dictum aliquet lorem. Aliquam id lorem non nibh tempus blandit gravida eget massa. Vestibulum tristique imperdiet tincidunt. Fusce dignissim suscipit convallis.

@Austin I just added the instructions for Table of Content. I hope I didn’t make any mistake :smiley:

@jonray I didn’t know about the 4 spaces. But I think you can do the same with <pre> and </pre> or use the Preformatted text button on the editor tool bar OR use backticks ( ` ) before and after your text.

I’ll take a note to add this latter.

EDIT: You’re right. Adding four spaces is different.

  • Adding backticks limits the length of the text to the width of the page and thus displays the text on multiple lines.
  • Adding 4 spaces forces the text to stay on one line and adds a scroll bar under the line of text.
  • Adding <pre> and </pre> seems to adds a scroll bar to the entire page.
1 Like

It’s a useful tip I got from @elusien some time ago. The collective wisdom of this forum is awesome!

1 Like

Added. Right after the Blockquote part.
Thanks for the suggestion @jonray :+1:

I think I’ll need to add a Table of content :grin:

The only thing I’m not sure how to do is the code box, not that I would need to use it as I just prefer to have a downloadable txt/mlt file ready for use. Possibly it’s:


I find that formatting options obscure the post preview when inserted into a reply. I wish there was a way to hide this, especially among Regulars.


You mean when we quote a part of someone’s post into a reply ?

I added a table of content and links to go back to the top of the page.

2 Likes

Amazing and very useful! Thanks a million @musicalbox !

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.