code-body: yes
created: 20231006082350928
modified: 20231010213624488
tags:
title: CPL PluginWiki Edit Template
type: text/vnd.tiddlywiki

\define illegalcharexp() [:/<>"\|?*]
\import CPL Tag Picker

<$list filter="[[IfEditorMode]get[text]else[no]match[yes]]" variable="edit">

<$macrocall $name="cpl-tag-picker" title=<<currentTiddler>> tagField="cpl.tags"/>

<div class="tc-control-panel">
<$list filter="[[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]]" variable="lang">
<$list filter="[<lang>search[zh]]" variable="lang">

|!标题 |<$edit-text field="cpl.title" tag=input placeholder="插件的标题，以$:/plugins/开头"/> |
|!版本 |<$edit-text field="cpl.version" tag=input placeholder="当插件文件不包含版本号时，会用此版本号替代"/> |
|!名称 |<$edit-text field="cpl.name" tag=input placeholder={{{ [<currentTiddler>get[cpl.title]split[/]last[1]addprefix[可能是：]] }}}/> |
|!类别 |<$select field="cpl.category" default="Unknown"><$list filter="[prefix[$:/plugins/Gk0Wk/CPL-Repo/config/plugin-categories/]]" variable="category"><option value={{{ [<category>removeprefix[$:/plugins/Gk0Wk/CPL-Repo/config/plugin-categories/]] }}}><$text text={{{ [<category>get[text]] }}}/></option></$list></$select> |
|!简介 |<$edit-text field="cpl.description" tag=textarea class="tc-edit-texteditor" placeholder="为插件添加简短的介绍"/> |
|!作者 |<$edit-text field="cpl.author" tag=input placeholder={{{ [<currentTiddler>get[cpl.title]split[/]last[2]first[1]addprefix[可能是：]] }}}/> |
|!URI |<$edit-text field="cpl.uri" tag=textarea placeholder={{{ [<currentTiddler>get[cpl.title]removeprefix[$:/plugins/]search-replace:gim:regexp<illegalcharexp>,[_]encodeuricomponent[]addprefix[从哪里可以找到这个插件(.json, .tid 或者 .html等)。如果插件的 json 文件在网络上，请填写下载地址；如果插件没有下载地址，需要手动下载或者编译，请将 json 插件文件放在本项目的 wiki/files/plugin-offline/ 路径下，并命名为 ]addsuffix[.json]] }}}/> |
|!类型 |<$select field="cpl.plugin-type" default="plugin"><$list filter="[[plugin]] [[language]] [[theme]] [[import]] [[library]] [[info]]"><option value=<<currentTiddler>>><$view field="title"/></option></$list></$select> |
|!介绍 |<$edit class="edit-plugin-textarea" field="cpl.readme" placeholder="插件的详细介绍" type="text/vnd.tiddlywiki"/> |
|!图标 |<$edit-text field="cpl.icon" placeholder="插件图标的URL" tag=input/> |
|!源代码 |<$edit-text field="cpl.source" tag=input placeholder="Source Code Project URL"/> |
|!文档 |<$edit-text field="cpl.documentation" tag=input placeholder="Documentation URL"/> |
|!前置依赖 |<$edit-text class="tc-edit-texteditor" field="cpl.dependents" placeholder="前置依赖插件的标题" tag=textarea/> |
|!父插件 |<$edit-text field="cpl.parent-plugin" tag=input placeholder="父插件的标题"/> |
|!核心版本要求 |<$edit-text field="cpl.core-version" tag=input placeholder="最小的核心版本，如'>=5.2.0'"/> |

</$list>
<$list filter="[<lang>!search[zh]]" variable="lang">

|!Title |<$edit-text field="cpl.title" tag=input placeholder="Title of the plugin, starting with $:/plugins/"/> |
|!Version |<$edit-text field="cpl.version" tag=input placeholder="When the plugin file does not contain a version number, this version number will be used instead."/> |
|!Name |<$edit-text field="cpl.name" tag=input placeholder={{{ [<currentTiddler>get[cpl.title]split[/]last[1]addprefix[Shall be: ]] }}}/> |
|!Category |<$select field="cpl.category" default="Unknown"><$list filter="[prefix[$:/plugins/Gk0Wk/CPL-Repo/config/plugin-categories/]removeprefix[$:/plugins/Gk0Wk/CPL-Repo/config/plugin-categories/]]" variable="category"><option value=<<category>>><$text text=<<category>>/></option></$list></$select> |
|!Description |<$edit-text field="cpl.description" tag=textarea class="tc-edit-texteditor" placeholder="Add brief description for this plugin."/> |
|!Author |<$edit-text field="cpl.author" tag=input placeholder={{{ [<currentTiddler>get[cpl.title]split[/]last[2]first[1]addprefix[Shall be: ]] }}}/> |
|!URI |<$edit-text field="cpl.uri" tag=textarea placeholder={{{ [<currentTiddler>get[cpl.title]removeprefix[$:/plugins/]search-replace:gim:regexp<illegalcharexp>,[_]encodeuricomponent[]addprefix[Where to find this plugin (.json, .tid or .html, etc.). Fill in the download URL if the JSON file is available online. If the plugin must be downloaded or built manually, place the JSON plugin file under wiki/files/plugin-offline/ in this project and name it ]addsuffix[.json]] }}}/> |
|!Type |<$select field="cpl.plugin-type" default="plugin"><$list filter="[[plugin]] [[language]] [[theme]] [[import]] [[library]] [[info]]"><option value=<<currentTiddler>>><$view field="title"/></option></$list></$select> |
|!Readme |<$edit class="edit-plugin-textarea" field="cpl.readme" placeholder="Readme of this plugin." type="text/vnd.tiddlywiki"/> |
|!Icon |<$edit-text field="cpl.icon" placeholder="URL of plugin's Icon" tag=input/> |
|!Source |<$edit-text field="cpl.source" tag=input placeholder="Source Code Project URL"/> |
|!Documentation |<$edit-text field="cpl.documentation" tag=input placeholder="Documentation URL"/> |
|!Dependents |<$edit-text class="tc-edit-texteditor" field="cpl.dependents" placeholder="Dependent plugin titles." tag=textarea/> |
|!Parent Plugin |<$edit-text field="cpl.parent-plugin" tag=input placeholder="Parent plugin title"/> |
|!Core Version |<$edit-text field="cpl.core-version" tag=input placeholder="Minimal core version, e.g. '>=5.2.0'"/> |

</$list>
</$list>
</div>
</$list>

<$list filter="[[IfEditorMode]get[text]else[no]!match[yes]]">
<$list filter="[[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]]" variable="lang">
<$list filter="[<lang>search[zh]]" variable="lang">
网站模式只读，不可编辑！
</$list>
<$list filter="[<lang>!search[zh]]" variable="lang">
Website is read-only!
</$list>
</$list>
</$list>