Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !5378

Closed
Created Oct 20, 2013 by Administrator@rootOwner
  • Report abuse
Report abuse

Viewing IPython notebooks in GitLab

  • Overview 12
  • Commits 1
  • Changes 6

Created by: martijnvermaat

Dear GitLab maintainers,

With this pull request I intend to get some feedback on extending GitLab with live inline rendering of IPython Notebooks.

Introduction and rationale

The IPython Notebook is a web-based interactive environment for editing documents containing both executable code and rich text. The platform is becoming increasingly popular in the scientific community amongst others.

These documents are serialized as JSON and can be converted to HTML, PDF, and other formats using the IPython nbconvert tool. Static HTML renderings can also be shared over the web using the IPython Notebook Viewer and indeed this is quite popular for viewing notebooks stored in GitHub.

However, due to GitLab's focus being more on repositories with controlled access, it is not possible to use the IPython Notebook Viewer service with notebooks stored in GitLab. Even if it were possible, this would bring unwanted security issues since everything on the Notebook Viewer is public.

Implementation

This pull request is an ad-hoc implementation of live inline rendering of notebooks in GitLab. Clicking a notebook file in the GitLab web interface will convert the notebook to HTML using the IPython nbconvert tool and include it in the GitLab blob view as a base64 encoded data URI for an IFrame. The obvious benefit here is that everything happens inside the GitLab access controlled view of the blob.

You can find some more documentation on the patch here.

Since this is only a proof-of-concept, I can point out some obvious areas for improvement:

  • Somehow cache the nbconvert results.
  • Test (and presumably fix) files (in the same repository) linked from the notebook.
  • Add unit tests.

Request for feedback

I think this would be a great feature for IPython Notebook and GitLab users and it would give GitLab a clear advantage over GitHub for hosting IPython Notebook, especially in private repositories.

Are you interested in a feature like this? If so, let's discuss necessary improvements. If not, I'll try to keep my own branch up-to-date (and still welcome any feedback!).

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/martijnvermaat/blob-ipython-notebook