mirror of
https://github.com/Hopiu/djLint.git
synced 2026-03-17 05:50:24 +00:00
updated demo
This commit is contained in:
parent
68c155a7cf
commit
b34b07f098
3 changed files with 14 additions and 5 deletions
|
|
@ -10,7 +10,9 @@ keywords: online template formatter, djLint, HTML, templates, formatter, linter,
|
|||
|
||||
<div class="container is-fluid pb-5">
|
||||
<hr class="mt-0" />
|
||||
<h1 class="title is-3">{{ "demo_description" | i18n | safe }}</h1>
|
||||
<h1 class="title is-3 mb-0">{{ "demo_description" | i18n | safe }}</h1>
|
||||
<small class="mb-4 is-italic is-block" id="djlint-version"></small>
|
||||
|
||||
<div class="block" id="djlint-status">
|
||||
<span class="icon-text">
|
||||
<span class="icon">
|
||||
|
|
@ -20,6 +22,7 @@ keywords: online template formatter, djLint, HTML, templates, formatter, linter,
|
|||
</span>
|
||||
</div>
|
||||
<div class="columns is-hidden">
|
||||
|
||||
<div class="column is-narrow">
|
||||
|
||||
<form id="djlint-settings">
|
||||
|
|
|
|||
|
|
@ -89,7 +89,11 @@ if (typeof Worker !== 'undefined') {
|
|||
}
|
||||
if ((type == 'error' || type == 'html') && id == session_id) {
|
||||
setOutput(message);
|
||||
} else {
|
||||
} else if (type == "status") {
|
||||
console.log(message)
|
||||
} else if (type == "version") {
|
||||
document.getElementById('djlint-version').textContent = message;
|
||||
}else {
|
||||
console.log(event.data);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -41,12 +41,13 @@ async function loadPyodideAndPackages() {
|
|||
postMessage({ type: 'status', message: 'Installing tqdm..' });
|
||||
|
||||
postMessage({
|
||||
type: 'status',
|
||||
type: 'version',
|
||||
message:
|
||||
'Running Python ' +
|
||||
pyodide.runPython(`
|
||||
import sys
|
||||
sys.version
|
||||
import platform
|
||||
from importlib import metadata
|
||||
f"running with Python {platform.python_version()}; djLint {metadata.version('djlint')}"
|
||||
`),
|
||||
});
|
||||
|
||||
|
|
@ -103,6 +104,7 @@ self.onmessage = async (event) => {
|
|||
await self.pyodide.runPythonAsync(`
|
||||
import io
|
||||
import os
|
||||
import sys
|
||||
sys.modules['_multiprocessing'] = object
|
||||
from multiprocessing.pool import ThreadPool
|
||||
sys.stdout = io.StringIO()
|
||||
|
|
|
|||
Loading…
Reference in a new issue