diff --git a/sample/codelab.md b/sample/codelab.md index d980a115b..7829cd8fc 100644 --- a/sample/codelab.md +++ b/sample/codelab.md @@ -202,6 +202,11 @@ $ claat serve * Choose the directory that matches your "id" that you put in the headers. * Viola! You should have your first codelab! +For a "tight inner loop" while writing Codelabs, you can use a tool like e.g. [`entr`](https://github.com/eradman/entr) +with a [watch script such as this one](https://github.com/googlecodelabs/tools/blob/main/sample/watch.sh); this allows +to change your Markdown source file, Ctrl-S to Save it, F5 to reload in the brower - without having to constantly retype +the commands above every time. + ## Host Your CodeLab Duration: 0:01:00 diff --git a/sample/watch.sh b/sample/watch.sh new file mode 100755 index 000000000..3d7895eaa --- /dev/null +++ b/sample/watch.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euo pipefail + +# TODO Implement https://github.com/googlecodelabs/tools/issues/881 and remove this! ;-) + +../claat/bin/claat serve & +claatServePID=$? +trap 'kill ${claatServePID}' EXIT + +echo codelab.md | entr ../claat/bin/claat export codelab.md