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
This commit is contained in:
1
Authors
1
Authors
@@ -51,6 +51,7 @@ Devendra Modium <dmodium@isi.edu>
|
|||||||
Devin Carlen <devin.carlen@gmail.com>
|
Devin Carlen <devin.carlen@gmail.com>
|
||||||
Donal Lafferty <donal.lafferty@citrix.com>
|
Donal Lafferty <donal.lafferty@citrix.com>
|
||||||
Dong-In David Kang <dkang@isi.edu>
|
Dong-In David Kang <dkang@isi.edu>
|
||||||
|
Doug Hellmann <doug.hellmann@dreamhost.com>
|
||||||
Duncan McGreggor <duncan@dreamhost.com>
|
Duncan McGreggor <duncan@dreamhost.com>
|
||||||
Ed Leafe <ed@leafe.com>
|
Ed Leafe <ed@leafe.com>
|
||||||
Edouard Thuleau <edouard1.thuleau@orange.com>
|
Edouard Thuleau <edouard1.thuleau@orange.com>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ gettext.install('nova')
|
|||||||
|
|
||||||
from nova import utils
|
from nova import utils
|
||||||
|
|
||||||
|
|
||||||
def setup(app):
|
def setup(app):
|
||||||
rootdir = os.path.abspath(app.srcdir + '/..')
|
rootdir = os.path.abspath(app.srcdir + '/..')
|
||||||
print "**Autodocumenting from %s" % rootdir
|
print "**Autodocumenting from %s" % rootdir
|
||||||
|
|||||||
@@ -10,9 +10,16 @@ for x in `./find_autodoc_modules.sh`;
|
|||||||
do
|
do
|
||||||
echo "Generating ${SOURCEDIR}/${x}.rst"
|
echo "Generating ${SOURCEDIR}/${x}.rst"
|
||||||
echo "${SOURCEDIR}/${x}.rst" >> .autogenerated
|
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 <<EOF
|
( cat <<EOF
|
||||||
The :mod:\`${x}\` Module
|
${heading}
|
||||||
==============================================================================
|
${underline}
|
||||||
.. automodule:: ${x}
|
.. automodule:: ${x}
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
|
|||||||
Reference in New Issue
Block a user