No description
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .envrc | ||
| notion-to-gitbook.py | ||
| poetry.lock | ||
| pyproject.toml | ||
| README.md | ||
Notion to Gitbook
Our workflow requires you to write everything in Notion, then copy-paste it to GitBook. This is a bad workflow. This script aims to ease the transfer from Notion to GitBook.
Installation
- Create and activate a virtualenv however you like
python -m pip install .
Usage
- In Notion, navigate to
...(upper right), then "Export". - Set Export format to "HTML". The other options don't matter.
- Unzip the resulting download to get a directory containing your Notion page in HTML.
- Run
notion-to-gitbook.py /path/to/downloaded/notion/. Note this is the dir, not the HTML file. - Tell Rich about any bugs.
If you're on a mac, you can run cat gitbook.html | pbcopy to copy the result straight to your clipboard.
Why
This script has a few advantages:
- Create empty image blocks with the caption pre-entered, so you can just upload the image rather than create one yourself
- De-duplicate figure captions
- Detect and semi-format math (can't full format b/c of GitBook bug)
- Correctly convert Notion callouts to GitBook callouts