Changeset 99


Ignore:
Timestamp:
03/26/10 10:27:42 (14 years ago)
Author:
pinsard
Message:

improve manuals productions using sphinx

Location:
trunk/adm
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/adm/makefile

    r98 r99  
    1212# ==== 
    1313# 
    14 # ++ amélioration de la page index avec sphinx ou rest2web 
    15 # 
    16 # sphinx output 
    17 # 
    1814# add -W to sphinx command when encoding problems are solved 
    1915# 
     
    3228# 
    3329# - fplod 20100311T143131Z aedon.locean-ipsl.upmc.fr (Darwin) 
    34 #    
     30# 
    3531#   * add rest2web (alternative to sphinx) 
    3632# 
    3733# - fplod 20100310T190253Z aedon.locean-ipsl.upmc.fr (Darwin) 
    3834# 
    39 #   * add php and xsl files to man_troff  
     35#   * add php and xsl files to man_troff 
    4036# 
    4137# - fplod 20100310T182201Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    4440# 
    4541# - fplod 20100310T091541Z aedon.locean-ipsl.upmc.fr (Darwin) 
    46 #    
     42# 
    4743#   * add man_troff with shell scripts possible now with docutils 0.6 
    4844#     can be test with 
     
    109105LIST_SRCPHP_RST = \ 
    110106$(shell echo "$(LIST_SRCPHP)" | \ 
    111         sed -e "s+$(DIRSRC)+$(DIRTMP)/sphinx_tmpdir/source+g" \ 
    112             -e "s+\.php+.php.rst+g") 
     107        sed -e "s+$(DIRSRC)+$(DIRTMP)/+g" \ 
     108            -e "s+\.php+.php.rst+g") 
    113109 
    114110LIST_SRCPHP_R2W = \ 
    115111$(shell echo "$(LIST_SRCPHP)" | \ 
    116112        sed -e "s+$(DIRSRC)+$(DIRTMP)/rest2web_tmpdir+g" \ 
    117             -e "s+\.php+.php.txt+g") 
     113            -e "s+\.php+.php.txt+g") 
    118114 
    119115 
    120116LIST_SRCPHP_TROFF = \ 
    121117$(shell echo "$(LIST_SRCPHP)" | \ 
    122         sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/man/man1/+g" \ 
    123             -e "s+\.php+.php.1+g") 
     118        sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/man/man1/+g" \ 
     119            -e "s+\.php+.php.1+g") 
    124120 
    125121LIST_SRCPHP_HTML = \ 
    126122$(shell echo "$(LIST_SRCPHP)" | \ 
    127         sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/html/many/+g" \ 
    128             -e "s+\.php+.php.html+g") 
     123        sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/html/many/+g" \ 
     124            -e "s+\.php+.php.html+g") 
    129125 
    130126LIST_SRCPHP_PDF = \ 
    131127$(shell echo "$(LIST_SRCPHP)" | \ 
    132         sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/pdf/many/+g" \ 
    133             -e "s+\.php+.php.pdf+g") 
     128        sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/pdf/many/+g" \ 
     129            -e "s+\.php+.php.pdf+g") 
    134130 
    135131LIST_SRCXSL = \ 
     
    152148LIST_SRCXSL_RST = \ 
    153149$(shell echo "$(LIST_SRCXSL)" | \ 
    154         sed -e "s+$(DIRSRC)+$(DIRTMP)/sphinx_tmpdir/source+g" \ 
    155             -e "s+\.xsl+.xsl.rst+g") 
     150        sed -e "s+$(DIRSRC)+$(DIRTMP)+g" \ 
     151            -e "s+\.xsl+.xsl.rst+g") 
    156152 
    157153LIST_SRCXSL_R2W = \ 
    158154$(shell echo "$(LIST_SRCXSL)" | \ 
    159         sed -e "s+$(DIRSRC)+$(DIRTMP)/rest2web_tmpdir+g" \ 
    160             -e "s+\.xsl+.xsl.txt+g") 
     155        sed -e "s+$(DIRSRC)+$(DIRTMP)/rest2web_tmpdir+g" \ 
     156            -e "s+\.xsl+.xsl.txt+g") 
    161157 
    162158LIST_SRCXSL_TROFF = \ 
    163159$(shell echo "$(LIST_SRCXSL)" | \ 
    164         sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/man/man1/+g" \ 
    165             -e "s+\.xsl+.xsl.1+g") 
     160        sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/man/man1/+g" \ 
     161            -e "s+\.xsl+.xsl.1+g") 
    166162 
    167163LIST_SRCXSL_HTML = \ 
    168164$(shell echo "$(LIST_SRCXSL)" | \ 
    169         sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/html/many/+g" \ 
    170             -e "s+\.xsl+.xsl.html+g") 
     165        sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/html/many/+g" \ 
     166            -e "s+\.xsl+.xsl.html+g") 
    171167 
    172168LIST_SRCXSL_PDF = \ 
    173169$(shell echo "$(LIST_SRCXSL)" | \ 
    174         sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/pdf/many/+g" \ 
    175             -e "s+\.xsl+.xsl.pdf+g") 
     170        sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/pdf/many/+g" \ 
     171            -e "s+\.xsl+.xsl.pdf+g") 
    176172 
    177173LIST_SRCSH = \ 
     
    186182LIST_SRCSH_RST = \ 
    187183$(shell echo "$(LIST_SRCSH)" | \ 
    188         sed -e "s+$(DIRSRC)+$(DIRTMP)/sphinx_tmpdir/source+g" \ 
    189             -e "s+\.sh+.sh.rst+g") 
     184        sed -e "s+$(DIRSRC)+$(DIRTMP)+g" \ 
     185            -e "s+\.sh+.sh.rst+g") 
    190186 
    191187LIST_SRCSH_R2W = \ 
    192188$(shell echo "$(LIST_SRCSH)" | \ 
    193         sed -e "s+$(DIRSRC)+$(DIRTMP)/rest2web_tmpdir+g" \ 
    194             -e "s+\.sh+.sh.txt+g") 
     189        sed -e "s+$(DIRSRC)+$(DIRTMP)/rest2web_tmpdir+g" \ 
     190            -e "s+\.sh+.sh.txt+g") 
    195191 
    196192LIST_SRCSH_TROFF = \ 
    197193$(shell echo "$(LIST_SRCSH)" | \ 
    198         sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/man/man1/+g" \ 
    199             -e "s+\.sh+.sh.1+g") 
     194        sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/man/man1/+g" \ 
     195            -e "s+\.sh+.sh.1+g") 
    200196 
    201197LIST_SRCSH_HTML = \ 
    202198$(shell echo "$(LIST_SRCSH)" | \ 
    203         sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/html/many/+g" \ 
    204             -e "s+\.sh+.sh.html+g") 
     199        sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/html/many/+g" \ 
     200            -e "s+\.sh+.sh.html+g") 
    205201 
    206202LIST_SRCSH_PDF = \ 
    207203$(shell echo "$(LIST_SRCSH)" | \ 
    208         sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/pdf/many/+g"  \ 
    209             -e "s+\.sh+.sh.pdf+g") 
     204        sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/pdf/many/+g"  \ 
     205            -e "s+\.sh+.sh.pdf+g") 
    210206 
    211207REST2WEB = \ 
     
    264260before : 
    265261        @mkdir -p $(DIRWWW)/manuals/man/man1/ 
    266         @mkdir -p $(DIRWWW)/manuals/html/one/ 
    267262        @mkdir -p $(DIRWWW)/manuals/html/many/ 
    268263        @mkdir -p $(DIRWWW)/manuals/html/rest2web/ 
    269264        @mkdir -p $(DIRWWW)/manuals/html/rest2web/css/ 
    270265        @mkdir -p $(DIRWWW)/manuals/html/sphinx/ 
    271         @mkdir -p $(DIRWWW)/manuals/pdf/one/ 
    272266        @mkdir -p $(DIRWWW)/manuals/pdf/many/ 
    273         @mkdir -p $(DIRTMP)/sphinx_tmpdir/source/ 
     267        @mkdir -p $(DIRWWW)/manuals/pdf/sphinx/ 
     268        @mkdir -p $(DIRTMP)/sphinx_tmpdir/doctrees/ 
    274269        @mkdir -p $(DIRTMP)/rest2web_tmpdir/ 
    275270 
     
    286281cleantmp : 
    287282        -@rm -f $(DIRTMP)/all.xml 
    288         -@rm -rf $(DIRTMP)/sphinx_tmpdir/ 
     283        -@rm -f $(DIRTMP)/*.rst 
     284        -@rm -f $(DIRTMP)/*.tex 
    289285        -@rm -rf $(DIRTMP)/rest2web_tmpdir/ 
    290286        -@rm -f $(DIRTMP)/rest2web.log 
    291         -@rm -f $(DIRTMP)/*.tex 
    292         -@rm -f $(DIRWWW)/manuals/pdf/one/*.aux 
    293         -@rm -f $(DIRWWW)/manuals/pdf/one/*.log 
    294         -@rm -f $(DIRWWW)/manuals/pdf/one/*.out 
    295287        -@rm -f $(DIRWWW)/manuals/pdf/many/*.aux 
    296288        -@rm -f $(DIRWWW)/manuals/pdf/many/*.log 
    297289        -@rm -f $(DIRWWW)/manuals/pdf/many/*.out 
     290        -@rm -rf $(DIRTMP)/sphinx_tmpdir/ 
     291        -@rm -f $(DIRTMP)/sphinx_*.log 
    298292 
    299293design : \ 
     
    347341        python $(REST2WEB) $(DIRADM)/rest2web/superbib_site.ini -v 
    348342 
    349 man_text_sphinx : \ 
     343man_html_sphinx : \ 
    350344$(DIRADM)/sphinx/conf.py \ 
    351 $(DIRADM)/sphinx/Makefile \ 
     345$(DIRTMP)/sphinx_tmpdir/index.rst \ 
    352346$(LIST_SRCSH_RST) \ 
    353347$(LIST_SRCXSL_RST) \ 
    354348$(LIST_SRCPHP_RST) 
    355         echo "sphinx text ++ experimental" 
    356         mkdir -p $(DIRWWW)/manuals/text/sphinx/ 
    357         sphinx-build -b text -a -E -c $(DIRADM)/sphinx \ 
    358         -w $(DIRTMP)/sphinx.log \ 
    359         $(DIRTMP)/sphinx_tmpdir/source \ 
    360         $(DIRWWW)/manuals/text/sphinx/ 
    361  
    362 man_html_sphinx : \ 
    363 $(DIRADM)/sphinx/conf.py \ 
    364 $(DIRADM)/sphinx/Makefile \ 
    365 $(DIRADM)/sphinx/source/contents.rst \ 
    366 $(LIST_SRCSH_RST) \ 
    367 $(LIST_SRCXSL_RST) \ 
    368 $(LIST_SRCPHP_RST) 
    369         cp $(DIRADM)/sphinx/source/contents.rst $(DIRTMP)/sphinx_tmpdir/source/ 
    370         sphinx-build -b html -a -E -c $(DIRADM)/sphinx \ 
    371         -d build/doctrees \ 
    372         -w $(DIRTMP)/sphinx.log \ 
    373         $(DIRTMP)/sphinx_tmpdir/source \ 
    374         $(DIRWWW)/manuals/html/sphinx/ 
     349        @cp $(LIST_SRCSH_RST) $(DIRTMP)/sphinx_tmpdir/ 
     350        @cp $(LIST_SRCXSL_RST) $(DIRTMP)/sphinx_tmpdir/ 
     351        @cp $(LIST_SRCPHP_RST) $(DIRTMP)/sphinx_tmpdir/ 
     352        sphinx-build -b html -c $(DIRADM)/sphinx \ 
     353            -d $(DIRTMP)/sphinx_tmpdir/doctrees \ 
     354            -w $(DIRTMP)/sphinx_html.log \ 
     355            $(DIRTMP)/sphinx_tmpdir/ \ 
     356            $(DIRWWW)/manuals/html/sphinx/ 
    375357 
    376358man_pdf : \ 
    377359man_pdf_many \ 
    378360man_pdf_sphinx 
    379  
    380 man_pdf_sphinx : \ 
    381 $(DIRADM)/sphinx/conf.py \ 
    382 $(DIRADM)/sphinx/Makefile \ 
    383 $(LIST_SRCSH_RST) \ 
    384 $(LIST_SRCXSL_RST) \ 
    385 $(LIST_SRCPHP_RST) 
    386         sphinx-build -b latex -a -E -c $(DIRADM)/sphinx \ 
    387         -d build/doctrees \ 
    388         -w $(DIRTMP)/sphinx.log \ 
    389         $(DIRTMP)/sphinx_tmpdir/source \ 
    390         $(DIRWWW)/manuals/pdf/sphinx/ 
    391361 
    392362man_pdf_many : \ 
     
    395365$(LIST_SRCPHP_PHP) 
    396366 
     367man_pdf_sphinx : \ 
     368$(DIRADM)/sphinx/conf.py \ 
     369$(DIRTMP)/sphinx_tmpdir/index.rst \ 
     370$(LIST_SRCSH_RST) \ 
     371$(LIST_SRCXSL_RST) \ 
     372$(LIST_SRCPHP_RST) 
     373        @cp $(LIST_SRCSH_RST) $(DIRTMP)/sphinx_tmpdir/ 
     374        @cp $(LIST_SRCXSL_RST) $(DIRTMP)/sphinx_tmpdir/ 
     375        @cp $(LIST_SRCPHP_RST) $(DIRTMP)/sphinx_tmpdir/ 
     376        @sphinx-build -b latex -c $(DIRADM)/sphinx \ 
     377            -d $(DIRTMP)/sphinx_tmpdir/doctrees \ 
     378            -w $(DIRTMP)/sphinx_pdf.log \ 
     379            $(DIRTMP)/sphinx_tmpdir/ \ 
     380            $(DIRTMP)/sphinx_tmpdir/latex_output 
     381        cd $(DIRTMP)/sphinx_tmpdir/latex_output/; make all-pdf 
     382        cp $(DIRTMP)/sphinx_tmpdir/latex_output/*.pdf \ 
     383           $(DIRWWW)/manuals/pdf/sphinx/ 
     384 
    397385$(DIRWWW)/manuals/html/many/index.html : \ 
    398386$(DIRTMP)/index_many.rst 
     
    400388        $< $@ 
    401389 
    402 $(DIRWWW)/manuals/html/one/index.html : \ 
    403 $(DIRTMP)/$(PRODUCT)_manuals.rst 
    404         @$(RST2HTML) --input-encoding=ISO-8859-15 --strict \ 
    405         $< $@ 
    406  
    407 $(DIRWWW)/manuals/pdf/one/$(PRODUCT)_manuals.pdf : \ 
    408 $(DIRTMP)/$(PRODUCT)_manuals.tex 
    409         @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/one/ $< 
    410         @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/one/ $< 
    411  
    412390$(DIRTMP)/index_many.rst : 
    413         @echo "===================" >> $@ 
    414         @echo "$(PRODUCTNAME) tools" >> $@ 
    415         @echo "===================" >> $@ 
     391        @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@ 
     392        @echo "$(PRODUCTNAME) manuals" >> $@ 
     393        @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@ 
    416394        @echo " " >> $@ 
    417395        @echo "Shell scripts" >> $@ 
     
    427405        @for file in $(LIST_SRCPHP); do echo " ";echo "$$(basename $${file})_"; echo " "; echo ".. _$$(basename $${file}) : $$(basename $${file}).html"; done >> $@ 
    428406 
    429 $(DIRTMP)/rest2web_tmpdir/%.txt: $(DIRTMP)/sphinx_tmpdir/source/%.rst 
     407$(DIRTMP)/sphinx_tmpdir/index.rst : 
     408        @echo ".. _index:" >> $@ 
     409        @echo " " >> $@ 
     410        @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@ 
     411        @echo "$(PRODUCTNAME) manuals" >> $@ 
     412        @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@ 
     413        @echo " " >> $@ 
     414        @echo "Shell scripts" >> $@ 
     415        @echo "Shell scripts" | tr [:print:] = >> $@ 
     416        @echo ".. toctree::" >> $@ 
     417        @echo "   :maxdepth: 1" 1>> $@ 
     418        @echo "   :glob:" 1>> $@ 
     419        @echo " " >> $@ 
     420        @for file in $(LIST_SRCSH); \ 
     421        do \ 
     422           echo "   $$(basename $${file})"; \ 
     423        done >> $@ 
     424        @echo " " >> $@ 
     425        @echo "XSL scripts" >> $@ 
     426        @echo "XSL scripts" | tr [:print:] = >> $@ 
     427        @echo ".. toctree::" >> $@ 
     428        @echo "   :maxdepth: 1" 1>> $@ 
     429        @echo "   :glob:" 1>> $@ 
     430        @echo " " >> $@ 
     431        @for file in $(LIST_SRCXSL); \ 
     432        do \ 
     433           echo "   $$(basename $${file})"; \ 
     434        done >> $@ 
     435        @echo " " >> $@ 
     436        @echo "PHP scripts" >> $@ 
     437        @echo "PHP scripts" | tr [:print:] = >> $@ 
     438        @echo ".. toctree::" >> $@ 
     439        @echo "   :maxdepth: 1" 1>> $@ 
     440        @echo "   :glob:" 1>> $@ 
     441        @echo " " >> $@ 
     442        @for file in $(LIST_SRCPHP); \ 
     443        do \ 
     444           echo "   $$(basename $${file})"; \ 
     445        done >> $@ 
     446        @echo " " >> $@ 
     447        @echo "Indices and tables" >> $@ 
     448        @echo "Indices and tables" | tr [:print:] = >> $@ 
     449        @echo "* :ref:\`search\`" >> $@ 
     450        @echo " " >> $@ 
     451 
     452 
     453$(DIRTMP)/rest2web_tmpdir/%.txt: $(DIRTMP)/%.rst 
    430454        @sed -e "/^#/d" \ 
    431455             -e "s+@file@+$$(basename $< .rst)+" \ 
     
    434458        @rm $(DIRTMP)/restindex 
    435459 
    436 $(DIRWWW)/manuals/man/man1/%.1:$(DIRTMP)/sphinx_tmpdir/source/%.rst 
     460$(DIRWWW)/manuals/man/man1/%.1:$(DIRTMP)/%.rst 
    437461        @$(RST2MAN) --input-encoding=ISO-8859-15 --strict \ 
    438462        $< $@ 
    439463 
    440 $(DIRWWW)/manuals/html/many/%.html:$(DIRTMP)/sphinx_tmpdir/source/%.rst 
     464$(DIRWWW)/manuals/html/many/%.html:$(DIRTMP)/%.rst 
    441465        @$(RST2HTML) --input-encoding=ISO-8859-15 --strict \ 
    442466        $< $@ 
     
    446470        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $< 
    447471 
    448 $(DIRTMP)/%.tex : $(DIRTMP)/sphinx_tmpdir/source/%.rst 
     472$(DIRTMP)/%.tex : $(DIRTMP)/%.rst 
    449473        @$(RST2LATEX) $(RST2LATEX_OPTIONS_MANY) --input-encoding=ISO-8859-15 --strict \ 
    450474        $< $@ 
    451475 
    452 $(DIRTMP)/sphinx_tmpdir/source/%.sh.rst : $(DIRSRC)/%.sh 
     476$(DIRTMP)/%.sh.rst : $(DIRSRC)/%.sh 
    453477        @$(DIRADM)/extract_rst.sh -i $< -l sh -o $@ 
    454478 
    455 $(DIRTMP)/sphinx_tmpdir/source/%.xsl.rst : $(DIRSRC)/%.xsl 
     479$(DIRTMP)/%.xsl.rst : $(DIRSRC)/%.xsl 
    456480        @$(DIRADM)/extract_rst.sh -i $< -l xml -o $@ 
    457481 
    458 $(DIRTMP)/sphinx_tmpdir/source/%.php.rst : $(DIRSRC)/%.php 
     482$(DIRTMP)/%.php.rst : $(DIRSRC)/%.php 
    459483        @$(DIRADM)/extract_rst.sh -i $< -l php -o $@ 
    460484 
  • trunk/adm/sphinx/conf.py

    r98 r99  
    3838 
    3939# The master toctree document. 
    40 master_doc = 'contents' 
     40master_doc = 'index' 
    4141 
    4242# General information about the project. 
     
    6262# Else, today_fmt is used as the format for a strftime call. 
    6363#today_fmt = '%B %d, %Y' 
    64 today_fmt = '%Y%d%B' 
     64today_fmt = '%Y%m%d' 
    6565 
    6666# List of documents that shouldn't be included in the build. 
     
    154154 
    155155# If true, links to the reST sources are added to the pages. 
    156 html_show_sourcelink = False  
     156html_show_sourcelink = False 
    157157 
    158158# If true, an OpenSearch description file will be output, and all pages will 
Note: See TracChangeset for help on using the changeset viewer.