自动生成python笔记本的展厅页面

时间:2017-01-07 05:06:22

标签: documentation shogun

我想使用Travis这样的持续集成工具为我的jupyter笔记本生成一个陈列室页面。

一个完美的例子是Shogun's showroom page,但我不知道他们在使用什么。

1 个答案:

答案 0 :(得分:1)

我们正在使用buildbot来生成它;这是它的工作: http://buildbot.shogun-toolbox.org/builders/nightly_default/builds/44

生成笔记本的内容非常简单:

#!/bin/bash

export PYTHONPATH=$PWD/build_install/lib/python2.7/dist-packages:$PYTHONPATH
export LD_LIBRARY_PATH=$PWD/build_install/lib:$LD_LIBRARY_PATH

find $1 -type f \( -name '*.ipynb' ! -name 'template.ipynb' \) | xargs -I{} cp '{}' $3
find $1 -type f \( -name '*.ipynb' ! -name 'template.ipynb' \) | xargs -P $2 -I{} jupyter nbconvert --ExecutePreprocessor.timeout=600 --to html --output-dir $3 --execute '{}'
find $3 -type f -name '*.html' | xargs -P $2 -I{} python extract_image_from_html.py '{}'
相关问题