Template:Version: Difference between revisions

From Untold Dawn
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
<code><pre><nowiki>
<code><pre><nowiki>
{{Version
{{Version
|version=         <!-- Required. The main version this content applies to -->
|version          <!-- Required. The main version this content applies to -->
|since=            <!-- Optional. The version where this feature was introduced -->
|since=            <!-- Optional. The version where this feature was introduced -->
|until=            <!-- Optional. The last version where this feature applies -->
|until=            <!-- Optional. The last version where this feature applies -->
Line 15: Line 15:
<div class="version-box{{#if:{{{status|}}}| {{#ifeq:{{{status}}}|deprecated|deprecated|{{#ifeq:{{{status}}}|removed|removed}}}}}">
<div class="version-box{{#if:{{{status|}}}| {{#ifeq:{{{status}}}|deprecated|deprecated|{{#ifeq:{{{status}}}|removed|removed}}}}}">
<!-- Check if version provided -->
<!-- Check if version provided -->
{{#if:{{{version|}}|
{{#if:{{{1|}}|
   <!-- Version is provided -->
   <!-- Version is provided -->


Line 22: Line 22:
     <!-- 'since' is provided -->
     <!-- 'since' is provided -->
     This {{{type|page}}}, introduced in version {{{since}}}{{#if:{{{until|}}|
     This {{{type|page}}}, introduced in version {{{since}}}{{#if:{{{until|}}|
       , applies to versions {{{since}}} through {{{until}}} (current: {{{version}}})
       , applies to versions {{{since}}} through {{{until}}} (current: {{{1}}})
       | , applies starting from version {{{since}}} (current: {{{version}}})
       | , applies starting from version {{{since}}} (current: {{{1}}})
     }}
     }}
   | <!-- else no 'since' -->
   | <!-- else no 'since' -->
     {{#if:{{{until|}}|
     {{#if:{{{until|}}|
       This {{{type|page}}} applies up to version {{{until}}} (current: {{{version}}})
       This {{{type|page}}} applies up to version {{{until}}} (current: {{{1}}})
       | This {{{type|page}}} applies to version {{{version}}}
       | This {{{type|page}}} applies to version {{{1}}}
     }}
     }}
   }}
   }}

Revision as of 23:27, 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. -->
}}