diff options
author | Kefu Chai <kchai@redhat.com> | 2015-04-07 09:45:20 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2015-04-07 17:26:50 +0200 |
commit | 6dd570476c3b92228265408547e1bc8ea667f006 (patch) | |
tree | b5d8a52c34eaca67cb6d92c61f8755535ab10a3a /man | |
parent | doc: fix sphinx warnings (diff) | |
download | ceph-6dd570476c3b92228265408547e1bc8ea667f006.tar.xz ceph-6dd570476c3b92228265408547e1bc8ea667f006.zip |
man: ignore fieldlist when getting desc for manpages
this change will enable us to specify `:orphan:` in the fieldlist of
a manpage rst file, otherwise sphinx-build complains at seeing it if
it is not referenced by a toc doc.
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'man')
-rw-r--r-- | man/conf.py | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/man/conf.py b/man/conf.py index 4cadf231dad..40f1b1e03f0 100644 --- a/man/conf.py +++ b/man/conf.py @@ -7,6 +7,27 @@ release = 'dev' exclude_patterns = ['**/.#*', '**/*~'] +def _get_description(fname): + with file(fname) as f: + one = None + for line in f: + line = line.rstrip('\n') + if not line: + continue + if line.startswith(':') and line.endswith(':'): + continue + one = line + break + two = f.readline() + three = f.readline() + print one, three + assert one == three + assert all(c=='=' for c in one.rstrip('\n')) + two = two.strip() + name, description = two.split('--', 1) + assert name.strip() == base + return description.strip() + def _get_manpages(): src_dir = os.path.dirname(__file__) top_srcdir = os.path.dirname(src_dir) @@ -22,16 +43,7 @@ def _get_manpages(): continue if base == 'index': continue - with file(os.path.join(section_dir, filename)) as f: - one = f.readline() - two = f.readline() - three = f.readline() - assert one == three - assert all(c=='=' for c in one.rstrip('\n')) - two = two.strip() - name, rest = two.split('--', 1) - assert name.strip() == base - description = rest.strip() + description = os.path.join(section_dir, filename) yield ( os.path.join(section, base), base, |