Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto refresh page feature? #59

Open
mcdoyaji opened this issue Jul 27, 2017 · 2 comments
Open

auto refresh page feature? #59

mcdoyaji opened this issue Jul 27, 2017 · 2 comments

Comments

@mcdoyaji
Copy link

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.

@mcdoyaji
Copy link
Author

mcdoyaji commented Aug 4, 2017

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?

@olafurpg
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants