Help:Generating documentation

From semantic-mediawiki.org
Generating documentation
Generate parameter documentation for a result format
Further Information
Provided by: Semantic MediaWiki
Minimum version: 1.6.0
Maximum version: still supported
Function: yes
Tag: no
Name: #smwdoc
Table of Contents

The parser function #smwdoc allows for automatic parameter documentation generation for all Result formats.

This documentation also applies to the #mapsdoc parser function which may be used analogous.

Syntax

{{#smwdoc:<format name> |parameters=<criterion> |language=<languagecode> }}
Available options and codes for parameters
  • parameters: Available options are specific, base, all. See the examples listed below to learn about their usage.
  • language: Available codes are specified in ISO 639-1.
NoteNote:  A translation must be available for the specified code to work. Otherwise the English language fallback messages are shown.

Examples

Parameter "parameters"

only specific parameters for the respective format are shown
{{#smwdoc:table}}
or
{{#smwdoc:table |parameters=specific }}
Parameter Type Default Description
class text sortable wikitable smwtable An additional CSS class to set for the table
transpose yes/no no Display table headers vertically and results horizontally
sep text empty The separator for values
only basic parameters applicable for all formats are shown
{{#smwdoc:table |parameters=base }}
Parameter Type Default Description
source text empty Alternative query source
limit whole number 50 The maximum number of results to return
offset whole number 0 The offset of the first result
link text all Show values as links
sort list of texts empty Property to sort the query by
order list of texts empty Order of the query sort
headers text show Display the headers/property names
mainlabel text no The label to give to the main page name
intro text empty The text to display before the query results, if there are any
outro text empty The text to display after the query results, if there are any
searchlabel text ... further results Text for continuing the search
default text empty The text to display if there are no query results
basic parameters applicable for all formats and specific parameters for the respective format are shown
{{#smwdoc:table |parameters=all }}
Parameter Type Default Description
source text empty Alternative query source
limit whole number 50 The maximum number of results to return
offset whole number 0 The offset of the first result
link text all Show values as links
sort list of texts empty Property to sort the query by
order list of texts empty Order of the query sort
headers text show Display the headers/property names
mainlabel text no The label to give to the main page name
intro text empty The text to display before the query results, if there are any
outro text empty The text to display after the query results, if there are any
searchlabel text ... further results Text for continuing the search
default text empty The text to display if there are no query results
class text sortable wikitable smwtable An additional CSS class to set for the table
transpose yes/no no Display table headers vertically and results horizontally
sep text empty The separator for values

Parameter "language"

{{#smwdoc:table |language=de }}
Parameter Typ Standard Beschreibung
class Text sortable wikitable smwtable Die zusätzliche für die Tabellenformatierung anwendbare CSS-Klasse
transpose ja/nein no Den Tabellenkopf vertikal und die Ergebnisse horizontal anzeigen (Transposition)
sep Text leer Legt fest, welches Trennzeichen für Ausgabe der Abfrageergebnisse genutzt werden soll