Update the generated script doc organization.

Added an additional master TOC index for Bro script packages that
automatically gets filled in at ``make doc`` time.  The master TOC
links to per-package indexes which contains links to all the scripts
contained within it along with their summary.  The per-package index
is also now automatically generated/derived from the path component
of the script passed into the rest_target() macro.
This commit is contained in:
Jon Siwek 2011-06-30 16:58:20 -05:00
parent fe5f4b8e53
commit 5a2cd265ab
22 changed files with 229 additions and 236 deletions

View file

@ -93,7 +93,6 @@ void BroDoc::AddImport(const std::string& s)
if ( streq(filename, PACKAGE_LOADER) )
{
// link to the package's index
// TODO: check that this works
string pkg(subpath);
pkg += "/index";
imports.push_back(pkg);
@ -180,7 +179,11 @@ void BroDoc::WriteDocFile() const
if ( it != imports.begin() )
WriteToDoc(", ");
WriteToDoc(":doc:`%s </policy/%s>`", it->c_str(), it->c_str());
string pretty(*it);
size_t pos = pretty.find("/index");
if ( pos != std::string::npos && pos + 6 == pretty.size() )
pretty = pretty.substr(0, pos);
WriteToDoc(":doc:`%s </policy/%s>`", pretty.c_str(), it->c_str());
}
WriteToDoc("\n");
}