Skip to content

Highlight with blockquotes and admonitions

Blockquotes

Blockquotes can be created by using symbol > at the start of the line. For example the following markdown

> In order to understand recursion, one must first understand recursion.
outputs 👇

In order to understand recursion, one must first understand recursion.

Of course, you can write multiple lines in the blockquote

Multiline Blockquote - option 1

Measuring programming progress by lines of code is like measuring aircraft building progress by weight
Bill Gates (co-founder of Microsoft)

> Measuring programming progress by lines of code is like measuring aircraft building progress by weight    
> **Bill Gates (co-founder of Microsoft)**

Starting every new line with > can be cumbersome, especially if you need to make line breaks

Multiline Blockquote option 2

If Internet Explorer is brave enough to ask to be your default browser, 
you should be brave enough to ask that girl out.
> ```
  If Internet Explorer is brave enough to ask to be your default browser, 
  you should be brave enough to ask that girl out.
  ```

Admonitions

Admonition is an extension to Markdown that looks shiny and attractive.

Admonitions are created with the following syntax:

!!! type "Title of Admonition"
    Something importatnt you want to highlight!
outputs this 👇

Title of Admonition

Something importatnt you want to highlight!

Admonition without text in the header

The following markdown snippet

!!! note 
    Admonition without text in the header 
outputs this 👇

Note

Admonition without text in the header

Admonition without header

The following markdown snippet

!!! note ""
    Admonition without header 
outputs this 👇

Admonition without header

Admonition with text and code

Include any code block directly inside the Admonition

!!! note
    In Python we use indentation instead of curly braces:
    ```python
    i = 1
    while i < 6:
        print(i)
        if i == 3:
            break
        i += 1
    ```
    If indentation is wrong, the python code will fail to execute
The result will look like this 👇

Note

In Python we use indentation instead of curly braces:

i = 1
while i < 6:
    print(i)
    if i == 3:
        break
    i += 1
If indentation is incorrect, the python code will fail to execute

Collapsible Admonition

Start Admonition with ???

??? type "Python generator example"
    A generator function that yields ints is secretly just a function that
    returns an iterator of ints, so that's how we annotate it
    ``` python
    def g(n: int) -> Iterator[int]:
        i = 0
        while i < n:
            yield i
            i += 1
    ```
Result - collapsible Admonnition 👇

Python generator function example

A generator function that yields ints is secretly just a function that returns an iterator of ints, so that's how we annotate it

def g(n: int) -> Iterator[int]:
    i = 0
    while i < n:
        yield i
        i += 1

Nested Admonition

You can create Admonitions inside other Admonitions

??? note "Open styled details"
    ??? danger "Nested details!"
        And more content again.
Looking like this 👇

Open styled details
Nested details!

And more content again.

Admonitions with tabs

Using tabs inside Admonitions can be handy

Recursion in markdown

Recursion in markdown

return True

#!py3 return True

!!! example "Recursion in markdown"
    === "Output"
        `#!py3 return True`

    === "Markdown"
        ` #!py3 return True `

Admonition types

There are numerous Admonition types that you can use to make important text stand out. Every Admonition starts with the type keyword following after !!! or ??? For example, Admonition of info type

!!! info 
    The wood frog can hold its pee for up to eight months.
looks like this 👇

Info

The wood frog can hold its pee for up to eight months.

Other Admonition types:

summary, abstract, tldr

Tldr

went looking for myself and came back empty handed

tip, hint, important

Tip

If you get a loan at a bank, you will be paying for it 30 years. If you rob a bank you will be out in just 10

success, check, done

Success

Monday 12:30. I finally came to office and had my first cup of coffee

question, help, faq

Question

How far of a drive is it from Miami to Florida?

warning, caution, attention

Warning

Don't feed the Dragons! They are on a strict diet.

failure, fail, missing

Failure

I made Jusus shaped cookies but I burnt them

danger, error

Error

ErrorReporter stopped working

bug

Bug

A ladybird bug can eat 5,000 insects in its whole lifetime

example

Example

Unlike humans, bees can make collaborative decisions

quote, cite

Quote

Always remember that you are absolutely unique. Just like everyone else