Discussion:
[tw] No Linking to External Files in node.js setup?
Jeff Vance
2017-04-16 01:46:03 UTC
Permalink
I'm experimenting with using node.js setup for the first time. My personal
TW has gotten pretty huge and I was curious to see what using the node.js
setup is like. However, one major problem is I have lots of links to PDF
files using file:///path/to/file. They worked fine before, but under
node.js, my browser won't let me click them. There are no errors or
messages or anything. I just click the link and nothing happens. I tried
Firefox and Safari. In both cases, I have to copy the link and paste it
into the address bar to actually go to the file.

Is this a common problem? If there is no way around it, I might ditch the
node.js idea altogether. I have tons of PDFs I've indexed this way, so not
being able to link to them is a deal breaker.
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e009ea55-e51e-4513-a2df-2f6f776e910f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Mark S.' via TiddlyWiki
2017-04-16 02:10:41 UTC
Permalink
If you have any external images, they will also not show up.

node.js only serves up tiddlers, nothing else. Apparently modern browsers
won't let you link to a local file or image from page served up by a server
(which is how it views files from node.js). So, if you needed those images
or files, you would need to run a separate file server and then change all
your addresses to point to that server.

This limitation is one reason why I can't get excited about node.js. I can
only assume that people using node.js aren't interested in images and other
resources. To me images and supporting files are an important part of any
information management system. If I only cared about text I'd probably just
concentrate on SimpleNotes or other similar solutions.

Good luck!
Mark
Post by Jeff Vance
I'm experimenting with using node.js setup for the first time. My
personal TW has gotten pretty huge and I was curious to see what using the
node.js setup is like. However, one major problem is I have lots of links
to PDF files using file:///path/to/file. They worked fine before, but
under node.js, my browser won't let me click them. There are no errors or
messages or anything. I just click the link and nothing happens. I tried
Firefox and Safari. In both cases, I have to copy the link and paste it
into the address bar to actually go to the file.
Is this a common problem? If there is no way around it, I might ditch the
node.js idea altogether. I have tons of PDFs I've indexed this way, so not
being able to link to them is a deal breaker.
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/798def91-a481-460c-90b3-06642a9020e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Douglas Counts
2017-04-16 04:22:11 UTC
Permalink
Just a few suggestions as I don't have the time right now to do a deeper
look at the problem:

Node.JS can serve up images, video, or anything else you might want.
Whether TiddlyWiki itself though is coded for that, I'm not sure. Normally
one simply assigns a route using Express.JS middleware to serve up static
files. So there is a way to do this, I have done so on many websites, I
just don't have the time at the moment to dig deeper into how/if TiddlyWiki
itself is coded for this, but it is possible with Node.JS.

Regarding your links to your PDF files, I used to make this same mistake
too. You need to use relative external links instead. It saves you a lot
on typing too.

I used to load PDFs into a browser tab and copy the URL into TiddlyWike
before I realized *relative external links* were available.

So if you have a subdirectory below where your TiddlyWikis are like:
./TWDataFiles/PDFs

And you have a book located in there like so:
./TWDataFiles/PDFs/Instant TiddlyWiki Development.pdf

Then you can link to it like so:
[ext[Instant TiddlyWiki Development|TWDataFiles/PDFs/Instant TiddlyWiki
Development.pdf]]

Notice that you need to not use the conventional [[title|link]] but
instead use [ext[title|link]] instead.

There is actually some good documentation on external links here [Linking
in WikiText] <http://tiddlywiki.com/static/Linking%2520in%2520WikiText.html>
.

Good luck,

-Doug
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/df2a5e36-9328-4eaf-8872-0631085ad393%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Mark S.' via TiddlyWiki
2017-04-16 13:34:30 UTC
Permalink
To clarify, TiddlyWiki running on node.js doesn't serve up images or other
files. There are other applications running on node.js that do serve up
images and that is one of the easiest ways to add a server to your set up
if you want to go that route.

Thanks,
Mark
Post by Douglas Counts
Just a few suggestions as I don't have the time right now to do a deeper
Node.JS can serve up images, video, or anything else you might want.
Whether TiddlyWiki itself though is coded for that, I'm not sure. Normally
one simply assigns a route using Express.JS middleware to serve up static
files. So there is a way to do this, I have done so on many websites, I
just don't have the time at the moment to dig deeper into how/if TiddlyWiki
itself is coded for this, but it is possible with Node.JS.
Regarding your links to your PDF files, I used to make this same mistake
too. You need to use *relative external links* instead. The link format
is a little different from what you may have been doing, but it saves you a
lot on typing too.
I used to load PDFs into a browser tab and copy the URL into TiddlyWiki
before I realized *relative external links* were available.
./TWDataFiles/PDFs
./TWDataFiles/PDFs/Instant TiddlyWiki Development.pdf
[ext[Instant TiddlyWiki Development|TWDataFiles/PDFs/Instant TiddlyWiki
Development.pdf]]
Notice that you need to not use the conventional [[title|link]] but
instead use [ext[title|link]] instead.
There is actually some good documentation on external links here [Linking
in WikiText]
<http://tiddlywiki.com/static/Linking%2520in%2520WikiText.html>.
Good luck,
-Doug
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b0714c6f-bcda-4d40-870d-1ee3ea3fba24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeff Vance
2017-04-16 16:50:32 UTC
Permalink
Hi Mark: this is interesting. Exploring your idea of using another
node.js application to serve files, I found this:

https://github.com/indexzero/http-server

I tried it on its own and it works very well, but not sure how to make it
play nicely with TiddlyWiki. Maybe there is some sort of conflict running
them together and resolving the host. Starting the file server from the
root of the relative path, I could navigate to any file via localhost (when
TW is not running). But when TW server is running, the file paths don't
work anymore.
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/ddbd81c0-de63-439c-ad34-77b1fa297adb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Mark S.' via TiddlyWiki
2017-04-16 18:47:18 UTC
Permalink
Yes, that's the one I tried also.

It appears that you can't run both services on local host. But you can
specify your host IP number for each (which is what you want if you want
other devices on the network to see your tiddlywiki). But you need to
specify a different port number. So maybe 8080 for the TW and 8090 for the
images. Just tested and this appears to actually work.

This means you can't use relative paths since you're going to have specify
the IP:port for any image or file you're serving up. It's effectively the
same as if you were referencing an image on a website somewhere.

Good luck!
Mark
Post by Jeff Vance
Hi Mark: this is interesting. Exploring your idea of using another
https://github.com/indexzero/http-server
I tried it on its own and it works very well, but not sure how to make it
play nicely with TiddlyWiki. Maybe there is some sort of conflict running
them together and resolving the host. Starting the file server from the
root of the relative path, I could navigate to any file via localhost (when
TW is not running). But when TW server is running, the file paths don't
work anymore.
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/888fcb4a-bca5-438f-97ba-73b43a13b0b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeff Vance
2017-04-16 16:09:33 UTC
Permalink
Ok, thanks for the clarification and tips! I was not using relative
external links before (I wasn't aware that was possible). I'm definitely
switching to that way of linking now. Especially since most of the stuff I
link to are in a dropbox folder and I'm running out of storage (for the
free service). So I'm probably going to move everything to a different path
now.

I'm thinking I might just avoid the node.js setup, however. I liked the
idea of it, and if it's a pain to set it up to link to other files, it's
not worth it to me. One benefit I noticed is the node.js version was
running faster when I would save changes or delete tiddlers. My .html
version has gotten fairly big and there is now a slight delay (maybe 0.5
seconds) when it saves changes. But the node.js version is instant. I also
sync my TW in dropbox, so I liked the idea of only syncing smaller files
with each change, rather than the entire thing. But linking to PDFs is far
more important for me.
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/60ebe6b9-8ac3-4f2a-92d7-a7c27e0b478d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...