4 copyright = u'2010-2014, Inktank Storage, Inc. and contributors. Licensed under Creative Commons BY-SA'
8 exclude_patterns = ['**/.#*', '**/*~']
11 def _get_description(fname, base):
12 with open(fname) as f:
15 line = f.readline().rstrip('\n')
18 if line.startswith(':') and line.endswith(':'):
22 two = f.readline().rstrip('\n')
23 three = f.readline().rstrip('\n')
25 assert all(c=='=' for c in one)
26 name, description = two.split('--', 1)
27 assert name.strip() == base
28 return description.strip()
32 src_dir = os.path.dirname(__file__)
33 top_srcdir = os.path.dirname(src_dir)
34 man_dir = os.path.join(top_srcdir, 'doc', 'man')
35 sections = os.listdir(man_dir)
36 for section in sections:
37 section_dir = os.path.join(man_dir, section)
38 if not os.path.isdir(section_dir):
40 for filename in os.listdir(section_dir):
41 base, ext = os.path.splitext(filename)
46 path = os.path.join(section_dir, filename)
47 description = _get_description(path, base)
49 os.path.join(section, base),
56 man_pages = list(_get_manpages())
57 # sphinx warns if no toc is found, so feed it with a random file
58 # which is also rendered in this run.