SubscribeMainXMLTagsEditHistoryDiscussion

Introduction

This page describes Chicken wiki-specific extensions to svnwiki, that allow you to enter code examples and add markup to point out procedures and macros.

Tags for procedure-like definitions

The following tags are supported:

Each of these should be used as follows:

<procedure>(string-append a b ...)</procedure>

This will be rendered as follows (with some divs and spans for easy CSSing):

[procedure] (string-append a b ...)

Tags for other definitions

The following tags are also supported:

They should be used as follows:

<string>doctype:xhtml-1.0-strict</string>

They will be rendered as follows:

[string] doctype:xhtml-1.0-strict

Tags for examples

If you want to include examples, use the following code:

 <example>
 <expr>(string-append "foo" "bar")</expr>
 <result>"foobar"</result>
 </example>
 

If your example has more than one line, just put them within one <expr> tag. Do not put empty lines in an <examples><example> tag. You can put empty lines within <expr>, though.

If the example shows some interaction, use this:

 <example>
 <expr>(prompt-for-number-and-show-factorial)</expr>
 <output>Enter a number:</output>
 <input>4</input>
 <output>24</output>
 <result>24</result>
 </example>
 

If the result of the evaluation is not specified, omit the <result> part.

If the example requires some set up to take place before the actual code, please add an <init> section:

 <example>
 <init>(use format-modular)</init>
 <expr>(format #t "Objs: ~A~%" 24)</expr>
 <output>Objs: 24
 </output>
 </example>
 

The code in the <init> section will probably not be shown to the users unless the explicitly ask for it (ie. will be hidden with JavaScript, or shown with less emphasis than the actual code).

We expect to automatically build a page including all the examples in the wiki, indicating whether or not they pass.

Last update: 2008-12-26 (Rev 12880)

svnwiki $Rev: 14844 $