diff --git a/Makefile b/Makefile index 03e5871..a81e974 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,8 @@ SPHINXOPTS = -W SPHINXBUILD = sphinx-build SPHINXPROJ = Pybricks -SOURCEDIR = source -BUILDDIR = build +SOURCEDIR = ev3dev +BUILDDIR = "$(SOURCEDIR)"/build # Put it first so that "make" without argument is like "make help". help: @@ -17,5 +17,5 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(MAKE) -C source/_images `[ "$@" = "clean" ] && echo clean || echo all` + @$(MAKE) -C "$(SOURCEDIR)"/_images `[ "$@" = "clean" ] && echo clean || echo all` @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/source/_images/Makefile b/common/_images/Makefile similarity index 100% rename from source/_images/Makefile rename to common/_images/Makefile diff --git a/source/_static/css/theme_overrides.css b/common/_static/css/theme_overrides.css similarity index 100% rename from source/_static/css/theme_overrides.css rename to common/_static/css/theme_overrides.css diff --git a/source/_templates/footer.html b/common/_templates/footer.html similarity index 100% rename from source/_templates/footer.html rename to common/_templates/footer.html diff --git a/source/conf.py b/common/conf.py similarity index 97% rename from source/conf.py rename to common/conf.py index f8414db..bcea33c 100644 --- a/source/conf.py +++ b/common/conf.py @@ -44,7 +44,7 @@ extensions = [ ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ['../common/_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: @@ -134,7 +134,7 @@ else: 'disclaimer': _DISCLAIMER, } -html_logo = 'images/pybricks-logo-small.png' +html_logo = '../common/images/pybricks-logo-small.png' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. @@ -152,7 +152,7 @@ html_theme_options = { # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ['../common/_static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. @@ -224,7 +224,7 @@ latex_documents = [ (master_doc, ''.join([project, '-v', version, '.tex']), _TITLE, author, 'manual'), ] -latex_logo = 'images/pybricks-logo-large.png' +latex_logo = '../common/images/pybricks-logo-large.png' # -- Options for manual page output --------------------------------------- diff --git a/source/images/.gitignore b/common/images/.gitignore similarity index 100% rename from source/images/.gitignore rename to common/images/.gitignore diff --git a/source/images/pybricks-logo-large.png b/common/images/pybricks-logo-large.png similarity index 100% rename from source/images/pybricks-logo-large.png rename to common/images/pybricks-logo-large.png diff --git a/source/images/pybricks-logo-small.png b/common/images/pybricks-logo-small.png similarity index 100% rename from source/images/pybricks-logo-small.png rename to common/images/pybricks-logo-small.png diff --git a/source/robotics.rst b/common/robotics.rst similarity index 100% rename from source/robotics.rst rename to common/robotics.rst diff --git a/source/signaltypes.rst b/common/signaltypes.rst similarity index 100% rename from source/signaltypes.rst rename to common/signaltypes.rst diff --git a/source/tools.rst b/common/tools.rst similarity index 100% rename from source/tools.rst rename to common/tools.rst diff --git a/ev3dev/_images/Makefile b/ev3dev/_images/Makefile new file mode 100755 index 0000000..cf15c72 --- /dev/null +++ b/ev3dev/_images/Makefile @@ -0,0 +1,15 @@ + +SRC_DIR = . +OUT_DIR = ../images + +SVG := $(wildcard $(SRC_DIR)/*.svg) +PNG := $(patsubst $(SRC_DIR)/%.svg,$(OUT_DIR)/%.png,$(SVG)) +DIR := ${CURDIR} + +all: $(PNG) + +clean: + rm -f $(PNG) + +$(OUT_DIR)/%.png: $(SRC_DIR)/%.svg + inkscape --file=$(DIR)/$< --export-area-drawing --export-png=$(DIR)/$@ diff --git a/source/_images/connecting.png b/ev3dev/_images/connecting.png similarity index 100% rename from source/_images/connecting.png rename to ev3dev/_images/connecting.png diff --git a/source/_images/connecting.svg b/ev3dev/_images/connecting.svg similarity index 100% rename from source/_images/connecting.svg rename to ev3dev/_images/connecting.svg diff --git a/source/_images/connectingsub1.png b/ev3dev/_images/connectingsub1.png similarity index 100% rename from source/_images/connectingsub1.png rename to ev3dev/_images/connectingsub1.png diff --git a/source/_images/connectingsub2.png b/ev3dev/_images/connectingsub2.png similarity index 100% rename from source/_images/connectingsub2.png rename to ev3dev/_images/connectingsub2.png diff --git a/source/_images/devicebrowser.svg b/ev3dev/_images/devicebrowser.svg similarity index 100% rename from source/_images/devicebrowser.svg rename to ev3dev/_images/devicebrowser.svg diff --git a/source/_images/devicebrowser0.png b/ev3dev/_images/devicebrowser0.png similarity index 100% rename from source/_images/devicebrowser0.png rename to ev3dev/_images/devicebrowser0.png diff --git a/source/_images/devicebrowser1.png b/ev3dev/_images/devicebrowser1.png similarity index 100% rename from source/_images/devicebrowser1.png rename to ev3dev/_images/devicebrowser1.png diff --git a/source/_images/devicebrowser2.png b/ev3dev/_images/devicebrowser2.png similarity index 100% rename from source/_images/devicebrowser2.png rename to ev3dev/_images/devicebrowser2.png diff --git a/source/_images/devicebrowser3.png b/ev3dev/_images/devicebrowser3.png similarity index 100% rename from source/_images/devicebrowser3.png rename to ev3dev/_images/devicebrowser3.png diff --git a/source/_images/devicebrowser4.png b/ev3dev/_images/devicebrowser4.png similarity index 100% rename from source/_images/devicebrowser4.png rename to ev3dev/_images/devicebrowser4.png diff --git a/source/_images/etcher.png b/ev3dev/_images/etcher.png similarity index 100% rename from source/_images/etcher.png rename to ev3dev/_images/etcher.png diff --git a/source/_images/etcher.svg b/ev3dev/_images/etcher.svg similarity index 100% rename from source/_images/etcher.svg rename to ev3dev/_images/etcher.svg diff --git a/source/_images/existingproject.png b/ev3dev/_images/existingproject.png similarity index 100% rename from source/_images/existingproject.png rename to ev3dev/_images/existingproject.png diff --git a/source/_images/existingproject.svg b/ev3dev/_images/existingproject.svg similarity index 100% rename from source/_images/existingproject.svg rename to ev3dev/_images/existingproject.svg diff --git a/source/_images/files.png b/ev3dev/_images/files.png similarity index 100% rename from source/_images/files.png rename to ev3dev/_images/files.png diff --git a/source/_images/files.svg b/ev3dev/_images/files.svg similarity index 100% rename from source/_images/files.svg rename to ev3dev/_images/files.svg diff --git a/source/_images/files1.png b/ev3dev/_images/files1.png similarity index 100% rename from source/_images/files1.png rename to ev3dev/_images/files1.png diff --git a/source/_images/firstprogram.svg b/ev3dev/_images/firstprogram.svg similarity index 100% rename from source/_images/firstprogram.svg rename to ev3dev/_images/firstprogram.svg diff --git a/source/_images/firstprogram1.jpg b/ev3dev/_images/firstprogram1.jpg similarity index 100% rename from source/_images/firstprogram1.jpg rename to ev3dev/_images/firstprogram1.jpg diff --git a/source/_images/firstprogram2.png b/ev3dev/_images/firstprogram2.png similarity index 100% rename from source/_images/firstprogram2.png rename to ev3dev/_images/firstprogram2.png diff --git a/source/_images/manualrun.svg b/ev3dev/_images/manualrun.svg similarity index 100% rename from source/_images/manualrun.svg rename to ev3dev/_images/manualrun.svg diff --git a/source/_images/manualrun1.png b/ev3dev/_images/manualrun1.png similarity index 100% rename from source/_images/manualrun1.png rename to ev3dev/_images/manualrun1.png diff --git a/source/_images/manualrun2.png b/ev3dev/_images/manualrun2.png similarity index 100% rename from source/_images/manualrun2.png rename to ev3dev/_images/manualrun2.png diff --git a/source/_images/manualrun3.png b/ev3dev/_images/manualrun3.png similarity index 100% rename from source/_images/manualrun3.png rename to ev3dev/_images/manualrun3.png diff --git a/source/_images/newproject.png b/ev3dev/_images/newproject.png similarity index 100% rename from source/_images/newproject.png rename to ev3dev/_images/newproject.png diff --git a/source/_images/newproject.svg b/ev3dev/_images/newproject.svg similarity index 100% rename from source/_images/newproject.svg rename to ev3dev/_images/newproject.svg diff --git a/source/_images/onoff.svg b/ev3dev/_images/onoff.svg similarity index 100% rename from source/_images/onoff.svg rename to ev3dev/_images/onoff.svg diff --git a/source/_images/onoff0.png b/ev3dev/_images/onoff0.png similarity index 100% rename from source/_images/onoff0.png rename to ev3dev/_images/onoff0.png diff --git a/source/_images/overview.jpg b/ev3dev/_images/overview.jpg similarity index 100% rename from source/_images/overview.jpg rename to ev3dev/_images/overview.jpg diff --git a/source/_images/overview.svg b/ev3dev/_images/overview.svg similarity index 100% rename from source/_images/overview.svg rename to ev3dev/_images/overview.svg diff --git a/source/_images/projectoverview.png b/ev3dev/_images/projectoverview.png similarity index 100% rename from source/_images/projectoverview.png rename to ev3dev/_images/projectoverview.png diff --git a/source/_images/projectoverview.svg b/ev3dev/_images/projectoverview.svg similarity index 100% rename from source/_images/projectoverview.svg rename to ev3dev/_images/projectoverview.svg diff --git a/source/_images/projectstructure.svg b/ev3dev/_images/projectstructure.svg similarity index 100% rename from source/_images/projectstructure.svg rename to ev3dev/_images/projectstructure.svg diff --git a/source/_images/running.png b/ev3dev/_images/running.png similarity index 100% rename from source/_images/running.png rename to ev3dev/_images/running.png diff --git a/source/_images/running.svg b/ev3dev/_images/running.svg similarity index 100% rename from source/_images/running.svg rename to ev3dev/_images/running.svg diff --git a/source/_images/screen.png b/ev3dev/_images/screen.png similarity index 100% rename from source/_images/screen.png rename to ev3dev/_images/screen.png diff --git a/source/_images/sd.svg b/ev3dev/_images/sd.svg similarity index 100% rename from source/_images/sd.svg rename to ev3dev/_images/sd.svg diff --git a/source/_images/sd1.jpg b/ev3dev/_images/sd1.jpg similarity index 100% rename from source/_images/sd1.jpg rename to ev3dev/_images/sd1.jpg diff --git a/source/_images/sd2.png b/ev3dev/_images/sd2.png similarity index 100% rename from source/_images/sd2.png rename to ev3dev/_images/sd2.png diff --git a/source/_images/store.svg b/ev3dev/_images/store.svg similarity index 100% rename from source/_images/store.svg rename to ev3dev/_images/store.svg diff --git a/source/_images/store0.png b/ev3dev/_images/store0.png similarity index 100% rename from source/_images/store0.png rename to ev3dev/_images/store0.png diff --git a/source/_images/store2.png b/ev3dev/_images/store2.png similarity index 100% rename from source/_images/store2.png rename to ev3dev/_images/store2.png diff --git a/source/_images/store3.png b/ev3dev/_images/store3.png similarity index 100% rename from source/_images/store3.png rename to ev3dev/_images/store3.png diff --git a/source/_images/vsix.png b/ev3dev/_images/vsix.png similarity index 100% rename from source/_images/vsix.png rename to ev3dev/_images/vsix.png diff --git a/source/_images/vsix.svg b/ev3dev/_images/vsix.svg similarity index 100% rename from source/_images/vsix.svg rename to ev3dev/_images/vsix.svg diff --git a/ev3dev/conf.py b/ev3dev/conf.py new file mode 100644 index 0000000..a426e43 --- /dev/null +++ b/ev3dev/conf.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Pybricks documentation build configuration file +# +import os +import sys +exec(open(os.path.abspath("../common/conf.py")).read()) diff --git a/source/ev3brick.rst b/ev3dev/ev3brick.rst similarity index 100% rename from source/ev3brick.rst rename to ev3dev/ev3brick.rst diff --git a/source/ev3devices.rst b/ev3dev/ev3devices.rst similarity index 100% rename from source/ev3devices.rst rename to ev3dev/ev3devices.rst diff --git a/source/examples/color_sorter.rst b/ev3dev/examples/color_sorter.rst similarity index 100% rename from source/examples/color_sorter.rst rename to ev3dev/examples/color_sorter.rst diff --git a/source/examples/robot_arm_h25.rst b/ev3dev/examples/robot_arm_h25.rst similarity index 100% rename from source/examples/robot_arm_h25.rst rename to ev3dev/examples/robot_arm_h25.rst diff --git a/source/examples/robot_educator.rst b/ev3dev/examples/robot_educator.rst similarity index 100% rename from source/examples/robot_educator.rst rename to ev3dev/examples/robot_educator.rst diff --git a/ev3dev/images/.gitignore b/ev3dev/images/.gitignore new file mode 100644 index 0000000..8ab8387 --- /dev/null +++ b/ev3dev/images/.gitignore @@ -0,0 +1,3 @@ +*.png +!pybricks-logo-large.png +!pybricks-logo-small.png diff --git a/source/images/color_sorter.jpg b/ev3dev/images/color_sorter.jpg similarity index 100% rename from source/images/color_sorter.jpg rename to ev3dev/images/color_sorter.jpg diff --git a/source/images/robot_arm.jpg b/ev3dev/images/robot_arm.jpg similarity index 100% rename from source/images/robot_arm.jpg rename to ev3dev/images/robot_arm.jpg diff --git a/source/images/ultrasonic_sensor_driving_base.jpg b/ev3dev/images/ultrasonic_sensor_driving_base.jpg similarity index 100% rename from source/images/ultrasonic_sensor_driving_base.jpg rename to ev3dev/images/ultrasonic_sensor_driving_base.jpg diff --git a/source/index.rst b/ev3dev/index.rst similarity index 100% rename from source/index.rst rename to ev3dev/index.rst diff --git a/source/parameters.rst b/ev3dev/parameters.rst similarity index 100% rename from source/parameters.rst rename to ev3dev/parameters.rst diff --git a/ev3dev/robotics.rst b/ev3dev/robotics.rst new file mode 100644 index 0000000..fd7023b --- /dev/null +++ b/ev3dev/robotics.rst @@ -0,0 +1,4 @@ +:mod:`robotics` -- Robotics module +=========================================== + +.. automodule:: robotics diff --git a/ev3dev/signaltypes.rst b/ev3dev/signaltypes.rst new file mode 100644 index 0000000..5ba65b5 --- /dev/null +++ b/ev3dev/signaltypes.rst @@ -0,0 +1 @@ +.. include:: ../common/signaltypes.rst diff --git a/source/startinstall.rst b/ev3dev/startinstall.rst similarity index 100% rename from source/startinstall.rst rename to ev3dev/startinstall.rst diff --git a/source/startrun.rst b/ev3dev/startrun.rst similarity index 100% rename from source/startrun.rst rename to ev3dev/startrun.rst diff --git a/ev3dev/tools.rst b/ev3dev/tools.rst new file mode 100644 index 0000000..5eeb890 --- /dev/null +++ b/ev3dev/tools.rst @@ -0,0 +1 @@ +.. include:: ../common/tools.rst diff --git a/source/motorcontrol.rst b/source/motorcontrol.rst deleted file mode 100644 index 9924917..0000000 --- a/source/motorcontrol.rst +++ /dev/null @@ -1,86 +0,0 @@ -Motor Essentials -===================== - -Intro - - - -Encoded Motors ----------------- - -.. _duty: - -Duty cycle -^^^^^^^^^^ -TODO - -Angle encoder -^^^^^^^^^^^^^ -TODO - -.. _ratio: - -Gear ratio -^^^^^^^^^^ - -TODO - - :: - - Example for one gear train: gears=[12, 36] - ____________ - | | - | motor | - |____________| - || - || 12t 36t - |||||| |||||||||||||| - || - || - output axle - - - Example with multiple gear trains: gears=[[12, 20, 36], [20, 40], [20, 8, 40]] - _____________ - | | - | motor | - |____________| - || - || 12t 20t 36t - |||||| ||||||||||| |||||||||||||| - || - || - |||||||| ||||||||||||||||| - 20t || 40t - || - |||||||| ||| ||||||||||||||||| - 20t 8t || 40t - || - output axle - - -.. _maneuvers: - -Motor maneuvers ---------------- - - -Reference signal -^^^^^^^^^^^^^^^^ - - -Automatic control -^^^^^^^^^^^^^^^^^ - -.. _pid: - -PID Parameters -^^^^^^^^^^^^^^ -TODO - - -.. _defaultpars: - -Default motor parameters ------------------------- -TODO