3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【jupyterlab】コード非表示でhtml出力する方法

Posted at

背景

・jupyterlabでデータ解析をした結果をコード非表示で共有したい。
(プラグラムをしない人にデータ解析結果を共有する際にコードがない方がみやすい)
・jupyterlab(3.1.1)については、コード非表示で出力するための日本語記事が見つからなかった。

環境

windows10
jupyterlab(3.1.1)
nbconvert(6.1.0)

はじめに

jupyterlabのhtml出力は、下記画像のようなGUI操作しか知らなかった。
画像1.png

調べてみた1

下記URLにそれらしきやり方があった。
https://nbconvert.readthedocs.io/en/latest/changelog.html?highlight=hide#new-command-line-flags
画像2.png

調べてみた2

それらしきやり方があったが、GUIではなくCLIでの出力のよう、、、
CLIでどのようにhtml出力するかが、そもそもわからない、、、
調べてみた結果、下記でできた!

パワーシェルを開く

html出力したい.ipynbファイルがあるフォルダへ移動

パワーシュルで下記を実行

jupyter nbconvert --to html ファイル名.ipynb

コード非表示でhtml出力をしてみる

上記の「調べてみた1」と「調べてみた2」を合わせて
パワーシェルで下記を実行
(「調べてみた2」のコードの最後に「--no-input」を追記しただけ)

jupyter nbconvert --to html ファイル名.ipynb --no-input

これでコード非表示のhtml出力が完了

まとめ

・とりあえずjupyterlabでコード非表示の出力ができた
・マークダウンで各行の説明をしないと見ずらい
・CLIの出力には他にもコマンドがあるようなので、もっと便利なものもあるかも

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?