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.

YakovL
  • 7,557
  • 12
  • 62
  • 102
Kenrick Chien
  • 1,036
  • 8
  • 22

5 Answers5

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.

Jonathan Bardi
  • 321
  • 1
  • 4
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.

blue
  • 2,683
  • 19
  • 29
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.

FSpark
  • 11
  • 1
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).

zacts
  • 117
  • 3
  • hum.. actually it seems that you can use the following syntax, as stated in http://tiddlywiki.tiddlyspace.com/TiddlyWiki%20Markup, [img[./relative/path/to/image/from/tiddlywiki.html/path]]. So no need for a plugin. – zacts Mar 03 '15 at 08:04
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.