source: project/wiki/eggref/4/civet @ 29866

Last change on this file since 29866 was 29866, checked in by svnwiki, 8 years ago

Anonymous wiki edit for IP [216.241.35.41]: Updated docs for release 0.3.4.

File size: 27.2 KB
Line 
1== civet
2
3=== Description
4
5Civet is an XML-based templating system. It is intended primarily for
6generating dynamic web pages in XHTML, but may be useful for other XML
7applications.
8
9[[toc:]]
10
11=== Authors
12
13Matt Gushee <matt@gushee.net>
14
15=== Requirements
16
17[[utf8]], [[uri-common]], [[ssax]], [[sxpath]], [[sxml-serializer]]
18
19=== Introduction
20
21Civet was created as a templating engine for the soon-to-be-released '''Coq au
22Vin''' blogging library. The name comes from CVT, which is an abbreviation for
23'Coq au Vin Templates'.
24
25Civet supports insertion of dynamic content via variables, common control
26structures such as '''if''' and '''for''', and has a simple inheritance
27mechanism. It does not, and probably will never, support the inclusion of
28arbitrary code in Scheme or any other language.
29
30All Civet templates must be well-formed XML. Each template consists of
31markup from the target document type (e.g., XHTML), which represents literal
32output, combined with markup from the Civet template vocabulary, which
33inserts dynamic content and controls the structure of the output. For the
34sake of brevity, these two types of markup may be referred to as 'literal
35markup' and 'template markup' respectively.
36
37A '''template set''' consists of a '''base template''' and one or more
38'''extension templates'''. The base template determines the document type of
39the output and its overall structure. As of language version 0.2, the content
40of extension templates is restricted to metadata contained in a '''head'''
41element, and content contained in one or more '''blocks'''. Any content outside
42of these structures in an extension template will be ignored.
43
44Extension templates are used to specialize various aspects of the base
45template. They may also be chained so as to specialize other extension
46templates. Each extension template is associated with its '''parent''' (i.e.,
47the template that it extends) by means of the {{extends}} attribute on the
48document element.
49
50XML namespaces are used to distinguish the template vocabulary from literal
51content. For best results, we suggest that the default namespace be that of
52the target document type, while template vocabulary markup should use a
53prefix. The namespace URI for the template vocabulary is
54
55    {{http://xmlns.therebetygers.net/civet/<version_number>}}
56
57For best results, please ensure that all templates in your installation use
58the same prefix for this namespace. Here at Coq au Vin World Headquarters,
59we use the prefix {{cvt}}.
60
61
62=== Scheme API
63
64
65==== PROCEDURES
66
67<procedure>(render TEMPLATE CONTEXT #!key (PORT #f) (FILE #f))</procedure>
68
69This is the main function used to transform a template to some form of
70useful output (such as an XHTML web page). The TEMPLATE argument should be
71the filename of a template, including the extension but not including the
72directory path. CONTEXT is a context object (see {{make-context}} below for a
73description). There are two keyword arguments to specify an output
74destination: PORT is an output port, and FILE is a filename. If both are
75given, PORT takes precedence; if neither is given, the output will be
76returned as a string.
77
78<procedure>(process-template-set TEMPLATE CONTEXT)</procedure>
79
80This function is similar to {{render}}, but returns an SXML document rather
81than rendering to XML.
82
83<procedure>(process-base-template TEMPLATE BLOCK-DATA CONTEXT)</procedure>
84
85This function takes an SXML template, TEMPLATE, and an alist containing SXML
86blocks (which generally will have been read from extension templates, but
87could potentially be created programmatically), and a CONTEXT object, and
88returns a transformed SXML document. The BLOCK-DATA alist consists of
89`'((NAME . (LOCALE VARS MACROS BLOCK)) ...), where NAME corresponds to the
90name of a block in the source template, LOCALE, VARS, and MACROS are,
91respectively, locale options, variables, and macros read from the template,
92and BLOCK is an SXML fragment consisting of a {{cvt:block}} element and its
93content.
94
95<procedure>(load-template NAME #!optional (NSMAP '())</procedure>
96
97Loads a template from a file. {{NAME}} should be a filename including the
98extension but excluding the directory path. The optional NSMAP argument is
99an alist in the form {{'((PREFIX . NAMESPACE-URI) ...)}}, where {{PREFIX}}
100is a symbol (except in the case of a default namespace, in which case it
101should be {{#f}}. {{NSMAP}} overrides or extends the list of namespace
102bindings defined in {{*default-nsmap*}}.
103
104A value of {{#f}} for {{NSMAP}} will cause the template to be parsed with no
105namespace bindings.
106
107Note that when you load a template, a primitive form of caching is peformed
108behind the scenes. Specifically, whenever you load a new or modified
109template from XML, the resulting SXML document is saved to a file in the
110cache path ({{<site-path>/templates/.cache}} by default). On subsequent
111invocations of this procedure, if the cached SXML file exists and is newer,
112it will be loaded in place of the XML file. At present it is not possible to
113override this behavior.
114
115<procedure>(build-template-set NAME #!optional (NSMAP '())</procedure>
116
117Given the NAME of an template file and an optional {{NSMAP}}, this procedure
118loads that template and any ancestors it references, and returns two values,
119the base template and an alist (referred to elsewhere as {{BLOCK-DATA}}) of the
120blocks extracted from any extension templates in the set.
121
122<procedure>(make-context KWARGS)</procedure>
123
124Returns a context object: a closure that is used to maintain state
125information during the processing run. The following keywords are supported:
126
127* {{vars}}      alist, default = '()
128
129* {{attrs}}     alist, default = '()
130
131* {{nsmap}}     alist, default = (*default-nsmap*)
132
133* {{locale}}    alist, default = '()
134
135* {{blocks}}    alist, default = '()
136
137* {{macros}}    alist, default = '()
138
139* {{state}}     symbol, default = 'init
140
141Directly manipulating the context object is not recommended. In general you
142should use {{context->context}} (see below). However, should you need to get
143or set any values, the closure responds to the following messages:
144
145* {{(set-var! SYMBOL VALUE)}}
146
147* {{(update-vars! ALIST)}}
148 
149* {{(set-vars! ALIST)}}
150
151* {{(get-var SYMBOL)}}
152
153* {{(get-vars)}}
154
155* {{(get-field OBJ-NAME FIELD-NAME)}}
156
157* {{(pfx->uri NAMESPACE-PREFIX)}}
158
159* {{(uri->pfx NAMESPACE-URI)}}
160
161* {{(set-ns! PREFIX URI)}}
162
163* {{(update-nsmap! ALIST)}}
164
165* {{(set-nsmap! ALIST)}}
166
167* {{(get-nsmap)}}
168
169* {{(set-attrs! ALIST)}}
170
171* {{(set-attr! SYMBOL VALUE)}}
172
173* {{(get-attrs)}}
174
175* {{(delete-attrs!)}}
176
177* {{(set-block! SYMBOL SXML-FRAGMENT)}}
178
179* {{(get-block SYMBOL)}}
180
181* {{(get-blocks)}}
182
183* {{(set-macro! SYMBOL SXML-FRAGMENT)}}
184
185* {{(get-macro SYMBOL)}}
186
187* {{(get-macros)}}
188
189* {{(set-locale! ALIST)}}
190
191* {{(set-lang! LANG-CODE)}}
192
193* {{(set-country! COUNTRY-CODE)}}
194
195* {{(set-encoding! ENCODING-NAME)}}
196
197* {{(set-date-format! DATE-FORMAT)}}
198
199* {{(get-locale)}}
200
201* {{(set-state! SYMBOL)}}
202
203* {{(get-state)}}
204
205
206<procedure>(context->context CONTEXT KWARGS)</procedure>
207
208Returns a new context object based on the existing one, with all its data
209copied from the original except as modified by the KWARGS. The following
210keyword arguments are supported.
211
212* {{+vars}}    Updates or sets one or more variables. Takes an alist.
213
214* {{+attrs}}   Updates or sets one or more attributes. Takes an alist.
215
216* {{+nsmap}}   Updates or sets one or more namespace bindings. Takes an alist.
217
218* {{+locale}}  Updates or sets one or more locale options. Takes an alist.
219
220* {{+blocks}}  Updates or sets one or more template blocks. Takes an alist.
221
222* {{+macros}}  Updates or sets one or more template macros. Takes an alist.
223
224* {{-vars}}    Unsets one or more variables. Takes a list of symbols.
225
226* {{-attrs}}   Unsets one or more attributes. Takes a list of symbols.
227
228* {{-nsmap}}   Unsets one or more namespace bindings. Takes a list of symbols.
229
230* {{-locale}}  Unsets one or more locale options. Takes a list of symbols.
231
232* {{-blocks}}  Unsets one or more template blocks. Takes a list of symbols.
233
234* {{-macros}}  Unsets one or more template macros. Takes a list of symbols.
235
236* {{state}}    Sets the state. Takes a symbol.
237
238==== PARAMETERS
239
240<parameter>*site-path*</parameter>
241
242The root directory of your web site. The template path is automatically
243calculated from this path unless you set {{*template-path*}}. If the value
244of this parameter is {{#f}}, the processor assumes that the current working
245directory is the site path; likewise, if you set a relative path, that path
246is assumed to be relative to the current directory. Therefore it is a good
247idea to set this parameter to an absolute path.
248
249'''Default:''' {{#f}}
250
251<parameter>*template-path*</parameter>
252
253The directory where templates are stored. If the parameter is set to
254{{#f}}, the processor will look for templates in a {{templates}} subdirectory of
255the site path. Storing templates in subdirectories of the template path is
256not currently supported.
257
258'''Default:''' {{#f}}
259
260<parameter>*template-cache-path*</parameter>
261
262The directory where cached SXML templates are stored. If it is set to {{#f}},
263cached templates will be searched for in a {{.cache}} subdirectory of the
264template path.
265
266'''Default:''' {{#f}}
267
268<parameter>*enable-l10n*</parameter>
269
270Enable localization? Currently has no effect.
271
272'''Default:''' {{#f}}
273
274<parameter>*civet-ns-prefix*</parameter>
275
276A symbol representing the prefix to be used for Civet vocabulary elements.
277Do not override this unless you are actually using a different prefix in
278your templates.
279
280'''Default:''' {{'cvt}}
281
282<parameter>*civet-ns-uri*</parameter>
283
284The namespace URI for Civet vocabulary elements. Overriding this is not
285recommended.
286
287'''Default:''' {{"http://xmlns.therebetygers.net/civet/0.2"}}
288
289<parameter>*default-nsmap*</parameter>
290
291The default namespace map to be used when loading XML templates.
292
293'''Default:'''
294
295    `((#f . "http://www.w3.org/1999/xhtml")
296      (,(*civet-ns-prefix*) . ,(*civet-ns-uri*)))))
297
298<parameter>*sxpath-nsmap*</parameter>
299
300The default namespace map to be used for SXPath expressions and
301serialization.
302
303'''Default:'''
304
305    `((*default* . "http://www.w3.org/1999/xhtml")
306      (,(*civet-ns-prefix*) . ,(*civet-ns-uri*)))
307
308<parameter>*sort-functions*</parameter>
309
310A mapping from data type symbols to sorting functions to be used in {{for}}
311loops. For each "built-in" data type there are two functions specified: the
312first is used for ascending sorts, the second for descending.
313
314'''Default:'''
315
316    `((string . (,string<? ,string>?))
317      (char . (,char<? ,char>?))
318      (number . (,< ,>))
319      (boolean . (,(lambda (a b) (or (not a) b)) ,(lambda (a b) (or a (not b))))))
320
321
322=== Template Vocabulary, version 0.2
323
324The following describes the complete vocabulary of elements and attributes
325represented by the {{civet}} namespace. At present there is no formal
326specification or schema for the language, and this document may be regarded
327as a normative reference.  Please report any language in this document that
328you find ambiguous or insufficiently clear.
329
330Also, each element description includes a '''Contents''' subsection,
331describing what child nodes are required or allowed. However, for all
332elements, unless otherwise noted, markup from the target vocabulary is
333permitted within any element of the template vocabulary, and comments and
334processing instructions are unrestricted.
335
336NOTES:
337
338* This document uses the {{cvt:}} namespace prefix in all element
339  descriptions. Bear in mind that, as with all XML namespace prefixes, this
340  is merely a convention (and is the default prefix supported by the Scheme
341  library), and you may use a different prefix in your code and templates.
342
343* While all elements described are handled by the processor and should not
344  cause errors, some (e.g. locale) do not actually do anything.
345
346
347==== cvt:template
348
349This is the document element for an extension template. As of Version 0.2, a
350{{cvt:template}} element may only contain {{cvt:head}}, {{cvt:block}} elements. Any
351other content will be discarded by the processor.
352
353A base template does '''not''' use {{cvt:template}}; rather, its document element
354should be the document element required by the target document type, e.g. {{html}}.
355
356'''Context:'''
357
358Occurs only as the document element of an extension template.
359
360'''Content:'''
361
362May contain, in the following order:
363
364* {{cvt:head}} [optional]
365
366* {{cvt:block}} [zero or more]
367
368May not contain text nodes or any markup from the target vocabulary.
369
370'''Attributes:'''
371
372* {{extends}} [required] Contains a reference to the parent template,
373  expressed as a system file path.
374
375----
376
377==== cvt:head
378
379Contains elements that set variables and/or configure processing behavior.
380
381'''Context:'''
382
383First child of the document element of a template.
384
385'''Contents:'''
386
387May contain, in any order:
388
389* {{cvt:locale}} [optional]
390
391* {{cvt:defvar}} [zero or more]
392
393* {{cvt:defmacro}} [zero or more]
394
395
396----
397
398==== cvt:locale
399
400May be used to determine locale options within a template. Currently has no
401effect. I'm not sure if this element should be supported or not. Certainly,
402locale options are useful at the application level, but not necessarily
403within a template, so this element will probably be discontinued if it does
404not prove useful in the near future.
405
406'''Context:'''
407
408Within {{head}}.
409
410'''Content:'''
411
412Empty.
413
414'''Attributes:'''
415
416* {{lang}}
417
418* {{country}}
419
420* {{encoding}}
421
422* {{date-format}}
423
424
425----
426
427==== cvt:defvar
428
429Sets a variable's value within its local scope (i.e. for the template if
430contained in {{cvt:head}}, otherwise within the lexical scope of its parent
431element). The value may be specified either by a {{value}} attribute whose
432value is a literal string, or by the element content; if both are present,
433the attribute takes precedence.
434
435'''Context:'''
436
437Within a {{cvt:head}}, {{cvt:block}}, or {{cvt:with}}.
438
439'''Content:'''
440
441Any element other than {{cvt:template}}, {{cvt:head}}, or {{cvt:block}}
442
443'''Attributes:'''
444
445* {{name}} [required] The variable name to set.
446
447* {{type}} [optional, default=auto] The value may be any known datatype, where
448  ''known'' includes the built-in types and any types defined in the processing
449  application. A value of {{auto}} means that the type will be {{node-set}} if
450  this element contains any markup from the target vocabulary, otherwise
451  {{string}}.
452
453* {{value}} [optional] This attribute may be used instead of child nodes to
454  specify the value, if the value consists of a single text node.
455 
456
457----
458
459
460==== cvt:defmacro
461
462Defines a macro. A macro has a name and contains XML nodes which are
463evaluated in the lexical scope where a macro is referenced using the
464{{cvt:macro}} element. Thus the macro may contain arbitrary template
465markup including references to variables that are unbound at macro
466definition time. Please note that as of library version 0.3.4, there
467are certain template markup elements that will not work as you may
468expect in a macro. These include {{cvt:attr}}, {{cvt:else}}, and
469{{cvt:interpolate}}. These elements are handled outside the normal
470processing flow; therefore, if you use one of them as the ''child''
471of {{cvt:macro}}, there will be no result when the macro is evaluated.
472On the other hand, these elements ''should'' work as descendants of
473other elements within a macro definition, but this has not been
474systematically tested.
475
476'''Context:'''
477
478Within {{cvt:head}}.
479
480'''Content:'''
481
482Any element other than {{cvt:template}}, {{cvt:head}}, or {{cvt:block}}.
483
484'''Attributes:'''
485
486* {{name}} [required] The name of the macro. Must be unique within the
487  template.
488
489
490----
491
492==== cvt:block
493
494This element represents the basic unit of document structure, and may contain
495any type of content, or be empty. The order of blocks within the document (and
496of any interspersed content outside of blocks) is determined by the base
497template, and may not be altered by extension templates.
498
499Each block has a required {{name}} attribute. Following the usual practice, its
500value must be unique within any given document. Furthermore, any block ID
501used in an extension template must match one defined in the base template of
502the set.
503
504Nested blocks are not currently allowed, and will raise an error. Nesting
505may be supported in future versions if it is deemed a useful feature and can
506be implemented in a reasonable manner.
507
508The following rules govern the relationships of corresponding blocks (i.e.,
509those whose IDs match) among different templates in a set.
510
511* ''Defined with content in ancestor template, omitted in descendant:''
512
513Output includes the content defined in the ancestor template.
514
515* ''Defined as empty in ancestor template, omitted in descendant template:''
516
517No output.
518
519* ''Defined with content in ancestor template, defined as empty in descendant:''
520
521No output
522
523* ''Defined with content in ancestor template, and with different content in
524  descendant:''
525
526Content defined in the descendant template replaces that defined in the
527ancestor template.
528
529'''Attributes:'''
530
531* {{name}} [required] An arbitrary identifier that must be unique at document
532  level.
533
534
535----
536
537==== cvt:var
538
539A placeholder for inserting dynamic content. Variables are generally passed
540by the processing application, but may also be defined within the template
541(see {{cvt:defvar}}). There is no mechanism for assigning a new value to an
542existing variable, but names may be reused in local bindings (e.g. a block-
543level definition).
544
545'''Attributes:'''
546
547* {{name}} [required] The identifier for the variable; in order to insert
548  content, this value must be matched in the {{vars}} alist defined in the
549  processing application, or by a variable defined within the template. If
550  the name is a '''qualified name''', indicated with dotted notation, the
551  processor will retrieve the named field from the named object (i.e.:
552  <object>.<field>)
553
554* {{required}} [optional, default: true] Whether the variable is required to
555  be defined. Any required variable that is undefined is an error.
556
557* {{type}} [optional, default: string] A builtin or user-defined datatype.
558  The builtin types are:
559
560** {{string}}
561
562** {{boolean}}
563
564** {{char}}
565
566** {{number}}
567
568** {{integer}}
569
570** {{float}}
571
572** {{list:<type>}}
573
574** {{object}}
575
576** {{node-list}}
577
578* {{format}} [optional] The name of a formatting function defined in the
579  civet library or in your application. This function is usually
580  associated with a specific data type. As of version 0.3 of the library,
581  {{format="uri"}} will cause the output to be uri-encoded. Future versions
582  of the library will include additional options and provide a mechanism
583  for user-defined formatters.
584
585
586----
587
588==== cvt:macro
589
590References a macro defined with {{cvt:defmacro}}. All contents of the named
591macro will be evaluated in the lexical scope where this element is placed.
592
593'''Attributes:'''
594
595* {{name}} [required] The name of the macro.
596
597
598----
599
600==== cvt:if
601
602The basic conditional structure. If the test specified by the {{test}} attribute
603returns true, all content of the {{cvt:if}} element is written to the output;
604otherwise it is ommitted. May contain an optional {{cvt:else}} element.
605
606'''Context:'''
607
608May be contained within any element.
609
610'''Contents:'''
611
612Any element except {{cvt:template}} and {{cvt:block}}.
613
614'''Attributes:'''
615
616* {{test}} [required] A boolean expression. See {{Expression Language}} below.
617
618===== Expression Language:
619
620The {{test}} attribute uses a simple expression language, including the
621following expressions:
622
623<var-name>   Returns #t if the variable is defined in the current
624context, and is neither false nor null, false otherwise.
625
626<var-name> = <expr>   Returns #t if the variable value is equal
627(using equal?) to the right-side expression. The right-side expression may
628be a (quoted) string or numeric literal, or another variable name.
629
630<var-name> != <expr>   Returns #t if the variable value is
631unequal to the right-side expression.
632
633<function>(<var-name>, <expr>)   Performs a numeric
634comparison between the named variable and the right-side expression. Four
635functions are supported:
636
637* {{lt}}  Less than
638* {{gt}}  Greater than
639* {{le}}  Less than or equal to
640* {{ge}}  Greater than or equal to
641
642Whitespace is allowed but not required at the beginning and end of an
643expression, and between any two tokens.
644
645----
646
647==== cvt:else
648
649The content of this element is output if the {{cvt:if}} test fails.
650
651
652----
653
654==== cvt:for
655
656Iterate over a list variable.
657
658'''Attributes:'''
659
660* {{each}} [required] Defines the local variable name for each iteration.
661
662* {{in}} [required] Equivalent to the name attribute for {{var}} and {{block}}.
663
664* {{sort}} [optional, default=auto] The sorting method to use. May be 'alpha',
665  'numeric', 'auto', or 'none'. 'Auto' means that civet will select a sorting
666  method based on the datatype of the variable. This may degrade performance
667  and produce unexpected results, so it is best to specify the sorting method
668  whenever possible. Future versions of the library may allow user-defined
669  sorting functions.
670
671* {{sort-field}} [optional] If the variable refers to a list of objects, this
672  attribute specifies the field that should be used to sort the list.
673
674* {{order}} [optional, default=asc] Possible values are 'asc' (ascending) and
675  'desc' (descending).
676
677----
678
679==== cvt:interpolate
680
681Inserts text or markup between the iterations of a {{cvt:for}} loop. Any {{cvt:for}}
682element may have up to three {{cvt:interpolate}} children (with different {{mode}}
683attributes). The content of {{cvt:interpolate}}, when it appears (see the description
684of the {{mode}} attribute below, follows all content of the {{cvt:for}} loop.
685
686'''Context:'''
687
688Within a {{cvt:for}} element.
689
690'''Content:'''
691
692Text, or any element other than {{cvt:template}}, {{cvt:head}}, or {{cvt:block}}.
693
694'''Attributes:'''
695
696* {{mode}} [optional, default=default] Determines whether to insert the content,
697  depending on the state of the loop. The following values are recognized:
698
699** '''default:''' Insert this content on every iteration of the loop except the
700   last, unless overridden by another {{cvt:interpolate}} element with a different
701   mode.
702
703** '''last:''' Insert this content after the next-to-last iteration. Overrides
704   'default'.
705
706** '''pair:''' When the loop variable has exactly two elements, insert this content
707   between them. Overrides 'last' and 'default'.
708
709----
710
711==== cvt:with
712
713A container for variable definitions.
714
715'''Context:'''
716
717Anywhere in a base template, or anywhere within a block in an extension
718template.
719
720'''Content:'''
721
722Should contain one or more <defvar> elements [otherwise the {{cvt:with}}
723element serves no purpose], followed by any other elements (except {{cvt:block}}
724and {{cvt:template}}).
725
726'''Attributes:'''
727
728None.
729
730
731----
732
733==== cvt:attr
734
735Sets an attribute on its parent element. If the literal attribute is already
736defined on the parent, the value specified by this element overrides it.
737Otherwise, it adds a new attribute to the parent. The value may be specified
738by a variable reference specified by a {{var}} attribute, or by the element
739content. If both are present, the attribute takes precedence.
740
741NOTE: As of library version 0.3.4, the {{var}} attribute does not work. This will
742be fixed in the next release.
743
744'''Context:'''
745
746Any element from the target vocabulary.
747
748'''Content:'''
749
750Any combination of strings and template markup that evaluates to a single
751string.
752
753'''Attributes:'''
754
755* {{name}} [required]
756
757* {{type}} [optional, default: string]
758
759* {{var}}  [optional] References a variable to supply the value.
760
761
762==== Variable substitution in attributes
763
764In addition to the attributes defined above for template vocabulary
765elements, any unprefixed attribute from the target vocabulary may have the
766{{civet}} namespace prefix applied to it.  This indicates to the processor
767that the attribute's value is a variable reference; when encountering such
768an attribute, the processor will substitute the variable's value for the
769reference and remove the prefix.
770
771For example, if your application defines a variable {{page-classes}} with
772the value "single-article blog-post", the following code in a template:
773
774    <body cvt:class="page-classes">
775
776will produce the output:
777
778    <body class="single-article blog-post">
779
780Note that this method permits only the substitution of a primitive data type
781with an obvious string representation.  If you require any more complex
782manipulations, such as converting lists or objects to strings, or
783conditional processing, you must use the {{attr}} element.
784
785If an element has an attribute prefixed in this manner, and a {{cvt:attr}}
786element child, the {{cvt:attr}} element overrides the prefixed attribute.
787
788=== Examples
789
790There is a small but growing collection of example templates at:
791
792[[https://github.com/mgushee/civet/tree/master/examples]]
793
794=== Template Processors
795
796A civet processor must fulfill the following requirements:
797
798* It must support the entire template vocabulary as described in this
799  document.
800
801* If any templates in the input set are ill-formed or fail to conform to the
802  requirements of this document, processing must end with an error.
803
804* If template processing successfully completes, the output will be
805  well-formed XML, with all markup from the template vocabulary removed.
806
807Any failure with respect to meeting these requirements is a bug, and may be
808reported as such. Please note, however, that since the template language
809deliberately allows templates to include arbitrary fragments composed of
810markup from non-civet vocabularies, it is impossible to guarantee the
811validity of the output document with respect to any XML schema.
812
813=== In case of bugs
814
815If you have a GitHub account, please use the
816[[https://github.com/mgushee/civet/issues|GitHub issue tracker]] -- likewise
817for any technical questions or suggestions you may have (other than how-to
818type questions). If you are unable to do this, the chicken-users mailing
819list will also work.
820
821=== License
822
823Copyright (c) 2013, Matthew C. Gushee
824All rights reserved.
825
826Redistribution and use in source and binary forms, with or without
827modification, are permitted provided that the following conditions are met:
828
829
830    Redistributions of source code must retain the above copyright notice,
831    this list of conditions and the following disclaimer.
832
833    Redistributions in binary form must reproduce the above copyright
834    notice, this list of conditions and the following disclaimer in the
835    documentation and/or other materials provided with the distribution.
836   
837    Neither the name of the author nor the names of its contributors may be
838    used to endorse or promote products derived from this software without
839    specific prior written permission.
840
841THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
842AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
843IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
844ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
845LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
846CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
847SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
848INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
849CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
850ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
851POSSIBILITY OF SUCH DAMAGE.
852
853
854=== Repo
855
856[[https://github.com/mgushee/civet]]
857
858
859=== Version History
860
861;0.3.4:     Added version to utf8 dependency.
862
863;0.3.3:     Modified expression language to treat null values as false.
864
865;0.3.1:     Fixed meta file.
866
867;0.3.0:     Added interpolation in {{for}} loops, macros, and {{format="uri"}} for variable references.
868
869;0.2.1:     Edited docs & converted to svnwiki format.
870
871;0.2:       Fixed inconsistent nesting bug.
872
873;0.1.1:     Improved documentation.
874
875;0.1:       Initial release.
Note: See TracBrowser for help on using the repository browser.