Blame doc/README.rst

Packit db064d
infiniband-diags ReStructured Text documentation
Packit db064d
================================================
Packit db064d
Packit db064d
Having documentation in ReStructured Text has the following benefits
Packit db064d
Packit db064d
1) The addition of common functionality (options, config files, etc.) can be
Packit db064d
   documented once and then included in documents for multiple tools.
Packit db064d
Packit db064d
   1a) Documentation source is more straight forward and writers can
Packit db064d
       concentrate on the features which are unique to each tool.
Packit db064d
Packit db064d
2) Documentation can be generated into multiple formats (man, html) not just
Packit db064d
   man pages.
Packit db064d
Packit db064d
3) Documentation for any individual tool is complete within that page.  (There
Packit db064d
   is no referencing of other documents and guessing which "common" options
Packit db064d
   apply.)
Packit db064d
Packit db064d
Packit db064d
Instructions
Packit db064d
------------
Packit db064d
Packit db064d
Place main ``rst`` files in the rst directory.  ``common include`` rst files
Packit db064d
should be in rst/common.
Packit db064d
Packit db064d
"git add" should _only_ be run on the rst source files themselves.
Packit db064d
Packit db064d
The best way to update generated documentation after changes is to [re]run
Packit db064d
configure.  autoconf will run the ``generate`` script if rst2man is available
Packit db064d
on your system.  If rst2man is not available, tarball and source rpm
Packit db064d
distributions contain the doc/man/\*.in files and can be built from those files
Packit db064d
a users system without rst2man.  Of course they will not get any changes made
Packit db064d
to the rst files.  Therefore developers are required to have rst2man[*] installed.
Packit db064d
Packit db064d
[*] rst2man is available in the python-docutils package.
Packit db064d
Packit db064d
Packit db064d
Common files
Packit db064d
------------
Packit db064d
Packit db064d
Common documents should be placed in the rst/common directory.  Common files should not be put
Packit db064d
in the 'main' rst directory.   The automated conversion script will try and
Packit db064d
make documents out of them.
Packit db064d
Packit db064d
There are 2 types of common files
Packit db064d
Packit db064d
	1) common options
Packit db064d
Packit db064d
               The common options are text which describes a common option.
Packit db064d
               The naming conventions is:
Packit db064d
Packit db064d
                        opt_<option>.rst
Packit db064d
Packit db064d
	2) common sections
Packit db064d
Packit db064d
                A common section contains a section header and documents a more
Packit db064d
                advanced feature such as a config file.  The naming convention
Packit db064d
                for the common section is:
Packit db064d
Packit db064d
                        sec_<section>.rst.
Packit db064d
Packit db064d
Packit db064d
Common documents should actually document features which are intended to be
Packit db064d
common across multiple tools.  Within the code these features are contained in
Packit db064d
ibdiag_common or a sub library such as ibnetdisc or an external library such as
Packit db064d
the node name map feature.
Packit db064d
Packit db064d
Packit db064d
Examples
Packit db064d
--------
Packit db064d
Packit db064d
The "man" page text is:
Packit db064d
Packit db064d
::
Packit db064d
        <text>
Packit db064d
Packit db064d
        .. include:: common/opt_L.rst
Packit db064d
Packit db064d
        <text>
Packit db064d
Packit db064d
        .. include:: common/sec_config-file.rst
Packit db064d
Packit db064d
Packit db064d
The common option "L" is:
Packit db064d
Packit db064d
::
Packit db064d
        .. Define the common option -L
Packit db064d
Packit db064d
        **-L**   The address specified is a LID
Packit db064d
Packit db064d
Packit db064d
And the common Section is:
Packit db064d
Packit db064d
::
Packit db064d
        .. Common text for the config file
Packit db064d
Packit db064d
        CONFIG FILE
Packit db064d
        -----------
Packit db064d
Packit db064d
        @IBDIAG_CONFIG_PATH@/ibdiag.conf
Packit db064d
Packit db064d
        A global config file is provided to set some of the common options for all
Packit db064d
        tools.  See supplied config file for details.
Packit db064d
Packit db064d