name = '2015-08-31-bolo_cerveja'
title = "Beer Cake"
%matplotlib inline
import os
from datetime import datetime
from IPython.core.display import HTML
with open('creative_commons.txt', 'r') as f:
html = f.read()
hour = datetime.utcnow().strftime('%H:%M')
comments="true"
date = '-'.join(name.split('-')[:3])
slug = '-'.join(name.split('-')[3:])
metadata = dict(title=title,
date=date,
hour=hour,
comments=comments,
slug=slug,
name=name)
markdown = """Title: {title}
date: {date} {hour}
comments: {comments}
slug: {slug}
{{% notebook {name}.ipynb cells[2:] %}}
""".format(**metadata)
content = os.path.abspath(os.path.join(os.getcwd(),
os.pardir,
os.pardir,
'{}.md'.format(name)))
with open('{}'.format(content), 'w') as f:
f.writelines(markdown)
html = '''
<small>
<p> This post was written as an IPython notebook.
It is available for <a href='https://ocefpaf.github.com/python4oceanographers/downloads/notebooks/%s.ipynb'>download</a>
or as a static <a href='https://nbviewer.ipython.org/url/ocefpaf.github.com/python4oceanographers/downloads/notebooks/%s.ipynb'>html</a>.</p>
<p></p>
%s''' % (name, name, html)
Pre-heat oven at 180 degC
Use two 20 cm dish greased and sprinkled with the cocoa
Melt the butter with the beer.
Mix the flour, baking power, sodium bicarbonate, salt, and the cocoa
Mix the rest of the ingredients to prepare the dough
Spread over the dishes
Bake for 40-550 min
Batter at medium speed the cream cheese and the butter adding the vanilla and the sugar icing
Level the cake top and bottom and add the topping on both. Mount one on top of the other.
HTML(html)
This post was written as an IPython notebook. It is available for download or as a static html.