lesson-example
lesson-example copied to clipboard
Add demo of use Jupyter Notebook for lesson
Motivation
Make easy to have the correct output of Python code or any other language supported by Jupyter Notebook.
User case
I helped @alex-konovalov with the Software Carpentry Sage idea lesson. Sage is supported by Jupyter Notebook. And GAP developers, @alex-konovalov wrote the Software Carpentry GAP lesson, is working to have a kernel supported by Jupyter.
Screenshots
Markdown lesson (from the lesson-example repository)
RMarkdown lesson (from the lesson-example repository)
Jupyter notebook lesson (from this pull request)
The layout looks the same of the other sources.
"Limitations"
Jupyter notebook doesn't allow cells inside cells what makes having something like
> ## Challenge Title
>
> This is the body of the challenge.
>
> ```{python}
> it may include some code that Jupyter notebook is going to execute
> ```
> {: .source}
>
> > ## Solution
> >
> > This is the body of the solution.
> >
> > ```{python}
> > it may also include some code that Jupyter notebook is going to execute
> > ```
> > {: .output}
> {: .solution}
{: .challenge}
but Jupyter doesn't sanitize the HTML in Markdown cells what allows us to have the open of a HTML tag in one Markdown cell and the close of that HTML tag in another Markdown cell, like
<blockquote class="challenge">
## Challenge Title
This is the body of the challenge.
```{python}
it may include some code that Jupyter notebook is going to execute
```
<blockquote class="solution">
## Solution
This is the body of the solution.
```{python}
it may also include some code that Jupyter notebook is going to execute
```
</blockquote>
</blockquote>
I know that we try to avoid type HTML but I couldn't find another solution.
Next actions
Get feedback from @valentina-s, @tbekolay, @k8hertweck, @ChristinaLK, @gvwilson, @tracykteal, @ctb, @ethanwhite, and everyone from the community.
@rgaiacs any further plans about this PR?
any further plans about this PR?
No. I didn't receive any interest from @swcarpentry/python-maintainers about this plus I'm not happy with the use of the HTML tags.
I know that https://github.com/swcarpentry/lesson-example/pull/202 would not work for Sage or Gap. :-(