From 4189c0c988daa939be0e8ec979ce0ae0563c4b7d Mon Sep 17 00:00:00 2001 From: "jakob.stendahl" Date: Mon, 12 Dec 2022 14:13:40 +0100 Subject: Create docs from python code --- NeoRuntime/Runtime/luxcena_neo/neo_behaviour.py | 93 +- NeoRuntime/Runtime/luxcena_neo/strip.py | 58 +- docs/Scripting/NeoBehaviour.md | 68 + docs/Scripting/Strip.md | 18 + mkdocs.yml | 19 +- public/docs/404.html | 682 +- public/docs/Code Documentation/Design/index.html | 735 +-- .../Modules/CompileAndRun/index.html | 888 +-- public/docs/Code Documentation/Run/index.html | 896 ++- public/docs/Code Documentation/SocketIO/index.html | 905 ++- public/docs/FuturePlan/index.html | 810 ++- .../docs/Scripting/Examples/strandtest/index.html | 737 --- public/docs/Scripting/NeoBehaviour/index.html | 1851 ++++++ public/docs/Scripting/Strip/index.html | 1207 ++++ public/docs/Scripting/SupportLib/index.html | 1067 ++-- public/docs/Usage/CLI/index.html | 890 ++- public/docs/Usage/Configuration/index.html | 880 ++- public/docs/Usage/Install/index.html | 819 ++- public/docs/assets/_mkdocstrings.css | 36 + public/docs/assets/fonts/font-awesome.css | 4 - public/docs/assets/fonts/material-icons.css | 13 - public/docs/assets/fonts/specimen/FontAwesome.ttf | Bin 165548 -> 0 bytes public/docs/assets/fonts/specimen/FontAwesome.woff | Bin 98024 -> 0 bytes .../docs/assets/fonts/specimen/FontAwesome.woff2 | Bin 77160 -> 0 bytes .../fonts/specimen/MaterialIcons-Regular.ttf | Bin 128180 -> 0 bytes .../fonts/specimen/MaterialIcons-Regular.woff | Bin 57620 -> 0 bytes .../fonts/specimen/MaterialIcons-Regular.woff2 | Bin 44300 -> 0 bytes public/docs/assets/images/favicon.png | Bin 521 -> 1870 bytes .../assets/images/icons/bitbucket.1b09e088.svg | 1 - .../docs/assets/images/icons/github.f0b8504a.svg | 1 - .../docs/assets/images/icons/gitlab.6dd19c00.svg | 1 - .../assets/javascripts/application.c648116f.js | 6 - .../docs/assets/javascripts/bundle.5a2dcb6a.min.js | 29 + .../assets/javascripts/bundle.5a2dcb6a.min.js.map | 8 + .../javascripts/extra/bundle.5f09fbc3.min.js | 18 + .../javascripts/extra/bundle.5f09fbc3.min.js.map | 8 + public/docs/assets/javascripts/lunr/lunr.da.js | 1 - public/docs/assets/javascripts/lunr/lunr.de.js | 1 - public/docs/assets/javascripts/lunr/lunr.du.js | 1 - public/docs/assets/javascripts/lunr/lunr.es.js | 1 - public/docs/assets/javascripts/lunr/lunr.fi.js | 1 - public/docs/assets/javascripts/lunr/lunr.fr.js | 1 - public/docs/assets/javascripts/lunr/lunr.hu.js | 1 - public/docs/assets/javascripts/lunr/lunr.it.js | 1 - public/docs/assets/javascripts/lunr/lunr.ja.js | 1 - public/docs/assets/javascripts/lunr/lunr.jp.js | 1 - public/docs/assets/javascripts/lunr/lunr.multi.js | 1 - public/docs/assets/javascripts/lunr/lunr.nl.js | 1 - public/docs/assets/javascripts/lunr/lunr.no.js | 1 - public/docs/assets/javascripts/lunr/lunr.pt.js | 1 - public/docs/assets/javascripts/lunr/lunr.ro.js | 1 - public/docs/assets/javascripts/lunr/lunr.ru.js | 1 - .../javascripts/lunr/lunr.stemmer.support.js | 1 - public/docs/assets/javascripts/lunr/lunr.sv.js | 1 - public/docs/assets/javascripts/lunr/lunr.th.js | 1 - public/docs/assets/javascripts/lunr/lunr.tr.js | 1 - .../assets/javascripts/lunr/min/lunr.ar.min.js | 1 + .../assets/javascripts/lunr/min/lunr.da.min.js | 18 + .../assets/javascripts/lunr/min/lunr.de.min.js | 18 + .../assets/javascripts/lunr/min/lunr.du.min.js | 18 + .../assets/javascripts/lunr/min/lunr.es.min.js | 18 + .../assets/javascripts/lunr/min/lunr.fi.min.js | 18 + .../assets/javascripts/lunr/min/lunr.fr.min.js | 18 + .../assets/javascripts/lunr/min/lunr.hi.min.js | 1 + .../assets/javascripts/lunr/min/lunr.hu.min.js | 18 + .../assets/javascripts/lunr/min/lunr.it.min.js | 18 + .../assets/javascripts/lunr/min/lunr.ja.min.js | 1 + .../assets/javascripts/lunr/min/lunr.jp.min.js | 1 + .../assets/javascripts/lunr/min/lunr.ko.min.js | 1 + .../assets/javascripts/lunr/min/lunr.multi.min.js | 1 + .../assets/javascripts/lunr/min/lunr.nl.min.js | 18 + .../assets/javascripts/lunr/min/lunr.no.min.js | 18 + .../assets/javascripts/lunr/min/lunr.pt.min.js | 18 + .../assets/javascripts/lunr/min/lunr.ro.min.js | 18 + .../assets/javascripts/lunr/min/lunr.ru.min.js | 18 + .../lunr/min/lunr.stemmer.support.min.js | 1 + .../assets/javascripts/lunr/min/lunr.sv.min.js | 18 + .../assets/javascripts/lunr/min/lunr.ta.min.js | 1 + .../assets/javascripts/lunr/min/lunr.th.min.js | 1 + .../assets/javascripts/lunr/min/lunr.tr.min.js | 18 + .../assets/javascripts/lunr/min/lunr.vi.min.js | 1 + .../assets/javascripts/lunr/min/lunr.zh.min.js | 1 + public/docs/assets/javascripts/lunr/tinyseg.js | 207 +- public/docs/assets/javascripts/lunr/wordcut.js | 6709 +++++++++++++++++++- .../docs/assets/javascripts/modernizr.74668098.js | 1 - .../javascripts/workers/search.16e2a7d4.min.js | 48 + .../javascripts/workers/search.16e2a7d4.min.js.map | 8 + .../stylesheets/application-palette.a8b3c06d.css | 1 - .../assets/stylesheets/application.30686662.css | 1 - .../docs/assets/stylesheets/extra.0d2c79a8.min.css | 1 + .../assets/stylesheets/extra.0d2c79a8.min.css.map | 1 + .../docs/assets/stylesheets/main.975780f9.min.css | 1 + .../assets/stylesheets/main.975780f9.min.css.map | 1 + .../assets/stylesheets/palette.2505c338.min.css | 1 + .../stylesheets/palette.2505c338.min.css.map | 1 + public/docs/index.html | 777 ++- public/docs/objects.inv | Bin 0 -> 451 bytes public/docs/search/search_index.json | 1 - public/docs/sitemap.xml | 71 +- public/docs/sitemap.xml.gz | Bin 203 -> 204 bytes 100 files changed, 15081 insertions(+), 5798 deletions(-) create mode 100644 docs/Scripting/NeoBehaviour.md create mode 100644 docs/Scripting/Strip.md delete mode 100644 public/docs/Scripting/Examples/strandtest/index.html create mode 100644 public/docs/Scripting/NeoBehaviour/index.html create mode 100644 public/docs/Scripting/Strip/index.html create mode 100644 public/docs/assets/_mkdocstrings.css delete mode 100644 public/docs/assets/fonts/font-awesome.css delete mode 100644 public/docs/assets/fonts/material-icons.css delete mode 100644 public/docs/assets/fonts/specimen/FontAwesome.ttf delete mode 100644 public/docs/assets/fonts/specimen/FontAwesome.woff delete mode 100644 public/docs/assets/fonts/specimen/FontAwesome.woff2 delete mode 100644 public/docs/assets/fonts/specimen/MaterialIcons-Regular.ttf delete mode 100644 public/docs/assets/fonts/specimen/MaterialIcons-Regular.woff delete mode 100644 public/docs/assets/fonts/specimen/MaterialIcons-Regular.woff2 delete mode 100644 public/docs/assets/images/icons/bitbucket.1b09e088.svg delete mode 100644 public/docs/assets/images/icons/github.f0b8504a.svg delete mode 100644 public/docs/assets/images/icons/gitlab.6dd19c00.svg delete mode 100644 public/docs/assets/javascripts/application.c648116f.js create mode 100644 public/docs/assets/javascripts/bundle.5a2dcb6a.min.js create mode 100644 public/docs/assets/javascripts/bundle.5a2dcb6a.min.js.map create mode 100644 public/docs/assets/javascripts/extra/bundle.5f09fbc3.min.js create mode 100644 public/docs/assets/javascripts/extra/bundle.5f09fbc3.min.js.map delete mode 100644 public/docs/assets/javascripts/lunr/lunr.da.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.de.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.du.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.es.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.fi.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.fr.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.hu.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.it.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.ja.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.jp.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.multi.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.nl.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.no.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.pt.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.ro.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.ru.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.stemmer.support.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.sv.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.th.js delete mode 100644 public/docs/assets/javascripts/lunr/lunr.tr.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 public/docs/assets/javascripts/lunr/min/lunr.zh.min.js delete mode 100644 public/docs/assets/javascripts/modernizr.74668098.js create mode 100644 public/docs/assets/javascripts/workers/search.16e2a7d4.min.js create mode 100644 public/docs/assets/javascripts/workers/search.16e2a7d4.min.js.map delete mode 100644 public/docs/assets/stylesheets/application-palette.a8b3c06d.css delete mode 100644 public/docs/assets/stylesheets/application.30686662.css create mode 100644 public/docs/assets/stylesheets/extra.0d2c79a8.min.css create mode 100644 public/docs/assets/stylesheets/extra.0d2c79a8.min.css.map create mode 100644 public/docs/assets/stylesheets/main.975780f9.min.css create mode 100644 public/docs/assets/stylesheets/main.975780f9.min.css.map create mode 100644 public/docs/assets/stylesheets/palette.2505c338.min.css create mode 100644 public/docs/assets/stylesheets/palette.2505c338.min.css.map create mode 100644 public/docs/objects.inv delete mode 100644 public/docs/search/search_index.json diff --git a/NeoRuntime/Runtime/luxcena_neo/neo_behaviour.py b/NeoRuntime/Runtime/luxcena_neo/neo_behaviour.py index d4ee9bd..d572204 100644 --- a/NeoRuntime/Runtime/luxcena_neo/neo_behaviour.py +++ b/NeoRuntime/Runtime/luxcena_neo/neo_behaviour.py @@ -5,10 +5,17 @@ from .strip import detect_format_convert_color from .color_utils import rgb_from_twentyfour_bit, hex_from_twentyfour_bit class NeoBehaviour: - """ - This is the base-class "main" should inherit from! - All methods are blocking :) This means that you could potentially loose a "tick" - For example, if "eachSecond" is taking up the thread, and the clock goes from 11:58 to 12:02, "eachHour", will not be called. + """ This is the base-class "main" should inherit from! + + Note: All methods are blocking + This means that you could potentially loose a "tick" + + For example, if "eachSecond" is taking up the thread, and the clock goes from 11:58 to 12:02, "eachHour", will not be called. + + Danger: Do NOT override __init__ in your implementation, this will break some features. + For this purpose you should instead use the [on_start][luxcena_neo.neo_behaviour.NeoBehaviour.on_start] method! + + Important: An instance of the [Strip][luxcena_neo.strip.Strip] class will be available in your module as `strip` without any setup on your part. """ def __init__(self, package_path): @@ -23,7 +30,8 @@ class NeoBehaviour: del self.declare def declare_variables(self): - """ This should be overridden, and ALL variables should be declared here. """ + """ This should be overridden, and ALL variables should be declared here. + When this method is called, variables can be declared using `self.declare()`. """ return def on_start(self): @@ -136,8 +144,20 @@ class Variables: return {x.name: x.to_dict() for x in self.__vars.values()} class Variable: + """ The base class for any variable, this should _probably_ not be used directly. """ def __init__(self, name, default, var_type: VariableType, on_change = None): + """ The base constructor for any variable. All these parameters should likely be passed on by + the subclass inheriting this one. + + Args: + name: A string which is the name of the variable, keep in mind that this is case sensitive. + default: This will be set as the default value of the variable the first time the script is started. + var_type: This is the enum number of the variable type, this is just a number which is used to + communicate with the frontend which value picker to show. + on_change: Optional callable, which will be called with the new value every time the variable is + updated (both programatically and via user input). + """ self.__name = name self.__value = default self.__var_type = var_type @@ -148,7 +168,9 @@ class Variable: def name(self): return self.__name @property - def value(self): return self.__value + def value(self): + """ This is likely the property you should use to get the current value of the variable. """ + return self.__value @value.setter def value(self, value): @@ -171,8 +193,22 @@ class Variable: self.__save_func = save_func class ColorVariable(Variable): + """ This is a variable storing a color value. + + Note: Right now, this only properly supports setting the value as a hex string. + This will hopefully change in the future, but it is likely that the main + operation will remain as hex strings. + """ def __init__(self, name: str, *color, **kwargs): + """ Constructor for a color variable + + Args: + name: Will be passed on to the parent class ([Variable][luxcena_neo.neo_behaviour.Variable]). + *color: The next positional parameters will be used as the default color. + Right now, it will just pick the first one, and interpret it as a hex color. + **kwargs: Keyword arguments will be passed to the parent class ([Variable][luxcena_neo.neo_behaviour.Variable]). + """ if not self.verify_color(*color): raise Exception("Invalid color {}".format(color)) super().__init__(name, self.extract_interesting(*color), VariableType.COLOR, **kwargs) @@ -206,8 +242,18 @@ class ColorVariable(Variable): return color class IntegerVariable(Variable): + """ A variable for storing a integer value (whole number). """ def __init__(self, name: str, default: int = 0, min_val: int = 0, max_val: int = 255, **kwargs): + """ Constructor for a integer variable + + Args: + name: Will be passed on to the parent class ([Variable][luxcena_neo.neo_behaviour.Variable]). + default: A number which will be set as the default if the mode has never been run before. + min_val: The lowest value this variable can have (inclusive). + max_val: The highest value this variable can have (inclusive). + **kwargs: Keyword arguments will be passed to the parent class ([Variable][luxcena_neo.neo_behaviour.Variable]). + """ self.__min = min_val self.__max = max_val super().__init__(name, default, VariableType.INT, **kwargs) @@ -228,8 +274,19 @@ class IntegerVariable(Variable): class FloatVariable(Variable): + """ A variable for storing a float value (decimal number). """ def __init__(self, name: str, default: float = 0.0, min_val: float = 0.0, max_val: float = 255.0, step: float = 0.5, **kwargs): + """ Constructor for a float variable + + Args: + name: Will be passed on to the parent class ([Variable][luxcena_neo.neo_behaviour.Variable]). + default: A number which will be set as the default if the mode has never been run before. + min_val: The lowest value this variable can have (inclusive). + max_val: The highest value this variable can have (inclusive). + step: This does not affect the python code, it only affects the value picker which will be shown in the frontend. + **kwargs: Keyword arguments will be passed to the parent class ([Variable][luxcena_neo.neo_behaviour.Variable]). + """ self.__min = min_val self.__max = max_val self.__step = step @@ -255,8 +312,16 @@ class FloatVariable(Variable): class BooleanVariable(Variable): + """ A variable for storing a boolean value (on/off). """ def __init__(self, name: str, default: bool, **kwargs): + """ Constructor for a boolean variable + + Args: + name: Will be passed on to the parent class ([Variable][luxcena_neo.neo_behaviour.Variable]). + default: A boolean which will be set as the default if the mode has never been run before. + **kwargs: Keyword arguments will be passed to the parent class ([Variable][luxcena_neo.neo_behaviour.Variable]). + """ super().__init__(name, default, VariableType.BOOL, **kwargs) @Variable.value.setter @@ -268,8 +333,24 @@ class BooleanVariable(Variable): print("Attempted to set {} to \"{}\", which is not a valid bool...".format(self.name, value)) class Trigger(Variable): + """ A trigger which can execute some function. + + Although technically a variable, this is not intended as one. + It is intended to be used with a on_change function, such that + this action is performed when this trigger is activated. + + It will show up as a button in the frontend, and can also be triggered by + setting the value (What you set it as will be ignored, so e.g. None. """ def __init__(self, name: str, **kwargs): + """ Constructor for the Trigger + It is important to set the on_change callable (see the Variable class). If you don't + this class is completely useless. + + Args: + name: The name of the trigger variable (mostly useful if you wanted to trigger it in the code). + **kwargs: Keyword arguments will be passed to the parent class ([Variable][luxcena_neo.neo_behaviour.Variable]). + """ super().__init__(name, False, VariableType.TRIGGER, **kwargs) @Variable.value.setter diff --git a/NeoRuntime/Runtime/luxcena_neo/strip.py b/NeoRuntime/Runtime/luxcena_neo/strip.py index b0165c9..31e541a 100644 --- a/NeoRuntime/Runtime/luxcena_neo/strip.py +++ b/NeoRuntime/Runtime/luxcena_neo/strip.py @@ -24,6 +24,14 @@ except ModuleNotFoundError: class Strip: + """ Class representing a led-strip, + + If you are using the NeoBehaviour runtime, an pre-configured instance of this will + be setup in your module with the name `strip`. + + Attributes: + SEGMENTS (list[int]): A list of the configured segments. + """ def __init__(self, strip_conf): # Read in all config options @@ -97,20 +105,24 @@ class Strip: @property def power_on(self): + """ Wether the power action is on or not. """ return self.__power_on @power_on.setter def power_on(self, value: bool): + """ Will set brightness to zero if value is false, or restore brightness to the last value if true. """ self.__power_on = value self._set_brightness(self.__set_brightness if self.power_on else 0) self.save_globvars() @property def brightness(self): + """ The current brightness. """ return self.__actual_brightness @brightness.setter def brightness(self, value: int): + """ Will set the brightness if power is on, if not it will simply save it. """ if 0 <= value <= 255: self.__set_brightness = value if (self.power_on): @@ -127,12 +139,16 @@ class Strip: self.show() def show(self): - """Update the display with the data from the LED buffer.""" + """Update the display with the data from the LED buffer, you can think of it as a flush method.""" self.COLORSTATE = self.TMPCOLORSTATE self.strip.show() def set_pixel_color(self, n, *color): - """Set LED at position n to the provided 24-bit color value (in RGB order). + """Set the color of the LED at position N. + + Args: + n (int): The pixel to set. + *color: This will be interpreted as a color. """ if n >= self.LED_COUNT: return c = detect_format_convert_color(*color) @@ -147,7 +163,14 @@ class Strip: # ) def set_pixel_color_XY(self, x, y, *color): - """Set LED at position n to the provided 24-bit color value (in RGB order). + """Set the color of a LED at position (x, y) in the matrix you have configured to a color. + + Note: This will only print a warning message if you try to set pixels outside the matrix. + + Args: + x (int): The x position. + y (int): The y position. + *color: This will be interpreted as a color. """ try: pixel = self.pixelMatrix.get(x, y) @@ -156,9 +179,12 @@ class Strip: print(f"Pixel outside matrix cannot be set ({x}, {y})") def set_segment_color(self, segment, *color): - """Set a whole segment to the provided red, green and blue color. - Each color component should be a value from 0 to 255 (where 0 is the - lowest intensity and 255 is the highest intensity).""" + """Set a whole segment to the provided color. + + Args: + segment (int): The segment to set. + *color: This will be interpreted as a color. + """ if segment >= len(self.SEGMENTS): return for n in get_segment_range(self.SEGMENTS, segment): self.set_pixel_color(n, *color) @@ -177,11 +203,25 @@ class Strip: """Get the 24-bit RGB color value for the LED at position n.""" return self.strip.getPixelColor(n) - def blank(self): - """Will turn off all pixels, this also calls show for you.""" + def blank(self, auto_show=True): + """Will turn off all pixels. + + Args: + auto_show (bool): If set to true, strip.show() is called. Disable this if needed for some quicker animations. + """ for n in range(self.LED_COUNT): self.set_pixel_color(n, 0) - self.show() + if auto_show: + self.show() + + def set_strip_color(self, *color): + """Set all pixels in the strip to a color + + Args: + *color: This will be interpreted as a color. + """ + for n in range(self.LED_COUNT): + self.set_pixel_color(n, *color) def color_from_rgb(red, green, blue, white=0): diff --git a/docs/Scripting/NeoBehaviour.md b/docs/Scripting/NeoBehaviour.md new file mode 100644 index 0000000..c10d055 --- /dev/null +++ b/docs/Scripting/NeoBehaviour.md @@ -0,0 +1,68 @@ +# Documentation for `NeoBehaviour` + +::: luxcena_neo.neo_behaviour.NeoBehaviour + handler: python + options: + show_root_heading: true + show_source: false + filters: ["!^__init__"] + + +### An example of the usage of the class +```python +from luxcena_neo import NeoBehaviour + +class Main(NeoBehaviour): + def on_start(self): + strip.setPixelColor(0, "#fafafa") +``` + +--- + +::: luxcena_neo.neo_behaviour.Variable + handler: python + options: + show_root_heading: true + show_source: false + +--- + +::: luxcena_neo.neo_behaviour.ColorVariable + handler: python + options: + show_root_heading: true + show_source: false + +--- + +::: luxcena_neo.neo_behaviour.IntegerVariable + handler: python + options: + show_root_heading: true + show_source: false + +--- + +::: luxcena_neo.neo_behaviour.FloatVariable + handler: python + options: + show_root_heading: true + show_source: false + #show_category_heading: true + #show_if_no_docstring: true + +--- + +::: luxcena_neo.neo_behaviour.BooleanVariable + handler: python + options: + show_root_heading: true + show_source: false + +--- + +::: luxcena_neo.neo_behaviour.Trigger + handler: python + options: + show_root_heading: true + show_source: false diff --git a/docs/Scripting/Strip.md b/docs/Scripting/Strip.md new file mode 100644 index 0000000..cd06519 --- /dev/null +++ b/docs/Scripting/Strip.md @@ -0,0 +1,18 @@ +# Documentation for `strip` + +::: luxcena_neo.strip.Strip + handler: python + options: + show_root_heading: true + show_source: false + +--- + +## A note on colors +Most methods which need colors takes a `*color` parameter. This is because it interprets multiple types of colors. The example below illustrates this, each of the lines has the exact same effect on the led strip. +```python +set_pixel_color(0, "#fafafa") +set_pixel_color(0, 16448250) +set_pixel_color(0, 250, 250, 250) +set_pixel_color(0, (250, 250, 250)) +``` diff --git a/mkdocs.yml b/mkdocs.yml index 1e8334c..e282b17 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,6 +1,7 @@ site_name: Luxcena Neo Documentation site_dir: public/docs -theme: material +theme: + name: material extra_javascript: - assets/luxcena-colors.js - assets/webfont.js @@ -31,6 +32,11 @@ markdown_extensions: - pymdownx.tasklist: custom_checkbox: true - pymdownx.tilde +plugins: + - mkdocstrings: + handlers: + python: + paths: [NeoRuntime/Runtime] nav: - Introduction: index.md - Plan for the future: FuturePlan.md @@ -39,13 +45,12 @@ nav: - Configuration: Usage/Configuration.md - CLI: Usage/CLI.md - Scripting: - - Support Library: Scripting/SupportLib/README.md - - Examples: - - Strandtest: Scripting/Examples/strandtest.md + - Strip: Scripting/Strip.md + - Main interface: Scripting/NeoBehaviour.md + #- Support Library: Scripting/SupportLib/README.md - Code Documentation: - - Modules: - - CompileAndRun: "Code Documentation/Modules/CompileAndRun.md" + #- Modules: + # - CompileAndRun: "Code Documentation/Modules/CompileAndRun.md" - Run: Code Documentation/Run/index.md - - Design: Code Documentation/Design/index.md - API: - Socket-IO: Code Documentation/SocketIO.md diff --git a/public/docs/404.html b/public/docs/404.html index d214f91..c9a198e 100644 --- a/public/docs/404.html +++ b/public/docs/404.html @@ -1,38 +1,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -40,122 +17,122 @@ - + + + + + + - - - - - + + + + + - + + + + - - - - - - - + + + + + + + + + - + +
+ +
+
+ +
-
-