Well, I actually managed to figure it out soon after posting this, but the reason for the fix was a little weird so I'll document it for others. It seems that for javascript changes the tiddler doesn't automatically refresh. Instead you need to either: * Close and reopen the page * Click the refresh button in tiddlywiki (you can add it in the tools menu) After that the changes should show up.
On Monday, October 17, 2016 at 1:04:10 AM UTC-7, Erock wrote: > > I have been learning about javascript macros recently and was trying to > create a simple one to start with, but I can't seem to get it to work. I've > read lots of documentation, forums, etc., but still can't seem to figure > out why it won't work. Here is what I've been doing. I set up two tiddlers, > JsTiddler and RunTiddler. I added a very simple javascript macro to > JsTiddler, and set its type = "application/javascript" and module-type = > "macro". Here is the text: > /*\ > title: JsTiddler > type: application/javascript > module-type: macro > \*/ > (function(){ > > /*jslint node: true, browser: true */ > /*global $tw: false */ > "use strict"; > > exports.name = "jstiddler"; > > exports.params = []; > > /* > Run the macro > */ > exports.run = function() { > return "Hello World"; > }; > > })(); > > I then created a second tiddler to import and display the macro called > RunTiddler. This is its text: > <$importvariables filter="[[JsTiddler]]"> > <$macrocall $name="jstiddler" /> > </$importvariables> > > However, when I run this, all I get is a blank tiddler. I have tried > filtering in different ways (such as using tags), but that didn't help > either. I have also been able to use <<now>> and <<version>> in both <<>> > and <$macrocall> syntax, so I know that my wiki can use js tiddlers. Can > anyone tell me what I'm doing wrong? 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+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@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/79ece1ff-76ae-49d7-909d-bc2d0fe8fd4f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.