It’s been a while, maybe a year since my last post, so I thought I have to at least write a post and hopefully going to be an easy read, so here I’m going to talk about the why, the what, and the how of the Markdown.
What’s with the rises?
Markdown is trending when Static Site Generators (SSG) are getting popular and becoming the next big thing of the Internet. Google and the other search engines start to penalize sites that load slowly, simply because users experience interacting with a web page becomes vital. Google wants the site owner to pay attention to web performance by using its tools such as Lighthouse, PageSpeed Insights, and AMP. Luckily, You can use this TestMySite tool to check whether your site going to be penalized or not?
WYSIWYG Editor
Some of you might have been blogging on any platform and then tired with all the hassle comes from WYSIWYG editor such as the post that won’t be saved, cluttered UI, missing button, crash update, etc.
The Markdown has the same purpose with the WYSIWYG but in a less hassle and distractive way, you can write in any editing tools such as notepad, docs, word, UltraEdit, or any online Markdown editor on the internet such as StackEdit, Dillinger, Editor.MD, Typora, etc.
And so you don’t have to be dependant on WYSIWYG editor that comes quite varies on each blogging platform. The WYSIWYG editor is converting what you type to HTML in real-time, so what you type on the editor is what you’ll see after the post gets published.
How do Markdown works?
As I mentioned before, the changes from the WYSIWYG editor will be visible immediately. But in Markdown, you need to add some Markdown Syntax to your writing, and then the text will be stored in a plaintext file with *.md
extension. But, How do you get the file converted to .html, .pdf, .epub, .doc, or .mobi
? Yes, indeed you need a converter, parser, implementation, or an app and those are called a Markdown processor
To summaries,
- Write some text with markdown syntax in any text editor,
- Save it with
*.md
extension, - Open the file in any markdown file converter, or copy-paste the text to any markdown parser I mentioned above.
How should I use Markdown?
Nowadays, markdown can be use for blogging thanks to SSG, as you can see, this site was created with one of the SSG called Hugo. Markdown is also good for taking notes, creating letters, composing email, presentations, tech documentations, or maybe books.
The Benefits
In my experience, after you get used to, you will experience faster writing, more focus, less distraction, easy editing, generics, means that, your writing can be easily migrate to any type of documents (html, pdf, epub, doc, or mobi)
. Not to worry, you can also use any html tags to your writing. As result, I never want to write my blog post using any other tools than markdown.
Markdown Syntax
As you go through all these syntaxes, you need to pay attention to spaces, tabs, and indentations because it matters. You can copy-paste the example below to any online Markdown editor mentioned above.
Headers <h1..h6/>
Add a couple of # hash and a single space at the beginning of a word or sentences, the number of # hash corresponds to the heading level.
|
|
Paragraphs <p/>
|
|
Line Breaks <br/>
Sometimes when you hit <Enter>
once (i.e., insert a new line) the line break should be created, but if it’s not, try to end the word or sentence with 2 or more spaces
|
|
Technical note: If the result above is the same, then the markdown processor uses GFM line breaks, so there’s no need to use MD’s two-space line breaks.
Italic <em/>
Add * or _ before and after a word or sentence
|
|
Bold <strong/>
Add ** or __ before and after a word or sentence
|
|
Bold and Italic <strong><em>
Add *** or ___ before and after a word or sentence
|
|
Blockquotes <blockquote/>
Add > in front of a word or sentence
|
|
Ordered List <ol/>
Add number and period in front of the word or sentence, the first number is important, the rest will follow. Add two blank lines to create another group of list
|
|
Unordered List <ul/>
You may add these symbols * (asterisk) or + (plus) or - (dash) in front of the sentence to create an unordered list, the way you insert another element to the list is pretty much the same as the ordered list, the different that might happened is that the unordered list doesn’t create a paragraph inside the list at the first place.
|
|
Code Blocks <pre><code>
The Code blocks normally indented with four spaces or a tab, the other way is to enclose the codes with three of this ` tick symbol at the beginning and the end of the code (not available in all markdown processor).
|
|
Syntax Highlighting,
|
|
For a single line of code, you can use a tick symbol before and after the code,
|
|
Escaping Symbols
You can use a \ backslash symbol to escape a symbol,
|
|
Especially if you want to escape the tick marks in a line of code, you may enclose the sentence in double tick marks ``
|
|
All the symbol that you can escape,
Symbols | Name |
---|---|
\ | backslash |
` | tickmark |
* | asterisk |
_ | underscore |
{} | curly braces |
[] | brackets |
() | parentheses |
# | hash |
+ | plus |
- | minus |
. | dot/period |
! | exclamation |
Horizontal Rules <hr/>
|
|
Images <img/>
You may use either an absolute or relative path
|
|
Links <a/>
|
|
Reference-style links <a/>
If you got so many links on your post and you’re kinda want to make it a little bit neat, you can try to reference all the links in one place.
|
|
URLs and Email <a/>
|
|
Extended Markdown
These extended syntaxes below aren’t available in all Markdown processors or parsers, you need to experiment yourself.
Tables <table/>
To create a table, you need to use three or more hyphens --- to create each column’s header, and some pipes | to separate each column
|
|
you can add alignment,
|
|
Heading IDs
This might be different in each markdown processor,
|
|
Link to Heading IDs,
|
|
Definition List <dl/>
|
|
Strikethrough <del/>
|
|
Task lists <input type="checkbox"/>
You can create a list of items with checkboxes if it’s supported by a markdown processor
|
|
“The scariest moment is always just before you start. After that, things can only get better.”
~ Stephen King