Skip to content

Commit 7d1646b

Browse files
lihebili-xin-yi
authored andcommitted
move website to the main repo (#349)
1 parent 6caaf60 commit 7d1646b

Some content is hidden

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

71 files changed

+10643
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build Website on PRs
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- website/**
9+
# Review gh actions docs if you want to further define triggers, paths, etc
10+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
11+
12+
jobs:
13+
website-build-on-PR:
14+
name: Build
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 18
21+
cache: yarn
22+
cache-dependency-path: ./website/yarn.lock
23+
24+
- name: Install dependencies
25+
working-directory: ./website
26+
run: yarn install --frozen-lockfile
27+
- name: Test build website
28+
working-directory: ./website
29+
run: yarn build
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build and Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- website/**
9+
# Review gh actions docs if you want to further define triggers, paths, etc
10+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
11+
12+
jobs:
13+
deploy:
14+
name: Build and Deploy
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 18
21+
cache: yarn
22+
cache-dependency-path: ./website/yarn.lock
23+
24+
- name: Install dependencies
25+
working-directory: ./website
26+
run: yarn install
27+
- name: Build website
28+
working-directory: ./website
29+
run: yarn build
30+
31+
# Popular action to deploy to GitHub Pages:
32+
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
33+
- name: Deploy to GitHub Pages
34+
uses: peaceiris/actions-gh-pages@v3
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
# Build output to publish to the `gh-pages` branch:
38+
publish_dir: ./website/build
39+
# The following lines assign commit authorship to the official
40+
# GH-Actions bot for deploys to `gh-pages` branch:
41+
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
42+
# The GH actions bot is used by default if you didn't specify the two fields.
43+
# You can swap them out with your own user credentials.
44+
user_name: github-actions[bot]
45+
user_email: 41898282+github-actions[bot]@users.noreply.github.com

website/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

website/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

website/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

website/blog/2023-02-07-first.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
slug: first-blog-post
3+
title: First Blog Post
4+
authors:
5+
- name: Hebi Li
6+
url: https://lihebi.com
7+
tags: [greetings]
8+
---
9+
10+
Greetings! We'll publish blog posts when we are ready to announce, stay tuned!

website/docs/1-intro.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Introduction
2+
3+
[CodePod.io](http://CodePod.io) is an open-source canvas-based coding IDE that
4+
helps programmers develop large, production-ready projects faster by presenting
5+
interactive coding (e.g., Jupyter) on a hierarchical, scoped, 2D canvas. Without
6+
code modularization (traditionally done via organizing text files under
7+
tree-structured folder hierarchies), a Jupyter notebook can easily become messy,
8+
difficult to manage and scale. Alleviating such limitations, CodePod was born to
9+
bump interactive coding beyond prototyping and demos. Our website is
10+
[https://codepod.io](https://codepod.io). More details are in our paper:
11+
[https://arxiv.org/abs/2301.02410](https://arxiv.org/abs/2301.02410)
12+
13+
Start with the [user manual](/docs/manual). Codepod is free and open source, you can deploy your own CodePod by following hte [developer manual](/docs/developer).

website/docs/3-manual/README.md

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# User Manual
2+
3+
**Try it [here (experimental)](https://app.codepod.io)**
4+
5+
## Optional User Registration
6+
7+
Codepod is a web app with standard user authentication. You can register, or better, you can login with your google account instantly. If you don't register & login, the system will register a Guest user, so that people can try out Codepod without registering.
8+
9+
<img src={require("./assets/signup.png").default} alt="xxx" width="600" />
10+
11+
## The dashboard and project creation
12+
13+
You will be greeted with the dashboard. It will list your projects and those that shared with you by other users. You can create a new project on the dashboard, which drops you into the new project canvas.
14+
15+
<!-- ![guestUser](https://user-images.githubusercontent.com/4576201/235222305-6cd13058-6a35-43b8-8a8d-36c94c4b6f54.png) -->
16+
17+
<img src={require("./assets/guestUser.png").default} alt="xxx" width="600" />
18+
19+
## The Canvas
20+
21+
### Create your first code pod
22+
23+
In the canvas, you can right-click on the Canvas to create pods and scopes. Create a new pod, and you can type your hello world code in the cell.
24+
25+
<!-- ![create-pod](./assets/create-pod.png) -->
26+
27+
<img
28+
src={require("./assets/create-pod.png").default}
29+
alt="Example banner"
30+
width="600"
31+
/>
32+
33+
### The runtime and sidebar
34+
35+
The sidebar shows some status of the project and runtime, as well as settings. Wait until you have the runtime ready and idle for running code. The sidebar can be folded with the "Fold" button.
36+
37+
### Execute the code
38+
39+
Back to your code, you can execute the pod by clicking the "run" button on the floating toolbar, or press `<shift>+<enter>`.
40+
41+
<img
42+
src={require("./assets/execute.png").default}
43+
alt="Example banner"
44+
width="600"
45+
/>
46+
47+
### Moving around the Canvas
48+
49+
You can move your pods with the drag handles on the toolbar. Simply drag-n-drop.
50+
51+
## Organize your Canvas with scopes
52+
53+
### Create your first scope
54+
55+
One key feature that Codepod brings is the scope. You can create a scope by right-clicking on the canvas. Scopes are like modules in your code, they can be nested, and you can move your pods into scopes. Drag-n-drop your pods into the scope; a target scope will be highlighted when you drag a pod over it.
56+
57+
<img
58+
src={require("./assets/moveIntoScope.png").default}
59+
alt="Example banner"
60+
width="600"
61+
/>
62+
63+
You can also run all the pods in the scope by clicking the "Run" button in the scope toolbar. It will execute all pods and scopes in the scope by geometric order, from top-left to bottom-right.
64+
65+
<img src={require("./assets/executeScope.png").default} alt="xxx" width="600" />
66+
67+
### The scoped runtime semantics
68+
69+
The scoped runtime supports python variables, functions, and classes. You can define them in the scope, and use them in the pods. The scope is like a python module. All names defined in the scope stays inside the scope. The outside world cannot see it.
70+
71+
### Export to parent as public API
72+
73+
A scope can define some public APIs, which can be used by outer scopes. You can define a public API by adding a `@export` decorator at the first line of the pod. Once you execute it, the pod will be highlighted with a thick green border to indicate that this pod defines a public API. The public API can then be resolved in outer scope.
74+
75+
<img
76+
src={require("./assets/scopeExport.png").default}
77+
alt="Example banner"
78+
width="600"
79+
/>
80+
81+
The names can be further exported to ancestor nodes.
82+
83+
<img
84+
src={require("./assets/scopeRecursiveExport.png").default}
85+
alt="Example banner"
86+
width="600"
87+
/>
88+
89+
### Lexical scoping
90+
91+
The other direction, from parent scope to child scope, is automatic. It works like the lexical scoping where inner scopes can see the names in outer scopes. This enables you to define global variables and utility functions in the outermost scope, and use them anywhere on the Canvas.
92+
93+
<img
94+
src={require("./assets/parentToChild.png").default}
95+
alt="Example banner"
96+
width="600"
97+
/>
98+
99+
## Writing docs in Rich-text editor
100+
101+
We integrate the Remirror/ProseMirror editor, so that you can write rich-text documents in the pods. You can create a rich-text pod by right-clicking on the canvas. The rich-text pod supports markdown syntax, and you can insert images and videos.
102+
103+
<img
104+
src={require("./assets/richText.png").default}
105+
alt="Example banner"
106+
width="600"
107+
/>
108+
109+
The rich-text editor supports:
110+
111+
- Markdown syntax
112+
- Insert images
113+
- Tables
114+
- Links
115+
116+
## Copy-n-paste
117+
118+
You can copy a pod or a scope, and paste it anywhere on the canvas. The copy-n-paste feature is in the pod toolbar. You can also paste across browser tabs. On paste, a shadowed visualization will be moving with your cursor until you click to drop it.
119+
120+
<img src={require("./assets/copyNPaste.png").default} alt="xxx" width="600" />
121+
122+
## Auto-layout
123+
124+
It is painful and inefficient to resize and position the pods and scopes manually. Codepod provides an auto-layout feature to help you organize your canvas. The auto-layout setting is in the sidebar, default to enabled.
125+
126+
Before auto-layout, the pods and scopes could be overlapped and messy.
127+
128+
<img
129+
src={require("./assets/autoLayoutBefore.png").default}
130+
alt="Example banner"
131+
width="600"
132+
/>
133+
134+
After auto-layout, the pods and scopes are organized by a collision-free algorithm, and the scopes will be resized to fit the pods inside.
135+
136+
<img
137+
src={require("./assets/autoLayoutAfter.png").default}
138+
alt="xxx"
139+
width="600"
140+
/>
141+
142+
## Contextual zooming
143+
144+
The canvas can be zoomed in and out by the touch pad pining, the buttons, and the mouse wheel. We introduce a major feature called "contextual zoom". The idea is to see different level of details at different zoom levels, so that users can focus on a small subsets of content to work on. Think of it as Google maps where you zoom in & out to see different levels of details.
145+
146+
The feature contains roughly two significant behaviors:
147+
148+
1. different levels in the hierarchy have different font sizes
149+
2. when zooming out, the pods and scopes that become too small to view will be collapsed into a block, with large text summarizing its content. These blocks can be dragged and moved easily (which is pretty easy to use).
150+
151+
This feature is experimental and disabled by default. There's a setting contextual zoom in the sidebar to enable it.
152+
153+
Fully expanded (zoomed in):
154+
155+
<img src={require("./assets/zoomExpanded.png").default} alt="xxx" width="600" />
156+
157+
Zoom out:
158+
159+
<img src={require("./assets/zoom1.png").default} alt="xxx" width="600" />
160+
161+
Zoom out:
162+
163+
<img src={require("./assets/zoom2.png").default} alt="xxx" width="600" />
164+
165+
Zoom out:
166+
167+
<img src={require("./assets/zoomAll.png").default} alt="xxx" width="600" />
168+
169+
## Exporting
170+
171+
You can export your project into a SVG image, executable Python files, and a Jupyter notebook. The export button is in the sidebar.
172+
173+
## Share your project and collaborate in real time
174+
175+
Modern collaboration cannot be without real-time collaboration. Codepod supports real-time collaboration. You can share your project with other users, and they can edit the project together with you in real time.
176+
177+
<img src={require("./assets/shareDialog.png").default} alt="xxx" width="600" />
178+
179+
The shared projects will be shown in the bottom of the Guest's dashboard. The real-time collaboration happens in the following places:
180+
181+
- The code pods
182+
- The rich-text pods
183+
- The Canvas: nodes and edges
184+
185+
## In case of the app went wrong
186+
187+
The project is still in heavy development, and bugs can happen. If you find the page is not responding, you can try to refresh the page.
188+
189+
If you would like to hunter the bugs, welcome and thanks! You can open the developer console and see if there are errors. Let us know by openning a GitHub issue.
267 KB
Loading
253 KB
Loading

0 commit comments

Comments
 (0)