Try Gramlot
In a hurry? Start with Try Gramlot: the quick route.
This repository contains the Gramlot core, published on PyPI (gramlot) and on
npm (@gramlot/gramlot). The adapters are in gramlot-py-server (Python
pages) and gramlot-js-server (JavaScript pages); the example pages are in
gramlot-examples.
Start with one learning environment
Start with Python and the Uvicorn adapter unless your application already uses
another framework. You need basic Python, a text editor and a browser. The
adapter installs the core; Node.js is not needed to serve Python pages. Browser
behavior still runs in JavaScript, through the page’s Logic module.
First open the gallery to compare explanation, source and result. Then create an editable project. The gallery displays source but does not save edits to it; changing a field changes page Data, not the Python/JavaScript file.
Use the Python installation and commands for the environment setup, then return to the route in section 015.
Open the gallery, then edit your own page
The Python package needs the uvicorn and gallery extras for this route. In a
Python virtual environment, follow the Uvicorn guide
and gallery command.
The gallery prints its address. Stop it before reusing its port. The hosted
galleries for Python and
JavaScript need no installation.
Create a separate empty project with gramlot uvicorn new hello, then follow the
printed install/start commands. Edit hello/pages/index.py for Source and
hello/pages/index.js for browser Logic. With GRAMLOT_DEV=YES, reopen/reload the
page after a saved edit; DEBUG also selects the readable runtime. This is not
automatic hot reload. Without development reload, restart the server as needed.
The generated project uses named Logic and a strict CSP. Inline gallery examples need the documented permissive profile; copying inline code into the strict project does not make it named Logic. See CSP.
Alternative |
Environment instructions |
|---|---|
Existing Django, Flask, FastAPI or Kajenn site |
Python adapters; choose the framework’s extra and guide. |
JavaScript on Node/Bun |
JavaScript tutorial; Page on the server, Logic in the browser. |
JavaScript without an application server |
Standalone tutorial; Page in a Worker, Logic in the window. Python pages cannot run there. |
Learn by topic
The gallery groups its lessons by topic. It goes from HTML and SVG structure to Data binding, controllers and server calls, then to input components and containers. Each lesson has its explanation, its Python and JavaScript source and the running page. The examples manual lists the lessons and explains how to read them.
Topic |
Guide |
|---|---|
Source, HTML and SVG elements, live Source changes |
|
Pointers, initial values, bound controls, style and visibility, freeze |
|
Formulas, controllers, named logic, inline code, buttons, events, lifecycle |
|
Sending and saving Data, messages, ask, pointer templates |
|
Endpoints and |
|
|
|
Input components, validation, command buttons, containers |
|
Appearance |
Read the prerequisites of a lesson and predict its result before you try it. For
example, when a formula reads the VAT rate with =, changing the rate alone does
not recalculate it; the next change of a ^ argument uses the new rate.
The gallery runs on servers without a resource system and without an identity
system: js_requires groups and the allow and deny of an auth rule need a server
that has them. The gallery shows the
default refusal of auth. An installed older gallery may show fewer lessons:
follow the adapter’s setup/update guide rather than treating missing lessons as a
runtime failure.
Standalone export of the gallery
The standalone integration @gramlot/gramlot-serverless writes the gallery of
gramlot-examples as a folder (npx gramlot-serverless gallery <folder>). Open its
index.html in a browser; keep the folder together. No application server or
runtime installation is needed. Rebuild the export to receive updates; an exported
folder does not update itself.