Commit Graph

91 Commits

Author SHA1 Message Date
Leonid Usov 88fb668938 doc: fixes for local dev builds
Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
2024-03-04 13:48:03 +02:00
Kefu Chai 8d3ec1f14e
Merge pull request #46664 from tchaikov/wip-doc-gantt
doc: render release with mermaid gantt

Reviewed-by: Laura Flores <lflores@redhat.com>
2022-06-15 22:25:16 +08:00
Kefu Chai f481f86aa3 doc: render release with mermaid gantt
for better readability

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-06-15 00:38:22 -04:00
Salar Nosrati-Ershad 26d44bcae8 doc: Disable double dashes "--" smartquotes conversion to en-dashes 2022-06-11 23:34:06 +04:30
Kefu Chai 8891d65319 doc/conf.py: silence warnings from breathe
breathe calls doxygen for extracting/generating docs from code.
while doxygen complains at seeing undocumented fields/func. these
warnings could fail the sphinx-build command, if it takes warnings
as errors.

in this change, these warnings are silenced.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-03-06 14:27:55 +08:00
Josh Durgin c9b75d081b doc/conf.py: use links to the 'edit' page for edit on github
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
2022-01-12 12:27:48 -05:00
Yehuda Sadeh 50ab91473e doc/rgw: fix docs build
Workaround rgw modules conflict, as there are two separate modules named
rgw: src/pybind/rgw, src/pybind/mgr/rgw

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2021-11-30 10:57:14 -08:00
Kefu Chai 4231bfda04
Merge pull request #42582 from tchaikov/wip-doc-health-report
doc/dev: add health-reports.rst

Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2021-08-02 21:40:48 +08:00
Kefu Chai 1a36bf82fc admin, doc: introduce sphinxcontrib.seqdiag
for rendering sequence-diagram. unlike ditaa, seqdiag allows us to
create sequence-diagram without worrying about the layout. and the
syntax is quite like that of dot.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-02 19:02:56 +08:00
Kefu Chai 02e7acc376 doc/conf.py: run ditaa with java
just in case, otherwise we could have

  File "/home/docs/checkouts/readthedocs.org/user_builds/ceph/envs/42577/lib/python3.8/site-packages/sphinxcontrib/ditaa.py", line 200, in html_visit_ditaa
    render_ditaa_html(self, node, node['code'], node['options'])
  File "/home/docs/checkouts/readthedocs.org/user_builds/ceph/envs/42577/lib/python3.8/site-packages/sphinxcontrib/ditaa.py", line 177, in render_ditaa_html
    fname, outfn = render_ditaa(self, code, options, prefix)
  File "/home/docs/checkouts/readthedocs.org/user_builds/ceph/envs/42577/lib/python3.8/site-packages/sphinxcontrib/ditaa.py", line 141, in render_ditaa
    p = Popen(ditaa_args, stdout=PIPE, stdin=PIPE, stderr=PIPE)
  File "/home/docs/.pyenv/versions/3.8.6/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/home/docs/.pyenv/versions/3.8.6/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/usr/bin/ditaa'

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-02 01:42:08 +08:00
Kefu Chai 98dc0d4e85 doc/_ext: load options defined by mgr modules
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-06 20:54:42 +08:00
Kefu Chai 4b7fb6c453 doc/conf.py: use glob.glob() to find .yaml.in files
improve the maintainability of .yaml.in files.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-21 13:35:12 +08:00
Kefu Chai aa50d14b61 common/optinos: extract crimson options out
prepare for the change to split the options by services

in future, osd will have its own osd.yaml.in, while crimson will consume
both osd.yaml.in and crimson.yaml.in.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-21 13:17:17 +08:00
Kefu Chai 4da18aaf57 common/options,doc: extract formatted desc into .yaml.in
* add a field named "fmt_desc", which is the description formatted using
  reStructuredText. it is preserved as it is if it's different from the
  desc or long_desc of an option. we can consolidate it with long_desc
  in future, and use pretty printer which has minimal support for
  reStructuredText for printing the formatted descriptions for a better
  user experience of command line. but at this moment, fmt_desc has
  only one consumer: the "ceph_confval" sphinx extension which extracts
  and translate the options yaml file to reStructuredText, which is in
  turn rendered by sphinx.
* remove unused options from the doc
  - journal_queue_max_ops
  - journal_queue_max_bytes

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-17 00:02:45 +08:00
Kefu Chai 4b6a3f8161 doc/_ext: extract confval into an extension
better readability this way

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-15 00:37:45 +08:00
Kefu Chai 754bd73d2b doc: add a new directive "confval"
* so we can define configuration in a more structured way
* so the confvals can be cross referenced

see also https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_object_type

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-28 23:28:31 +08:00
Kefu Chai 14c9572eb2 doc/_theme: customize sphinx_rtd_theme
* move the breadcrumbs to the top
* add border around admonition elements
* use different colors and fonts for section headers
* add decoration lines at the bottom of breadcrumbs
* remove left and right borders in tables
* override the injected versions, the name of theme
  is different from "sphinx_rtd_theme", but the
  versions element is still displayed at the
  bottom-left corner as "versions.html" defines.
  without overriding .rst-badge CSS styling,
  readthedocs puts the injected versions at
  the default bottom-right corner, see
  2a519f1146/readthedocs/api/v2/templates/restapi/footer.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-05 09:59:16 +08:00
Kefu Chai 275c6bd1b7 doc: switch to sphinx_rtd_theme
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-04 19:00:47 +08:00
Kefu Chai 96be45744e doc: silence warnings from openapi sphinx extension
this is a follow-up of 1debd98565,
we should use the logging from sphinx.util instead from Python standard
library's logging.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-02-13 10:18:58 +08:00
Kefu Chai 5d3a918496 doc: drop ceph.js completely
these are leftovers of 7a62303b57

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-02-13 10:18:58 +08:00
Kefu Chai 1debd98565 doc: silence warnings from openapi sphinx extension
it prints out

skipping non-JSON example generation.

if an API does not contains example while ":example:" is specified for
openapi extension, and if this API is not a GET request, openapi
extention complains.

see also
9dbae9c9a6/sphinxcontrib/openapi/openapi30.py (L191)

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-02-01 17:57:57 +08:00
Kefu Chai 202b805aaf doc: build mon_command_api.rst using a homebrew extension
so we can build the command doc using ReadTheDoc infra, without adding
the generated rst file to the source repo.

before this change, all the commands are ordered alphabetically. after
this change, command docs are generated by two directives, and are
ordered separately. we could restructure the directives and merge them.

but let's leave it for a future change if this is important.

for more details on writing sphinx directives, see
https://www.sphinx-doc.org/en/master/extdev/markupapi.html and
https://docutils.sourceforge.io/docs/howto/rst-directives.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-08 11:35:42 +08:00
Kefu Chai 670efdd3c7 doc: build api docs with Read the Docs
since we are able to build the python bindings using the stub
implementation of C binding, let's enable the API docs build.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-05 22:09:22 +08:00
Kefu Chai 7a62303b57 doc: check "release" context variable for #dev-warning
if $release is "dev", then the release being built is not a stable
version.

drop ceph.js, as the web page is generated at build time.

since the last user of "releases.json" is gone, now we can
drop the hooks preparing "releases.json" in conf.py as well.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-02 00:25:16 +08:00
Kefu Chai 7edd8dd0d0 doc: add docubetter link back
check if the release being built is EOL when building the document, so
no need to use javascript to read releases.json anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-02 00:25:16 +08:00
Kefu Chai 94488f911a doc/conf: find the latest stable release in releases.yml
instead of hardwiring the "|stable-release|" to "octopus" use the latest
release name found in 'doc/releases/releases.yml'

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-01 15:41:45 +08:00
Kefu Chai beb218c41d doc/conf: read version and release from src/ceph_release
instead of hardwiring them to 'dev' and 'dev', use the src/ceph_release
as the source of truth.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-01 15:41:45 +08:00
Kefu Chai be26c566e5 doc: remove edit_on_github sphinx extension
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-01 15:41:45 +08:00
Kefu Chai b1c4a821b6 doc/conf: generate releases.json in conf.py
pave the road to build all the ingredients of the document using RTD
facility.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-20 12:59:22 +08:00
Kefu Chai e5c949dbe9 doc/conf: re-group configurations
for better readability.

see also https://www.sphinx-doc.org/en/master/usage/configuration.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-20 12:59:22 +08:00
Kefu Chai c2151a3843 doc/conf: wrap lines over 79 chars
to be compliant with PEP8, see
https://www.python.org/dev/peps/pep-0008/#id19

also silences flake8 warning of

E501 line too long

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-20 12:59:22 +08:00
Kefu Chai 06d0bbc94a doc/conf: add blank lines before class/func definitions
this change silences flake8 warnings like:

expected 2 blank lines after class or function definition, found 1
[E305]

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-20 12:59:22 +08:00
Kefu Chai 664547a665 doc/conf: disable "undefined name" warning from flake8
"tags" is exposed by sphinx, so we will have access to this variable
when sphinx imports this file. this silences the warning from flake8:

undefined name 'tags' [F821]

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-20 12:59:22 +08:00
Kefu Chai f3f0b3027e doc/conf: drop "u" prefix from string literals
since we've migrated to python3, there is no need to add "u" prefix
anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-20 12:59:22 +08:00
Kefu Chai 3c0bc49875 doc: pass graphviz options in conf.py
easier to maintain the options of sphinx extensions in a single place.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-19 17:00:29 +08:00
Kefu Chai cc5864234e doc: generate peering graph in conf.py
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-19 17:00:29 +08:00
Courtney Caldwell ca2261781e
mgr/dashboard/api: generate offline API docs
Generate Sphinx documentation from OpenAPI YAML spec:
- Fixed Docs controller doc generation
- Now dashboard Python doesn't fails if dashboard/frontend/dist doesn't exist
- OpenAPI added to @ceph/api CODEOWNERS
- Renamed Ceph-Dashboard API to Ceph REST or RESTful API.
- OpenAPI Docs: fixed decorators and docstrings.
- Sphinx Docs: updated dashboard and dev ones.

Co-authored-by: Ernesto Puerta <epuertat@redhat.com>
Fixes: https://tracker.ceph.com/issues/45863
Signed-off-by: Courtney Caldwell <ccaldwel@redhat.com>
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
2020-09-28 12:03:03 +02:00
Kefu Chai 253fd22896 doc: add sphinx.ext.mathjax for math-to-MathML rendering
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-09-01 09:53:18 +08:00
Kefu Chai 7ca85e77d0 doc: replace luminous with |stable-release|
"luminous" is a magic number in these contexts, and we should use a
constant for representing it.

the "sphinx_substitution_extensions" sphinx extension is introduced for
performing the global subsitution.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-09-01 09:53:17 +08:00
Kefu Chai cf357e17ab doc/conf.py: define CEPH_RADOS_API for breathe
otherwise we could have following errors:

Invalid C declaration: Expected identifier in nested name, got keyword: int [error at 18]
      CEPH_RADOS_API int rados_aio_append (rados_ioctx_t io, const char *oid, rados_completion_t completion, const char *buf, size_t len)
      ------------------^

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-08-28 20:35:21 +08:00
Kefu Chai 1704216628 doc/conf.py: s/add_javascript/add_js_file/
to address following warning:

jenkins-build/build/workspace/ceph-pr-docs/doc/conf.py:102: RemovedInSphinx40Warning: The app.add_javascript() is deprecated. Please use app.add_js_file() instead.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-06-22 10:37:57 +08:00
Kefu Chai 8bd8a8badb doc: add in-doc search from read the docs
readthedocs-sphinx-search features better user experience than the
builtin search offered by sphinx

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-10 08:38:06 +08:00
Kefu Chai 0cb56e0f13 doc: use plantweb as fallback of sphinx-ditaa
RTD does not support installing system packages, the only ways to install
dependencies are setuptools and pip. while ditaa is a tool written in
Java. so we need to find a native python tool allowing us to render ditaa
images. plantweb is able to the web service for rendering the ditaa
diagram. so let's use it as a fallback if "ditaa" is not around.

also start a new line after the directive, otherwise planweb server will
return 500 at seeing the diagram.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-10 08:38:06 +08:00
Kefu Chai 847e4ef941 doc/conf.py: exclude pybindings docs from build for RTD
because it'd difficult to prepare (dummy) librados,libcephfs and librbd for
their python bindings in the building environment offered by Read the Docs.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-09 22:47:56 +08:00
Kefu Chai e2e9de8b4d doc: overide the default margin for "ul.simple > li"
by default, the user agent's css sets `margin-block-end` of "ul ul" to
"0", which renders the unordered lists in release notes cluttered. as we
are using nested unordered list to present the changes in different
components.

in this change a customized css is added to reset the begin and end
margin of ul to 1em, which is the default value of top level ul.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-03-13 20:16:18 +08:00
Sebastian Wagner 30d415974c doc: Add sphinx_autodoc_typehints extension
`mgr/orchestrator_modules.rst` makes heavy use type hints.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-02-27 13:16:00 +01:00
Jason Dillaman 26e7cad290 Revert "doc: do not add suffix for search result links"
This reverts commit 88d6d499e0.

All doc builds are currently broken due to this change since
the HTML files are written without the necessary ".html"
extension.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2020-02-26 15:18:24 -05:00
Sebastian Wagner aad35bacc0 doc: move bootstrap.rst to cephadm
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-02-26 12:29:37 +01:00
Kefu Chai 88d6d499e0 doc: do not add suffix for search result links
since sphinx 1.5, SOURCELINK_SUFFIX is always added to the source file,
and search page always tries to add it to the highlighted source result.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-02-20 14:44:11 +08:00
Brad Hubbard f3f78ad52b doc: Change copyright attribution to ceph authors
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
2019-12-21 07:57:27 +10:00