First, it is only installed in prerelease (the plugin exists since 5.1.15).
Tried out on different platforms without success, so I started to investigate the matter.
Directory based (Node) wiki + Tiddly Desktop
Using Tiddly Desktop on a Node wiki, the document.location.protocol value is crome-extension: (in Chrome it's http:) so run is stopped at the beginning of the hook because the condition is not met.
Even if we fix this, it doesn't know the relative file name because it doesn't know its own directory (document.location.pathname is /html/wiki-folder-window.html).
For the time being, this plugin can't be used with a Node wiki.
Single HTML + Tiddly Desktop
makePathRelative()does not work on Windows because it encodes the colon in sourcepath and has no beginning / sign, thus it always throw makePathRelative: both paths must be absolute:
Hi @bimlas I haven't tested the external attachments plugin with a wiki folder, only with standalone wikis. It's a good idea to get it working though. The second problem is indeed fixed by 996ee52.
First, it is only installed in prerelease (the plugin exists since 5.1.15).
Tried out on different platforms without success, so I started to investigate the matter.
Directory based (Node) wiki + Tiddly Desktop
Using Tiddly Desktop on a Node wiki, the document.location.protocol value is
crome-extension:
(in Chrome it'shttp:
) so run is stopped at the beginning of the hook because the condition is not met.https://github.com/Jermolene/TiddlyWiki5/blob/e646d207c3aa9e7570fedeb27a6576b4d91ea8d9/plugins/tiddlywiki/external-attachments/startup.js#L28
Even if we fix this, it doesn't know the relative file name because it doesn't know its own directory (
document.location.pathname
is/html/wiki-folder-window.html
).https://github.com/Jermolene/TiddlyWiki5/blob/e646d207c3aa9e7570fedeb27a6576b4d91ea8d9/plugins/tiddlywiki/external-attachments/startup.js#L29
For the time being, this plugin can't be used with a Node wiki.
Single HTML + Tiddly Desktop
makePathRelative()
does not work on Windows because it encodes the colon insourcepath
and has no beginning/
sign, thus it always throwmakePathRelative: both paths must be absolute
:sourcepath
:C%3A/external-directory/example.pdf
rootpath
:/C:/external-directory
https://github.com/Jermolene/TiddlyWiki5/blob/e646d207c3aa9e7570fedeb27a6576b4d91ea8d9/plugins/tiddlywiki/external-attachments/startup.js#L55-L63
The method fails even if
USE_ABSOLUTE_FOR_DESCENDENTS_TITLE
andUSE_ABSOLUTE_FOR_NON_DESCENDENTS_TITLE
is true.