Author Topic: Building docs  (Read 1346 times)

krege

  • Newbie
  • *
  • Posts: 10
Building docs
« on: February 15, 2017, 06:13:45 AM »
Hi,
one more question on building.

I'm running with latest git sources and I have got an error during docs building with sphinx. I see you have it done in online documentation so " believe the error is on the my side. But may be you have a clue?
Logs:
Code: [Select]
$ build/bin/ovitos /usr/bin/sphinx-build -b html -a -E -D version=2.8 -D release=2.8.2 . build/share/ovito/doc/manual/html/python
Running Sphinx v1.4.8
building [mo]: all of 0 po files
building [html]: all source files
updating environment: 15 added, 0 changed, 0 removed
reading sources... [100%] modules/ovito_vis                                                                                                                 
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [ 40%] introduction/overview                                                                                                             
Exception occurred:
  File "/usr/lib/python3.5/site-packages/docutils/writers/_html_base.py", line 671, in depart_document
    assert not self.context, 'len(context) = %s' % len(self.context)
AssertionError: len(context) = 1
The full traceback has been saved in /tmp/sphinx-err-zg_3qdjq.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!

/tmp/sphinx-err-zg_3qdjq.log:
Code: [Select]
# Python version: 3.5.2 (CPython)
# Docutils version: 0.13.1 release
# Jinja2 version: 2.8.1
# Last messages:
#   checking consistency...
#   done
#   preparing documents...
#   done
#   writing output... [  6%] index
#   writing output... [ 13%] introduction/custom_modifiers
#   writing output... [ 20%] introduction/examples
#   writing output... [ 26%] introduction/file_io
#   writing output... [ 33%] introduction/modifiers
#   writing output... [ 40%] introduction/overview
# Loaded extensions:
#   sphinx.ext.autodoc (1.4.8) from /usr/lib/python3.5/site-packages/sphinx/ext/autodoc.py
#   alabaster (0.7.9) from /usr/lib/python3.5/site-packages/alabaster/__init__.py
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/sphinx/cmdline.py", line 244, in main
    app.build(opts.force_all, filenames)
  File "/usr/lib/python3.5/site-packages/sphinx/application.py", line 291, in build
    self.builder.build_all()
  File "/usr/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 211, in build_all
    self.build(None, summary='all source files', method='all')
  File "/usr/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 322, in build
    self.write(docnames, list(updated_docnames), method)
  File "/usr/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 360, in write
    self._write_serial(sorted(docnames), warnings)
  File "/usr/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 368, in _write_serial
    self.write_doc(docname, doctree)
  File "/usr/lib/python3.5/site-packages/sphinx/builders/html.py", line 448, in write_doc
    self.docwriter.write(doctree, destination)
  File "/usr/lib/python3.5/site-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/usr/lib/python3.5/site-packages/sphinx/writers/html.py", line 47, in translate
    self.document.walkabout(visitor)
  File "/usr/lib/python3.5/site-packages/docutils/nodes.py", line 187, in walkabout
    visitor.dispatch_departure(self)
  File "/usr/lib/python3.5/site-packages/docutils/nodes.py", line 1895, in dispatch_departure
    return method(node)
  File "/usr/lib/python3.5/site-packages/docutils/writers/_html_base.py", line 671, in depart_document
    assert not self.context, 'len(context) = %s' % len(self.context)
AssertionError: len(context) = 1

Thanks!

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 638
Re: Building docs
« Reply #1 on: February 15, 2017, 10:22:30 AM »
Hi,

Normally, the CMake build script takes care of building the Python documentation using Sphinx. It should be sufficient to run "make scripting_documentation" in the build directory. Is this what you were doing? The console output you posted suggests that you run Sphinx manually. But that being said, the way you ran Sphinx looks okay to me.

I haven't see this type of error before. To me it looks like an internal error in the Sphinx machinery which is not really related to OVITO. All I can say is that I didn't have any problems generating the docs with the same version of Sphinx (1.4.8 ) as you.

I'm sorry that I could not provide any real help here.


krege

  • Newbie
  • *
  • Posts: 10
Re: Building docs
« Reply #2 on: February 15, 2017, 10:45:46 AM »
I just copy command the cmake run it to check manually. With inner cmake run the result is the same.

Thank you anyway, would try to contact the sphinx team.

krege

  • Newbie
  • *
  • Posts: 10
Re: Building docs
« Reply #3 on: February 16, 2017, 03:32:56 AM »
Sphinx 1.5.1 did the trick. Don't understand what was wrong anyway.

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 638
Re: Building docs
« Reply #4 on: February 16, 2017, 08:09:00 AM »
I'm glad it worked. Thanks for letting us know.