diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-04-05 18:23:29 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-04-05 18:23:29 +0300 |
commit | 4860b451f2abab11255ecb87449638f0113e2300 (patch) | |
tree | 9322af37c3c2682bc3f3a876408743f22330f3fe /sphinx/directives | |
parent | 50fd2ff51056d7f000a9e3ebeb7c4b6e5a84e387 (diff) | |
parent | 713bbf5cafa3fc5e143ced59dafe56f4b802ef80 (diff) |
Merge branch '3.x'
Diffstat (limited to 'sphinx/directives')
-rw-r--r-- | sphinx/directives/__init__.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py index 48e9238f4..a29a51d95 100644 --- a/sphinx/directives/__init__.py +++ b/sphinx/directives/__init__.py @@ -125,6 +125,15 @@ class ObjectDescription(SphinxDirective): """ pass + def transform_content(self, contentnode: addnodes.desc_content) -> None: + """ + Called after creating the content through nested parsing, + but before the ``object-description-transform`` event is emitted, + and before the info-fields are transformed. + Can be used to manipulate the content. + """ + pass + def after_content(self) -> None: """ Called after parsing content. Used to reset information about the @@ -197,6 +206,7 @@ class ObjectDescription(SphinxDirective): self.env.temp_data['object'] = self.names[0] self.before_content() self.state.nested_parse(self.content, self.content_offset, contentnode) + self.transform_content(contentnode) self.env.app.emit('object-description-transform', self.domain, self.objtype, contentnode) DocFieldTransformer(self).transform_all(contentnode) |