Transclusion Indirection (Custom Cross Reference Search)

121 views
Skip to first unread message

William Jones

unread,
May 20, 2016, 12:03:58 AM5/20/16
to TiddlyWiki
Hello all,

I'm trying to RE a binary and am using TiddlyWiki to document my results. I've been tweaking the wiki in order to make cross referencing addresses with disassembled code snippets easier. However, I've run into a snag.

I keep RAM/ROM addresses as individual tiddlers with "size", "address", and "description" (quick summary) fields. One very useful thing for me would to be able to lookup what an address does without me losing my place in the current code snippet, which makes up the text field of certain tiddlers.

So I decided to implement a custom search bar underneath the standard search bar. When I type in an address, the search bar will pop up the size, address, and description fields of the tiddler(s) whose address field matches. I don't have to move from my current position at all because the fields for the current address are displayed nonintrusively.

Unfortunately, I'm not able to do this properly for reasons I don't understand. I edited $:/core/ui/SideBarLists to add a custom search field, but I am not able to access the text field or even the name of using the $()$ syntax.

<$set name="addrSearchTiddler" value="$:/temp/addrsearch">
<div class="tc-search">
<span>Address Lookup:</span>
<$edit-text tiddler="$:/temp/addrsearch" type="search" tag="input" focus={{$:/config/Search/AutoFocus}} focusPopup=<<qualify "$:/state/popup/addrsearch-dropdown">> class="tc-popup-handle"/>

<$reveal state="$:/temp/addrsearch" type="nomatch" text="">
<$text text=$(addrSearchTiddler)$ />
</$reveal>

<$reveal state="$:/temp/addrsearch" type="match" text="">
</$reveal>
</div>
</$set>

The output of the following is:
Address Lookup: $(addrSearchTiddler)$


Although a similar method is used to implement the standard search, I feel like this is not the proper way to implement a custom search. How might I go about transcluding the text of $:/temp/addrsearch into a filter which will then display the desired fields (size, address, description) in a popup analogous to the standard search bar?

Thanks for any help :)! I don't post this message lightly, but I really need to get back to actually collecting data/worry about convenience later. And hey, when has a life hack ever actually paid for the time spent implementing it :)?

BJ

unread,
May 20, 2016, 4:13:21 AM5/20/16
to TiddlyWiki
You can add custom search results try this-
create a new tiddler called custom with contents


\define searchResults()
<table>
<$list filter="[!is[system]search:address{$(searchTiddler)$}]" >
<tr><td>{{!!title}}</td><td>{{!!text}}</td></tr></$list>
</table>
\end
<<searchResults>>

and tagged

$:/tags/SearchResults

this adds an extra tab in the search results popup

Note that the syntax

$(searchTiddler)$}
can only be used inside a macro.

all the best
BJ

William Jones

unread,
May 20, 2016, 11:47:29 AM5/20/16
to TiddlyWiki
Okay, that worked wonderfully and is much cleaner than my proposed solution.

prog...@assays.tv

unread,
May 20, 2016, 1:57:04 PM5/20/16
to TiddlyWiki
it slowed me to a  crawl. but then I AM on XP with no memory and no interest in these issues :-). I only have myself to blame.
Reply all
Reply to author
Forward
0 new messages