From 1ea445c377d25970cb73f5f35004e02c5e066ca4 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 1 Mar 2012 16:51:21 -0500 Subject: [PATCH] blueprint sphinx-doc-cleanup bug 944381 Add logic to generate_autodoc_index.sh to produce rst underlines to match the heading strings. Change-Id: Ib0f54a45fcc4ab6dfaa593c756682f1a25fdb420 --- Authors | 1 + doc/ext/nova_autodoc.py | 1 + doc/generate_autodoc_index.sh | 11 +++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Authors b/Authors index 54a3cbfa793d..8db7ad8a6074 100644 --- a/Authors +++ b/Authors @@ -51,6 +51,7 @@ Devendra Modium Devin Carlen Donal Lafferty Dong-In David Kang +Doug Hellmann Duncan McGreggor Ed Leafe Edouard Thuleau diff --git a/doc/ext/nova_autodoc.py b/doc/ext/nova_autodoc.py index 3dd992d849da..704c590f0b95 100644 --- a/doc/ext/nova_autodoc.py +++ b/doc/ext/nova_autodoc.py @@ -5,6 +5,7 @@ gettext.install('nova') from nova import utils + def setup(app): rootdir = os.path.abspath(app.srcdir + '/..') print "**Autodocumenting from %s" % rootdir diff --git a/doc/generate_autodoc_index.sh b/doc/generate_autodoc_index.sh index 4e2870bfc929..5d9cdd315be9 100755 --- a/doc/generate_autodoc_index.sh +++ b/doc/generate_autodoc_index.sh @@ -10,9 +10,16 @@ for x in `./find_autodoc_modules.sh`; do echo "Generating ${SOURCEDIR}/${x}.rst" echo "${SOURCEDIR}/${x}.rst" >> .autogenerated + heading="The :mod:\`${x}\` Module" + # Figure out how long the heading is + # and make sure to emit that many '=' under + # it to avoid heading format errors + # in Sphinx. + let heading_len=$(echo "$heading" | wc -c) + underline=$(head -c $heading_len < /dev/zero | tr '\0' '=') ( cat <