def heading_to_md(cell):
    cell.cell_type = "markdown"
    level = cell.pop('level', 1)
    cell.source = '#'*level + ' ' + cell.source
turn heading cell into corresponding markdown
dataset/ETHPy150Open astroML/sklearn_tutorial/doc/notebooks/nbconvert.py/heading_to_md