Displaying HTML files without code

If you are exporting your notebook content into an html format, you may want to display content such as markdown and visualizations, but not your code. Fortunately, there is an easy way to do this by using nbconvert configuration options. Open your Terminal and run the following line of code:

jupyter nbconvert --no-input --to html lindsay.ipynb

The preceding command instructs jupyter to use nbconvert to convert your file into html with no cell inputs. The --no-input flag ensures that only the outputs of cells will appear.

Your HTML file should look as follows:

Only the outputs of the cells appear—the code and markdown written in the inputs of the cells are not displayed. This command can be extremely useful when publishing your work.

More information about hiding cell content when converting notebooks can be found at the following link: https://stackoverflow.com/questions/49907455/hide-code-when-exporting-jupyter-notebook-to-html.

You can find additional useful commands for nbconvert in the official documentation: https://nbconvert.readthedocs.io/en/latest/config_options.html#cli-flags-and-aliases.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset