Neal Fultz
Neal Fultz

Reputation: 9696

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

Upvotes: 0

Views: 1343

Answers (2)

Neal Fultz
Neal Fultz

Reputation: 9696

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.

Upvotes: 1

John
John

Reputation: 1049

I had this problem too. My work-around was to realise that the pilcrow has its own class in the html, which is different to the headings it follows, and add the following to the css to make the pilcrow have font size 0, which removes the pilcrow from the rendered page.

.anchor-link{
    font-size: 0;
}

You could also make the text-color the same as the background, or a number of other things to make the Pilcrow effectively disappear.

Upvotes: 1

Related Questions