| Crates.io | ipynb-to-md |
| lib.rs | ipynb-to-md |
| version | 0.2.0 |
| created_at | 2025-01-11 06:54:55.650372+00 |
| updated_at | 2025-01-13 14:40:33.040823+00 |
| description | Convert Jupyter Notebooks to Markdown files |
| homepage | https://github.com/diaakasem/ipynb-to-md |
| repository | https://github.com/diaakasem/ipynb-to-md |
| max_upload_size | |
| id | 1512213 |
| size | 17,884 |
A simple command-line tool that converts Jupyter/IPython Notebook (.ipynb) files into Markdown (.md) files. This is especially handy when you want to share your notebook content (including code snippets and outputs) in Markdown-based documentation. I personally use it in Yazi to preview ipynb files.
cargo install ipynb-to-md
git clone https://github.com/<your-username>/ipynb-to-md.git
cd ipynb-to-md
cargo build
cargo run -- <input.ipynb> [output.md]
If you prefer a release build (optimized for performance), use:
cargo build --release
Then the compiled binary will be located in target/release/ipynb-to-md.
ipynb-to-md -f html -i my_notebook.ipynb -o converted_notebook.md
or
cat my_notebook.ipynb | ipynb-to-md > converted_notebook.md
After running, you should see either an on-screen or file-based representation of your original notebook in Markdown format.
-i, --input <INPUT>: The path to a valid Jupyter Notebook file. If not specified, the program will read from standard input.-o, --output <OUTPUT>: Optional path to the resulting Markdown file.
-f, --format <FORMAT> Output format (text is default) [default: text] [possible values: text, html]-h, --help: Display the help message.-V, --version: Display the version number.Sample .ipynb content might look like this (in abbreviated JSON form):
{
"cells": [
{
"cell_type": "markdown",
"source": ["# My Notebook\\n", "This is a markdown cell\\n"]
},
{
"cell_type": "code",
"source": ["print(\"Hello, world!\")\\n"],
"outputs": [
{
"output_type": "stream",
"text": ["Hello, world!\\n"]
}
]
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}
When converted, you’d get:
# My Notebook
This is a markdown cell
```python
print("Hello, world!")
```
Hello, world!
This project is distributed under the MIT License. You are free to use, modify, and distribute this software as allowed by its license.
Contributions of all kinds are welcome! Feel free to open an issue for any bugs, feature requests, or general questions. If you’d like to make code changes:
We appreciate your feedback and contributions!
Happy coding! If you find this tool helpful, consider giving the repository a star ⭐ on GitHub!