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

docutils 0.10 will break sphinx manpage writer #998

Closed
shimizukawa opened this issue Jan 3, 2015 · 1 comment
Closed

docutils 0.10 will break sphinx manpage writer #998

shimizukawa opened this issue Jan 3, 2015 · 1 comment

Comments

@shimizukawa
Copy link
Member

In Fedora we've been working off of a docutils snapshot as we try to get our Linux distro prepared for Python-3.3. We noticed that there's a change to the docutils manpage writer that will break sphinx's manpage generation. Part of the docutils change increments the indent level when visit_admonition() is called and decrements the indent level when depart_admonition() is called.

Sphinx has its own manpage writer that customizes several aspects of the docutils manpage writer. One of those is to override visit_admonition() to add some new labels for admonitions. However, it does not also override depart_admonition(). This leads to a problem with the new version of docutils where the indent level is decremented past the top level leading to a traceback:

File "/usr/lib/python2.7/site-packages/docutils/writers/manpage.py", line 877, in dedent
self._indent.pop()
IndexError: pop from empty list

There's two ways that I see to rework this.

  • override depart_admonition() as well so that you can tell it not to decrement the indent level.
  • Instead of overriding visit_admonition(), add the additional labels to the data structure that docutils.writers.manpage will use.

I'll attach a patch to do the latter.


@shimizukawa
Copy link
Member Author

From Georg Brandl on 2012-10-30 09:49:50+00:00

Closes #998: fix manpage writer in expectation of docutils 0.10 API change

→ <>

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

No branches or pull requests

1 participant