The TinyMCE Editor in Publii does not currently include a full markdown editor, but it does have support for the most common shortcuts, which will help you create your post content faster.
- ## - Two hashes before a sentence sets the text as an H2, or Heading 2, HTML element.
- ### - Three hashes before a sentence creates an H3, or Heading 3, HTML element.
- #### - Four hashes create an h3, or Heading 4, element.
- ##### - Five hashes create an H5, or Heading 5, element.
- ###### - Six hashes create an H6, or Heading 6, element.
- 1. - The number '1' and a full-stop followed by a space creates an OL, or Ordered List, HTML element.
- - , * - A star or hyphen (otherwise known as a dash) followed by a space creates a UL, or Unordered List, HTML element.
- *text* - Inserting stars before and after a block of text will turn that text italic.
- **text** - Inserting two starts before and after a block of text will turn that text bold.
Inserting Headings with Markdown
The heading elements in HTML (H1-H6) are used to create titles for your content. Each heading 'level' is used to show where a particular title is in the post hierarchy; for example, the main title of a page or article will use the H1 heading, while each subsection of the article will use an H2 heading. If each section has its own subsections, then they will usually use the next heading down; a subsection under a H2 heading will use a H3 heading, and so one. This creates a structure to your content that is easily understandable to both people and computers! In Publii, the main H1 title is created by the 'Title' field in the post editor, and the other headings may be added manually as you create your content. With markdown shortcuts, this can be done very quickly and easily.
To insert a heading using markdown, you add hashes (#) corresponding to the heading you want to insert before your title. So, to insert a Heading 2 element (H2), you would write:
##My heading 2 title
...then hit enter. The Post Editor will automatically convert this to a Heading 2 element in HTML. If you want to insert a Heading 3 (H3) element, just add three hashes before the title, and so on.
Inserting Lists with Markdown
There are two types of lists that are common in HTML, and in writing in general; ordered lists, or lists with numbered items, and unordered lists, which use bulletpoints instead of numbers for each item. Inserting them using markdown is extremely fast and easy. For an unordered list, type a star (*) or a hyphen/dash (-) followed by a space before the first item's text in a list. When you hit enter, the text will automatically change to a bulletpoint item. For example, typing:
* The first item in my unordered list.
...and hitting the enter key will add a bulletpoint before the text, and automatically create a second bulletpoint for your new line of text, so you can add the next item. Simply add your next item, then hit enter again to create a third item etc...Once you've added all the items you want, pressing enter on a blank item will end the list.
Inserting ordered lists works in exactly the same way, but instead of using a star or hyphen, you can just start to write the list using "1. ". The item will automatically be formatted into a list. Once you've added enough items, just hit enter on a blank item to end the list.
Adding Bold or Italic Text with Markdown
Markdown can automatically change your text to be bold or italic by wrapping the text in the appropriate symbol, in this case a star (*) for italics, and two stars (**) for bold. To make a sentence bold, you should add two stars before and after the text. For italic, add one star before and after the text:
**This text will be bold**.
*This text will be italic*.
This text will be unchanged.
The Post Editor will change the text as soon as you press space after adding the last star, so you'll know immediately that is has worked.