![]() |
A decorator: Do not generate docs for this method.
tfdocs.doc_controls.do_not_doc_inheritable(
obj: tfdocs.doc_controls.T
) -> tfdocs.doc_controls.T
This version of the decorator is "inherited" by subclasses. No docs will be generated for the decorated method in any subclass. Even if the sub-class overrides the method.
For example, to ensure that method1
is never documented use this
decorator on the base-class:
class Parent(object):
@do_not_doc_inheritable
def method1(self):
pass
def method2(self):
pass
class Child(Parent):
def method1(self):
pass
def method2(self):
pass
This will produce the following docs:
/Parent.md
# method2
/Child.md
# method2
When generating docs for a class's arributes, the __mro__
is searched and
the attribute will be skipped if this decorator is detected on the attribute
on any class in the __mro__
.
class Example(object):
@property
@do_not_doc_inheritable
def x(self):
return self._x
Args | |
---|---|
obj
|
The class-attribute to hide from the generated docs. |
Returns | |
---|---|
obj |