How to link to local images on Node.js version of Tiddlywiki?
Asked Answered
S

5

5

I'm using the Node.js version of TiddlyWiki, and I'd like to link to images on my filesystem.

The documentation listed here doesn't work; in the [img[path]] tag, for the path part I put something like /Users/documents/ken/path_to_image.jpg yet nothing shows up in the tiddler.

My wiki exists in /Users/documents/ken/wiki.

Spastic answered 19/2, 2015 at 18:49 Comment(0)
V
3

I know this is an old post, but zacts stated that you can use a macro plugin or simply use the [img] tag to point to the relative path of the image from the tiddlywiki.html file, but the op is using the node.js version, and zacts apparently didn't read that. There is no tiddlywiki.html file for TiddlyWiki on node.js. That only works with the static .html version of tiddlywiki, not the node.js version.

Currently there is no way to point to a local file through the node.js version of Tiddlywiki as node.js is not a webserver, therefore it does not see subfolders like /images/ off of the root url. The only way is to run a parallel web server on the same machine and use the full web url to the images served up from the web server.

Varnish answered 15/8, 2016 at 5:21 Comment(0)
E
3

In case someone else stumbles across this problem: I could not find this documented anywhere, but what seems to work is to just copy the image in the tiddlers directory, then restart the nodejs server, and search for the image title from tiddlywiki. There will be a tiddler that contains that image, that you can edit at your leisure.

Alternatively, copy the image as image_name.png (or image_name.jpg) into the tiddlers directory, and create a image_name.png.meta text file with the following contents:

title: image_name
type: image/jpeg

Upon restart of the tiddlywiki nodejs server, a tiddler with title image_name which contains the image will be there.

Eddyede answered 25/11, 2018 at 16:23 Comment(1)
thanks, it resolve my long time problemLoyola
A
1

If you are using the Node.js version, you can simply put it in the ./files folder, and then use [img[. /files/xxx.jpg]] to reference it.

Andy answered 31/7, 2022 at 13:27 Comment(1)
need put at wiki folder. see tiddlywiki.com/…Loyola
S
0

I had this same issue recently, and I found a neat little solution for it. Let me send you the links, and I'll post the snippets here.

I happened to stumble across this tiddlywiki image gallery homepage that linked to a macro plugin that lets you link in local images. Here is the link to the tiddler for the plugin: http://www.richshumaker.com/tw5/tw-photo.html#External%20Image%20Path. Here is the original TiddlyWiki google groups post of the plugin for this: https://groups.google.com/forum/#!msg/tiddlywiki/ChRV6sjQpn4/bCm35_XhGmkJ.

I hope this helps! =) (note: when I get more time I may clean up the formatting of this post).

Suffocate answered 3/3, 2015 at 4:59 Comment(1)
hum.. actually it seems that you can use the following syntax, as stated in tiddlywiki.tiddlyspace.com/TiddlyWiki%20Markup, [img[./relative/path/to/image/from/tiddlywiki.html/path]]. So no need for a plugin.Suffocate
H
0

It is very simple, you use _canonical_uri field

_canonical_uri field

The field value is something like "./wiki/path_to_image.jpg" (mine is "./files") in the same level as the tiddlers folder. I did not experimented with files outside the root folder of the wiki. The dot in the path might be ommited.

The content type might be "audio/mp3" "image/jpg" look at the "parser" shadow tiddlers. Your Browser might support more content types like "audio/wav" but you would have to add this line to "$:/core/modules/parsers/audioparser.js" For example. Might be the same thing for images. Check your browser support.

I really do not know why this fact is so obscure, but it work wonders.

Halverson answered 18/10, 2022 at 6:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.