Template:Version: Difference between revisions
Jump to navigation
Jump to search
(Created page with "<noinclude>This template helps manage documentation that is version-specific. It allows you to specify which versions a page or section applies to, indicate if something is deprecated, and link to release notes. === Usage === <code><pre><nowiki> {{Version |version= <!-- Required. The main version this content applies to --> |since= <!-- Optional. The version where this feature was introduced --> |until= <!-- Optional. The last version wher...") |
No edit summary |
||
Line 13: | Line 13: | ||
</nowiki></pre></code></noinclude> | </nowiki></pre></code></noinclude> | ||
<includeonly> | <includeonly> | ||
{{# | <div class="version-box{{#if:{{{status|}}}| {{#ifeq:{{{status}}}|deprecated|deprecated|{{#ifeq:{{{status}}}|removed|removed}}}}}"> | ||
{{# | <!-- Check if version provided --> | ||
{{#if:{{{version|}}| | |||
{{# | <!-- Version is provided --> | ||
{{# | |||
<!-- | <!-- Construct base message depending on since/until --> | ||
{{#if:{{{since|}}| | |||
<!-- 'since' is provided --> | |||
This {{{type|page}}}, introduced in version {{{since}}}{{#if:{{{until|}}| | |||
, applies to versions {{{since}}} through {{{until}}} (current: {{{version}}}) | |||
| , applies starting from version {{{since}}} (current: {{{version}}}) | |||
This {{ | |||
, applies to versions {{ | |||
}} | }} | ||
|<!-- else no since --> | | <!-- else no 'since' --> | ||
{{#if:{{ | {{#if:{{{until|}}| | ||
This {{ | This {{{type|page}}} applies up to version {{{until}}} (current: {{{version}}}) | ||
| This {{{type|page}}} applies to version {{{version}}} | |||
}} | }} | ||
}} | }} | ||
<!-- | <!-- Add status information if applicable --> | ||
{{#if:{{ | {{#if:{{{status|}}| | ||
{{#ifeq:{{ | {{#ifeq:{{{status}}}|deprecated | ||
, but is now deprecated. | | , but is now deprecated. | ||
| {{#ifeq:{{{status}}}|removed | |||
| , but is now removed. | |||
| <!-- No recognized status --> | |||
}} | |||
}} | }} | ||
|<!-- | | <!-- no status --> | ||
. | . | ||
}} | }} | ||
<!-- | <!-- Add notes link if provided --> | ||
{{#if:{{ | {{#if:{{{notes|}}| | ||
See [[{{ | See [[{{{notes}}}]] for more details. | ||
}} | }} | ||
|<!-- else no version --> | | <!-- else no version --> | ||
<span style="color:red;">Error: No version specified! Please provide a version parameter.</span> | <span style="color:red;">Error: No version specified! Please provide a version parameter.</span> | ||
}} | }} | ||
</div> | </div> | ||
</includeonly> | </includeonly> |
Revision as of 23:24, 10 December 2024
This template helps manage documentation that is version-specific. It allows you to specify which versions a page or section applies to, indicate if something is deprecated, and link to release notes.
Usage
{{Version
|version= <!-- Required. The main version this content applies to -->
|since= <!-- Optional. The version where this feature was introduced -->
|until= <!-- Optional. The last version where this feature applies -->
|status= <!-- Optional. Can be 'deprecated' or 'removed' -->
|notes= <!-- Optional. A page or section linking to detailed changelog/release notes -->
|type= <!-- Optional. Defaults to 'page'. Could be 'section', 'feature', etc. -->
}}