DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:versionswitch

versionswitch Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" yes
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" unknown

plugin Easily switch between different documented versions

Last updated on
2024-06-19
Provides
Syntax
Repository
Source

Similar to translation

Tagged with navigation

A CosmoCode Plugin

This plugin is somewhat similar to the translation plugin as it allows to easily jump between page with the same name in different namespaces. As the name suggests it is meant to jump between different named versions of documentation. This is especially useful when documenting software.

The idea is that for new software releases you will copy the old documentation to a new namespace so that users of old releases can still refer to previous versions of the documentation.

Installation

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

Recent updates:

Configuration

The plugin exposes a single configuration option in the config manager. In it you configure the namespaces that contain version namespaces, with one per line.

A simple setup could look like this:

products:pixelfusion

With this setup a page named products:pixelfusion:7.1:processor would show the pages products:pixelfusion:7.0:processor and products:pixelfusion:6.0:processor as other versions of the same feature.

If you have a more complex setup, you can use a regular expression to match sub namespaces as a second parameter (separated by whitespace). Eg:

products:pixelfusion
products:quantumcanvas (latest_release|wip|archive:[^:]+)

This would consider products:quantumcanvas:latest_release:painter, products:quantumcanvas:wip:painter and products:quantumcanvas:archive:2022:painter as versions of the same feature, but would ignore products:quantumcanvas:unrelated:painter.

Usage

Once installed, the plugin can easily be added to a sidebar using the following syntax:

~~VERSIONSWITCH~~

The version selector will only be shown on pages that are within namespaces as per configured above.

The shown versions will take their name from the respective namespaces' start page title if any. ACLs are always honored when showing versions - non readable versions will not be shown.

Alternatively to the syntax, template authors can include the functionality directly into their template:

$vswitch = plugin_load('syntax', 'versionswitch');
if ($vswitch) {
    echo $vswitch->versionSelector()
}
plugin/versionswitch.txt · Last modified: 2024-06-19 23:52 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki