画像¶
画像ファイル(pngやjpeg)を表示します。
使い方¶
.. image:: filename
:scale: scale_value
:align: position
:width: width_value
:height: height_value
:alt: text
オプション | 内容 |
---|---|
scale | 拡大率・縮小率を指定します。 |
align | 左寄せ、中央、右寄せを指定します。 |
width | 幅を指定します。 |
heignt | 高さを指定します。 |
alt | 画像が表示できないときに代わりに表示する文字を指定します。 |
使用例¶
test_image.jpgというjpeg画像を表示してみます。
オプションを指定しない場合
イメージのテスト
================
.. image:: test_image.jpg

50%に縮小表示
イメージのテスト
================
.. image:: test_image.jpg
:scale: 50%

中央に表示
イメージのテスト
================
.. image:: test_image.jpg
:scale: 50%
:align: center

幅を300pxにして表示
イメージのテスト
================
.. image:: test_image.jpg
:width: 300px

代替テキストを表示
イメージのテスト
================
.. image:: test_image.jpg
:alt: altのテスト

(_buildhtml_imagesの中の画像ファイルを削除してみました。)