Skip to content

Commit a251e12

Browse files
authored
V2/fix docs (#351)
* wip: fix docs * add language selection and some small fixes * url titles * sharedworker * folder view * add index file * homepage fixes * misc updates * fix build * fix docs * fix lint * fix lint
1 parent a39fc98 commit a251e12

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2080
-1637
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ blocknote
1111
│ ├── editor - The main React application
1212
│ ├── engine - The live-code execution engine
1313
│ ├── packager - Tool to bundle TypeCell notebook apps (WIP)
14-
│ └── parsers - Helpers to convert to / from TypeCell notebooks
14+
│ └── parsers - Helpers to convert to / from TypeCell
1515
├── patches - patch-package patches
1616
└── test-util - Server and data for unit tests
1717
```

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ typecell
7272
│ ├── editor - The main React application
7373
│ ├── engine - The live-code execution engine
7474
│ ├── packager - Tool to bundle TypeCell notebook apps (WIP)
75-
│ └── parsers - Helpers to convert to / from TypeCell notebooks
75+
│ └── parsers - Helpers to convert to / from TypeCell documents
7676
├── patches - patch-package patches
7777
└── test-util - Server and data for unit tests
7878
```

package-lock.json

Lines changed: 721 additions & 533 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"lint": "npm run lint --workspaces",
3636
"watch": "npm run build && npm run --parallel watch",
3737
"start": "npm run start-react",
38-
"start-filebridge": "npx filebridge packages/editor/public/_docs",
3938
"start-react": "npm run start --workspace=packages/editor",
4039
"start:preview": "npm run preview --workspace=packages/editor",
4140
"start:server": "npm run dev --workspace=packages/server",

packages/editor/copy-docs.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,13 @@ import glob from "glob";
22
import * as path from "path";
33
const files = glob.sync("**/*.md", { cwd: path.join("public", "_docs") });
44

5-
console.log(JSON.stringify(files));
5+
console.log(
6+
JSON.stringify(
7+
{
8+
title: "Docs",
9+
items: files,
10+
},
11+
undefined,
12+
2
13+
)
14+
);

packages/editor/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1717
-->
1818
<link rel="manifest" href="/manifest.json" />
19-
<title>TypeCell Notebooks</title>
19+
<title>TypeCell</title>
2020
</head>
2121
<body>
2222
<div id="root"></div>

packages/editor/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"@atlaskit/button": "^16.8.2",
1111
"@atlaskit/css-reset": "^6.5.3",
1212
"@atlaskit/dropdown-menu": "^11.10.5",
13+
"@atlaskit/empty-state": "^7.6.3",
1314
"@atlaskit/flag": "^15.2.15",
1415
"@atlaskit/form": "^8.11.8",
1516
"@atlaskit/inline-message": "^11.5.3",
@@ -24,19 +25,20 @@
2425
"@atlaskit/textfield": "^5.6.3",
2526
"@atlaskit/tree": "^8.8.5",
2627
"@atlaskit/user-picker": "^10.4.0",
28+
"@tiptap/core": "^2.0.4",
29+
"@blocknote/core": "^0.9.2",
2730
"@emotion/react": "^11.4.0",
2831
"@supabase/auth-ui-react": "^0.4.2",
2932
"@supabase/auth-ui-shared": "^0.1.6",
3033
"@supabase/supabase-js": "^2.26.0",
3134
"@syncedstore/yjs-reactive-bindings": "^0.5.1",
32-
"@tippyjs/react": "^4.2.6",
3335
"@typecell-org/util": "^0.0.3",
3436
"@typecell-org/shared": "^0.0.3",
3537
"@typecell-org/engine": "^0.0.3",
3638
"@typecell-org/parsers": "^0.0.3",
3739
"@typecell-org/frame": "^0.0.3",
40+
"speakingurl": "^14.0.1",
3841
"classnames": "^2.3.1",
39-
"filebridge-client": "^0.1.5",
4042
"fractional-indexing": "^2.0.0",
4143
"lodash": "^4.17.21",
4244
"mobx": "^6.2.0",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Welcome to TypeCell
2+
3+
Hi there 👋 ! Welcome to the community preview of TypeCell, an experimental _live notebook programming_ environment for the web.
4+
5+
This guide should help you to get started, and learn more about the ins & outs.
6+
7+
## Tutorial
8+
9+
Complete the tutorial to get familiar with TypeCell:
10+
11+
» [Interactive introduction](/docs/interactive-introduction.md)
12+
13+
## Reference manual
14+
15+
We've written about the main functionality of TypeCell in the [manual](/docs/manual):
16+
17+
- [Notebooks and cells](/docs/manual/1.%20Notebooks%20and%20cells.md)
18+
- [TypeScript and exports](/docs/manual/2.%20TypeScript%20and%20exports.md)
19+
- [Reactive variables](/docs/manual/3.%20Reactive%20variables.md)
20+
- [Working with user input](/docs/manual/4.%20Inputs.md)
21+
- [Imports & NPM](/docs/manual/5.%20Imports%20and%20NPM.md)
22+
- [Collaboration](/docs/manual/6.%20Collaboration.md)
23+
24+
## Demos
25+
26+
Another good way to learn is to check out some notebooks from our community:
27+
28+
» [View demo notebooks](/docs/demos.md)
29+
30+
# Feedback ❤️
31+
32+
As always, we'd love to hear your thoughts and see your experiments, so [come and say hi on Discord](https://discord.gg/TcJ9TRC3SV) or [Matrix](https://matrix.to/#/#typecell-space:matrix.org) as well.
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
["demos.md","interactive-introduction.md","manual/1. Notebooks and cells.md","manual/2. TypeScript and exports.md","manual/3. Reactive variables.md","manual/4. Inputs.md","manual/5. Imports and NPM.md","manual/6. Collaboration.md","README.md"]
1+
{
2+
"title": "Docs",
3+
"items": [
4+
"demos.md",
5+
"interactive-introduction.md",
6+
"manual/1. Notebooks and cells.md",
7+
"manual/2. TypeScript and exports.md",
8+
"manual/3. Reactive variables.md",
9+
"manual/4. Inputs.md",
10+
"manual/5. Imports and NPM.md",
11+
"manual/6. Collaboration.md",
12+
"README.md"
13+
]
14+
}

packages/editor/public/_docs/interactive-introduction.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# Introduction to TypeCell Notebooks
1+
# Introduction to TypeCell
22

3-
Welcome to TypeCell Notebooks. A notebook is a live, interactive programming environment for Javascript / Typescript
3+
Welcome to TypeCell. A TypeCell document is a live, interactive programming environment for Javascript / Typescript
44
running in your browser.
55

6-
In this introduction, we will go through the basics of using TypeCell Notebooks.
6+
In this introduction, we will go through the basics of using TypeCell.
77

88
## Cats
99

1010
Let's say you're like my grandma, and you have a lot of cats. Our story will be about them.
1111

1212
### Step 1: give your cat a name!
1313

14-
1514
```typescript
1615
export let cat = {
1716
name: "",
@@ -51,7 +50,6 @@ export default message;
5150

5251
### Step 2: Friends
5352

54-
5553
```typescript
5654
export default (
5755
<div>I feel like our cat needs a friend. Let's call him {$.friend.name}.</div>
@@ -63,7 +61,6 @@ Uh oh, what's this? I forgot to add a cell defining our friend. Can you do it fo
6361
A cell is a container for code & output. To add one, click on the + above or below another cell.
6462
You can do it wherever you like.
6563

66-
6764
```typescript
6865
// @default-collapsed
6966

@@ -86,14 +83,13 @@ to access across cells! Exported variables are also displayed below the cell.
8683

8784
Code cells automatically run when:
8885

89-
* You change the code of a cell
90-
* Any of the reactive variables the cell references (from `$`) are changed
86+
- You change the code of a cell
87+
- Any of the reactive variables the cell references (from `$`) are changed
9188

9289
## Feeding neighbors
9390

9491
Our cats have some neighbors. Let's involve them in the story too!
9592

96-
9793
```typescript
9894
export let neighbors = [
9995
$.cat,
@@ -114,7 +110,6 @@ export let neighbors = [
114110
Now, if you're like my grandma, you're feeding the entire neighborhood by yourself, but you don't
115111
yet know if our friend prefers dry/wet food or how many cans they eat per week.
116112

117-
118113
```typescript
119114
// @default-collapsed
120115

@@ -136,7 +131,6 @@ export default (
136131

137132
Alright, once you've completed steps 1 - 3, let's see how much food you need to prepare. We do this in the cell below:
138133

139-
140134
```typescript
141135
// Repeats a character a number of times and returns the string.
142136
export function repeat(char: string, times: number) {
@@ -191,7 +185,6 @@ JSX is part of React, and makes it easy to create type-safe HTML elements. In Ty
191185
Next, we'll create some user input fields to indicate how much food we have prepared.
192186
The built-in TypeCell Input library makes this easy:
193187

194-
195188
```typescript
196189
export let dryFoodPrepared = typecell.Input<number>(
197190
<input type="range" min="0" max="20" />,
@@ -221,7 +214,6 @@ export default (
221214

222215
Now, let's also create some cells to calculate whether we have prepared enough food:
223216

224-
225217
```typescript
226218
// @default-collapsed
227219

@@ -310,7 +302,7 @@ export default (
310302
These are just 2 of the many input types that TypeCell supports. To see the
311303
other choices, make sure to try the TypeCell inputs tutorial.
312304

313-
*<strong>Tip:</strong> expand the 3 cells above to see how they work.*
305+
_<strong>Tip:</strong> expand the 3 cells above to see how they work._
314306

315307
## Final notes
316308

@@ -321,6 +313,6 @@ There are a lot more features to discover, for example,
321313
did you know you can import any NPM package you like, or even compose different notebooks?
322314
Try creating your own notebook to give it a try, or have a look at the other examples.
323315

324-
**Have fun using TypeCell Notebooks!**
316+
**Have fun using TypeCell!**
325317

326318
<small>This tutorial is inspired by [pluto.jl](https://github.com/fonsp/Pluto.jl), thanks Fons & Nicholas!</small>

0 commit comments

Comments
 (0)