|
4 | 4 | import Code from '@/components/shared/Code.svelte'; |
5 | 5 | import Collapsible from '@/components/shared/Collapsible.svelte'; |
6 | 6 | import Linkable from '@/components/shared/Linkable.svelte'; |
7 | | - import TableOfContents from '@/components/shared/TableOfContents.svelte'; |
8 | | - import type { TOC } from '@/lib/tableOfContents'; |
| 7 | + import * as TableOfContents from '$lib/components/shared/table-of-contents/index.js'; |
| 8 | + import type { TOC } from '@/lib/table-of-contents'; |
9 | 9 |
|
10 | 10 | let tableOfContents: TOC = [ |
11 | 11 | { title: 'Introduction', id: 'intro' }, |
|
22 | 22 | </script> |
23 | 23 |
|
24 | 24 | <Article article={NUMWORKS_PROGRAMMING}> |
25 | | - <TableOfContents {tableOfContents} /> |
26 | | - <Linkable id="intro"><p class="text-foreground text-xl font-bold">Introduction</p></Linkable> |
| 25 | + <TableOfContents.Root /> |
| 26 | + <TableOfContents.Element title="Introduction" /> |
27 | 27 | <p> |
28 | 28 | Towards the end of 2023, I got a <a |
29 | 29 | target="_blank" |
|
43 | 43 | customizable graphs). I mostly programmed on my calculator when I had nothing to do during |
44 | 44 | class. |
45 | 45 | </p> |
46 | | - <Linkable id="py-modules"> |
47 | | - <p class="text-foreground text-xl font-bold">Python Modules</p> |
48 | | - </Linkable> |
| 46 | + <TableOfContents.Element title="Python Modules" /> |
49 | 47 | <p> |
50 | 48 | The Python implementation comes with a select few custom modules: <code>math</code>, |
51 | 49 | <code>cmath</code>, <code>matplotlib.pyplot</code>, <code>numpy</code>, <code>turtle</code>, |
|
74 | 72 | suspend execution for t seconds</Code |
75 | 73 | > |
76 | 74 | </Collapsible> |
77 | | - <Linkable id="limits"> |
78 | | - <p class="text-foreground text-xl font-bold">Limitations</p> |
79 | | - </Linkable> |
80 | | - <Linkable id="py-performance"> |
81 | | - <p class="text-foreground text-xl font-bold">Performance</p> |
82 | | - </Linkable> |
| 75 | + <TableOfContents.Element title="Limitations" /> |
| 76 | + <TableOfContents.Element title="Performance" level={1} /> |
83 | 77 | <p> |
84 | 78 | With these methods mentioned above, you can theoretically make just about anything, only limited |
85 | 79 | by hardware. These limitations catch up to you quite quickly. For one, clearing the screen every |
|
105 | 99 | creating full-fledged modules. After all, the calculator wasn't made to create games with |
106 | 100 | Python, which is why the drawing module is as simple as it is. |
107 | 101 | </p> |
108 | | - <Linkable id="py-mem"> |
109 | | - <p class="text-foreground text-xl font-bold">Memory and Storage</p> |
110 | | - </Linkable> |
| 102 | + <TableOfContents.Element title="Memory and Storage" level={1} /> |
111 | 103 | <p> |
112 | 104 | It should be obvious that the team behind this calculator chose Python as the programming |
113 | 105 | language available for users because of its simplicity for making scripts, and even more for |
@@ -140,9 +132,7 @@ struct _mp_obj_base_t { |
140 | 132 | seem like a lot, and it actually is, but when you have multiple large scripts installed, the |
141 | 133 | limit is definitely reachable. |
142 | 134 | </p> |
143 | | - <Linkable id="native-apps"> |
144 | | - <p class="text-foreground text-xl font-bold">Writing native apps</p> |
145 | | - </Linkable> |
| 135 | + <TableOfContents.Element title="Writing Native Apps" /> |
146 | 136 | <p> |
147 | 137 | Recently, I discovered that it is possible to write external apps in C (and C++ or any other |
148 | 138 | language that is compatible with C) that can be uploaded onto the calculator. This discovery |
|
0 commit comments