1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Introduce "parent-plugin" field to control how plugins are displayed in the chooser

"Sub-plugins" are displayed within the dropdown of their parent plugin.

This is a more elaborate version of #4109. It doesn't address dependent plugins (yet), this is just about grouping addon plugins under their parent.
This commit is contained in:
Jeremy Ruston 2019-09-25 16:16:28 +01:00
parent f460b2caa1
commit 92340d81cc
18 changed files with 31 additions and 13 deletions

View File

@ -61,6 +61,13 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
<div class="tc-plugin-info-dropdown-body"> <div class="tc-plugin-info-dropdown-body">
<$transclude tiddler=<<assetInfo>> field="readme" mode="block"/> <$transclude tiddler=<<assetInfo>> field="readme" mode="block"/>
</div> </div>
<div class="tc-plugin-info-sub-plugins">
<$set name="original-title" value={{{ [<assetInfo>get[original-title]] }}}>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}original-plugin-type[$type$]has[parent-plugin]parent-plugin<original-title>sort[title]sort[name]]" variable="assetInfo">
<<display-plugin-info "$type$">>
</$list>
</$set>
</div>
</div> </div>
</$reveal> </$reveal>
</$set> </$set>
@ -83,8 +90,10 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
</$reveal> </$reveal>
<div class="tc-plugin-library-listing"> <div class="tc-plugin-library-listing">
<$list filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}original-plugin-type[$type$]search:author,description,original-title,readme,title{$:/temp/RemoteAssetSearch/$(currentTiddler)$}sort[title]sort[name]]" variable="assetInfo"> <$list filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}original-plugin-type[$type$]search:author,description,original-title,readme,title{$:/temp/RemoteAssetSearch/$(currentTiddler)$}sort[title]sort[name]]" variable="assetInfo">
<$list filter="[[$:/temp/RemoteAssetSearch/$(currentTiddler)$]has[text]] ~[<assetInfo>!has[parent-plugin]]" variable="ignore"><!-- Hide sub-plugins if we're not searching -->
<<display-plugin-info "$type$">> <<display-plugin-info "$type$">>
</$list> </$list>
</$list>
</div> </div>
\end \end

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-autocomplete", "title": "$:/plugins/tiddlywiki/codemirror-autocomplete",
"name": "CodeMirror Autocomplete", "name": "CodeMirror Autocomplete",
"description": "Autocompletion for CodeMirror", "description": "Autocompletion for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-closebrackets", "title": "$:/plugins/tiddlywiki/codemirror-closebrackets",
"name": "CodeMirror Close Brackets", "name": "CodeMirror Close Brackets",
"description": "Close brackets for CodeMirror", "description": "Close brackets for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-closetag", "title": "$:/plugins/tiddlywiki/codemirror-closetag",
"name": "CodeMirror Close Tag", "name": "CodeMirror Close Tag",
"description": "Close tags automatically for CodeMirror", "description": "Close tags automatically for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-fullscreen", "title": "$:/plugins/tiddlywiki/codemirror-fullscreen",
"name": "CodeMirror Fullscreen", "name": "CodeMirror Fullscreen",
"description": "Fullscreen editing for CodeMirror", "description": "Fullscreen editing for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-keymap-emacs", "title": "$:/plugins/tiddlywiki/codemirror-keymap-emacs",
"name": "CodeMirror Keymap Emacs", "name": "CodeMirror Keymap Emacs",
"description": "Keymap compatible with Emacs for CodeMirror", "description": "Keymap compatible with Emacs for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-keymap-sublime-text", "title": "$:/plugins/tiddlywiki/codemirror-keymap-sublime-text",
"name": "CodeMirror Keymap Sublime Text", "name": "CodeMirror Keymap Sublime Text",
"description": "Keymap compatible with Sublime Text for CodeMirror", "description": "Keymap compatible with Sublime Text for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-keymap-vim", "title": "$:/plugins/tiddlywiki/codemirror-keymap-vim",
"name": "CodeMirror Keymap Vim", "name": "CodeMirror Keymap Vim",
"description": "Keymap compatible with Vim for CodeMirror", "description": "Keymap compatible with Vim for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-mode-css", "title": "$:/plugins/tiddlywiki/codemirror-mode-css",
"name": "CodeMirror Mode CSS", "name": "CodeMirror Mode CSS",
"description": "CSS highlighting mode for CodeMirror", "description": "CSS highlighting mode for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-mode-htmlembedded", "title": "$:/plugins/tiddlywiki/codemirror-mode-htmlembedded",
"name": "CodeMirror Mode HTML Embedded", "name": "CodeMirror Mode HTML Embedded",
"description": "Embedded HTML highlighting mode for CodeMirror", "description": "Embedded HTML highlighting mode for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-mode-htmlmixed", "title": "$:/plugins/tiddlywiki/codemirror-mode-htmlmixed",
"name": "CodeMirror Mode HTML Mixed", "name": "CodeMirror Mode HTML Mixed",
"description": "HTML mixed highlighting mode for CodeMirror", "description": "HTML mixed highlighting mode for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-mode-javascript", "title": "$:/plugins/tiddlywiki/codemirror-mode-javascript",
"name": "CodeMirror Mode JavaScript", "name": "CodeMirror Mode JavaScript",
"description": "JavaScript highlighting mode for CodeMirror", "description": "JavaScript highlighting mode for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-mode-markdown", "title": "$:/plugins/tiddlywiki/codemirror-mode-markdown",
"name": "CodeMirror Mode Markdown", "name": "CodeMirror Mode Markdown",
"description": "Markdown highlighting mode for CodeMirror", "description": "Markdown highlighting mode for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki", "title": "$:/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki",
"name": "CodeMirror Mode TiddlyWiki Classic", "name": "CodeMirror Mode TiddlyWiki Classic",
"description": "Tiddlywiki Classic highlighting mode for CodeMirror", "description": "Tiddlywiki Classic highlighting mode for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-mode-xml", "title": "$:/plugins/tiddlywiki/codemirror-mode-xml",
"name": "CodeMirror Mode XML", "name": "CodeMirror Mode XML",
"description": "XML highlighting mode for CodeMirror", "description": "XML highlighting mode for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/codemirror-search-replace", "title": "$:/plugins/tiddlywiki/codemirror-search-replace",
"name": "CodeMirror Search and Replace", "name": "CodeMirror Search and Replace",
"description": "Search and replace for CodeMirror", "description": "Search and replace for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme" "list": "readme"
} }

View File

@ -1,17 +1,6 @@
title: $:/plugins/tiddlywiki/codemirror/readme title: $:/plugins/tiddlywiki/codemirror/readme
This plugin provides an enhanced text editor component based on [[CodeMirror|http://codemirror.net]]. This plugin provides an enhanced text editor component based on [[CodeMirror|http://codemirror.net]]. The basic configuration is designed to be as lightweight as possible and is just around 235kb of size. Additional features can be installed with ~CodeMirror ~AddOns from the plugin library.
The basic configuration is designed to be as lightweight as possible and is just around 235kb of size.
Additional features can be installed with ~CodeMirror ~AddOns from the plugin library:
* Code colouring for many languages (see [[the official documentation here|http://codemirror.net/mode/index.html]])
* Auto closing brackets and tags
* Folding brackets, comments, and tags
* Auto-completion
* Search and Replace
* Fullscreen Editing
* Optional Emacs, Sublime Text or Vim Keymaps
[[Source code|https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/codemirror]] [[Source code|https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/codemirror]]

View File

@ -2073,12 +2073,17 @@ html body.tc-body.tc-single-tiddler-window {
display: flex; display: flex;
border: 1px solid <<colour muted-foreground>>; border: 1px solid <<colour muted-foreground>>;
fill: <<colour muted-foreground>>; fill: <<colour muted-foreground>>;
background-colour: <<colour background>>; background-color: <<colour background>>;
margin: 0.5em 0 0.5em 0; margin: 0.5em 0 0.5em 0;
padding: 4px; padding: 4px;
align-items: center; align-items: center;
} }
.tc-plugin-info-sub-plugins .tc-plugin-info {
margin: 0.5em 1em 0.5em 1em;
background: rgba(255,255,0,0.05);
}
.tc-plugin-info-disabled { .tc-plugin-info-disabled {
background: -webkit-repeating-linear-gradient(45deg, #ff0, #ff0 10px, #eee 10px, #eee 20px); background: -webkit-repeating-linear-gradient(45deg, #ff0, #ff0 10px, #eee 10px, #eee 20px);
background: repeating-linear-gradient(45deg, #ff0, #ff0 10px, #eee 10px, #eee 20px); background: repeating-linear-gradient(45deg, #ff0, #ff0 10px, #eee 10px, #eee 20px);