简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM