On Monday, November 18, 2013 3:22:49 PM UTC-8, Michael Evans wrote:
>
> I'm trying to implement jtab <http://jtab.tardate.com/> in my wiki. It
> would be used on a good number of pages, so ideally, I want it to be
> includable in tiddlers as a plugin. It requires the libraries jquery,
> raphael, and the jtab script. All three can be found
> here<https://github.com/tardate/jtab/tree/master/javascripts>,
> although from my understanding, jquery is already included in tiddlywiki.
> I would like to somehow make this a plug-in if possible, not link to it
> externally. I've been messing around with no luck. What's the best way for
> me to do this?
>
(note: the following is untested and may not work right)
As you've already noted, jQuery is included in the TWCore, so you don't
need to add that.
To add Raphael (vector graphics library), copy the contents of the
raphael.js source file and paste it into a tiddler.
To add jTab (music notation library), copy the contents of the jtab.js
source file and paste it into the same tiddler as before, following the
Raphael code.
At the end of the tiddler, add the following code:
config.macros.jtab = {
handler: function() { jtab.renderimplicit(null); }
}
Make sure to tag the tiddler with "systemConfig" to make it a plugin. Save
and reload your document. If all goes well, it should load and run the
code you just pasted, which will initialize the Raphael and jTab libraries.
Then, create a tiddler containing:
--------------------
{{jTab{
... jtab syntax goes here ...
}}}<<jtab>>
--------------------
The content inside the {{jTab{...}}} wrapper should use jTab syntax. If
the plugin code is working, the <<jTab>> macro that follows after the
wrapper causes the content within the wrapper to be displayed as jTab
rendered music notation.
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
EVERY DONATION IS IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
http://TiddlyTools.github.com/fundraising.html#MakeADonation
Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
http://www.TiddlyTools.com/#Contact
--
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/groups/opt_out.