Skip to content

Commit

Permalink
haciendo funcionar el demo
Browse files Browse the repository at this point in the history
  • Loading branch information
rgonzalezt committed Apr 11, 2023
1 parent fcdf4ea commit a7fe648
Show file tree
Hide file tree
Showing 6 changed files with 569 additions and 68 deletions.
6 changes: 2 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,15 @@ module.exports = function (grunt) {
watch: {
scripts: {
files: ['src/**'],
tasks: ['compile'],
tasks: ['run:build'],
}
}

});

grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-run');
grunt.registerTask('compile', ['run:build']);
grunt.registerTask('default', ['compile']);

};
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ build:
@ ./node_modules/grunt/bin/grunt typescript
@ npm run generate-random-grammar
@ touch ./dist/imageList.js
@ python scripts/generateImageList.py
@ python3 scripts/generateImageList.py
@ cp -r src/assets dist/data
@ ./node_modules/grunt/bin/grunt concat
@ rm ./dist/gramaticaAleatoria.js
@ rm ./dist/imageList.js
# @ rm ./dist/imageList.js # if we remove this, demo doesn't work
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,23 @@ this by running the following command:
npm install
```

Then, to start the compilation and open the browser:
You also need to install python3, to do this in Linux, run:

```
grunt
sudo apt-get install python3 python3-dev
```

And if you are developing new exercises, it is a good idea to start a
compilation continuously with the following command:
Then, to start the compilation and open the browser in the demo page:

```
grunt watch
npm run start
```

However, this doesn't trigger a new compilation when a file is changed.
For this you have to start in another terminal:

```
npm run watch
```

## How does it look?
Expand Down
4 changes: 2 additions & 2 deletions demo.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
</head>


<h3>DEMO Pilas Bloques Exercises</h3>
<div class="container">

<div class="canvas-container">
<canvas id='canvas'></canvas>

Expand All @@ -60,7 +60,7 @@
</div>

<script type="module">
import { imageList } from './dist/imageList.js';
import './dist/imageList.js';
window["repeat"] = function repeat(n, f) { for (var i = 0; i < n; i++) { f(); } }
function evalScene(nombreDesafio) {
pilas.mundo.gestor_escenas.cambiar_escena(new (eval(nombreDesafio))());
Expand Down
Loading

0 comments on commit a7fe648

Please sign in to comment.