Giter VIP home page Giter VIP logo

lektor-jupyter-preprocess's Introduction

Lektor Jupyter preprocess

Integrate Jupyter notebooks into Lektor CMS.

Installation

The plugin is not installable via PyPI (yet), so you have to install it as a local plugin in the packages folder of your site.

Get the code

Copy it

Download this folder and copy it into <your lektor site>/package.

... or add as git submodule

$ mkdir <your lektor site>/packages
$ cd <your lektor site>/packages
$ git submodule add https://github.com/obestwalter/lektor-jupyter-preprocess

Get started

Once you have the plugin in packages, run a lektor clean and lektor serve to start integrating notebook powered articles into your site.

Have a look at the example project how to configure and use it.

The plugin is in use on my personal website - read more about how it works in the obligatory meta article about my website.

Warning: minimal implementation

I am mainly using this to render simple notebooks with text output. Anything more involved would need to render directly to HTML, which is likely possible by extending this plugin. The are a few todos in the code already about this.

If this is not what you want

lektor-jupyter-preprocess's People

Contributors

obestwalter avatar

Stargazers

Rebecca Ingram avatar  avatar Maxime Liquet avatar Alper Ozaydin avatar

Watchers

 avatar James Cloos avatar

lektor-jupyter-preprocess's Issues

Modify load magic to load and highlight other file types

problem: i want to load other types than Python code from external files

solution: extend the %load magic processing to take a filename and afterwards the type that should correspond with a recognized highlighting string - e.g.

%load tox.ini ini would generate the markdown

```ini
[tox]
skipsdist = True

[testenv]
[...]
```

Insert into contents.lr rather than clobber

problem: I want to keep my data in contents. lr

solution: if the plugin finds a section wrapped in special comments, the markdown will be inserted in that section e.g.:

<!--JUPYTER_PREPROCESS-->
content from a jupyter notebook

...

lots of it
<!--JUPYTER_PREPROCESS-->

More configuration

defaults for how to handle cells by default

make configurable in configs/jupyter-preprocess.ini, metadata and directly in cell:

  • what exactly the fenced code blocks should look like
  • global settings for execution behaviour
  • full or abridged traceback (global and cell-level)

When a cell is preprocessed and contains no cell-level metadata, the corresponding default value will be used.

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.