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.

In [1]:
println("Julia version = $VERSION")
Julia version = 0.6.0
In [2]:
Pkg.status("JuliaFEM")
WARNING: unknown Conda commit ebc2e3fb, metadata may be ahead of package cache
WARNING: unknown Conda commit f7a05aa0, metadata may be ahead of package cache
 - JuliaFEM                      0.3.0+             documentation

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.