How to transclude external tiddlers in TW5

1,128 views
Skip to first unread message

David Myers

unread,
Apr 13, 2016, 6:16:36 AM4/13/16
to TiddlyWiki
Hello All.

First of all I would like to thank all those who have worked on TiddlyWiki ~ suffice to say I love it lots and lots.

Recently I've started a number of TiddlyWiki files and I often want to include them into one another.

I know that I can 'import' and external TiddlyWiki from the Tools > Import menu in the side bar.

However  would like to be able to 'transclude' an external wiki into my current one.

My use case:

I am writing my thesis, and use TW to take notes.
I use zotero and BibTex for storing my references. Whic I then import (one at a time) using inmysocks Citations Plugin
However I keep all my citations in a single tiddlywiki file, and then simply import this file into each of my other TiddlyWiki notebooks.

This works fine, but I would really appreciate a way for the TW with the references / citations in to auto update into the currently open TW file (much like how transcluding a tiddler mean I only need a single copy of it and any updates I make are seen wherever it is transcluded.
This functionality exists in TW classic using the SharedTiddlerPlugin or ExternalTiddlersPlugin etc, but currently doesn't seem to be availabe in TW5 (or have I missed something ?)

Another option would be to add in an 'import' button to do this automatically with this specified file.

I found the loadTiddlersFromFile function, but I'm not sure how to call it directly from within the a tiddler. I could place a 'button' within the local references tiddler that could point to the external file.

If anyone can give me any pointers that would be great, I'm fairly new to working on TW.


to this end I attemtped to find the JS code in the empty tiddlywiki file, but I can't seem to find it, as it doesn't seem to be called 'load' or 'import'

Evolena

unread,
Apr 13, 2016, 7:21:03 AM4/13/16
to TiddlyWiki
I don't know how to do that for the standalone version of Tiddlywiki.

But, if you want to give a try to Tiddlywiki on Node.js, you could then define inclusion of your citation wiki into each notes wiki (cf includeWikis). For an example of the configuration, see the tiddlywiki.info for the "prerelease" edition, which only has tiddlers with new functionalities, and includes the main tw5 wiki.

David Myers

unread,
Apr 13, 2016, 7:42:39 AM4/13/16
to TiddlyWiki
I wasn't aware that the Node.js version gave this functionality. However I personally like the 'all in a single file' that is TW's main strong point for me. This means I can send a sigle TW file to a colleague (or post it to a web page) and it will function in place, as it does on my local pc. I now my colleagues will copy the main file around, and break all the links !

I did some more reading, and found the import button is actually a macro call, but can't find any details on the macro.

I would be happy if I could pass it a 'default' location to pick up the external references file, this would be a reasonable work around for my problem, even better if I could get it to select only a certain tiddlers (I clearly don't want to import the titile and subtitle, and a bunch of the other shadow tiddlers, I could add the button and perform the import all in a single mouse click...

Evolena

unread,
Apr 13, 2016, 8:04:45 AM4/13/16
to TiddlyWiki


Le mercredi 13 avril 2016 13:42:39 UTC+2, David Myers a écrit :
I wasn't aware that the Node.js version gave this functionality. However I personally like the 'all in a single file' that is TW's main strong point for me. This means I can send a sigle TW file to a colleague (or post it to a web page) and it will function in place, as it does on my local pc. I now my colleagues will copy the main file around, and break all the links !

You can still generate a single-file tiddlywiki, which will include both the notes and the citations, and share it. It's only that on your file system, the citations are shared between your notes wikis, thus no duplication.

 

I did some more reading, and found the import button is actually a macro call, but can't find any details on the macro.

I would be happy if I could pass it a 'default' location to pick up the external references file, this would be a reasonable work around for my problem, even better if I could get it to select only a certain tiddlers (I clearly don't want to import the titile and subtitle, and a bunch of the other shadow tiddlers, I could add the button and perform the import all in a single mouse click...

Do you know that the "filter" advanced search allow to export the results of the search (in CSV, JSON or HTML file)? You can then filter which tiddler to export (tiddlers not system nor shadow, based on tag, ...). And such a file (at least CSV and JSON) can be directly imported into another tiddlywiki.

Devin Weaver

unread,
Apr 13, 2016, 8:20:05 AM4/13/16
to TiddlyWiki
You're asking for two very different things. On one hand you want the "single page" version and on the other you want "more than one" page version. The two are mutually exclusive.

That said I understand what you want to do and I have two conclusions. First it is not possible in the current setup you are asking for. This is for a few reasons. The single page version is a full HTML page. It would have to download the entire HTML, Parse it, And then selectively import what you need. To do this auto-magically would require a good deal of custom code specific to just your needs. This is why the current implementation relies on a drag and drop from the user and an import confirmation dialog. The manual process is the best general solution to this.

I then did an experiment to see of I could externally include a tid file using _canonical_uri Turns out this method attempts to embed the content not import and so obviously a tid file is something the browser doesn't natively support.

This brought me to the final conclusion: Node.js with includeWikis option. By structuring your content as a few Node.js tiddlywiki directories you could (on your Node.JS dev machine) edit any one wiki in isolation. Then when finish use the download button or the tiddlywiki --rendertiddler command to build the final single page wiki which would include what you want in a single HTML that could be emailed around.

I use the later solution for my home page (and several other single page static sites). https://tritarget.org/ (source https://github.com/sukima/dev-tritarget-org/) My work flow is simple. I execute the node server (tiddlywiki --server) and then open my site in my browser (http://localhost:8080/). Then in the browser I add/delete/edit content to my hearts desire. Then I shutdown the Node.js server, clean up the tiddlers directory, and save the changes to my version control software. Then I simple run a build command which creates my main HTML file (index.html), all the static versions of the pages (https://tritarget.org/static.html), and any external images. Then I simply upload the output (compiled) content to my web server. With this setup you could separate content by multiple wikis or simply separate them in directories since each tiddler is represented as a tid file instead of embedded in a HTML document for storage.

David Myers

unread,
Apr 13, 2016, 9:18:08 AM4/13/16
to TiddlyWiki
@Devin.

I like the sound of your idea, but I worry it will add to my workflow, and I'll end up 'not bothering'  with the exporting, hence leaving my colleagues with a node.js version of my TW file(s). That doesn't mean I won't look to implement this, but I'll need to wait for when I have a bit more time on my hands (and the truth is the 'import' button works remarkably wekk, I just need to remember to do it on a semi regular basis.

@ Evolena.

As I say for Devin, this sound interesting. I hope to find time to incorporation what you both propose into my workflow...

Unfortunately right now I have more pressing things to do, I thought it would be simply a case of finding a way to call the import macro with a pre-set file name, and a grep to exclude all the shadow tiddlers.

however the node.js version is interesting, and I guess I'll look into it in the future...

David

Hegart Dmishiv

unread,
Apr 13, 2016, 11:57:25 AM4/13/16
to TiddlyWiki, Andrew Myers
Hi all,


On Wednesday, 13 April 2016 23:42:39 UTC+12, David Myers wrote:
I would be happy if I could pass it a 'default' location to pick up the external references file

I would also like to find an answer to this, as I have a similar use case in mind, for my TiddlyCRM semester project  for the {{DesignWrite}} course. I've been generating data sets, or batches, of tiddlers from a spreadsheet, which I import regularly via the JSON importing as Evolena described earlier. I can bulk delete this SampleData using this interface (which is transcluded as part of my main navigational system). I'd like to add an extra column to this table, in order to be able to bulk import the respective JSON files, using the same idea that David Myers has elucidated here, of being able to pass a URL (which I could specify in my constants interface) to import a specific JSON file.  I see the tm-import-tiddlers widget message and the BrowseWidget, but neither of these seem to help me achieve what I want to be able to do.

Thanks in advance for any advice offered,

Hegart.

Mark S.

unread,
Apr 13, 2016, 1:17:19 PM4/13/16
to TiddlyWiki
There's supposed to be the ability to link to external tid files using _canonical_uri. However, it doesn't work on my very latest FF, so not sure where it does work. I notice that the link to http://tiddlywiki.com/#ExternalText doesn't exist, so maybe the idea was dropped..

You might look at Tobias Beer's <<external>> plugin and see if it's want you want: http://tobibeer.github.io/tw5-plugins/#external

David Myers

unread,
Apr 13, 2016, 1:43:58 PM4/13/16
to TiddlyWiki
Mark,

That seems interesting, but I would really like to be able to link to the tiddlers in the included file, not sure if that is possible in Tobias' plugin... I need a better look.

I know that this was available in TW classic, such as the inlcude plugin, there is a whole thread here in the TW group discssing it, and it's various offshoots.

The question is how is TW5 so different that these TW classic plugins don't work for TW5 ? Are they relatively easy to make them TW5 compatible ?

Hegart,

I hear what you are saying, if there was a way to create a 'permanent' import external TW file with a bunch of pre set fields that would work for me, add in the required settings a single time in that system tiddler, then just use a 'refresh' button when required would be a workable solution as far as I am concerned. Much like the current import tiddler, but with the location of the external tiddler already available

D

Jeremy Ruston

unread,
Apr 13, 2016, 1:46:34 PM4/13/16
to tiddl...@googlegroups.com
Hi Mark

There's supposed to be the ability to link to external tid files using _canonical_uri. However, it doesn't work on my very latest FF, so not sure where it does work. I notice that the link to http://tiddlywiki.com/#ExternalText doesn't exist, so maybe the idea was dropped..

The documentation is missing, but the feature is present. There are some notes in the release tiddler for the version when the feature was released:


To test it, try visiting this link:


If you see the full text of “Alice in Wonderland”, then it is working. Basically, the tiddler has a _canonical_uri field pointing to a .tid file.

The only browser-specific limitation I’m aware of is that Chrome won’t display external tiddlers when the TiddlyWiki is loaded from a file:// URI. But there are many other gotchas that make external tiddlers pretty tricky to work with if one is only working in the standalone configuration.

Best wishes

Jeremy.


You might look at Tobias Beer's <<external>> plugin and see if it's want you want: http://tobibeer.github.io/tw5-plugins/#external



On Wednesday, April 13, 2016 at 3:16:36 AM UTC-7, David Myers wrote:
Hello All.

First of all I would like to thank all those who have worked on TiddlyWiki ~ suffice to say I love it lots and lots.

Recently I've started a number of TiddlyWiki files and I often want to include them into one another.

I know that I can 'import' and external TiddlyWiki from the Tools > Import menu in the side bar.

However  would like to be able to 'transclude' an external wiki into my current one.

My use case:

I am writing my thesis, and use TW to take notes.
I use zotero and BibTex for storing my references. Whic I then import (one at a time) using inmysocks Citations Plugin
However I keep all my citations in a single tiddlywiki file, and then simply import this file into each of my other TiddlyWiki notebooks.

This works fine, but I would really appreciate a way for the TW with the references / citations in to auto update into the currently open TW file (much like how transcluding a tiddler mean I only need a single copy of it and any updates I make are seen wherever it is transcluded.
This functionality exists in TW classic using the SharedTiddlerPlugin or ExternalTiddlersPlugin etc, but currently doesn't seem to be availabe in TW5 (or have I missed something ?)

Another option would be to add in an 'import' button to do this automatically with this specified file.

I found the loadTiddlersFromFile function, but I'm not sure how to call it directly from within the a tiddler. I could place a 'button' within the local references tiddler that could point to the external file.

If anyone can give me any pointers that would be great, I'm fairly new to working on TW.


to this end I attemtped to find the JS code in the empty tiddlywiki file, but I can't seem to find it, as it doesn't seem to be called 'load' or 'import'

-- 
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 tiddl...@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/026b1358-6cd9-49b7-a8b3-3f339947b548%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeremy Ruston

unread,
Apr 13, 2016, 1:48:07 PM4/13/16
to tiddl...@googlegroups.com
HI David

I know that this was available in TW classic, such as the inlcude plugin, there is a whole thread here in the TW group discssing it, and it's various offshoots.

The question is how is TW5 so different that these TW classic plugins don't work for TW5 ? Are they relatively easy to make them TW5 compatible ?

It’s the browsers that have changed; since TiddlyWiki Classic days all of the major browsers have implemented substantial restrictions on the actions that can be performed from a file:// URI. TWC’s includeplugin doesn’t work like it did in contemporary browsers.

Best wishes

Jeremy.



Hegart,

I hear what you are saying, if there was a way to create a 'permanent' import external TW file with a bunch of pre set fields that would work for me, add in the required settings a single time in that system tiddler, then just use a 'refresh' button when required would be a workable solution as far as I am concerned. Much like the current import tiddler, but with the location of the external tiddler already available

D




On Wednesday, April 13, 2016 at 7:17:19 PM UTC+2, Mark S. wrote:
There's supposed to be the ability to link to external tid files using _canonical_uri. However, it doesn't work on my very latest FF, so not sure where it does work. I notice that the link to http://tiddlywiki.com/#ExternalText doesn't exist, so maybe the idea was dropped..

You might look at Tobias Beer's <<external>> plugin and see if it's want you want: http://tobibeer.github.io/tw5-plugins/#external



On Wednesday, April 13, 2016 at 3:16:36 AM UTC-7, David Myers wrote:
Hello All.

First of all I would like to thank all those who have worked on TiddlyWiki ~ suffice to say I love it lots and lots.

Recently I've started a number of TiddlyWiki files and I often want to include them into one another.

I know that I can 'import' and external TiddlyWiki from the Tools > Import menu in the side bar.

However  would like to be able to 'transclude' an external wiki into my current one.

My use case:

I am writing my thesis, and use TW to take notes.
I use zotero and BibTex for storing my references. Whic I then import (one at a time) using inmysocks Citations Plugin
However I keep all my citations in a single tiddlywiki file, and then simply import this file into each of my other TiddlyWiki notebooks.

This works fine, but I would really appreciate a way for the TW with the references / citations in to auto update into the currently open TW file (much like how transcluding a tiddler mean I only need a single copy of it and any updates I make are seen wherever it is transcluded.
This functionality exists in TW classic using the SharedTiddlerPlugin or ExternalTiddlersPlugin etc, but currently doesn't seem to be availabe in TW5 (or have I missed something ?)

Another option would be to add in an 'import' button to do this automatically with this specified file.

I found the loadTiddlersFromFile function, but I'm not sure how to call it directly from within the a tiddler. I could place a 'button' within the local references tiddler that could point to the external file.

If anyone can give me any pointers that would be great, I'm fairly new to working on TW.


to this end I attemtped to find the JS code in the empty tiddlywiki file, but I can't seem to find it, as it doesn't seem to be called 'load' or 'import'

-- 
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 tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

David Myers

unread,
Apr 13, 2016, 2:24:15 PM4/13/16
to tiddl...@googlegroups.com
Jeremy,

yes I had noticed that my FF beta on my android tablet suddenly didn't work with the Android equivalent of tiddlyfox for editing.
some crazy thing about 'unsigned extensions'

But hey, I guess reducing functionality for the end user is a good thing <grrr>

Everyone seems to be doing the 'apple thing' and adding in new strange and silly restrictions becuase 'we the devs no best'.

The exception seems to be TW, I much prefer 5 over classic. lots of extra things that are really cool (like SVG editing).

I just wish I could use it for my presentations rather than OO impress or powerpoint. I did do so one time, and the profs where really impressed. I think they liked the way it was so easy to link to external sites, and how there was nice consistency between each 'slide' (or tiddler).

Just keep up the good work.

David


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/qWowD8FZsAw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mark S.

unread,
Apr 13, 2016, 2:24:22 PM4/13/16
to TiddlyWiki

Hi Jeremy,

This is the message I see in the tiddler:



Loading external text from ./test.tid

If this message doesn't disappear you may be using a browser that doesn't support external text in this configuration. See http://tiddlywiki.com/#ExternalText



Jeremy Ruston

unread,
Apr 13, 2016, 3:00:59 PM4/13/16
to tiddl...@googlegroups.com
Hi Mark

What browser and operating system are you using?

Thanks

Hegart Dmishiv

unread,
Apr 13, 2016, 3:13:07 PM4/13/16
to TiddlyWiki
On Thursday, 14 April 2016 05:43:58 UTC+12, David Myers wrote:
Much like the current import tiddler, but with the location of the external tiddler already available

That's precisely what I'm trying to achieve.  I don't think the _canonical_uri field will help me here, as I'll be attempting to import multiple different "packages / bundles" of tiddlers from a single tiddler "interface", so I'd need multiple _canonical_uri fields, I think. I'm not sure. If anyone can suggest a way to make this work, so that I can simply add buttons to import these "packages / bundles" of tiddlers from given URLs, that would be awesome.

Hegart.

Mark S.

unread,
Apr 13, 2016, 3:27:31 PM4/13/16
to TiddlyWiki

This is Firefox 43.0.1 on Win 7.

Hegart Dmishiv

unread,
Apr 20, 2016, 5:55:31 PM4/20/16
to TiddlyWiki

Bit of a bump here. I haven't gotten any further with this yet, and I'd really like to. Here's a screenshot of what I'd like to achieve. If anyone can help make it happen, I'd really appreciate it. Thanks.


David Myers

unread,
Apr 21, 2016, 4:19:21 AM4/21/16
to tiddl...@googlegroups.com
Or maybee if they could be selected by their tags.

When I import my 'references and bibliography' I have about 30 tiddlers to import... and it keeps growing.

however they all have the same 'tag' on the tiddlers.

clearly I don't want any of the system tiddlers etc, and the plugin tiddlers I only need to install the first time I do it.

There would be an obvious problem in attempting to import tiddlers that allready exist, so I guess an 'overwrite or ignore' option would be appropriate.

... hmm it seems this is becoming more complicated ?

I guess we need to create a 'specification' for the process.

@Jeremy.
Do you have a system in place for designing the spec for new functionality ?
Is this a function that you think you may like to have ?

I would really love to help with this, but I'm fairly charged with my thesis at the moment (implementing a new data integration / visualisation / sharing / analysis system for a distributed teams of medical researchers trying to find a new HIV vaccine).

David


D

On Wed, Apr 20, 2016 at 11:55 PM, Hegart Dmishiv <hegart....@gmail.com> wrote:

Bit of a bump here. I haven't gotten any further with this yet, and I'd really like to. Here's a screenshot of what I'd like to achieve. If anyone can help make it happen, I'd really appreciate it. Thanks.


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/qWowD8FZsAw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Jeremy Ruston

unread,
Apr 22, 2016, 11:00:46 AM4/22/16
to tiddl...@googlegroups.com
Hi Hegart

The problem here is that all browsers now restrict the ability of pages loaded from a file:// URI to use XMLHttpRequest() to access other files on file:// URIs, so one wouldn’t be able to actually perform the import.

TiddlyFox could perhaps be extended to work around the restrictions.

Best wishes

Jeremy


On 20 Apr 2016, at 22:55, Hegart Dmishiv <hegart....@gmail.com> wrote:

Bit of a bump here. I haven't gotten any further with this yet, and I'd really like to. Here's a screenshot of what I'd like to achieve. If anyone can help make it happen, I'd really appreciate it. Thanks.




--
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.

Jeremy Ruston

unread,
Apr 22, 2016, 11:03:14 AM4/22/16
to tiddl...@googlegroups.com
Hi David

I guess we need to create a 'specification' for the process.

This is a case where the problem isn’t the lack of a spec, but figuring out a way to make the thing work; as noted in my previous reply, browsers restrict file access quite heavily these days. When one is working with the single file, standalone configuration of TiddlyWiki, the restrictions imposed by browsers end up driving almost all of the major design decisions :(

Best wishes

Jeremy


@Jeremy.
Do you have a system in place for designing the spec for new functionality ?
Is this a function that you think you may like to have ?

I would really love to help with this, but I'm fairly charged with my thesis at the moment (implementing a new data integration / visualisation / sharing / analysis system for a distributed teams of medical researchers trying to find a new HIV vaccine).

David


D

On Wed, Apr 20, 2016 at 11:55 PM, Hegart Dmishiv <hegart....@gmail.com> wrote:

Bit of a bump here. I haven't gotten any further with this yet, and I'd really like to. Here's a screenshot of what I'd like to achieve. If anyone can help make it happen, I'd really appreciate it. Thanks.




--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/qWowD8FZsAw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@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/11fec91e-b808-4649-bce8-520ffc8472c8%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
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 tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mark S.

unread,
Apr 22, 2016, 11:45:44 AM4/22/16
to TiddlyWiki
So,  should _canonical_uri work on external files? Or should we expect browsers to block it?

It does not work on mine. I get


Loading external text from test.tid

If this message doesn't disappear you may be using a browser that doesn't support external text in this configuration. See http://tiddlywiki.com/#ExternalText


The test.tid is in the same directory as the TW file. Changing the extension to .txt does not help.

This occurs in TW5 5.1.11 in  Firefox 43.0.1 under Windows 7.

Thanks,
Mark
 

Jeremy Ruston

unread,
Apr 22, 2016, 11:50:26 AM4/22/16
to tiddl...@googlegroups.com
Hi Mark

So,  should _canonical_uri work on external files? Or should we expect browsers to block it?

This discussion is about _canonical_uri with text files; it works differently for images and HTML files (because it can use the <img> and <iframe> tags, instead of having to load the data directly with XMLHttpRequest).

_canonical_uri works with external text files when the TiddlyWiki is hosted on a HTTP URI, and the destination is CORS enabled. It doesn’t work when the TiddlyWiki is hosted on a file:// URI, which is what you are presumably doing.

The only thing that’s still confusing me is your report that visiting the following URL in Firefox on Windows 7 doesn’t work:

http://tiddlywiki.com/#Alice%20in%20Wonderland

Best wishes

Jeremy.
Reply all
Reply to author
Forward
0 new messages