sphinx-contrib / plantuml

BSD 2-Clause "Simplified" License
115 stars 42 forks source link

Getting NotImplementedError: Unknown node: plantuml #6

Closed andrejohansson closed 6 years ago

andrejohansson commented 6 years ago

Hello,

I'm trying to build some docs using plantuml and this extension but I get an exception and blank image files (0 byte files). Generating the diagrams using the jar file directly on the command line works. Do you know what could be wrong?

C:\dev\github\capture-engine-doc>make html
Running Sphinx v1.6.6
loading translations [en]... done
building [mo]: all of 0 po files
building [html]: all source files
updating environment: 10 added, 0 changed, 0 removed
reading sources... [100%] user_guide/keyboard_shortcuts
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] user_guide/keyboard_shortcuts
generating indices... genindex
writing additional pages... search
copying images... [100%] _static/images/ccf/main_interface.png
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded.
Running Sphinx v1.6.6
loading translations [en]... done
loading pickled environment... not yet created
building [mo]: all of 0 po files
building [text]: all source files
updating environment: 10 added, 0 changed, 0 removed
reading sources... [100%] user_guide/keyboard_shortcuts
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] user_guide/keyboard_shortcuts
Exception occurred:
  File "c:\programdata\anaconda3\lib\site-packages\sphinx\writers\text.py", line 1179, in unknown_visit
    raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
NotImplementedError: Unknown node: plantuml
The full traceback has been saved in C:\Users\andrej\AppData\Local\Temp\sphinx-err-gg7ieo2i.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!

Build finished. The HTML pages are in build/html.

Here is my versions:

C:\dev\github\capture-engine-doc>pip show sphinxcontrib-plantuml
Name: sphinxcontrib-plantuml
Version: 0.9
Summary: Sphinx "plantuml" extension
Home-page: https://github.com/sphinx-contrib/plantuml/
Author: Yuya Nishihara
Author-email: yuya@tcha.org
License: BSD
Location: c:\programdata\anaconda3\lib\site-packages
Requires: Sphinx

C:\dev\github\capture-engine-doc>pip show sphinx
Name: Sphinx
Version: 1.6.6
Summary: Python documentation generator
Home-page: http://sphinx-doc.org/
Author: Georg Brandl
Author-email: georg@python.org
License: BSD
Location: c:\programdata\anaconda3\lib\site-packages
Requires: Jinja2, babel, docutils, alabaster, sphinxcontrib-websupport, colorama, snowballstemmer, imagesize, setuptools, Pygments, requests, six

C:\dev\github\capture-engine-doc>java -version
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)

C:\dev\github\capture-engine-doc>dot -V
dot - graphviz version 2.38.0 (20140413.2041)

C:\dev\github\capture-engine-doc\source\_extensions>java -jar plantuml.jar -version
PlantUML version 1.2018.00 (Thu Jan 04 20:42:56 CET 2018)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Java Version: 1.8.0_152-b16
Operating System: Windows 10
OS Version: 10.0
Default Encoding: Cp1252
Language: en
Country: GB
Machine: MRD-L-HQBKNC2
PLANTUML_LIMIT_SIZE: 4096
Processors: 8
Max Memory: 7,604,273,152
Total Memory: 512,753,664
Free Memory: 504,700,568
Used Memory: 8,053,096
Thread Active Count: 1

The environment variable GRAPHVIZ_DOT has been set to C:\Program Files (x86)\Graphviz2.38\bin\dot.exe
Dot executable is C:\Program Files (x86)\Graphviz2.38\bin\dot.exe
Dot version: dot - graphviz version 2.38.0 (20140413.2041)
Installation seems OK. File generation OK

I have tried different values in conf.py but currently I´ve set it to the hardcoded path:

#plantuml = 'java -jar -Djava.awt.headless=true %s' % os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '_extensions', 'plantuml.jar'))
plantuml  = 'java -jar r"C:\dev\github\capture-engine-doc\source\_extensions\plantuml.jar"'

In my docmentation files I´ve tried both referencing a uml file and inlining the graph:

keyboard_shortcuts.rst

##################
Keyboard Shortcuts
##################

.. uml:: mytest.uml

mytest.uml

@startuml

(*) --> "First Activity"
-->[You can put also labels] "Second Activity"
--> (*)

@enduml
yuja commented 6 years ago

Appears that make html tries to build a text output, which isn't implemented.

andrejohansson commented 6 years ago

Thanks for your reply, you were correct. I was confused since I wasn´t targetting the text output explicitly. I had to remove the extension sphinxprettysearchresults for it to not require text output generation.

Also I tried a couple of variations of the conf path, but it seems that the only working escape sequence for me on Windows was forward slashes. Neither double backslashes nor, python functions etc worked for me.

yuja commented 6 years ago

to not require text output generation.

It's fixed by 24620ce by the way, will be included in the next version.

Neither double backslashes nor, python functions etc worked for me.

Perhaps that's because a command string is parsed by shlex in a Unix way. You can instead specify a list of command arguments, but anyway, forward slashes are more convenient in Python code.

plantuml = ['java', '-jar', r"C:\dev\github\capture-engine-doc\source\_extensions\plantuml.jar"]