mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Auto-doc framework now handles multiple script authors more conveniently.
This commit is contained in:
parent
5fbcde7344
commit
e0a77cb794
3 changed files with 7 additions and 8 deletions
|
@ -85,7 +85,8 @@ void BroDoc::WriteDocFile() const
|
|||
WriteSectionHeading("Summary", '-');
|
||||
WriteStringList("%s\n", "%s\n\n", summary);
|
||||
|
||||
WriteToDoc(":Author: %s\n", author_name.c_str());
|
||||
WriteToDoc(":Author(s): ");
|
||||
WriteStringList("%s, ", "%s\n", authors);
|
||||
|
||||
WriteToDoc(":Namespaces: ");
|
||||
WriteStringList("`%s`, ", "`%s`\n", modules);
|
||||
|
|
10
src/BroDoc.h
10
src/BroDoc.h
|
@ -83,12 +83,11 @@ public:
|
|||
void AddPortAnalysis(const std::string& analyzer, const std::string& ports);
|
||||
|
||||
/**
|
||||
* Sets the author of the script.
|
||||
* Adds a script author.
|
||||
* The scanner should call this when it sees "## Author: ..."
|
||||
* @param s The name, email, etc. of the script author(s). Must be
|
||||
* all on one line.
|
||||
* @param s The name, email, etc. of the script author.
|
||||
*/
|
||||
void SetAuthor(const std::string& s) { author_name = s; }
|
||||
void AddAuthor(const std::string& s) { authors.push_back(s); }
|
||||
|
||||
/**
|
||||
* Schedules documentation of a script option. An option is
|
||||
|
@ -166,10 +165,9 @@ protected:
|
|||
FILE* reST_file;
|
||||
std::string reST_filename;
|
||||
std::string source_filename;
|
||||
std::string author_name;
|
||||
std::string packet_filter;
|
||||
|
||||
std::list<std::string> ls;
|
||||
std::list<std::string> authors;
|
||||
std::list<std::string> modules;
|
||||
std::list<std::string> summary;
|
||||
std::list<std::string> imports;
|
||||
|
|
|
@ -137,7 +137,7 @@ ESCSEQ (\\([^\n]|[0-7]+|x[[:xdigit:]]+))
|
|||
|
||||
##{OWS}Author:.* {
|
||||
if ( generate_documentation )
|
||||
current_reST_doc->SetAuthor(
|
||||
current_reST_doc->AddAuthor(
|
||||
skip_whitespace( // Skip whitespace after "Author:"
|
||||
skip_whitespace(yytext + 2) // Skip whitespace after ##
|
||||
+ 7) // Skip "Author:"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue