zeek/doc
2011-04-18 18:11:43 -07:00
..
scripts Improving documention for the Bro script document-generation process 2011-04-06 16:39:50 -05:00
source Implementing capability to logically group generated policy script docs 2011-04-06 14:38:35 -05:00
CMakeLists.txt Make doc build target depend on doc-clean to prevent accumulation of junk 2011-04-08 14:26:51 -05:00
conf.py.in Initial implementation of a make doc target to generate script docs. 2011-04-06 12:06:39 -05:00
example.bro Reverting test, it works now. 2011-04-18 18:11:43 -07:00
README Improving documention for the Bro script document-generation process 2011-04-06 16:39:50 -05:00

This directory contains scripts and templates that can be used to automate
the generation of Bro script documentation.  Two build targets are defined
by CMake:

``make doc``

    This target depends on a Python interpreter (>=2.5) and
    `Sphinx <http://sphinx.pocoo.org/>`_ being installed.  Sphinx can be
    installed like::

        > sudo easy_install sphinx

    This target will also first build the bro binary if it is not already
    since the generation of reStructuredText (reST) documentation from
    Bro scripts is integrated within the parsing process.

    After completion, HTML documentation can be located inside the CMake
    ``build/`` directory as ``build/doc/out/html``.  The generated reST
    documentation will be located in ``build/doc/source/policy``.

``make doc-clean``

    This target removes Sphinx inputs and outputs from the CMake ``build/`` dir.

To schedule a script to be documented, edit ``scripts/generate_reST_docs.py.in``
and try adding the name of the script along with an optional script group to
the ``docs`` dictionary.  That python script also shows other, more specialized
methods for generating documentation for some types of corner-cases.

When adding a new logical grouping for generated scripts, create a new
reST document in ``source/policy/<group_name>.rst`` and add some default
documentation.  References to (and summaries of) documents associated with
the group get appended to this file during the ``make doc`` process.

The Sphinx source tree template in ``source/`` can be modified to add more
common/general documentation, style sheets, JavaScript, etc.  The Sphinx
config file is produced from ``conf.py.in``, so that can be edited to change
various Sphinx options, like setting the default HTML rendering theme.
There is also a custom Sphinx domain implemented in ``source/ext/bro.py``
which adds some reST directives and roles that aid in generating useful
index entries and cross-references.

See ``example.bro`` for an example of how to document a Bro script such that
``make doc`` will be able to produce reST/HTML documentation for it.