A Python package for generating a table of contents for Jupyter notebooks
Project description
Jupyter Notebook ToC
This is a simple extension to generate a table of contents for a Jupyter notebook.
Basic Usage
import jupyter_toc
jupyter_toc.build()
It will return something like this:
Table of Contents
- [Introduction](#introduction)
- [Subhead](##subhead)
- [Usage](#usage)
- [Development](#development)
Advanced Usage
You can pass arguments to customize the following:
title
- The title of the table of contents.depth
- The maximum depth of headings to include in the table of contents.make_hyperlinks
- Whether to make the table of contents entries hyperlinks.print_output
- Whether to print the ToC or just return it as a string.
Contributing
Feel free to open an issue or submit a pull request.
To publish a new version to PyPI:
pip install twine wheel # if you don't have it already
python setup.py sdist bdist_wheel # build the package
twine upload dist/* # upload to PyPI
Development
Running Tests
The test suite can be run using Python's built-in unittest
framework.
Navigate to the tests
directory and run:
python -m unittest test_jupyter_toc.py
Or, if you're in the root directory:
python -m unittest tests/test_jupyter_toc.py
Authors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jupyter-toc-1.1.2.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file jupyter-toc-1.1.2.tar.gz
.
File metadata
- Download URL: jupyter-toc-1.1.2.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d2e25a6196db157218414790a1463f94fb9ef40094da0a81556aef9621e57fa |
|
MD5 | 7a7ee1b3164dc1d3150d55a3563d8c61 |
|
BLAKE2b-256 | 496bf1f56d830a9f60365b75f2e137a5dea2ef8ad91236f92bb8a8b74426d07f |
File details
Details for the file jupyter_toc-1.1.2-py3-none-any.whl
.
File metadata
- Download URL: jupyter_toc-1.1.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6978e48181b50da462370d092dae08747b01be12879ad7c88316688f8a16d76 |
|
MD5 | 56ece9e58011840bb253b862f03981e7 |
|
BLAKE2b-256 | c077b24ff6f43f0f90cb6efdb28c4a94a78acdd9aa70f6c49e1462661e2d2c58 |