Help define Editor tool container widget

97 views
Skip to first unread message

Mat

unread,
Mar 22, 2016, 12:27:37 PM3/22/16
to TiddlyWikiDev
I was going to post this on Github as a proposal for a core plugin but realized I need help to define what it should actually do/be;

The idea is basically a generalization of Alain Dutech's Edit-Comp Text plugin, (thread).

As Alain shows, it is possible in edit-mode(!) to have popup trigger from a custom command that can interact with the editor content (and at cursor position).

With the obvious exception of Jeremys recent rich text editor additions, TWs edit-mode capabilities are very limited both in terms of tools to use but, more seriously, in terms of "infrastructure" to create tools for edit-mode. What I need help to define is a "piece of such infrastructure", i.e;

  • a widget(?) that is a generic and customizable "container" for specific tools
  • and this container gives a UI for interaction between those tools and the editor content

One major use of this would be for Intelligent Code Completion like VisualStudios Intellisense. So, for example;

  • Much like in Alain's solution, typing the beginning letters of a macro title could propose the complete title.
  • But it could also be made to (in the popup) display info on the relevant macro parameters.
  • ...even by merely clicking on a macro title, it could display this info or other comments about it.
  • ...nd a link to where the macro is defined.
  • ...nd a peek feature to have it display the definition.
  • ...same features for: style classes, widget defnitions, js-code or other constructs.
  • And for markup tags or other special syntax it could inform on syntactic matters (e.g inserting a newline proposes the missing closing tag, or the "\end" marker in a macro).
  • "Filter error: Missing [ in filter expression" - this old favourite could show already in edit mode
  • Self-recursion warnings
  • Notifications when linking, transcluding etc to missing tiddlers

...etc. In spite of my limited coding skills, it seems to me that if things can trigger from the typing of (or clicking on) specific strings then this should all be doable. And it feels like a general and useful enough concept that maybe it could be a standard distro widget.

Such a popup container might also be an alternative location to display the rich text edit tools in Jeremys current creations.

But I'm not talking about some advanced developers tool - I'm thinking of an end-user widget; A regular user might want that, say, a list of selecatable profile pictures appear as @emplo... is typed. Or simply that a set of predefined text snippets list when the string "byebye" is typed.

SO, I'm asking you to help out in specifying what this "container" should be in defined enough terms for it to be a valid proposal on github.

A generic container (manifested as a popup?), in cursor proximity, triggered by custom strings in edit mode (and perhaps also by clicking on a special string?) that allows the added applicatinos it may feature to interact with the content. The added applications are a separate and later task.

BTW, thinking on how tag(pills) are selected in edit-mode, I'm thinking we might already have parts of this in core - no?

<:-)

Alex Hough

unread,
Mar 22, 2016, 4:41:52 PM3/22/16
to tiddly...@googlegroups.com
Mat,

In hangout 99 didn't Eric demo something similar to the feature you are talking about?

I think he'd tapped into Jeremy's rich text editor architecture...

Best wishes 


Alex
--
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 tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/79a3fb44-0732-4740-9b1c-cbee6acdf7b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mat

unread,
Mar 24, 2016, 7:49:55 AM3/24/16
to TiddlyWikiDev
Alex,
 
In hangout 99 didn't Eric demo something similar to the feature you are talking about?

Ha - in deed! At around 0:46 Eric shows what seems to be pretty much what I'm talking about (ironically, a mere minute before I join the hangout).


@Eric - what are your thoughts on what I'm writing above here about a generic container widget? Does the idea with a user friendly "widget" for this make sense? Are e.g the "Intelligent Code Completion" ideas realistic?


<:-)

CodaCoder

unread,
Apr 1, 2016, 10:29:28 AM4/1/16
to TiddlyWikiDev
I'm writing this without seeing hangout 99, so this could be moot.

Having the product (and scars) to prove it, I've implemented editing tools for my own DSLs in both CodeMirror and Ace.  Ace is, IMO, far, far easier to work with and (perhaps more importantly for TW5 purposes) far easier to hack and extend. (Aside: one of the simplest-sounding yet longest lasting issues I had with CodeMirror, was controlling its width in a flexible and dynamic manner (not something that is needed in TW - you typically don't need to drag the editor itself around the UI)).

My intention when I used Ace was to provide a simple editor that allowed a JSON-like DSL to be displayed and edited such that keyword property names (quoted strings) in the JSON could be coloured as though they were actual keywords in the DSL language.  With that as my brief, I had it working in (comparatively speaking) "no time" and realised I could go a lot further.  Cutting it short, I ended up with an IDE and debugger with watches, stepping, you-name-it.  The editor now has all the bells and whistles you'd expect - line numbers, code folding, search/replace, current item match highlighting... and mostly "for free".  Anyway...

Since TW syntax is primarily "HTML", I'd start with the HTML lang in Ace and build an editor using the current TW structure (i.e. apply Ace to the existing TW textarea element).

Just my 0.02.

Ace: https://ace.c9.io/

Tobias Beer

unread,
Jun 1, 2016, 7:21:20 AM6/1/16
to TiddlyWikiDev
Hi Mat,

This sounds like a very useful concept, some kind of edit-info(-popup).
I think you've already worded it quite well
(except perhaps for how you use the word "infrastructure",
perhaps use "libary" or rather "module" instead, if not "plugin").

Best wishes,

Tobias.
Reply all
Reply to author
Forward
0 new messages