Clickable links in editing pane?

124 views
Skip to first unread message

karh...@gmail.com

unread,
Oct 26, 2014, 8:01:48 PM10/26/14
to leo-e...@googlegroups.com
Hi everyone,

I need a feature which (I think) may not be currently supported by Leo. Please comment on the chances that it may be implemented in the future releases.

What I am looking for is the ability to click on HTML-style hyperlinks (word-based anchors) directly within the editing pane, without using the viewrendered pane.
I want to avoid the viewrendered pane at all costs, because using it would be an unnecessary complication, at least for me. Firstly, the notes that I will be writing are plain texts with no formatting, so I don't need the viewrendered pane at all. But above all, I want to the avoid the nuisance of having to go back and forth between the editing pane and the viewrendered pane. Not to mention that it takes up precious space on the screen.
In conclusion, I'd like to be able to do both editing and hyperlink navigation within the same pane. Is this possible?

Thanks

Serg

Terry Brown

unread,
Oct 26, 2014, 8:46:59 PM10/26/14
to leo-e...@googlegroups.com
On Sun, 26 Oct 2014 17:01:48 -0700 (PDT)
karh...@gmail.com wrote:

> Hi everyone,
>
> I need a feature which (I think) may not be currently supported by
> Leo. Please comment on the chances that it may be implemented in the
> future releases.
>
> What I am looking for is the ability to click on HTML-style
> hyperlinks (word-based anchors) directly within the editing pane,

So just to be clear, currently you can Ctrl-click
https://docs.python.org/3/library/http.server.html#http.server.BaseHTTPRequestHandler.responses
or any other link and Leo will cause your system web browser to open
that - unless it's a link like
file:///home/tbrown/some/path/myfile.leo#Top%20Node->Next%20->Target%20Node
which would cause Leo to jump to that node in that file.

So that's there - I think you're asking for "word-based anchors",
meaning that rather than the above verbose and ugly urls, you see only
short phrases like "responses" or "Target Node"... am I right?

Leo doesn't do that but it would be extremely useful if it did. Once
the basic machinery was in place we could have all kinds of responses
bound to short, visually low impact in-text links.

Just not really sure what the most robust / flexible way to implement
it in the body editor would be. The body editor's a text editor,
having separate data associated with specific pieces of text is not
what text editors do, it's what wysiwyg editors do. Leo supports
http://ckeditor.com/demo as an alternate editing environment, but then
the underlying pages are in HTML...

Cheers -Terry

sergei karhof

unread,
Oct 27, 2014, 4:06:41 AM10/27/14
to leo-e...@googlegroups.com
On Mon, Oct 27, 2014 at 12:46 AM, 'Terry Brown' via leo-editor <leo-e...@googlegroups.com> wrote:
 
So just to be clear, currently you can Ctrl-click
https://docs.python.org/3/library/http.server.html#http.server.BaseHTTPRequestHandler.responses
or any other link and Leo will cause your system web browser to open
that - unless it's a link like
file:///home/tbrown/some/path/myfile.leo#Top%20Node->Next%20->Target%20Node
which would cause Leo to jump to that node in that file.

So that's there - I think you're asking for "word-based anchors",
meaning that rather than the above verbose and ugly urls, you see only
short phrases like "responses" or "Target Node"... am I right?

Sure, what I would like to see on the screen, within the editing pane, is just the anchor, e.g. ClickMeToJumpThere, to which the hyperlink is associated. The ugly text of the hyperlink would remain hidden underneath.
 
Leo doesn't do that but it would be extremely useful if it did.  Once
the basic machinery was in place we could have all kinds of responses
bound to short, visually low impact in-text links.

I am very glad that the need and the usefulness of those is appreciated.
I totally agree with you: something with a low visual impact is the best. Since colorizing within the editing pane is already supported, I think we could just have the links indicated with a given color, and that's all you see on the surface. Or, at most, we might enclose the hyperlink's anchor with the < and > characters, so that we would have <ClickMeIAmALink>, but this of course may not even be necessary if we use colorizing. Or we may have both colorizing and the < > convention (or [ ] for that matter).


>The body editor's a text editor,
having separate data associated with specific pieces of text is not
what text editors do, it's what wysiwyg editors do.

I think we may be able to strike a midway compromise here, unless you are willing to go all the way and implement a full wysiwyg mode with hyperlink support, which of course would be very welcome.
I am not familiar with http://ckeditor.com/demo, but I remember trying your rich text editing mode some time ago. It was fine, but IIRC it needed more polishing. If you could build on that and add to it the support for hyperlinks (which may not be as complicated as it might seem), it would be great. Otherwise, simple hyperlink support with colorization in the standard editing pane, as indicated above, would also be fine.

What I looking forward to is a Leo-based fully interconnected wiki-like data system. Are you developers willing to explore the possibility of developing Leo in this direction? Leo would greatly benefit from this enhancement, especially considering that nowadays wikis are very popular.

All the best,

Serg


Edward K. Ream

unread,
Oct 27, 2014, 8:30:37 AM10/27/14
to leo-editor
On Sun, Oct 26, 2014 at 7:01 PM, <karh...@gmail.com> wrote:

> What I am looking for is the ability to click on HTML-style hyperlinks
> (word-based anchors) directly within the editing pane, without using the
> viewrendered pane.

This could be done in a plugin. I have no plans to do so.

Edward

Matt Wilkie

unread,
Oct 27, 2014, 5:37:16 PM10/27/14
to leo-e...@googlegroups.com

On Mon, Oct 27, 2014 at 1:06 AM, sergei karhof <karh...@gmail.com> wrote:
>The body editor's a text editor,
having separate data associated with specific pieces of text is not
what text editors do, it's what wysiwyg editors do.

I think we may be able to strike a midway compromise here,

 A low impact approach (low dev time that is) would be to use syntax highlighting to de-emphasize the structural part of the link:

Development of Leo currently takes place at https://github.com/leo-editor/leo-editor on GitHub.


matt


Matt Wilkie

unread,
Oct 27, 2014, 5:40:32 PM10/27/14
to leo-e...@googlegroups.com
nuts, the autolinking messed that up. Here's a screenshot of what I meant:



Dufriz

unread,
Oct 27, 2014, 6:14:12 PM10/27/14
to leo-e...@googlegroups.com
The de-emphasizing via grey colorizing is not bad, but of course it would be much better if we could hide the ugly text completely.

@Edward: sorry, but what I seem to understand from your short answer is that the proposed feature is not interesting enough. Would you mind commenting a bit more extensively on it?

I really believe that the requested feature, which could be advertized a "wiki support", is very useful and that it would take Leo to a whole new level.

Jacob Peck

unread,
Oct 28, 2014, 9:24:21 AM10/28/14
to leo-e...@googlegroups.com
On 10/27/2014 6:14 PM, Dufriz wrote:
> I really believe that the requested feature, which could be advertized
> a "wiki support", is very useful and that it would take Leo to a whole
> new level.
Not quite on topic, but I find I can get a combination of wiki-like and
mindmap-like behavior out of Leo by using the backlink.py and
graphcanvas.py plugins. Add in the newish nodetags.py plugin, and you
can sort, link, and browse nodes like nobody's business! With
nodewatch.py, you can even have scriptable, dynamic node jumplists :)

Plugins do awesome things, is what I'm saying. But really, they're no
replacement for in-text hyperlinks.

-->Jake

Edward K. Ream

unread,
Oct 28, 2014, 9:39:23 AM10/28/14
to leo-editor
On Mon, Oct 27, 2014 at 5:14 PM, Dufriz <duf...@gmail.com> wrote:

> @Edward: sorry, but what I seem to understand from your short answer is that the proposed feature is not interesting enough. Would you mind commenting a bit more extensively on it?

I wouldn't read too much into short answers. At present, I am focused
on getting a1 out the door, so even good ideas don't get much
attention.

Shorter, better-looking links would be good. The question is, how to
do it? As indicated, the colorizer would almost certainly be
involved...

Edward

Edward K. Ream

unread,
Oct 28, 2014, 9:41:00 AM10/28/14
to leo-editor
On Tue, Oct 28, 2014 at 8:39 AM, Edward K. Ream <edre...@gmail.com> wrote:
> On Mon, Oct 27, 2014 at 5:14 PM, Dufriz <duf...@gmail.com> wrote:
>
>> @Edward: sorry, but what I seem to understand from your short answer is that the proposed feature is not interesting enough. Would you mind commenting a bit more extensively on it?
>
> I wouldn't read too much into short answers. At present, I am focused
> on getting a1 out the door, so even good ideas don't get much
> attention.

The only reliable way to keep my attention is to file an enhancement
item at https://github.com/leo-editor/leo-editor/issues.

EKR

Matt Wilkie

unread,
Oct 28, 2014, 12:11:56 PM10/28/14
to leo-e...@googlegroups.com

On Mon, Oct 27, 2014 at 3:14 PM, Dufriz <duf...@gmail.com> wrote:
I really believe that the requested feature, which could be advertized a "wiki support", is very useful and that it would take Leo to a whole new level.

I think you'll find widespread agreement to that sentiment here. The questions are how to get there and who would/could do it?

matt

Fidel N

unread,
Oct 28, 2014, 12:36:09 PM10/28/14
to leo-e...@googlegroups.com
In case someone ends up digging into this, this code might be useful.
The following script "embeds" an hyper link inside the selected node, but its not clickable for some reason:

c.frame.body.widget.setOpenExternalLinks(True)
c
.frame.body.widget.insertHtml("<a href='http://www.w3schools.com/'>w3Schools</a>")
c
.frame.body.widget.show()

Just copy paste and run in any node body in a new outline (some strange things happen after that).

There, you will just be accessing the body widget, which happens to be a QtTextBrowser Class, which happens to already support html and hyper links.

HTH.

Chris George

unread,
Oct 28, 2014, 1:06:55 PM10/28/14
to leo-e...@googlegroups.com
I think it might need to come up a level of abstraction from there.

I write mainly in rst. Clickable html URLs would be of limited utility to me. The other thing to consider is that when constructing a document, I tend to work in small pieces, each with its own node. I also use clones. Clickable links need to go not only to external documents in external applications to be useful, they also need to go to internal targets, both within the current node and in all other nodes within the current .leo file and other .leo files as well. I currently use bookmarks to assist in this, but full support for rst external, internal, indirect and implicit hyperlink targets in the editor would be awesome. But it would also be of limited utility to someone writing in markdown or html or yaml or xml or Textile or AsciiDoc or...

An alternative would be to develop a hyperlink standard unique to Leo that is commented out of all output rendered from the files. I am not sure how well this approach would work for those dealing with source code though.

Chris
Reply all
Reply to author
Forward
0 new messages