Accessing Tiddlers from JavaScript

45 views
Skip to first unread message

Vaughn Papenhausen

unread,
May 1, 2020, 7:30:08 PM5/1/20
to TiddlyWiki
I should probably begin by saying that I am the noobiest of noobs. I know nothing about coding, just dipping my toes in for the first time. So I have a super, super basic question.

I'm trying to make a modification to the CodeMirror autocomplete plugin. In particular, instead of autocompleting any word in the current tiddler, or autocompleting HTML, I want it to autocomplete tiddler titles (think Roam Research); basically I'm trying to do what SnowGoon's TW5-extendedit plugin does, except in CodeMirror. But CodeMirror is written in JavaScript, not WikiText. So my question is this: how do I load, say, the text of a tiddler, or the title of a tiddler, into a variable in JavaScript? Is there a list of methods somewhere? Reading through code from SnowGoon's plugin I came across the command "$tw.wiki.getTiddlerData()", but I don't know exactly how it works, or what other similar commands there are. I tried looking through the developer documentation for TW but couldn't find anything (I'm guessing this is because I failed to search well enough rather than because it's not there). Could anyone point me to the correct place in the documentation, or explain how to do this?

TonyM

unread,
May 1, 2020, 9:10:13 PM5/1/20
to TiddlyWiki
Vaughn,

I cant answer your question but this is the kind of request that may make more sense over here https://groups.google.com/forum/#!forum/tiddlywikidev

Place a link to you post there in this thread once completed.

Regards
Tony

Vaughn Papenhausen

unread,
May 1, 2020, 9:24:40 PM5/1/20
to TiddlyWiki
Thanks! I didn't know about that group.

Reply all
Reply to author
Forward
0 new messages