Scalatex
Scalatex copied to clipboard
auto refresh page feature?
how can browse auto-refresh after readme/run?
I try this with Itellij chrome live edit feature.
but it's not working well.
I want to use workbench. but don't know how.
here's partial solution.
add below strings into build.sbt
/*
For openDocument after scalatext document compiled
maybe defining task in readme project is better than this.
// http://www.scala-sbt.org/0.13/docs/Howto-After-Input-Task.html
*/
lazy val openDocument = TaskKey[Unit]("openDocument", "openbrowser")
// TODO: refresh browsers tab has current targetURI.
openDocument := {
val target = baseDirectory.value / "readme/target/scalatex/index.html"
java.awt.Desktop.getDesktop.browse(target.toURI)
}
addCommandAlias("dc", ";readme/run;openDocument")
and then run sbt dc
it will open browser after scalatex compile.
but, I can't find how to refresh browser tab has same uri.
anyone know that?
Here's what I use
$ cat ~/dotfiles/bin/watchscalatex.sh
browser-sync start --server --files "readme/target/scalatex/**" --startPath "/readme/target/scalatex"
I then keep ~readme/run and watchscalatex.sh running in two separate terminal consoles.