Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported on recent Sphinx versions #55

Open
simaoafonso-pwt opened this issue Jan 25, 2023 · 3 comments
Open

Unsupported on recent Sphinx versions #55

simaoafonso-pwt opened this issue Jan 25, 2023 · 3 comments

Comments

@simaoafonso-pwt
Copy link

This project looks great, but it's not working on recent Sphinx versions.

Here's what I get on Sphinx >v5:

# sphinx-build -M docx -l en --
<...>
writing...
Exception occurred:
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/docutils/nodes.py", line 575, in __getitem__
    return self.children[key]
IndexError: list index out of range

I got the full tracelog, clean of secret data here:

# Sphinx version: 5.2.3
# Python version: 3.8.16 (CPython)
# Docutils version: 0.15 release
# Jinja2 version: 3.1.2
# Last messages:
# <...>
#
#   writing...
# Loaded extensions:
#   sphinx.ext.mathjax (5.2.3) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/ext/mathjax.py
#   sphinxcontrib.applehelp (1.0.2) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinxcontrib/applehelp/__init__.py
#   sphinxcontrib.devhelp (1.0.2) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinxcontrib/devhelp/__init__.py
#   sphinxcontrib.htmlhelp (2.0.0) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinxcontrib/htmlhelp/__init__.py
#   sphinxcontrib.serializinghtml (1.1.5) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinxcontrib/serializinghtml/__init__.py
#   sphinxcontrib.qthelp (1.0.3) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinxcontrib/qthelp/__init__.py
#   alabaster (0.7.12) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/alabaster/__init__.py
#   sphinx.ext.intersphinx (5.2.3) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/ext/intersphinx.py
#   sphinx.ext.graphviz (5.2.3) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/ext/graphviz.py
#   sphinx.ext.autodoc.preserve_defaults (1.0) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/ext/autodoc/preserve_defaults.py
#   sphinx.ext.autodoc.type_comment (5.2.3) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/ext/autodoc/type_comment.py
#   sphinx.ext.autodoc (5.2.3) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py
#   sphinx.ext.napoleon (5.2.3) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/ext/napoleon/__init__.py
#   sphinx.ext.autosummary (5.2.3) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/ext/autosummary/__init__.py
#   sphinx_automodapi.autodoc_enhancements (unknown version) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx_automodapi/autodoc_enhancements.py
#   sphinx.ext.inheritance_diagram (5.2.3) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/ext/inheritance_diagram.py
#   sphinx_automodapi.automodsumm (unknown version) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx_automodapi/automodsumm.py
#   sphinx_automodapi.automodapi (unknown version) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx_automodapi/automodapi.py
#   sphinx_automodapi.smart_resolver (unknown version) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx_automodapi/smart_resolver.py
#   sphinx.ext.todo (5.2.3) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/ext/todo.py
#   sphinx.ext.extlinks (5.2.3) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/ext/extlinks.py
#   docxsphinx (unknown version) from $PWD/.venv/3.8-64/lib/python3.8/site-packages/docxsphinx/__init__.py
Traceback (most recent call last):
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/cmd/build.py", line 279, in build_main
    app.build(args.force_all, filenames)
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/application.py", line 350, in build
    self.builder.build_update()
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 299, in build_update
    self.build(['__all__'], to_build)
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 368, in build
    self.write(docnames, list(updated_docnames), method)
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/docxsphinx/builder.py", line 85, in write
    self.write_doc(docname, doctree)
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/docxsphinx/builder.py", line 90, in write_doc
    self.writer.write(doctree, destination)
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/docutils/writers/__init__.py", line 78, in write
    self.translate()
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/docxsphinx/writer.py", line 98, in translate
    self.document.walkabout(visitor)
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/docutils/nodes.py", line 180, in walkabout
    if child.walkabout(visitor):
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/docutils/nodes.py", line 172, in walkabout
    visitor.dispatch_visit(self)
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/docutils/nodes.py", line 1900, in dispatch_visit
    return method(node)
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/docxsphinx/writer.py", line 1106, in visit_comment
    comment = node[0]
  File "$PWD/.venv/3.8-64/lib/python3.8/site-packages/docutils/nodes.py", line 575, in __getitem__
    return self.children[key]
IndexError: list index out of range

Hopefully this helps.

@hugobuddel
Copy link
Collaborator

Thank you @simaoafonso-pwt .

We (the maintainers) are currently not actively using the docxsphinx plugin, and are not maintaining it as much as we should.

You could also try to see whether https://github.com/amedama41/docxbuilder would suite your needs better. (Also posting this for other visitors.)

@simaoafonso-pwt
Copy link
Author

You could also try to see whether https://github.com/amedama41/docxbuilder would suite your needs better. (Also posting this for other visitors.)

Thanks for this, I'll check that project.

We (the maintainers) are currently not actively using the docxsphinx plugin, and are not maintaining it as much as we should.

I noticed as much, thanks for replying anyway. I'll close this issue now.

@hugobuddel
Copy link
Collaborator

Good luck with your quest. It can be frustrating to create docx files.

I've reopened the issue, because:

  • if we do start maintaining this plugin again, then we should probably fix this issue first
  • if we don't maintain it, then people will easily find this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants