mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
zeekygen: Render function parameters as :param x: instead of ❌
We're currently rendering parameter descriptions from .bif file into the .rst as follows: :cid: The connection identifier. :aid: The analyzer ID. Switch this to :param cid: instead so that we can have Sphinx deal with this as param docfield and group all parameters into a single section. Currently, having the bare :cid: style causes sphinx to treat it as an unknown field type, capitalize it and render it.
This commit is contained in:
parent
f6b28a6784
commit
2007eeae1b
4 changed files with 11 additions and 11 deletions
|
@ -70,7 +70,7 @@ bool prettify_params(string& s)
|
||||||
if ( identifier == "Returns" )
|
if ( identifier == "Returns" )
|
||||||
subst = ":returns";
|
subst = ":returns";
|
||||||
else
|
else
|
||||||
subst = ":" + identifier;
|
subst = ":param " + identifier;
|
||||||
|
|
||||||
s.replace(identifier_start_pos, identifier.size(), subst);
|
s.replace(identifier_start_pos, identifier.size(), subst);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -260,7 +260,7 @@ Events
|
||||||
link. Use the see role instead: :zeek:see:`ZeekygenExample::a_function`.
|
link. Use the see role instead: :zeek:see:`ZeekygenExample::a_function`.
|
||||||
|
|
||||||
|
|
||||||
:name: Describe the argument here.
|
:param name: Describe the argument here.
|
||||||
|
|
||||||
Functions
|
Functions
|
||||||
#########
|
#########
|
||||||
|
@ -275,11 +275,11 @@ Functions
|
||||||
empty comments is optional, but improves readability of script.
|
empty comments is optional, but improves readability of script.
|
||||||
|
|
||||||
|
|
||||||
:tag: Function arguments can be described
|
:param tag: Function arguments can be described
|
||||||
like this.
|
like this.
|
||||||
|
|
||||||
|
|
||||||
:msg: Another param.
|
:param msg: Another param.
|
||||||
|
|
||||||
|
|
||||||
:returns: Describe the return type here.
|
:returns: Describe the return type here.
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
This is a global function declaration.
|
This is a global function declaration.
|
||||||
|
|
||||||
|
|
||||||
:i: First param.
|
:param i: First param.
|
||||||
|
|
||||||
:j: Second param.
|
:param j: Second param.
|
||||||
|
|
||||||
|
|
||||||
:returns: A string.
|
:returns: A string.
|
||||||
|
@ -23,9 +23,9 @@
|
||||||
This is a record field function.
|
This is a record field function.
|
||||||
|
|
||||||
|
|
||||||
:i: First param.
|
:param i: First param.
|
||||||
|
|
||||||
:j: Second param.
|
:param j: Second param.
|
||||||
|
|
||||||
|
|
||||||
:returns: A string.
|
:returns: A string.
|
||||||
|
|
|
@ -212,11 +212,11 @@
|
||||||
empty comments is optional, but improves readability of script.
|
empty comments is optional, but improves readability of script.
|
||||||
|
|
||||||
|
|
||||||
:tag: Function arguments can be described
|
:param tag: Function arguments can be described
|
||||||
like this.
|
like this.
|
||||||
|
|
||||||
|
|
||||||
:msg: Another param.
|
:param msg: Another param.
|
||||||
|
|
||||||
|
|
||||||
:returns: Describe the return type here.
|
:returns: Describe the return type here.
|
||||||
|
@ -234,7 +234,7 @@
|
||||||
link. Use the see role instead: :zeek:see:`ZeekygenExample::a_function`.
|
link. Use the see role instead: :zeek:see:`ZeekygenExample::a_function`.
|
||||||
|
|
||||||
|
|
||||||
:name: Describe the argument here.
|
:param name: Describe the argument here.
|
||||||
|
|
||||||
.. zeek:id:: ZeekygenExample::function_without_proto
|
.. zeek:id:: ZeekygenExample::function_without_proto
|
||||||
:source-code: zeekygen/example.zeek 176 184
|
:source-code: zeekygen/example.zeek 176 184
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue