Jupyter

Hextra Jupyter Notebook renderer shortcode.

Renders a Jupyter Notebook (.ipynb) as code blocks and Markdown cells.

{{% hextra/jupyter "example-notebook.ipynb" %}}

Parameters:

ParameterDescriptionDefault
positionalPath or URL to the .ipynb file(required)
allowUnsafeHTMLSet to "true" to render raw HTML from notebook outputsfalse
filenameOptional filename to display as a header(none)

Example:

Sample Notebook 🔗

This Jupyter notebook demonstrates how the hextra/jupyter shortcode renders notebook cells. It supports Markdown cells, code cells with syntax highlighting, and cell outputs.

# A simple Python greeting
message = "Hello from the Academy!"
print(message)
Hello from the Academy!
# Generate Fibonacci numbers
def fibonacci(n):
    a, b = 0, 1
    result = []
    for _ in range(n):
        a, b = b, a + b
        result.append(a)
    return result

fibonacci(10)
[1, 1, 2, 3, 5, 8, 13, 21, 34, 55]

The notebook shortcode renders each cell in sequence:

  • Markdown cells are rendered as formatted text.
  • Code cells are displayed as syntax-highlighted code blocks.
  • Outputs (stream text and execution results) appear below their code cells.