]>
git.proxmox.com Git - ceph.git/blob - ceph/man/conf.py
4 copyright
= u
'2010-2014, Inktank Storage, Inc. and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0)'
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(':'):
20 if line
.startswith('.. '):
24 two
= f
.readline().rstrip('\n')
25 three
= f
.readline().rstrip('\n')
27 assert all(c
=='=' for c
in one
)
28 name
, description
= two
.split('--', 1)
29 assert name
.strip() == base
30 return description
.strip()
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
):
42 for filename
in os
.listdir(section_dir
):
43 base
, ext
= os
.path
.splitext(filename
)
48 path
= os
.path
.join(section_dir
, filename
)
49 description
= _get_description(path
, base
)
51 os
.path
.join(section
, base
),
58 man_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.