Show Changes Show Changes
Print Print
Recent Changes Recent Changes
Subscriptions Subscriptions
Lost and Found Lost and Found
Find References Find References
Rename Rename
Administration Page Administration Page
Search

History

9/12/2007 3:32:07 PM
-10.10.192.22
8/19/2007 4:39:21 PM
-66.78.124.101
8/19/2007 4:38:46 PM
-66.78.124.101
8/19/2007 4:38:14 PM
-66.78.124.101
8/19/2007 4:36:17 PM
-66.78.124.101
List all versions List all versions

RSS feed for the TestJwd namespace

Wiki Talk Language Overview
.
Summary
See_also
WikiTalk source code is surrounded by @@ characters on both sides of the expression. Example:
 ||The WikiTalk topic summary is: @@topics.WikiTalk.Summary@@||

Would generate this text:

The WikiTalk topic summary is: WikiTalk is a language for including dynamic content in FlexWiki topics.

The language

Object oriented

WikiTalk is object oriented. All data types are objects (strings, integers, booleans, Topics, Federations, etc.)

Logic

If/Then constructs are accomplished through methods on "Boolean":/default.aspx/TestJwd/InstructionCard.html?type=Boolean objects.

 @@"Monday".Equals(DateTime.Now.DayOfWeek).IfTrue {"''Mondays stink''"} IfFalse {"''Most of the week is good''"}@@

Output: Most of the week is good

The IfTrue/IfFalse construct actually maps to the IfTrueIfFalse method on the "Boolean":/default.aspx/TestJwd/InstructionCard.html?type=Boolean object. The previous example is normally written:

 @@"Monday".Equals(DateTime.Now.DayOfWeek).IfTrueIfFalse( {"''Mondays stink''"}, {"''Most of the week is good''"} ) @@

Output: Most of the week is good

Looping

Looping is accomplished through "Block":/default.aspx/TestJwd/InstructionCard.html?type=Blocks which are chunks of WikiTalk code surrounded by {}. The syntax of a block is {parameters... | value}. In the following example, the variable named theparameter is used to loop through elements in an array created by ["Array element1 ", "Array element2 "] :

 @@{theparameter | ["Array element1", "Array element2"]}.Value{each | each.Value}@@

Output: Array element1Array element2

Objection
It is not true! The code above is not looping at all (looping is through Collect, WhileFalse and WhileTrue) and the variable named theparameter is not used at all in the computation. See next examples. -- Herby
 @@{theparameter | ["Array element1", "Array element2"]}.Value{what, ever | "whatever, it does not matter"}@@

Output: Array element1Array element2

 @@{theparameter | ["Array element1", "Array element2"]}.Value(0)@@

Output: Array element1Array element2

Explanation
The result is always the same, because the result of Value is the result of the block, which is the WikiTalkExpression in the block (precisly, last expression in the WikiTalkExpressionChain, but in this block there is only one WikiTalkExpression), in this case the array ["Array element1", "Array element2"]. FlexWiki outputs arrays by putting string representations of their elements one after another. -- Herby

For more information on looping, see WikiTalkLoopingDemo

Functions

WikiTalk supports functions. Functions are WikiTalk Blocks (see reference in "Looping" above) which have one or more FlexWikiParameters. Functions are named by putting them in a topic's property. This is an example of a function named Hithere:

:Hithere:{ firstname, lastname |
        [ "Hi there ", firstname, lastname, "!   You got to this page on ", DateTime.Now ]
}

Note that the property name Hithere begins with a colon. This tells FlexWiki that the WikiPageProperty named Hithere is hidden. For a more advanced discussion on the usage of functions, see WikiTalkFunction.

The function is called within the topic page by using the function name and passing the parameters in parens. For example

 @@Hithere("Tim ", "Smith")@@

would output:

Hi there Tim Smith! You got to this page on 10/10/2008 1:16:52 PM

To call a function in another topic, use the With property which brings the other topic's properties into scope. This example puts InstructionCard in this topic's scope and then calls the LinkToInstructionCard function.

 With: InstructionCard
 This is a link to documentation on @@LinkToInstructionCard("Boolean")@@

Another way to call a function defined in another topic is to directly access the topic through the topics array. For example:

 @@topics.WikITalkLanguage1Overview.Hithere("Tim ", "Smith")@@

would output:

TestJwd.WikiTalkLanguageOverview(1:8) : No such property or function: FlexWiki.DynamicNamespace.WikITalkLanguage1Overview

Note that in this example, WikITalkLanguage1Overview is the topic name that contains the HiThere function. topics.WikITalkLanguageOverview is returning a DynamicTopic which gives you access to the functions defined in the topic.

Not logged in. Log in

The wiki for all things Objective Design Solutions

This is FlexWiki, an open source wiki engine.

This site supports the new NoFollow anti-spam initiative.
Change Style

Recent Topics