Good news, everyone!
Good news, everyone! (2020-06-13)
In [1]:
# TITLE: Good news, everyone!
# DATE: 2020-06-13
# TAGS: announcement,static website generator
from matplotlib import pyplot as plt
import pandas as pd
%matplotlib inline
/home/stewart/.pyenv/versions/3.7.5/lib/python3.7/site-packages/pandas/compat/ UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.

It's fun to write stuff. But as a software engineer, I always felt like every tool I use to write was a little bit off. But that changed recently. Writing things on a Jupyter notebook became my new habit and I love it. It is powerful to use both Markdown and code/MathJax interactively without going back and forth between your terminal and Markdown editor.

However, a new problem arises with this new habit of mine. While Markdown is widely supported in many statically generated publication solutions (e.g. Jekyll), Jupyter notebooks are not the easiest thing you can use for a blog post. The ones that do support Jupyter notebooks are either pretty complex to set up or not to my liking. So I decided to write a new one just for me.

The first cell of the notebook holds meta info like below, which will be parsed and used to generate indices:

In [2]:
# TITLE: the blog title
# COVER: the cover picture URL
# DATE: the date
# TAGS: tag a,tag b,...

But showing the above cell in the content will be very noisy, so you can add special cell tags to hide the input, or the output, or both! (input_hidden, output_hidden, hidden)

And then you can continue writing your code, with some Markdown cells here and there. Viola! The below cells are examples:

$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a}. $$
In [3]:
pd.DataFrame([range(100), range(100)])
0 1 2 3 4 5 6 7 8 9 ... 90 91 92 93 94 95 96 97 98 99
0 0 1 2 3 4 5 6 7 8 9 ... 90 91 92 93 94 95 96 97 98 99
1 0 1 2 3 4 5 6 7 8 9 ... 90 91 92 93 94 95 96 97 98 99

2 rows × 100 columns

In [4]:
plt.plot([x ** 2 for x in range(100)])
[<matplotlib.lines.Line2D at 0x7f33bcaed190>]

Pretty cool!

The blog templates are custom built for my blog, but it is customizable for your blog as well. If you want to use this for your blog, please check out the Github repo.

The good news is that I have some bad news for you: I started my blog again.