ext/zeek: Add zeek:field role and directive #324
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For documenting and referencing record fields, introduce a new role and
directive. Zeek is changed to produce ReST containing
.. field:
directives instead of the definition-list style output.
Record fields can be referenced in rst as :zeek:field:
Type$field
. Thiswill produce a clickable link rendered as just
field
. The link goes tothe definition of the field within the named record type. It is also possible
to use :zeek:see:
Type$field
. In that case, the link will beType$field
instead of just
field
.Using :zeek:field:
field
without a Type is allowed as markup, but whenno link is wanted.
I hope this was worth it :-)
This changes the way records are rendered in the HTML docs slightly. Each field can now be linked individually, so I think that's a plus. There's also a bit more internal structure on the sphinx side rather than just treating fields as rst definitions in case we want to do more fancy things in the future.
The main difference is that the gray bar does not extend to the right anymore, but also that fields are now actually next to a
Fields
entry.The record's docstring comes at the end after all fields, but that's already an issue with master today and I'm out of steam staring at sphinx/docutils:
Not also how enums are rendered similarly today (just without a nice "Fields").