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. The documentation is generated according to the software version and the feature set which is provided by it for the respective wiki.1

This documentation also applies to the #mapsdoc parser function provided by extension "Maps"Allows embedding of dynamic maps, geocoding and geospatial operations.

Usage[edit]

{{#smwdoc:<format-name> |parameters=<criterion> |language=<language-code> }}
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[edit]

Parameter "parameters"[edit]

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 between results
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 between results

Parameter "language"[edit]

{{#smwdoc:table |language=de }}
Parameter Typ Standard Beschreibung
class Text sortable wikitable smwtable Legt fest, welche zusätzliche CSS-Klasse genutzt werden soll
transpose ja/nein no Legt fest, ob der Spalten- und Zeilenkopf bei der Anzeige der Abfrageergebnisse transponiert werden soll
sep Text leer Legt fest, welches Trennzeichen bei der Ausgabe der Abfrageergebnisse genutzt werden soll

Appearance[edit]

Starting with Semantic MediaWiki 3.1.6Released on 19 April 2020 and compatible with MW 1.31.0 - 1.34.x.2 the class used to generate the tables for documentation was changed from wikitable to smwtable-clean . Moreover an new class called doctable was introduced to allow individual adaptations via CSS.

Example
.doctable {
	width: 100%;
}

This CSS would result in the tables being displayed in full width.


References

  1. ^  Semantic Result Formats: GitHub issue comment gh:srf:629:768136757
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:4667