Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/833995 )
Change subject: [doc] Update category.py documentation ......................................................................
[doc] Update category.py documentation
- explain "clean" action - update pywikibot_script_docstring_fixups
Bug: T318239 Change-Id: I87eabfdea79c0d693e84e996492f05e3324bf4af --- M docs/conf.py M scripts/category.py 2 files changed, 24 insertions(+), 14 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Verified; Looks good to me, approved
diff --git a/docs/conf.py b/docs/conf.py index 3efa97a..b17aabb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -426,7 +426,7 @@ lines[0] = '**{}**'.format(line.strip('.')) elif line == '¶ms;': lines[index] = ('This script supports use of ' - ':py:mod:`pywikibot.pagegenerators` arguments.') + ':py:mod:`pagegenerators` arguments.') elif name == 'scripts.replace' and line == '&fixes-help;': lines[index] = (' The available fixes are listed ' 'in :py:mod:`pywikibot.fixes`.') diff --git a/scripts/category.py b/scripts/category.py index cb04077..3b25670 100755 --- a/scripts/category.py +++ b/scripts/category.py @@ -1,6 +1,5 @@ #!/usr/bin/python3 -""" -Script to manage categories. +"""Script to manage categories.
Syntax:
@@ -8,13 +7,22 @@
where action can be one of these
- * add - mass-add a category to a list of pages. - * remove - remove category tag from all pages in a category. - * move - move all pages in a category to another category. - * tidy - tidy up a category by moving its pages into subcategories. - * tree - show a tree of subcategories of a given category. - * listify - make a list of all of the articles that are in a category. - * clean - automatically clean specified category. +*add* + mass-add a category to a list of pages. +*remove* + remove category tag from all pages in a category. +*move* + move all pages in a category to another category. +*tidy* + tidy up a category by moving its pages into subcategories. +*tree* + show a tree of subcategories of a given category. +*listify* + make a list of all of the articles that are in a category. +*clean* + Removes redundant grandchildren from specified category by removing + direct link to grandparent. In another words a grandchildren should + not be also a children.
and option can be one of these
@@ -1361,11 +1369,13 @@
Stubs categories are exception.
- .. versionadded:: 7.0 + .. note:: For details please read:
- For details please read: - https://en.wikipedia.org/wiki/WP:SUBCAT - https://en.wikipedia.org/wiki/WP:DIFFUSE + - https://en.wikipedia.org/wiki/WP:SUBCAT + + - https://en.wikipedia.org/wiki/WP:DIFFUSE + + .. versionadded:: 7.0 """
update_options = {
pywikibot-commits@lists.wikimedia.org