转换Jupyter笔记本
nbconvert的Python项目详细描述
nbconvert
Jupyter笔记本电脑转换
nbconvert工具jupyter nbconvert
将笔记本转换为各种其他的
通过Jinja模板格式化nbconvert工具允许您转换
.ipynb
将笔记本文件转换成各种静态格式,包括:
- HTML
- 乳胶
- PDF格式
- 显示js
- 降价(MD)
- 重组文本(RST)
- 可执行脚本
用法
在命令行中,使用nbconvert将jupyter笔记本(input)转换为 另一种格式(output)。基本的指挥结构是:
$ jupyter nbconvert --to <output format> <input notebook>
其中,<output format>
是所需的输出格式,<input notebook>
是
Jupyter笔记本的文件名。
示例:将笔记本转换为HTML
使用:
$ jupyter nbconvert --to html mynotebook.ipynb
此命令创建名为mynotebook.html
的HTML输出文件
dev安装
检查是否安装了pandoc(pandoc --version
);如果需要,请安装:
sudo apt-get install pandoc
或
brew install pandoc
安装nbconvert进行开发,使用:
git clone https://github.com/jupyter/nbconvert.git
cd nbconvert
pip install -e .
在上面的dev安装之后运行测试:
pip install nbconvert[test]
py.test --pyargs nbconvert
资源
- Documentation for Jupyter nbconvert [PDF]
- nbconvert examples on GitHub
- Issues
- Technical support - Jupyter Google Group
- Project Jupyter website
- Documentation for Project Jupyter [PDF]