Repository navigation
Markdown cells
A markdown cell shows formatted text: headings, lists, code, links and pictures. It has no editor on the screen until you open it. A markdown cell does not run.
| Task | How |
|---|---|
| Make a markdown cell | In cell mode, press m. Or type :md
|
| Change it back to code | In cell mode, press y. Or type :code
|
| Edit the text | Select the cell and press enter or i. Or double-click the cell |
| Show the formatted text |
escape escape, shift+enter, ctrl+enter, or move to a different cell |
| Fold or unfold the cell |
h in cell mode, :hide / :show
|
shift+enter shows the text and goes to the next cell. ctrl+enter shows the text and stays.
With --no-vim, one escape is sufficient.
The variables of the cell go away. The cells that used them become stale. In reactive mode, those cells run again and fail.
| Text in the cell | Result |
|---|---|
 |
The picture shows in the cell |
[text](x.png) |
A link to a picture file also shows as a picture |
- The source can be an
httporhttpsaddress, adata:URL, or a file path. - A relative path starts from the folder of the notebook.
- Animated GIFs play.
- gpython loads pictures in the background. The cell shows
⌛ altuntil the picture arrives, and🌆 altwith the cause if it fails. - gpython keeps downloaded pictures in
~/.cache/gpython/images. Thus they show immediately the next time. -
vin cell mode and:imgalso work on the pictures of a markdown cell. See Images.
gpython can draw h1 to h3 headings in a larger font, as images.
This function is off by default. To turn it on, add this to the config file:
[experimental]
true_markdown = trueIt needs a terminal with the kitty graphics protocol and Unicode placeholders (Kitty, Ghostty).
It does not work in tmux. Elsewhere, gpython shows the headings as text.
GPYTHON_BIG_HEADINGS=0 turns it off for one session.
| File type | Storage |
|---|---|
.py with # %% markers |
# %% [markdown], then lines that start with # (the Jupytext format) |
Plain .py script |
A top-level """text""" string is a markdown cell |
| marimo notebook | A mo.md(...) cell. gpython shows it and does not run it |
.ipynb |
A markdown cell |
A code cell whose last line is only a string ("""note""") does not print that string as its result.
Use the notebook
- Getting started
- Command line
- Running cells
- Keys
- Commands
- Vim
- Markdown cells
- Variables and the debugger
- Images
Set up the workspace
Help and project