diff options
-rw-r--r-- | riki.md | 32 | ||||
-rw-r--r-- | src/directive/img.rs | 2 |
2 files changed, 33 insertions, 1 deletions
@@ -428,6 +428,8 @@ then command fails ### `img` +#### Simple image inclusion + _Requirement: the `img` directive embeds an image in the generated HTML page._ @@ -447,6 +449,36 @@ then file output/index.html contains "<img src="img.jpg"" This is a dummy JPEG image. ~~~ +#### Image attributes + +_Requirement: the `img` directive allows useful attributes to be set._ + +The [ikiwiki img +directive](http://ikiwiki.info/ikiwiki/directive/img/) allows +arguments: + +* `size`---The size parameter is optional, defaulting to full size. + You can specify only the width or the height, and the other value + will be calculated based on it: "200x", "x200". +* `alt`, `title`, `class`, `align`, `id`, `hspace`, and + `vspace`---These are passed through unchanged to the html img tag. + +~~~scenario +given an installed riki +given file site/index.mdwn from img +given file site/img.jpg from jpeg +when I run riki build site output +then file output/index.html contains "<img src="img.jpg"" +~~~ + +~~~{#img .file .markdown} +[[!img img.jpg]]] +~~~ + +~~~{#jpeg .file} +This is a dummy JPEG image. +~~~ + ### `meta title` _Requirement: the `meta title` directive sets page title._ diff --git a/src/directive/img.rs b/src/directive/img.rs index be165f8..51b35f4 100644 --- a/src/directive/img.rs +++ b/src/directive/img.rs @@ -13,7 +13,7 @@ pub struct Img { impl Img { pub const REQUIRED: &'static [&'static str] = &[]; pub const ALLOWED: &'static [&'static str] = &[ - "alt", "caption", "class", "height", "link", "width", "size", "align", + "alt", "caption", "class", "link", "size", "align", ]; pub const ALLOW_ANY_UNNAMED: bool = true; |