File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 77import sys
88import os
99import sphinx .ext .autodoc
10+ import sphinx .transforms
11+ import docutils .nodes
1012
1113# --- Pre-processing Tasks
1214
@@ -267,10 +269,23 @@ def add_directive_header(self, sig: str) -> None:
267269 strings .pop ()
268270 return r
269271
272+ class Transform (sphinx .transforms .SphinxTransform ):
273+ default_priority = 800
274+ def apply (self ):
275+ self .document .walk (Visitor (self .document ))
276+ class Visitor (docutils .nodes .SparseNodeVisitor ):
277+ def visit_desc_annotation (self , node ):
278+ # Remove `property` prefix from properties so they look the same as
279+ # attributes
280+ if 'property' in node .astext ():
281+ node .parent .remove (node )
282+
283+
270284def setup (app ):
271285 app .add_css_file ("css/custom.css" )
272286 app .add_autodocumenter (ClassDocumenter )
273287 app .connect ('source-read' , source_read )
274288 app .connect ('build-finished' , post_process )
275289 app .connect ("autodoc-process-docstring" , warn_undocumented_members )
276290 app .connect ('autodoc-process-bases' , on_autodoc_process_bases )
291+ app .add_transform (Transform )
You can’t perform that action at this time.
0 commit comments