Skip to content

Commit 22e8263

Browse files
committed
fix multiple lines output and color scheme
1 parent 19a95da commit 22e8263

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed
-30 Bytes
Binary file not shown.

examples/server/webui/src/components/CanvasPyInterpreter.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const PyodideWrapper = {
3636
if (result) {
3737
stdOutAndErr.push(result.toString());
3838
}
39-
return stdOutAndErr.join('');
39+
return stdOutAndErr.join('\n');
4040
},
4141
};
4242

@@ -102,9 +102,11 @@ export default function CanvasPyInterpreter() {
102102
{running ? 'Running...' : 'Run'}
103103
</button>
104104
</div>
105-
<pre className="bg-slate-900 rounded-md grow text-gray-200 p-3 whitespace-pre-wrap overflow-auto">
106-
{output}
107-
</pre>
105+
<textarea
106+
className="textarea textarea-bordered h-full dark-color"
107+
value={output}
108+
readOnly
109+
></textarea>
108110
</div>
109111
</div>
110112
</div>

examples/server/webui/src/index.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,19 @@
4545
/* Highlight.js */
4646
[data-color-scheme='light'] {
4747
@include meta.load-css('highlight.js/styles/stackoverflow-light');
48+
.dark-color {
49+
@apply bg-base-content text-base-100;
50+
}
4851
}
4952
[data-color-scheme='dark'] {
5053
@include meta.load-css('highlight.js/styles/stackoverflow-dark');
5154
}
5255
[data-color-scheme='auto'] {
5356
@media (prefers-color-scheme: light) {
5457
@include meta.load-css('highlight.js/styles/stackoverflow-light');
58+
.dark-color {
59+
@apply bg-base-content text-base-100;
60+
}
5561
}
5662
@media (prefers-color-scheme: dark) {
5763
@include meta.load-css('highlight.js/styles/stackoverflow-dark');

0 commit comments

Comments
 (0)