Import into tiddlywiki from URL Link

Folks, I am not sure If I am missing something but is there a way to have a link to a file at a URL within tiddlywiki that triggers an import to that tiddlywiki?

You may know already; if not it may be helpful.

  • if you have a url link to a file you can open it in a new tab or window, r-click in a browser and download it with your browser;
  • If you use the <$browse/> widget you can select files from your computer to import them to tiddlywiki and this includes text, tids and JSON files even tiddlywiki html files from which you can select tiddlers. SInce this is your local system you must use a file open dialogue.
  • Also perhaps less well known, is with the browser widget if you paste a html link to a file on the internet, rather than select from your local files tiddlywiki will import that file into tiddlywiki.
  • Also we can make bookmarklets that contain tiddlers which when clicked are imported to the wiki without a dialogue or the $:/Import process.

My Question;

  • Is there a way we could have a link in tiddlywiki to an internet location that on click would attempt to import that file into tiddlywiki?, in this case triggering/presenting the $:/Import tiddler. A link or button would be fine.

Why?

  • This could allow onclick installs of a plugin, file or data such as a JSON file into a wiki allowing us to simplify complex installation instructions.
  • For safety its fine to insist on needing to click Import in the $/Import tiddler.

Research;

  • All import widgets (but not bookmarklets) seem to demand browsing and or pasting an address.
  • Perhaps a Bookmarklet could be constructed to pull the file from a URL?
  • Links to files to a Browser add on will Import the add on to the Browser, I would like to do this for tiddler content.
  • Tidddloid allows you to import a whole wiki into the app from a URL.
  • Perhaps we need a custom widget or Javascript plugin to facilitate this?

Not at present with just wikitext, though several people have explored this area via plugins which has proven to be very powerful and illuminating. The underlying techniques are either use of iframes, or HTTP requests where allowed by CORS limitations.

I expect that building on those experiences, wikitext affordances for HTTP requests will be introduced into the TiddlyWiki core in the not so distant future and will enable such a workflow with just wikitext.

1 Like

TBH, I think that could have good implications for end users, so long as what they need to DO is simple.

Just a comment, TT

Saq. What you comment highlights of course is how tiddlywiki is hosted. For me the most accessible host is php presently via tw-reciever for single file wikis.

However with docker and other package hosts I hope more of us can get webdav or node implementations soon, especialy multi user bob.

However world this feature be independant of the server?

I would also love file upload plugin for public readonly and private sites.

I am not sure what connection you see here with the saving mechanism for TW.

As mentioned, the usefulness of using HTTP requests would depend on the CORS settings of the server hosting file that you want to download/import. This has nothing to do with what saving mechanism that a server hosted TiddlyWiki uses. I recommend reading more about CORS and then how to configure it for your hosting of choice.

Amongst the free hosting options for single file TiddlyWikis, Github pages support CORS, and I recall having discussions with Simon about enabling it for TiddlyHost though I do not recall what the resolution was.