Laurens Valk
b101d1992d
ubuiltins.print: Use English.
2021-08-05 12:32:51 +02:00
Laurens Valk
b013204f88
ubuiltins.input: Say what it does.
...
The docstring said something about an argument, but not what this function is for.
2021-08-05 12:32:47 +02:00
Laurens Valk
b3c5353dd6
ubuiltins: Reorganize page.
...
Fixes https://github.com/pybricks/pybricks-api/issues/80
2021-08-05 12:32:41 +02:00
Laurens Valk
0ecf536cda
ubuiltins: Add compatibility everywhere.
...
This lets us sort everything by category or alphabetically without having to make special categories for Move Hub.
2021-08-05 12:32:37 +02:00
David Lechner
f2124615ba
ubuiltins: List decorators in separate section.
...
This moves the built-in decorators to their own section and uses
`autodecorator` to indicate they are decorators.
2021-08-05 12:32:29 +02:00
Laurens Valk
49ade9d9c6
pybricks.robotics: Show compatibility.
2021-08-05 12:32:03 +02:00
Laurens Valk
045312921e
pybricks.geometry: Show compatibility.
2021-08-05 12:32:03 +02:00
Laurens Valk
39f58b9e03
pybricks.tools: Show compatibility.
2021-08-05 12:32:03 +02:00
Laurens Valk
a0467b8d8e
doc/common/requirements: Fix image paths.
...
This ensures that the requirements directive works regardless of the depth of the document in the tree.
2021-08-05 12:32:03 +02:00
Laurens Valk
4945156d9a
pybricks.parameters: Show compatibility.
2021-08-05 12:32:03 +02:00
Laurens Valk
97b2de46ac
pybricks.hubs: Show compatibility.
2021-08-05 12:32:03 +02:00
Laurens Valk
e8d7281626
doc/common/requirements: A hub supports itself.
...
This way we can do the following, which is useful if it cannot be expressed in terms of other requirements.
.. pybricks-requirements:: movehub
A good example is on the specific hub page itself. The Move Hub requires the Move Hub.
2021-08-05 12:32:03 +02:00
Laurens Valk
979da8b170
pybricks.pupdevices: Show compatibility.
2021-08-05 12:32:03 +02:00
Laurens Valk
ac4a913be3
doc/common/requirements: Toggle hub table.
...
This makes it possible to hide/unhide the compatibility table.
It is adapted from the sphinxcontrib-contentui extension: https://github.com/ulrobix/sphinxcontrib-contentui
2021-08-05 12:32:03 +02:00
Laurens Valk
31a30f380f
doc/common/requirements: Rename to static.
...
We will work on a version that can be toggled dynamically. It will just include this static version. This keeps things simple and still lets
us use the static version as needed.
2021-08-05 12:32:03 +02:00
Laurens Valk
87dacfbf76
doc/common/extensions/requirements: Allow none.
...
With no requirements imposed, this means all hubs will work.
2021-08-05 12:32:03 +02:00
Laurens Valk
b02895e5fc
ubuiltins: Use raw strings for inline math.
...
This resolves the following warnings:
./src/ubuiltins/__init__.py:143:31: W605 invalid escape sequence '\l'
./src/ubuiltins/__init__.py:143:38: W605 invalid escape sequence '\l'
./src/ubuiltins/__init__.py:174:31: W605 invalid escape sequence '\l'
./src/ubuiltins/__init__.py:174:38: W605 invalid escape sequence '\l'
2021-08-05 12:32:21 +02:00
Laurens Valk
486ac60ea0
ubuiltins.bool: Clarify docs.
...
Avoid double and triple negatives.
2021-08-05 12:32:17 +02:00
Laurens Valk
a3b6507a15
ubuiltins.bytes: Clarify docs.
2021-08-05 12:32:14 +02:00
Laurens Valk
75bc15f071
ubuiltins: Add bytearray.
2021-08-05 12:32:03 +02:00
Laurens Valk
0b9280a8df
uerrno: Display on separate page.
...
Fixes https://github.com/pybricks/pybricks-api/issues/78
2021-08-02 11:01:20 +02:00
David Lechner
677656f669
pybricks.robotics.DriveBase: Fix arg name in type hints.
...
This fixes the `speed` arg name in the `DriveBase.drive()` method in the type hint file. Fixes #76 .
2021-07-30 15:27:09 -05:00
Laurens Valk
a8ab8b2314
pybricks.pupdevices.Motor: Add reset_angle kwarg.
...
Documents https://github.com/pybricks/support/issues/389
2021-07-28 16:07:53 +02:00
Laurens Valk
62bb262b96
pybricks.pupdevices.Remote: Add more examples.
2021-07-28 14:50:43 +02:00
Laurens Valk
8463206f8e
pybricks.pupdevices.Remote: Add name().
...
https://github.com/pybricks/support/issues/404
2021-07-28 13:41:00 +02:00
Laurens Valk
1cf6f8d31b
pybricks.iodevices: Document availability.
2021-07-27 15:55:38 +02:00
Laurens Valk
a0bd4a6812
doc/common/extensions: Show compatibility on hub.
...
This simplifies the table and reduces its size.
Also copy assets manually since Sphinx does not automatically copy
images to _images when used for custom directives.
2021-07-27 15:43:13 +02:00
Laurens Valk
efc907fb0c
doc/main: Add hub compatibility icons.
...
Also render to git tree.
2021-07-27 14:56:11 +02:00
Laurens Valk
be0903de9e
doc/common/extensions: Basic styling.
...
Turns it into a table with images, using builtin RTD classes for CSS.
2021-07-26 15:47:02 +02:00
Laurens Valk
20361971da
doc/main/images: Crop City Hub.
...
This hub had extra whitespace so they were all the same height, but this is no longer needed in the current layout.
2021-07-26 15:03:42 +02:00
Laurens Valk
cefa78270a
doc/common/extensions: Add requirements directive.
...
Displays compatibility for each hub depending on its features.
2021-07-26 12:18:55 +02:00
Laurens Valk
1f5eb1790b
doc/main/package: Reenable warnings as errors.
...
This gets disabled when overriding SPHINXOPTS.
2021-07-23 15:59:33 +02:00
Laurens Valk
84335d0032
doc/make: Build main doc target by default.
...
Less typing is better.
2021-07-23 15:46:58 +02:00
Laurens Valk
cb74f8e302
doc/main: Move signals to Pybricks TOC.
...
This was the only remaining section under "extras", so it is better to have it elsewhere. Since it only applies to the Pybricks package, put it there.
Also rename Pybricks Modules heading to Pybricks Package, since it behaves more like a package in contrast with the MicroPython modules that we now document as well.
2021-07-23 15:38:05 +02:00
Laurens Valk
78bd21b197
pybricks.common.Control: Drop feed_forward.
...
The implementation no longer includes this, so it is removed from the docs as well.
Fixes https://github.com/pybricks/pybricks-api/issues/74
2021-07-23 15:35:13 +02:00
Laurens Valk
24bba6d24c
pybricks.pupdevices.Motor: Document control here.
...
Based on user feedback, we learned that the control attribute is used more frequently than anticipated. Therefore it makes sense to document it here, just like we do with instances of pybricks.common classes in hubs.
This makes it a bit easier to find and see how it is used, along with some of the existing examples.
2021-07-23 15:33:18 +02:00
Laurens Valk
0edddbb0c2
pybricks.common.Control: Fix scale doc.
...
Document it as an attribute instead of in the main docstring. This way we can choose where it shows up in the docs.
2021-07-23 14:51:21 +02:00
Laurens Valk
a11af0845b
doc/main/motors: Drop commented sections.
...
This is not going to be completed here in the API docs.
2021-07-23 14:37:28 +02:00
Laurens Valk
3b71bce0b0
doc/main: Build IDE docs from main docs.
...
With EV3 dropped from the 3.X documentation, the main docs are now nearly identical to the IDE docs, save for some layout changes.
Having just one set of docs is easier to maintain. This drops the IDE doc target.
2021-07-23 12:56:33 +02:00
Laurens Valk
434ff5e346
doc/common/conf: Keep IDE conf settings.
...
We are going to be deleting the ide build files, so make sure we keep what's needed.
2021-07-23 12:45:30 +02:00
Laurens Valk
f7239fc9a9
pybricks.parameters.Port: Drop EV3 sensor ports.
...
We can restore these if the docs cover EV3 once more.
2021-07-23 12:35:46 +02:00
Laurens Valk
7e13611bc5
doc/common/conf: Default to main on RTD.
...
It would be nicer to specify this in the .readthedocs.yaml file, but this appears to not to be supported.
2021-07-23 12:34:10 +02:00
Laurens Valk
78feab8949
pybricks.tools: Drop Datalog class from doc.
...
We can unhide this if/when we support this on Powered Up.
2021-07-23 11:35:32 +02:00
Laurens Valk
f692e5a127
pybricks.iodevices: Drop EV3 specific devices.
...
Some of these could be brought back if we add Powered Up support.
2021-07-23 11:32:01 +02:00
Laurens Valk
fbd843cb54
doc/main/index: Unify IDE and main build.
...
The `only` directive can be used to include content selectively. It cannot be used to select a different TOC, which is why we resorted to separate doc builds before.
Now that we have dropped EV3 references from the docs, we can use a single build and just customize the content on the landing page with the only directive.
The docs can now be built with:
# Main docs:
make -C doc html SPHINXOPTS=-tmain
# IDE docs:
make -C doc html SPHINXOPTS=-tide
2021-07-23 11:25:51 +02:00
Laurens Valk
e4c7e5abeb
doc/common/conf: Drop class method hack.
...
This can be traced back to 0013a74d72 and 92e3735d63 .
It was used to work around things like
sound.beeps(number)
Description
being incorrectly displayed as
classmethod sound.beeps(number)
Description
But the current version of sphinx appears to display this correctly even without the hack. We want to reduce the number of hacks because they tend to break updates (https://github.com/pybricks/pybricks-api/issues/69#issuecomment-879822417 ).
2021-07-23 11:04:03 +02:00
Laurens Valk
8d521c1b1f
doc/common/conf: Drop EV3 hack.
...
This is no longer required, perhaps not even for EV3. For example, PrimeHub.speaker looks as intended.
We want to reduce the number of hacks because they tend to break updates (https://github.com/pybricks/pybricks-api/issues/69#issuecomment-879822417 ).
2021-07-23 10:48:07 +02:00
Laurens Valk
1be7fce116
doc/main: Drop EV3 references.
...
To make the documentation easier to use and maintain, EV3 content will be hidden.
The stable 2.0 docs should be used for EV3 instead.
2021-07-23 10:41:34 +02:00
Laurens Valk
5ab81dc732
doc/main: Update landing page with link to EV3.
2021-07-21 19:27:45 +02:00
Laurens Valk
72e0d87f77
ubuiltins: Examples for common exceptions.
2021-07-21 14:53:56 +02:00