Giter Club home page Giter Club logo

Comments (12)

nedbat avatar nedbat commented on June 15, 2024

BTW, the problem I'm having seems to do with ".. versionadded:" with Sphinx 3:

# Sphinx version: 3.2.1
# Python version: 3.8.3 (CPython)
# Docutils version: 0.16 release
# Jinja2 version: 2.11.2
# Last messages:
#   looking for now-outdated files...
#   none found
#   pickling environment...
#   done
#   checking consistency...
#   done
#   preparing documents...
#   done
#   writing output... [  4%] api
#   writing output... [  8%] api_coverage
# Loaded extensions:
#   sphinx.ext.mathjax (3.2.1) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/ext/mathjax.py
#   sphinxcontrib.applehelp (1.0.2) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinxcontrib/applehelp/__init__.py
#   sphinxcontrib.devhelp (1.0.2) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinxcontrib/devhelp/__init__.py
#   sphinxcontrib.htmlhelp (1.0.3) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinxcontrib/htmlhelp/__init__.py
#   sphinxcontrib.serializinghtml (1.1.4) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinxcontrib/serializinghtml/__init__.py
#   sphinxcontrib.qthelp (1.0.3) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinxcontrib/qthelp/__init__.py
#   alabaster (0.7.12) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/alabaster/__init__.py
#   sphinx.ext.autodoc.type_comment (3.2.1) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/ext/autodoc/type_comment.py
#   sphinx.ext.autodoc (3.2.1) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py
#   sphinx.ext.todo (3.2.1) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/ext/todo.py
#   sphinx.ext.ifconfig (3.2.1) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/ext/ifconfig.py
#   sphinxcontrib.spelling (5.4.0) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinxcontrib/spelling/__init__.py
#   sphinx.ext.intersphinx (3.2.1) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/ext/intersphinx.py
#   sphinx_rst_builder (unknown version) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx_rst_builder/__init__.py
#   sphinx.ext.extlinks (3.2.1) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/ext/extlinks.py
#   sphinx.ext.napoleon (3.2.1) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/ext/napoleon/__init__.py
#   sphinx_tabs.tabs (unknown version) from /Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx_tabs/tabs.py
Traceback (most recent call last):
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/cmd/build.py", line 280, in build_main
    app.build(args.force_all, filenames)
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/application.py", line 342, in build
    self.builder.build_all()
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 260, in build_all
    self.build(None, summary=__('all source files'), method='all')
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 361, in build
    self.write(docnames, list(updated_docnames), method)
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 535, in write
    self._write_serial(sorted(docnames))
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 545, in _write_serial
    self.write_doc(docname, doctree)
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx_rst_builder/_builder.py", line 90, in write_doc
    self.writer.write(doctree, destination)
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/docutils/writers/__init__.py", line 78, in write
    self.translate()
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx_rst_builder/_writer.py", line 39, in translate
    self.document.walkabout(visitor)
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/docutils/nodes.py", line 214, in walkabout
    if child.walkabout(visitor):
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/docutils/nodes.py", line 214, in walkabout
    if child.walkabout(visitor):
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/docutils/nodes.py", line 214, in walkabout
    if child.walkabout(visitor):
  [Previous line repeated 3 more times]
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/docutils/nodes.py", line 206, in walkabout
    visitor.dispatch_visit(self)
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx/util/docutils.py", line 468, in dispatch_visit
    method(node)
  File "/Users/ned/coverage/trunk/.tox/doc/lib/python3.8/site-packages/sphinx_rst_builder/_writer.py", line 610, in visit_versionmodified
    self.add_text(versionlabels[node['type']] % node['version'] + ': ')
KeyError: 'versionadded'

from restbuilder.

nedbat avatar nedbat commented on June 15, 2024

@davidfritzsche any thoughts about this? I would like to be able to upgrade.

from restbuilder.

nedbat avatar nedbat commented on June 15, 2024

This problem is fixed in this pull request: davidfritzsche#3

from restbuilder.

macfreek avatar macfreek commented on June 15, 2024

@davidfritzsche -- I have invited you as maintainer of this project. If you like, I'd be very pleased if you could push or merge any change that you see fit. Note that you don't need to feel obliged to do so -- if you don't have time, I can understand that. It's just that you have proven yourself to make useful contributions in the past, and I very much like those to be easy to find for other people, and that is most likely people will look in this spinx-contrib repo first. Thanks for your consideration.

from restbuilder.

macfreek avatar macfreek commented on June 15, 2024

@nedbat I should have asked you the following when you submitted this issue.

Could you test if things work fine with the code in this repository?
(You will have to change the include path and change extension = ['sphinx-rst-builder'] to extension = ['sphinxcontrib.restbuilder']).

Commit 8728a23 from June 2020 did backport some of the features in the fork from David Fritzsche. If there is something still missing, I'd be happy to see if we can backport that too, and ensure this repository is the one most up-to-date.

The only thing might still be missing is preservation of code blocks.

from restbuilder.

macfreek avatar macfreek commented on June 15, 2024

Note that this repository is of course also available at pypi, it's sphinxcontrib-restbuilder. I see I failed to push a new version after the above mentioned merge, though. I should have done that, and will do so shortly after things have settled a bit with the recent PR.

Let me know if downloading and testing is an issue for testing, and I'll do my best to replicate the issue.

from restbuilder.

nedbat avatar nedbat commented on June 15, 2024

This repo will still have the problem fixed by davidfritzsche#3, since the import here is still wrong.

I'm fine switching repos. Let me know when you are ready.

from restbuilder.

macfreek avatar macfreek commented on June 15, 2024

It seems that the versionlabels property was moved from sphinx.locale to sphinx.domains.changeset starting with Sphinx version 1.8.0 released in September 2018.

I'm happy to accept the following construct:

try:
    from sphinx.domains.changeset import versionlabels
except ImportErrror:
    # Support for Sphinx < 1.8.0
    from sphinx.locale import versionlabels

Feel free to make a PR, otherwise I'll make one later this week.

Thanks for the bug report, and my apologies that I didn't trigger on it before. Somehow the title of the issue caused me to incorrectly assume this bug was only present in the davidfritzsche release.

from restbuilder.

macfreek avatar macfreek commented on June 15, 2024

@nedbat I added this fix, but leave it open for now

  • Could you check if this works
  • I love to add a test, if you can past a short example rst snippet that triggered this bug, I'd appreciate that.
  • I will try to release a new version to pypi, that's overdue.

from restbuilder.

macfreek avatar macfreek commented on June 15, 2024

Yay about testing, because that showed another bug.

Test and fix were added in 8c678ec and 1905aa5.

from restbuilder.

macfreek avatar macfreek commented on June 15, 2024

New release will likely be in 1-2 weeks time. If you can't wait, this is how to install the development version:

git clone https://github.com/sphinx-contrib/restbuilder.git
cd restbuilder
sudo python setup.py install

from restbuilder.

nedbat avatar nedbat commented on June 15, 2024

Thanks, the versionadded issue is fixed. But there is an important difference between this repo and davidfritzsche's that I've written up in #19.

from restbuilder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.