From 39eab3230e3713465713205cc1f47cff418f3522 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Wed, 9 Jan 2019 14:51:41 +0100 Subject: [PATCH] doc: back to explicit ev3brick and ev3devices (instead of brick and devices) After internal discussion: - This way we need to maintain only one fake API. - Autocomplete can pick up the right brick/devices. - Explicit is better than implicit. --- source/brick.rst | 55 ------------------------------------------- source/conf.py | 1 + source/devices.rst | 30 ----------------------- source/ev3brick.rst | 55 +++++++++++++++++++++++++++++++++++++++++++ source/ev3devices.rst | 30 +++++++++++++++++++++++ source/index.rst | 4 ++-- 6 files changed, 88 insertions(+), 87 deletions(-) delete mode 100644 source/brick.rst delete mode 100644 source/devices.rst create mode 100644 source/ev3brick.rst create mode 100644 source/ev3devices.rst diff --git a/source/brick.rst b/source/brick.rst deleted file mode 100644 index c25574a..0000000 --- a/source/brick.rst +++ /dev/null @@ -1,55 +0,0 @@ -:mod:`brick` -- The EV3 Programmable Brick -========================================== - - -Buttons -------- - -.. autofunction:: brick.buttons - - -Light ------ - -.. autofunction:: brick.light - - - -Sound ------ - -.. automethod:: brick.sound.beep - - -.. automethod:: brick.sound.beeps - - -.. automethod:: brick.sound.tune - - -.. automethod:: brick.sound.file - - -.. automethod:: brick.sound.speak - - -Display -------- -:: - - x - --------------> - (0, 0) __________________ - | | - | | | - y | | Hello | - | | World | - v | | - |__________________| - (177, 127) - -.. automethod:: brick.display.clear - -.. automethod:: brick.display.text - -.. automethod:: brick.display.image diff --git a/source/conf.py b/source/conf.py index ff81f65..f3dc7db 100644 --- a/source/conf.py +++ b/source/conf.py @@ -90,6 +90,7 @@ todo_include_todos = True autodoc_member_order = 'bysource' autodoc_default_flags = ['members', 'undoc-members'] autoclass_content = 'both' # This ensures init arguments are not ignored but added to class docstring. +add_module_names = False # Hide module name # -- Options for HTML output ---------------------------------------------- diff --git a/source/devices.rst b/source/devices.rst deleted file mode 100644 index cbcbc94..0000000 --- a/source/devices.rst +++ /dev/null @@ -1,30 +0,0 @@ -:mod:`devices` -- EV3 Motors and Sensors -=========================================== - -Motors ------- - -.. autoclass:: devices.Motor - -Sensors -------- - -Touch Sensor -^^^^^^^^^^^^ -.. autoclass:: devices.TouchSensor - -Color Sensor -^^^^^^^^^^^^ -.. autoclass:: devices.ColorSensor - -Infrared Sensor and Beacon -^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. autoclass:: devices.InfraredSensor - -Ultrasonic Sensor -^^^^^^^^^^^^^^^^^ -.. autoclass:: devices.UltrasonicSensor - -Gyroscopic Sensor -^^^^^^^^^^^^^^^^^ -.. autoclass:: devices.GyroSensor diff --git a/source/ev3brick.rst b/source/ev3brick.rst new file mode 100644 index 0000000..b16654d --- /dev/null +++ b/source/ev3brick.rst @@ -0,0 +1,55 @@ +:mod:`ev3brick` -- The EV3 Programmable Brick +============================================= + + +Buttons +------- + +.. autofunction:: ev3brick.buttons + + +Light +----- + +.. autofunction:: ev3brick.light + + + +Sound +----- + +.. automethod:: ev3brick.sound.beep + + +.. automethod:: ev3brick.sound.beeps + + +.. automethod:: ev3brick.sound.tune + + +.. automethod:: ev3brick.sound.file + + +.. automethod:: ev3brick.sound.speak + + +Display +------- +:: + + x + --------------> + (0, 0) __________________ + | | + | | | + y | | Hello | + | | World | + v | | + |__________________| + (177, 127) + +.. automethod:: ev3brick.display.clear + +.. automethod:: ev3brick.display.text + +.. automethod:: ev3brick.display.image diff --git a/source/ev3devices.rst b/source/ev3devices.rst new file mode 100644 index 0000000..2d3fc49 --- /dev/null +++ b/source/ev3devices.rst @@ -0,0 +1,30 @@ +:mod:`ev3devices` -- EV3 Motors and Sensors +=========================================== + +Motors +------ + +.. autoclass:: ev3devices.Motor + +Sensors +------- + +Touch Sensor +^^^^^^^^^^^^ +.. autoclass:: ev3devices.TouchSensor + +Color Sensor +^^^^^^^^^^^^ +.. autoclass:: ev3devices.ColorSensor + +Infrared Sensor and Beacon +^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. autoclass:: ev3devices.InfraredSensor + +Ultrasonic Sensor +^^^^^^^^^^^^^^^^^ +.. autoclass:: ev3devices.UltrasonicSensor + +Gyroscopic Sensor +^^^^^^^^^^^^^^^^^ +.. autoclass:: ev3devices.GyroSensor diff --git a/source/index.rst b/source/index.rst index cd771cb..14d60b6 100644 --- a/source/index.rst +++ b/source/index.rst @@ -18,8 +18,8 @@ Welcome to Pybricks's documentation! :maxdepth: 1 :caption: Modules: - brick - devices + ev3brick + ev3devices parameters tools