You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lab_0/index.md
+2-59Lines changed: 2 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,67 +6,10 @@ toc: true
6
6
This page is where you can iterate. Follow the lab instructions in the [readme.md](./README.md).
7
7
8
8
9
-
## Writing HTML in Markdown
10
-
<!-- simple divs -->
11
-
<div>
12
-
<p>You can write pure HTML in <ahref="https://commonmark.org/">markdown files!</a></p>
13
-
</div>
14
9
15
-
<!-- hidden context -->
16
-
<details>
17
-
<summary>Click me</summary>
18
-
This text is not visible by default.
19
-
</details>
20
-
21
-
<!-- css grid styles -->
22
-
<divclass="grid grid-cols-4">
23
-
<divclass="card"><h1>A</h1></div>
24
-
<divclass="card"><h1>B</h1></div>
25
-
<divclass="card"><h1>C</h1></div>
26
-
<divclass="card"><h1>D</h1></div>
27
-
</div>
28
-
29
-
<!-- leveraging pre-made cards -->
30
-
<divclass="grid grid-cols-4">
31
-
<divclass="card">
32
-
${resize((width) => `This card is ${width}px wide.`)}
33
-
</div>
34
-
</div>
35
-
36
-
## Writing JS in Markdown
37
-
Use JavaScript to render charts, inputs, and other dynamic, interactive, and graphical content on the client. JavaScript in Markdown can be expressed either as fenced code blocks or inline expressions. You can also import JavaScript modules to share code across pages.
38
-
39
-
You can write javascript in js blocks...
40
-
<!-- function definition -->
41
-
```js
42
-
constaddition= (x, y) => x + y;
43
-
```
44
-
45
-
...which won't show up in the dashboard unless referred to in its own block...
46
-
<!-- function reference -->
47
-
```js
48
-
addition
49
-
```
50
-
51
-
<!-- display -->
52
-
...or leveraging the `display` function.
53
-
```js
54
-
display(addition)
55
-
display(addition(2, 3))
56
-
```
57
-
58
-
There are some helpful functions already baked into Observable Framework, like now, width, or the responsive display.
0 commit comments