Skip to content

move javascript.html to javascript/index.md #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/.observablehq/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default {
pages: [
{name: "Getting started", path: "/getting-started"},
{name: "Markdown", path: "/markdown"},
{name: "JavaScript", path: "/javascript"},
{name: "JavaScript", path: "/javascript/"},
{name: "Data loaders", path: "/loaders"},
{
name: "JavaScript",
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The **Observable command-line interface (CLI)** is a static site generator for c
Current features:

- [Observable Markdown](./markdown)
- [Reactive JavaScript](./javascript), as both fenced code blocks and inline expressions
- [Reactive JavaScript](./javascript/), as both fenced code blocks and inline expressions
- Import from npm and local ES modules
- Local preview server with hot module replacement
- Static site generator
Expand Down
4 changes: 2 additions & 2 deletions docs/javascript.md → docs/javascript/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JavaScript

[Observable Markdown](./markdown) supports reactive JavaScript. JavaScript runs on the client, powered by the [Observable Runtime](https://github.com/observablehq/runtime). (In the future, JavaScript may also run during build to support data snapshot generation and server-side rendering.)
[Observable Markdown](../markdown) supports reactive JavaScript. JavaScript runs on the client, powered by the [Observable Runtime](https://github.com/observablehq/runtime). (In the future, JavaScript may also run during build to support data snapshot generation and server-side rendering.)

In addition to standard Markdown features — headings, formatting, tables, images, and the like — Observable Markdown supports reactive JavaScript that runs on the client. Live JavaScript can be expressed either as [fenced code blocks](#fenced-code-blocks) (<code>```js</code>) or [inline expressions](#inline-expressions) (<code>$\{…}</code>).

Expand Down Expand Up @@ -46,7 +46,7 @@ const x = 1 + 2;
const x = 1 + 2;
```

A program code block doesn’t display anything by default, but you can call the built-in [`display` function](./javascript/display) explicitly. The above block defines the top-level variable `x` with a value of ${x}.
A program code block doesn’t display anything by default, but you can call the built-in [`display` function](./display) explicitly. The above block defines the top-level variable `x` with a value of ${x}.

(A technical note: the parser first attempts to parse the input as an expression; if that fails, it parses it as a program. So, code such as `{foo: 1}` is interpreted as an object literal rather than a block with a labeled statement.)

Expand Down
2 changes: 1 addition & 1 deletion docs/loaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ for (const feature of collection.features) {
}
```

To access your data from Markdown, add a [JavaScript fenced code block](./javascript) and load `earthquakes.csv` as a [file](./javascript/files).
To access your data from Markdown, add a [JavaScript fenced code block](./javascript/) and load `earthquakes.csv` as a [file](./javascript/files).

```js show
const quakes = FileAttachment("earthquakes.csv").csv({typed: true});
Expand Down
2 changes: 1 addition & 1 deletion docs/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ See [GitHub’s guide to Markdown](https://docs.github.com/en/get-started/writin

What’s different about Observable Markdown?

- [Live JavaScript](./javascript), either as code blocks or inline expressions
- [Live JavaScript](./javascript/), either as code blocks or inline expressions
- Built-in support for [${tex`\TeX`}](./tex), [Dot (GraphViz)](./dot), and [Mermaid](./mermaid)
- [HTML](./html) (but watch out for blank lines)
- YAML front matter