The fastpages blog engine is very useful to write a notebook. But I wanted to be able to write HTML directly in my notebook to implement a template.

For the moment, I'm not going to do like that, I'll keep my template in a classic notebook, but I'll leave you here the technique to write HTML from a notebook which will be interpreted by fastpages in HTML.

This is HTML written in the notebook in a plain text cell (not Markdown), with h3 tags

If I try to write html with print in a code cell, it fails.

age = 45
name = "Paul"
gap = 10
print(f"<h3>In {gap} year(s), {name} will be {age + gap} year(s) old.</h3>")

With this formula, a new plain text cell is created, so that's good!

get_ipython().run_cell_magic(u'HTML', u'',f"<h3>In {gap} year(s), {name} will be {age + gap} year(s) old.</h3>")

In 10 year(s), Paul will be 55 year(s) old.