Building on a recent question of mine: 
https://groups.google.com/forum/#!topic/tiddlywikidev/8GcocOUuwMU

As before: I am the noobiest of noobs, and have no idea what I'm doing when 
it comes to code, but am attempting to muddle my way through anyway. 

SnowGoon has an awesome plugin 
<https://snowgoon88.github.io/TW5-extendedit/> that allows you to simply 
type "[[" and pop up a list of tiddlers, and search through it by simply 
continuing to type. I'm trying to get the same sort of functionality within 
the CodeMirror editor. CodeMirror has an autocomplete extension, which can 
do things like pop up a list of all the words in the current text field and 
autocomplete from that. What I'm trying to do is push a different list to 
that autocomplete popup: instead of a list of all the words in the current 
text field, I want it to pop up a list of all (non-system) tiddler titles, 
just like SnowGoon's plugin. The CodeMirror plugin would handle everything 
like making the popup show up at the cursor and everything, I just need to 
pass a different list to it. 

I'm pretty sure the filter I need is: [all[tiddlers]!is[system]]. But what 
I'm not sure of is how to make use of this filter. CodeMirror is written in 
JavaScript, not WikiText, so I have to be able to use this filter from 
within a JavaScript tiddler. But most of the documentation I've found is 
for how to do things in WikiText, not JavaScript. 

Here's the closest thing I've been able to cobble together: 

var allTiddlers = $tw.wiki.filterTiddlers("[all[tiddlers]!is[system]]")

But I'm pretty sure I'm still doing something wrong, since it's not doing 
what I want yet. Would this be the way to create a variable called 
"allTiddlers" whose contents is an array of the titles of the non-system 
tiddlers in the current wiki? I.e. if the wiki contains 3 tiddlers, "Test 
1", "Test 2" and "Test 3", I want an array like this: 

allTiddlers == ["Test 1", "Test 2", "Test 3"]

Am I on the right track? If not, how *would *I do this? 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/fb068101-c2d1-402b-9279-d3c91208b2a8%40googlegroups.com.

Reply via email to