I have a sphinx extension directive"plot_directive"

  
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/doc/sphinxext/plot_directive.py

which we use to embed matplotlib plots, with links to src, in our
narrative and API docs, eg

  http://matplotlib.sourceforge.net/users/screenshots.html#ellipses   AND
  http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.acorr

The directive call is fairly, simple.  Eg, in the Axes.acorr docs in
the link above, we point to an external example::

        .. plot:: mpl_examples/pylab_examples/xcorr_demo.py

which triggers a run of xcorr_demo.py,  creates a Figure instance,
saves it to a PNG file, and puts the files in the right place so the
sphinx build can find it.  This is a great feature for us since we are
a graphics package and can insure that the code we point to a doc
build time actually generates the figure we display.

What I would like to do is create a single page image gallery of
thumbnails that point to all of our generated examples.  We have a
large examples directory that contains many subdirectories consisting
of hundreds of examples.  Most of these create figures, some do not,
and some fail due to various errors.  We generate one "plot" directive
call for every example file, but some of these fail, and  at doc build
time, only the plot directive knows whether an example fails or not.

So we have a lot of *.rst files which might call the plot directive,
and each of these calls may generate a figure and thumbnail.  What I
would like to do is, after all the est files and their associated plot
directives are called, have the ability for the plot_directive.py to
get a "finalize" call in the same way it gets a "setup" call, which
would generate a thumbnail gallery as a rst file or jinja template,
which is then built before the build process exits.

Currently, I have an external script which iterates over the plot
directive output directory and generates the necessary rst or jinja
html templates, but this requires repeated calls to the build process:
first I build the plot directive images and thumbnails, then run the
script which generates the gallery jinja template, and then rerun the
build prccess to render the gallery.  It would be nice if the plot
directive could generate the necessary templates in the first build
(this part is easy), and then trigger a run of these rst/template
files before the build process exits (this is the part I am unsure
about).

Any suggestions?
JDH

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to