Commit Graph

73 Commits

Author SHA1 Message Date
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
Sage Weil
8b20bb016d doc/foundation: add ceph foundation info here
Signed-off-by: Sage Weil <sage@redhat.com>
2019-12-03 10:45:45 -06:00
Sage Weil
3b228a45a4 doc/bootstrap: add new bootstrap documentation
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-05 14:28:50 -05:00
Sebastian Wagner
c4625d86c4 python-common: Reference it in the docs
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2019-07-26 12:00:33 +02:00
Ernesto Puerta
ae8e288769
doc: mgr/dashboard: feature-toggles: Fix config
Add '*.inc.rst' to the list of excluded patterns from sphinx-build. This
allows for using '*.inc.rst' as includes, and avoids duplicates. The
benefit of keeping the trailing '.rst' extension is that most IDEs use
that to render reStructured Text files.

Fixes: http://tracker.ceph.com/issues/37530
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
2019-02-11 12:07:55 +01:00
Noah Watkins
bb887b78f8 doc: show edit on github links and version warnings
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2018-11-02 14:49:15 -07:00
Sage Weil
2a0d6ddbc0 doc/conf.py: fix man page build vs governance.rst
Signed-off-by: Sage Weil <sage@redhat.com>
2018-06-05 16:18:36 -05:00
Nathan Cutler
820dac980e
Merge pull request #20876 from smithfarm/wip-doc-license
legal: remove doc license ambiguity

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
Reviewed-by: Ken Dreyer <kdreyer@redhat.com>
2018-03-19 14:29:54 +01:00
Nathan Cutler
e294dd5910 legal: remove doc license ambiguity
The license applicable to the files under doc/ was originally declared (in the
top-level file COPYING) to be "Creative Commons Attribution-ShareAlike (CC
BY-SA)" by ed0653b493

This license declaration omitted a version number.

Some time later ef7418421b was merged, mentioning
CC-BY-SA-1.0 as one of the Ceph source code licenses. Although the purpose of that
commit was only to summarize the canonical license information from COPYING, it
unintentionally became the only place in the source code where the doc license
version was specified.

In March 2018, the Debian project warned that CC-BY-SA-1.0 does not meet its
criteria for inclusion in the "free" section of the Debian distribution. (For
that, at least version 3.0 must be used.)

This new commit removes the doc license ambiguity by setting it to CC-BY-SA-3.0
in all places where the license is mentioned.

The exact spelling of the license name is taken from https://spdx.org/licenses/

Fixes: http://tracker.ceph.com/issues/23336
Signed-off-by: Nathan Cutler <ncutler@suse.com>
2018-03-13 18:59:02 +01:00
Abhishek Lekshmanan
d9a42eb42a doc: add releases to conf.py
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
2018-03-07 23:50:28 +01:00
Kefu Chai
220e038dc5 doc/mgr: document mgr/plugin using automethod
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-02 14:34:13 +08:00
Kefu Chai
fda079d5ed doc: switch to upstream sphinx-ditaa
it works with setuptools and is now compatible with py3

the py3 branch is created to track the upstream's master branch

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-09-11 23:05:26 +08:00
Kefu Chai
335205bafa doc/conf.py: do not set html_use_smartypants explicitly
because it's deprecated, and is on by default in the specified sphinx
version (v1.6.3):

this change silences following warning:

build-doc/virtualenv/local/lib/python2.7/site-packages/sphinx/environment/__init__.py:683:
RemovedInSphinx17Warning: html_use_smartypants option is deprecated.
Smart quotes are on by default; if you want to disable or customize
them, use the smart_quotes option in docutils.conf.
  RemovedInSphinx17Warning)

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-08-22 11:24:13 +08:00
Alfredo Deza
9ca04aa852 doc ignore ceph-volume when building man pages
Signed-off-by: Alfredo Deza <adeza@redhat.com>
2017-08-21 11:44:54 -04:00
Alfredo Deza
f78a991f59 doc exclude man_index when not building man pages
Signed-off-by: Alfredo Deza <adeza@redhat.com>
2017-08-16 08:20:02 -04:00
Alfredo Deza
8e06659c34 doc: exclude mgr from man pages, define a man index.rst
Signed-off-by: Alfredo Deza <adeza@redhat.com>
2017-08-16 08:20:01 -04:00
Patrick McGarry
87c579cebe Merge remote-tracking branch 'origin/master' 2016-08-01 15:59:08 -04:00
Kefu Chai
65de919ec3 doc: add breathe_domain_by_extension to conf.py
so it can render the doxygen generated objects with the proper domain by
checking the extension of rendered source file.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-05-31 18:34:32 +08:00
Kefu Chai
0e00d2f21b doc,cmake: do not scan non-man pages when building man pages
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-05-24 12:58:43 +08:00