Skip to content

Notebook ​

Romain CasatiNovember 15, 2024· in Notebook· 1 min read

Iframes in Markdown ​

The Markdown cells of Basthon's notebook can embed outside pages with the <iframe> tag: map, video, applet… For security, these iframes are put in a sandbox (sandbox) and have no access to the notebook.

html
<iframe
  width="100%"
  height="350"
  src="https://www.openstreetmap.org/export/embed.html?bbox=2.284%2C48.853%2C2.305%2C48.864&amp;marker=48.8584%2C2.2945"
></iframe>

Play with it!

Iframe in a Markdown cell


Romain CasatiOctober 22, 2024· in Python, Notebook· 1 min read

clear_output ​

The clear_output function of the IPython.display module works in Basthon: it clears the output of the current cell. With wait=True, the clearing only happens at the next display, which avoids flickering. Perfect for a progress bar, a countdown or a little text animation!

Play with it!

clear_output


Romain CasatiSeptember 18, 2024· in Notebook· 1 min read

Mermaid ​

The Markdown cells of Basthon's notebook can now draw Mermaid diagrams: graphs, sequence, class or state diagrams… A mermaid code block is all it takes:

markdown
```mermaid
graph LR
    A[Input] --> B{Test}
    B -->|true| C[Action]
    B -->|false| D[End]
```

They can also be produced from Python with IPython.display.Markdown.

Play with it!

Mermaid


Romain CasatiNovember 22, 2023· in Notebook· 1 min read

Read-only instructions ​

An unfortunate double click on an instruction, and the student faces Markdown code… With the romd extension (for read-only markdown, URL parameter extensions=romd), the Markdown cells of Basthon's notebook can no longer be edited, and none can be created.

Play with it!

Read-only Markdown


Romain CasatiNovember 22, 2023· in Notebook· 1 min read

Line numbers from the start ​

With the linenumbers extension (URL parameter extensions=linenumbers), Basthon's notebook opens with line numbers shown in every code cell. Handy to tell a student "look at line 4"!

Play with it!

Line numbers