reStructuredText¶
reStructuredText (reST)のサンプルとか
テーブル¶
品番 |
商品名 |
数量 |
単価 |
合計額 |
---|---|---|---|---|
YK0023 |
クレヨン |
5 |
430円 |
2150円 |
HM0926 |
セロハンテープ |
2 |
220円 |
440円 |
MI0102 |
画鋲 |
4 |
170円 |
680円 |
書き方:
+--------+----------------+------+-------+----------+
| 品番 | 商品名 | 数量 | 単価 | 合計額 |
+========+================+======+=======+==========+
| YK0023 | クレヨン | 5 | 430円 | 2150円 |
+--------+----------------+------+-------+----------+
| HM0926 | セロハンテープ | 2 | 220円 | 440円 |
+--------+----------------+------+-------+----------+
| MI0102 | 画鋲 | 4 | 170円 | 680円 |
+--------+----------------+------+-------+----------+
ヘッダ行は無くてもよいです。
簡易なテーブル¶
品番 |
商品名 |
数量 |
単価 |
合計額 |
---|---|---|---|---|
YK0023 |
クレヨン |
5 |
430円 |
2150円 |
HM0926 |
セロハンテープ |
2 |
220円 |
440円 |
MI0102 |
画鋲 |
4 |
170円 |
680円 |
書き方:
======== ================= ======= ======= ========
品番 商品名 数量 単価 合計額
======== ================= ======= ======= ========
YK0023 クレヨン 5 430円 2150円
HM0926 セロハンテープ 2 220円 440円
MI0102 画鋲 4 170円 680円
======== ================= ======= ======= ========
画像¶

書き方:
.. image:: PATH_TO/imagefile
:height: 100 px
:width: 200 px
:scale: 50 %
:alt: alternate text
:align: right
:target: URI or reference name
PATH_TOには、ソースファイルからの相対パスかトップのソースディレクトリからの絶対パスで指定する。画像ファイル名は*などのワイルドカードも指定可能。オプションのtargetを指定すると画像はハイパーリンクとなり、指定されたURIかアンダースコアを接尾した参照名へのリンクになる。
コード¶
1 2 3 4 5 6 7 | taramo@eastpoint01:~/www$ docker push taramodocker/sphinx
Using default tag: latest
The push refers to repository [docker.io/taramodocker/sphinx]
79fd89b4ff99: Pushed
33c9e49a8b69: Mounted from hnakamur/sphinx
f4666769fca7: Mounted from hnakamur/sphinx
latest: digest: sha256:501f57b89a79981b415d9de9c955ca9d851ac770a28fa09aefdda246ded5eeec size: 2611
|
書き方:
.. code-block:: console
:linenos:
taramo@eastpoint01:~/www$ docker push taramodocker/sphinx
Using default tag: latest
The push refers to repository [docker.io/taramodocker/sphinx]
79fd89b4ff99: Pushed
33c9e49a8b69: Mounted from hnakamur/sphinx
f4666769fca7: Mounted from hnakamur/sphinx
latest: digest: sha256:501f57b89a79981b415d9de9c955ca9d851ac770a28fa09aefdda246ded5eeec size: 2611
引用¶
引用は::のブロックでインデントを下げる。メールの引用のように>が先頭にあればインデント不要
シャア:
認めたくないものだな、自分自身の若さゆえの過ちというものを
John Doe wrote:
>> Great idea!
>
> Why didn't I think of that?
書き方:
シャア::
認めたくないものだな、自分自身の若さゆえの過ちというものを
John Doe wrote::
>> Great idea!
>
> Why didn't I think of that?
nwdiag¶
nwdiag(http://blockdiag.com/ja/nwdiag/)を使ったネットワーク図のサンプル
書き方:
.. nwdiag::
nwdiag {
network dmz {
address = "192.168.1.x/24"
web [address = "192.168.1.5"];
fw [address = "192.168.1.1"];
}
network internal {
address = "192.168.10.x/24";
fw [address = "192.168.10.1"];
ap [address = "192.168.10.11"];
db [address = "192.168.10.12"];
}
}
Graphviz¶
Graphviz(http://graphviz.org/) を使ったグラフのサンプルです。
書き方:
.. graphviz::
digraph sample{
"待機中" -> "実行中" -> "一時停止";
"一時停止" -> "実行中";
"一時停止" -> "待機中";
}
PlantUML¶
PlantUML(http://plantuml.com/)のUML図サンプルです。
書き方:
.. uml::
skinparam monochrome true
actor User
participant "Action" as A
participant "Servce" as B
participant "Dao" as C
participant "DB" as D
User -> A: request
activate A
A -> B: invoke
activate B
B -> C: request data access
activate C
C -> D: sql query
activate C
D --> C: query result
deactivate C
C --> B: data access result
deactivate B
B --> A: invoke result
deactivate B
A --> User: response
deactivate A