Drafter250
Drafter250

Reputation: 178

Export Jupyter notebook to HTML with line numbers?

If I turn on line numbers in my code cells in a Jupyter Notebook the rendered output when I go to download as HTML does not include the line numbers in the output.

Is there a setting in nbconvert that allows this? (I did not see anything obvious in the nbconvert docs)

If not, is it possible with custom templating in nbconvert?

Why: I want to be able to reference Line numbers from my markdown cells for tutorials.

Ipython 6.1.0 nbconvert 5.3.1 jupyter client 5.1.0

Upvotes: 4

Views: 1229

Answers (1)

TrinTragula
TrinTragula

Reputation: 380

This was solved in this issue of the ipyhton GitHub repository.

Basically nbconvert hasn't got a setting for this, but you can create a custom template to get the result you need.

Upvotes: 3

Related Questions