Flavoured Markdown¶
Flavoured markdown is a type of markdown that is customised with different syntax to provide a more stylistic documentationn. As you know, markdown is great for its simplicity, however this also makes it inflexible when making more stylistic documentation such as creating Math formula with Latex and many more feature that you wil see here. With Flavoured Markdown, there are certain syntax to follow on top of the original markdown syntax.
Below is a very very small overview to whatMkdocs Material - the base extension . I will just highlight some of them, because those are the only documentation syntax that is commonly use and usually remembered.
Admonitions¶
These are kind of those fancy boxes that you usually in cool Science Books that adds extra information.
Note
As you can see this box, is very attractive.
The syntax for this is:
1 2 |
|
What If You want a different Title
The syntax for this is:
1 2 |
|
Icons¶
More info here
You can also change these icons by changing the first word after !!!
or ???
.
note
,seealso
-
Note
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
abstract
,summary
,tldr
-
Abstract
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
info
,todo
-
Info
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
tip
,hint
,important
-
Tip
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
success
,check
,done
-
Success
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
question
,help
,faq
-
Question
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
warning
,caution
,attention
-
Warning
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
failure
,fail
,missing
-
Failure
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
danger
,error
-
Danger
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
bug
-
Bug
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
example
-
Example
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
quote
,cite
-
Quote
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
Collapsible Block¶
More info here
If things are getting a little bit crowded, why not make some of them collapsible?
Example of a More Complex Documentation
Here is the basic idea of bubble sort!
1 2 3 4 5 |
|
The Syntax for the Example Above
1 2 3 4 5 6 7 8 9 |
|
Code Highlight¶
This is powered by codehilite. Whenever, you need code, this is the one that makes it pretty.
For example:
1 2 3 4 5 |
|
Syntax of the Example Above
1 2 3 4 5 6 7 |
|
Highlight Specific Code Lines¶
What if I want to show some cool lines? I could highlight which specific line number should be highlighted.
1 2 3 4 5 |
|
Syntax of the Example Above
1 2 3 4 5 6 7 |
|
Latex / Math Symbol Renderer¶
This is for math nerds that needs some Maths in their documentation. More info on Latex here.
For example, the Pythagoras Theorem $$ a^2 + b^2 = c^2 $$
Syntax of the Example Above
1 |
|
Inline Latex¶
According to the results with the p-value \(p < 0.05\), it means that we will reject the null Hypothesis \(H_0\), and that there is a significant difference in the means.
Footnotes¶
Woah woah woah! Getting a little bit nerdy referencer here!
"You can tell that I don't know much about referencing"1. If you click this shiny number, it takes you to the bottom of the page where the reference is.
Syntax of the Example Above
1 2 3 4 |
|
Content Tabs¶
Very useful for when you need one or the other.
For example, when dealing with multiple programming languages.
1 2 3 4 5 6 |
|
1 2 3 4 5 6 |
|
Syntax of Above
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Icons and Emoji¶
Just worth mentioning, not too sure if you're going to use it.
- –
.icons/material/account-circle.svg
- –
.icons/fontawesome/regular/laugh-wink.svg
- :octicons-octoface-16: –
.icons/octicons/octoface-16.svg
Syntax of Above
1 2 3 |
|
Images¶
Can be done with Markdown or HTML.
Image Captioning¶
Syntax of Above
1 2 3 4 |
|
Image Alignment¶
This is for when you have paragraphs and some text, but you really wanted those fancy images on the side. You can either say left
or right
. Now Let me just fill this with some random words so that the image doesn't look to weird.
Syntax Above
1 2 3 |
|
Graph In Markdown / Mermaid Markdown¶
More Information here.
What if you really just want to create some fancy graphs, but you really can't be bothered to:
- Load some other software
- Draw this graph that you wanted to show
- Save this graph that you want to show
- Upload this graph somewhere
- Link this image back to this documentation
Like there are just soooo many steps.
Introducing mermaid markdown.
Syntax for Above
1 2 3 4 5 |
|
How about more complex ones? Is this complex enough for your
Syntax for Above
1 2 3 4 5 6 7 |
|
Some Examples of Other Charts¶
Sequence Diagram¶
prevail! John-->>Alice: Great! John->>Bob: How about you? Bob-->>John: Jolly good!
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Gantt Chart¶
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Class Diagram¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
-
Book of Wisdom - John Doe ↩