On 2013-05-23, J Luis wrote:

> [-- Type: text/plain, Encoding: quoted-printable --]

> Thanks for looking.

> And ... I think it would make a lot of sense to define figures in
> substitutions.

rST substitutions are inline elements. They can appear on places where
block-level elements like figures may not.

How should a figure like Fig. 23 be put in running text?

   .-)

   Fig. 23: This is an example


OTOH, I do understand that it may be desirable to have a "macro" feature
also for block-level elements (i.e. directives).

One idea is to allow custom directives on the rST level, similar to custom
roles via the ``.. roles::`` directive.

My usage example is passing styling class arguments to a directive, like::

  .. directive:: booktab(table)
     :class: booktabs

See also http://docutils.sourceforge.net/docs/dev/todo.html#directives


This would make it possible to define a figure directive with default class
and content like e.g. ::

  .. directive:: myfig(figure)
     :class: special
     :default-argument: myfig.jpg

     This is my figure

for later use as ::

  ..myfig::

or overriding the heading ::

  ..myfig::

    This is also my figure.

or overriding image and heading ::

  ..myfig:: myfig2.png

    This is another of my figures.

Günter

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sphinx-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to