Update README about netrepl and make sure we can stop the watch command
This commit is contained in:
parent
5b3eaf2c35
commit
0bae8c01f8
4 changed files with 15 additions and 13 deletions
15
README.md
15
README.md
|
|
@ -15,14 +15,23 @@ The site itself is built using [bagatto](https://bagatto.co/), which is a static
|
|||
bag index.janet
|
||||
```
|
||||
|
||||
There is some code that starts a networked repl when you add the `--repl` flag to the above command. This allows you to interactively evaluate parts of the website, which is very handy if you want to understand how it works or change some parts.
|
||||
|
||||
The build output is in `site`, you can upload that to wherever static files are served from.
|
||||
|
||||
### Starting a `netrepl` from within bagatto
|
||||
|
||||
When running bagatto with the `--repl` flag, you can start a `netrepl` which [Conjure](https://github.com/Olical/conjure) can connect to:
|
||||
|
||||
``` lisp
|
||||
(def env (curenv))
|
||||
(def t (thread/new (fn [_] (netrepl/server "127.0.0.1" 9365 env))))
|
||||
```
|
||||
|
||||
All the bagatto functions like `eval-data` and `eval-site` are available in the netrepl session as well. A static site generator from your repl! 🔥
|
||||
|
||||
### Continuously rebuild the site on changes
|
||||
|
||||
Easy as π! Use `entr`, which is included in the development environment:
|
||||
|
||||
``` fish
|
||||
while true; fd | entr -d sh -c 'bag index.janet'; end
|
||||
while sleep 0.5s; fd | entr -d sh -c 'bag index.janet'; end
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue