]> gitweb.factorcode.org Git - factor.git/blob - basis/furnace/boilerplate/boilerplate-docs.factor
c5c9a01a12165ae50e453b1db35ee5d64b9ba71b
[factor.git] / basis / furnace / boilerplate / boilerplate-docs.factor
1 USING: help.markup help.syntax io.streams.string
2 http.server.dispatchers ;
3 IN: furnace.boilerplate
4
5 HELP: <boilerplate>
6 { $values
7      { "responder" "a responder" }
8      { "boilerplate" "a new boilerplate responder" }
9 }
10 { $description "Wraps a responder in a boilerplate responder. The boilerplate responder needs to be configured before use; see " { $link "furnace.boilerplate.config" } "." } ;
11
12 HELP: boilerplate
13 { $class-description "The class of boilerplate responders. Slots are documented in " { $link "furnace.boilerplate.config" } "." } ;
14
15 ARTICLE: "furnace.boilerplate.config" "Boilerplate configuration"
16 "The " { $link boilerplate } " tuple has two slots which can be set:"
17 { $table
18     { { $slot "template" } { "A pair with shape " { $snippet "{ responder name }" } ", where " { $snippet "responder" } " is a responder class, usually a subclass of " { $link dispatcher } ", and " { $snippet "name" } " is the name of a template file, without the " { $snippet ".xml" } " extension, relative to the directory containing the responder's vocabulary source file." } }
19     { { $slot "init" } { "A quotation run before the boilerplate template is rendered. This quotation can set values which the template can then display." } }
20 } ;
21
22 ARTICLE: "furnace.boilerplate.example" "Boilerplate example"
23 "The " { $vocab-link "webapps.wiki" } " vocabulary uses boilerplate to add a footer and sidebar to every page. Since the footer and sidebar are themselves dynamic content, it sets the " { $slot "init" } " quotation as well as the " { $slot "template" } " slot:"
24 { $code "<boilerplate>"
25 "    [ init-sidebars init-relative-link-prefix ] >>init"
26 "    { wiki \"wiki-common\" } >>template" } ;
27
28 ARTICLE: "furnace.boilerplate" "Furnace boilerplate support"
29 "The " { $vocab-link "furnace.boilerplate" } " vocabulary implements a facility for sharing a common header and footer between different pages on a web site. It builds on top of " { $link "html.templates.boilerplate" } "."
30 { $subsections
31     <boilerplate>
32     "furnace.boilerplate.config"
33     "furnace.boilerplate.example"
34 }
35 { $see-also "html.templates.chloe.tags.boilerplate" } ;
36
37 ABOUT: "furnace.boilerplate"