Dokuwiki - 如何动态更改可见页面内容

Dokuwiki - how to change visible page contents dynamically

我在 dokuwiki 站点上有一些开发人员文档。该软件有多个版本(例如 v1、v2...)。希望能根据软件版本动态改变页面可见内容

例如,页面上可能有一个下拉菜单,允许 reader 到 select "v1, v2, etc." 当 v2 selected 时,只有页面的某些部分发生变化以反映此的 v2 部分。

这是一些维基页面内容的示例:

To build the foobar project, first download the code:
  cd ~
  git clone https://foo.example.com/bar.git
  git checkout v1.0

  ...

如果此人将下拉列表中的 selected 项更改为 v2,它将更改为以下内容:

To build the foobar project, first download the code:
  cd ~
  git clone https://foo.example.com/bar.git
  git checkout v2.0

  ...

有谁知道 Dokuwiki 中有可以做这种事情的插件吗?

我前一段时间写了 variants plugin,它是一个插件的概念证明,它可以根据用户提供的参数提供页面部分的变体。它有效,但功能集非常有限,即您只能在 URL 中指定一些参数,然后根据该参数,您可以在文本中包含 if-else-blocks。应该可以从下拉列表中设置该参数,但插件不提供下拉列表。如果您想扩展它,请随时进行扩展,请发送补丁或请求请求。

如果您的页面具有您可以从一个公共页面包含的大量公共部分,则 page4release plugin which has been built for the purpose you describe but it uses completely different pages for different versions of the software. You could also use a combination of this plugin and the include plugin 使用另一种方法(免责声明:我是包含插件的作者)。