<div>Hi,</div><div><br></div><div>Yesterday I started with adding some substitutions for icons used in the RST file I am working on.</div><div>'working_with_vector.rst' contains many! It is not too hard but.. to include them only in the document I am working on.</div>
<div>I found that substitutions for Icons like |nix| are defined in conf.py, but I do not like the idea of adding the new definitions in there.</div><div>On the following interesting site I found an alternative way.</div>
<div><br></div><a href="http://packages.python.org/an_example_pypi_project/sphinx.html#substitutions">http://packages.python.org/an_example_pypi_project/sphinx.html#substitutions</a><div><br></div><div>The idea:</div><div>
I want to automatically create a global.rst using a python script to include all substitutions to images of icons in there.</div><div>The script will search and include all png files < 8 kb that will be found under directories "img/en/".</div>
<div>In the latex script most substitutions are equal to the icon name so it should not be too hard to generate this file.</div><div><br></div><div>The advantage is that you only need to to include a single 'include' line referring to the global.rst file and most of the icons should show up immediately after the build. Another advantage is that you can remove most of these substitions from config.py so it is less cluttered and it does not need to be changed too often which (I believe) could break the build process. It is also an easier place to find the substitutions. A disadvantage could be that in a few places the reference needs to be changed in the rst file because it was not equal to the name of the file. (i.e. in rst file -> |labeling|  however the image:: ../img/en/mActionLabeling.png, so in that case I will need to change it to |mActionLabeling|).</div>
<div><br></div><div>Whatever, I will write the python script. I am sure the result can also be quickly included in the config.py instead of the global.rst.</div><div>Let me know when you see a problem with this idea.</div>
<div><br></div><div>Regards,</div><div>Diethard</div>