2011-12-14 18:47:38 +00:00
|
|
|
==================
|
|
|
|
Documenting Ceph
|
|
|
|
==================
|
|
|
|
|
2017-07-18 13:47:06 +00:00
|
|
|
User documentation
|
|
|
|
==================
|
|
|
|
|
|
|
|
The documentation on docs.ceph.com is generated from the restructuredText
|
|
|
|
sources in ``/doc/`` in the Ceph git repository.
|
|
|
|
|
|
|
|
Please make sure that your changes are written in a way that is intended
|
|
|
|
for end users of the software, unless you are making additions in
|
|
|
|
``/doc/dev/``, which is the section for developers.
|
|
|
|
|
|
|
|
All pull requests that modify user-facing functionality must
|
|
|
|
include corresponding updates to documentation: see
|
|
|
|
`Submitting Patches`_ for more detail.
|
|
|
|
|
|
|
|
Check your .rst syntax is working as expected by using the "View"
|
|
|
|
button in the github user interface when looking at a diff on
|
|
|
|
an .rst file, or build the docs locally using the ``admin/build-doc``
|
|
|
|
script.
|
|
|
|
|
|
|
|
For more information about the Ceph documentation, see
|
|
|
|
:doc:`/start/documenting-ceph`.
|
|
|
|
|
2011-12-29 23:57:33 +00:00
|
|
|
Code Documentation
|
|
|
|
==================
|
|
|
|
|
|
|
|
C and C++ can be documented with Doxygen_, using the subset of Doxygen
|
2015-03-18 03:52:18 +00:00
|
|
|
markup supported by Breathe_.
|
2011-12-29 23:57:33 +00:00
|
|
|
|
2019-01-04 21:32:21 +00:00
|
|
|
.. _Doxygen: http://www.doxygen.nl/
|
2015-03-18 03:52:18 +00:00
|
|
|
.. _Breathe: https://github.com/michaeljones/breathe
|
2011-12-29 23:57:33 +00:00
|
|
|
|
|
|
|
The general format for function documentation is::
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Short description
|
|
|
|
*
|
|
|
|
* Detailed description when necessary
|
|
|
|
*
|
|
|
|
* preconditons, postconditions, warnings, bugs or other notes
|
|
|
|
*
|
|
|
|
* parameter reference
|
|
|
|
* return value (if non-void)
|
|
|
|
*/
|
|
|
|
|
|
|
|
This should be in the header where the function is declared, and
|
|
|
|
functions should be grouped into logical categories. The `librados C
|
|
|
|
API`_ provides a complete example. It is pulled into Sphinx by
|
2012-11-14 22:57:51 +00:00
|
|
|
`librados.rst`_, which is rendered at :doc:`/rados/api/librados`.
|
2011-12-29 23:57:33 +00:00
|
|
|
|
2020-10-08 13:58:14 +00:00
|
|
|
To generate the doxygen documentation in HTML format use:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
# make doxygen
|
|
|
|
|
|
|
|
HTML output will be under: ``build-doc/doxygen/html``
|
|
|
|
|
2012-03-02 19:00:08 +00:00
|
|
|
.. _`librados C API`: https://github.com/ceph/ceph/blob/master/src/include/rados/librados.h
|
2017-05-22 11:56:33 +00:00
|
|
|
.. _`librados.rst`: https://github.com/ceph/ceph/raw/master/doc/rados/api/librados.rst
|
2011-12-29 23:57:33 +00:00
|
|
|
|
2011-12-14 18:47:38 +00:00
|
|
|
Drawing diagrams
|
|
|
|
================
|
|
|
|
|
|
|
|
Graphviz
|
|
|
|
--------
|
|
|
|
|
|
|
|
You can use Graphviz_, as explained in the `Graphviz extension documentation`_.
|
|
|
|
|
|
|
|
.. _Graphviz: http://graphviz.org/
|
2019-12-05 03:03:43 +00:00
|
|
|
.. _`Graphviz extension documentation`: https://www.sphinx-doc.org/en/master/usage/extensions/graphviz.html
|
2011-12-14 18:47:38 +00:00
|
|
|
|
|
|
|
.. graphviz::
|
|
|
|
|
|
|
|
digraph "example" {
|
|
|
|
foo -> bar;
|
|
|
|
bar -> baz;
|
2017-07-18 13:47:06 +00:00
|
|
|
bar -> th
|
2011-12-14 18:47:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Most of the time, you'll want to put the actual DOT source in a
|
|
|
|
separate file, like this::
|
|
|
|
|
|
|
|
.. graphviz:: myfile.dot
|
|
|
|
|
|
|
|
|
|
|
|
Ditaa
|
|
|
|
-----
|
|
|
|
|
|
|
|
You can use Ditaa_:
|
|
|
|
|
|
|
|
.. _Ditaa: http://ditaa.sourceforge.net/
|
|
|
|
|
|
|
|
.. ditaa::
|
|
|
|
|
|
|
|
+--------------+ /=----\
|
|
|
|
| hello, world |-->| hi! |
|
|
|
|
+--------------+ \-----/
|
|
|
|
|
|
|
|
|
|
|
|
Blockdiag
|
|
|
|
---------
|
|
|
|
|
|
|
|
If a use arises, we can integrate Blockdiag_. It is a Graphviz-style
|
|
|
|
declarative language for drawing things, and includes:
|
|
|
|
|
|
|
|
- `block diagrams`_: boxes and arrows (automatic layout, as opposed to
|
|
|
|
Ditaa_)
|
|
|
|
- `sequence diagrams`_: timelines and messages between them
|
|
|
|
- `activity diagrams`_: subsystems and activities in them
|
|
|
|
- `network diagrams`_: hosts, LANs, IP addresses etc (with `Cisco
|
|
|
|
icons`_ if wanted)
|
|
|
|
|
2018-06-01 08:05:16 +00:00
|
|
|
.. _Blockdiag: http://blockdiag.com/en/
|
|
|
|
.. _`Cisco icons`: https://pypi.org/project/blockdiagcontrib-cisco/
|
2011-12-14 18:47:38 +00:00
|
|
|
.. _`block diagrams`: http://blockdiag.com/en/blockdiag/
|
|
|
|
.. _`sequence diagrams`: http://blockdiag.com/en/seqdiag/index.html
|
|
|
|
.. _`activity diagrams`: http://blockdiag.com/en/actdiag/index.html
|
|
|
|
.. _`network diagrams`: http://blockdiag.com/en/nwdiag/
|
2012-03-14 18:58:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
Inkscape
|
|
|
|
--------
|
|
|
|
|
|
|
|
You can use Inkscape to generate scalable vector graphics.
|
2018-06-01 08:05:16 +00:00
|
|
|
https://inkscape.org/en/ for restructedText documents.
|
2012-03-14 18:58:27 +00:00
|
|
|
|
2012-05-03 17:15:21 +00:00
|
|
|
If you generate diagrams with Inkscape, you should
|
2012-03-14 18:58:27 +00:00
|
|
|
commit both the Scalable Vector Graphics (SVG) file and export a
|
|
|
|
Portable Network Graphic (PNG) file. Reference the PNG file.
|
|
|
|
|
|
|
|
By committing the SVG file, others will be able to update the
|
|
|
|
SVG diagrams using Inkscape.
|
|
|
|
|
2012-05-03 17:15:21 +00:00
|
|
|
HTML5 will support SVG inline.
|
2017-07-18 13:47:06 +00:00
|
|
|
|
2018-08-14 03:29:41 +00:00
|
|
|
.. _`Submitting Patches`: https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst
|