Feature Requirement: Button/action to Search and Replace JSON or tiddler content

54 views
Skip to first unread message

TW Tones

unread,
Aug 6, 2020, 7:06:00 PM8/6/20
to TiddlyWiki
Folks,

Whilst working on a new Import mechanism, it has become obvious the ability to search a JSON file, data tiddler or regular tiddler and alter one or more elements is a possibly common requirement. 
  • In my current use case I want to add a prefix to all titles in the import tiddler, so that they can be imported in a separate namespace.
There are various search and replace tools in the editor(s), lots of search tools and even methods that can be used in the Editor Toolbar. 
  • But as a designer we do not have a mechanism to supply a tiddler filter, a string filter and replacement string (Filter), to a button to make such changes.
  • An example may be someone provides the search and replace string/filter and clicks a button.
  • Or given a hardcoded search and replace string/filter an action would trigger it
I am stating this feature requirement out to see if someone has done this before, or has a solution that could be adapted to achieve this.

Why?
  • To me this is a tiddler manipulation feature gap that many may wish to use
  • For me it is the last step in improving the versatility of the Import Mechanism
  • In fact if one packages tiddlers into a JSON, then applies changes to the JSON it will support the export process as well
Prior Art?
  • Tools such as the relink plugin, the Commander of Mohamads etc... already do most of this, just not as an action
  • Joshuas JSON tools also supports doing things like this but involves a deeper understanding of JSON files.
  • Any other sources?
I expect to build this myself as its needed in my "new Import mechanism", however with the communities contribution I hope we can find a more general solution.


Thanks for any ideas
TW Tones



TiddlyTweeter

unread,
Aug 7, 2020, 12:20:19 AM8/7/20
to TiddlyWiki
Tones

Can't contribute much, other than comment Riz, somewhere built a bespoke importer of JSON that bulk manipulated titles.
The specific use case was to have a way to import where you do NOT have unique titles in the imported JSON. 
The code for that tool might be worth looking at. Maybe relevant. Let me know if you want me to find it for you.

On broader note anything that enhances JSON import/export is good news. 
JSON is an absolutely perfect interchange & "database" format for TW.

Best wishes
TT

Birthe C

unread,
Aug 7, 2020, 5:24:31 AM8/7/20
to TiddlyWiki
TT,

We are always complaining about the search. This time I am not able to find the importer of JSON by Riz you are writing about, but lots of places where you mention it.

It would be helpful if we all try to not only mention the goodies but also to link to them. No matter how good, the stuff is, it will not help anyone not able to find it. Search finding lots of results for mentioning but no links - seen through the wrong glasses could be seen as search pollution. ;-)


Birthe

Reply all
Reply to author
Forward
0 new messages