From e21c44a50e6f32ddf033641819960b305bd70b32 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Tue, 28 Apr 2009 17:38:18 +0200 Subject: [PATCH] Refactored into sphinx, addenum and reblender (separate). --- Makefile | 80 +++------------------ {source/pkgs_addenum => pkgs}/fsl.rst | 0 reblender | 13 ++-- {source => sphinx}/.templates/layout.html | 0 sphinx/Makefile | 78 ++++++++++++++++++++ {source => sphinx}/conf.py | 0 {source => sphinx}/gpg.rst | 0 {source => sphinx}/index.rst | 0 {source => sphinx}/pics/debian-imaging.jpg | Bin {source => sphinx}/setup.rst | 0 10 files changed, 97 insertions(+), 74 deletions(-) rename {source/pkgs_addenum => pkgs}/fsl.rst (100%) rename {source => sphinx}/.templates/layout.html (100%) create mode 100644 sphinx/Makefile rename {source => sphinx}/conf.py (100%) rename {source => sphinx}/gpg.rst (100%) rename {source => sphinx}/index.rst (100%) rename {source => sphinx}/pics/debian-imaging.jpg (100%) rename {source => sphinx}/setup.rst (100%) diff --git a/Makefile b/Makefile index a903a1b..45071d8 100644 --- a/Makefile +++ b/Makefile @@ -1,94 +1,34 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = - -# Internal variables. -SRCDIR = build/src -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SRCDIR) - WWW_UPLOAD_URI = elrond:/home/hanke/public_html/archive -WWW_DIR = build/html +WWW_DIR = build/_build/html -.PHONY: help clean html web pickle htmlhelp latex changes linkcheck +prep: + mkdir -p build/src + cp -r sphinx/* build/src -prep: - mkdir -p build - cp -r source/* build/src +html: prep update-db + cd build/src && $(MAKE) html BUILDDIR=$(CURDIR)/build clean: -rm -rf build -html: prep - mkdir -p build/html build/doctrees - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html - @echo - @echo "Build finished. The HTML pages are in build/html." - -pickle: prep - mkdir -p build/pickle build/doctrees - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -web: pickle - -json: prep - mkdir -p build/json build/doctrees - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) build/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: prep - mkdir -p build/htmlhelp build/doctrees - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in build/htmlhelp." - -latex: prep - mkdir -p build/latex build/doctrees - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex - @echo - @echo "Build finished; the LaTeX files are in build/latex." - @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ - "run these through (pdf)latex." - -changes: prep - mkdir -p build/changes build/doctrees - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes - @echo - @echo "The overview file is in build/changes." - -linkcheck: prep - mkdir -p build/linkcheck build/doctrees - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in build/linkcheck/output.txt." - update-db: - rm -f build/db.db +# -r http://apsy.gse.uni-magdeburg.de/debian/dists/lenny/Release \ + -r http://apsy.gse.uni-magdeburg.de/debian/dists/squeeze/Release \ +# rm -f build/db.db ./reblender \ --db build/db.db \ --outdir build/src \ + --pkgaddenum pkgs \ -r http://apsy.gse.uni-magdeburg.de/debian/dists/dapper/Release \ -r http://apsy.gse.uni-magdeburg.de/debian/dists/gutsy/Release \ -r http://apsy.gse.uni-magdeburg.de/debian/dists/hardy/Release \ -r http://apsy.gse.uni-magdeburg.de/debian/dists/intrepid/Release \ -r http://apsy.gse.uni-magdeburg.de/debian/dists/etch/Release \ - -r http://apsy.gse.uni-magdeburg.de/debian/dists/lenny/Release \ - -r http://apsy.gse.uni-magdeburg.de/debian/dists/squeeze/Release \ -r http://apsy.gse.uni-magdeburg.de/debian/dists/sid/Release \ -t svn://svn.debian.org/blends/projects/med/trunk/debian-med/tasks/imaging \ -t svn://svn.debian.org/blends/projects/med/trunk/debian-med/tasks/imaging-dev \ diff --git a/source/pkgs_addenum/fsl.rst b/pkgs/fsl.rst similarity index 100% rename from source/pkgs_addenum/fsl.rst rename to pkgs/fsl.rst diff --git a/reblender b/reblender index 7176271..3afd33a 100755 --- a/reblender +++ b/reblender @@ -663,7 +663,7 @@ def writePkgsBy(db, key, value2id, outdir, heading): toc.close() -def writeRst(db, outdir): +def writeRst(db, outdir, addenum_dir=None): createDir(outdir) createDir(os.path.join(outdir, 'pkgs')) @@ -680,8 +680,10 @@ def writeRst(db, outdir): pf.write(genPkgPage(db, p)) # check for doc addons - if os.path.exists(os.path.join(outdir, 'pkgs_addenum/%s.rst' % p)): - pf.write('\n\n.. include:: ../pkgs_addenum/%s.rst\n' %p) + if addenum_dir is not None: + addenum = os.path.join(os.path.abspath(addenum_dir), '%s.rst' % p) + if os.path.exists(addenum): + pf.write('\n\n.. include:: %s\n' % addenum) pf.close() toc.write(' pkgs/%s\n' % p) @@ -719,6 +721,9 @@ def prepOptParser(op): action="append", dest="prospective_pkgs", help="None") + op.add_option("--pkgaddenum", action="store", dest="addenum_dir", + type="string", default=None, help="None") + def main(): op = OptionParser(version="%prog 0.0.1") @@ -744,7 +749,7 @@ def main(): if not opts.outdir is None: dpa.writeSourcesLists(opts.outdir) - writeRst(dpa, opts.outdir) + writeRst(dpa, opts.outdir, opts.addenum_dir) writePkgsBy(dpa, 'maintainer', maintainer2email, opts.outdir, 'Packages maintained by ') diff --git a/source/.templates/layout.html b/sphinx/.templates/layout.html similarity index 100% rename from source/.templates/layout.html rename to sphinx/.templates/layout.html diff --git a/sphinx/Makefile b/sphinx/Makefile new file mode 100644 index 0000000..fd47aff --- /dev/null +++ b/sphinx/Makefile @@ -0,0 +1,78 @@ +# Makefile for Sphinx documentation +# + +# target directory +BUILDDIR = _build + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html web pickle htmlhelp latex changes linkcheck + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " changes to make an overview over all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + mkdir -p $(BUILDDIR)/html $(BUILDDIR)/doctrees + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +pickle: + mkdir -p $(BUILDDIR)/pickle $(BUILDDIR)/doctrees + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +web: pickle + +json: + mkdir -p $(BUILDDIR)/json $(BUILDDIR)/doctrees + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + mkdir -p $(BUILDDIR)/htmlhelp $(BUILDDIR)/doctrees + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +latex: + mkdir -p $(BUILDDIR)/latex $(BUILDDIR)/doctrees + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ + "run these through (pdf)latex." + +changes: + mkdir -p $(BUILDDIR)/changes $(BUILDDIR)/doctrees + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + mkdir -p $(BUILDDIR)/linkcheck $(BUILDDIR)/doctrees + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." diff --git a/source/conf.py b/sphinx/conf.py similarity index 100% rename from source/conf.py rename to sphinx/conf.py diff --git a/source/gpg.rst b/sphinx/gpg.rst similarity index 100% rename from source/gpg.rst rename to sphinx/gpg.rst diff --git a/source/index.rst b/sphinx/index.rst similarity index 100% rename from source/index.rst rename to sphinx/index.rst diff --git a/source/pics/debian-imaging.jpg b/sphinx/pics/debian-imaging.jpg similarity index 100% rename from source/pics/debian-imaging.jpg rename to sphinx/pics/debian-imaging.jpg diff --git a/source/setup.rst b/sphinx/setup.rst similarity index 100% rename from source/setup.rst rename to sphinx/setup.rst -- 2.39.2