> In the previous Tiddlers Macro Example I would define the youtubeid at
the start of the Tiddler and it would be used in only that Tiddler. Do I
still do that?
Yes, you do. Each hangout tiddler needs to start with
\define hangoutprefix() TwHo#73
\define youtubeid() EU-H0xhga08
to set up its environment.
The "topiclink" macro then picks these up as $(youtubeid)$ and
$(hangoutprefix)$:
\define topiclink(description, timecode)
<<youtime "$(youtubeid)$" "$timecode$">> ''---''
[[$description$|$(hangoutprefix)$ - $description$]]
\end
By the way, the reason why $description$ and $timecode$ don't have
parentheses inside their dollar signs is that they're the immediate
parameters of the "topiclink" macro itself. The $(blah)$ syntax, by
contrast, looks for "blah" as something defined further out.
> Will I have to eliminate the original macro as I have done some work with
it and would like to keep it?
I was kinda assuming you would delete it. I changed the definitions of
"topic" and "topiclink" to use the "youtime" macro, and your wiki can't
contain both definitions at the same time. If you try to do so, they will
fight each other as you say, and one or the other will win in a pretty
arbitrary fashion.
Sorry I wasn't able to supply you with everything at once! I'm on the TW5
learning curve, too… Can you not search and replace to adjust your earlier
work to the new pattern?
> How do you put a 'Created by X or Y in a Macro.js file?'
The top section of the text, between /*\ and \*/, is a JavaScript comment.
TiddlyWiki expects this comment to start with lines giving "name: value"
information about the macro, but it gives up at the first blank line of the
comment. So feel free to write anything you like after a blank line, but
before the \*/:
/*\
title: $:/.rich/macros/youtime.js
type: application/javascript
module-type: macro
blah blah blah
and some more blah
\*/
> Time code in a consistent format that is 'future proof'
That makes sense, and is why I gave preference to that format as the
parameter to "youtime".
> no 2m3sec for Embedding
Ah. How annoying. I didn't know that. I think you'll need a second macro,
similar to "youtime", that takes the same two parameters ("youtubeid" and
"timecode") and generates whatever's needed for an embed. I think you've
already realised this yourself.
> I use a real Tiddler Name of "TwHo#72 - Eric IndieGogo Update" as Eric
Might Update us in more than one hangout ;)
Indeed! But that's what "hangoutprefix" is for. The revised "topiclink"
macro in my third post in this thread generates just such a link:
[[$description$|$(hangoutprefix)$ - $description$]]
> can I hack your code to create a 'timecode' macro?
Go ahead. It should be a question of changing
var h = bits[0], m = bits[1], s = bits[2], m = h*60 + m*1;
to
var h = bits[0], m = bits[1], s = bits[2], s = h*60*60 + m*60 + s;
and then using "s" (rather than both "m" and "s") in the output. The output
might as well be the whole "iframe" embedding guff.
– æ
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.