Skip to content

Commit

Permalink
move website to the main repo (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
lihebi committed Jun 30, 2023
1 parent 8fe0154 commit 6f8397e
Show file tree
Hide file tree
Showing 71 changed files with 10,643 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/website-build-on-PR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build Website on PRs

on:
pull_request:
branches:
- main
paths:
- website/**
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
website-build-on-PR:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: ./website/yarn.lock

- name: Install dependencies
working-directory: ./website
run: yarn install --frozen-lockfile
- name: Test build website
working-directory: ./website
run: yarn build
45 changes: 45 additions & 0 deletions .github/workflows/website-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Deploy to GitHub Pages

on:
push:
branches:
- main
paths:
- website/**
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: ./website/yarn.lock

- name: Install dependencies
working-directory: ./website
run: yarn install
- name: Build website
working-directory: ./website
run: yarn build

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./website/build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
20 changes: 20 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

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.
3 changes: 3 additions & 0 deletions website/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
10 changes: 10 additions & 0 deletions website/blog/2023-02-07-first.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
slug: first-blog-post
title: First Blog Post
authors:
- name: Hebi Li
url: https://lihebi.com
tags: [greetings]
---

Greetings! We'll publish blog posts when we are ready to announce, stay tuned!
13 changes: 13 additions & 0 deletions website/docs/1-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Introduction

[CodePod.io](http://CodePod.io) is an open-source canvas-based coding IDE that
helps programmers develop large, production-ready projects faster by presenting
interactive coding (e.g., Jupyter) on a hierarchical, scoped, 2D canvas. Without
code modularization (traditionally done via organizing text files under
tree-structured folder hierarchies), a Jupyter notebook can easily become messy,
difficult to manage and scale. Alleviating such limitations, CodePod was born to
bump interactive coding beyond prototyping and demos. Our website is
[https://codepod.io](https://codepod.io). More details are in our paper:
[https://arxiv.org/abs/2301.02410](https://arxiv.org/abs/2301.02410)

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).
189 changes: 189 additions & 0 deletions website/docs/3-manual/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# User Manual

**Try it [here (experimental)](https://app.codepod.io)**

## Optional User Registration

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.

<img src={require("./assets/signup.png").default} alt="xxx" width="600" />

## The dashboard and project creation

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.

<!-- ![guestUser](https://user-images.githubusercontent.com/4576201/235222305-6cd13058-6a35-43b8-8a8d-36c94c4b6f54.png) -->

<img src={require("./assets/guestUser.png").default} alt="xxx" width="600" />

## The Canvas

### Create your first code pod

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.

<!-- ![create-pod](./assets/create-pod.png) -->

<img
src={require("./assets/create-pod.png").default}
alt="Example banner"
width="600"
/>

### The runtime and sidebar

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.

### Execute the code

Back to your code, you can execute the pod by clicking the "run" button on the floating toolbar, or press `<shift>+<enter>`.

<img
src={require("./assets/execute.png").default}
alt="Example banner"
width="600"
/>

### Moving around the Canvas

You can move your pods with the drag handles on the toolbar. Simply drag-n-drop.

## Organize your Canvas with scopes

### Create your first scope

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.

<img
src={require("./assets/moveIntoScope.png").default}
alt="Example banner"
width="600"
/>

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.

<img src={require("./assets/executeScope.png").default} alt="xxx" width="600" />

### The scoped runtime semantics

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.

### Export to parent as public API

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.

<img
src={require("./assets/scopeExport.png").default}
alt="Example banner"
width="600"
/>

The names can be further exported to ancestor nodes.

<img
src={require("./assets/scopeRecursiveExport.png").default}
alt="Example banner"
width="600"
/>

### Lexical scoping

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.

<img
src={require("./assets/parentToChild.png").default}
alt="Example banner"
width="600"
/>

## Writing docs in Rich-text editor

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.

<img
src={require("./assets/richText.png").default}
alt="Example banner"
width="600"
/>

The rich-text editor supports:

- Markdown syntax
- Insert images
- Tables
- Links

## Copy-n-paste

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.

<img src={require("./assets/copyNPaste.png").default} alt="xxx" width="600" />

## Auto-layout

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.

Before auto-layout, the pods and scopes could be overlapped and messy.

<img
src={require("./assets/autoLayoutBefore.png").default}
alt="Example banner"
width="600"
/>

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.

<img
src={require("./assets/autoLayoutAfter.png").default}
alt="xxx"
width="600"
/>

## Contextual zooming

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.

The feature contains roughly two significant behaviors:

1. different levels in the hierarchy have different font sizes
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).

This feature is experimental and disabled by default. There's a setting contextual zoom in the sidebar to enable it.

Fully expanded (zoomed in):

<img src={require("./assets/zoomExpanded.png").default} alt="xxx" width="600" />

Zoom out:

<img src={require("./assets/zoom1.png").default} alt="xxx" width="600" />

Zoom out:

<img src={require("./assets/zoom2.png").default} alt="xxx" width="600" />

Zoom out:

<img src={require("./assets/zoomAll.png").default} alt="xxx" width="600" />

## Exporting

You can export your project into a SVG image, executable Python files, and a Jupyter notebook. The export button is in the sidebar.

## Share your project and collaborate in real time

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.

<img src={require("./assets/shareDialog.png").default} alt="xxx" width="600" />

The shared projects will be shown in the bottom of the Guest's dashboard. The real-time collaboration happens in the following places:

- The code pods
- The rich-text pods
- The Canvas: nodes and edges

## In case of the app went wrong

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.

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.
Binary file added website/docs/3-manual/assets/autoLayoutAfter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/copyNPaste.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/create-pod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/execute.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/executeScope.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/guestUser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/moveIntoScope.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/parentToChild.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/richText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/scopeExport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/shareDialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/signup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/zoom1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/zoom2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/zoomAll.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/3-manual/assets/zoomExpanded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/4-developer/Codepod_system_arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6f8397e

Please sign in to comment.