Hyde is a program for compiling static websites from a variety of input files. It is basically a Schemey clone of programs such as Webby and, particularly name-wise, Jekyll. Note that there is another project named Hyde which is similar in purpose but written in Python.

Hyde can be run through the hyde executable contained in this egg.

A website is, in Hyde's sense, a directory containing at least a hyde.scm file. This file is evaluated before any command and can be used to set parameters or define helper functions. It should also contain a directory of source files (unless the (source-dir) parameter points somewhere outside the current directory). Invoking the compilation process will recursively traverse (source-dir) and do one of the following things for each file it finds:

If the file's extension is unknown to Hyde, copy the file to the same relative path within (output-dir) unchanged.

If the file's extension is known to Hyde, translate its contents, possibly wrap the result in one or more layouts and write it to the same relative path within (output-dir), possibly changing its extension.

In the latter case, the translator used is determined by the source file's extension (see translators for a list of available translators). Before translation, the file is (read), i.e. the first s-expression in the file is read from it. This s-expression must be an alist (or a null list) holding arbitrary page-vars which are made available within the page's as well as the layouts' evaluation environment. This can be used to set a page title, for example. The rest of the file is considered the page's body and is left to be translated by the translator.

As you can see, Hyde created the source file and inserted the file name as a page-var called title, too (actually it's the other way around: the argument for hyde new is the title and Hyde transforms this into a suitable file name, i.e. it removes special chars and substitutes spaces with dashes). This is handy as the default layout uses this to fill the <title> tag in the resulting HTML document:

As we learn from that example, page-vars can be referred to through the $ function which is made available by Hyde in the environment which SXML (as well as SCSS and Atom) pages are evaluated in. Also note the inject transformation rule which allows injection of unescaped HTML into the document. Finally, the variable contents contains the translated page contents (see Available Bindings During Page Evaluation).

An alist which maps either (ir)regexps or procedures to page-vars. Each page has its page-source-path matched against the (ir)regexps or is passed to the procedure. If it matches or returns non-#f, the respective page-vars are appended to the page's local page-vars, i.e. local page-vars have precedence over them. Default: '()

Example:

The following default-page-vars would set the layouts page-var to ("page.sxml" "default.sxml") for all .sxml pages below pages and the page-vars tags to (awful) for all pages containing the word "cool":

Defines an environment name. The body expressions are only evaluated when hyde is executed with -e [name]. This is useful to set different parameters for different scenarios or deployment locations. If no -e option is set, the default environment is used. Just (define-hyde-environment default ...) to override it. See Available Commands for which commands respect environments.

Creates a procedure that reads from (current-input-port) and writes to the standard input of the program name linewise. Afterwards, its standard output is read back and written to (current-output-port), also linewise. It can be used to create page translators for external programs, e.g. the markdown translator included in Hyde is defined like this:

Returns the value of page-var (a symbol identifiying the page-var) or #f if no page-var of that name exists. By giving the optional page argument, refer to that page's page-vars instead of the current page's.

Returns the given page's contents, possibly wrapped in the given layouts. page may be either a page record or a path relative to (source-dir). This procedure is useful to create aggregate pages. Note that it will translate the contents of dynamic pages even if they have not been compiled, yet. In this case, they will neither be wrapped in page-specific nor the default layouts, only the ones given in layouts.

Add colorize support to svnwiki pages. Implement more powerful default-page-vars. Add make-external-translator (thanks to Christian Kellermann for the patch). Only recompile requested pages instead of the whole site with hyde serve.

0.9

Print usage for unknown commands (thanks to Christian Kellermann). Add current-page binding and make it the default argument for all page record field accessors.

Copyright (c) 2010, Moritz Heidkamp
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
Neither the name of the author nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.