summaryrefslogtreecommitdiff
path: root/sphinx/domains/math.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-08 01:11:17 +0900
committerGitHub <noreply@github.com>2021-01-08 01:11:17 +0900
commitca9342cc440bd3842dff26841d146beaf7b8c4b3 (patch)
tree286bfd6736d7971eaa9a51f7b07cad2dee34417c /sphinx/domains/math.py
parent2d53b7cd6638a579fea23186762b1a561dadeb14 (diff)
parentaf4e615a8a25c15df844cf51a2eb2647111bd472 (diff)
downloadsphinx-git-ca9342cc440bd3842dff26841d146beaf7b8c4b3.tar.gz
Merge pull request #8631 from tk0miya/6241_assets_for_specific_page
Close #6241: html: Allow to add JS/CSS files to the specific page
Diffstat (limited to 'sphinx/domains/math.py')
-rw-r--r--sphinx/domains/math.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sphinx/domains/math.py b/sphinx/domains/math.py
index 6bd93e7b5..248a7a2a6 100644
--- a/sphinx/domains/math.py
+++ b/sphinx/domains/math.py
@@ -157,8 +157,11 @@ class MathDomain(Domain):
targets = [eq for eq in self.equations.values() if eq[0] == docname]
return len(targets) + 1
- def has_equations(self) -> bool:
- return any(self.data['has_equations'].values())
+ def has_equations(self, docname: str = None) -> bool:
+ if docname:
+ return self.data['has_equations'].get(docname, False)
+ else:
+ return any(self.data['has_equations'].values())
def setup(app: "Sphinx") -> Dict[str, Any]: