Difference between revisions of "Dungeons and Dragons Wiki:Ask Syntax"
m (This has been bugging me, so having a quick reference page would help.) |
(Minimal documentation up for {{ask:}}) |
||
Line 1: | Line 1: | ||
− | == | + | <small>Main documentation for Semantic Mediawiki can be found at [http://semantic-mediawiki.org/wiki/Semantic_MediaWiki] |
+ | |||
+ | == Setting Properties == | ||
To set a property without showing the text on the page, use the format '''<nowiki>{{#set:Property=Value goes here}}</nowiki>'''. | To set a property without showing the text on the page, use the format '''<nowiki>{{#set:Property=Value goes here}}</nowiki>'''. | ||
To set a property and show the text on the page, use the format '''<nowiki>[[Property::Value goes here]]</nowiki>'''. | To set a property and show the text on the page, use the format '''<nowiki>[[Property::Value goes here]]</nowiki>'''. | ||
+ | |||
+ | To set multiple properties (mostly used at the beginning of classes), use the following format: | ||
+ | |||
+ | <pre><nowiki>{{set:Property1=Value goes here | ||
+ | |Property2=Value of Property 2 | ||
+ | |... | ||
+ | |PropertyN=Value of last property. | ||
+ | }}</nowiki></pre> | ||
+ | |||
+ | == Ask Function == | ||
+ | |||
+ | Semantic Mediawiki gives the parser function '''<nowiki>{{ask:<query>[[|param=value[...|param=value]]}}</nowiki>'''. | ||
+ | |||
+ | === Query === | ||
+ | |||
+ | The query should be the first value you send. It can either be <nowiki>[[Category:categoryName]] or [[Property::value]]</nowiki>. For example, to choose all user fighter feats in 3.5e, the query would be <nowiki>[[Category:3.5e]] [[Category:Feat]] [[Type::Fighter]]</nowiki> | ||
+ | |||
+ | === Other parameters === | ||
+ | |||
+ | The following is a table of parameters this parser function accepts. | ||
+ | |||
+ | {| class="d20 zebra" style="text-align:left;" | ||
+ | ! Parameter | ||
+ | ! Possible values | ||
+ | ! Description | ||
+ | |- | ||
+ | | <tt>format</tt> | ||
+ | | a format name (see below) | ||
+ | | selected output format; some formats allow further parameters (see [[#Result formats]]) | ||
+ | |- | ||
+ | | <tt>limit</tt> | ||
+ | | non-negative number | ||
+ | | maximal number of pages selected (in the case of a table: rows) | ||
+ | |- | ||
+ | | <tt>offset</tt> | ||
+ | | number | ||
+ | | where to start | ||
+ | |- | ||
+ | | <tt>sort</tt> | ||
+ | | property name or a list of property names separated by , | ||
+ | | name of properties to use for sorting queries (see [[Help:Selecting pages]]) | ||
+ | |- | ||
+ | | <tt>order</tt> | ||
+ | | <tt>ascending</tt>/<tt>asc</tt>, <tt>descending</tt>/<tt>desc</tt>/<tt>reverse</tt>,<br />or a list of those if more than one property is used for sorting | ||
+ | | defines how results should be ordered, only applicable if <tt>sort</tt> is used, <tt>ascending</tt> is the default (see [[Help:Selecting pages]]) | ||
+ | |- | ||
+ | | <tt>headers</tt> | ||
+ | | <tt>show</tt>, <tt>hide</tt> | ||
+ | | shows or hides the labels/headers used in some output formats such as «table», <tt>show</tt> is default | ||
+ | |- | ||
+ | | <tt>mainlabel</tt> | ||
+ | | plain text | ||
+ | | title of the first column (the one with the page titles in it), default is no title; set to <tt>-</tt> to suppress printing the page titles | ||
+ | |- | ||
+ | | <tt>link</tt> | ||
+ | | <tt>none</tt>, <tt>subject</tt>, <tt>all</tt> | ||
+ | | defines which article names in the result are hyperlinked, <tt>all</tt> normally is the default | ||
+ | |||
+ | Note: linking can also be controlled for individual printouts using the ''plain output format'' as described in [[Help:Displaying_information#Display_format|Displaying information]]. | ||
+ | |- | ||
+ | | <tt>default</tt> | ||
+ | | plain text | ||
+ | | if, for any reason, the query returns no results, this will be printed instead | ||
+ | |- | ||
+ | | <tt>intro</tt> | ||
+ | | plain text | ||
+ | | initial text that prepends the output, if at least some results exist | ||
+ | |- | ||
+ | | <tt>outro</tt> | ||
+ | | plain text | ||
+ | | text that is appended to the output, if at least some results exist | ||
+ | |- | ||
+ | | <tt>searchlabel</tt> | ||
+ | | plain text | ||
+ | | text for continuing the search (default is «… further results») | ||
+ | |} | ||
+ | |||
+ | For the format, use one of list, table, ul, or ol. | ||
+ | |||
+ | ;list:Comma separated list | ||
+ | ;table:Table | ||
+ | ;ul:Unordered list | ||
+ | ;ol:Ordered list |
Revision as of 04:27, 15 January 2011
Main documentation for Semantic Mediawiki can be found at [1]
Setting Properties
To set a property without showing the text on the page, use the format {{#set:Property=Value goes here}}.
To set a property and show the text on the page, use the format [[Property::Value goes here]].
To set multiple properties (mostly used at the beginning of classes), use the following format:
{{set:Property1=Value goes here |Property2=Value of Property 2 |... |PropertyN=Value of last property. }}
Ask Function
Semantic Mediawiki gives the parser function {{ask:<query>[[|param=value[...|param=value]]}}.
Query
The query should be the first value you send. It can either be [[Category:categoryName]] or [[Property::value]]. For example, to choose all user fighter feats in 3.5e, the query would be [[Category:3.5e]] [[Category:Feat]] [[Type::Fighter]]
Other parameters
The following is a table of parameters this parser function accepts.
Parameter | Possible values | Description |
---|---|---|
format | a format name (see below) | selected output format; some formats allow further parameters (see #Result formats) |
limit | non-negative number | maximal number of pages selected (in the case of a table: rows) |
offset | number | where to start |
sort | property name or a list of property names separated by , | name of properties to use for sorting queries (see Help:Selecting pages) |
order | ascending/asc, descending/desc/reverse, or a list of those if more than one property is used for sorting |
defines how results should be ordered, only applicable if sort is used, ascending is the default (see Help:Selecting pages) |
headers | show, hide | shows or hides the labels/headers used in some output formats such as «table», show is default |
mainlabel | plain text | title of the first column (the one with the page titles in it), default is no title; set to - to suppress printing the page titles |
link | none, subject, all | defines which article names in the result are hyperlinked, all normally is the default
Note: linking can also be controlled for individual printouts using the plain output format as described in Displaying information. |
default | plain text | if, for any reason, the query returns no results, this will be printed instead |
intro | plain text | initial text that prepends the output, if at least some results exist |
outro | plain text | text that is appended to the output, if at least some results exist |
searchlabel | plain text | text for continuing the search (default is «… further results») |
For the format, use one of list, table, ul, or ol.
- list
- Comma separated list
- table
- Table
- ul
- Unordered list
- ol
- Ordered list