Skip to content

Commit

Permalink
Add colab example notebook (#111)
Browse files Browse the repository at this point in the history
* add colab example; set default theme

* Update example-data/ImJoy_elFinder_Colab.ipynb

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
  • Loading branch information
oeway and MartinHjelmare committed Sep 24, 2020
1 parent dfe7c48 commit ff3186c
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
# ImJoy elFinder [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/imjoy-team/imjoy-elfinder/master?urlpath=elfinder) [![PyPI](https://img.shields.io/pypi/v/imjoy-elfinder.svg?style=popout)](https://pypi.org/project/imjoy-elfinder/) ![Version](https://img.shields.io/badge/dynamic/json.svg?color=success&label=latest&prefix=v&query=version&url=https://raw.githubusercontent.com/imjoy-team/imjoy-elfinder/master/imjoy_elfinder/VERSION) [![Test](https://github.com/imjoy-team/imjoy-elfinder/workflows/Test/badge.svg)](https://github.com/imjoy-team/imjoy-elfinder/actions)
# ImJoy elFinder [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/imjoy-team/imjoy-elfinder/master?urlpath=elfinder) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/imjoy-team/imjoy-elfinder/blob/master/example-data/ImJoy_elFinder_Colab.ipynb) [![PyPI](https://img.shields.io/pypi/v/imjoy-elfinder.svg?style=popout)](https://pypi.org/project/imjoy-elfinder/) ![Version](https://img.shields.io/badge/dynamic/json.svg?color=success&label=latest&prefix=v&query=version&url=https://raw.githubusercontent.com/imjoy-team/imjoy-elfinder/master/imjoy_elfinder/VERSION) [![Test](https://github.com/imjoy-team/imjoy-elfinder/workflows/Test/badge.svg)](https://github.com/imjoy-team/imjoy-elfinder/actions)

A web file browser for managing data on remote jupyter servers, specifically built for the [ImJoy](https://imjoy.io) project, an open source platform for deploying computational tools to the end user.

Expand Down
93 changes: 93 additions & 0 deletions example-data/ImJoy_elFinder_Colab.ipynb
@@ -0,0 +1,93 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "ImJoy-elFinder-Colab.ipynb",
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "MgoYmq0DjwpX",
"colab_type": "text"
},
"source": [
"## ImJoy-elFinder in Google Colab\n",
"\n",
"ImJoy-elFinder is a file browser designed for the web.\n",
"\n",
"In this notebook, we demonstrate how you can run ImJoy-elFinder in Google Colab to support previewing, downloading and uploading files.\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "sS2qnw42jqh8",
"colab_type": "code",
"colab": {}
},
"source": [
"!pip install imjoy-elfinder"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "pzGAXh2RkLej",
"colab_type": "code",
"colab": {}
},
"source": [
"import threading\n",
"from google.colab import output\n",
"from imjoy_elfinder.app import main\n",
"\n",
"# start imjoy-elfinder server\n",
"thread = threading.Thread(target=main, args=[[\"--root-dir=/content\", \"--port=8765\"]])\n",
"thread.start()\n",
"\n",
"# view the \n",
"output.serve_kernel_port_as_iframe(8765, height='800')"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "v4aBe_K_lgF0",
"colab_type": "code",
"colab": {}
},
"source": [
"# open imjoy-elfinder in a new tab\n",
"output.serve_kernel_port_as_window(8765)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "_ufulSAnm286",
"colab_type": "code",
"colab": {}
},
"source": [
""
],
"execution_count": null,
"outputs": []
}
]
}
2 changes: 1 addition & 1 deletion imjoy_elfinder/VERSION
@@ -1,3 +1,3 @@
{
"version": "0.1.58"
"version": "0.1.59"
}
2 changes: 1 addition & 1 deletion imjoy_elfinder/templates/elfinder/main.js
Expand Up @@ -155,7 +155,7 @@
height: '100%',
rememberLastDir: false,
cssAutoLoad: true,
theme: 'material-light',
theme: 'default',
themes: {
'dark-slim': 'https://johnfort.github.io/elFinder.themes/dark-slim/manifest.json',
'material': 'https://nao-pon.github.io/elfinder-theme-manifests/material-default.json',
Expand Down

0 comments on commit ff3186c

Please sign in to comment.