Matthew Helsley schrieb:
> I'm trying to generate some math output but I keep getting:
> 
> [EMAIL PROTECTED]:~/src/cvs/bgf/doc$ make html
> mkdir -p custom_build/html custom_build/doctrees
> sphinx-build -b html -d custom_build/doctrees   . custom_build/html
> /var/lib/python-support/python2.5/pygments/plugin.py:39: UserWarning:
> Module sphinx was already imported from
> /usr/lib/python2.5/site-packages/sphinx/__init__.py, but
> /usr/lib/python2.5/site-packages is being added to sys.path
>   import pkg_resources
> Exception occurred:
>   File "/usr/lib/python2.5/site-packages/sphinx/application.py", line
> 165, in setup_extension
>     mod.setup(self)
> TypeError: setup() takes exactly 3 arguments (1 given)
> The full traceback has been saved in /tmp/sphinx-err-6R1vvs.log, if
> you want to report the issue to the author.
> Please also report this if it was a user error, so that a better error
> message can be provided next time.
> Send reports to [EMAIL PROTECTED] Thanks!
> make: *** [html] Error 1
> 
> I'm not sure if this is truly a bug or my conf.py is poorly
> configured. I used sphinx-0.4.2-1 (ubuntu intrepid ibex 8.10) to set
> up the sphinx document directory initially. Upon discovering that it
> didn't have the extensions I wanted I installed sphinx-0.5. Then I
> editted conf.py to load the math extensions I wanted to use:
> 
> extensions = ['sphinx.ext.autodoc', 'sphinx.ext.mathbase', 
> 'sphinx.ext.pngmath']
> 
> 
> So I started looking at the code and added the print statement below
> tosphinx/application.py:
>         # load all extension modules
>         for extension in self.config.extensions:
>             print >>status, 'Setting up extension: %s' % extension
>             self.setup_extension(extension)
> 
> Now when I get the error I see:
> 
> [EMAIL PROTECTED]:~/src/cvs/bgf/doc$ make html
> mkdir -p custom_build/html custom_build/doctrees
> sphinx-build -b html -d custom_build/doctrees   . custom_build/html
> /var/lib/python-support/python2.5/pygments/plugin.py:39: UserWarning:
> Module sphinx was already imported from
> /usr/lib/python2.5/site-packages/sphinx/__init__.py, but
> /usr/lib/python2.5/site-packages is being added to sys.path
>   import pkg_resources
> Setting up extension: sphinx.ext.autodoc
> Setting up extension: sphinx.ext.mathbase
> Exception occurred:
>   File "/usr/lib/python2.5/site-packages/sphinx/application.py", line
> 166, in setup_extension
>     mod.setup(self)
> TypeError: setup() takes exactly 3 arguments (1 given)
> The full traceback has been saved in /tmp/sphinx-err-XoaGxf.log, if
> you want to report the issue to the author.
> Please also report this if it was a user error, so that a better error
> message can be provided next time.
> Send reports to [EMAIL PROTECTED] Thanks!
> make: *** [html] Error 1
> 
> Which suggests that mathbase.py is the source of the exception. Next I
> noticed that in mathbase.py the setup function indeed takes 3
> arguments whereas the setup function in autodoc only takes one:
> 
> def setup(app, htmlinlinevisitors, htmldisplayvisitors):
>     app.add_node(math,
>                  latex=(latex_visit_math, None),
>                  text=(text_visit_math, None),
>                  html=htmlinlinevisitors)
>     app.add_node(displaymath,
>                  latex=(latex_visit_displaymath, None),
>                  text=(text_visit_displaymath, None),
>                  html=htmldisplayvisitors)
>     app.add_node(eqref,
>                  latex=(latex_visit_eqref, None),
>                  text=(text_visit_eqref, None),
>                  html=(html_visit_eqref, html_depart_eqr
> 
> Comparing the math and displaymath nodes to the eqref node suggests
> there should be a function somewhere following a similar name
> convention. I was thinking there might be an easy fix but I can't find
> anything similar/suggestive to htmlinlinevisitors and
> htmldisplayvisitors that looks like it ought to be passed to the setup
> function.

The fix is quite easy: don't put mathbase in your extensions -- it's
only used internally by pngmath :)

I'll put some wording in the docs to clarify this.

cheers,
Georg

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to