While this is all complicated and helpful, I can see it's possible my
intent was missed.
I have 5 Tiddlers called Monday Tuesday Wednesday Thursday and Friday
Their contents are essentially a list of activities, with procedures/
times/etc for each of those days. Clearly I could use Outlook or
something, but the need for more contextual information for each
procedure, each step, is a need Tiddlywiki meets nicely.
I'd like to have the DefaultTiddlers contain a code of some kind that
will open the tiddler for the day of the week.
If it is Tuesday, I would like the Tuesday tiddler to be one of the
ones that opens. (I have other static tiddlers specified as well.)
Hope this helps figure out a simple and direct/single solution for me.
On Sep 24, 6:03 pm, Eric Shulman wrote:
> > I'm trying to make a link out of the day. I have certain daily
> > functions I perform, and their procedures are listed under a wiki of
> > the day [[Monday]] etc. Well I recently learned about macros < > DDD>> does pull up the name of the day, but I cant seem to make it
> > into a link in any conventional way. Anyone?
>
> Unfortunately, because of the way macros work in TW, it's not possible
> to combine the "output from a macro" with some surrounding syntax and
> then have that combination parsed as if it had been entered as text.
>
> For example, using a macro inside the PrettyLink syntax, like this:
> [[text to show|<>]]
> is *not* valid TW syntax.
>
> The reason is that when a macro is invoked by the TW core's "wikify()"
> engine, it doesn't generate *text* that is inserted into the source
> and then parsed to produce the final rendered result. Rather, each
> macro is responsible for rendering it's own output (if any) by
> directly generating browser DOM elements into a containing 'place'
> that is passed to the macro by the core engine.
>
> Fortunately, there *are* several ways to create dynamically-assembled
> output, depending upon your specific needs. One method uses only TW-
> native syntax by combining 'hidden sections' and 'transclusion with
> evaluated parameters'. For example, you can put the following in a
> tiddler named [[LinkToToday]]:
> /%
> !show
> [[$1]]
> !end
> %/< with: {{new Date().formatString('DDD');}}>>
> you can then embed this output into another tiddler's content, like
> this:
> <>
>
> Alternatively, you can use this plugin:
> http://www.TiddlyTools.com/#WikifyPlugin
> to do something very similar, with a more compact syntax:
> <>
>
> You could also use this plugin:
> http://www.TiddlyTools.com/#DatePlugin
> which provides a variety of enhanced date display, link and advanced
> popup features, allowing you to write:
> <>
> to create the desired link.
>
> ...and, if that's not sufficient, with this plugin:
> http://www.TiddlyTools.com/#InlineJavascriptPlugin
> you can use almost any javascript-programmed logic you want to
> generate dynamic output, like this:
>
> var day=new Date().formatString('DDD');
> if (['Saturday','Sunday'].contains(day))
> return "It's the weekend... go out and play!";
> else
> return "[["+day+"]]";
>
>
> However... based on this further bit of info from you:
> "To add today's Tiddler to the DefaultTiddler"
> it would seem that none of the above is quite the right fit, because
> what you want to do is alter the content of [[DefaultTiddlers]] so
> that it affects *startup processing*.
>
> Unfortunately, the previously described techniques are all used to
> generate linked date output *within a rendered tiddler*, which occurs
> long after startup processing has been completed.
>
> Fortunately, there is still a relatively easy way to do what you
> want...
>
> 1) Start by creating a tiddler (give it a name like
> [[SetDefaultTiddlersPlugin]])
> 2) Enter the following javascript code:
>
> //{{{
> var now="[["+new Date().formatString('DDD')+"]]";
> config.shadowTiddlers['DefaultTiddlers']=now;
> //}}}
>
> 3) Add the 'systemConfig' tag (to indicate that this is a plugin)
> 4) Press 'done'
> 5) Delete (or rename) any existing [[DefaultTiddlers]] (so that the
> shadow tiddler will be applied the next time the document is opened)
>
> When the document is saved-and-reloaded, the tiny plugin you just
> created will be invoked during startup, and the DefaultTiddlers shadow
> content will be updated with a link to the current day name. Then,
> when the DefaultTiddlers definition is *applied* (near the end of the
> startup process), the desired day-named tiddler (e.g., "[[Monday]]",
> "[[Tuesday]]", etc) will be automatically opened, based on the content
> your plugin has written into the shadow tiddler.
>
> QED.
>
> enjoy,
> -e
> Eric Shulman
> TiddlyTools / ELS Design Studios
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to tiddlywiki@googlegroups.com
To unsubscribe from this group