[Bro] RST documentation for BRO

Siwek, Jon jsiwek at illinois.edu
Tue Jan 27 08:18:23 PST 2015


Here’s a small patch you can try:

https://github.com/bro/bro/commit/36bc7ba5b5d25cea881db22fb1a5bc2bc5fbc3e4

- Jon

> On Jan 27, 2015, at 8:29 AM, Andrew V. Stepanov <stanv at altlinux.org> wrote:
> 
> 
> People from pygments claim to
> ./doc/ext/rst_directive.py
> 
> birkenfeld says:
> 15:31 hm
> 15:31 ok. in any case, lexer guessing is not always successful
> 15:31 and varies with pygments vesrion
> 15:31 so they should really guard against ClassNotFound
> 
> 
> Please fix it!
> 
> 27.01.15 17:19, Andrew V. Stepanov пишет:
>> Hello.
>> 
>> I need to make RPM package for BRO.
>> 
>> https://www.bro.org/
>> 
>> I need to run in SPEC file: make doc
>> 
>> But it fails with:
>> 
>> Running Sphinx v1.3a0
>> loading pickled environment... not yet created
>> building [html]: targets for 422 source files that are out of date
>> updating environment: 422 added, 0 changed, 0 removed
>> reading sources... [  0%] broids/index
>> running test doc/sphinx/ftp-bruteforce.btest ...
>> reading sources... [  0%] cluster/index
>> reading sources... [  0%] components/binpac/README
>> 
>> Exception occurred:
>>   File "/usr/lib/python2.7/site-packages/pygments/lexers/__init__.py",
>> line 252, in guess_lexer
>>     raise ClassNotFound('no lexer matching the text found')
>> ClassNotFound: no lexer matching the text found
>> The full traceback has been saved in /usr/src/tmp/sphinx-err-5Cm0Xi.log,
>> if you want to report the issue to the developers.
>> 
>> 
>> Contents of /usr/src/tmp/sphinx-err-5Cm0Xi.log is:
>> 
>> 
>> # Sphinx version: 1.3a0
>> # Python version: 2.7.8
>> # Docutils version: 0.13 repository
>> # Jinja2 version: 2.8-dev
>> # Loaded extensions:
>> #   rst_directive from
>> /usr/src/RPM/BUILD/bro-2.3.1/build/doc/sphinx_input/ext/rst_directive.py
>> #   bro from /usr/src/RPM/BUILD/bro-2.3.1/build/doc/sphinx_input/ext/bro.py
>> #   adapt-toc from
>> /usr/src/RPM/BUILD/bro-2.3.1/build/doc/sphinx_input/ext/adapt-toc.py
>> #   sphinx.ext.todo from
>> /usr/lib/python2.7/site-packages/sphinx/ext/todo.pyc
>> #   broxygen from
>> /usr/src/RPM/BUILD/bro-2.3.1/build/doc/sphinx_input/ext/broxygen.py
>> #   btest-sphinx from
>> /usr/src/RPM/BUILD/bro-2.3.1/aux/btest/sphinx/btest-sphinx.pyc
>> Traceback (most recent call last):
>>   File "/usr/lib/python2.7/site-packages/sphinx/cmdline.py", line 254,
>> in main
>>     app.build(force_all, filenames)
>>   File "/usr/lib/python2.7/site-packages/sphinx/application.py", line
>> 215, in build
>>     self.builder.build_update()
>>   File "/usr/lib/python2.7/site-packages/sphinx/builders/__init__.py",
>> line 214, in build_update
>>     'out of date' % len(to_build))
>>   File "/usr/lib/python2.7/site-packages/sphinx/builders/__init__.py",
>> line 234, in build
>>     purple, length):
>>   File "/usr/lib/python2.7/site-packages/sphinx/builders/__init__.py",
>> line 134, in status_iterator
>>     for item in iterable:
>>   File "/usr/lib/python2.7/site-packages/sphinx/environment.py", line
>> 474, in update_generator
>>     self.read_doc(docname, app=app)
>>   File "/usr/lib/python2.7/site-packages/sphinx/environment.py", line
>> 621, in read_doc
>>     pub.publish()
>>   File "/usr/lib/python2.7/site-packages/docutils/core.py", line 217,
>> in publish
>>     self.settings)
>>   File "/usr/lib/python2.7/site-packages/docutils/readers/__init__.py",
>> line 72, in read
>>     self.parse()
>>   File "/usr/lib/python2.7/site-packages/docutils/readers/__init__.py",
>> line 78, in parse
>>     self.parser.parse(self.input, document)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/__init__.py",
>> line 172, in parse
>>     self.statemachine.run(inputlines, document, inliner=self.inliner)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 170, in run
>>     input_source=document['source'])
>>   File "/usr/lib/python2.7/site-packages/docutils/statemachine.py",
>> line 239, in run
>>     context, state, transitions)
>>   File "/usr/lib/python2.7/site-packages/docutils/statemachine.py",
>> line 460, in check_line
>>     return method(match, context, next_state)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 2961, in text
>>     self.section(title.lstrip(), source, style, lineno + 1, messages)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 327, in section
>>     self.new_subsection(title, lineno, messages)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 395, in new_subsection
>>     node=section_node, match_titles=True)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 282, in nested_parse
>>     node=node, match_titles=match_titles)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 195, in run
>>     results = StateMachineWS.run(self, input_lines, input_offset)
>>   File "/usr/lib/python2.7/site-packages/docutils/statemachine.py",
>> line 239, in run
>>     context, state, transitions)
>>   File "/usr/lib/python2.7/site-packages/docutils/statemachine.py",
>> line 460, in check_line
>>     return method(match, context, next_state)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 2726, in underline
>>     self.section(title, source, style, lineno - 1, messages)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 327, in section
>>     self.new_subsection(title, lineno, messages)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 395, in new_subsection
>>     node=section_node, match_titles=True)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 282, in nested_parse
>>     node=node, match_titles=match_titles)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 195, in run
>>     results = StateMachineWS.run(self, input_lines, input_offset)
>>   File "/usr/lib/python2.7/site-packages/docutils/statemachine.py",
>> line 239, in run
>>     context, state, transitions)
>>   File "/usr/lib/python2.7/site-packages/docutils/statemachine.py",
>> line 460, in check_line
>>     return method(match, context, next_state)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 2726, in underline
>>     self.section(title, source, style, lineno - 1, messages)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 327, in section
>>     self.new_subsection(title, lineno, messages)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 395, in new_subsection
>>     node=section_node, match_titles=True)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 282, in nested_parse
>>     node=node, match_titles=match_titles)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 195, in run
>>     results = StateMachineWS.run(self, input_lines, input_offset)
>>   File "/usr/lib/python2.7/site-packages/docutils/statemachine.py",
>> line 239, in run
>>     context, state, transitions)
>>   File "/usr/lib/python2.7/site-packages/docutils/statemachine.py",
>> line 460, in check_line
>>     return method(match, context, next_state)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 2726, in underline
>>     self.section(title, source, style, lineno - 1, messages)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 327, in section
>>     self.new_subsection(title, lineno, messages)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 395, in new_subsection
>>     node=section_node, match_titles=True)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 282, in nested_parse
>>     node=node, match_titles=match_titles)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 195, in run
>>     results = StateMachineWS.run(self, input_lines, input_offset)
>>   File "/usr/lib/python2.7/site-packages/docutils/statemachine.py",
>> line 239, in run
>>     context, state, transitions)
>>   File "/usr/lib/python2.7/site-packages/docutils/statemachine.py",
>> line 460, in check_line
>>     return method(match, context, next_state)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 2299, in explicit_markup
>>     nodelist, blank_finish = self.explicit_construct(match)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 2311, in explicit_construct
>>     return method(self, expmatch)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 2054, in directive
>>     directive_class, match, type_name, option_presets)
>>   File
>> "/usr/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line
>> 2103, in run_directive
>>     result = directive_instance.run()
>>   File
>> "/usr/src/RPM/BUILD/bro-2.3.1/build/doc/sphinx_input/ext/rst_directive.py",
>> line 138, in run
>>     lexer = guess_lexer(content)
>>   File "/usr/lib/python2.7/site-packages/pygments/lexers/__init__.py",
>> line 252, in guess_lexer
>>     raise ClassNotFound('no lexer matching the text found')
>> ClassNotFound: no lexer matching the text found
>> 
>> $ rpm -q python-module-docutils
>> python-module-docutils-0.13-alt1.svn20140708
>> 
>> bro-2.3.1.tar.gz
>> 
>> https://github.com/bro/bro/tree/master/doc/components/binpac
>> https://github.com/bro/binpac/blob/master/README
>> 
>> Could you please help me ?
> _______________________________________________
> Bro mailing list
> bro at bro-ids.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/bro
> 




More information about the Bro mailing list