mirror of
https://github.com/django-components/django-components.git
synced 2025-09-26 15:39:08 +00:00
Deployed 055dd076
to dev with MkDocs 1.6.1 and mike 2.1.3
This commit is contained in:
parent
f1d2a282df
commit
c1e31b60b1
5 changed files with 83 additions and 71 deletions
|
@ -77,7 +77,15 @@ function updateTheme(editor, light, dark) {
|
|||
});
|
||||
}
|
||||
|
||||
async function setupPyodide(idPrefix, install = null, themeLight = 'tomorrow', themeDark = 'tomorrow_night', session = null) {
|
||||
async function setupPyodide(
|
||||
idPrefix,
|
||||
install = null,
|
||||
themeLight = 'tomorrow',
|
||||
themeDark = 'tomorrow_night',
|
||||
session = null,
|
||||
minLines = 5,
|
||||
maxLines = 30,
|
||||
) {
|
||||
const editor = ace.edit(idPrefix + "editor");
|
||||
const run = document.getElementById(idPrefix + "run");
|
||||
const clear = document.getElementById(idPrefix + "clear");
|
||||
|
@ -88,6 +96,12 @@ async function setupPyodide(idPrefix, install = null, themeLight = 'tomorrow', t
|
|||
editor.session.setMode("ace/mode/python");
|
||||
setTheme(editor, getTheme(), themeLight, themeDark);
|
||||
|
||||
editor.setOption("minLines", minLines);
|
||||
editor.setOption("maxLines", maxLines);
|
||||
|
||||
// Force editor to resize after setting options
|
||||
editor.resize();
|
||||
|
||||
writeOutput(output, "Initializing...");
|
||||
let pyodide = await pyodidePromise;
|
||||
if (install && install.length) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue