Example Jupyter Notebook¶
This is a sample Jupyter notebook to demonstrate the mkdocs-jupyter plugin functionality.
Simple Python Example¶
Let's start with a simple Python example:
In [1]:
Copied!
# Simple Python code
print("Hello from Jupyter!")
print("This notebook is rendered with mkdocs-jupyter.")
# Simple Python code
print("Hello from Jupyter!")
print("This notebook is rendered with mkdocs-jupyter.")
Hello from Jupyter! This notebook is rendered with mkdocs-jupyter.
Variables and Calculations¶
In [2]:
Copied!
# Basic calculations
a = 42
b = 58
result = a + b
print(f"The sum of {a} and {b} is: {result}")
# Basic calculations
a = 42
b = 58
result = a + b
print(f"The sum of {a} and {b} is: {result}")
The sum of 42 and 58 is: 100
Lists and Iteration¶
In [3]:
Copied!
# Working with lists
numbers = [1, 2, 3, 4, 5]
squared = [n**2 for n in numbers]
print(f"Squared values: {squared}")
# Working with lists
numbers = [1, 2, 3, 4, 5]
squared = [n**2 for n in numbers]
print(f"Squared values: {squared}")
Squared values: [1, 4, 9, 16, 25]
Conclusion¶
This demonstrates how Jupyter notebooks can be seamlessly integrated into your MkDocs site. You can:
- Write markdown and code cells
- Display outputs
- Create interactive documentation
- Share data science work