> Is it possible to create link to file that is in the same folder as
> the tiddlywiki.html using relative path?
>
> This tag works [[file://path/to/wiki/filename.pdf]]. But [[file://
> filename.pdf]] doesn't work.
By design, [[anytext]] is always assumed to be a link to a tiddler,
even if that tiddler doesn't exist yet. Fortunately, the "PrettyLink"
syntax, [[text|link]], applies the inverse rule: the link is assumed
to be external, *unless* the tiddler already exists. While this
distinction is subtle, it does allow you to achieve the result you
want:
[[filename.pdf]] is a link to a tiddler, but
[[filename.pdf|filename.pdf]] is a link to an external file
And, because the link doesn't start with an /absolute/path/to/
folder/..., it is automatically handled by the browser as *relative to
the current directory* (i.e, the one containing the TW document).
Thus, you can also write something like:
[[old version|archives/filename.jpg]]
to link to a file in a *relative sub-directory*.
Also note that the link doesn't specify either http:// or file://
protocol. In fact, in most browsers, relative references only work
when you omit the protocol from the URL. In this case, it's an
advantage: it means that the same external PrettyLink can be applied
locally (as a filesystem reference), or remotely (as a server-side
URL), without needing any special TW code... the browser's normal
handling does it automatically.
enjoy,
-e