On Fri, Jun 13, 2008 at 9:40 AM, Michael Droettboom <[EMAIL PROTECTED]> wrote:

> This task took a lot longer than I expected, so I'm going to have to
> pause for a while.  But here's a couple of notes for improvement if
> anyone wants to take it on:
>
> 1) Clicking on the image in HTML currently goes to a high-res PNG.  It
> could instead go to a PDF, which personally I think is preferable, but I
> know some people are adamantly opposed to installing a PDF plugin in
> their browser.
>
> 2) This only works if the .py files live in users/figures.  A more
> general solution might be to move the actual rendering of .png and .pdf
> plots (which currently occurs in users/figures/make.py) to the plot
> directive itself, and have them rendered even more on-the-fly than they
> are already.  Then it could pull .py's from anywhere (such as
> mpl-examples) and put the resulting images in the correct place for
> sphinx to find them and add them to the build.
>
> 3) The CSS could be tweaked so the images don't get a thick border in
> HTML.  Putting a magnifying glass in the corner would be cool if there's
> any CSS wizards out there.  But that's an aesthetic consideration.
> People may like the border.

I've committed some changes that should address all three of these
issues.  The plot_directive now assumes you are giving it a pyplot
python file (stored in doc/pyplots) and will generate the savefigs at
doc build time.  The paths are a bit hairy in these rest directives so
I decided it was easiest to force all the python files to live in this
dir, and we can revisit this later.  I am not convinced it is a good
idea to point to external files anyway for the image generation (like
examples/something.py) since someone may unwittingly change this w/o
begin aware the docs are relying on it.  I addressed 1 and 3 by not
making the image clickable, but rather putting links to the high res
png and pdf below it, and along with the src there too.  For now I am
including a link to the src even if the src is not included, but if
there is a reason not to we can easily remove this.

There are a few TODOs in there where the code could be cleaner or I am
having some unexplained problems.  I also updated Darren's section in
the devel guide.

JDH

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to