[Live-demo] [OSGeo] #1200: Move from static to dynamic Link generation for missing rst files

OSGeo trac_osgeo at osgeo.org
Mon Aug 5 12:12:43 PDT 2013


#1200: Move from static to dynamic Link generation for missing rst files
-------------------------+--------------------------------------------------
 Reporter:  fgdrf        |       Owner:  live-demo@…              
     Type:  enhancement  |      Status:  new                      
 Priority:  normal       |   Milestone:  OSGeoLive7.0             
Component:  LiveDVD      |    Keywords:  build sphinx             
-------------------------+--------------------------------------------------
 '''Situation''':[[BR]]
  * Makefile down below doc folder creates symlinks for missing rst files
 in translation sub-folders
  * it scans the root directory and folders in the 2nd order (`en/*/*`)

 '''Problem''':[[BR]]
  * (possible) changes in the folder structure requires to change Makefile
  * new rst files (e.g. metrics.rst) in the first order down below the
 language are not considered and causes into http 404 Errors if the
 document is linked from somewhere

 '''Solution''':[[BR]]

 the Make target ''link_to_en_docs'' should be more flexible and should
 analyse the current tree of sub-dirs.

 {{{
 START_DIR     = $(shell pwd)
 ORIGIN_FILES  = $(shell find ./en -name "*.rst" -print)

 [..]

 link_to_en_docs:
         # For quickstart, standards and overview docs which have not been
         # translated, link to english doc
         for LANG in $(TRANSLATIONS) ; do \
           for DOC in $(ORIGIN_FILES) ; do \
             TRANSLATED_DOC=`echo $$DOC | sed -e"s/en/$$LANG/"` ; \
             TARGET_EN=`echo $$DOC | sed -e"s#^#../../#"` ; \
             if [ ! -f $$TRANSLATED_DOC ] ; then \
               rm -f $$TRANSLATED_DOC ; \
               ln -s $$TARGET_EN $$TRANSLATED_DOC ; \
             fi ; \
           done ; \
         done
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1200>
OSGeo <http://www.osgeo.org/>
OSGeo committee and general foundation issue tracker.


More information about the Osgeolive mailing list