MindTouch Developer Center > DekiScript > Reference > Wiki Functions and Variables

DekiScript Developer Documentation

Home    Tutorials    Reference    Samples/FAQ


The following functions and variables are part of the Deki Wiki runtime environment and are only available within wiki pages.  Hence, these functions and variables cannot be accessed from by XML extensions.

Wiki Functions

All wiki functions generate embeddable content, such as the contents of another wiki page, search results, page hierachy, or localized text.

Function Description
Wiki.AnyPage Show the contents of a random page selected from the query's result set.
Wiki.Contributors Insert a list of top contributors on the site.
Wiki.Create Insert a link or button to create a new page.
Wiki.Directory Insert an alphabetical directory of the search results.
Wiki.Edit Insert a link or button to open the editor.
Wiki.GetPage Get page object at wiki page path.
Wiki.GetSearch Get list of found page and file objects.
Wiki.GetUser Get user object for user name or id.
Wiki.Languages Displays a page's versions written in other languages.
Wiki.Localize Retrieve a localized resource string. For more information on available resource names and the parameters that they take, please refer to the
Wiki.Page Include a wiki page.
Wiki.PageCount Insert the total number of pages that exist.
Wiki.PageExists Check if the given wiki page exists.
Wiki.Search Insert a list of search results.
Wiki.TagButton Insert button linking to all tagged pages. (IN PROGRESS)
Wiki.Template Insert dynamically a wiki template with parameters.
Wiki.Text Retrieve the text contents for an entire or part of another wiki page
Wiki.Toc Insert table of contents of a wiki page.
Wiki.Tree Insert a wiki page's subpage tree.
Wiki.Uri Retrieve the full uri of a given wiki page.
Wiki.UserCount Get number of wiki users.

Wiki Function Examples

Wiki Variables

Variables are used to access the current page object, user object, and site object.

Variable Type Description
Page map: page Access the current page object (Note: if page property is used inside a template, it refers to the nearest non-template page this is including the template).
Site map: site Access the site object.
User map: user Access the current user object.
__mode str One of "view", "edit", or "save".  Indicates during what operation the script is being executed.
__include bool Indicates if the page is being included into another page.

                  

Wiki Objects

Objects are like maps, but have a known structure.  Deki Wiki defines several objects corresponding to various items inside the wiki.

Comment Object

The comment object contains the text of the comment, the user ID, the home page of the user, and other information.

Field Type Description
Text str Text contents of the comment.
Mime str Mime type of the comment.
Date str Date in UTC format of the comment.
Author map: user User that wrote the comment.
Page map: page Page on which the comment is located on.

Object Examples

File Object

The file object contains the name of the file, the description of the file, the date when the file was attached, and other information.

Field Type Description
Description str Description of the file attachment.
Name str File name of the file attachment.
Size num Size in bytes of the file attachment.
Page map: page Page object to which the file is attached to.
Mime str Mime type of the file attachment.
Date str Date in UTC format when the file was attached.
Author user User who attached the file.
Api str API for operation on the file attachment.
Uri str URI to retrieve the file attachment.

Object Examples

Page Object

The page object contains the date the page was last modfied, the page ID, the attaches files, and other information.

Function Description
Api The API of the current page.
Author The users that created the current page name and information.
Comments The comments for the current page.
Date Date-time in GMT when the current page was last modified.
EditSummary Change summary associated with last edit operation.
Feed Retrieve the RSS/Atom feed uri of the page.
Files The files attached to the current page.
FrontUri URI to access front page of current page (regardless if current page is front page or not).
Id ID of the current page.
Language The language on the current page.
Mime The mime type of the current page.
Name Name of the current page.
Namespace Namespace of the current page.
Parent The parent of the current page.
Parents The hierarchical parents of the current page.
Path Path of the current page.
Subpages The subpages that stem from the current page.
Tags The tags attached to the current page.
TalkUri URI to access talk page of current page (regardless if current page is talk page or not).
Text Raw text contents of the page.
Title Title of the current page.
Toc Table of content for the current page.
UnprefixedPath Path of the page without namespace prefix.
Uri URI of the current page.
ViewCount View counter for the current page. (this replaces page.counter which is obsolete)
Xml The raw XML contents of the current page.

Object Examples

Site Object

The site object contains the host name of the site, the language of the site, and other information.

Function Description
Api Site API URI.
Feed Retrieve the RSS/Atom feed uri of the site.
HomePage The home page of the site.
HostName Site name.
Language Site
PageCount Number of pages on the site.
Uri Site URI.
UserCount Number of users on the site.

Object Examples

Tag Object

The tag object contains the name of the tag, the type of the tag, the list of tagged pages, and other information.

Field Type Description
Name str Full name with prefix of tag.
Prefix str Prefix of tag.
Value str Value of tag.
Type str Types of tags (one of "text", "date, ", "user", or "define").
Pages list: [ page ] List of tagged pages.
Definition map: page Tag's definition page object.

Object Examples

User Object

The user object contains the name of the user, the user ID, the home page of the user, and other information.

Function Description
Anonymous User object represents the anonymous user.
Api The uri of the current user.
Feed Retrieve the RSS/Atom feed uri for the user.
Gravatar The
HomePage The home page of the user.
Id ID of the current user.
Name Name of the current user.
Uri URI for user's page.

Object Examples

    

Tag page
You must login to post a comment.
Powered by MindTouch Deki v.8.08.1a