Hi guys !

I realize I have a very specific request. But hopefully 
challenging/interesting enough for you guys.
I put some background info, so you understand where I am coming from but I 
guess you can skip the paragraph, till the issue bit

*Background* : I have migrated a chm file that document an internal 
database, into TW5 of course. The migration is done with a Vim script that 
converts the html into tiddlers. The files are then imported nicely in TW. 
This works great. The purpose of this is to allow me and colleagues to add 
notes to the documentation. Documentation is never complete and you always 
want to write down a SQL query and share it. So you can add some tiddlers 
to the tiddlywiki (not easily done with chm). Point is the DB evolves and 
new chm come up from time to time. So to keep the notes and allow for 
refreshed tiddlers, I came up with this :

   - The migrated tiddlers are named by database object typically table 
   name. I'll use tableA in the examples
   - These have embedded a button at the top that will create a relative 
   tiddler to their name : TableA+ (just add the "+" suffix)
   - They transclude this relative tiddler (basically  the migrated tiddler 
   include {{TableA+}} even if it does not exist yet.
   - So if a comment was made , the TableA+ is created and kept , and 
   TableA is updated at the new migration.
   - I apply the same idea for a bottom comment with suffix "+b" , that 
   creates TableA+b, and to create comment for each field of the table, so 
   TableA.field1+ can be created

This again works very nicely. Now comes the point. I want to search through 
Table documentation and my notes at the same time. and the default search 
can come up with many entry for the same table (TableA, TableA+, 
TableA.fieldn+, TableA+b). What I want is to get only one result back from 
the search (nicer, more compact result set)

*Here is my issue*
The tiddlywiki is full of comment tiddlers that have suffix "+", "+b" and 
".fieldn+". 
These comments refers to the a main tiddler named "TableA". 

I want to be able to search through all of these, but only offer a link to 
the main tiddler . So if my search string is found in "TableA+", I want the 
search to return TableA
This can be done for the "+" and "+b" suffix, using removesuffix operator

in the macro that customize the search, i will use the following to change 
the link to remove from the tiddlers the "+b" suffix

[!is[system]search{$(searchTiddler)$}!regexp[\..*\+]] +[removesuffix[+b]]

I do the same with "+" suffix, add the tiddlers corresponding to the table 
(removesuffix does filter out the tiddlers without suffix) , do the union 
of the lot, and sort it back.

<$list filter="[!is[system]search{$(searchTiddler)$}!regexp[\..*\+]] 
+[removesuffix[+]] [!is[system]search{$(searchTiddler)$}!regexp[\..*\+]] 
+[removesuffix[+b]] [!is[system]search{$(searchTiddler)$}!suffix[+]!suffix[+b]] 
[!is[system]search{$(searchTiddler)$}regexp[\..*\+]] +[sort[]]">

The code above include the regexp operator to include or exclude the 
tiddlers with the ".field1+" or ".field67+" suffix. But for them I don't 
know how to remove the suffix. *removesuffix does not work with regular 
expressions*

*So in short*
*is there a way to remove a suffix that you can identify through regular 
expressions ?*

I guess variables could help, but I would not know where to start. Can you 
provide clues ?
Also I am not fully confortable on how to customize the search, is there 
any example around of customized searchs appart from the timeline in 
tiddlywiki.com ? where is the code for the default search ?

Many thanks for your help. Sorry for the long post




-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3c007a4a-75cc-44a7-8d46-5aa49e0d3cd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to