Skip to content

Commit

Permalink
Add initial demos (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl authored Oct 9, 2022
1 parent 16f7f20 commit 3048178
Show file tree
Hide file tree
Showing 39 changed files with 2,444 additions and 462 deletions.
4 changes: 3 additions & 1 deletion .binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ dependencies:
# build
- flit >=3.7.1
- doit-with-toml
# run
# demo
- ipywidgets >=8
- jupyterlab-myst
- jupyterlab-webrtc-docprovider
- jupyter-videochat
# docs
- docutils >=0.18
- pydata-sphinx-theme
Expand Down
5 changes: 4 additions & 1 deletion .binder/postBuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
set -eux
source activate ${NB_CONDA_PREFIX}
source activate ${NB_PYTHON_PREFIX}
IN_BINDER=1 doit dev

mkdir -p ${NB_PYTHON_PREFIX}/share/jupyter/lab/settings
cp .binder/overrides.json ${NB_PYTHON_PREFIX}/share/jupyter/lab/settings
54 changes: 34 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: CI

on:
push:
Expand All @@ -8,19 +8,30 @@ on:
branches:
- '*'

env:
CACHE_EPOCH: 0

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: install (conda)
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: .binder/environment.yml
miniforge-variant: Mambaforge
use-mamba: true
- name: install (conda)
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: .binder/environment.yml
miniforge-variant: Mambaforge
use-mamba: true

- name: Cache (node_modules)
uses: actions/cache@v3
id: cache-node-modules
with:
path: node_modules/
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
- name: Build dist
shell: bash -l {0}
Expand All @@ -29,27 +40,30 @@ jobs:
- name: Upload (dist)
uses: actions/upload-artifact@v3
with:
name: jupyterlab-deck dist ${{ github.run_number }}
name: jupyterlab-deck-dist-${{ github.run_number }}
path: ./dist

build:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: install (conda)
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: .binder/environment.yml
miniforge-variant: Mambaforge
use-mamba: true
- name: Cache (node_modules)
uses: actions/cache@v3
id: cache-node-modules
with:
path: node_modules/
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
- name: Lint
shell: bash -l {0}
run: doit lint
- name: install (conda)
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: .binder/environment.yml
miniforge-variant: Mambaforge
use-mamba: true

- name: Lint
shell: bash -l {0}
run: |
git -u diff && exit 1
run: doit lint
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Changelog

### `0.1.0`

- initial release
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing
## Contributing

## Setup
### Setup

- Start with [Mambaforge](https://github.com/conda-forge/miniforge)

Expand All @@ -9,7 +9,7 @@ mamba env update --prefix .venv --file .binder/environment.yml
source activate ./.venv
```

## `doit`
### `doit`

The various build tasks are managed by [doit](https://pydoit.org). To get up to a
ready-to-play JupyterLab:
Expand Down
46 changes: 23 additions & 23 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
BSD 3-Clause License
BSD 3-Clause License

Copyright (c) 2022, Dead Pixels Collective
All rights reserved.
Copyright (c) 2022, jupyterlab-deck contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# `jupyterlab-deck`

[![rtd-badge]][rtd] [![binder-badge]][binder] [![ci-badge]][ci]

[binder-badge]: https://mybinder.org/badge_logo.svg
[binder]:
https://mybinder.org/v2/gh/deathbeds/jupyterlab-deck/HEAD?urlpath=lab/tree/examples/README.ipynb
[ci-badge]: https://img.shields.io/github/checks-status/deathbeds/jupyterlab-deck/main
[ci]: https://github.com/deathbeds/jupyterlab-deck/actions?query=branch%3Amain
[rtd-badge]: https://img.shields.io/readthedocs/jupyterlab-deck
[rtd]: https://jupyterlab-deck.rtfd.io

> Lightweight presentations for JupyterLab
## Installation
Expand All @@ -17,21 +27,27 @@
> mamba install jupyterlab-deck
> ```

## Usage

- Add _slide metadata_ with the _Advanced tools_
- When viewing a _Notebook_, click the _deck_ icon
- Use the _navigation controls_ or _keyboard shortcuts_ to navigate through the deck
- Exit the deck with <kbd>shift+esc</kbd>

## Linking
## Enabling Deck Mode at startup

Open a deck directly to a JupyterLab/JupyterLite URL with:
- see the JupyterLab docs about [settings overrides][overrides].

```json
{
"@deathbeds/jupyterlab-deck:plugin": {
"active": true
}
}
```
http://127.0.0.1:8888/lab?deck=intro.ipynb
```

[overrides]:
https://jupyterlab.readthedocs.io/en/stable/user/directories.html#overrides-json

## Uninstall

Expand Down
5 changes: 5 additions & 0 deletions docs/_static/deck.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/_static/theme.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
html {
background-color: transparent;
iframe {
box-shadow: 2px 2px 5px var(--pst-color-text-muted);
}
18 changes: 10 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,26 @@
import json
import os
import subprocess
import sys
from pathlib import Path

from sphinx.application import Sphinx
import tomli

os.environ.update(IN_SPHINX="1")

CONF_PY = Path(__file__)
HERE = CONF_PY.parent
ROOT = HERE.parent
APP_PKG = ROOT / "package.json"
APP_DATA = json.loads(APP_PKG.read_text(encoding="utf-8"))
PYPROJ = ROOT / "pyproject.toml"
PROJ_DATA = tomli.loads(PYPROJ.read_text(encoding="utf-8"))
RTD = json.loads(os.environ.get("READTHEDOCS", "False").lower())

# metadata
author = APP_DATA["author"]
project = APP_DATA["name"]
author = PROJ_DATA["project"]["authors"][0]["name"]
project = PROJ_DATA["project"]["name"]
copyright = f"{datetime.date.today().year}, {author}"

# The full version, including alpha/beta/rc tags
release = APP_DATA["version"]
release = PROJ_DATA["project"]["version"]

# The short X.Y version
version = ".".join(release.rsplit(".", 1))
Expand Down Expand Up @@ -69,9 +68,12 @@

# theme
html_theme = "pydata_sphinx_theme"
html_favicon = "_static/deck.svg"
html_logo = "_static/deck.svg"
html_theme_options = {
"github_url": APP_DATA["homepage"],
"github_url": PROJ_DATA["project"]["urls"]["Source"],
"use_edit_page_button": True,
"logo": dict(text=PROJ_DATA["project"]["name"]),
}

html_context = {
Expand Down
25 changes: 25 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
<a href="./_static/lab/index.html?path=README.ipynb" target="_blank" style="float: right;">
<i class="fa-solid fa-external-link"></i>
Open in new tab
</a>

<iframe
src="./_static/lab/index.html?path=README.ipynb"
style="width: 99%; border: solid 1px #999; height: 500px"
></iframe>
```{include} ../README.md
```

```{include} ../CHANGELOG.md
```

```{include} ../CONTRIBUTING.md
```

## Open Source

```{include} ../LICENSE
```
Loading

0 comments on commit 3048178

Please sign in to comment.