Web UI & Templates

Introduction

Development Screenshot ⚠️

This is the Starlight Web UI. The Web UI allows you to make real-time changes to what displays in your chatbox. (It will have multiple purposes in the future)

Using the UI you can reference plugins and code by using the Jinja2 templating language!

Chatbox Jinja2 examples are included in the examples folder

Here is a small primer on using the Jinja2 templating language https://realpython.com/primer-on-jinja-templating/#control-the-flow-in-jinja

Environment Variables

Along with Jinja's default environment variables and functions, Starlight provides the following that can be referenced by a template.

{{ current_time }} # The current system time (HH:MM AM/PM)
{{ top_bar }} # ╔═════════════╗
{{ middle_bar }} # ╠═════════════╣
{{ bottom_bar }} # ╚═════════════╝
{{ cpu_usage }} # EG: 40.1 (Percentage string)
{{ ram_usage }} # EG: 49.6 (Percentage string)
{{ ram_used }} # EG: 8.9GB
{{ ram_total }} # Total amount of System RAM
{{ _rand }} # Random number between 1 and 100
{{ update_interval }} # The specified update interval
{{ cpu_info }} # https://github.com/workhorsy/py-cpuinfo#fields (dict)
{{ plugins }} # Loaded plugins (dict)

All loaded plugins are also assigned an environment variable (usually the plugin filename)

EG: Having a plugin with the filename myplugin.py would be referenced by {{ myplugin() }}

Last updated