symfony / symfony-docs

The Symfony documentation
https://symfony.com/doc
Other
2.18k stars 5.12k forks source link

Error building latex documentation (2.8) #5721

Closed AndoniZubimendi closed 7 years ago

AndoniZubimendi commented 9 years ago

Trying to build the latex documentation at 2.8 branch I get this error:

make latex
...
...
resolving references...
writing...
Exception occurred:
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/sphinx/writers/latex.py", line 1804, in unknown_visit
    raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
NotImplementedError: Unknown node: bestpractice
The full traceback has been saved in /var/folders/km/grzg5y3d1fqg2ml4ztp1_g700000gn/T/sphinx-err-dge9bV.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [latex] Error 1

The detailed log file is:

 Sphinx version: 1.3.1
# Python version: 2.7.10 (CPython)
# Docutils version: 0.12 release
# Jinja2 version: 2.8
# Last messages:
#   create_framework/http-kernel-controller-resolver
#   create_framework/separation-of-concerns
#   create_framework/unit-testing
#   create_framework/event-dispatcher
#   create_framework/http-kernel-httpkernelinterface
#   create_framework/http-kernel-httpkernel-class
#   create_framework/dependency-injection
#
#   resolving references...
#   writing...
# Loaded extensions:
#   sensio.sphinx.phpcode (unknown version) from /Users/andoni/Library/Python/2.7/lib/python/site-packages/sensio/sphinx/phpcode.pyc
#   sphinx.ext.autodoc (1.3.1) from /Users/andoni/Library/Python/2.7/lib/python/site-packages/sphinx/ext/autodoc.pyc
#   sensio.sphinx.configurationblock (unknown version) from /Users/andoni/Library/Python/2.7/lib/python/site-packages/sensio/sphinx/configurationblock.pyc
#   sphinx.ext.doctest (1.3.1) from /Users/andoni/Library/Python/2.7/lib/python/site-packages/sphinx/ext/doctest.pyc
#   alabaster (0.7.6) from /Users/andoni/Library/Python/2.7/lib/python/site-packages/alabaster/__init__.pyc
#   sensio.sphinx.bestpractice (unknown version) from /Users/andoni/Library/Python/2.7/lib/python/site-packages/sensio/sphinx/bestpractice.pyc
#   sensio.sphinx.refinclude (unknown version) from /Users/andoni/Library/Python/2.7/lib/python/site-packages/sensio/sphinx/refinclude.pyc
#   symfonycom.sphinx (unknown version) from /Users/andoni/Proyectos/documentacion/symfony-docs/_theme/_exts/symfonycom/sphinx/__init__.pyc
#   sphinx.ext.todo (1.3.1) from /Users/andoni/Library/Python/2.7/lib/python/site-packages/sphinx/ext/todo.pyc
#   sensio.sphinx.codeblock (unknown version) from /Users/andoni/Library/Python/2.7/lib/python/site-packages/sensio/sphinx/codeblock.pyc
Traceback (most recent call last):
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/sphinx/cmdline.py", line 245, in main
    app.build(opts.force_all, filenames)
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/sphinx/application.py", line 264, in build
    self.builder.build_update()
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/sphinx/builders/__init__.py", line 240, in build_update
    self.build(['__all__'], to_build)
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/sphinx/builders/__init__.py", line 316, in build
    self.write(docnames, list(updated_docnames), method)
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/sphinx/builders/latex.py", line 107, in write
    docwriter.write(doctree, destination)
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/sphinx/writers/latex.py", line 101, in translate
    self.document.walkabout(visitor)
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/nodes.py", line 166, in walkabout
    visitor.dispatch_visit(self)
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/docutils/nodes.py", line 1882, in dispatch_visit
    return method(node)
  File "/Users/andoni/Library/Python/2.7/lib/python/site-packages/sphinx/writers/latex.py", line 1804, in unknown_visit
    raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
NotImplementedError: Unknown node: bestpractice

I am on MacOS X Yosemite, am I doing something wrong, or it is an error?

javiereguiluz commented 9 years ago

The bestpractice node is defined in this file: https://github.com/fabpot/sphinx-php/blob/master/sensio/sphinx/bestpractice.py Have you installed the PHP Sphinx extensions provided by this repo? https://github.com/fabpot/sphinx-php

AndoniZubimendi commented 9 years ago

Yes, I have it installed (as told in the README.md).

I can build the html documentation fine. If I try to build the epub, I get the same error of the issue 5707. But commenting templates_path in conf.py produces the pub without error.

I am using Python 2.7, if this helps.

Any other thing I can try?

FancyGoldfish07 commented 8 years ago

Hey,

I am having this problem too. Has anyone found a solution to this yet?

javiereguiluz commented 7 years ago

I'm sorry but I must close this as "won't fix". We already have problems with our 3 official formats (HTML, PDF, ePub) so we won't be able to fix these Latex issues. Maybe you can get help on the Symfony Slack where we have the #support and #documentation channels.

thomascobb commented 7 years ago

For what it's worth, I had a similar problem with a custom node, and discovered this issue while searching for a solution. I fixed it by adding latex and text arguments to the app.add_node() function as described here:

http://www.sphinx-doc.org/en/stable/extdev/tutorial.html#the-setup-function

I guess the owner of the sphinx-php project would have to add it here:

https://github.com/fabpot/sphinx-php/blob/master/sensio/sphinx/bestpractice.py#L40