Skip to content

Commit

Permalink
Merge pull request #10 from martin-azpillaga/refactor-simplify-projec…
Browse files Browse the repository at this point in the history
…t-setup

Refactor: Simplify project setup
  • Loading branch information
alessiostalla authored Jul 6, 2023
2 parents 56c3ebc + 2b041e6 commit 52e58ca
Show file tree
Hide file tree
Showing 14 changed files with 5,209 additions and 3,825 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy website to Pages

on: push

permissions:
contents: read
pages: write
id-token: write

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build website
run: |
npm install
npm run generateParser
npm run compile
npm run test
npm run bundle
npm run packageWeb
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'web'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.gradle
node_modules
dist
web
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
# calc-monaco-editor

This project is explained in the article [Writing a browser based editor using Monaco and ANTLR](https://tomassetti.me/writing-a-browser-based-editor-using-monaco-and-antlr/).
This project is explained in the article [Writing a browser based editor using Monaco and ANTLR].

A browser based editor for a simple DSL to perform calculations.

It shows how to integrate ANTLR with monaco.

![Calc Example](./doc/images/calc_example.png)
![Calc Example]

## Generating the lexer and the parser
## Try it online

```
./gradlew generateParser
```
Play with the editor [online].

## Or run it locally

## Build everything and run the server
You will need an installation of [Java 8+] and [Node 16+] to build the project. Then run

```
npm install
./gradlew generateParser
tsc
webpack
cd server
../gradlew runServer
npm run all
```

Now visit http://localhost:8888
Now visit http://localhost:8888.


[Writing a browser based editor using Monaco and ANTLR]: https://tomassetti.me/writing-a-browser-based-editor-using-monaco-and-antlr/
[Calc Example]: ./doc/images/calc_example.png
[Java 8+]: https://www.java.com/en/download/help/download_options.html
[Node 16+]: https://nodejs.org/en
[online]: https://minim.tools/calc-monaco-editor/
Loading

0 comments on commit 52e58ca

Please sign in to comment.