mirror of https://gitlab.com/octtspacc/OcttKB
37 lines
854 B
Plaintext
37 lines
854 B
Plaintext
tags: $:/tags/Macro
|
|
title: $:/plugins/kookma/refnotes/macros/find
|
|
type: text/vnd.tiddlywiki
|
|
|
|
\define find(text, begin, end, output:"simple", mode:"all")
|
|
<$vars
|
|
fulltext=<<__text__>>
|
|
start=<<__begin__>>
|
|
stop=<<__end__>>
|
|
output-macro=<<__output__>>
|
|
>
|
|
<$list variable=p1 filter="[<fulltext>splitbefore<start>]">
|
|
<$list variable=p2 filter="[<fulltext>removeprefix<p1>]">
|
|
<$list variable=p3 filter="[<p2>splitbefore<stop>removesuffix<stop>]">
|
|
<$macrocall $name=<<output-macro>> p=<<p3>> />
|
|
<$reveal type="match" text="all" default=<<__mode__>> >
|
|
<$macrocall $name="find"
|
|
text={{{[<p2>removeprefix<p3>removeprefix<stop>]}}}
|
|
begin=<<start>>
|
|
end=<<stop>>
|
|
output=<<output-macro>>
|
|
/>
|
|
</$reveal>
|
|
</$list>
|
|
</$list>
|
|
</$list>
|
|
</$vars>
|
|
\end
|
|
|
|
\define simple(p)
|
|
<$text text=<<__p__>> />
|
|
\end
|
|
|
|
\define simple-list(p)
|
|
<li><$text text=<<__p__>>/></li>
|
|
\end
|