From e9873f82514628f26522248e60c76e7be121c8be Mon Sep 17 00:00:00 2001 From: Chad Hanna <chad.hanna@ligo.org> Date: Mon, 30 Apr 2018 16:28:28 -0400 Subject: [PATCH] NEW DOC --- doc/source/conf.py | 4 +++ doc/source/gstlal-burst/code.rst | 7 +++-- doc/source/gstlal-burst/gstlal-burst.rst | 4 +-- doc/source/gstlal-calibration/code.rst | 4 +-- .../gstlal-calibration/gstlal-calibration.rst | 4 +-- doc/source/gstlal-inspiral/code.rst | 4 +-- .../gstlal-inspiral/gstlal-inspiral.rst | 4 +-- doc/source/gstlal-ugly/code.rst | 4 +-- doc/source/gstlal-ugly/gstlal-ugly.rst | 4 +-- doc/source/gstlal/gstlal.rst | 2 ++ doc/source/index.rst | 9 +++---- doc/sphinx-bindoc | 27 +++++++++++++------ 12 files changed, 47 insertions(+), 30 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index fdb2c56946..69a4ca247c 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -20,6 +20,10 @@ import os import sys sys.path.insert(0, os.path.abspath('.')) sys.path.insert(0, os.path.abspath('../../gstlal/python')) +sys.path.insert(0, os.path.abspath('../../gstlal-inspiral/python')) +#sys.path.insert(0, os.path.abspath('../../gstlal-burst/python')) +sys.path.insert(0, os.path.abspath('../../gstlal-calibration/python')) +sys.path.insert(0, os.path.abspath('../../gstlal-ugly/python')) # -- General configuration ------------------------------------------------ diff --git a/doc/source/gstlal-burst/code.rst b/doc/source/gstlal-burst/code.rst index deebd9f805..cd6e78a90f 100644 --- a/doc/source/gstlal-burst/code.rst +++ b/doc/source/gstlal-burst/code.rst @@ -1,8 +1,11 @@ -GstLAL Code -=========== +GstLAL burst code +================= .. toctree:: :maxdepth: 2 +.. This code should be uncommented once the burst package is in good shape + +.. bin/bin python-modules/modules diff --git a/doc/source/gstlal-burst/gstlal-burst.rst b/doc/source/gstlal-burst/gstlal-burst.rst index 461fd908be..a46a0af4a3 100644 --- a/doc/source/gstlal-burst/gstlal-burst.rst +++ b/doc/source/gstlal-burst/gstlal-burst.rst @@ -1,5 +1,5 @@ -GstLAL project -============== +GstLAL burst project +==================== .. toctree:: :maxdepth: 2 diff --git a/doc/source/gstlal-calibration/code.rst b/doc/source/gstlal-calibration/code.rst index deebd9f805..32af084463 100644 --- a/doc/source/gstlal-calibration/code.rst +++ b/doc/source/gstlal-calibration/code.rst @@ -1,5 +1,5 @@ -GstLAL Code -=========== +GstLAL calibration code +======================= .. toctree:: :maxdepth: 2 diff --git a/doc/source/gstlal-calibration/gstlal-calibration.rst b/doc/source/gstlal-calibration/gstlal-calibration.rst index 461fd908be..5946e59bc7 100644 --- a/doc/source/gstlal-calibration/gstlal-calibration.rst +++ b/doc/source/gstlal-calibration/gstlal-calibration.rst @@ -1,5 +1,5 @@ -GstLAL project -============== +GstLAL calibration project +========================== .. toctree:: :maxdepth: 2 diff --git a/doc/source/gstlal-inspiral/code.rst b/doc/source/gstlal-inspiral/code.rst index deebd9f805..5796dbaece 100644 --- a/doc/source/gstlal-inspiral/code.rst +++ b/doc/source/gstlal-inspiral/code.rst @@ -1,5 +1,5 @@ -GstLAL Code -=========== +GstLAL inspiral code +==================== .. toctree:: :maxdepth: 2 diff --git a/doc/source/gstlal-inspiral/gstlal-inspiral.rst b/doc/source/gstlal-inspiral/gstlal-inspiral.rst index 461fd908be..ac4c6a886a 100644 --- a/doc/source/gstlal-inspiral/gstlal-inspiral.rst +++ b/doc/source/gstlal-inspiral/gstlal-inspiral.rst @@ -1,5 +1,5 @@ -GstLAL project -============== +GstLAL inspiral project +======================= .. toctree:: :maxdepth: 2 diff --git a/doc/source/gstlal-ugly/code.rst b/doc/source/gstlal-ugly/code.rst index deebd9f805..3aba8eab04 100644 --- a/doc/source/gstlal-ugly/code.rst +++ b/doc/source/gstlal-ugly/code.rst @@ -1,5 +1,5 @@ -GstLAL Code -=========== +GstLAL ugly code +================ .. toctree:: :maxdepth: 2 diff --git a/doc/source/gstlal-ugly/gstlal-ugly.rst b/doc/source/gstlal-ugly/gstlal-ugly.rst index 461fd908be..992f02f7e8 100644 --- a/doc/source/gstlal-ugly/gstlal-ugly.rst +++ b/doc/source/gstlal-ugly/gstlal-ugly.rst @@ -1,5 +1,5 @@ -GstLAL project -============== +GstLAL ugly project +=================== .. toctree:: :maxdepth: 2 diff --git a/doc/source/gstlal/gstlal.rst b/doc/source/gstlal/gstlal.rst index 461fd908be..21e932c4de 100644 --- a/doc/source/gstlal/gstlal.rst +++ b/doc/source/gstlal/gstlal.rst @@ -5,4 +5,6 @@ GstLAL project :maxdepth: 2 overview + tutorials/tutorials code + diff --git a/doc/source/index.rst b/doc/source/index.rst index 657a12564a..47d58c6fd0 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -15,9 +15,6 @@ The GstLAL project documentation projects -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` ++-----------------+-----------------+---------------+ +| :ref:`genindex` | :ref:`modindex` | :ref:`search` | ++-----------------+-----------------+---------------+ diff --git a/doc/sphinx-bindoc b/doc/sphinx-bindoc index 34faed076a..8d537747c2 100755 --- a/doc/sphinx-bindoc +++ b/doc/sphinx-bindoc @@ -13,10 +13,10 @@ def process_source(prog, outfile): if len(sys.argv) == 1: - print "USAGE: sphinx-bindoc <output directory> <input directory>" + print "USAGE: sphinx-bindoc <output directory> <input directory> [patterns to exclude]" sys.exit() -assert(len(sys.argv) == 3) +assert(len(sys.argv) >= 3) indir = sys.argv[2] outdir = sys.argv[1] @@ -29,16 +29,26 @@ tocf.write("""bin :maxdepth: 1 """) -for prog in os.listdir(indir): +for prog in sorted(os.listdir(indir)): # Don't document make files if "Makefile" in prog: continue + if prog in sys.argv[3:]: + continue path_to_prog = os.path.join(indir, prog) # Write the rst file that contains command line arguments fname = os.path.join(outdir, prog+".rst") - print >> sys.stderr, "Creating file ", fname + + # register this program in the master list of programs + tocf.write("\n %s" % os.path.split(fname)[-1].replace(".rst","")) + + if os.path.exists(fname): + print >> sys.stderr, "File %s already exists, skipping." % fname + continue + else: + print >> sys.stderr, "Creating file ", fname f = open(fname, "w", 0) # parse the bin program itself for additional documentation @@ -47,12 +57,13 @@ for prog in os.listdir(indir): # write the output of --help f.write("%s\n%s\n\n" % ("Command line options", "".join(["-"] * len("Command line options")))) - subprocess.call([path_to_prog, "--help"], stdout = f) + f.write("\n\n.. code-block:: none\n\n") + proc = subprocess.Popen([path_to_prog, "--help"], stdout = subprocess.PIPE) + helpmessage = proc.communicate()[0] + helpmessage = "\n".join([" %s" % l for l in helpmessage.split("\n")]) + f.write(helpmessage) # close the file f.close() - # register this program in the master list of programs - tocf.write("\n %s" % os.path.split(fname)[-1].replace(".rst","")) - tocf.close() -- GitLab