Hi Mat,
thanks for your reply.
I think this code could be the key to some missing features.
Hi everyone
For my purposes it would be good to be able to set different start
and ending marks, I guess this should be possible.
I tried to understand and change the cherrypicker Macro
(
http://cherrypicker.tiddlyspot.com/#CherryPicker) replacing the
$mark$ by $start$ and $end$.
I understood some things, some are beyond my knowledge.
My result crashes I think due to problems with the recursion.
(What means +[first[]]?)
I made a commented version of the macro,
For those willing to help who don`t know the cherrypicker, the aim
is to list the sections between $start$ and $end$.
So thanks for help
Jan
<!--
-------------------------1. This part filters the relevant
Tiddlers, gets their Text and passes it to 2. and it creates the
box with the results ---------------------------------
-->
\define xtract(start, end)
@@.cherryheading $start$...$end$@@
<div style="margin: -0px 0 0 22px;">
<$list
filter="[!is[system]regexp:text[$start$]regexp:text[$end$]!prefix[Draft]!title[About]!tag[About]!regexp:text[cherrypicker
]] -[prefix[CherryPicker]] -[prefix[codeCherry]]"
emptyMessage="NO" variable="tid">
<$list variable="fulltext" emptyMessage="NOpfx"
filter="""[<tid>get[text]]""">
<$macrocall $name="scrubprefix"
txt=<<fulltext>> start="$start$" end="$end$"/>
</$list>
</$list>
</div>
\end
<!--
-------------------------2. This part chops off all before the
start-mark---------------------------------
-->
\define scrubprefix(txt, start, end)
<$list variable="pfx"
filter="[[$txt$]regexp[$start$\S]splitbefore[$start$]]"
>
@@.pfx ''pfx'':<<pfx>><br>@@
<$list variable="txt" emptyMessage="NOtxt"
filter="[[$txt$]removeprefix<pfx>]">@@.txt
''txt:'' """<<txt>>"""<br>@@
<$macrocall $name="pick" txt=<<txt>>
start="$start$" end="$end$"/>
</$list>
</$list>
\end
<!--
-------------------------3. This macro chops off at the end-mark
and creates a section which is collected and a rest which is
again passed to the
scrubprefix...---------------------------------
-->
\define pick(txt, start, end)
<$list variable="cherry" emptyMessage="NOcherry"
filter="[[$txt$]regexp[\S$end$]splitbefore[$end$]removesuffix[$end$]]
[[$txt$]!regexp[$end$]splitbefore[ ]]
[[$txt$]!regexp[\S$end$\s]splitbefore[$end$]]
+[first[]]">
<span class="cherrybullet" tooltip=<<tid>>>
<$link
to=<<tid>>>{{cherrybullet.png}}</$link>
</span><<cherry>> <br>
<$list variable="rest" emptyMessage="NO3"
filter="[[$txt$]removeprefix<cherry>removeprefix[$end$ ]]
[[$txt$]removeprefix<cherry>]
+[first[]]">
@@.rest ''rest'':<<rest>><br>@@
<$list filter="[<rest>regexp[$start$]]">
<$macrocall $name="scrubprefix"
txt=<<rest>> start="$start$" end="$end$"/>
</$list>
</$list>
</$list>
\end