Skip to content

Commit

Permalink
docs: add homepage and example notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed May 4, 2021
1 parent f346fd8 commit e79cbfe
Show file tree
Hide file tree
Showing 2 changed files with 182 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Mudkip

A friendly Sphinx wrapper for the rest of us.

```{toctree}
:hidden:
notebook_example
```

```{toctree}
:caption: Project links
:hidden:
GitHub Repository <https://github.com/vberlier/mudkip>
PyPI Package <https://pypi.org/project/mudkip>
```

---

```{eval-rst}
.. mdinclude:: ../README.md
:start-line: 9
:end-line: -3
```
157 changes: 157 additions & 0 deletions docs/notebook_example.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "scenic-marathon",
"metadata": {},
"source": [
"# Notebook example\n",
"\n",
"This page shows that Mudkip handles Jupyter Notebooks out of the box."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "median-penalty",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"8.366600265340756"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import math\n",
"\n",
"math.sqrt(7 + 63)"
]
},
{
"cell_type": "markdown",
"id": "coordinate-resolution",
"metadata": {},
"source": [
"You can use the `mudkip develop` command to open the jupyter notebook in the docs directory.\n",
"\n",
"```bash\n",
"$ mudkip develop --notebook\n",
"Watching \"docs\"...\n",
"Server running on http://localhost:5500\n",
"Notebook running on http://localhost:8888/?token=8549b18d...\n",
"```\n",
"\n",
"For more information about how notebooks are handled you can check out the documentation for the [`myst-nb`](https://myst-nb.readthedocs.io/en/latest/) extension. \n",
"\n",
"## A few demos"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "oriented-stevens",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"'Hello'\n",
"'Hello'\n"
]
},
{
"data": {
"text/plain": [
"'Hello'"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"print(repr(\"Hello\"))\n",
"print(repr(\"Hello\"))\n",
"\"Hello\""
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "manual-straight",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"i = 0\n",
"i = 1\n",
"i = 2\n"
]
}
],
"source": [
"for i in range(3):\n",
" print(f\"{i = }\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "extensive-header",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Point(x=1, y=2)"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from dataclasses import dataclass\n",
"\n",
"@dataclass\n",
"class Point:\n",
" x: float\n",
" y: float\n",
"\n",
"Point(1, 2)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit e79cbfe

Please sign in to comment.