forked from orbit-oss/flask
Tweaked autodoc to skip :internal: methods.
This commit is contained in:
parent
02a1317460
commit
ae00f6d149
3 changed files with 21 additions and 3 deletions
16
docs/flaskdocext.py
Normal file
16
docs/flaskdocext.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import re
|
||||
import inspect
|
||||
|
||||
|
||||
_internal_mark_re = re.compile(r'^\s*:internal:\s*$(?m)')
|
||||
|
||||
|
||||
def skip_member(app, what, name, obj, skip, options):
|
||||
docstring = inspect.getdoc(obj)
|
||||
if skip:
|
||||
return True
|
||||
return _internal_mark_re.search(docstring or '') is not None
|
||||
|
||||
|
||||
def setup(app):
|
||||
app.connect('autodoc-skip-member', skip_member)
|
||||
Loading…
Add table
Add a link
Reference in a new issue