From 1bc56f9a1b0883c9d0fddbd8020ef6a47c4e2f03 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 13 Feb 2020 17:33:56 +0900 Subject: [PATCH] Close #7144: Add CSS class indicating its domain for each desc node --- CHANGES | 1 + sphinx/directives/__init__.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index d27b6cd07b4..43bf4496102 100644 --- a/CHANGES +++ b/CHANGES @@ -48,6 +48,7 @@ Features added * #3077: Implement the scoping for :rst:dir:`productionlist` as indicated in the documentation. * #1027: Support backslash line continuation in :rst:dir:`productionlist`. +* #7144: Add CSS class indicating its domain for each desc node Bugs fixed ---------- diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py index 9a2fb441205..81c9ce99257 100644 --- a/sphinx/directives/__init__.py +++ b/sphinx/directives/__init__.py @@ -160,6 +160,8 @@ def run(self) -> List[Node]: # 'desctype' is a backwards compatible attribute node['objtype'] = node['desctype'] = self.objtype node['noindex'] = noindex = ('noindex' in self.options) + if self.domain: + node['classes'].append(self.domain) self.names = [] # type: List[Any] signatures = self.get_signatures()