To build this program, you will need a haskell distribution and the stack build tool. The easiest way to install all this is via ghcup system. Or you could install via the instructions at haskellstack
Once you have that, stack build
will build the programs.
You will need to watch the log to determine where stack puts the resulting executable,
since it will be down a long rabbit-hole.
The files in the static
subdirectory can be served directly,
without generation.
If you change the CSS or other templated static files, run
generate-static-exe -c CONFIG
to generate the appropriate CSS files.
To create a docker image, make sure that you have the static files up to date and then use
docker build . -t yourname/de-calixtinus:0.5
This builds the current source in a docker container and then creates a slimmed-down version for deployment.
The camino planner uses an icon font Camino-Icons.woff built from SVG icons in the fonts/svg directory. A FontForge project can be found in the fonts directory, which is used to generate the WOFF font.
The SVG icons use a template with guides for a standard 80% above/20% below the line font. However, it seems to be next to impossible to import the SVG in a way that doesn't produce overly small glyphs. The general procedure that works is:
- Select the appropriate glyph
- Name the glyph via the
Glyph Info ...
dialog - Open the outline via
New Outline Window
Import ...
the SVG, save and close- Select all new icons
- Use
Element > Transformations > Transform ...
with aScale Uniformly
of 150% - Use
Metrics > Auto-Width ...
with a separation of 10 to set widths - Use
Metrics > Set Both Bearings ...
with bearings of 5
Leaving the "action" icons, such as the globe and information symbol unscaled seems sensible.
No longer required
Using text-icu
seems to create constant headaches in terms of compilation and
installation and has been replaced by a simple system that canonicalises most
romance language accented letters.
This may be a bad choice, which is why the instructions are still here.
The text-icu
package allows canonicalisation of unicode characters.
This package depends on the icu4c library.
For macOS, you will need to have brew installed and install the library
and the pkg-config cask.
brew install pkg-config
brew install icu4c@73
See https://hackage.haskell.org/package/text-icu
If the underlying icu4c library changes version, you may need to unregister the library and rebuild, using
stack exec -- ghc-pkg unregister --force text-icu
stack build
The customised bootstrap is the basic Bootstrap 5.3 with some colour adjustments.
The background has been made "older-looking" and the blue changed to the
blue found on the Camino tiles.
To create the customised boostrap, you will need scss
, usually installed with npm
.
You will also need the bootstrap source in a separate directory.
After that, you can run the following in the project directory
sass ./scss/custom.scss ./static/css/bootstrap-dc.css
It appears that the yesod build will sometimes fail due to
problems parsing some UTF-8 encoded files.
This manifests as an error of the form
happy: src/Language/JavaScript/Parser/Grammar7.y: hGetContents: invalid argument (invalid byte sequence)
Ensure that the LANG
environment variable is set with a suitable encoding
export LANG=C.UTF-8
or export LANG=en_US.UTF-8
See https://stackoverflow.com/questions/70803989/cannot-compile-yesod-hgetcontents-invalid-argument