Re: Question about substitution definitions as relating to figures

David Goodger <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <CABiJP=LcD_uPt2N-98LZJqx7Q_x0ATRcw4nXDA+Hw4-EGDj-1w@mail.gmail.com>
On Wed, May 3, 2017 at 8:26 PM, Suzanne Hillman <[email protected]> wrote:
> Hello everyone!
>
> I'm back again. Again, please cc me on replies. :)
>
> In looking at the substitution definitions
> (http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#substitution-definitions),
> I see that they include images and replacement text. As far as I can tell,
> they do not include the possibility of substituting for figures.
>
> Is this accurate?

Yes, by definition. Substitutions are a phrase-level (within text)
construct, e.g. in the middle of a sentence. From the reST spec:
"Substitution definitions allow the power and flexibility of
block-level directives to be shared by inline text." Figures are
block-level elements (consisting of an image, and optionally a caption
and/or a legend), and thus cannot occur inside text.

> Do substitutions not yet allow you to substitute for
> figures?

Correct, however they won't be added in future. One can't put a figure
inside a sentence.

> I also tried using replace for figures, but it didn't like that.

Only a subset of directives can be used in substitutions: image,
unicode, replace, date.
http://docutils.sourceforge.net/docs/ref/rst/directives.html#directives-for-substitution-definitions

> I couldn't figure out how to add a feature request, if in fact that's not
> yet available.

https://sourceforge.net/p/docutils/feature-requests/

If you want to request this as a feature, you'll first have to
demonstrate how it would work. Please show an example of the reST
source, as well as indicate what the result would be.

What do you want to do in your document? Perhaps there's another way.

David Goodger
<http://python.net/~goodger>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.