Port documentation to build via Python3

This commit is contained in:
Saurabh Chaturvedi 2020-02-09 03:27:26 +05:30
parent 2d4f24ac48
commit ed9df1e6bd
2 changed files with 7 additions and 9 deletions

View File

@ -68,9 +68,7 @@ buildsphinx:
if [ ! -e $(SPHINXBUILD) ]; then \
mkdir $(BUILDDIR); \
cd $(BUILDDIR); \
curl -OL $(VENV_URL); \
tar zxvf $(VENV_VERSION).tar.gz; \
python2 ./$(VENV_VERSION)/virtualenv.py venv; \
python3 -m venv venv; \
fi
. $(VENVDIR)/bin/activate && \
cp .pip.conf $(VENVDIR)/pip.conf && \

View File

@ -502,7 +502,7 @@ class RubyModuleIndex(Index):
ignores = self.domain.env.config['modindex_common_prefix']
ignores = sorted(ignores, key=len, reverse=True)
# list of all modules, sorted by module name
modules = sorted(self.domain.data['modules'].iteritems(),
modules = sorted(iter(self.domain.data['modules'].items()),
key=lambda x: x[0].lower())
# sort out collapsable modules
prev_modname = ''
@ -551,7 +551,7 @@ class RubyModuleIndex(Index):
collapse = len(modules) - num_toplevels < num_toplevels
# sort by first letter
content = sorted(content.iteritems())
content = sorted(content.items())
return content, collapse
@ -609,10 +609,10 @@ class RubyDomain(Domain):
]
def clear_doc(self, docname):
for fullname, (fn, _) in self.data['objects'].items():
for fullname, (fn, _) in list(self.data['objects'].items()):
if fn == docname:
del self.data['objects'][fullname]
for modname, (fn, _, _, _) in self.data['modules'].items():
for modname, (fn, _, _, _) in list(self.data['modules'].items()):
if fn == docname:
del self.data['modules'][modname]
@ -704,9 +704,9 @@ class RubyDomain(Domain):
contnode, name)
def get_objects(self):
for modname, info in self.data['modules'].iteritems():
for modname, info in self.data['modules'].items():
yield (modname, modname, 'module', info[0], 'module-' + modname, 0)
for refname, (docname, type) in self.data['objects'].iteritems():
for refname, (docname, type) in self.data['objects'].items():
yield (refname, refname, type, docname, refname, 1)