]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | import sys |
2 | import os | |
3 | ||
4 | project = u'Ceph' | |
94b18763 | 5 | copyright = u'2016, Red Hat, Inc, and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0)' |
7c673cae FG |
6 | version = 'dev' |
7 | release = 'dev' | |
8 | ||
9 | templates_path = ['_templates'] | |
10 | source_suffix = '.rst' | |
11 | master_doc = 'index' | |
11fdf7f2 | 12 | exclude_patterns = ['**/.#*', '**/*~', 'start/quick-common.rst', '**/*.inc.rst'] |
7c673cae | 13 | if tags.has('man'): |
11fdf7f2 TL |
14 | master_doc = 'man_index' |
15 | exclude_patterns += ['index.rst', 'architecture.rst', 'glossary.rst', 'release*.rst', | |
7c673cae FG |
16 | 'api/*', |
17 | 'cephfs/*', | |
18 | 'dev/*', | |
11fdf7f2 | 19 | 'governance.rst', |
7c673cae FG |
20 | 'install/*', |
21 | 'mon/*', | |
22 | 'rados/*', | |
b5b8bbf5 FG |
23 | 'mgr/*', |
24 | 'ceph-volume/*', | |
7c673cae FG |
25 | 'radosgw/*', |
26 | 'rbd/*', | |
11fdf7f2 TL |
27 | 'start/*', |
28 | 'releases/*'] | |
29 | else: | |
30 | exclude_patterns += ['man_index.rst'] | |
7c673cae FG |
31 | |
32 | pygments_style = 'sphinx' | |
33 | ||
34 | html_theme = 'ceph' | |
35 | html_theme_path = ['_themes'] | |
36 | html_title = "Ceph Documentation" | |
37 | html_logo = 'logo.png' | |
38 | html_favicon = 'favicon.ico' | |
7c673cae | 39 | html_show_sphinx = False |
f64942e4 | 40 | html_static_path = ["_static"] |
7c673cae FG |
41 | html_sidebars = { |
42 | '**': ['smarttoc.html', 'searchbox.html'], | |
43 | } | |
44 | ||
f64942e4 AA |
45 | sys.path.insert(0, os.path.abspath('_ext')) |
46 | ||
7c673cae FG |
47 | extensions = [ |
48 | 'sphinx.ext.autodoc', | |
49 | 'sphinx.ext.graphviz', | |
50 | 'sphinx.ext.todo', | |
3efd9988 | 51 | 'sphinxcontrib.ditaa', |
7c673cae | 52 | 'breathe', |
f64942e4 | 53 | 'edit_on_github', |
11fdf7f2 | 54 | 'ceph_releases', |
7c673cae | 55 | ] |
3efd9988 | 56 | ditaa = 'ditaa' |
7c673cae FG |
57 | todo_include_todos = True |
58 | ||
59 | top_level = os.path.dirname( | |
60 | os.path.dirname( | |
61 | os.path.abspath(__file__) | |
62 | ) | |
63 | ) | |
64 | ||
65 | breathe_default_project = "Ceph" | |
66 | # see $(top_srcdir)/Doxyfile | |
67 | ||
68 | breathe_build_directory = os.path.join(top_level, "build-doc") | |
69 | breathe_projects = {"Ceph": os.path.join(top_level, breathe_build_directory)} | |
70 | breathe_projects_source = { | |
71 | "Ceph": (os.path.join(top_level, "src/include/rados"), | |
72 | ["rados_types.h", "librados.h"]) | |
73 | } | |
74 | breathe_domain_by_extension = {'py': 'py', 'c': 'c', 'h': 'c', 'cc': 'cxx', 'hpp': 'cxx'} | |
f64942e4 AA |
75 | |
76 | # the docs are rendered with github links pointing to master. the javascript | |
77 | # snippet in _static/ceph.js rewrites the edit links when a page is loaded, to | |
78 | # point to the correct branch. | |
79 | edit_on_github_project = 'ceph/ceph' | |
80 | edit_on_github_branch = 'master' | |
81 | ||
82 | # handles edit-on-github and old version warning display | |
83 | def setup(app): | |
84 | app.add_javascript('js/ceph.js') | |
11fdf7f2 TL |
85 | |
86 | # mocking ceph_module offered by ceph-mgr. `ceph_module` is required by | |
87 | # mgr.mgr_module | |
88 | class Dummy(object): | |
89 | def __getattr__(self, _): | |
90 | return lambda *args, **kwargs: None | |
91 | ||
92 | class Mock(object): | |
93 | __all__ = [] | |
94 | def __init__(self, *args, **kwargs): | |
95 | pass | |
96 | ||
97 | def __call__(self, *args, **kwargs): | |
98 | return Mock() | |
99 | ||
100 | @classmethod | |
101 | def __getattr__(cls, name): | |
102 | mock = type(name, (Dummy,), {}) | |
103 | mock.__module__ = __name__ | |
104 | return mock | |
105 | ||
106 | sys.modules['ceph_module'] = Mock() | |
107 | ||
108 | for pybind in [os.path.join(top_level, 'src/pybind'), | |
109 | os.path.join(top_level, 'src/pybind/mgr')]: | |
110 | if pybind not in sys.path: | |
111 | sys.path.insert(0, pybind) |