Commit Graph
122 Commits
Author SHA1 Message Date
Laurens Valk bc70549edd pyproject: Re-enable rtd-theme. 2026-08-24 17:28:00 +02:00
Laurens Valk 9bd82f7246 doc: Replace fork with extensions.
Use clean upstream Sphinx and use extensions for the awaitable types and work around a Sphinx docstring parsing bug.
2026-08-24 11:01:50 +02:00
Laurens Valk 1fca5c8ad9 all: Build with plain modern sphinx.
Updated for various Sphinx API changes.

Also drop rendered math. Simpler and makes the plain Python docstrings look better in jedi.

```
:math:`0 \leq x \leq 255`.
```

just becomes 0 ≤ x ≤ 255.

Also drop Latex dependencies. We don't rely on the PDF and don't need it for math anymore.
2026-08-24 10:30:57 +02:00
Laurens Valk cab110d4c1 all: Format with ruff. 2026-08-24 09:28:29 +02:00
Laurens Valk 1df788d716 poetry: Drop customizations.
Prepare for an updated Sphinx with a modern theme.
2026-08-24 09:27:25 +02:00
Laurens Valk 9acbdb8367 conf: Build a json symbol index on build.
Ship it with the docs so we can parse it in Pybricks for namespace based lookup.
2026-06-01 16:38:34 +02:00
Laurens Valk 6686fce3c3 pybricks.pupdevices: Document MarioHub, TechnicMoveHub and DuploTrain. 2026-05-29 16:59:51 +02:00
Laurens Valk 47a3d664c2 pybricks.iodevices: Include all classes in index.
Some were omitted once EV3 in Pybricks 2.0 was dropped, but they will be included again to prepare for EV3 in Pybricks 4.0.

Enable for Powered UP where relevant, as with UARTDevice.
2026-05-29 14:22:15 +02:00
Laurens Valk 1f8f0f777a pybricks.iodevices: Update PUPDevice and LUMPDevice.
Also remove Ev3devSensor, which is no longer used.
2026-05-29 12:30:58 +02:00
Laurens Valk a2ba8e4dcd pybricks.hubs: Move .ble to BLERadio.
Follows upstream firmware change.

Update tests and examples too.
2026-05-29 11:12:50 +02:00
Laurens Valk 5b56249d8c doc/common/extensions: Drop unused imports. 2025-05-01 11:19:48 +02:00
Laurens Valk 2380be2814 extensions/blockimg: Embed svg.
This cuts the total build from 527 to 156 files,
which is considerably fewer requests when loading
this inside Pybricks Code.

See https://github.com/pybricks/support/issues/1559
2025-02-26 10:58:03 +01:00
Laurens Valk 89a34e9f51 conf: Don't export txt sources.
The sources are hosted on GitHub, so there is not additional information here. Also, the actual docstrings are included in the .py files.

See https://github.com/pybricks/support/issues/1559
2025-02-26 10:17:08 +01:00
Laurens Valk d3ca8ee719 pybricks.iodevices: Add XboxController. 2024-02-11 14:26:03 +01:00
Laurens Valk b4adb50adf pybricks.robotics: Add Car class. 2024-01-25 20:38:02 +01:00
Laurens Valk 2b1f161005 v3.4.0b1 2023-11-28 15:12:05 +01:00
Laurens Valk 4d864737ae blocks: Experiment with block documentation. 2023-11-28 15:06:35 +01:00
Laurens Valk b97eef8152 conf: Fix RTD theme.
Fixes https://github.com/pybricks/pybricks-api/issues/150
2023-10-23 20:49:35 +02:00
Laurens Valk 397663d631 poetry: Update deps and fix Sphinx breakage. 2023-10-23 15:30:19 +02:00
David Lechner 3274cef849 pybricks.common: Add new BLE class.
This adds a new BLE class that is used for connectionless broadcasting/
observing on hubs with built-in Bluetooth Low Energy.

Also see https://github.com/pybricks/pybricks-micropython/pull/158.
2023-05-16 14:46:53 -05:00
David Lechner 8e5891d9e8 all: spelling
Misc spelling fixes.
2023-05-10 14:16:15 -05:00
Laurens Valk 9cde749e8a pybricks.geometry: Drop module.
See https://github.com/pybricks/pybricks-micropython/pull/160
2023-04-21 13:33:19 +02:00
Laurens Valk 8bca5eb6e4 pybricks.robotics: Add GyroDriveBase. 2023-04-21 10:42:30 +02:00
Laurens Valk d9dfd0e370 doc/common/extensions: Separate checkmark from image.
This makes it easier to see when the images are small.

Fixes: https://github.com/pybricks/support/issues/838
2022-12-09 08:35:33 +01:00
David Lechner 8bfc2e10c8 doc: Use Pybricks blue.
This changes the navbar background color to use the official Pybricks
blue color.
2022-12-08 17:16:32 -06:00
David Lechner 3418c8320c doc/common/css/ide: improve styling of field list
The default style of using a grid with two columns wastes space when
displayed in a narrow pane, like in Pybricks Code. Using flex with
column direction makes it flow from top to bottom.

Fixes: https://github.com/pybricks/support/issues/832
2022-12-07 20:21:47 +01:00
Laurens Valk ac23a9bb59 pybricks.common.Motor: Document compatibility.
Control methods are not available on Move Hub.

Fixes: https://github.com/pybricks/pybricks-api/issues/106
2022-12-02 12:15:25 +01:00
Laurens Valk d2b1b2183b pybricks.parameters.Icon: Document it.
Fixes https://github.com/pybricks/pybricks-api/issues/107
2022-11-10 16:38:44 +01:00
Laurens Valk be3558167e doc/common/extensions: Fix compatibility labels.
Fixes https://github.com/pybricks/support/issues/754
2022-10-27 15:41:42 +02:00
Laurens Valk e1be50181a doc/main: Revisit and automate all renders and diagrams.
Previously, all renders were created and added manually when a newly
supported device was added to the documentation.

This commit revisits all diagrams by creating them using a single
LDRAW multi-file part model and LPUB3D building instructions file.

This makes perspective and resolution consistent across all images, and
we could update them all at once if needed.

It also removes the background from all images so they can be used
with different documentation themes.
2022-10-10 09:19:49 +02:00
David Lechner 03ee7f74e8 doc/pup/essentialhub: fix bit rot
This fixes bitrot for PR #96. Also fixes a few minor issues where
changes were missed.
2022-06-29 12:08:33 -05:00
David Lechner a2d9c33eb5 jedi: add new pybricks_jedi package
This package will be used in Pybricks Code to provide some intellesense
operations.
2022-06-24 14:52:45 -05:00
Laurens Valk 8e7fc53974 doc/main: Disable NXT and EV3 pages again.
Now that all typehints have been added, we can
revert commit 4c583a9d4e again.
2022-06-10 11:20:32 +02:00
Laurens Valk 8ec1b18629 pybricks.parameters: Add typing, part 2. 2022-06-10 10:33:33 +02:00
Laurens Valk c77682f50d pybricks.iodevices: Add typing. 2022-06-10 10:05:11 +02:00
Laurens Valk 4c583a9d4e doc/main: Enable NXT and EV3 pages.
This will help us review the pages as we add typing to the documentation. Then they will be hidden again.

This commit can be cherry-picked later on if we ever enable NXT and EV3 content again.
2022-06-10 10:05:10 +02:00
Laurens Valk 0688b8dded doc/common/conf.py: Add missing units.
These are used for NXT sensors.
2022-06-10 10:05:10 +02:00
Laurens Valk dbc5d327e3 doc/common/conf: Display s^2 units correctly.
Now that we no longer use these in hyperlinks, we can use the right
unicode to display this unit correctly.
2022-05-30 17:29:30 +02:00
Laurens Valk 2167b9d52d pybricks.common.ColorLight: Add typing.
Also remove pybricks.common.Light which isn't used anywhere.

pupdevices.Light is a standalone light that does not support animations or blinks, so don't inherit from this nonexistent class.

Also remove the ColorLight.reset() method which was never implemented.
2022-05-27 20:00:28 +02:00
Laurens Valk aaf3ad1b9c pybricks.common.Control: Add typing. 2022-05-27 17:15:24 +02:00
Laurens Valk bd7806d2d4 all: Format with black.
Also activate auto formatting. Bump flake8 and mark black
disagreements in setup.cfg.
2022-05-27 16:22:05 +02:00
Laurens Valk 24f7d7c288 pybricks.common.Motor: Add typing. 2022-05-27 16:01:18 +02:00
Laurens Valk 5e0ba1de07 doc/common/conf: Format units in return type.
This formats return types so they don't look like tuples:

int: deg

If we can figure out how these nodes work, we can create proper links
and maybe use italics for the units or a slightly different font color.
2022-05-27 14:59:32 +02:00
Laurens Valk c4a09ab62a pybricks.common.DCMotor: Add typing. 2022-05-09 15:05:09 +02:00
Laurens Valk 5e9a8c5737 doc/main/signaltypes: Change how units are documented.
Previously, arguments had "types" like ":ref:`speed`", which would be rendered by Sphinx as a hyperlink and displayed as "rotational speed: deg/s".

This worked well enough but it had a few shortcomings:
- It looks bad on autocomplete, which doesn't know how to render RST with cross references.
- No real type information: int, float, ... ?
- Some units are very long, making the docs less concise.
- The unified approach doesn't always work. Some method arguments can be either deg/s or mm/s, depending on the application. This gets even lengthier.
- It's hard to maintain if you don't know what to link to.

In the new approach, the unit is just added to the type as plain text. Instead of giving the physical signal name, we give the real data type, which is more standard. The physical signal name is usually apparent from the docstring anyway, and can be inferred from the unit as well. This also solves all of the above problems.

Since most Pybricks methods allow both int and float for numeric inputs, we document these as a Number type, which is the union of int and float. Since the type is no longer directly tied to the type, we can still document the return type correctly, since this is never a union.

Instead of having complicated hacks in Sphinx to make this work (I have tried many), it turns out we can conveniently suppress broken references and still display the units. The only downside is that units will no longer have hyperlinks to the signal pages, at least for the moment. We should be able to make on_missing_reference a bit smarter to format the units as we see fit if needed.

The approach here is exemplified in the Motor.run_until_stalled method. Subsequent commits will apply it everywhere. Also clarify the behavior for duty_limit=None while we are updating this code anyway.
2022-05-09 10:28:31 +02:00
Laurens Valk 93a9370790 doc/common/extensions: Hide version directives in IDE build.
Version tags can be useful to keep track of new or updated features.

This lets us hide such details in the documentation that ships with the IDE to keep it concise.
2022-04-01 09:38:41 +02:00
Laurens Valk 4101f9be79 poetry: Update Sphinx and RTD-theme.
We were not using a proper release for sphinx-rtd-theme
in order to work around some bugs. Meanwhile, a proper
release has come out, so let's upgrade to 1.0.0.

Also bump Sphinx to 4.4.

Also update and fix workarounds for cross references.
Fixes https://github.com/pybricks/pybricks-api/issues/98.
2022-03-22 15:38:04 +01:00
Pavel Lobodinský 97002948d1 pybricks.common: Refactored Speaker API to be hub specific.
The Prime/Inventor Hub Speaker allows only a subset of EV3 Speaker API. Hence, splitting the API up.
2022-01-05 12:10:11 -06:00
Laurens Valk 7d0fe9cb85 doc/common/extensions: Fix classlink.
Allow the link to be different from the name.

This lets us fix the link for the Inventor Hub, which was linking to a non-existent page.
2021-11-22 14:49:20 +01:00
Laurens Valk 4124e1dd4e doc/common/conf: Drop unused imports.
These prevent us from upgrading Sphinx and they aren't being used anyway.

Fixes e4c7e5abeb
2021-08-06 10:07:42 +02:00