diff --git a/README.md b/README.md index 07e4dfe..cb4d4b4 100644 --- a/README.md +++ b/README.md @@ -482,6 +482,12 @@ by its parent: /> ``` +Each of the built-in buttons has its own switch: `run` (▶; without it, the +button still appears as ■ Stop while Python is busy, e.g. with Tests), +`tests`, `visualization` and `resetOutput`; `repl: false` hides the REPL's +input line but keeps the console (output, and `input()`'s line when a program +asks). A host can thus show e.g. «Tests» without ▶, or ▶ without «Tests». + With `emptyOutput: false` (the embed's `visual` mode), a visualization whose program prints nothing and raises no error has no output panel instead of «(Keine Ausgabe)», so short visualizations take less space. It is decided for diff --git a/src/GlPythonWorkspace.tsx b/src/GlPythonWorkspace.tsx index 0193b26..ce6076a 100644 --- a/src/GlPythonWorkspace.tsx +++ b/src/GlPythonWorkspace.tsx @@ -179,7 +179,10 @@ type WorkspaceCapabilities = { // An input line below the output that runs Python in the namespace of the // last Run, e.g. to call the file's functions. repl: boolean - // A Tests button that runs the doctests in the file's docstrings. + // The ▶ Run button (without it, only Stop while Python is busy, e.g. with + // Tests), and a Tests button that runs the doctests in the file's + // docstrings - each on its own. + run: boolean tests: boolean // The visualizer's "copy → chain" button and its comments switch. export: boolean @@ -213,6 +216,7 @@ const defaultWorkspaceCapabilities: WorkspaceCapabilities = { visualization: true, graphics: true, repl: true, + run: true, tests: true, export: true, coverage: false, @@ -2520,7 +2524,7 @@ function GlPythonWorkspace(props: GlPythonWorkspaceProps) { // keeps its width as ▶ becomes ■. const runFromActions = () => { if (isVisualizing) exitVisualizer(); runCode() } const testsFromActions = () => { if (isVisualizing) exitVisualizer(); runTests() } - const actionsNode = workspaceCapabilities.actions ?