Docs/Notes/Code & compute cells

Code & compute cells

Drop a block of code into any note and it comes out neatly color-highlighted. Three kinds go further — queries over your knowledge base, queries over your tables, and Python — and become runnable: a small ▶ appears, and running the cell drops its result right into the note, just below the code.

Plain code vs. runnable cells

What decides whether a cell just looks nice or actually runs is the language you label it with.

Any language
Plain. Label a cell with a language — JavaScript, Rust, shell, and so on — and it's shown with color highlighting to make it easy to read. Nothing runs; it's there for reference.
Knowledge base
Runnable. Ask a question of your project's knowledge base and get back a table of answers — the same kind of question you'd ask from the Query panel.
Tables
Runnable. Query the data in your imported tables and spreadsheets, and get back a table of matching rows.
Python
Runnable. Run a bit of Python. The result can be text, a table, an inline image or chart — whatever the code produces.

Running a cell

A runnable cell shows a small ▶ button, whether you're writing the note or reading it in preview. You can run one a few ways:

Where output goes

A cell's result is written into the note itself, right below the cell — not a panel that vanishes when you close the note. Run the cell again and its result is refreshed in place. Depending on what the cell produces, the result might be a table, a block of text, an image, or a chart. If something goes wrong, you get a clearly-marked error with the message instead, so you can fix the cell and try again.

A note showing a Python cell with its ▶ button, and just beneath it the result it produced — a small table of data.
Screenshot — Runnable cell with output
Big results are trimmed, not hidden

Very large tables are shown up to a generous limit. When there's more, the result notes how many rows you're seeing out of the total, so you always know there's more — just narrow your query to see the rest.

A note on Python

Python cells run on your own machine and can do real work — read and write files, reach the network, and use whatever you have installed. Because of that, Minerva asks you to confirm once per project before it runs Python; after that it remembers your choice. You can point Minerva at the Python you want to use in Settings → Compute.

Within a single note, Python cells build on each other: a value or import from an earlier cell is available to later ones. Cells in different notes stay separate, and each knowledge-base or table query stands on its own.

Running is always your call

A cell only ever runs when you run it — by clicking ▶, pressing the shortcut, or choosing Recompute all. Since you're the one asking, it just runs, the same way typing in a note doesn't need approval. Cells run the query you wrote exactly as written, so treat them with the same care you'd give any query you run yourself.