Search code examples
markdownjupyter-notebooknbconvert

In exported Jupyter Notebooks, how do I disable the ¶?


When I export a notebook to html, my headings have a ¶ (pilcrow) at the end; how do I turn that off?

Here is an example command I am using:

jupyter nbconvert --to html --template basic Untitled.ipynb

where the notebook just contains a cell with a markdown heading and text:

# Here I am

Rock you like a hurricane

Solution

  • This is now supported as a config option:

    c.HTMLExporter.anchor_link_text = '' # disable pilcrow, requires nbconvert >= 5.2
    

    OLD:

    I was able to turn off pilcrows by patching the markdown renderer:

    import mistune
    import nbconvert
    nbconvert.filters.markdown_mistune.IPythonRenderer.header = mistune.Renderer.header
    

    This seems pretty hacky though.