where should be my css files?

34 views
Skip to first unread message

Alexander Danilov

unread,
Oct 23, 2013, 3:11:03 PM10/23/13
to clck...@googlegroups.com
Jeremy, is it normal for program to look for css files in
/home/alex/.cabal/share/i386-linux-ghc-7.6.3/clckwrks-theme-mysite-0.2.12/data/css/bootstrap.css ?

I am not sure, I understand the idea of theme packages.

If I build separate binary for the site, it will be reasonable try to find css/js/etc files in data/
directory of site, and if it doesn't exists, then return files compiled in site executable file.
Or, maybe, copy compiled in files into acid-state database at first start and later read from this
database only.

Web is not my job, so maybe I am wrong. Could you explain, please, how themes should work?

Jeremy Shaw

unread,
Oct 23, 2013, 4:13:47 PM10/23/13
to clck...@googlegroups.com
yes. That is normal. To answer your question we need to first look at
the big picture.

The long term goal of clckwrks is that a non-programmer should be able
to install the server and then configuring it entirely via the web
interface. There will be a store that allows them to install
additional plugins and themes with one-click.

The means, a fully dynamic clckwrks installation will require a
working GHC installation. To keep things sane, each server will likely
use cabal sandboxes to ensure that they don't stomp on each other by
trying to install different versions of the same plugins or theme
packages.

The file assets are listed in the themes .cabal file in the data-file
section. That is just where cabal decides to install them when you are
building as a user. They will be different places depending on whether
you build with --user, --global, --datadir, etc. Keep in mind that
themes are not just css -- they also include Haskell code.

A theme library uses the autogenerated getDataDir function to find
where those files ended up.

Since you might have multiple themes installed (though only one active
in an application at a time) those assets need to live in different
locations.

Now, it is also sensible that you might not want to support on-the-fly
installation of plugins and themes. instead you want to build a static
server, and then deploy it on the server.

Right now that is a bit tricky because the css and javascript files
for theme are only install if the theme has been cabal installed on
the system.

Some how you need to get the executable, plus those other assets on
the server, and they need to know how to find each other.

Personally, I have all my servers debianized -- and the packaging that
builds the theme libraries installs the css files in a separate
libghc-clckwrks-theme-foo-utils package that I can install on the
server.

You can alter the default location for the datafiles when building a
theme by specifying the --datadir flag to cabal configure. You can
also alter that location at runtime by setting an environment
variable. For example,
clckwrks_theme_clckwrks_datadir=/some/other/location. The name of the
env variable is dependent on the name of the theme package.

Anyway, I am not entirely clear on your particular problem, but it
sounds like you think it is odd that you would need to install the
theme library on the server just to run the executable?

- jeremy
> --
> http:/www.clckwrks.com/
> --- You received this message because you are subscribed to the Google
> Groups "clckwrks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clckwrks+u...@googlegroups.com.
> To post to this group, send email to clck...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clckwrks/52681F47.1020607%40gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Alexander Danilov

unread,
Oct 23, 2013, 4:27:23 PM10/23/13
to clck...@googlegroups.com
The idea is clean now, thank you.

> Anyway, I am not entirely clear on your particular problem, but it
> sounds like you think it is odd that you would need to install the
> theme library on the server just to run the executable?
>

Not exactly like this. I just didn't understand why theme files in one place, server in other place
and site somewhere else. Now I understand your idea.

One more question - how do you build debian packages from cabal files?
Reply all
Reply to author
Forward
0 new messages