lesson-example icon indicating copy to clipboard operation
lesson-example copied to clipboard

Add demo of use Jupyter Notebook for lesson

Open rgaiacs opened this issue 8 years ago • 2 comments

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)

screencapture-swcarpentry-github-io-lesson-example-04-formatting-1484786584239

RMarkdown lesson (from the lesson-example repository)

screencapture-swcarpentry-github-io-lesson-example-06-rmarkdown-example-1484786529982

Jupyter notebook lesson (from this pull request)

screencapture-localhost-4000-07-jupyter-1484786481713

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 avatar Jan 19 '17 01:01 rgaiacs

@rgaiacs any further plans about this PR?

olexandr-konovalov avatar May 22 '18 11:05 olexandr-konovalov

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. :-(

rgaiacs avatar May 23 '18 07:05 rgaiacs