Working with Pollen-rock is similar to Pollen’s The project server.
To start, issue the following command in your terminal.
$ raco pollen-rock --start-dir ~/workspace/blog
And you’ll see the following output
Welcome to Pollen Rock 0.6.0 (Racket 6.8)
Project root is /home/user/workspace/blog/
Pollen Editor is running at http://localhost:8000/dashboard (accessible by all machines on your network)
Ctrl-C at any time to terminate Pollen Rock.
If --start-dir argument is not specified, the project root will be current working directory.
All machines on your network will be accessible to your project directory. This is dangerous; other people who know your IP can issue HTTP POST request remotely to remove your project data. To limit the access scope to your own machine, specify --local in the argument.
The dashboard is at http://localhost:8000/dashboard.
On the dashboard, you can
Navigate in directories
Render Pollen source files
Open an in-browser editor to edit files
Change editor settings
On the dashboard, you can click Render to render a Pollen source file.
When Pollen-rock starts to render a file, it actually does two things: It renders and shows the rendered page in the browser, and it watches the source code changes and reloads the rendered page.
This is convenient when you open your editor and the browser side by side
There are a few things you should be aware of:
Pollen-rock doesn’t know the dependencies of your rendered result; if Pollen-rock watches source file file1.html.pm, who specifies link src style.css. Your change to style.css is not going to trigger the reload.
Pollen-rock watches the file content as well as file attributes.
On the dashboard, you can also click "Edit" to edit a file.
Pollen-rock editor currently supports syntax highlight of only a few common file types. The dashboard shows "Edit" only for supported files.
The editor saves your change automatically, and the header area shows the saving status. Once the saving status has become saved, it’s safe to close the browser. It will warn you when you close the browser if there are unsaved contents.
In the header area, you can also see
Render: split the view. It can cycle through horizontal and vertical split view, and automatically render the file and reload the rendered page when the source code syntax is correct
Settings: open settings page. Any changes to the setting will take effect immediately