Import and add prefix

61 views
Skip to first unread message

TonyM

unread,
Jun 21, 2018, 8:18:56 PM6/21/18
to TiddlyWiki
Folks,

I would like to know if anyone knows "prior art" or existing solutions that may help me develop the ability to import tiddlers and add a prefix or suffix during import?

This would permit the safe import of new and edited tiddlers that could be difference analysed and optionally replace or update the tiddler with the original name.

It could also be used to import image and other items who may have the same name but a Different content where applying a Prefix is desirable eg; close.jpg could be imported as $:/yourname/toolname/close.jpg

Eg in an import batch, the titles may be

readme
$:/source/macro
img.jpg

Where I can set a prefix eg "Import.batch-"

And the tiddlers are imported as 

Import.batch-readme
Import.batch-$:/source/macro
Import.batch-img.jpg

This needs to occur at import time not after because I do not want existing or system tiddlers to be overwritten. A selectable  automated prefix of the form YYMMDDhhmm- would be acceptable, or an numbered import batch. All items in the batch should have the same prefix.

I want this in connection with an idea I have for providing review and edit commentary against existing TiddlyWikis, 

This could have a great use in the community and as a feedback tool, along with other as yet undreamed of solutions including controlled annotation and review of wiki-content.

So If you know of this being done already, or in an edition, or in fact know how we may do this please let me know.

Thanks in Advance
tony 




Diego Mesa

unread,
Jun 21, 2018, 9:36:04 PM6/21/18
to TiddlyWiki
Hey Tony,

I accomplish this with my node version using a bash script and "Folder Actions" on OSX. When I ever I place a new PDF into a folder, my bashscript runs and creates a .tid file and opens it in my text editor with prespecified tags and titles. 

If this interests you Id be happy to explore further! 

Diego

TonyM

unread,
Jun 21, 2018, 9:59:13 PM6/21/18
to TiddlyWiki
Diego,

That sounds interesting, and I imagine I could use it at some point in the future to build a PDF repository, PDF being a valuable resource today. 

I was hoping for a solution on any type of tiddlywiki file or folder, without external requirements if possible, I want to add this feature into the import process if at all possible. I suspect what I need is a subset of your solution if you can add the prefix at import time. By the sound of it, you are doing this at the point you convert a PDF to a Tiddler. I want to import already existing tiddlers as tid files or json files.

The truth is the tool I want to build is for one, not many to control the import of tiddlers then review and edit so I could build it on Node, however this may be an unnecessary dependency. I can see its value for everyone.

Attached is a mockup. An aexample of importing tiddlers from a json file, You could imagine in the example the tiddlers were imported as 

import1.$:/PSaT/macros/SysTimetine
import1.$:/PSaT/ui/SideBar/RecentSys

Any tips or code snippits appreciated,

Regards
Tony
mockup.png

wjam

unread,
Jun 22, 2018, 5:42:03 AM6/22/18
to TiddlyWiki
My diffview import allows you to make backups if the import text field differs from the current using the /\bu button please have a look at
.


to be more specific
<br/>modified :<$view tiddler=<<payloadTiddler>> field="modified" /> <$view tiddler=<<payloadTiddler>> field="modified" format="relativedate"/> (<b>current</b>)<<-- als text niet leeg/empty show backup button>><$reveal type="nomatch" state=<<payloadTiddler>> text="">{{$:/plugins/wjam/Buttons/save-oldtxt-import}}</$reveal><br/>

$:/plugins/wjam/Buttons/save-oldtxt-import is a simple backup button it only saves the text field 
backups into $:/oldtxt/title and date info , 
other fields are not backupped , because e.g. having multiple tiddlers with the same (system)tags  will lead to strange results

Using the diffview plugin, differences can easlity be identified.

K.R. wjam
Reply all
Reply to author
Forward
0 new messages