Commit graph

23 commits

Author SHA1 Message Date
Jon Siwek
95ed192088 More tweaks to generated script docs.
- The "private interface" section is still tracked, but no longer rendered.
  We can judge the usefulness of it later and add back if there's demand.

- Documentation of event handlers was being treated the same as event
  declarations.  Now handlers are tracked separately, but not currently
  rendered in the generated doc output since usefulness is questionable.
2011-09-07 11:33:08 -05:00
Jon Siwek
4ac6d0ae2e Fixes for script auto-documentation.
- Fixing the parts of the `make restdoc` and `make doc` process that were
  broken by the last Bro script re-organization

- Generated documentation for Bro scripts derived from BiFs now use the
  original BiF source file as the "original source file" link

- Renaming of the internal POLICYDEST definition and other misc places that
  refer to "policy" scripts; that terminology doesn't make total sense now

- Added a documentation blacklist reminder test that will fail if there's
  scripts that are blacklisted from being documentated because they're still
  in progress

- Some minor Bro script changes to fix small @load dependency errors

Addresses #543
2011-08-08 19:50:45 -05:00
Robin Sommer
e87e2ad96e Merge remote branch 'remotes/origin/topic/policy-scripts-new'
* remotes/origin/topic/policy-scripts-new:
  Add RPC/SSL scripts to doc generation target.
  Update the generated script doc organization.
  Changing back the last commit.  It made things worse.
  Trying a different method of record parsing for SSL analyzer.
  Moved the RPC script into the right place.
  More SSL script cleanup.
  Fixed a segfault from empty strings in the SSL analyzer.
  Removing what I believe is the last stray print statement from the SSL analyzer.
  Fixed more eternal looping bugs in the SSL analyzer.
  Updates and fixes for the SSL analyzer.
  Changes to make generated script docs understand new policy/ hierarchy.
2011-06-30 16:43:21 -07:00
Jon Siwek
fe5f4b8e53 Changes to make generated script docs understand new policy/ hierarchy.
Added an arg to the search_for_files() util function that can return
the subpath of BROPATH's policy/ dir in which the loaded file is found.
This subpath is then used in both the the reST file's document title
(so that script's named e.g. "base.bro" actually have some context) and
in figuring out how to interlink with other generated docs of other
scripts that are found in @load directives.

I still need to overhaul things so the loading of "packages" is
documented in a meaningful way and that the CMake targets are able
to generate indexes for packages.
2011-06-30 11:37:15 -05:00
Robin Sommer
a5e13b184d Merge remote branch 'remotes/origin/topic/policy-scripts-new'
* remotes/origin/topic/policy-scripts-new: (264 commits)
  Update core.vlan-mpls baseline.
  Update core.conn-uid test/baseline.
  Fixing tests / updating baselines.
  Renaming a poorly named notice.
  Resolving a conflict in scan.l.
  Notice framework updates.
  Fixed bug I just introduced to known-services.
  Known services now only logs for "normal" connections.
  Fix the name of the DPD log.
  Updating the netstats script to match the new internal code.
  Removed expected_connection_timeout variable.
  New default notice actions for emailing network admins.
  New default notice action for emailing network admins.
  weird.bro moved into notice framework.
  Removed a redundant and out of place mozilla CA list.
  Renamed the stream for the notice log.
  Small consistency tweaks for the communications framework.
  Finishing the inactivity script.
  Intel framework test passes now.
  Reorganized some of the tests for consistency.
  ...
2011-06-29 21:48:19 -07:00
Jon Siwek
56a946568a More changes to how Bro generates docs for scripts in subdirs of BROPATH
The output reST filename now reflects the subdir information (by flattening
'/' path separators into the '^' character).  This is to prevent file name
conflicts when generated reST docs, but during the CMake 'doc' target to
build HTML docs, everything gets unflattened.
2011-05-16 20:17:58 -05:00
Robin Sommer
e7bde27f2d Merge remote branch 'origin/topic/jsiwek/doc-framework' 2011-04-18 14:54:23 -07:00
Jon Siwek
057ad684d8 Add brief descriptions for classes involved in generation of script docs. 2011-04-08 12:30:06 -05:00
Jon Siwek
2d17ca0942 Generated script docs now have a new summary section.
It's a table listing all the identifiers in the script's public interface
and an optional, brief (one-sentence) description of each.
2011-04-01 12:30:22 -05:00
Jon Siwek
090ce2d03c Fix generated script docs displaying functions twice.
A function prototype can be declared separately from where it's defined;
the doc framework should now recognize them as the same and combine
reST documentation associated with either case if both are present.
2011-03-29 16:54:16 -05:00
Jon Siwek
60a7dc6f55 Autodoc framework now tracks script constants
Also, it's starting to attempt to describe more complex types
of initial values.
2011-03-24 16:56:25 -05:00
Jon Siwek
2490878656 Another revision for autodoc tracking of public vs private interfaces
A script's public API wasn't simply definable as identifiers
for which ID::IsGlobal() is true, e.g. an unexported identifier with
SCOPE_MODULE will still pass that test and (incorrectly) be considered
public API.

Also, generated reST now omits empty interface sections.
2011-03-24 14:04:30 -05:00
Jon Siwek
2e88c5100c Revise autodoc tracking of public vs private script interfaces
A bro script's public interface is taken to mean any identifier declared
in the global scope that optionally is exported from some namespace/module.
Or more simply: ID::IsGlobal()
2011-03-24 12:32:32 -05:00
Jon Siwek
c2f0332b5f Removing lexical scanner recognition of "## Author:" comments.
This functionality is better done manually by the script writer
embedding reST into the script summary section (##! comments).
This allows flexibility in choosing between different methods
to convey the same information (e.g. ":Author: <author>" or
the ".. codeauthor:: <author>" directive that Sphinx
configurations can recognize).
2011-03-24 09:51:47 -05:00
Jon Siwek
8b79971e21 Fix auto-generated reST :doc: references to strip .bro file suffixes.
It's allowed for a script to "@load example.bro", but Sphinx doesn't want
that file extension for the purposes of generating cross-referencing links
to other documentation.
2011-03-23 16:59:41 -05:00
Jon Siwek
384fa03c26 Revising notice, port analysis, packet filter, auto-generated documentation.
They're now all optional sections -- if a given bro script doesn't use the
functionality, then the documentation doesn't mention anything about it.
2011-03-21 15:08:39 -05:00
Jon Siwek
e0a77cb794 Auto-doc framework now handles multiple script authors more conveniently. 2011-03-21 14:03:11 -05:00
Jon Siwek
9e13d15f29 Tabifying BroDoc* sources to make consistent with general style. 2011-03-15 16:48:51 -05:00
Jon Siwek
dbf2b9996e Revising BroDoc*.h internal/api documentation. 2011-03-15 15:38:43 -05:00
Jon Siwek
f67c0892e5 Revise enum documentation autogeneration.
This adds a new subclass of EnumType, CommentedEnumType, and removes
any previous changes to EnumType that were done to support the
autodoc framework.

Dummy CommentedEnumType and ID's are constructed in parallel with the
real EnumType ID's during parsing and passed on to the autodoc framework.

This allows the generated documentation to track enum redefs, with
a special case being the "Notice" enum type.
2011-03-15 14:51:50 -05:00
Jon Siwek
1bad6e3a95 Changes to auto-document dpd_config (port analysis) script settings. 2011-03-05 16:11:26 -06:00
Jon Siwek
0d7ffe998f Debugging output from doc-framework now only in debug mode.
Also a minor format fix for documenting empty string lists.
2011-03-05 14:22:06 -06:00
Jon Siwek
30209b56bb Bro script documentation framework checkpoint
* New bro runtime options: -Z or --doc-scripts enables documentation mode
* New BroDoc, BroBifDoc, and BroDocObj interfaces to support script
  documentation
* Modifications to the bro scanner (scan.l) to get it to keep track of
  which script is being scanned/parsed and which document is being generated
* Modifications to scan.l and the bro parser (parse.y) to produce/consume
  script comments denoted with "##"
* Documentation is currently generated for the following
** Script author
** Script summary
** @load's
** capture_filters
** modules (namespaces)

Most of the remaining framework/infrastructure work should be in extracting
the interesting BroObj objects as the parser sees them and better formatting
the reST documents.
2011-02-25 15:30:18 -06:00