JupyterToScrapbox
Jupyter notebookファイルを scrapbox のインポート形式ファイルに変換するツール。
= インストール
rubygem でインストールしてください。シェルから
code:shell
gem install jupyter_to_scrapbox
= 使い方
シェルから
code:shell
bundle exec jupyter_to_scrapbox convert ファイル名 オプション > scrapbox.json 上で作成された scrapbox.json を、scrapbox のインポートツールを用いてインポートします。
ファイル名は Jupyter notebook (拡張子 .ipynb) を指定します。空白で区切って複数指定できます。
Jupyter notebook内の 画像ファイルをインポートするには、オプション -i または --image を指定してください (既定では指定されていません)
上のスクリプトを実行する前に、GYAZO のアクセストークンを、環境変数 GYAZO_TOKEN に設定してください。
code:shell
export GYAZO_TOKEN="access_token"
変換の実行
code:shell
bundle exec jupyter_to_scrapbox convert Untitled1.ipynb -i > scrapbox.json
現在対応する画像ファイル形式は PNG のみ。
注意
変換後のページタイトルは、各ファイルのベースネーム (親ディレクトリ名と拡張子を外した部分)です。
以下英語版ドキュメント。
This tool converts jupyter notebook files to json file suitable for import to scrapbox.
The Jupyter Notebook http://jupyter.org is an open-source web application that allows you to create and share documents that contain live code and explanatory text.