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
689ceedc
Verified
Commit
689ceedc
authored
1 year ago
by
Rok Štular
Browse files
Options
Downloads
Patches
Plain Diff
fix(thebe): Fix relative URLs
parent
ff21c3b1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!40
Publish fixes
,
!38
fix(thebe): Fix relative URLs
Pipeline
#205669
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build-book.sh
+3
-3
3 additions, 3 deletions
build-book.sh
thebe_lite/_static/sphinx-thebe.js
+8
-4
8 additions, 4 deletions
thebe_lite/_static/sphinx-thebe.js
with
11 additions
and
7 deletions
build-book.sh
+
3
−
3
View file @
689ceedc
...
...
@@ -2,13 +2,15 @@
set
-euo
pipefail
set
-euo
pipefail
START_SERVER
=
${
1
:-
false
}
PAGE_ROOT
=
${
2
:-
"/"
}
# Build the jupyter book, everything else is post-processing
jupyter-book build book
# Note: the structure of thebe_lite mimicks where thing are needed in the html folder
cp
thebe_lite/
*
book/_build/html/
-r
sed
"s,const PAGE_ROOT =
\"
/
\"
;,const PAGE_ROOT =
\"
$PAGE_ROOT
\"
;,g"
thebe_lite/_static/sphinx-thebe.js
>
book/_build/html/_static/sphinx-thebe.js
rm
book/_build/html/THEBE_LITE.md
# Copy all non notebook, markdown or build files into the build for local access in pyodide etc.
...
...
@@ -40,8 +42,6 @@ if [ "$python_command" = "" ] ; then
fi
# Serves the files on port 8000, localhost (127.0.0.1:8000)
START_SERVER
=
${
1
:-
false
}
if
[
"
$START_SERVER
"
=
true
]
;
then
echo
"Starting server on port 8000"
$python_command
-m
http.server 8000
--directory
book/_build/html
...
...
This diff is collapsed.
Click to expand it.
thebe_lite/_static/sphinx-thebe.js
+
8
−
4
View file @
689ceedc
// Do not touch the following line
const
PAGE_ROOT
=
"
/
"
;
// You can touch from here onwards
const
thebeLiteConfig
=
{
requestKernel
:
true
,
useJupyterLite
:
true
,
...
...
@@ -436,8 +440,8 @@ var initThebe = async () => {
console
.
log
(
"
[sphinx-thebe]: Loading thebe...
"
);
$
(
"
.thebe-launch-button
"
).
text
(
"
Loading thebe...
"
);
await
loadScriptAsync
(
"
/
thebe-lite.min.js
"
);
await
loadScriptAsync
(
"
/
index.js
"
);
await
loadScriptAsync
(
`
${
PAGE_ROOT
}
thebe-lite.min.js
`
);
await
loadScriptAsync
(
`
${
PAGE_ROOT
}
index.js
`
);
// Runs once the script has finished loading
console
.
log
(
"
[sphinx-thebe]: Finished loading thebe...
"
);
...
...
@@ -529,5 +533,5 @@ if (document.readyState !== "loading") {
});
}
loadStyleAsync
(
"
/
thebe.css
"
);
loadStyleAsync
(
"
/
_static/code.css
"
);
loadStyleAsync
(
`
${
PAGE_ROOT
}
thebe.css
`
);
loadStyleAsync
(
`
${
PAGE_ROOT
}
_static/code.css
`
);
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