Skip to content
Snippets Groups Projects
Commit 13328deb authored by sheepmax's avatar sheepmax
Browse files

Fixed bugs with moving status

parent 9ee10ba5
No related branches found
No related tags found
3 merge requests!135Update 2 files,!120New thebe features,!101Thebe new features: tags, aesthetics, default ipywidgets install
......@@ -282,6 +282,7 @@ parts:
- file: cookbook/benchmarks/benchmark_aux.ipynb
- file: cookbook/benchmarks/benchmark_tags.ipynb
- file: cookbook/benchmarks/benchmark_load.ipynb
- file: cookbook/benchmarks/benchmark_noexec.ipynb
- file: cookbook/widgets.ipynb
- file: cookbook/exercise_checking.ipynb
- file: cookbook/interactive_templates
......
%% Cell type:markdown id: tags:disable-execution,ee
# Benchmarks: disable execution
Disabling execution of the page
%% Cell type:code id: tags:disable-execution
``` python
print("This can't be run")
```
%% Cell type:markdown id: tags:
# Benchmarks: cell tags
This page includes benchmarks for the behaviour of different cell tags with Thebe.
%% Cell type:code id: tags:thebe-init
%% Cell type:code id: tags:thebe-init,disable-download
``` python
# Thebe init
print("This should show on startup")
```
%% Cell type:code id: tags:hide-input
``` python
# Hide input
print("You shouldn't be able to see this without expanding the dropdown.")
print("But the output should be shown outside of it!")
```
%% Cell type:code id: tags:thebe-remove-input-init
``` python
# Remove input
print("This should be shown despite the lack of input.")
```
%% Cell type:code id: tags:thebe-remove-input-init
``` python
# Remove input should preserve placeholder output
print("This output should still be shown until execution.")
```
%% Output
This output should still be shown until execution.
%% Cell type:code id: tags:
``` python
# Predefined output should be removed upon execution
print("Already ran this locally")
```
%% Output
Already ran this locally
%% Cell type:code id: tags:hide-input
``` python
# Hide input with predefined output should show predefined output until execution
print("I'm free from the dropdown!")
```
%% Output
I'm free from the dropdown!
%% Cell type:code id: tags:
``` python
```
......
......@@ -16,9 +16,12 @@
border-radius: calc(var(--mystnb-source-border-radius) + 1px);
background-color: var(--pst-color-surface);
color: var(--pst-color-text-base);
height: 100% !important;
}
.thebe-launch-button {
height: 80% !important;
}
.cell_output .jp-OutputArea-output pre {
border: var(--mystnb-source-border-width) var(--mystnb-source-border-color) solid;
}
......
......@@ -406,10 +406,12 @@ function moveHideInputOutput() {
var initThebe = async () => {
// Remove Rocket now that we're initializing
document.querySelector(".dropdown-launch-buttons").remove();
$(".dropdown-launch-buttons").remove();
// Add the launch info to the top bar
$(".dropdown-download-buttons").before($(".thebe-launch-button"));
$(".header-article-items__end .header-article-item").prepend(
$(".thebe-launch-button")
);
console.log("[sphinx-thebe]: Loading thebe...");
$(".thebe-launch-button ").text("Loading thebe...");
......@@ -496,11 +498,21 @@ function handleThebeRemoveInputTag(element) {
element.remove();
}
function handleDisableExecutionTag(element) {
$(".dropdown-launch-buttons").remove();
}
function handleDisableDownloadTag(element) {
$(".dropdown-download-buttons").remove();
}
// Deal with custom-defined tags to properly prepare Thebe and DOM
// Current special tags: thebe-remove-input-init
function consumeSpecialTags() {
const specialTagsInfo = [
{ tag: "thebe-remove-input-init", handler: handleThebeRemoveInputTag },
{ tag: "disable-execution", handler: handleDisableExecutionTag },
{ tag: "disable-download", handler: handleDisableDownloadTag },
];
window.specialTaggedElements = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment