Skip to content

Commit

Permalink
Fix some documentation build warnings.
Browse files Browse the repository at this point in the history
- Fix issue with package_list.py regeneration confusing Sphinx.
- Add -E option to avoid caching and make Sphinx happy.
  • Loading branch information
tgamblin committed Oct 4, 2016
1 parent 7806fde commit 00c5f40
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/spack/docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = -E
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
Expand Down
3 changes: 1 addition & 2 deletions lib/spack/docs/command_index.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.. _command_index:

=================
Command index
=================

Expand Down
23 changes: 11 additions & 12 deletions lib/spack/docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# flake8: noqa
##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# Created by Todd Gamblin, tgamblin@llnl.gov.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
Expand Down Expand Up @@ -70,9 +67,10 @@
#
# Generate package list using spack command
#
with open('package_list.rst', 'w') as plist_file:
subprocess.Popen(
[spack_root + '/bin/spack', 'package-list'], stdout=plist_file)
if not os.path.exists('package_list.rst'):
with open('package_list.rst', 'w') as plist_file:
subprocess.Popen(
[spack_root + '/bin/spack', 'package-list'], stdout=plist_file)

#
# Find all the `spack-*` references and add them to a command index
Expand All @@ -85,11 +83,12 @@
if match:
command_names.append(match.group(1).strip())

shutil.copy('command_index.in', 'command_index.rst')
with open('command_index.rst', 'a') as index:
index.write('\n')
for cmd in sorted(command_names):
index.write(' * :ref:`%s`\n' % cmd)
if not os.path.exists('command_index.rst'):
shutil.copy('command_index.in', 'command_index.rst')
with open('command_index.rst', 'a') as index:
index.write('\n')
for cmd in sorted(command_names):
index.write(' * :ref:`%s`\n' % cmd)


# Run sphinx-apidoc
Expand Down

0 comments on commit 00c5f40

Please sign in to comment.