Skip to content

MkDocs でサポートされる記法

MkDocs でサポートされる記法のうち、幾つかをメモしておきます。 機能によっては事前に mkdocs.yml で有効化しておく必要があります。

ハイライトの変更 (Highlighting Changes)

Highlighting changes で説明されています。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
Text can be deleted and replacement text added. This can also be
combined into onea single operation. Highlighting is also
possible and comments can be added inline.



Formatting can also be applied to blocks by putting the opening and closing
tags on separate lines and adding new lines between the tags and the content.


Text can be deleted and replacement text added. This can also be combined into onea single operation. Highlighting is also possible and comments can be added inline.

Formatting can also be applied to blocks by putting the opening and closing tags on separate lines and adding new lines between the tags and the content.

テキストのハイライト (Highlighting Text)

Highlighting text で説明されています。

1
2
3
- ==This was marked==
- ^^This was inserted^^
- ~~This was deleted~~
  • This was marked
  • This was inserted
  • This was deleted

コードブロック (Code Blocks)

Code blocks で説明されています。

指定無し

codeblocks-01

1
import tensorflow as tf

タイトルを表示

codeblocks-02

bubble_sort.py
1
2
3
4
5
def bubble_sort(items):
    for i in range(len(items)):
        for j in range(len(items) - 1 - i):
            if items[j] > items[j + 1]:
                items[j], items[j + 1] = items[j + 1], items[j]

行番号表示の開始行数を指定

codeblocks-03

123
124
125
126
127
def bubble_sort(items):
    for i in range(len(items)):
        for j in range(len(items) - 1 - i):
            if items[j] > items[j + 1]:
                items[j], items[j + 1] = items[j + 1], items[j]

指定行をハイライト

codeblocks-04

1
2
3
4
5
def bubble_sort(items):
    for i in range(len(items)):
        for j in range(len(items) - 1 - i):
            if items[j] > items[j + 1]:
                items[j], items[j + 1] = items[j + 1], items[j]

指定した範囲行をハイライト

codeblocks-05

1
2
3
4
5
def bubble_sort(items):
    for i in range(len(items)):
        for j in range(len(items) - 1 - i):
            if items[j] > items[j + 1]:
                items[j], items[j + 1] = items[j + 1], items[j]

タイトル表示・開始行数指定・指定範囲行のハイライト

codeblocks-06

bubble_sort.py
101
102
103
104
105
def bubble_sort(items):
    for i in range(len(items)):
        for j in range(len(items) - 1 - i):
            if items[j] > items[j + 1]:
                items[j], items[j + 1] = items[j + 1], items[j]

行番号を表示しない

codeblocks-07

def greeting():
    print("Hello, World")

greeting()

警告 (Admonition)

Admonitions で説明されています。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
!!! Note
    Note

!!! Tip
    Tip

!!! Warning
    Warning

!!! Danger
    Danger

!!! Success
    Success

!!! Failure
    Failure

!!! Bug
    Bug

!!! Summary
    Summary

Note

Note

Tip

Tip

Warning

Warning

Danger

Danger

Success

Success

Failure

Failure

Bug

Bug

Summary

Summary

詳細 (Detail)

Collapsible blocks で説明されています。 Admonitions と異なり、折りたたみブロックとして表示されます。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
??? optional-class "Summary"
    Here's some content.

??? multiple optional-class "Summary"
    Here's some content.

???+ note "Open styled details"

    ??? danger "Nested details!"
        And more content again.

??? success
   Content.

??? warning classes
   Content.
Summary

Here's some content.

Summary

Here's some content.

Open styled details
Nested details!

And more content again.

Success

Content.

Warning

Content.

定義リスト (Definition Lists)

Using definition lists で説明されています。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
`Lorem ipsum dolor sit amet`

:   Sed sagittis eleifend rutrum. Donec vitae suscipit est. Nullam tempus
    tellus non sem sollicitudin, quis rutrum leo facilisis.

`Cras arcu libero`

:   Aliquam metus eros, pretium sed nulla venenatis, faucibus auctor ex. Proin
    ut eros sed sapien ullamcorper consequat. Nunc ligula ante.

    Duis mollis est eget nibh volutpat, fermentum aliquet dui mollis.
    Nam vulputate tincidunt fringilla.
    Nullam dignissim ultrices urna non auctor.
Lorem ipsum dolor sit amet

Sed sagittis eleifend rutrum. Donec vitae suscipit est. Nullam tempus tellus non sem sollicitudin, quis rutrum leo facilisis.

Cras arcu libero

Aliquam metus eros, pretium sed nulla venenatis, faucibus auctor ex. Proin ut eros sed sapien ullamcorper consequat. Nunc ligula ante.

Duis mollis est eget nibh volutpat, fermentum aliquet dui mollis. Nam vulputate tincidunt fringilla. Nullam dignissim ultrices urna non auctor.

タスクリスト (Task Lists)

Using task lists で説明されています。

1
2
3
4
5
6
- [x] Lorem ipsum dolor sit amet, consectetur adipiscing elit
- [ ] Vestibulum convallis sit amet nisi a tincidunt
    * [x] In hac habitasse platea dictumst
    * [x] In scelerisque nibh non dolor mollis congue sed et metus
    * [ ] Praesent sed risus massa
- [ ] Aenean pretium efficitur erat, donec pharetra, ligula non scelerisque
  • [x] Lorem ipsum dolor sit amet, consectetur adipiscing elit
  • [ ] Vestibulum convallis sit amet nisi a tincidunt
    • [x] In hac habitasse platea dictumst
    • [x] In scelerisque nibh non dolor mollis congue sed et metus
    • [ ] Praesent sed risus massa
  • [ ] Aenean pretium efficitur erat, donec pharetra, ligula non scelerisque

注釈 (Footnotes)

Adding footnote references で説明されています。

1
2
3
4
5
6
7
Lorem ipsum[^1] dolor sit amet, consectetur adipiscing elit.[^2]

[^1]: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
[^2]:
    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.

Lorem ipsum1 dolor sit amet, consectetur adipiscing elit.2

キー (Keys)

Adding keyboard keys で説明されています。 サポートされているキーの一覧は Extending/Modifying Key-Map Index にまとめられています。

1
++ctrl+alt+del++

Ctrl+Alt+Del


  1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. 

  2. 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.