Search and replace widget

171 views
Skip to first unread message

Ruslan Popov

unread,
Feb 11, 2020, 8:03:19 AM2/11/20
to TiddlyWiki
Is there a text search and replace widget?

I am trying to generate a list of tiddler titles, which look like ...

Applications March 10 Course 123
Applications March 20 Course 234
Applications March 30 Course 345
Applications April 10 Course 456
 

... and shorten these titles by removing repetitive words, such as "Applications" and "Course", and in addition by removing the last number. So the list should become like this:

March 10
March 20
March 30
April 10

Is this achievable by using some existing widget, or a new one should be created?

Many thanks in advance
Message has been deleted

Mat

unread,
Feb 11, 2020, 8:16:31 AM2/11/20
to TiddlyWiki
sorry for deleted post

Yes, you can search and replace as described at bottom here: https://tiddlywiki.com/prerelease/#split%20Operator

<:-)

Ruslan Popov

unread,
Feb 11, 2020, 8:31:53 AM2/11/20
to TiddlyWiki
Thank you, I see many useful operators there! I am looking forward to the next release.

Will it be possible to use them for changing text? Or they only work on lists?

And would it be useful to have a general search and replace widget / operator, which can modify text using a regular expression? That is a more general case than remove prefix or suffix, and more convenient than splitting and re-assembling a string.

Mohammad

unread,
Feb 11, 2020, 8:39:10 AM2/11/20
to TiddlyWiki
TW-Commander is designed to serve such purpose

You can rename tiddler by removing prefix or suffix
Create bulk of tiddler with some base title, tags and fields bu one click

Search and replace in any fields (tags, text, title, othe fields,...)

--Mohammad

Ruslan Popov

unread,
Feb 11, 2020, 8:46:24 AM2/11/20
to TiddlyWiki
Hi Mohammad, I saw the Commander - it's impressive!

In my case I don't need to rename tiddlers, only to format a title list in a particular way. So the output would be like this:

[[March 10|Applications March 10 Course 123]]

The link part is the actual tiddler title, and the display part is the same title stripped of redundant details.

Mohammad

unread,
Feb 11, 2020, 8:52:44 AM2/11/20
to TiddlyWiki


On Tuesday, February 11, 2020 at 5:16:24 PM UTC+3:30, Ruslan Popov wrote:
Hi Mohammad, I saw the Commander - it's impressive!


Glad you found Commander useful!
 
In my case I don't need to rename tiddlers, only to format a title list in a particular way. So the output would be like this:

[[March 10|Applications March 10 Course 123]]

The link part is the actual tiddler title, and the display part is the same title stripped of redundant details.

Good! so this can be done manually!

Ruslan Popov

unread,
Feb 11, 2020, 11:23:42 AM2/11/20
to TiddlyWiki
No, in my case it's not done manually. The code that generates the list is the following:

<$list filter="[!has[draft.of]tag[task]!tag[done]!sort[modified]]">
<$checkbox tag="done">
<$link>
<$view field="title"/>
</$link>
</$checkbox>
<$list filter="[all[current]tags[]regexp[Applicants]sort[title]]"><$link to={{!!title}}>▷</$link></$list>
<br></$list>

It has two nested lists. The outer list outputs task titles, the nested list looks for a certain type tag, and if it's present outputs an arrow symbol, linking to the tiddler representing that tag. Instead of the arrow I want to output some details from that tag's name (but not the entire name).

The output looks like this:

0G4035_067 ▷
0G4035_058 ▷
P37157_006 ▷

Instead of the arrow, I want to output a text, which is a shortened version of the tag name.

Mat

unread,
Feb 11, 2020, 2:18:17 PM2/11/20
to TiddlyWiki
Ruslan Popov wrote:
Thank you, I see many useful operators there! I am looking forward to the next release.

split join is already implemented in latest release. 

Will it be possible to use them for changing text? Or they only work on lists?

It does work for this, yes, which is basically what you see in that example - but filters typically treat everything as lists (or as one single element) so you basically transclude the text to make it a list... but one has to be careful to not eliminate duplicate elements. 

Note that
<$link> 
<$view field="title"/> 
</$link> 
and 
<$link to={{!!title}}>▷</$link>

can be written as merely 
<$link/>
and
<$link>▷</$link>  

<:-)

Ruslan Popov

unread,
Feb 12, 2020, 12:54:27 AM2/12/20
to TiddlyWiki
can be written as merely 
<$link/>
and
<$link>▷</$link>  

<:-)

Wow! TW is so smart! 

Mat

unread,
Feb 12, 2020, 3:29:12 AM2/12/20
to TiddlyWiki
Ruslan Popov wrote:
Wow! TW is so smart! 


Tell all your friends about it so they can enjoy it too!

<:-) 

Ruslan Popov

unread,
Feb 13, 2020, 12:29:34 AM2/13/20
to TiddlyWiki
Tell all your friends about it so they can enjoy it too!

I will make a presentation for them. If you can recommend any materials showcasing TW in a business environment - that may be helpful!

It's been extremely helpful. At the same time, I think how it can further be extended, for example support multiple users, and work with simple comma or tab delimited datasets.

Mat

unread,
Feb 13, 2020, 12:53:08 AM2/13/20
to TiddlyWiki
Ruslan Popov wrote:
Tell all your friends about it so they can enjoy it too!

I will make a presentation for them. If you can recommend any materials showcasing TW in a business environment - that may be helpful!

There is @Jeremys general presentation about TW which is not directed specifically to a business environment tho. Can't remember the url right now.

It's been extremely helpful. At the same time, I think how it can further be extended, for example support multiple users, and work with simple comma or tab delimited datasets.

For multiple users, check out @Jed Cartys  Bob variants that have been developed a few years now. It is the best, as far as I know.
CSV, as I guess you've noted, @Joshua Fontay is currently doing work on this.

<:-)


TonyM

unread,
Feb 13, 2020, 5:31:04 AM2/13/20
to TiddlyWiki
Ruslan,

I have tiddlywiki in a business environment, but as is common for commercial software it contains a whole lot of commercial in confidence data, unless the solution is for public consumption they often can not be shared. The same happens for bespoke personal wikis, I think that may be why we do not see as many real world examples as we would like. 

I could however write a summary of the particular application for you, need to write one for myself anyway, but it only demonstrates a small subset of what can be achieved. Just ask.

Regards
Tony

Ruslan Popov

unread,
Feb 17, 2020, 5:03:06 AM2/17/20
to tiddl...@googlegroups.com
I would love to see the following features in TiddlyWiki, which would be very useful in an enterprise environment:

* multiple users authentication and authorization (and OAuth for web)

* support for loading and saving of individual tiddlers (perhaps lazy loading)

* merging and conflict resolution similar to version control systems (perhaps integration with a VCS)

* easier integration of JavaScript or other programming language

* namespaces (when different tiddlers can have the same name if they are located in different namespaces (useful, for example, for repetitive projects having the same structure, represented as a set of tiddlers))

* better support of datasets

* integrated visualization (graphs, mindmaps, etc)

Some of this would be a paradigm change, so this would be a TW 6? Is something like this possible? :)

Also I wonder whether any TW developers are also SmallTalk programmers, and whether TW was partially inspired by SmallTalk (which I think is one of the best programming languages / environments ever created!).

TonyM

unread,
Feb 17, 2020, 6:38:11 PM2/17/20
to TiddlyWiki
Ruslan,

Much of what you ask for alrteady exists or is only a few customisations away. Some quick responses below



* multiple users authentication and authorization (and OAuth for web)

Not really, I too wish, but there are ways to approach this. The node versions have user ID and Passwords, I use a PHP based on tw-reciever
 

* support for loading and saving of individual tiddlers (perhaps lazy loading)

Lazy loading on node JS, thats the way the node version works 

* merging and conflict resolution similar to version control systems (perhaps integration with a VCS)
 
A Github implementation or using trashbin plugin and NoteSelf offers tiddler versions 

* easier integration of JavaScript or other programming language

Easier perhaps but javascript must behave a particular way to allow tiddlywiki to do its magic of instantaneous update there are also security issues we need to be aware of otherwise we may give someone the ability to write javascript on our website.
 

* namespaces (when different tiddlers can have the same name if they are located in different namespaces (useful, for example, for repetitive projects having the same structure, represented as a set of tiddlers))

This is in fact true already, we consider $:/ the system name space, I consider $:/config the config namespace, you can easily build your own namespace models because using prefix, add/remove prefix, lookup and other operators you can build what you ask for. I have recently discussed this bu would be happy to work with you to build a switch between names space tool.
 

* better support of datasets

Have you seen the JSON tools?
 

* integrated visualization (graphs, mindmaps, etc)

Have you seen tiddlymap and other graphics, railroad, flowcharts, and other implementations? 

Some of this would be a paradigm change, so this would be a TW 6? Is something like this possible? :)

No paradigm needed for you suggestions, they are all here on some capacity, and are thus possible, yes they need to be easier to find.

Personally not sure about smalltalk.

Regards
Tony
 
Reply all
Reply to author
Forward
0 new messages