1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

KaTeX - EditorToolbar stamp button for wysiwyg katex snippet input (#3131)

* add KaTeX logo

* add katex stamp button

* add katex stamp dropdown

* add a snippet so that the dropdown isn't empty

* correct dropdown title

* change tag

* update snippets tag
This commit is contained in:
BurningTreeC 2018-03-05 12:05:44 +01:00 committed by Jeremy Ruston
parent da0ffce2d6
commit cc39a86430
4 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,3 @@
title: $:/plugins/tiddlywiki/katex/katex-logo
$$\KaTeX$$

View File

@ -0,0 +1,4 @@
title: $:/plugins/tiddlywiki/katex/snippets/logo
tags: $:/tags/KaTeX/Snippet
$$\KaTeX$$

View File

@ -0,0 +1,53 @@
title: $:/plugins/tiddlywiki/katex/ui/EditorToolbar/katex-dropdown
\define toolbar-button-stamp-inner()
<$button tag="a">
<$action-sendmessage
$message="tm-edit-text-operation"
$param="replace-selection"
text={{$(snippetTitle)$}}
/>
<$action-deletetiddler
$tiddler=<<dropdown-state>>
/>
<$view tiddler=<<snippetTitle>> field="caption" mode="inline">
<$transclude tiddler=<<snippetTitle>> mode="inline"/>
</$view>
</$button>
\end
<$list filter="[all[shadows+tiddlers]tag[$:/tags/KaTeX/Snippet]!has[draft.of]sort[caption]]" variable="snippetTitle">
<<toolbar-button-stamp-inner>>
</$list>
----
<$button tag="a">
<$action-sendmessage
$message="tm-new-tiddler"
tags="$:/tags/KaTeX/Snippet"
text="""$$snippet$$"""
/>
<$action-deletetiddler
$tiddler=<<dropdown-state>>
/>
<em>
<$text text={{$:/language/Buttons/Stamp/Caption/New}}/>
</em>
</$button>
[ext[KaTeX functions catalogue|https://khan.github.io/KaTeX/function-support.html]]

View File

@ -0,0 +1,8 @@
title: $:/plugins/tiddlywiki/katex/ui/EditorToolbar/katex
tags: $:/tags/EditorToolbar
icon: $:/plugins/tiddlywiki/katex/katex-logo
caption: katex
description: create and insert preconfigured KaTeX snippets
condition: [<targetTiddler>!is[image]]
dropdown: $:/plugins/tiddlywiki/katex/ui/EditorToolbar/katex-dropdown
text: