Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
Page Rendering ProcessOverview of how TWiki works To achieve a goal in TWiki either by making use of existing features or implementing new features, good understanding of how TWiki works is crucial. That said, this topic explains how TWiki processes various TWiki operations - view, edit, save, attach, upload, etc.
On this page:
BasicsHere's the basic steps of the page rendering by TWiki.
Preferences variables are readPreferences variables are defined at an early stage of TWiki processing. After this step, no preferences variables are set.
Please note that topics INCLUDE'd by the current topic are not read for preferences variables.
Template is read and expanded
As mentioned above, TWikiTemplates describes how a template is selected and read.
It's worth mentioning that template expansion happens before variable expansion.
At the end of step, all template directives are resolved,
hence there aren't any
Variable expansionVariables may be nested - a variable may be a parameter of another variable and there is no limitation of nesting level. If variables are nested, they are processed from the inner-most to the outer-most. A topic may have any number of variables. Variables at the same nesting level are processed from top to bottom. You can see it from the example below. Raw text: %SET{"foo" value="abc"}% %GET{"foo"}% %SET{"foo" value="def"}% %GET{"foo"}% Result:
TWiki markup to HTMLAt this point, all variables are expanded. Markup described on TextFormattingRules are converted into HTML You may want to suppress this step to see the result of variable expansion not converted into HTML. You can do that by supplying raw=expandvariables URL parameter to a view URL: e.g. https://twikinew.ihep.ac.cn/twikipublic/view/Main/?raw=expandvariables
PluginsSo far, how plugins are involved with page rendering hasn't been discused. Here's how.
In many cases, plugins introduce predefined variables such as Some plugins extend TWiki markup. For example, the table notation in TWiki (an example shown below) is provided by the TablePlugin. Though the table notation is regarded as an integral part of TWiki markup, it is implemented by a plugin rather than the TWiki core. | One One | One Two | One Three | | ^ | Two Two | Two Three | | Three One | ^ | Three Three |
There are various places in the TWiki core where functions provided by plugins are called.
For example, TablePlugin has a function named
As you can imagine, if a plugin has
A plugin may have
SpreadSheetPlugin has
In addition to
Related Topics: DeveloperDocumentationCategory, TWikiTemplates, TWikiVariables, TextFormattingRules |