I'm no longer using this after finding blockup, which is awesome!
set up for me to create code sketches for bl.ocks.org using es6 syntax
Run: npm update
in the console to install npm modules
transpile es6 code using buble:
npm run build
will compile using the below script:
buble gist/script.js > gist/script-compiled.js
NOTE: To generate separate sourcemap files – i.e. an output.js.map
file to go along with output.js
– use the --sourcemap
or -m
flag:
buble -i input.js -m -o output.js
npm run serve
will use live-server to run a little development server with live reload capability
view at: http://localhost:8888/
once all working as desired, navigate to the gist folder: cd gist
- replace
thumbnail.png
(or delete it if not using thumbnail on blocks) - replace
preview.png
(or delete it if not using social media preview) - update
README.md
finally create the gist: gistup -m 'd3 | your title'
NOTES
- for further options using gistup: https://github.com/mbostock/gistup
- If you want
script-compiled.js
to be hidden once you push the gist to the block, rename it to.script-compiled.js
and update the corresponding script tag inindex.html