From 99a3b3c9f61a13ad3b514b883836a5f8b53063d2 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 18:17:21 -0700 Subject: [PATCH] furnace: documentation improvements --- basis/furnace/actions/actions-docs.factor | 2 +- basis/html/components/components-docs.factor | 2 +- basis/html/components/components.factor | 9 ++++++++- basis/html/templates/chloe/chloe-docs.factor | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/basis/furnace/actions/actions-docs.factor b/basis/furnace/actions/actions-docs.factor index a49d6d54b3..862bdead72 100644 --- a/basis/furnace/actions/actions-docs.factor +++ b/basis/furnace/actions/actions-docs.factor @@ -31,7 +31,7 @@ HELP: new-action { $description "Constructs a subclass of " { $link action } "." } ; HELP: page-action -{ $class-description "The class of Chloe page actions. These are actions whose " { $slot "display" } " slot is pre-set to serve the Chloe template stored in the " { $slot "page" } " slot." } ; +{ $class-description "The class of Chloe page actions. These are actions whose " { $slot "display" } " slot is pre-set to serve the Chloe template stored in the " { $slot "template" } " slot. The " { $slot "template" } " slot contains a pair with shape " { $snippet "{ responder name }" } "." } ; HELP: validate-integer-id { $description "A utility word which validates an integer parameter named " { $snippet "id" } "." } diff --git a/basis/html/components/components-docs.factor b/basis/html/components/components-docs.factor index c35237b403..3b4f1d6ae3 100644 --- a/basis/html/components/components-docs.factor +++ b/basis/html/components/components-docs.factor @@ -29,7 +29,7 @@ HELP: textarea { $class-description "Text area components display a multi-line editor for a string value. The " { $slot "rows" } " and " { $slot "cols" } " properties determine the size of the text area." } ; HELP: link -{ $description "Link components render a link to an object stored at a value, with the link title and URL determined by the " { $link link-title } " and " { $link link-href } " generic words. The optional " { $slot "target" } " slot is a target frame to open the link in." } ; +{ $description "Link components render a value responding to the " { $link link-title } " and " { $link link-href } " generic words. The optional " { $slot "target" } " slot is a target frame to open the link in." } ; HELP: link-title { $values { "obj" object } { "string" string } } diff --git a/basis/html/components/components.factor b/basis/html/components/components.factor index 9dddb85619..5a2a55bfd0 100644 --- a/basis/html/components/components.factor +++ b/basis/html/components/components.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2008, 2009 Slava Pestov, Daniel Ehrenberg +! Copyright (C) 2008, 2010 Slava Pestov, Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. USING: accessors kernel namespaces io math.parser assocs classes classes.tuple words arrays sequences splitting mirrors @@ -117,6 +117,13 @@ M: string link-href ; M: url link-title ; M: url link-href ; +TUPLE: simple-link title href ; + +C: simple-link + +M: simple-link link-title title>> ; +M: simple-link link-href href>> ; + TUPLE: link target ; M: link render* diff --git a/basis/html/templates/chloe/chloe-docs.factor b/basis/html/templates/chloe/chloe-docs.factor index 41653cb85a..a3032aba96 100644 --- a/basis/html/templates/chloe/chloe-docs.factor +++ b/basis/html/templates/chloe/chloe-docs.factor @@ -60,7 +60,7 @@ HELP: compile-with-scope { $description "Calls the quotation and wraps any output it compiles in a " { $link with-scope } " form." } ; ARTICLE: "html.templates.chloe.tags.component" "Component Chloe tags" -"The following Chloe tags correspond exactly to " { $link "html.components" } ". Singleton component tags do not allow any attributes. Attributes of tuple component tags are mapped to tuple slot values of the component instance." +"The following Chloe tags correspond exactly to " { $link "html.components" } ". The " { $snippet "name" } " attribute should be the name of a form value (see " { $link "html.forms.values" } "). Singleton component tags do not allow any other attributes. Tuple component tags map all other attributes to tuple slot values of the component instance." { $table { "Tag" "Component class" } { { $snippet "t:checkbox" } { $link checkbox } }