[Qgis-community-team] automatically create substitutions for icons in global.rst

Otto Dassau dassau at gbd-consult.de
Thu Jul 5 01:36:45 PDT 2012


Hi,

I also agree and would leave it in conf.py. This makes it easier for new
translators/writers to work on the manual. Keep it simple is very important
since contributors often change - I think.

Regards
Otto

Am Wed, 4 Jul 2012 22:28:09 +0200
schrieb Diethard Jansen <diethard.jansen at gmail.com>:

> Yes, maybe you are right.
> 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.
> 
> regards, Diethard.
> 
> 2012/7/4 Paolo Corti <pcorti at gmail.com>
> 
> > On Wed, Jul 4, 2012 at 6:32 PM, Diethard Jansen
> > <diethard.jansen at gmail.com> wrote:
> > > Hi,
> > >
> > > Yesterday I started with adding some substitutions for icons used in
> > > the
> > RST
> > > file I am working on.
> > > 'working_with_vector.rst' contains many! It is not too hard but.. to
> > include
> > > them only in the document I am working on.
> > > 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.
> > > On the following interesting site I found an alternative way.
> > >
> > >
> > http://packages.python.org/an_example_pypi_project/sphinx.html#substitutions
> > >
> > > The idea:
> > > I want to automatically create a global.rst using a python script to
> > include
> > > all substitutions to images of icons in there.
> > > The script will search and include all png files < 8 kb that will be
> > found
> > > under directories "img/en/".
> > > In the latex script most substitutions are equal to the icon name so it
> > > should not be too hard to generate this file.
> > >
> > > 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|).
> > >
> > > 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.
> > > Let me know when you see a problem with this idea.
> > >
> > > Regards,
> > > Diethard
> >
> > Hi
> > the idea would be to have a common place where to store substitution
> > only for images that are in many pages.
> > I believe that a big part of the ones that now are in conf.py are used
> > only once in the user guide, so it would make sense to me to leave in
> > conf.py only the images that are used more times, and place the other
> > to each single page.
> > p
> >
> > --
> > Paolo Corti
> > Geospatial software developer
> > web: http://www.paolocorti.net
> > twitter: @capooti
> > skype: capooti
> >


-- 
Geoinformatik Büro Dassau - http://www.gbd-consult.de
FOSSGIS consulting , training , support  and analysis
Ackerstrasse 144c  ,  D - 40233 Düsseldorf  , Germany
Tel: +49-(0)211-98707867  , Mobil: +49-(0)171-4687540

--
Community Advisor - QGIS Project Steering Committee


More information about the Qgis-community-team mailing list