Yes, maybe you are right.  <div>I am finishing the replacements in an hour. It could take a few hours to program the python program. I have seen quite a lot substitutions in conf.py that definetely are used just in on rst. I will put all my substitutions in top of the rst document when others find they can use it as well it can be transferred to conf.py. I guess in the document working_with_vector.rst you will find the majority, so just have a look there first.<br>
<br></div><div>regards, Diethard.</div><div><br><div class="gmail_quote">2012/7/4 Paolo Corti <span dir="ltr"><<a href="mailto:pcorti@gmail.com" target="_blank">pcorti@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Wed, Jul 4, 2012 at 6:32 PM, Diethard Jansen<br>
<<a href="mailto:diethard.jansen@gmail.com">diethard.jansen@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> Yesterday I started with adding some substitutions for icons used in the RST<br>
> file I am working on.<br>
> 'working_with_vector.rst' contains many! It is not too hard but.. to include<br>
> them only in the document I am working on.<br>
> I found that substitutions for Icons like |nix| are defined in conf.py, but<br>
> I do not like the idea of adding the new definitions in there.<br>
> On the following interesting site I found an alternative way.<br>
><br>
> <a href="http://packages.python.org/an_example_pypi_project/sphinx.html#substitutions" target="_blank">http://packages.python.org/an_example_pypi_project/sphinx.html#substitutions</a><br>
><br>
> The idea:<br>
> I want to automatically create a global.rst using a python script to include<br>
> all substitutions to images of icons in there.<br>
> The script will search and include all png files < 8 kb that will be found<br>
> under directories "img/en/".<br>
> In the latex script most substitutions are equal to the icon name so it<br>
> should not be too hard to generate this file.<br>
><br>
> The advantage is that you only need to to include a single 'include' line<br>
> referring to the global.rst file and most of the icons should show up<br>
> immediately after the build. Another advantage is that you can remove most<br>
> of these substitions from config.py so it is less cluttered and it does not<br>
> need to be changed too often which (I believe) could break the build<br>
> process. It is also an easier place to find the substitutions. A<br>
> disadvantage could be that in a few places the reference needs to be changed<br>
> in the rst file because it was not equal to the name of the file. (i.e. in<br>
> rst file -> |labeling|  however the image:: ../img/en/mActionLabeling.png,<br>
> so in that case I will need to change it to |mActionLabeling|).<br>
><br>
> Whatever, I will write the python script. I am sure the result can also be<br>
> quickly included in the config.py instead of the global.rst.<br>
> Let me know when you see a problem with this idea.<br>
><br>
> Regards,<br>
> Diethard<br>
<br>
</div></div>Hi<br>
the idea would be to have a common place where to store substitution<br>
only for images that are in many pages.<br>
I believe that a big part of the ones that now are in conf.py are used<br>
only once in the user guide, so it would make sense to me to leave in<br>
conf.py only the images that are used more times, and place the other<br>
to each single page.<br>
<span class="HOEnZb"><font color="#888888">p<br>
<br>
--<br>
Paolo Corti<br>
Geospatial software developer<br>
web: <a href="http://www.paolocorti.net" target="_blank">http://www.paolocorti.net</a><br>
twitter: @capooti<br>
skype: capooti<br>
</font></span></blockquote></div><br></div>