$tw.wiki.getTiddlerText('tidname')
Is exactly what I needed, Thank you! thank you!
On Sunday, May 11, 2014 6:18:15 PM UTC-4, BJ wrote:
>
> Hi Devin,
> There are some instructions on managing plugin development see the
> tiddler 'Developing plugins using Node.js and GitHub' on tiddlywiki.com,
> I think that this is the easiest way to develop a plugin.
> Wth regards to your application, the contents of javascript and css files
> that you loaded into a webpage can be placed into tiddlers, (see codemirror
> plugin for example) that will then be automatically loaded. With regards to
> html, generally I think any amount of html can be push in one go -
> div.innerHTML
> = 'all your html' you could store it in a tiddler and access it with a call
> -div.innerHTML = $tw.wiki.getTiddlerText('tidname').
> cheers
> BJ
>
> On Sunday, May 11, 2014 2:56:44 PM UTC+1, Devin Weaver wrote:
>>
>> Many times I have the following thought process and I don't know how to
>> bridge the gap from source code to TW5 plugin. I'll have a neat HTML/CSS/JS
>> snippit working in jsbin.com or jsfiddle.net and wish to add it to a
>> TiddlyWiki document. Because it is multi format (HTML, CSS, JS, maybe a
>> data URI based image) this presents some complication making it a one off
>> plugin. Here is an example use case and workflow I'm in now:
>>
>> I wrote an interactive map using canvas. It draws lines on the map. The
>> map is a JPEG image that the JS reads via a data URI and draws it to the
>> canvas. A table has click events attached to the cells to make the JS code
>> draw arrows on the canvas. This all has four distinct files.
>>
>> So I thought this would be a great tiddler to add to a TiddlyWiki that I
>> could have other documentation tiddler etc. Perfect for a one off
>> documentation document I could pass around the office. Thing is, there is
>> very little info on plugin writing for TW5. I realized that adding it to an
>> empty TW was painful as the entire plugin needs to be packaged into a JSON
>> object. So I had to start with
>>
>> tiddlywiki --init empty
>>
>> and start writing in a plugins folder. This handled the packaging but
>> left me lost as what and where to place the pieces. And then how to
>> integrate them into the TW system. At first I thought this could be a
>> single tiddler but then I started to wonder if it should be a widget or
>> maybe a macro. Not sure.
>>
>> Is there any guidance for writing plugins and the style / organization /
>> conventions one should use? What exports are the plugins supposed to expose
>> and how do you reference data like images to be read and managed via
>> JavaScript (data URI possibly)?
>>
>> Any help pointing me into the right direction would be very appreciated.
>> I'll happily take notes and maybe gather enough to write some tutorials.
>>
>
--
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.