mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Teach Broxygen to generate an index of Bro notices
This commit is contained in:
parent
5227eb73c8
commit
8d8f5dd006
2 changed files with 33 additions and 3 deletions
|
@ -102,6 +102,11 @@ class BroEnum(BroGeneric):
|
||||||
#self.indexnode['entries'].append(('single', indextext,
|
#self.indexnode['entries'].append(('single', indextext,
|
||||||
# targetname, targetname))
|
# targetname, targetname))
|
||||||
m = sig.split()
|
m = sig.split()
|
||||||
|
if m[1] == "Notice::Type":
|
||||||
|
if 'notices' not in self.env.domaindata['bro']:
|
||||||
|
self.env.domaindata['bro']['notices'] = []
|
||||||
|
self.env.domaindata['bro']['notices'].append(
|
||||||
|
(m[0], self.env.docname, targetname))
|
||||||
self.indexnode['entries'].append(('single',
|
self.indexnode['entries'].append(('single',
|
||||||
"%s (enum values); %s" % (m[1], m[0]),
|
"%s (enum values); %s" % (m[1], m[0]),
|
||||||
targetname, targetname))
|
targetname, targetname))
|
||||||
|
@ -120,6 +125,26 @@ class BroAttribute(BroGeneric):
|
||||||
def get_index_text(self, objectname, name):
|
def get_index_text(self, objectname, name):
|
||||||
return _('%s (attribute)') % (name)
|
return _('%s (attribute)') % (name)
|
||||||
|
|
||||||
|
class BroNotices(Index):
|
||||||
|
"""
|
||||||
|
Index subclass to provide the Bro notices index.
|
||||||
|
"""
|
||||||
|
|
||||||
|
name = 'noticeindex'
|
||||||
|
localname = l_('Bro Notice Index')
|
||||||
|
shortname = l_('notices')
|
||||||
|
|
||||||
|
def generate(self, docnames=None):
|
||||||
|
content = {}
|
||||||
|
for n in self.domain.env.domaindata['bro']['notices']:
|
||||||
|
modname = n[0].split("::")[0]
|
||||||
|
entries = content.setdefault(modname, [])
|
||||||
|
entries.append([n[0], 0, n[1], n[2], '', '', ''])
|
||||||
|
|
||||||
|
content = sorted(content.iteritems())
|
||||||
|
|
||||||
|
return content, False
|
||||||
|
|
||||||
class BroDomain(Domain):
|
class BroDomain(Domain):
|
||||||
"""Bro domain."""
|
"""Bro domain."""
|
||||||
name = 'bro'
|
name = 'bro'
|
||||||
|
@ -150,6 +175,10 @@ class BroDomain(Domain):
|
||||||
'see': XRefRole(),
|
'see': XRefRole(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
indices = [
|
||||||
|
BroNotices,
|
||||||
|
]
|
||||||
|
|
||||||
initial_data = {
|
initial_data = {
|
||||||
'objects': {}, # fullname -> docname, objtype
|
'objects': {}, # fullname -> docname, objtype
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,10 +57,11 @@ Other Bro Components
|
||||||
components/pysubnettree/README
|
components/pysubnettree/README
|
||||||
components/trace-summary/README
|
components/trace-summary/README
|
||||||
|
|
||||||
Indices and tables
|
Other Indices and References
|
||||||
------------------
|
----------------------------
|
||||||
|
|
||||||
* :ref:`genindex`
|
* :ref:`General Index <genindex>`
|
||||||
|
* `Notice Index <bro-noticeindex.html>`_
|
||||||
* :ref:`search`
|
* :ref:`search`
|
||||||
|
|
||||||
Internal References
|
Internal References
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue