diff --git a/README.md b/README.md index 1bfd7a1..ac797d9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ +# Developing widgets +There a few sample widgets already included. On each page reload, each widgets `render()` is called and +a dictionary of type`RenderResult` is expected. Structure your module like so: + +```python +from happyMirror.render import BaseRenderer, RenderResult + +class NamedAfterMyPackage(BaseRenderer): + def render(self) -> RenderResult: + # do your stuff + + # all fields are optional + return { + 'name': 'some name', # mainly used for debuggging + 'view': 'html stuff', + 'script': 'javascript' + } +``` + # How to run ## Development mode Get all you need by typing `pip install -e .`, then run the application directly from VSCode.