Skip to content

Commit 5c1727b

Browse files
Julian-OT-Dynamos
authored andcommitted
Improve docs, add docs tests and remove vendored theme (kivy#2890)
* Add doc tests, make them pass * push.yml * Added documentation step which installs [docs], checks links and builds documentation to find any errors. * Need to install to get all the dependencies, because p4a code is imported during doc generation. * Updated rest of checkout action versions to be consistent with new code. * apis.rst * http -> https * Disambiguated two modules with the same name. * buildoptions.rst * Corrected indenting * conf,py * Added language * Added two URLS to ignore that link-checker was failing even though they worked. * ext/sphinix_rtd_theme/* * Old theme did not work with Sphinx 7.0+. * Removed it from source control. Install the latest each time. * launcher.rst * This described an old feature that hasn't worked for years. Couldn't fix the links because the whole feature is gone now. Removed it. If the attempts to bring the feature back ever come to fruition, this can be restored and edited. * index.rst * Removed no-longer-existing anchor, * Removed launcher page * quickstart.rst * Removed launcher * recipe.rst * Fixed syntax error in rst. * services,rst * Fixed broken URL (and linked to project rather than bug-tracker.) * troubleshooting.rst * http->https * Link to English rather than Chinese web-sites. * setup.py * Add docs as extra. * Updated with review comments. * Fix broken links in documentation. One dead link, causing test to fail. Several permanent redirects where it is better to use the final destination. The rest
1 parent 3c05366 commit 5c1727b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+46
-3811
lines changed

.github/workflows/push.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout python-for-android
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
- name: Set up Python 3.x
2020
uses: actions/setup-python@v4
2121
with:
@@ -36,7 +36,7 @@ jobs:
3636
os: [ubuntu-latest, macOs-latest]
3737
steps:
3838
- name: Checkout python-for-android
39-
uses: actions/checkout@v3
39+
uses: actions/checkout@v4
4040
- name: Set up Python ${{ matrix.python-version }}
4141
uses: actions/setup-python@v4
4242
with:
@@ -72,7 +72,7 @@ jobs:
7272
target: testapps-service_library-aar
7373
steps:
7474
- name: Checkout python-for-android
75-
uses: actions/checkout@v3
75+
uses: actions/checkout@v4
7676
- name: Build python-for-android docker image
7777
run: |
7878
docker build --tag=kivy/python-for-android .
@@ -121,7 +121,7 @@ jobs:
121121
ANDROID_NDK_HOME: ${HOME}/.android/android-ndk
122122
steps:
123123
- name: Checkout python-for-android
124-
uses: actions/checkout@v3
124+
uses: actions/checkout@v4
125125
- name: Install python-for-android
126126
run: |
127127
source ci/osx_ci.sh
@@ -170,7 +170,7 @@ jobs:
170170
REBUILD_UPDATED_RECIPES_EXTRA_ARGS: --arch=${{ matrix.android_arch }}
171171
steps:
172172
- name: Checkout python-for-android (all-history)
173-
uses: actions/checkout@v3
173+
uses: actions/checkout@v4
174174
with:
175175
fetch-depth: 0
176176
# helps with GitHub runner getting out of space
@@ -206,7 +206,7 @@ jobs:
206206
REBUILD_UPDATED_RECIPES_EXTRA_ARGS: --arch=${{ matrix.android_arch }}
207207
steps:
208208
- name: Checkout python-for-android (all-history)
209-
uses: actions/checkout@v3
209+
uses: actions/checkout@v4
210210
with:
211211
fetch-depth: 0
212212
- name: Install python-for-android
@@ -238,3 +238,15 @@ jobs:
238238
uses: AndreMiras/coveralls-python-action@develop
239239
with:
240240
parallel-finished: true
241+
242+
documentation:
243+
runs-on: ubuntu-latest
244+
steps:
245+
- uses: actions/checkout@v4
246+
- name: Requirements
247+
run: python3 -m pip install .[docs]
248+
- name: Check links
249+
run: sphinx-build -b linkcheck doc/source doc/build
250+
- name: Generate documentation
251+
run: sphinx-build doc/source doc/build
252+

doc/source/apis.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Requires `Permission.WRITE_EXTERNAL_STORAGE` to read and write to.
4848
Read more on all the different storage types and what to use them for
4949
in the Android documentation:
5050

51-
https://developer.android.com/training/data-storage/files
51+
https://developer.android.com/training/data-storage
5252

5353
A note on permissions
5454
~~~~~~~~~~~~~~~~~~~~~
@@ -148,7 +148,7 @@ Observing Activity result
148148

149149
.. module:: android.activity
150150

151-
The default PythonActivity has a observer pattern for `onActivityResult <http://developer.android.com/reference/android/app/Activity.html#onActivityResult(int, int, android.content.Intent)>`_ and `onNewIntent <http://developer.android.com/reference/android/app/Activity.html#onNewIntent(android.content.Intent)>`_.
151+
The default PythonActivity has a observer pattern for `onActivityResult <https://developer.android.com/reference/android/app/Activity#onActivityResult(int, int, android.content.Intent)>`_ and `onNewIntent <https://developer.android.com/reference/android/app/Activity.html#onNewIntent(android.content.Intent)>`_.
152152

153153
.. function:: bind(eventname=callback, ...)
154154

@@ -193,8 +193,6 @@ Example::
193193
Activity lifecycle handling
194194
~~~~~~~~~~~~~~~~~~~~~~~~~~~
195195

196-
.. module:: android.activity
197-
198196
The Android ``Application`` class provides the `ActivityLifecycleCallbacks
199197
<https://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks>`_
200198
interface where callbacks can be registered corresponding to `activity
@@ -241,7 +239,7 @@ Receiving Broadcast message
241239
.. module:: android.broadcast
242240

243241
Implementation of the android `BroadcastReceiver
244-
<http://developer.android.com/reference/android/content/BroadcastReceiver.html>`_.
242+
<https://developer.android.com/reference/android/content/BroadcastReceiver.html>`_.
245243
You can specify the callback that will receive the broadcast event, and actions
246244
or categories filters.
247245

@@ -308,7 +306,7 @@ Runnable
308306
.. module:: android.runnable
309307

310308
:class:`Runnable` is a wrapper around the Java `Runnable
311-
<http://developer.android.com/reference/java/lang/Runnable.html>`_ class. This
309+
<https://developer.android.com/reference/java/lang/Runnable.html>`_ class. This
312310
class can be used to schedule a call of a Python function into the
313311
`PythonActivity` thread.
314312

@@ -443,5 +441,5 @@ sometimes a little more involved, particularly if making Java classes
443441
from Python code), but it's not Pythonic and it's not short. These are
444442
problems that Plyer, explained below, attempts to address.
445443

446-
You can check the `Pyjnius documentation <https://pyjnius.readthedocs.io/en/stable/>`_ for further details.
444+
You can check the `Pyjnius documentation <https://pyjnius.readthedocs.io/en/latest/>`_ for further details.
447445

doc/source/buildoptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ options (this list may not be exhaustive):
6262
Since Android ignores ``android:screenOrientation`` when in multi-window mode
6363
(Which is the default on Android 12+), this option will also set the window orientation hints
6464
for the SDL bootstrap. If multiple orientations are given,
65-
``android:screenOrientation`` will be set to ``unspecified``.
65+
``android:screenOrientation`` will be set to ``unspecified``.
6666
- ``--manifest-orientation``: The orientation that will be set for the ``android:screenOrientation``
6767
attribute of the activity in the ``AndroidManifest.xml`` file. If not set, the value
6868
will be synthesized from the ``--orientation`` option.

doc/source/conf.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
#
7373
# This is also used if you do content translation via gettext catalogs.
7474
# Usually you set "language" from the command line for these cases.
75-
language = None
75+
language = 'en'
7676

7777
# There are two options for replacing |today|: either, you set today to some
7878
# non-false value, then it is used:
@@ -293,4 +293,14 @@
293293

294294

295295
# Example configuration for intersphinx: refer to the Python standard library.
296-
intersphinx_mapping = {'https://docs.python.org/': None}
296+
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
297+
298+
# Ignore some troublesome links that are actually fine.
299+
linkcheck_ignore = [
300+
# Special characters in URL seems to confuse link-checker.
301+
r"https://developer.android.com/reference/android/app/Activity#onActivity.*",
302+
303+
# GitHub parses anchor tags differently to pure HTML
304+
r"https://github.com/kivy/python-for-android/blob.*",
305+
]
306+

doc/source/ext/sphinx_rtd_theme/.gitignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

doc/source/ext/sphinx_rtd_theme/Gemfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

doc/source/ext/sphinx_rtd_theme/Gemfile.lock

Lines changed: 0 additions & 16 deletions
This file was deleted.

doc/source/ext/sphinx_rtd_theme/Gruntfile.js

Lines changed: 0 additions & 105 deletions
This file was deleted.

doc/source/ext/sphinx_rtd_theme/LICENSE

Lines changed: 0 additions & 20 deletions
This file was deleted.

doc/source/ext/sphinx_rtd_theme/MANIFEST.in

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)