方法一:通过markdown方式,图片自行上传
1. markdown格式导出(.md文件和png图片)
jupyter nbconvert --to markdown filename.ipynb
2. 用markdown编辑器,粘贴到blog
3. 将![png](output_1_0.png)处添加导出的图片output_1_0.png
方法二:通过HTML+CSS方式,需js权限
How to quickly turn an IPython notebook into a blog post
http://prooffreaderplus.blogspot.jp/2014/11/how-to-quickly-turn-ipython-notebook.html
1. HTML格式导出(不是file -> download as html)
jupyter nbconvert --to html --template basic filename.ipynb
2. 编辑器打开以html格式粘贴到blog
3. 在HTML代码中加入css代码
<style type="text/css"> .highlight{background: #f8f8f8; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .1em;padding:0em .5em;border-radius: 4px;} .k{color: #338822; font-weight: bold;} .kn{color: #338822; font-weight: bold;} .mi{color: #000000;} .o{color: #000000;} .ow{color: #BA22FF; font-weight: bold;} .nb{color: #338822;} .n{color: #000000;} .s{color: #cc2222;} .se{color: #cc2222; font-weight: bold;} .si{color: #C06688; font-weight: bold;} .nn{color: #4D00FF; font-weight: bold;} </style>