diff options
author | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-05-09 15:49:37 +0000 |
---|---|---|
committer | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-05-09 15:49:37 +0000 |
commit | 55cd5272b6cec7dc3cc9eae6bd8076dd0df064ab (patch) | |
tree | 425cebe706037126de562fdf2f74c97277446f65 | |
parent | 301119f58a9aa133cfb1b823a2d20e6762891425 (diff) | |
download | docutils-55cd5272b6cec7dc3cc9eae6bd8076dd0df064ab.tar.gz |
Added "border" option to "image" directive (& attribute to doctree element); updated docs & tests. Closes Feature Request 1193389.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3322 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r-- | HISTORY.txt | 4 | ||||
-rw-r--r-- | THANKS.txt | 1 | ||||
-rw-r--r-- | docs/dev/todo.txt | 9 | ||||
-rw-r--r-- | docs/ref/docutils.dtd | 1 | ||||
-rw-r--r-- | docs/ref/rst/directives.txt | 6 | ||||
-rw-r--r-- | docutils/parsers/rst/directives/images.py | 1 | ||||
-rw-r--r-- | test/functional/expected/standalone_rst_html4css1.html | 2 | ||||
-rw-r--r-- | test/functional/expected/standalone_rst_pseudoxml.txt | 2 | ||||
-rw-r--r-- | test/functional/input/data/standard.txt | 1 |
9 files changed, 19 insertions, 8 deletions
diff --git a/HISTORY.txt b/HISTORY.txt index 66a611350..218095d57 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -91,6 +91,7 @@ Changes Since 0.3.7 - "image" directive: added checks for valid values of "align" option, depending on context. "figure" directive: added specialized "align" option and attribute on "figure" element. + - Added a "border" option to the "image" directive. * docutils/parsers/rst/directives/misc.py: @@ -165,7 +166,8 @@ Changes Since 0.3.7 - Added ``stub`` attribute to ``colspec`` element via the ``tbl.colspec.att`` parameter entity. - Allowed topic elements within sidebars - - Added ``align`` attribute to ``figure`` element. + - Added the ``align`` attribute to ``figure`` element. + - Added the ``border`` option to the ``image`` element. Release 0.3.7 (2004-12-24) diff --git a/THANKS.txt b/THANKS.txt index 26b6e9114..a8133eac3 100644 --- a/THANKS.txt +++ b/THANKS.txt @@ -133,6 +133,7 @@ donations, tasty treats, and related projects: * Edward Welbourne * Felix Wiemann * Ka-Ping Yee +* George Yoshida * Moshe Zadka Thank you! diff --git a/docs/dev/todo.txt b/docs/dev/todo.txt index cba560dca..fc06bbf85 100644 --- a/docs/dev/todo.txt +++ b/docs/dev/todo.txt @@ -1121,12 +1121,11 @@ when used in a document. .. _unicode: http://docutils.sf.net/docs/ref/rst/directives.html#unicode-character-codes - - _`images.image`: "border"? + - _`images.image`:_`Units of measure`? (See `docutils-users, + 2003-03-02`__, and `docutils-develop, 2004-04-29`__.) - _`Units of measure`? (See `docutils-users, 2003-03-02 - <http://article.gmane.org/gmane.text.docutils.user/154>`__, and - `docutils-develop, 2004-04-29 - <http://article.gmane.org/gmane.text.docutils.devel/1439>`_.) + __ http://article.gmane.org/gmane.text.docutils.user/154 + __ http://article.gmane.org/gmane.text.docutils.devel/1439 - _`images.figure`: "title" and "number", to indicate a formal figure? diff --git a/docs/ref/docutils.dtd b/docs/ref/docutils.dtd index f3a7d37ca..455a8ae3a 100644 --- a/docs/ref/docutils.dtd +++ b/docs/ref/docutils.dtd @@ -481,6 +481,7 @@ or " ") or the text between option arguments (typically either "," or %align-hv.att; uri CDATA #REQUIRED alt CDATA #IMPLIED + border %number; #IMPLIED height %number; #IMPLIED width %number; #IMPLIED scale %number; #IMPLIED> diff --git a/docs/ref/rst/directives.txt b/docs/ref/rst/directives.txt index 130f0d154..1ca51f28f 100644 --- a/docs/ref/rst/directives.txt +++ b/docs/ref/rst/directives.txt @@ -226,6 +226,12 @@ The following options are recognized: text flow around it. The specific behavior depends upon the browser or rendering software used. +``border`` : integer + The width of the image border, in pixels. For images that are + also hyperlink references (see the ``target`` option, below), + browsers often draw a border by default. Set ``:border: 0`` to + disable this default. + ``target`` : text (URI or reference name) Makes the image into a hyperlink reference ("clickable"). The option argument may be a URI (relative or absolute), or a diff --git a/docutils/parsers/rst/directives/images.py b/docutils/parsers/rst/directives/images.py index 7efb2588d..96d01aeab 100644 --- a/docutils/parsers/rst/directives/images.py +++ b/docutils/parsers/rst/directives/images.py @@ -76,6 +76,7 @@ def image(name, arguments, options, content, lineno, image.arguments = (1, 0, 1) image.options = {'alt': directives.unchanged, + 'border': directives.nonnegative_int, 'height': directives.nonnegative_int, 'width': directives.nonnegative_int, 'scale': directives.nonnegative_int, diff --git a/test/functional/expected/standalone_rst_html4css1.html b/test/functional/expected/standalone_rst_html4css1.html index 13f8c02c6..e39f3c4e2 100644 --- a/test/functional/expected/standalone_rst_html4css1.html +++ b/test/functional/expected/standalone_rst_html4css1.html @@ -544,7 +544,7 @@ document (a document-wide <a class="reference" href="#table-of-contents">table o <div class="section" id="images"> <h3><a class="toc-backref" href="#id63" name="images">2.14.2 Images</a></h3> <p>An image directive (also clickable -- a hyperlink reference):</p> -<div class="image class1 class2 image-reference"><a class="reference" href="#directives"><img alt="../../../docs/user/rst/images/title.png" class="class1 class2" src="../../../docs/user/rst/images/title.png" /></a></div> +<div class="image class1 class2 image-reference"><a class="reference" href="#directives"><img alt="../../../docs/user/rst/images/title.png" border="0" class="class1 class2" src="../../../docs/user/rst/images/title.png" /></a></div> <p>A figure directive:</p> <div align="left" class="figclass1 figclass2 figure"> <div class="image class1 class2"><img alt="reStructuredText, the markup syntax" class="class1 class2" src="../../../docs/user/rst/images/title.png" /></div> diff --git a/test/functional/expected/standalone_rst_pseudoxml.txt b/test/functional/expected/standalone_rst_pseudoxml.txt index 597408d23..df683cd6a 100644 --- a/test/functional/expected/standalone_rst_pseudoxml.txt +++ b/test/functional/expected/standalone_rst_pseudoxml.txt @@ -1119,7 +1119,7 @@ <paragraph> An image directive (also clickable -- a hyperlink reference): <reference name="directives_" refid="directives"> - <image classes="class1 class2" uri="../../../docs/user/rst/images/title.png"> + <image border="0" classes="class1 class2" uri="../../../docs/user/rst/images/title.png"> <paragraph> A figure directive: <figure align="left" classes="figclass1 figclass2"> diff --git a/test/functional/input/data/standard.txt b/test/functional/input/data/standard.txt index b06a158d4..6f3e447bc 100644 --- a/test/functional/input/data/standard.txt +++ b/test/functional/input/data/standard.txt @@ -424,6 +424,7 @@ An image directive (also clickable -- a hyperlink reference): .. image:: ../../../docs/user/rst/images/title.png :class: class1 class2 :target: directives_ + :border: 0 A figure directive: |