Giter Club home page Giter Club logo

jekyll-jupyter-notebook's Introduction

Jekyll Jupyter Notebook

支持在 Jekyll 文档中嵌入 ipynb 的插件.

实现受到 https://github.com/red-data-tools/jekyll-jupyter-notebook 的启发, 但是我不需要嵌入 html 格式, 所以直接重写了.

Installation

在 Gemfile 里面追加依赖:

gem "jekyll-jupyter-notebook", :git => "https://github.com/sidgwick/jekyll-jupyter-notebook"

之后执行 bundle install 安装依赖.

接下来在 _config.yamlplugin 部分追加 jekyll-jupyter-notebook, 启用本插件.

Usage

在需要插入 Notebook 的地方, 按下面的方法写:

{% jupyter_notebook decision_stump.ipynb %}

这段代码会执行

jupyter nbconvert --template nbmd --to markdown --stdout decision_stump.ipynb

decision_stump.ipynb 转化为 markdown, 使用的模板是 nbmd, 要求它位于 jekyll 项目根目录下面, 因此需要创建一个这样的模板目录, 模板编写请参考https://nbconvert.readthedocs.io/en/latest/customizing.html, 如果不需要定制模板, 则按照链接里面说明, 简单继承官方的 markdown 模板就好.

我自己使用的模板, 可以参考 https://github.com/sidgwick/sidgwick.github.io/tree/master/nbmd.

TODO

  • 支持直接通过网络形式拉取 ipynb 资源

jekyll-jupyter-notebook's People

Watchers

Zhigang Song avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.