Instructions how to write examples using Jupyter notebook
These instructions describe how to make examples using Jupyter Notebooks.
All files should be in a single directory, use coding yyyy-mm-dd-description-of-my-notebook
, e.g. 2017-08-06-instructions-how-to-write-examples
.
After you are ready with the notebook, use use jupyter nbconvert
to convert notebook to html. Use basic template. For this notebook, the command was
jupyter nbconvert --to html --template basic notebook.ipynb
You can have this in your Makefile
, if still experimenting. Content of Makefile
for this notebook is
all:
jupyter nbconvert --to html --template basic notebook.ipynb
After that create index.md
containing metadata for example. Moreover, in index.md
one must include just generated html file. The content of the index.md
for this post is
---
layout: example
author: Jukka Aho
title: Instructions how to write examples using Jupyter notebook
date: 2017-08-06
categories: instructions
---
{% include_relative notebook.html %}
The last line including notebook may differ depending the name of the notebook.
It's preferable to add some categories to post, I case that later on we filter posts by them.
Add category of used JuliaFEM version, e.g. juliafem-0.3.0
. Also, it's good to show in notebook, what version of Julia and JuliaFEM is currently used, i.e.
println("Julia version = $VERSION")
Pkg.status("JuliaFEM")
Also use print_timer()
when necessary to give information about the runtimes of models.
When everything is ready, fork juliafem.github.io
, add directory to /_examples/
and do pull request as usual.