From 41675e5ed66e80ca4bc0ed5dfc77f7c9ddac81d8 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 30 Aug 2016 01:27:49 -0700 Subject: sorted command index, better colification. --- lib/spack/docs/conf.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/spack/docs/conf.py b/lib/spack/docs/conf.py index 95549e3b1e..90a08a154e 100644 --- a/lib/spack/docs/conf.py +++ b/lib/spack/docs/conf.py @@ -43,6 +43,8 @@ import shutil import subprocess from glob import glob +# -- Spack customizations ----------------------------------------------------- + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -60,6 +62,10 @@ spack_version = subprocess.Popen( [spack_root + '/bin/spack', '-V'], stderr=subprocess.PIPE).communicate()[1].strip().split('.') +# Set an environment variable so that colify will print output like it would to +# a terminal. +os.environ['COLIFY_SIZE'] = '25x80' + # # Generate package list using spack command # @@ -81,7 +87,7 @@ for filename in glob('*rst'): shutil.copy('command_index.in', 'command_index.rst') with open('command_index.rst', 'a') as index: index.write('\n') - for cmd in command_names: + for cmd in sorted(command_names): index.write(' * :ref:`%s`\n' % cmd) # @@ -106,10 +112,6 @@ for line in fileinput.input('spack.rst', inplace=1): print line, -# Set an environment variable so that colify will print output like it would to -# a terminal. -os.environ['COLIFY_SIZE'] = '25x80' - # Enable todo items todo_include_todos = True -- cgit v1.2.3-70-g09d2 From 05545a2528c5187d23329d3c691e66949e7d95b5 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 30 Aug 2016 01:43:48 -0700 Subject: test. --- lib/spack/docs/conf.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/spack/docs/conf.py b/lib/spack/docs/conf.py index 90a08a154e..de84d0e5c8 100644 --- a/lib/spack/docs/conf.py +++ b/lib/spack/docs/conf.py @@ -70,6 +70,9 @@ os.environ['COLIFY_SIZE'] = '25x80' # Generate package list using spack command # with open('package_list.rst', 'w') as plist_file: + subprocess.check_output( + [spack_root + '/bin/spack', 'package-list']) + subprocess.Popen( [spack_root + '/bin/spack', 'package-list'], stdout=plist_file) -- cgit v1.2.3-70-g09d2 From 32834dd67d20f2a58514bc9b9cd511e1a78d431e Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 30 Aug 2016 20:50:14 -0700 Subject: fix sys.path in conf.py --- lib/spack/docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/spack/docs/conf.py b/lib/spack/docs/conf.py index de84d0e5c8..06a2523ca2 100644 --- a/lib/spack/docs/conf.py +++ b/lib/spack/docs/conf.py @@ -50,7 +50,7 @@ from glob import glob # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('exts')) sys.path.insert(0, os.path.abspath('../external')) -sys.path.append(os.path.abspath('../spack')) +sys.path.append(os.path.abspath('..')) # Add the Spack bin directory to the path so that we can use its output in docs. spack_root = '../../..' -- cgit v1.2.3-70-g09d2 From 3a9388b43a435ac00bc6ea6aa154440e4f8df593 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 30 Aug 2016 21:02:34 -0700 Subject: Move sphinx-apidoc into conf.py, too. --- lib/spack/docs/.gitignore | 1 + lib/spack/docs/Makefile | 2 +- lib/spack/docs/conf.py | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/spack/docs/.gitignore b/lib/spack/docs/.gitignore index 26c343d3eb..0bbf78cce0 100644 --- a/lib/spack/docs/.gitignore +++ b/lib/spack/docs/.gitignore @@ -1,4 +1,5 @@ package_list.rst command_index.rst spack*.rst +modules.rst _build diff --git a/lib/spack/docs/Makefile b/lib/spack/docs/Makefile index 302ffd4c97..f9eae29187 100644 --- a/lib/spack/docs/Makefile +++ b/lib/spack/docs/Makefile @@ -74,7 +74,7 @@ clean: -rm -f package_list.rst command_index.rst -rm -rf $(BUILDDIR)/* $(APIDOC_FILES) -html: apidoc +html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." diff --git a/lib/spack/docs/conf.py b/lib/spack/docs/conf.py index 06a2523ca2..c0dccaa6ba 100644 --- a/lib/spack/docs/conf.py +++ b/lib/spack/docs/conf.py @@ -42,6 +42,7 @@ import re import shutil import subprocess from glob import glob +from sphinx.apidoc import main as sphinx_apidoc # -- Spack customizations ----------------------------------------------------- @@ -93,6 +94,10 @@ with open('command_index.rst', 'a') as index: for cmd in sorted(command_names): index.write(' * :ref:`%s`\n' % cmd) + +# Run sphinx-apidoc +sphinx_apidoc(['-T', '-o', '.', '../spack']) + # # Exclude everything in spack.__all__ from indexing. All of these # symbols are imported from elsewhere in spack; their inclusion in -- cgit v1.2.3-70-g09d2