mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Major reformatting of auto-generated reST documentation.
Introduces reST directives and roles in a "bro" domain that Sphinx will be taught to recognize.
This commit is contained in:
parent
384fa03c26
commit
bbe7c98ab3
11 changed files with 132 additions and 45 deletions
34
src/ID.cc
34
src/ID.cc
|
@ -607,39 +607,57 @@ void ID::DescribeExtended(ODesc* d) const
|
|||
}
|
||||
}
|
||||
|
||||
void ID::DescribeReST(ODesc* d) const
|
||||
void ID::DescribeReST(ODesc* d, bool is_role) const
|
||||
{
|
||||
d->Add(".. bro:id:: ");
|
||||
d->Add(name);
|
||||
if ( is_role )
|
||||
{
|
||||
if ( is_type )
|
||||
d->Add(":bro:type:`");
|
||||
else
|
||||
d->Add(":bro:id:`");
|
||||
d->Add(name);
|
||||
d->Add("`");
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( is_type )
|
||||
d->Add(".. bro:type:: ");
|
||||
else
|
||||
d->Add(".. bro:id:: ");
|
||||
d->Add(name);
|
||||
}
|
||||
d->PushIndent();
|
||||
d->NL();
|
||||
|
||||
if ( type )
|
||||
{
|
||||
d->Add(".. bro:type:: ");
|
||||
d->Add(":Type: ");
|
||||
if ( ! is_type && type->GetTypeID() )
|
||||
{
|
||||
d->Add("`");
|
||||
d->Add(":bro:type:`");
|
||||
d->Add(type->GetTypeID());
|
||||
d->Add("`");
|
||||
}
|
||||
else
|
||||
type->DescribeReST(d);
|
||||
d->NL();
|
||||
}
|
||||
|
||||
if ( attrs )
|
||||
{
|
||||
d->Add(":Attributes: ");
|
||||
attrs->DescribeReST(d);
|
||||
d->NL();
|
||||
}
|
||||
|
||||
if ( val && type &&
|
||||
type->InternalType() != TYPE_INTERNAL_OTHER &&
|
||||
type->InternalType() != TYPE_INTERNAL_VOID )
|
||||
{
|
||||
d->NL();
|
||||
d->Add(".. bro:val:: ");
|
||||
d->Add(":Init: ");
|
||||
val->DescribeReST(d);
|
||||
d->NL();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue