status: experimental
in a shell:
# install docker
docker pull fisx/aula
git clone https://github.com/liqd/aula
git clone --recursive https://github.com/liqd/thentos
cd aula
./docker/run.sh
# now you are inside the container.
cd /root/thentos
cabal sandbox init --sandbox=/liqd/thentos/.cabal-sandbox
cd /root/aula
cabal sandbox init --sandbox=/liqd/thentos/.cabal-sandbox
cabal install --enable-tests
Now, to have a quick look at the pages, do
cabal run aula-server
then point your browser to localhost:8080
Note: when you want to git pull
, do this outside of docker,
just as git clone
was performed outside. Otherwise, paths may be wrong.
https://github.com/hspec/sensei is a tool for rapid re-compilation and testing. If you want to use it, follow these steps:
- install any required system and ghc packages, e.g., for Debian-based systems, those mentioned in https://github.com/liqd/aula-docker/blob/master/Dockerfile in particular, libpq-dev and zlib1g-dev
- in a shell:
git clone --recursive https://github.com/hspec/sensei
git clone --recursive https://github.com/liqd/thentos
export THENTOS_ROOT_PATH=`pwd`/thentos/thentos-core
cd thentos
./misc/thentos-install.hs -p
cd ..
git clone https://github.com/liqd/aula
export AULA_ROOT_PATH=`pwd`/aula
cd aula
cabal sandbox init --sandbox=../thentos/.cabal-sandbox
Now, to have a quick look at the pages, do
cabal run aula-server
then point your browser to localhost:8080
[This section assumes you run without docker, but with
./docker/run.sh
you should be able to do the same thing in the
docker setting as well.]
To start sensei, in another terminal do
cabal install --enable-tests
make sensei
This will watch your files, and if anything changes, re-compile and run the test suite.
You can use seito (same git repo, different executable) to pull the last error report into your IDE to get pointed to the source code locations.
Background: sensei does not support multi-package development as such,
so we simply add the source files of all packages we want to use to
the source paths with a long list of -i
s. This way, any change in
any of thentos-*
or aula
will trigger a re-run.
Note: if compilation speed is an issue, you can modify thentos-install.hs, commenting out thentos-adhocracy and adding --disable-optimization (and --disable-library-profiling, if you have profiling on by default, but don't want to use prof stack traces for this project) to some of the runCabal invocations.
To create arbitrary (randomized) test content and browse it (mostly for work on HTML / css):
export AULA_SAMPLES=$HOME/aula-samples/
make click-dummies-recreate
make aula-server
To refresh the HTML from the same content (same texts and everything):
make click-dummies-refresh
The html pages are created in $AULA_SAMPLES/
, and can be browsed
under http://localhost:8080/samples/
. You can do two things now:
-
Edit the html pages directly. If you want to keep or diff your changes, you can initialize a local git repo (
cd $AULA_SAMPLES && git init
) and commit them there. -
Edit the source code in this repo under
src/Frontend/Page/*.hs
. If you do this,$AULA_SAMPLES/*.html
will be overwritten, so make sure that all valuable changes you make there are under git control and recorded apropriately.
You can combine the two work-flows and edit first the html, then record, then edit the Haskell source code and use git to diff the generated html again the html you tweaked manually.
Both aula-server
and click-dummies-refresh
go into a loop, so you
need two terminals. If you have two displays, you can move your
browser and the terminal with the refresh loop to one, and your source
code editor to the other. The browser will auto-refresh at any modification
and you will never have to focus there, no matter whether you
work on the haskell sources or on the html.