There are different ways to handle this. If we're talking images, for 
instance, the path to your USB might be different on different machines. So 
being able to change the path in just one place is handy. And being able 
specify different types of image sources is also handy. For instance, you 
might have some sources that are on a remote url, some on a usb, and some 
on CDROM.

Here's one possible macro 

\define img(devtype basename)
<$vars devpath={{{[prefix[ImagePath]suffix[-$devtype$]limit[1]get[text]]}}}>
<$image source={{{[<devpath>addsuffix<__basename__>]}}} />
</$vars>
\end

Then if you have your configuration tiddlers in the format ImagePath-<type> 
where the text has a path like (example ImagePath-files):

./files/

Then you can invoke your image like this

<<img files myimagepage.jpg>>

Or, back to your usb, you might have a config tiddler ImagePath-usb with 
text D:\mydirectory\myimages\ and invoke like

<<img usb myimagepage.jpg>>

Then when on a different machine, you can change the contents of 
ImagePath-usb to Z:\mydirectory\myimages\ .

I have an idea for using image tiddlers (e.g. with _canonical_uri) . The 
advantage of image tiddlers is that if you change the name of a tiddler, 
you can use relink to change tiddler transclusion automatically. But that's 
all for now.


On Tuesday, October 19, 2021 at 10:10:22 AM UTC-7 maruadv...@gmail.com 
wrote:

> Is there a way to have external links that are in a sense 'portable'? 
>
> I want to store the TW file and the external reference material on a usb 
> drive for access.
>
> Thanks.
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3261f820-b140-4bf6-a91c-d42fc6119a40n%40googlegroups.com.

Reply via email to