Skip to content

Commit 9b217ae

Browse files
committed
more docs
1 parent f3dd8ba commit 9b217ae

File tree

2 files changed

+15
-36
lines changed

2 files changed

+15
-36
lines changed

docs/desktop.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<script id="46" type="text/markdown">
1313
Here's a short demo:
1414

15-
<iframe style="border: none; max-width: 100%; width: 640px; aspect-ratio: 560 / 315;" src="https://www.youtube.com/embed/BeH6AhiQ4Bw?si=-f-wzXSCNkddOQOz" title="Vibe coding a choropleth map in Observable Notebooks 2.0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
15+
<iframe style="border: none; max-width: 100%; width: 960px; aspect-ratio: 560 / 315;" src="https://www.youtube.com/embed/BeH6AhiQ4Bw?si=-f-wzXSCNkddOQOz" title="Vibe coding a choropleth map in Observable Notebooks 2.0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
1616
</script>
1717
<script id="43" type="text/markdown">
1818
Observable Desktop is available as part of [**Notebooks 2.0 Technology Preview**](./).

docs/index.html

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,6 @@
109109
- an optional <code class="language-html">&lt;title&gt;</code> element, and
110110
- one <code class="language-html">&lt;script&gt;</code> element per cell.
111111
</script>
112-
<script id="35" type="text/markdown">
113-
The `type` attribute determines a cell's mode, which can be one of:
114-
115-
- `module` - JavaScript
116-
- `text/markdown` - Markdown
117-
- `text/html` - HTML
118-
- `application/sql` - SQL
119-
- `application/x-tex` - ${tex`\TeX`}
120-
- `text/vnd.graphviz` - DOT (Graphviz)
121-
- `application/vnd.observable.javascript` - Observable JavaScript
122-
- and more coming soon
123-
</script>
124112
<script id="13" type="text/markdown">
125113
Here's a simple "hello world" notebook to demonstrate:
126114

@@ -137,31 +125,22 @@
137125
</notebook>
138126
```
139127
</script>
140-
<script id="36" type="text/markdown">
141-
Cells can also have an `id` attribute to indicate a unique (positive integer) identifier; an `id` isn't required, but gives cells a stable identity for editing. Lastly the cell's `pinned` attribute specifies whether to show the cell's source code.
128+
<script id="82" type="text/markdown">
129+
See the [Notebook Kit documentation](./kit) for more on the notebook file format.
142130
</script>
143131
<script id="6" type="text/markdown">
144132
### Vanilla JavaScript
145133

146134
You no longer have to learn a nonstandard dialect, [Observable JavaScript](https://observablehq.com/@observablehq/observable-javascript~0), to use Observable Notebooks; they're now vanilla JavaScript. This also makes it easier to reuse code between notebooks and other web applications.
147135
</script>
148136
<script id="40" type="text/markdown">
149-
If you don't know Observable JavaScript, this change will be largely invisible --- JavaScript will "just work" like you expect. But if you're familiar with past notebooks, here are some highlights of vanilla syntax:
137+
<aside>Notebooks 2.0 supports an Observable JavaScript cell mode for backwards compatibility, so you can migrate to vanilla JavaScript at your own pace.</aside>
150138

151-
- You can declare top-level variables in cells with standard <code class="language-js">const</code> and <code class="language-js">let</code>, and cells can now expose as many top-level variables as they want (rather than being limited to one).
152-
- You can display content with the <code class="language-js">display()</code> function, and cells can display multiple things (rather than being limited to one thing), even over time (a bit like <code class="language-js">console.log</code>).
153-
- You can define reactive inputs with the <code class="language-js">view()</code> function, and cells can have multiple reactive inputs (rather than being limited to one).
154-
- You can import libraries from npm (and JSR, and the web) with standard static <code class="language-js">import</code> declarations (rather than being limited to dynamic imports and `require`).
155-
- You can import (vanilla) local JavaScript modules into your notebook.
156-
</script>
157-
<script id="76" type="text/markdown">
158-
Here's a quick example computing the Fibonacci numbers ${tex`F_n < 100`}:
159-
</script>
160-
<script id="75" type="module" pinned="">
161-
for (let a = 0, b = 1; a < 100; [a, b] = [b, a + b]) display(a);
162-
</script>
163-
<script id="55" type="text/markdown">
164-
For backwards compatibility, Notebooks 2.0 retain support for Observable JavaScript as a cell mode; this allows you to migrate to vanilla JavaScript incrementally and at your own pace. You can also import current notebooks into new notebooks.
139+
If you don't know Observable JavaScript, this change will be largely invisible --- JavaScript will "just work" like you expect. But if you're familiar with past notebooks, here are some highlights:
140+
141+
- You declare top-level variables in cells with standard <code class="language-js">const</code> and <code class="language-js">let</code>, and cells can now expose as many top-level variables as they want rather than being limited to just one.
142+
- You display content with the <code class="language-js">display()</code> function, and cells can display multiple things, even asynchronously. You likewise define reactive inputs with the <code class="language-js">view()</code> function, and cells can have multiple reactive inputs rather than being limited to just one.
143+
- You import libraries from npm (and JSR, the web, and local modules) with standard static <code class="language-js">import</code> declarations rather than being limited to `require` and dynamic imports.
165144
</script>
166145
<script id="41" type="text/markdown">
167146
See the [Notebooks system guide](./system-guide) for more on JavaScript in notebooks. And see the gallery below for lots of examples.
@@ -185,12 +164,12 @@
185164
<script id="11" type="text/markdown">
186165
<aside>We still provide <code>require</code> as a built-in to improve backwards compatibility, but it’s simply a wrapper around dynamic <code class="language-js">import</code>.</aside>
187166

188-
Notebooks 2.0 also fully embraces JavaScript modules, removing built-in support for `require` (asynchronous module definitions) --- the now-antiquated way of loading JavaScript modules that predates <code class="language-js">import</code>. Thanks to vanilla JavaScript syntax, you can use standard static import declarations or dynamic import expressions. And you can import libraries from npm (`npm:`), JSR (`jsr:`), local modules, or remote servers.
167+
Notebooks 2.0 also fully embraces JavaScript modules, removing built-in support for `require` (asynchronous module definitions) --- the now-antiquated way of loading JavaScript modules that predates <code class="language-js">import</code>. Thanks to vanilla JavaScript syntax, you can use standard static import declarations or dynamic import expressions. And you can import libraries from npm (`npm:`), JSR (`jsr:`), local modules, or remote servers. You can also import existing Observable notebooks (`observable:`).
189168
</script>
190169
<script id="12" type="text/markdown">
191170
### Notebooks as static sites
192171

193-
When you want to share your notebooks as a static site (like the one you are currently reading), install the open-source Notebook Kit:
172+
When you want to share your notebooks as a static site, install the open-source Notebook Kit:
194173

195174
```
196175
npm install @observablehq/notebook-kit
@@ -206,9 +185,6 @@
206185
<script id="79" type="text/markdown">
207186
This generates a `.observable/dist` folder containing the built site, which you can then deploy to your preferred static site hosting service, such as GitHub Pages, Vercel, or Netlify.
208187
</script>
209-
<script id="52" type="text/markdown">
210-
When we bring the next-generation notebook editor to the web, you won't need to run terminal commands to share notebooks --- you'll be able to share notebooks directly from the editor. We'll also work on making it easy to transition between local and web-based development. But we're providing this open-source tooling to give you flexibility and to enable deeper, custom notebook integrations. You should be able to do whatever you want with your notebooks.
211-
</script>
212188
<script id="46" type="text/markdown">
213189
When building notebooks, we use static generation for Markdown and HTML cells: static content is statically rendered. This improves the user experience by accelerating the first contentful paint, and by reducing reflow during page load --- your page appears instantly. It's good for SEO, too, because static content is now readable by search engines without JavaScript.
214190
</script>
@@ -223,6 +199,9 @@
223199

224200
See the [Notebook Kit documentation](./kit) for more.
225201
</script>
202+
<script id="52" type="text/markdown">
203+
When we bring the next-generation notebook editor to the web, you won't need terminal commands to share notebooks --- you'll be able to share notebooks directly from the editor. We'll also work on making it easy to transition between local and web-based development. But we're providing this open-source tooling to give you flexibility and to enable deeper, custom notebook integrations. You should be able to do whatever you want with your notebooks.
204+
</script>
226205
<script id="56" type="text/markdown">
227206
---
228207

@@ -266,7 +245,7 @@
266245
<script id="58" type="text/markdown">
267246
Here's a short demo of authoring notebooks:
268247

269-
<iframe style="border: none; max-width: 100%; width: 640px; aspect-ratio: 560 / 315;" src="https://www.youtube.com/embed/BeH6AhiQ4Bw?si=-f-wzXSCNkddOQOz" title="Vibe coding a choropleth map in Observable Notebooks 2.0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
248+
<iframe style="border: none; max-width: 100%; width: 960px; aspect-ratio: 560 / 315;" src="https://www.youtube.com/embed/BeH6AhiQ4Bw?si=-f-wzXSCNkddOQOz" title="Vibe coding a choropleth map in Observable Notebooks 2.0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
270249
</script>
271250
<script id="80" type="text/markdown">
272251
See the [Desktop user guide](./desktop-guide) for help getting started.

0 commit comments

Comments
 (0)