Metadata-Version: 2.4
Name: nixnb
Version: 0.1.0
Summary: Bi-directional Jupyter Notebook conversion: beautify ipynb/HTML to clean responsive pages, or restore HTML back to ipynb
Author: nixnb contributors
License: MIT
Keywords: jupyter,notebook,nbconvert,html,ipynb,beautify
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: beautifulsoup4>=4.7
Requires-Dist: nbformat>=5.1
Provides-Extra: nbconvert
Requires-Dist: nbconvert>=7.0; extra == "nbconvert"

# nixnb

Bi-directional Jupyter Notebook conversion tool.

- **Forward**: Turn `.ipynb` or Jupyter-exported HTML into a clean, responsive page that works on desktop, tablet, and mobile
- **Reverse**: Restore such HTML back to `.ipynb`, recovering code, markdown, and outputs as a validated nbformat notebook

## Installation

```bash
pip install nixnb
```

For `.ipynb` input (forward mode), `nbconvert` is also required:

```bash
pip install nbconvert
```

## Usage

### Forward: ipynb/html → beautified HTML

```bash
nixnb notebook.ipynb                    # → notebook-beautified.html
nixnb notebook.html                     # → notebook-beautified.html
nixnb notebook.html -o output.html      # explicit output path
nixnb notebook.html -o outputs/         # output to directory
```

### Reverse: html → ipynb

```bash
nixnb notebook.html -o output.ipynb     # trigger by .ipynb suffix
nixnb notebook.html --to-ipynb          # explicit flag, auto-named output
nixnb notebook.html --to-ipynb -o out.ipynb
```

### Full help

```bash
nixnb -h
```

## Features

- Responsive layout (desktop / tablet / mobile)
- Floating sidebar TOC (desktop), drawer TOC (mobile)
- Styled pandas DataFrames (zebra striping, hover highlight, tabular numbers)
- Re-colored syntax highlighting
- Auto-resize images
- Reverse conversion preserves code, markdown, and outputs as validated nbformat notebooks (correct output types, cell IDs, and metadata)

## Credits

Reverse conversion is based on
[takluyver/html_to_ipynb](https://github.com/takluyver/html_to_ipynb),
with additions: (1) it works on the beautified HTML that nixnb itself
produces, (2) it preserves cell outputs — text, DataFrames, and images —
rather than dropping them, (3) it strips stray whitespace so the
recovered source code is clean, and (4) it builds notebooks through the
official `nbformat` library so the output validates against the nbformat
4.5 specification.

## License

MIT
