Skip to content
Myr

Tweaked autodoc to skip :internal: methods.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 02a1317 · Browse files · 3 files+21 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+21 added−3 removed

  • other:+21 added−3 removed

3 files+21 added−3 removed

modified:docs/conf.py+3 added-1 removed
15 unmodified lines
16# If extensions (or modules to document with autodoc) are in another directory,17# add these directories to sys.path here. If the directory is relative to the18# documentation root, use os.path.abspath to make it absolute, like shown here.19sys.path.append(os.path.abspath('_themes'))20sys.path.append(os.path.abspath('.'))2122# -- General configuration -----------------------------------------------------2324# If your documentation needs a minimal Sphinx version, state it here.25#needs_sphinx = '1.0'2627# Add any Sphinx extension module names here, as strings. They can be extensions28# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.28extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']29extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',30 'flaskdocext']3132# Add any paths that contain templates here, relative to this directory.33templates_path = ['_templates']34
235 unmodified lines
added:docs/flaskdocext.py+16 added
1import re2import inspect345_internal_mark_re = re.compile(r'^\s*:internal:\s*$(?m)')678def skip_member(app, what, name, obj, skip, options):9 docstring = inspect.getdoc(obj)10 if skip:11 return True12 return _internal_mark_re.search(docstring or '') is not None131415def setup(app):16 app.connect('autodoc-skip-member', skip_member)
modified:flask/app.py+2 added-2 removed
255 unmodified lines
256 #: exactly like a regular dictionary but supports additional methods257 #: to load a config from files.258 self.config = Config(self.root_path, self.default_config)259260 #: Prepare the deferred setup of the logger.260 # Prepare the deferred setup of the logger.261 self._logger = None262 self.logger_name = self.import_name263264 #: A dictionary of all view functions registered. The keys will
915 unmodified lines
1180 """Called before each request and will ensure that it triggers1181 the :attr:`before_first_request_funcs` and only exactly once per1182 application instance (which means process usually).11831184 .. versionadded:: 0.81184 :internal:1185 """1186 if self._got_first_request:1187 return1188 with self._before_request_lock:
245 unmodified lines