I can tell you the clunky way I did it for the Fountain parser.
I took the entire code for the fountain javascript library and put it in a
tiddler:
$:/plugins/MAS/fountain/fountain.js
I marked it
type: application/javascript
module-type: library
Inside the parser/wrapper I referred to the code like this:
var fountain = require("$:/plugins/MAS/fountain/fountain.js");
and was then able to use fountain.parse(text) directly (which was the only
thing I needed from the code).
Perhaps someone can explain a better way of doing this -- particularly if
you want to leave the library on the disk so it doesn't bloat your TW.
Good luck!
-- Mark
var fountain = require("$:/plugins/MAS/fountain/fountain.js");
On Thursday, January 18, 2018 at 8:02:15 AM UTC-8, Diego Mesa wrote:
>
> Hello All,
>
> I am wondering if anyone knows of any existing tutorials/examples of
> adding and using external libraries within TW. I've found some examples to
> study, but its slow going (for me).
>
> Best,
> Diego
>
--
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/10d0a4b9-1206-4339-8476-d5ab42458910%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.