Skip to content

Commit

Permalink
[doc] prevent multiple entries in Sphinx documentation
Browse files Browse the repository at this point in the history
Some classes and functions of bot module are imported in pywikibot and
can also be used as pywikibot members. Remove the documentation from
pywikibot and add a reference to bot module for them.

Change-Id: Ic9ac9604023828017e15a7854ef71ebecc29091c
  • Loading branch information
xqt committed Jun 13, 2024
1 parent ba9e4d1 commit 1d6a70d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/api_ref/bot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@
:synopsis: User-interface related functions for building bots
:member-order: bysource

.. admonition:: Imports in :mod:`pywikibot` module

The following classes and functions are inported in :mod:`pywikibot`
module and can also be used as :mod:`pywikibot` members:

- :class:`pywikibot.Bot<bot.Bot>`
- :class:`pywikibot.CurrentPageBot<bot.CurrentPageBot>`
- :class:`pywikibot.WikidataBot<bot.WikidataBot>`
- :func:`pywikibot.calledModuleName<bot.calledModuleName>`
- :func:`pywikibot.handle_args<bot.handle_args>`
- :func:`pywikibot.input<bot.input>`
- :func:`pywikibot.input_choice<bot.input_choice>`
- :func:`pywikibot.input_yn<bot.input_yn>`
- :func:`pywikibot.show_help<bot.show_help>`

.. autoclass:: BaseBot

.. attribute:: generator
Expand Down
17 changes: 17 additions & 0 deletions docs/api_ref/pywikibot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,20 @@
***********************************************

.. automodule:: pywikibot
:exclude-members: Bot, CurrentPageBot, WikidataBot, calledModuleName,
handle_args, input, input_choice, input_yn, show_help

.. admonition:: Imports from :mod:`bot` module

The following classes and functions are inported from :mod:`bot` module
but can also be used as :mod:`pywikibot` members:

- :class:`pywikibot.Bot<bot.Bot>`
- :class:`pywikibot.CurrentPageBot<bot.CurrentPageBot>`
- :class:`pywikibot.WikidataBot<bot.WikidataBot>`
- :func:`pywikibot.calledModuleName<bot.calledModuleName>`
- :func:`pywikibot.handle_args<bot.handle_args>`
- :func:`pywikibot.input<bot.input>`
- :func:`pywikibot.input_choice<bot.input_choice>`
- :func:`pywikibot.input_yn<bot.input_yn>`
- :func:`pywikibot.show_help<bot.show_help>`

0 comments on commit 1d6a70d

Please sign in to comment.