Commit graph

299 commits

Author SHA1 Message Date
Jon Siwek
b8f6c5bc7d Improving documention for the Bro script document-generation process
Some minor organizational revisions to the python scripting.
2011-04-06 16:39:50 -05:00
Jon Siwek
f3b1a6bb9e Implementing capability to logically group generated policy script docs 2011-04-06 14:38:35 -05:00
Jon Siwek
e4e7a26ba1 Add :download: role to reST docs for linking to original script source files.
This role allows Sphinx to copy non-reST files in the source tree into
the output tree.
2011-04-06 12:12:21 -05:00
Jon Siwek
7593d4d368 Don't warn about generating reST script documentation for stdin 2011-04-06 12:08:23 -05:00
Jon Siwek
5183ab409b Initial implementation of a make doc target to generate script docs. 2011-04-06 12:06:39 -05:00
Jon Siwek
bd523f2905 Automatic reST doc markup for event/function params/return comments
For a bro script that is documented like:

  ## ...
  ## bar: ...
  ## Returns: ...
  global foo(bar: string): string;

the generated reST documentation will automatically substitute meaningful
markup (reST field lists) for the parameter and return type comments
2011-04-04 12:29:48 -05:00
Jon Siwek
758172120b Revising format of initialization values in generated script docs.
Fixed the obvious things: reduced the space taken up by empty tables
and allowed record values to span multiple lines (one for each record field).
2011-04-01 15:21:15 -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
cf45ae19e1 Generated script docs can now link to the original source.
The original bro source file needs to be copied to the same directory
that Sphinx outputs the rendered html.
2011-03-30 10:24:44 -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
94ac3f3c23 Revise the way "port analysis" and "packet filter" documentation is generated.
They now appear at the bottom of generated docs.

Also, a "more info" link is added which can point to an arbitrary location
in any reST document processed by Sphinx.
2011-03-29 14:19:33 -05:00
Jon Siwek
a9810d21a9 Generated docs now have xref links for attribute values that are enums. 2011-03-29 12:10:08 -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
037a6906af Canonicalize "##" and "## " stylized comments, revise record/enum documentation tracking
The documentation framework now sees "##Text" and "## Text" as
equivalent documentation comments.  This prevents unintentional
indentation in the generated reST as a result of the later style, but
still allows embedded reST markup that relies on indentation of more
than two spaces to work as expected.

Comments associated with record fields and enums values are able
to span multiple "##"-stylized comments, allowing for more robust
reST markup to be embedded.

The documentation framework now tracks record fields through
a new CommentedTypeDecl subclass of TypeDecl that the parser constructs
in parallel with the real TypeDecl.
2011-03-23 16:08:18 -05:00
Jon Siwek
bbe7c98ab3 Major reformatting of auto-generated reST documentation.
Introduces reST directives and roles in a "bro" domain that Sphinx
will be taught to recognize.
2011-03-22 16:05:59 -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
5fbcde7344 Teach Desc class how to (optionally) use spaces for indentation.
And (to be consistent with current conventions for reST documentation)
update places in the auto-documentation-generation framework
where tabs were used in the generated reST.
2011-03-21 13:49:53 -05:00
Jon Siwek
e491caeeb7 Add note to auto-generated reST about not editing it directly 2011-03-21 12:49:54 -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
b1dc5d3a1c Update to auto-generated documentation format.
Comments are now clearly marked.

Enums are now documented in order of their integral value, not
their identifier string.
2011-03-14 14:49:58 -05:00
Jon Siwek
f47c8e4d93 Changes to parser to allow enum type documentation comments.
"##" style comments before identifiers and "##<" style after identifiers
in the body of an enum type declaration will now show up in the
auto-generated reST documentation.
2011-03-14 14:13:52 -05:00
Jon Siwek
c4ca6f098c Changes to scanner and parser to allow record field comments.
The scanner can now be told to start/stop producing new token types that
assist in documenting record field types (and eventually enums also).

TOK_DOC:
    Produced on "##" style comments; documents the field that follows.

TOK_POST_DOC:
    Produced on "##<" style comments; documents the previous field.
2011-03-14 13:10:49 -05:00
Jon Siwek
4b0eb8127d Changes to add comments per enum or record type field. 2011-03-14 11:50:46 -05:00
Jon Siwek
15fd5297a3 Fixes for declared type ID tracking & adding DescribeReST()'s
Changed BroType to track a char* instead of an ID* that represents
the declared type's identifier.  It was also necessary to serialize
this information or else it can be lost (e.g. FieldDecl's in RecordType
always seem to get serialized at some point).

DescribeReST() functions added to many classes to get the output
closer to being reST compatible; still needs tweaking for Sphinx
(reST->HTML) compatibility.
2011-03-10 16:22:45 -06:00
Jon Siwek
287a3a3cb8 Changes to parser to pass along identifiers to doc framework. 2011-03-09 15:47:58 -06:00
Jon Siwek
1310f2387c Changing BroDocObj wrapper class to wrap ID instead of BroObj. 2011-03-09 15:10:05 -06:00
Jon Siwek
1c962cbb89 Changes to make declared types track their identifier.
Only occurs when in documentation mode.
2011-03-09 14:53:22 -06: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
27996cf9e0 Merge branch 'master' into topic/jsiwek/doc-framework 2011-03-05 13:59:18 -06:00
Robin Sommer
c94b13ad39 Merge remote branch 'origin/fastpath'
* origin/fastpath:
  Add alternative way to set BROPATH for running bro from build/ dir.
2011-03-02 13:46:33 -08:00
Jon Siwek
f7d031ed60 Merge remote-tracking branch 'origin/master' into topic/jsiwek/doc-framework 2011-03-02 14:54:06 -06:00
Jon Siwek
abd92115f4 Add alternative way to set BROPATH for running bro from build/ dir.
Adds two extra shell scripts, one to handle either the c-shell
or bourne-shell syntax for setting environment variables, that can
be sourced in order to set the BROPATH directly in the current
shell/environment in a way that's compatible with running bro
from the build/ directory.
2011-03-02 14:14:07 -06:00
Jon Siwek
0b0c3f6ede Merge branch 'master' into fastpath 2011-03-02 12:55:17 -06:00
Robin Sommer
e5d3654266 Updating submodule(s). 2011-02-28 15:39:24 -08:00
Robin Sommer
a770d80f6b Merge remote branch 'origin/fastpath'
* origin/fastpath:
  Fixing compiler warnings
  Revert "Updating submodule to current master"
  Remvoing leftover local variables that caused compile error on Mac OS X.
  Updating submodule to current master
2011-02-28 15:38:29 -08:00
Gregor Maier
fc6fcded07 Fixing compiler warnings 2011-02-25 21:15:22 -08:00
Gregor Maier
c54c1e0dce Revert "Updating submodule to current master"
This reverts commit 8b42bfed7c.
Master seems to have outdated submodules. Reverting to previous ones on
fastpath.
2011-02-25 21:11:06 -08:00
Gregor Maier
7d822e232d Remvoing leftover local variables that caused compile error on Mac OS X. 2011-02-25 21:09:55 -08:00
Gregor Maier
b6fd317dcc Merge remote branch 'origin/master' into fastpath 2011-02-25 20:44:05 -08:00
Gregor Maier
8b42bfed7c Updating submodule to current master 2011-02-25 20:43:53 -08:00
Robin Sommer
ff740f153c Fixing file detector leak in remote communication module.
This addresses #400.
2011-02-25 17:04:29 -08:00
Robin Sommer
2a82e0bd9b Updating indenpdentn state tests to work with new setyp.
Note that the broccoli test does currently not pass because of the
64-bit changes.
2011-02-25 17:01:11 -08:00