mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-12 08:25:01 -05:00
Closes #848: Always take the newest code in incremental rebuilds with the :mod:sphinx.ext.viewcode extension.
This commit is contained in:
1 parent
f9758086b0
commit
e5c1a81ed8
2 files changed
+14
-11
No files matched your search
@@ -99,6 +99,9 @@ Bugs fixed
|
||||
|
||||
* #1285: Avoid name clashes between C domain objects and section titles.
|
||||
|
||||
* #848: Always take the newest code in incremental rebuilds with the
|
||||
:mod:`sphinx.ext.viewcode` extension.
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
|
||||
+11
-11
@@ -24,17 +24,17 @@ def doctree_read(app, doctree):
|
||||
|
||||
def has_tag(modname, fullname, docname):
|
||||
entry = env._viewcode_modules.get(modname, None)
|
||||
if entry is None:
|
||||
try:
|
||||
analyzer = ModuleAnalyzer.for_module(modname)
|
||||
except Exception:
|
||||
env._viewcode_modules[modname] = False
|
||||
return
|
||||
try:
|
||||
analyzer = ModuleAnalyzer.for_module(modname)
|
||||
except Exception:
|
||||
env._viewcode_modules[modname] = False
|
||||
return
|
||||
if not isinstance(analyzer.code, unicode):
|
||||
code = analyzer.code.decode(analyzer.encoding)
|
||||
else:
|
||||
code = analyzer.code
|
||||
if entry is None or entry[0] != code:
|
||||
analyzer.find_tags()
|
||||
if not isinstance(analyzer.code, unicode):
|
||||
code = analyzer.code.decode(analyzer.encoding)
|
||||
else:
|
||||
code = analyzer.code
|
||||
entry = code, analyzer.tags, {}
|
||||
env._viewcode_modules[modname] = entry
|
||||
elif entry is False:
|
||||
@@ -142,7 +142,7 @@ def collect_pages(app):
|
||||
if not modnames:
|
||||
return
|
||||
|
||||
app.builder.info(' _modules/index')
|
||||
app.builder.info(' _modules/index', nonl=True)
|
||||
html = ['\n']
|
||||
# the stack logic is needed for using nested lists for submodules
|
||||
stack = ['']
|
||||
|
||||
Reference in new issue
Block a user