]> git.proxmox.com Git - ceph.git/blame - ceph/man/conf.py
import 15.2.5
[ceph.git] / ceph / man / conf.py
CommitLineData
7c673cae
FG
1import os
2
3project = u'Ceph'
94b18763 4copyright = u'2010-2014, Inktank Storage, Inc. and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0)'
7c673cae
FG
5version = 'dev'
6release = 'dev'
7
8exclude_patterns = ['**/.#*', '**/*~']
9
10
11def _get_description(fname, base):
12 with open(fname) as f:
13 one = None
14 while True:
15 line = f.readline().rstrip('\n')
16 if not line:
17 continue
18 if line.startswith(':') and line.endswith(':'):
19 continue
11fdf7f2
TL
20 if line.startswith('.. '):
21 continue
7c673cae
FG
22 one = line
23 break
24 two = f.readline().rstrip('\n')
25 three = f.readline().rstrip('\n')
26 assert one == three
27 assert all(c=='=' for c in one)
28 name, description = two.split('--', 1)
29 assert name.strip() == base
30 return description.strip()
31
32
33def _get_manpages():
34 src_dir = os.path.dirname(__file__)
35 top_srcdir = os.path.dirname(src_dir)
36 man_dir = os.path.join(top_srcdir, 'doc', 'man')
37 sections = os.listdir(man_dir)
38 for section in sections:
39 section_dir = os.path.join(man_dir, section)
40 if not os.path.isdir(section_dir):
41 continue
42 for filename in os.listdir(section_dir):
43 base, ext = os.path.splitext(filename)
44 if ext != '.rst':
45 continue
46 if base == 'index':
47 continue
48 path = os.path.join(section_dir, filename)
49 description = _get_description(path, base)
50 yield (
51 os.path.join(section, base),
52 base,
53 description,
54 '',
55 section,
56 )
57
58man_pages = list(_get_manpages())
59# sphinx warns if no toc is found, so feed it with a random file
60# which is also rendered in this run.
61master_doc = '8/ceph'