Skip to content

Commit 0bc27c1

Browse files
authored
Merge pull request #95 from robots-from-jupyter/robolite
Add support for JupyterLite
2 parents 19b2826 + 27d23c6 commit 0bc27c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+17569
-114
lines changed

.github/workflows/smoketest.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
2323
- run: nix-shell setup.nix -A shell --argstr robotframework ${{ matrix.robotframework-version }} --run "make test"
2424
- run: nix-shell setup.nix -A shell --argstr robotframework ${{ matrix.robotframework-version }} --run "python -m robotkernel.install"
25-
- run: nix-shell setup.nix -A shell --argstr robotframework ${{ matrix.robotframework-version }} --run "jupyter nbconvert --execute tests/Smoketest.ipynb --to notebook"
25+
- run: nix-shell setup.nix -A shell --argstr robotframework ${{ matrix.robotframework-version }} --run "jupyter nbconvert --execute tests/Smoketest.ipynb --to html"
26+
- run: nix-shell setup.nix -A shell --argstr robotframework ${{ matrix.robotframework-version }} --run "jupyter nbconvert --execute tests/StickyLibraryMagic.ipynb --to html"
2627
- run: nix-shell setup.nix -A shell --argstr robotframework ${{ matrix.robotframework-version }} --run "nbrobot -v BROWSER:headlessfirefox -F ipynb tests atest"
2728
- run: nix-shell --run "echo OK"

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
syntax: glob
22
*.egg-info
33
*.pyc
4+
*.doit.db
5+
*.log
6+
*.tsbuildinfo
7+
_/
8+
_pypi.ts
9+
lib/
10+
pypi/
11+
dist/
12+
labextension/
13+
node_modules/
414
.cache
15+
.eggs
516
.DS_Store
617
.idea
718
.ipynb_checkpoints
@@ -22,4 +33,3 @@ syntax: glob
2233
/src/jupyterlab_robotmode/node_modules/
2334
/tmp/
2435
/Untitle*.ipynb
25-

.readthedocs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
3+
build:
4+
os: "ubuntu-20.04"
5+
tools:
6+
python: "mambaforge-4.10"
7+
8+
conda:
9+
environment: docs/environment.yml
10+
11+
sphinx:
12+
configuration: conf.py

CHANGELOG.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
Changelog
22
=========
33

4-
1.5.2 (unreleased)
4+
1.6a3 (unreleased)
55
------------------
66

77
- Nothing changed yet.
88

99

10+
1.6a2 (2022-03-09)
11+
------------------
12+
13+
- Add pyolite support
14+
[datakurre]
15+
16+
1.6.0a1 (2022-02-22)
17+
--------------------
18+
19+
- Add %sticky magic LibraryName -magic to preserve state of global and suite scope libraries between executions
20+
[datakurre]
21+
1022
1.5.1 (2021-09-28)
1123
------------------
1224

MANIFEST.in

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
graft src/robotkernel
2-
graft pkgs
32
graft docs
43
graft tests
54
graft atest
5+
66
recursive-include src *.js
7-
include LICENSE *.rst *.nix
8-
exclude Makefile Dockerfile requirements*.txt *.ipynb *.json
7+
include LICENSE *.rstj
8+
exclude Makefile Dockerfile requirements*.txt *.nix *.png *.ipynb *.json dodo.py conf.py
9+
10+
prune .github
911
prune binder
1012
prune examples
13+
prune lite
14+
prune nix
15+
prune pkgs
1116
prune src/jupyterlab_robotmode
17+
1218
global-exclude *.py[co]

_templates/lite-demo.html

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<aside class="navbar-demo-box" title="try RobotKernel in your browser right now.">
2+
<h2>DEMO</h2>
3+
<div class="demo-label">
4+
Try <code>RobotKernel</code> right now with <input
5+
id="room-name"
6+
type="text"
7+
placeholder="nobody else"
8+
title="give a room name to enable shared editing"
9+
/> in...</em>
10+
</div>
11+
<form
12+
action="{{ pathto('_/lab/index.html?path=Example.ipynb', 1) }}"
13+
target="_blank"
14+
class="demo"
15+
>
16+
<input
17+
type="submit"
18+
title="RobotKernel in the la[te]st Jupyter UI"
19+
title="JupyterLab UI"
20+
value="JupyterLab"
21+
class="launch-demo"
22+
/>
23+
<input name="path" type="hidden" value="Example.ipynb" />
24+
<input name="room" type="hidden" value="" />
25+
</form>
26+
<div class="demo-label">
27+
... with <a href="https://github.com/jupyterlite/jupyterlite">JupyterLite</a>
28+
</div>
29+
</aside>
30+
31+
<script>
32+
$(function () {
33+
const roomName = $("#room-name");
34+
roomName.on("input", () =>
35+
$("input[name='room']").prop("value", roomName.prop("value"))
36+
);
37+
});
38+
</script>
39+
40+
<style>
41+
:root {
42+
--pg-brand-color0: #000;
43+
--pg-layout-color0: #fff;
44+
--pg-box-shadow0: 0.25em 0.25em #ccc;
45+
--pst-color-link: 252, 4, 4;
46+
--pst-color-inline-code: 67, 67, 200;
47+
}
48+
.navbar-demo-box h2 {
49+
margin: 0;
50+
padding: 0;
51+
color: var(--pg-layout-color0);
52+
text-align: center;
53+
width: 100%;
54+
font-style: italic;
55+
}
56+
/* card style */
57+
.right-next,
58+
.left-prev,
59+
.navbar-demo-box {
60+
background-color: var(--pg-brand-color0);
61+
color: var(--pg-layout-color0);
62+
box-shadow: var(--pg-box-shadow0);
63+
margin-bottom: 1em;
64+
}
65+
.prev-next-subtitle {
66+
font-style: italic;
67+
}
68+
.navbar-demo-box {
69+
display: flex;
70+
flex-direction: row;
71+
flex-wrap: wrap;
72+
border-left: 0;
73+
border-right: 0;
74+
padding: 1em 0 0 0;
75+
margin-bottom: 1em;
76+
padding: 0.5em;
77+
text-align: center;
78+
}
79+
.prev-next-area a p.prev-next-title,
80+
.right-next p, .left-prev p {
81+
color: var(--pg-layout-color0);
82+
}
83+
.navbar-demo-box code,
84+
.right-next code,
85+
.left-prev code {
86+
color: var(--pg-brand-color0);
87+
background-color: var(--pg-layout-color0);
88+
padding: 0.25em;
89+
font-weight: bold;
90+
}
91+
main.bd-content #main-content .right-next,
92+
main.bd-content #main-content .left-prev,
93+
.navbar-demo-box a {
94+
color: var(--pg-layout-color0);
95+
font-weight: bold;
96+
}
97+
98+
99+
.navbar-demo-box > .demo-label {
100+
flex: 1;
101+
width: 100%;
102+
min-width: 100%;
103+
}
104+
#room-name {
105+
margin-left: 0.5em;
106+
display: inline-box;
107+
max-width: 6em;
108+
border: 0;
109+
border-bottom: dotted 2px var(--pg-layout-color0);
110+
background-color: transparent;
111+
color: var(--pg-layout-color0);
112+
text-align: center;
113+
font-weight: bold;
114+
}
115+
#room-name::placeholder{
116+
font-style: italic;
117+
color: var(--pg-layout-color0);
118+
font-weight: 400;
119+
}
120+
.demo {
121+
flex: 1;
122+
display: flex;
123+
}
124+
.launch-demo {
125+
color: var(--pg-brand-color0);
126+
background-color: var(--pg-layout-color0);
127+
padding: 0.5em;
128+
width: 100%;
129+
margin: 0.5em 0;
130+
display: block;
131+
font-size: 150%;
132+
font-weight: bold;
133+
font-style: italic;
134+
text-align: center;
135+
border: 0;
136+
}
137+
.launch-demo:hover,
138+
.launch-demo:active,
139+
.launch-demo:focus {
140+
text-decoration: underline;
141+
}
142+
</style>

_templates/sbt-sidebar-footer.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% if theme_navbar_footer_text %}{% set theme_extra_navbar=theme_navbar_footer_text %}{% endif %} <!-- To handle the deprecated key -->
2+
{% if theme_extra_navbar %}
3+
<div class="navbar_extra_footer">
4+
{{ theme_extra_navbar }}
5+
</div>
6+
{% endif %}

_templates/sbt-sidebar-nav.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<nav class="bd-links" id="bd-docs-nav" aria-label="Main">
2+
<div class="bd-toc-item active">
3+
{{ sbt_generate_nav_html(include_item_names=True,
4+
with_home_page=theme_home_page_in_toc, show_depth=theme_show_navbar_depth)
5+
}}
6+
</div>
7+
</nav>
8+
9+
{% include "lite-demo.html" %}

_templates/sidebar-logo.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div class="navbar-brand-box">
2+
<a class="navbar-brand text-wrap" href="{{ pathto('index') }}">
3+
{% if logo %}
4+
<!-- `logo` is deprecated in Sphinx 4.0, so remove this when we stop supporting 3 -->
5+
{% set logo_url=logo %} {% endif %} {% if logo_url %}
6+
<img src="{{ pathto('_static/' + logo_url, 1) }}" class="logo" alt="logo" />
7+
{% endif %} {% if docstitle and not theme_logo_only %}
8+
<h1 class="site-logo" id="site-title">{{ docstitle }}</h1>
9+
{% endif %}
10+
</a>
11+
</div>

_toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
format: jb-book
2+
root: docs/index.rst
3+
chapters:
4+
- file: docs/install.rst

0 commit comments

Comments
 (0)