jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[sphinx] Add fixup for Initializer

Change-Id: I0260a96574affb4a49a31e7aaa9763ce3a7d2b6e
---
M docs/conf.py
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index 7faaa7f..7b28b2d 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -396,6 +396,15 @@
lines[:] = result[:] # assignment required in this way


+def pywikibot_docstring_fixups(app, what, name, obj, options, lines):
+ """Fixup docstrings."""
+ if what != 'class':
+ return
+
+ if lines and lines[0] == 'Initializer.':
+ lines[:] = lines[2:]
+
+
def pywikibot_script_docstring_fixups(app, what, name, obj, options, lines):
"""Pywikibot specific conversions."""
from scripts.cosmetic_changes import warning
@@ -408,9 +417,7 @@

length = 0
for index, line in enumerate(lines):
- if line == 'Initializer.':
- lines[index] = ''
- elif line == '&params;':
+ if line == '&params;':
lines[index] = ('This script supports use of '
':py:mod:`pywikibot.pagegenerators` arguments.')
elif name == 'scripts.replace' and line == '&fixes-help;':
@@ -490,6 +497,7 @@
def setup(app):
"""Implicit Sphinx extension hook."""
app.connect('autodoc-process-docstring', pywikibot_epytext_to_sphinx)
+ app.connect('autodoc-process-docstring', pywikibot_docstring_fixups)
app.connect('autodoc-process-docstring', pywikibot_script_docstring_fixups)
app.connect('autodoc-skip-member', pywikibot_skip_members)
app.add_autodoc_attrgetter(type, pywikibot_family_classproperty_getattr)

To view, visit change 676809. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I0260a96574affb4a49a31e7aaa9763ce3a7d2b6e
Gerrit-Change-Number: 676809
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged