Markdown: Difference between revisions
(→Syntax) |
(→Images) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 22: | Line 22: | ||
https://commonmark.org/help/ | https://commonmark.org/help/ | ||
== Basic Syntax == | |||
https://www.markdownguide.org/basic-syntax/ | |||
== Tutorial == | == Tutorial == | ||
Line 32: | Line 36: | ||
== Syntax == | == Syntax == | ||
Source: http://daringfireball.net/projects/markdown/basics | |||
=== Emphasis === | |||
<pre> | |||
Some of these words *are emphasized*. | |||
Some of these words _are emphasized also_. | |||
Use two asterisks for **strong emphasis**. | |||
Or, if you prefer, __use two underscores instead__. | |||
</pre> | |||
=== Headers === | |||
<pre> | <pre> | ||
Line 40: | Line 58: | ||
--------------------- | --------------------- | ||
# This is an H1 # | |||
## This is an H2 ## | |||
### This is an H3 ######### | |||
</pre> | |||
=== Paragraph === | |||
<pre> | |||
Now is the time for all good men to come to | Now is the time for all good men to come to | ||
the aid of their country. This is just a | the aid of their country. This is just a | ||
Line 46: | Line 75: | ||
The quick brown fox jumped over the lazy | The quick brown fox jumped over the lazy | ||
dog's back. | dog's back. | ||
</pre> | |||
=== Block Quote === | |||
<pre> | |||
> This is a blockquote. | > This is a blockquote. | ||
> | > | ||
> This is the second paragraph in the blockquote. | > This is the second paragraph in the blockquote. | ||
> | > | ||
</pre> | |||
=== Block Quote Header === | |||
<pre> | |||
> ## This is an H2 in a blockquote | > ## This is an H2 in a blockquote | ||
</pre> | |||
=== Lists === | |||
<pre> | |||
The following all produce the same unordered list styles: | The following all produce the same unordered list styles: | ||
Line 70: | Line 100: | ||
* Gum. | * Gum. | ||
* Water. | * Water. | ||
* Salt. | |||
+ Candy. | + Candy. | ||
+ Gum. | + Gum. | ||
+ | + Water. | ||
+ Salt. | |||
- Candy. | - Candy. | ||
- Gum. | - Gum. | ||
- | - Water. | ||
- Salt. | |||
Ordered list: | Ordered list: | ||
Line 85: | Line 117: | ||
2. Green | 2. Green | ||
3. Blue | 3. Blue | ||
1. Yellow | |||
2. Purple | |||
Note: need 4 spaces for the number list indent. | |||
</pre> | |||
=== Links === | |||
This is an [example link](http://example.com/). | This is an [example link](http://example.com/). | ||
Line 100: | Line 139: | ||
</pre> | </pre> | ||
=== Code Blocks === | |||
Code blocks are normally indented four spaces or one tab. | |||
<pre> | |||
this is a | |||
code block. | |||
</pre> | |||
=== Images === | |||
<pre> | |||
![Tux, the Linux mascot](/assets/images/tux.png) | |||
</pre> | |||
=== Horizontal Rule === | |||
To create a horizontal rule, use three or more asterisks (***), dashes (---), or underscores (___) on a line by themselves | |||
== GitHub Flavored Markdown == | == GitHub Flavored Markdown == | ||
Line 107: | Line 163: | ||
== Linux == | == Linux == | ||
=== View on Command Line === | |||
See [[mdless]] | |||
=== Convert to HTML === | === Convert to HTML === |
Latest revision as of 21:24, 29 February 2024
Markdown
Getting started with writing and formatting on GitHub - GitHub Help - https://help.github.com/articles/markdown-basics/
Daring Fireball: Markdown - http://daringfireball.net/projects/markdown/
- "Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML)."
---
Markdown - Wikipedia - http://en.wikipedia.org/wiki/Markdown
- "Markdown is a lightweight markup language, originally created by John Gruber with substantial contributions from Aaron Swartz, allowing people “to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML)”. The language takes many cues from existing conventions for marking up plain text in email. In other words, Markdown is a text-to-HTML conversion tool (for web writers).
- Markdown is also a Perl script written by Gruber, Markdown.pl, which converts marked-up text input to valid, well-formed XHTML or HTML and replaces left-pointing angle brackets ('<') and ampersands with their corresponding character entity references. It can be used as a standalone script, as a plugin for Blosxom or Movable Type, or as a text filter for BBEdit.
- Markdown has since been re-implemented by others as a Perl module available on CPAN (Text::Markdown), and in a variety of other programming languages. It is distributed under a BSD-style license[3] and is included with, or available as a plugin for, several content-management systems.
- Sites such as GitHub, reddit, Stack Overflow and SourceForge use Markdown to facilitate discussion between users."
Quick Reference
https://commonmark.org/help/
Basic Syntax
https://www.markdownguide.org/basic-syntax/
Tutorial
https://commonmark.org/help/tutorial/
Testing
https://spec.commonmark.org/dingus/
Syntax
Source: http://daringfireball.net/projects/markdown/basics
Emphasis
Some of these words *are emphasized*. Some of these words _are emphasized also_. Use two asterisks for **strong emphasis**. Or, if you prefer, __use two underscores instead__.
Headers
A First Level Header ==================== A Second Level Header --------------------- # This is an H1 # ## This is an H2 ## ### This is an H3 #########
Paragraph
Now is the time for all good men to come to the aid of their country. This is just a regular paragraph. The quick brown fox jumped over the lazy dog's back.
Block Quote
> This is a blockquote. > > This is the second paragraph in the blockquote. >
Block Quote Header
> ## This is an H2 in a blockquote
Lists
The following all produce the same unordered list styles: * Candy. * Gum. * Water. * Salt. + Candy. + Gum. + Water. + Salt. - Candy. - Gum. - Water. - Salt. Ordered list: 1. Red 2. Green 3. Blue 1. Yellow 2. Purple Note: need 4 spaces for the number list indent.
Links
This is an [example link](http://example.com/).
This is an [example link](http://example.com/ "With a Title").
Reference style links:
I get 10 times more traffic from [Google][1] than from [Yahoo][2] or [MSN][3].
[1]: http://google.com/ "Google" [2]: http://search.yahoo.com/ "Yahoo Search" [3]: http://search.msn.com/ "MSN Search"
Code Blocks
Code blocks are normally indented four spaces or one tab.
this is a code block.
Images
![Tux, the Linux mascot](/assets/images/tux.png)
Horizontal Rule
To create a horizontal rule, use three or more asterisks (***), dashes (---), or underscores (___) on a line by themselves
GitHub Flavored Markdown
See GitHub/GitHub Flavored Markdown
Linux
View on Command Line
See mdless
Convert to HTML
sudo apt install markdown
markdown file.md > file.html
ref: [1]
convert to DOCX
Pandoc can convert into several different formats
sudo apt install pandoc
pandoc file.md -f markdown -t html -s -o file.html
pandoc file.md -f markdown -t docx -s -o file.docx
ref: [2]