-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #352 from moonbitlang/zhiyuan/add-tour
add moonbit langauge tour
- Loading branch information
Showing
81 changed files
with
3,464 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: check langauge tour | ||
|
||
on: | ||
pull_request: | ||
branches: main | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
- name: install | ||
run: | | ||
pnpm install | ||
- name: check | ||
run: | | ||
cd moonbit-tour | ||
pnpm build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Deploy language tour to Pages | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ['main'] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: 'pages' | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
- uses: pnpm/action-setup@v4 | ||
- run: pnpm install | ||
- run: | | ||
cd moonbit-tour | ||
pnpm build | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: './moonbit-tour/dist' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
**/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v22.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
assets | ||
public | ||
tour | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-organize-imports"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# MoonBit Language Tour | ||
|
||
An interactive tour to learn the MoonBit programming language. | ||
|
||
## Get started | ||
|
||
```sh | ||
pnpm install | ||
pnpm build | ||
pnpm preview | ||
``` | ||
|
||
open <http://localhost:4173> to view the tour. | ||
|
||
## How to add new tour | ||
|
||
### Add new lesson | ||
|
||
1. Create a new folder under the chapter folder following the naming convention `lesson<n>_<lesson-name>` (count start from 1). | ||
1. Write the lesson content in `index.md` and lesson code in `index.mbt` under the created folder. | ||
|
||
To see the render result while writing lesson on the fly, follow the instruction below: | ||
|
||
1. Setup development environment. | ||
|
||
```sh | ||
pnpm install | ||
pnpm dev | ||
``` | ||
|
||
1. Write the lesson content in `tour/index.md` and lesson code in `tour/index.mbt`. You can see the render result in <http://localhost:5173> | ||
|
||
1. After you finish writing the lesson, copy `tour/index.md` and `tour/index.mbt` to the corresponding lesson folder. | ||
|
||
### Add new chapter | ||
|
||
1. Create a new folder under `tour` following the naming convention `chapter<n>_<chapter-name>`. | ||
1. Add new lessons following the instruction above. | ||
|
||
## Credit | ||
|
||
This project is highly inspired by [Gleam Language Tour](https://github.com/gleam-lang/language-tour). |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.