pywebtest-gitbook

0.0.3 • Public • Published

pywebtest-gitbook is a plugin for gitbook that allow to run python code in the gitbook with python editor.

For Editor , using ace and brython to run python code on browser. Running brython code are inspired from Pierre Quentel's answer from google group discussion.

Install

npm install pywebtest-gitbook

In your gitbook book.json

"plugin" : [
    "pywebtest-gitbook"
    ],
 "pluginsConfig" : {
      "bookPath" : "http://www.mybook.com/"
    }

You need to point the bookPath url because brython.js need to load from gitbook home path.

Screenshot

image

How to add python code

You can add python code like following

Hello World

[[[helloworld.py]]]


Bubbler Sort

[[[bubble.py]]]

You need to put your python file path between [[[ and ]]]

Example:

  • file.md
  • code
    • helloworld.py

In file.md , you can call like

This is file.md

[[[code/helloworld.py]]

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i pywebtest-gitbook

      Weekly Downloads

      4

      Version

      0.0.3

      License

      MIT

      Last publish

      Collaborators

      • saturngod