https://github.com/atahanyorganci/nb2md
Convert Jupyter notebooks to markdown
https://github.com/atahanyorganci/nb2md
converter deno jupyter jupyter-notebook markdown
Last synced: 3 months ago
JSON representation
Convert Jupyter notebooks to markdown
- Host: GitHub
- URL: https://github.com/atahanyorganci/nb2md
- Owner: atahanyorganci
- License: bsd-3-clause
- Created: 2022-03-31T21:02:34.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-01T21:06:44.000Z (about 4 years ago)
- Last Synced: 2025-05-31T15:49:25.941Z (about 1 year ago)
- Topics: converter, deno, jupyter, jupyter-notebook, markdown
- Language: TypeScript
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# nb2md
[](https://deno.land/x/nb2md)

Convert Jupyter notebooks to markdown
## Installation
```
deno install --allow-read --allow-write https://deno.land/x/init@v0.1.0/mod.ts
```
## Features
- Convert markdown cells into prose
- Based on notebook language convert code cells into fenced code blocks
- Convert `STDOUT` and `STDERR` into verbatim text
- Handle execute output
- `image/png` base64 encoded PNGs are decoded and save to image dir
- `text/html` HTML produced by `pandas.DataFrame` is converted into markdown tables
- `text/plain` is directly appended to output document
- `application/json` is embedded into output document as JSON fenced code blocks
## Usage
Convert a Jupyter notebook v4 into markdown
```shell
$ nb2md notebook.ipynb -o notebook.md
```
Skip output of code cells, default `false`
```shell
$ nb2md notebook.ipynb -o notebook.md --skip-output
```
Customize image directory, default `images`
```shell
$ nb2md notebook.ipynb -o notebook.md --image-dir img
```
## Options
- `--help` or `-h` will print the CLI documentation to the terminal.
- `--version` or `-v` will print the version number to the terminal
- `--output` or `-o` path to output file, **required**
- `--skip-output` skip code cell output, default `fasle`
- `--image-dir` path to the image directory, default `'images'`
## Contributing
You are welcome to report any bugs, other issues, or feature requests! If you want to add a fix/feature/other improvement fork this repository and make a pull request with your changes.