mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-05-01 03:26:53 +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:
committed by
Jeremy Ruston
parent
da0ffce2d6
commit
cc39a86430
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:
|
||||
Reference in New Issue
Block a user