Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Book
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MUDE
Book
Commits
6995bba6
Commit
6995bba6
authored
1 year ago
by
sheepmax
Browse files
Options
Downloads
Patches
Plain Diff
Install ipywidgets by default
parent
1ca33c26
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!135
Update 2 files
,
!120
New thebe features
,
!101
Thebe new features: tags, aesthetics, default ipywidgets install
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
thebe_lite/_static/sphinx-thebe.js
+7
-6
7 additions, 6 deletions
thebe_lite/_static/sphinx-thebe.js
with
7 additions
and
6 deletions
thebe_lite/_static/sphinx-thebe.js
+
7
−
6
View file @
6995bba6
...
...
@@ -175,8 +175,8 @@ var configureThebe = () => {
updateThebeButtonStatus
(
`<span class='launch_msg'>Launching Pyodide kernel: </span><span class='status'>`
+
data
.
status
+
"
</span>
"
data
.
status
+
"
</span>
"
);
if
(
data
.
status
===
"
attached
"
)
{
...
...
@@ -301,7 +301,7 @@ function override_pyodide_lookup(fs, server_path) {
currentDirectory
+=
directory
+
"
/
"
;
try
{
fs
.
mkdir
(
currentDirectory
);
}
catch
{
}
}
catch
{}
}
}
...
...
@@ -430,8 +430,9 @@ var initThebe = async () => {
// 4. Execute the override_pyodide_lookup function in JS, and bake in the relative path from root in the book (the home)
// NOTE: All functions used in override_pyodide_lookup should be nested inside it, since the web worker cannot access functions in this script
thebelab
.
session
.
kernel
.
requestExecute
({
code
:
`import js; import pyodide_js; js.fs = pyodide_js.FS; js.eval("""
${
override_pyodide_lookup
.
toString
()}
"""); js.eval(f"override_pyodide_lookup(fs, '
${
location
.
pathname
.
split
(
"
/
"
).
slice
(
0
,
-
1
).
join
(
"
/
"
)
+
"
/
"
}
')")`
,
code
:
`import js; import pyodide_js; js.fs = pyodide_js.FS; js.eval("""
${
override_pyodide_lookup
.
toString
()}
"""); js.eval(f"override_pyodide_lookup(fs, '
${
location
.
pathname
.
split
(
"
/
"
).
slice
(
0
,
-
1
).
join
(
"
/
"
)
+
"
/
"
}
')")`
,
});
const
request
=
new
XMLHttpRequest
();
...
...
@@ -451,7 +452,7 @@ var initThebe = async () => {
// Fix for issues with ipywidgets in Thebe
await
thebelab
.
session
.
kernel
.
requestExecute
({
code
:
`import ipykernel; ipykernel.version_info = (0,0)`
,
code
:
`import ipykernel; ipykernel.version_info = (0,0)
\n%pip install ipywidgets
`
,
}).
done
;
updateThebeButtonStatus
(
"
Running pre-intialized cells...
"
);
setupSpecialTaggedElements
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment