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:
parent
da0ffce2d6
commit
cc39a86430
3
plugins/tiddlywiki/katex/katex-logo.tid
Normal file
3
plugins/tiddlywiki/katex/katex-logo.tid
Normal file
@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tiddlywiki/katex/katex-logo
|
||||
|
||||
$$\KaTeX$$
|
4
plugins/tiddlywiki/katex/snippets/logo.tid
Normal file
4
plugins/tiddlywiki/katex/snippets/logo.tid
Normal file
@ -0,0 +1,4 @@
|
||||
title: $:/plugins/tiddlywiki/katex/snippets/logo
|
||||
tags: $:/tags/KaTeX/Snippet
|
||||
|
||||
$$\KaTeX$$
|
53
plugins/tiddlywiki/katex/ui/EditorToolbar/katex-dropdown.tid
Normal file
53
plugins/tiddlywiki/katex/ui/EditorToolbar/katex-dropdown.tid
Normal 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]]
|
8
plugins/tiddlywiki/katex/ui/EditorToolbar/katex.tid
Normal file
8
plugins/tiddlywiki/katex/ui/EditorToolbar/katex.tid
Normal 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:
|
Loading…
Reference in New Issue
Block a user