Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-11-24 18:50:36 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-02-28 11:10:57 +0300
commit3059a999b2f3a2f4b8d69c7e473a81ce70f82f3c (patch)
treec1f4ff73d463e039d80b6610fb8f0e7b79d8a429 /sphinx/environment
parent6ca7c1c579c6857985a5e8faae64a77b32dc6098 (diff)
Close #8326: Rename master_doc to root_doc
To describe the purpose more accurately, the `master_doc` is now renamed to `root_doc`. The old name is still available. But it is recommeneded to use new one from now on.
Diffstat (limited to 'sphinx/environment')
-rw-r--r--sphinx/environment/__init__.py4
-rw-r--r--sphinx/environment/adapters/toctree.py2
-rw-r--r--sphinx/environment/collectors/toctree.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py
index 28599c977..60ede8188 100644
--- a/sphinx/environment/__init__.py
+++ b/sphinx/environment/__init__.py
@@ -600,7 +600,7 @@ class BuildEnvironment:
traversed.add(subdocname)
relations = {}
- docnames = traverse_toctree(None, self.config.master_doc)
+ docnames = traverse_toctree(None, self.config.root_doc)
prevdoc = None
parent, docname = next(docnames)
for nextparent, nextdoc in docnames:
@@ -618,7 +618,7 @@ class BuildEnvironment:
included = set().union(*self.included.values()) # type: ignore
for docname in sorted(self.all_docs):
if docname not in self.files_to_rebuild:
- if docname == self.config.master_doc:
+ if docname == self.config.root_doc:
# the master file is not included anywhere ;)
continue
if docname in included:
diff --git a/sphinx/environment/adapters/toctree.py b/sphinx/environment/adapters/toctree.py
index 2e33cf702..d12055b84 100644
--- a/sphinx/environment/adapters/toctree.py
+++ b/sphinx/environment/adapters/toctree.py
@@ -315,7 +315,7 @@ class TocTree:
def get_toctree_for(self, docname: str, builder: "Builder", collapse: bool,
**kwargs: Any) -> Element:
"""Return the global TOC nodetree."""
- doctree = self.env.get_doctree(self.env.config.master_doc)
+ doctree = self.env.get_doctree(self.env.config.root_doc)
toctrees = [] # type: List[Element]
if 'includehidden' not in kwargs:
kwargs['includehidden'] = True
diff --git a/sphinx/environment/collectors/toctree.py b/sphinx/environment/collectors/toctree.py
index da0b3fe6c..aeb6ef3a6 100644
--- a/sphinx/environment/collectors/toctree.py
+++ b/sphinx/environment/collectors/toctree.py
@@ -281,7 +281,7 @@ class TocTreeCollector(EnvironmentCollector):
_walk_doctree(docname, doctree, secnum)
if env.config.numfig:
- _walk_doc(env.config.master_doc, tuple())
+ _walk_doc(env.config.root_doc, tuple())
for docname, fignums in env.toc_fignumbers.items():
if fignums != old_fignumbers.get(docname):
rewrite_needed.append(docname)