On the fly completions/suggestions

215 views
Skip to first unread message

Alain Dutech

unread,
Sep 10, 2014, 7:58:44 AM9/10/14
to tiddl...@googlegroups.com

I have tried to search this forum but found no mention of feature that I would find awesome.

So, is it possible, when you are editing a tiddler (for exemple its body field) to "monitor" what the user is typing and suggest some completion based on the current word.

For example, I already have a tiddler "HolidayLocation" and I'm editing the content of another tiddler.
I'm typing "When we arrive at Hol"
the editor suggests "[[HolidayLocation]]" based on the existing tiddlers.
I type ENTER to validate and keep typing, or wave it out by keeping typing "lyday Inn" :o)

The suggestion could be shown in a popup, with several choices if any. Selection with arrow ? ENTER to validate ? ESC to wave out...

Well, I hope I'm clear.

Has it be done? How? Could it be done ?

Cheers,
Alain

c pa

unread,
Sep 10, 2014, 6:38:52 PM9/10/14
to tiddl...@googlegroups.com
Alain,

(From the Tiddlywiki roadmap)

Some important features were deferred to be added after the beta:

  • Keyboard snippet expansion in the text editor
Chime in anyone if there is a plugin out there that does this

Alain Dutech

unread,
Sep 11, 2014, 2:36:44 AM9/11/14
to tiddl...@googlegroups.com
Thx for the answer. I'll wait then :o)
Should I learn javascript in the meantime to help the developpers ?

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/JPLow_GBP9U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Stephan Hradek

unread,
Sep 11, 2014, 3:14:05 AM9/11/14
to tiddl...@googlegroups.com


Am Donnerstag, 11. September 2014 08:36:44 UTC+2 schrieb Alain Dutech:
Thx for the answer. I'll wait then :o)
Should I learn javascript in the meantime to help the developpers ?

It's never wrong to learn something new.

Alain Dutech

unread,
Nov 18, 2014, 7:20:53 AM11/18/14
to tiddl...@googlegroups.com

Hello,
I am "upping" this topic again.

I am still looking for a way to suggest "link completions" in tiddler editing.
For example,
I'm typing "When we arrive at [[Hol"
the editor suggests "[[HolidayLocation]]" based on the existing tiddlers.
I type ENTER to validate and keep typing, or wave it out by keeping typing "lyday Inn" :o)

If this functionnality does not exists, could someone point me to some starting point. I'm even willing to help develop a plugin for this.

Alain

Danielo Rodríguez

unread,
Nov 18, 2014, 5:03:32 PM11/18/14
to tiddl...@googlegroups.com
This is a non trivial request since it requires parsing what you are writing on each key press. Code mirror can do this,but is not implemented in the current plugin and it is not easy to implement.

Tobias Beer

unread,
Nov 18, 2014, 5:29:09 PM11/18/14
to tiddl...@googlegroups.com
I think I'd much rather prefer an extensible toolbar that allows inserting all kinds of content, e.g. macro skeletons.

For example, with the ui to add a new tag being (a bit more of) a generic thing, it could be reused to...
  1. open the popup using an "insert link" button
  2. filter tiddler titles rather than just tags
    • perhaps with an option to search all tiddlers, including system & shadows
  3. insert a [[link]] at the end of the textfield
Best wishes, Tobias.

Alain Dutech

unread,
Nov 19, 2014, 3:25:43 AM11/19/14
to tiddl...@googlegroups.com
@Danielo : yes, I though this up only after posting and agree that it is a bit difficult. I don't know how much ressources wuold be eaten by parsing the key pressed. I haven't tried codemirro. It would be a difficult task to hack it ? What is the "default" editor used in TW (if any) ?

@Tobias : the toolbar (in the editor ?) would also be a nice idea, yep. Especially if you had a "search form" where entering the first letter of a tiddle gave the opportunity to add the link to this tiddler in the text.

Thanks, both of you, for these feedbacks.
Alain


--

Danielo Rodríguez

unread,
Nov 19, 2014, 4:49:42 AM11/19/14
to tiddl...@googlegroups.com


El miércoles, 19 de noviembre de 2014 09:25:43 UTC+1, Alain Dutech escribió:
@Danielo : yes, I though this up only after posting and agree that it is a bit difficult. I don't know how much ressources wuold be eaten by parsing the key pressed. I haven't tried codemirro. It would be a difficult task to hack it ? What is the "default" editor used in TW (if any) ?

The default editor is a text-area :D
Codemirror provides this kind of functionality for code, but it uses fixed strings and the implementation is not clear for me. Maybe you can adapt to TW. But trust me, I tried, and I failed, and I think PMario tried also, and he failed. This si discouragin since HE is the original creator of the codemirror plugin for TWC
 
@Tobias : the toolbar (in the editor ?) would also be a nice idea, yep. Especially if you had a "search form" where entering the first letter of a tiddle gave the opportunity to add the link to this tiddler in the text.

I have plans to adapt my keyboard snippets plugin to this kind of functionality. Maybe I can implement a hotkey to suggest tiddlers completions, or, at least, complete with the closest one.

Alain Dutech

unread,
Nov 19, 2014, 5:45:58 AM11/19/14
to tiddl...@googlegroups.com



On Wed, Nov 19, 2014 at 10:49 AM, Danielo Rodríguez <rdan...@gmail.com> wrote

I have plans to adapt my keyboard snippets plugin to this kind of functionality. Maybe I can implement a hotkey to suggest tiddlers completions, or, at least, complete with the closest one.

That would be very handy. :o)
I will even try to find the time to look at your keyboard snippet.


And, I'm not an expert at all, but is Ace easier to hack / use / imbed in TW5 than CodeMirror ?

Alain

Tobias Beer

unread,
Nov 19, 2014, 7:12:24 AM11/19/14
to tiddl...@googlegroups.com
Hi Danielo,
 
I have plans to adapt my keyboard snippets plugin to this kind of functionality. Maybe I can implement a hotkey to suggest tiddlers completions, or, at least, complete with the closest one.

This is surely a neat thing but from a dependency point of view I'd turn it the other way around, so that your keyboard shortcuts extend a toolbar widget. Not sure how and when the core will ship with a keyboard widget but it might just be that you'd want that toolbar widget to make use of that eventually, so I wouldn't be overly mingling the two, for now, just my 5 cts.

Rather than a long list of explicit shortcuts for individual actions, I'd much more prefer a single shortcut that opens a well designed popup which lets me select whatever content editing or inserting feature I need. Perhaps a "classic toolbar" as part of the edit-template isn't the most efficient ui for this after all.

Best wishes, Tobias.

Tobias Beer

unread,
Nov 19, 2014, 7:14:04 AM11/19/14
to tiddl...@googlegroups.com
Not sure how and when the core will ship with a keyboard widget...


Best wishes, Tobias.

Alain Dutech

unread,
Nov 26, 2014, 9:51:39 AM11/26/14
to tiddl...@googlegroups.com
Hi,
I've made a toy attempt at on-line link completion in a raw textearea. Tried to have it run on jsfiddle, to no avail. So, you can try it (and get the sources I hope) on
But as I am new to javascript, I could use help/advice to
 - make it cleaner, more javascript like
 - maybe use more efficient libraries
 - understand why my overlay is transparent !!!!
 - update this to a plugin for TW5

Alain

PS : next step is to put it on github (real soon).

--

Mat

unread,
Nov 26, 2014, 11:21:31 AM11/26/14
to tiddl...@googlegroups.com
On Thursday, September 11, 2014 12:38:52 AM UTC+2, c pa wrote:
Chime in anyone if there is a plugin out there that does this

Maybe this list of alternative text expanders software is of use? You can set it to "show by license".

<:-)

Tobias Beer

unread,
Nov 28, 2014, 7:31:12 AM11/28/14
to tiddl...@googlegroups.com
Hi Alain,

Interesting stuff...
 
But as I am new to javascript, I could use help/advice to
 - make it cleaner, more javascript like
 - maybe use more efficient libraries
 - understand why my overlay is transparent !!!!
 - update this to a plugin for TW5

However, on Chrome Win 8 nothing happens.
Firefox works, and it would be nice if the overlay gets focus when pressing the down key.

Best wishes, Tobias.

Alain Dutech

unread,
Nov 28, 2014, 10:21:44 AM11/28/14
to tiddl...@googlegroups.com


On Fri, Nov 28, 2014 at 1:31 PM, Tobias Beer <beert...@gmail.com> wrote:
Hi Alain,

Interesting stuff...
Thx
 
But as I am new to javascript, I could use help/advice to
 - make it cleaner, more javascript like
 - maybe use more efficient libraries
 - understand why my overlay is transparent !!!!
 - update this to a plugin for TW5

However, on Chrome Win 8 nothing happens.
Yep, and I've discovered that it is not working either in Win 7 + (older) Firefox.
So, I'll try to have a look, but I'm more Linux
 
Firefox works, and it would be nice if the overlay gets focus when pressing the down key.
Ok, I'll have a look.

Alain
Reply all
Reply to author
Forward
0 new messages