mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
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.
This commit is contained in:
parent
037a6906af
commit
8b79971e21
2 changed files with 18 additions and 1 deletions
|
@ -56,6 +56,22 @@ BroDoc::~BroDoc()
|
|||
FreeBroDocObjPtrList(redefs);
|
||||
}
|
||||
|
||||
void BroDoc::AddImport(const std::string& s)
|
||||
{
|
||||
size_t ext_pos = s.find_last_of('.');
|
||||
|
||||
if ( ext_pos == std::string::npos )
|
||||
imports.push_back(s);
|
||||
else
|
||||
{
|
||||
if ( s.substr(ext_pos + 1) == "bro" )
|
||||
imports.push_back(s.substr(0, ext_pos));
|
||||
else
|
||||
fprintf(stderr, "Warning: skipped documenting @load of file "
|
||||
"without .bro extension: %s\n", s.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void BroDoc::SetPacketFilter(const std::string& s)
|
||||
{
|
||||
packet_filter = s;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue