From 4411f677cf2ab450007ead16061b9d401a04fc5b Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Mon, 17 Oct 2016 16:17:47 +0900 Subject: [PATCH] Fix #3058: Using the same 'caption' attribute in multiple 'toctree' directives results in warning / error --- CHANGES | 2 ++ sphinx/directives/other.py | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index e1fd628a4..ea744d89b 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,8 @@ Bugs fixed ---------- * #2936: Fix doc/Makefile that can't build man because doc/man exists +* #3058: Using the same 'caption' attribute in multiple 'toctree' directives + results in warning / error Release 1.4.8 (released Oct 1, 2016) ==================================== diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py index bab2f9f54..52d3e9453 100644 --- a/sphinx/directives/other.py +++ b/sphinx/directives/other.py @@ -52,9 +52,6 @@ class TocTree(Directive): env = self.state.document.settings.env suffixes = env.config.source_suffix glob = 'glob' in self.options - caption = self.options.get('caption') - if caption: - self.options.setdefault('name', nodes.fully_normalize_name(caption)) ret = [] # (title, ref) pairs, where ref may be a document, or an external link, @@ -113,7 +110,7 @@ class TocTree(Directive): # includefiles only entries that are documents subnode['includefiles'] = includefiles subnode['maxdepth'] = self.options.get('maxdepth', -1) - subnode['caption'] = caption + subnode['caption'] = self.options.get('caption') subnode['glob'] = glob subnode['hidden'] = 'hidden' in self.options subnode['includehidden'] = 'includehidden' in self.options