1 ******************************************** 2 * 3 * Clearsilver INSTALL 4 * 5 * http://www.clearsilver.net 6 * 7 * Brandon Long, David Jeske 8 * 9 ******************************************** 10 11 1) Compile ------------------------------------------------ 12 13 Simplest case: 14 15 # ./configure 16 # make 17 18 Options to configure: 19 --disable-compression Disables HTML Compression support 20 --enable-remote-debugger Enables remote X CGI debugging 21 --disable-apache Disables building of apache 1.3.x module 22 --with-apache=path Set location of Apache installation 23 --disable-python Disables building of python module 24 --with-python=path Set location of Python Includes 25 --disable-perl Disables building of perl module 26 --with-perl=path Set location of Perl binary 27 --disable-ruby Disables building of ruby module 28 --with-ruby=path Set location of Ruby binary 29 --disable-java Disables building of java module 30 --with-java=path Set location of J2SDK 31 --disable-csharp Disables building of csharp module 32 --with-csharp=path Set location of csharp 33 --enable-gettext Enable gettext message translation 34 35 --disable-compression: Currently, the CGI output code in the cgi 36 kit automatically attempts to detect whether the remote browser can 37 handle compressed data, and if it does, compresses the output for 38 text/html. This is run-time configurable via Config.CompressionEnabled. 39 Disabling it at compile time eliminates the dependency on libz. 40 41 --enable-remote-debugger: The CGI kit contains code for remotely 42 debuggin CGI programs by launching an X based debugger (such as xxgdb or 43 ddd) at the X display you specify in the HTTP request. There are 44 controls such as a configurable list of allowed displays, but remote 45 debugging is disabled by default. 46 47 --enable-gettext: Enables gettext message translation. Once enabled 48 you have a new builtin function "_(<message>)". This function calls the 49 function gettext (man 3 gettext). 50 51 The rest of the --disable/--with either disable a specific module, or 52 point ClearSilver at the right program to enable it. The configure 53 script will simple not build any module it can't find the right versions 54 of programs to build against. Alternatively, if you are making 55 ClearSilver part of your build environment, you can simple delete 56 whichever module directory you don't want, and the build will ignore it. 57 58 For information about compiling on Windows under MingW and MSYS, see 59 python/README.txt 60 61 The csharp wrapper was built with Mono (www.go-mono.com) and should work 62 with v0.24 and later (give or take). In theory, it should be fairly 63 simple to get this working on MS.Net as well. 64 65 2) Install ------------------------------------------------ 66 67 # make install 68 69 The make install is relatively new, and just installs the 70 libraries/header files (and probably the perl and python modules, but 71 that's a guess) 72 73 3) Example 1, Apache static.cgi ---------------------------------- 74 75 "static.cgi" is a simple binary which will allow you to write static 76 HDF files, static ClearSilver templates, and render them. This is a 77 good way to get started and learn the clearsilver model and 78 syntax. Follow the steps below to install static.cgi into your Apache 79 configuration and then read the documentation while playing with 80 static files. 81 82 http://www.clearsilver.net/docs/man_hdf.hdf 83 84 Add the following to your Apache configuration and copy the 85 Clearsilver static.cgi binary from cgi/static.cgi into your Apache 86 cgi-bin directory. 87 88 AddHandler cgi-script .cgi 89 Action cs-handler /cgi-bin/static.cgi 90 AddHandler cs-handler .cs 91 92 Since any html file is a valid CS file, I also run with: 93 94 AddHandler cs-handler .html 95 96 * About static.cgi: 97 98 static.cgi works by assuming that whatever file it was pointed at is a 99 CS template. It first tries to load common.hdf in the same directory, 100 then it tries to load some other hdf files, and then it parses and 101 displays the template file. 102 103 Ie, if its pointed at foo.cs, it will load common.hdf, try to load 104 foo.cs.hdf, if that fails, it tries foo.hdf. If the hdf defines 105 CGI.StaticContent, it will assume that's the real template file (which 106 is how we use it on www.clearsilver.net, we just point at he .hdf files, 107 which define StaticContent as a wrapper.cs, which includes another file 108 defined in the .hdf file). 109 110 4) Example 2, imd image server ------------------------------------ 111 112 "imd" is a simple image server written with C and clearsilver. The imd 113 directory has a README on how to set up imd with Apache. 114 115 5) Example 3, using with Python ----------------------------------- 116 117 The clearsilver python wrapper comes with CSPage.py. This file 118 contains the CSPage superclass, and this file gives some pointers on 119 how to use the cs handler via python. A much more thorough example 120 is Scott Hassan's image_server, available from 121 122 http://www.dotfunk.com/projects/image_server 123 124 125