Published
Edited
Mar 30, 2021
1 star
Insert cell
md`# Day 1 & Day 2, 25 Aug. & 26 Aug., 2020, Basic Commands`
Insert cell
Insert cell
Insert cell
Insert cell
import {sn,note} from "@j-f1/sidenotes"
Insert cell
md`## Uinsg Markdown in Observable`
Insert cell
sn`
- How to use Markdown: look at the examples I had above and below.
- Add inline code: \`like this\`
- Add **table of contents**: first use \`import {toc} from @mbostock/toc\` to import the function, and then use \`toc{}\` to generate your table of contents (Reference: https://observablehq.com/@mbostock/toc)
- Add **footnotes<sup>[[1](#footnote1)]</sup>**: write \`<sup>[[N](#footnoteN)]</sup>\` after the word you want to put footnote on. Then, at the bottom of your notebook, use this syntax:
\`\`\`
footnoteN = md\`N: Your own words\`
\`\`\` . (Reference: https://observablehq.com/@jashkenas/markdown-style-footnotes)
- Add sidenotes (Please see the sidenote on the right of this line of text) ${note`Nemo qui nobis voluptatum at distinctio rem tempore.`}:

First, import necessary functions:

\`\`\`js
import {sn,note} from "@j-f1/sidenotes"
\`\`\`

Then, start the paragraph where your intended sidenote is located with
\`\`\`js
sn\`
\`\`\`

Then, simply embed the content of your intended sidenote using the codes I employed in this example.

(References: https://observablehq.com/@j-f1/sidenotes)
`
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
book = 20
Insert cell
person = 15
Insert cell
sales = book * person
Insert cell
Insert cell
Insert cell
Insert cell
price = monitor + 45
Insert cell
Insert cell
Insert cell
viewof mouse = html`<input type=range/>`
Insert cell
price_updated = mouse * 20
Insert cell
md`
## Math

You can input math using \`tex\`. Like this: ${tex `a = \frac{b}{c}`}

Or:
`
Insert cell
tex`a = \frac{b}{c}`
Insert cell
Insert cell
tex.block `
a = \frac{b}{c}
`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more