Add a playground to the docs site

This commit is contained in:
Max Brunsfeld 2019-04-24 16:58:30 -07:00
parent 1fc0525940
commit e39d69dfa7
6 changed files with 316 additions and 2 deletions

View file

@ -1,4 +1,25 @@
#!/bin/bash
root=$PWD
cd docs
bundle exec jekyll serve "$@"
bundle exec jekyll serve "$@" &
bundle exec ruby <<RUBY &
require "listen"
dir = "$root/target/release"
puts "Watching #{dir}"
listener = Listen.to(dir, only: /^tree-sitter\.(js|wasm)$/, wait_for_delay: 3.0) do
puts "WASM files updated. Copying to docs folder..."
system(
"cp",
"$root/target/release/tree-sitter.js",
"$root/target/release/tree-sitter.wasm",
"$root/docs/assets/js/"
)
end
listener.start
sleep
RUBY
wait