Template:Class: Difference between revisions

From KDE TechBase
(Update template base URL and add parser functions to handle parameter combinations)
m (Remove extraneous curly brace)
Line 1: Line 1:
<includeonly>{{#ifexpr: {{{3|5}}} < 5 | [https://api.kde.org/mapsearcher.php?class={{{1}}}&module={{{2|ALL}}}&version={{{3}}}&go=Go {{{text|{{{1}}}}}}}] | {{#if:{{{2|}}} | [https://api.kde.org/frameworks/{{lc:{{{2}}}}}/html/class{{{1}}}.html {{{text|{{{1}}}}}}}] | [https://api.kde.org/frameworks/search.html?query={{{1}}}} {{{text|{{{1}}}}}}] }}}}</includeonly><noinclude>
<includeonly>{{#ifexpr: {{{3|5}}} < 5 | [https://api.kde.org/mapsearcher.php?class={{{1}}}&module={{{2|ALL}}}&version={{{3}}}&go=Go {{{text|{{{1}}}}}}] | {{#if:{{{2|}}} | [https://api.kde.org/frameworks/{{lc:{{{2}}}}}/html/class{{{1}}}.html {{{text|{{{1}}}}}}] | [https://api.kde.org/frameworks/search.html?query={{{1}}}} {{{text|{{{1}}}}}}] }}}}</includeonly><noinclude>
The '''<nowiki>{{Class}}</nowiki> template''' creates a link to the [https://api.kde.org/frameworks/index.html API Documentation] for a member Class of the KDE Frameworks.
The '''<nowiki>{{Class}}</nowiki> template''' creates a link to the [https://api.kde.org/frameworks/index.html API Documentation] for a member Class of the KDE Frameworks.



Revision as of 14:06, 5 January 2021

The {{Class}} template creates a link to the API Documentation for a member Class of the KDE Frameworks.

Variables

{{Class|1=<className>|2=<library/module>|3=<frameworksVersion>|text=<linkText>}}

The numbered variables may be used without names as positional parameters, and the text= variable may be used with any quantity of other variables. Such as:

  • {{Class|<className>|<library/module>|<frameworksVersion>|text=<linkText>}}, or
  • {{Class|<className>||<frameworksVersion>|text=<link text>}}, or
  • {{Class|<className>|text=<linkText>}}

Usage Examples

  • {{Class|KColorDialog}} looks for the docs of the KColorDialog Class in the KDE Frameworks.
  • {{Class|KProcessList::KProcessInfo|kcoreaddons}} shows the docs for the KProcessList::KProcessInfo Class in the KCoreAddons library.
  • {{Class|KColorDialog|kdelibs|3.5}} shows the docs for the specified class in version 3.5 of the KDE Frameworks.
  • {{Class|KColorDialog|kdelibs|3.5|text=Color Dialog}} shows the docs for a different version and defines the link text.