Command Line Interface
This guide provides a user-oriented walkthrough of the CLI module of ipynb2web. For detailed API documentation, please refer to the official documentation
Installation
To install ipynb2web
, run the following command:
npm install ipynb2web
Usage Overview
The ipynb2web
CLI provides three main commands to convert Jupyter notebooks (ipynb files) to various formats and create related assets. Execute it in the terminal as follows:
ipynb2web <COMMAND> <SAVETO> <FROM/or/SitemapName>
Commands
-
Convert Notebooks to JSON Documents: This command processes directories containing
.ipynb
files, converting them to JSON documents and creating navigation JSON for each directory.ipynb2web DirectoryName "custom/SAVETO/path/" "custom/FROM/path/"
-
Generate Sitemap: The sitemap command creates a
Sitemap.txt
file from multiple section navigations. It is useful for SEO and website navigation purposes.ipynb2web sitemap "custom/sitemap/path.txt"
-
Create Audio Assets: This command generates audio versions of documents, provided that the
.ipynb
files include the necessary frontmatter. It requires theOPENAI_API_KEY
to be stored in your.env
file.ipynb2web audio "custom/SAVETO/path/" "custom/FROM/path/"
Notes
- Ensure that the paths provided in the commands are accurate and accessible.
- The
OPENAI_API_KEY
is essential for theaudio
command to function correctly.