Skip to content

Commit 08d56f7

Browse files
committed
Prevent prettierd from formatting text in <Code> components
1 parent 0f88685 commit 08d56f7

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

src/lib/components/shared/Code.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
children: Snippet;
1313
language?: string;
1414
nohl?: boolean;
15-
class: string;
15+
class?: string;
1616
} = $props();
1717
1818
let codeElement: HTMLElement;

src/routes/blog/articles/numworks-programming/+page.svelte

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,8 @@
33
import { NUMWORKS_PROGRAMMING } from '$lib/constants/articles';
44
import Code from '@/components/shared/Code.svelte';
55
import Collapsible from '@/components/shared/Collapsible.svelte';
6-
import Linkable from '@/components/shared/Linkable.svelte';
76
import * as TableOfContents from '$lib/components/shared/table-of-contents/index.js';
87
import type { TOC } from '@/lib/table-of-contents';
9-
10-
let tableOfContents: TOC = [
11-
{ title: 'Introduction', id: 'intro' },
12-
{ title: 'Python Modules', id: 'py-modules' },
13-
[
14-
{ title: 'Limitations', id: 'limits' },
15-
[
16-
{ title: 'Performance', id: 'py-performance' },
17-
{ title: 'Memory and Storage', id: 'py-mem' }
18-
]
19-
],
20-
{ title: 'Writing native apps', id: 'native-apps' }
21-
];
228
</script>
239

2410
<Article article={NUMWORKS_PROGRAMMING}>
@@ -57,19 +43,19 @@
5743
</p>
5844
<Collapsible title="Kandinsky">
5945
<Code nohl
60-
>get_pixel(x, y) - returns the color of the pixel at (x,y) set_pixel(x, y, color) - colors the
61-
pixel at (x,y) color(r, g, b) - defines an RGB color draw_string(text, x, y, fg, bg) -
62-
displays a string at (x, y), and if specified, with a foreground and background color
63-
fill_rect(x, y, w, h, col) - fills a rectangle spanning from (x, y) to (x + w, y + h) with a
64-
color</Code
46+
>{`get_pixel(x, y) - returns the color of the pixel at (x,y)
47+
set_pixel(x, y, color) - colors the pixel at (x,y)
48+
color(r, g, b) - defines an RGB color
49+
draw_string(text, x, y, fg, bg) - displays a string at (x, y), and if specified, with a foreground and background color
50+
fill_rect(x, y, w, h, col) - fills a rectangle spanning from (x, y) to (x + w, y + h) with a color`}</Code
6551
>
6652
</Collapsible>
6753
<Collapsible title="Ion">
68-
<Code nohl>keydown(k) - returns true if the key k is down</Code>
54+
<Code nohl>{`keydown(k) - returns true if the key k is down`}</Code>
6955
</Collapsible><Collapsible title="Time"
7056
><Code nohl
71-
>monotonic() - returns the clock's time (not to be confused with the actual time) sleep(t) -
72-
suspend execution for t seconds</Code
57+
>{`monotonic() - returns the clock's time (not to be confused with the actual time)
58+
sleep(t) - suspend execution for t seconds`}`</Code
7359
>
7460
</Collapsible>
7561
<TableOfContents.Element title="Limitations" />

0 commit comments

Comments
 (0)