2020-04-09 13:25:39 +00:00
|
|
|
import shutil
|
2014-03-24 18:23:54 +00:00
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
|
2013-03-08 23:46:34 +00:00
|
|
|
project = u'Ceph'
|
2019-12-20 21:57:27 +00:00
|
|
|
copyright = u'2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0)'
|
2011-08-19 23:43:21 +00:00
|
|
|
version = 'dev'
|
|
|
|
release = 'dev'
|
|
|
|
|
|
|
|
templates_path = ['_templates']
|
|
|
|
source_suffix = '.rst'
|
|
|
|
master_doc = 'index'
|
2019-02-06 17:04:23 +00:00
|
|
|
exclude_patterns = ['**/.#*', '**/*~', 'start/quick-common.rst', '**/*.inc.rst']
|
2016-05-24 04:53:21 +00:00
|
|
|
if tags.has('man'):
|
2017-08-15 18:11:06 +00:00
|
|
|
master_doc = 'man_index'
|
|
|
|
exclude_patterns += ['index.rst', 'architecture.rst', 'glossary.rst', 'release*.rst',
|
2016-05-24 04:53:21 +00:00
|
|
|
'api/*',
|
2020-02-26 10:28:18 +00:00
|
|
|
'cephadm/*',
|
2016-05-24 04:53:21 +00:00
|
|
|
'cephfs/*',
|
|
|
|
'dev/*',
|
2018-06-05 21:18:36 +00:00
|
|
|
'governance.rst',
|
2019-12-02 23:43:26 +00:00
|
|
|
'foundation.rst',
|
2016-05-24 04:53:21 +00:00
|
|
|
'install/*',
|
|
|
|
'mon/*',
|
|
|
|
'rados/*',
|
2017-08-15 18:11:06 +00:00
|
|
|
'mgr/*',
|
2017-08-17 21:02:43 +00:00
|
|
|
'ceph-volume/*',
|
2016-05-24 04:53:21 +00:00
|
|
|
'radosgw/*',
|
|
|
|
'rbd/*',
|
2018-03-07 22:50:28 +00:00
|
|
|
'start/*',
|
|
|
|
'releases/*']
|
2017-08-15 18:42:52 +00:00
|
|
|
else:
|
|
|
|
exclude_patterns += ['man_index.rst']
|
2016-05-24 04:53:21 +00:00
|
|
|
|
2011-08-19 23:43:21 +00:00
|
|
|
pygments_style = 'sphinx'
|
|
|
|
|
2012-05-03 18:02:51 +00:00
|
|
|
html_theme = 'ceph'
|
|
|
|
html_theme_path = ['_themes']
|
2013-03-04 19:48:14 +00:00
|
|
|
html_title = "Ceph Documentation"
|
2012-05-03 18:02:51 +00:00
|
|
|
html_logo = 'logo.png'
|
2011-08-19 23:43:21 +00:00
|
|
|
html_favicon = 'favicon.ico'
|
|
|
|
html_show_sphinx = False
|
2018-10-01 23:54:19 +00:00
|
|
|
html_static_path = ["_static"]
|
2011-08-30 18:26:56 +00:00
|
|
|
html_sidebars = {
|
|
|
|
'**': ['smarttoc.html', 'searchbox.html'],
|
|
|
|
}
|
2020-03-13 05:11:49 +00:00
|
|
|
html_css_files = [
|
|
|
|
'css/custom.css',
|
|
|
|
]
|
2018-10-01 23:54:19 +00:00
|
|
|
sys.path.insert(0, os.path.abspath('_ext'))
|
|
|
|
|
2011-08-29 22:43:41 +00:00
|
|
|
extensions = [
|
2011-09-30 18:30:28 +00:00
|
|
|
'sphinx.ext.autodoc',
|
2020-02-27 12:16:00 +00:00
|
|
|
'sphinx_autodoc_typehints',
|
2011-09-01 19:42:56 +00:00
|
|
|
'sphinx.ext.graphviz',
|
2011-08-29 22:43:41 +00:00
|
|
|
'sphinx.ext.todo',
|
2015-03-17 15:40:00 +00:00
|
|
|
'breathe',
|
2018-10-01 23:54:19 +00:00
|
|
|
'edit_on_github',
|
|
|
|
'ceph_releases',
|
2011-08-29 22:43:41 +00:00
|
|
|
]
|
2020-04-09 15:14:42 +00:00
|
|
|
|
2020-04-09 13:25:39 +00:00
|
|
|
ditaa = shutil.which("ditaa")
|
|
|
|
if ditaa is not None:
|
|
|
|
extensions += ['sphinxcontrib.ditaa']
|
|
|
|
else:
|
|
|
|
extensions += ['plantweb.directive']
|
|
|
|
plantweb_defaults = {
|
|
|
|
'engine': 'ditaa'
|
|
|
|
}
|
|
|
|
|
2020-04-09 15:14:42 +00:00
|
|
|
build_with_rtd = os.environ.get('READTHEDOCS') == 'True'
|
|
|
|
if build_with_rtd:
|
|
|
|
extensions += ['sphinx_search.extension']
|
|
|
|
|
2011-08-19 23:43:21 +00:00
|
|
|
todo_include_todos = True
|
|
|
|
|
2014-03-24 18:23:54 +00:00
|
|
|
top_level = os.path.dirname(
|
|
|
|
os.path.dirname(
|
|
|
|
os.path.abspath(__file__)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2015-03-17 15:40:00 +00:00
|
|
|
breathe_default_project = "Ceph"
|
|
|
|
# see $(top_srcdir)/Doxyfile
|
|
|
|
|
|
|
|
breathe_build_directory = os.path.join(top_level, "build-doc")
|
|
|
|
breathe_projects = {"Ceph": os.path.join(top_level, breathe_build_directory)}
|
|
|
|
breathe_projects_source = {
|
|
|
|
"Ceph": (os.path.join(top_level, "src/include/rados"),
|
|
|
|
["rados_types.h", "librados.h"])
|
|
|
|
}
|
2016-05-31 10:33:08 +00:00
|
|
|
breathe_domain_by_extension = {'py': 'py', 'c': 'c', 'h': 'c', 'cc': 'cxx', 'hpp': 'cxx'}
|
2017-11-02 04:19:33 +00:00
|
|
|
|
2018-10-01 23:54:19 +00:00
|
|
|
# the docs are rendered with github links pointing to master. the javascript
|
|
|
|
# snippet in _static/ceph.js rewrites the edit links when a page is loaded, to
|
|
|
|
# point to the correct branch.
|
|
|
|
edit_on_github_project = 'ceph/ceph'
|
|
|
|
edit_on_github_branch = 'master'
|
|
|
|
|
|
|
|
# handles edit-on-github and old version warning display
|
|
|
|
def setup(app):
|
2020-06-22 01:34:53 +00:00
|
|
|
app.add_js_file('js/ceph.js')
|
2020-04-09 13:25:39 +00:00
|
|
|
if ditaa is None:
|
|
|
|
# add "ditaa" as an alias of "diagram"
|
|
|
|
from plantweb.directive import DiagramDirective
|
|
|
|
app.add_directive('ditaa', DiagramDirective)
|
2018-10-01 23:54:19 +00:00
|
|
|
|
2017-11-02 04:19:33 +00:00
|
|
|
# mocking ceph_module offered by ceph-mgr. `ceph_module` is required by
|
|
|
|
# mgr.mgr_module
|
|
|
|
class Dummy(object):
|
|
|
|
def __getattr__(self, _):
|
|
|
|
return lambda *args, **kwargs: None
|
|
|
|
|
|
|
|
class Mock(object):
|
|
|
|
__all__ = []
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def __call__(self, *args, **kwargs):
|
|
|
|
return Mock()
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def __getattr__(cls, name):
|
|
|
|
mock = type(name, (Dummy,), {})
|
|
|
|
mock.__module__ = __name__
|
|
|
|
return mock
|
|
|
|
|
|
|
|
sys.modules['ceph_module'] = Mock()
|
|
|
|
|
2020-04-09 15:14:42 +00:00
|
|
|
if build_with_rtd:
|
2020-04-09 08:51:06 +00:00
|
|
|
exclude_patterns += ['**/api/*',
|
|
|
|
'**/api.rst']
|
|
|
|
autodoc_mock_imports = ['cephfs',
|
|
|
|
'rados',
|
|
|
|
'rbd',
|
|
|
|
'ceph']
|
|
|
|
pybinds = ['pybind/mgr',
|
|
|
|
'python-common']
|
|
|
|
else:
|
|
|
|
pybinds = ['pybind',
|
|
|
|
'pybind/mgr',
|
|
|
|
'python-common']
|
|
|
|
|
|
|
|
for c in pybinds:
|
|
|
|
pybind = os.path.join(top_level, 'src', c)
|
2017-11-02 04:19:33 +00:00
|
|
|
if pybind not in sys.path:
|
|
|
|
sys.path.insert(0, pybind)
|