diff --git a/doc/scripts/CMakeLists.txt b/doc/scripts/CMakeLists.txt index 582676a9b3..26b413117d 100644 --- a/doc/scripts/CMakeLists.txt +++ b/doc/scripts/CMakeLists.txt @@ -129,24 +129,8 @@ endmacro(REST_TARGET) # Schedule Bro scripts for which to generate documentation. # Note: the script may be located in a subdirectory off of one of the main # directories in BROPATH. In that case, just list the script as 'foo/bar.bro' -rest_target(${POLICY_SRC_DIR} alarm.bro user) -rest_target(${POLICY_SRC_DIR} arp.bro user) rest_target(${POLICY_SRC_DIR} conn.bro user) -rest_target(${POLICY_SRC_DIR} dhcp.bro user) rest_target(${POLICY_SRC_DIR} dns.bro user) -rest_target(${POLICY_SRC_DIR} ftp.bro user) -rest_target(${POLICY_SRC_DIR} http.bro user) -rest_target(${POLICY_SRC_DIR} http-reply.bro user) -rest_target(${POLICY_SRC_DIR} http-request.bro user) -rest_target(${POLICY_SRC_DIR} irc.bro user) -rest_target(${POLICY_SRC_DIR} smtp.bro user) -rest_target(${POLICY_SRC_DIR} ssl.bro user) -rest_target(${POLICY_SRC_DIR} ssl-ciphers.bro user) -rest_target(${POLICY_SRC_DIR} ssl-errors.bro user) -rest_target(${POLICY_SRC_DIR} synflood.bro user) -rest_target(${POLICY_SRC_DIR} tcp.bro user) -rest_target(${POLICY_SRC_DIR} udp.bro user) -rest_target(${POLICY_SRC_DIR} weird.bro user) rest_target(${CMAKE_CURRENT_SOURCE_DIR} example.bro internal) # Finding out what scripts bro will generate documentation for by default diff --git a/doc/scripts/example.bro b/doc/scripts/example.bro index 2e2a8977ec..0699cc7237 100644 --- a/doc/scripts/example.bro +++ b/doc/scripts/example.bro @@ -66,7 +66,7 @@ redef dpd_config += { # redefinitions of "Notice::Type" are self-documenting, but # more information can be supplied in two different ways -redef enum Notice += { +redef enum Notice::Type += { ## any number of this type of comment ## will document "Notice_One" Notice_One, diff --git a/src/parse.y b/src/parse.y index 288b6c4cfe..cf1b0e507c 100644 --- a/src/parse.y +++ b/src/parse.y @@ -1059,7 +1059,8 @@ decl: BroDocObj* o = new BroDocObj(fake_id, reST_doc_comments, true); o->SetRole(true); - if ( streq(fake_id->Name(), "Notice" ) ) + if ( extract_module_name(fake_id->Name()) == "Notice" && + extract_var_name(fake_id->Name()) == "Type" ) current_reST_doc->AddNotice(o); else current_reST_doc->AddRedef(o); diff --git a/testing/btest/Baseline/doc.autogen-reST-example/example.rst b/testing/btest/Baseline/doc.autogen-reST-example/example.rst index f06c23ba8b..f1dcd15e52 100644 --- a/testing/btest/Baseline/doc.autogen-reST-example/example.rst +++ b/testing/btest/Baseline/doc.autogen-reST-example/example.rst @@ -98,23 +98,23 @@ Namespaces Notices ~~~~~~~ -:bro:type:`Notice` +:bro:type:`Notice::Type` :Type: :bro:type:`enum` - .. bro:enum:: Example::Notice_One Notice + .. bro:enum:: Example::Notice_One Notice::Type any number of this type of comment will document "Notice_One" - .. bro:enum:: Example::Notice_Two Notice + .. bro:enum:: Example::Notice_Two Notice::Type any number of this type of comment will document "Notice_Two" - .. bro:enum:: Example::Notice_Three Notice + .. bro:enum:: Example::Notice_Three Notice::Type - .. bro:enum:: Example::Notice_Four Notice + .. bro:enum:: Example::Notice_Four Notice::Type Public Interface ----------------