#4 add border option to image

closed-wont-fix
Felix Wiemann
None
5
2005-05-02
2005-05-01
George Yoshida
No

Starting from docutils 0.3.7, 'target' option was added to
Image object. This is one of the things I've wanted for a
long time. Thanks for docutils developers.

Now I want another option, 'border'.

The rationale behind this feature request is as follows:

As I use 'target' option, I've notived one aesthetic
problem with it. Images are surrounded by blue border
lines. If you set the border attribute 0, you can get rid of
it.

For the moment, I'm adding one line of code to
rst/directives/images.py so that I can set the border
parameter.

--- images.py 25 Sep 2004 23:44:06 -0000 1.18
+++ images.py 1 May 2005 15:36:03 -0000
@@ -59,6 +59,7 @@

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,

(I don't know if this is the right solution, but it works at
least for me.)

Discussion

  • Adrien Beau
    Adrien Beau
    2005-05-01

    Logged In: YES
    user_id=787269

    I believe this is purely an HTML styling issue. If so, then
    you can (and should) modify the CSS file that is linked from
    the final HTML file rather than modify the source code.

     
  • Felix Wiemann
    Felix Wiemann
    2005-05-02

    Logged In: YES
    user_id=1014490

    Yes. The appropriate stylesheet entry is (untested):

    div.image-reference img { border: 0 }

     
  • Felix Wiemann
    Felix Wiemann
    2005-05-02

    • assigned_to: nobody --> felixwiemann
    • status: open --> closed-wont-fix
     
  • Felix Wiemann
    Felix Wiemann
    2005-05-02

    Logged In: YES
    user_id=1014490

    Oh, by the way, hyperlink-images being surrounded by a blue
    border is intentional and in most cases quite helpful
    because otherwise there is would be little indication that
    the image is a link. It's like text links being underlined.

     
  • George Yoshida
    George Yoshida
    2005-05-02

    Logged In: YES
    user_id=671362

    OK. I've found an official statement of W3C standards.

    http://www.w3.org/TR/REC-html40/conform.html#deprecated
    > HTML presentational attributes have been deprecated when
    style sheet alternatives exist

    Thanks for your comments.

     
  • David Goodger
    David Goodger
    2005-05-16

    Logged In: YES
    user_id=7733

    For posterity:

    I implemented this change in revision 3322 (2005-05-09),
    before reading the discussion here. Convinced of the
    validity of the arguments against, I reverted the change in
    revision 3340.