Skip to content
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

add devcontainer and update README for push-button dev environment #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
28 changes: 28 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
{
"name": "Node.js",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-20",
"features": {
"ghcr.io/devcontainers/features/rust:1": {}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && npm install && npm run compile-wasm && cp ./src/test/.testCode.doenet ./src/test/testCode.doenet",
"postAttachCommand": {
"viewer": "npm run dev -- --host"
}

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ Semantic markup for building interactive web activities.


## Quickstart

First, install [Node](https://nodejs.org/en/download),
[Rust](https://rustup.rs/),
and [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/).

In the project folder:

`$ npm install`
Expand All @@ -25,9 +30,17 @@ In the project folder:

`$ npm run dev`

Paste demo code into `src/test/testCode.doenet`
Paste demo code into `./src/test/testCode.doenet`
(or copy `./src/test/.testCode.doenet` to `./src/test/testCode.doenet`).

Navigate to <http://localhost:3000/src/test/index.html>

## Codespaces quickstart

Navigate to `localhost:3000/src/test/index.html`
All the above steps should happen automatically. Once that is ready
(after "Your applicaiton running on port 3000 is available"),
just visit <http://localhost:3000/src/test/index.html> (may need to
Ctrl-click to open GitHub Codespaces link).

## Demos

Expand Down
7 changes: 7 additions & 0 deletions src/test/.testCode.doenet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<graph name="graph">
<point name="p1" xs="2 3"/>
<point name="p2" xs="$p1.y $p1.x"/>
</graph>
<text>
<collect source="graph" componentType="point"/>
</text>