Bug 385897

Summary: Click on relative URL tries to open this file
Product: [Applications] kate Reporter: Gregor Mi <codestruct>
Component: plugin-previewAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: wishlist CC: kossebau
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Gregor Mi 2017-10-18 10:00:30 UTC
It would be nice if some documentation is spread over several md files and one clicks on a link that points to another md file, that this md file is opened in Kate and therefore the preview of this new file is shown. Similar how github does it with its README.mds.

This maybe could be implemented if it is possible to report the event of clicking a hyperlink in the Webview back to Kate which then decides what happens, e.g.:

1) relative link to existing file (regardless if .md or not): open this file in Kate. Maybe even another distinction: if this file does not have a preview than the current preview is not changed. This case could be used when the documentation links to relevant source files.
2) relative link to existing folder: check if there is a README.md file and open it.
3) http(s) URL: open in browser
Comment 1 Friedrich W. H. Kossebau 2017-10-27 15:54:34 UTC
Implementation idea brain dump:
This could be done by loading the KParts plugins as Browser/View, thus activating any possibly implemented KParts::BrowserExtension and connecting to the openUrlRequest()/openUrlRequestDelayed() signal.
In the handler to the signal one could then go and poke the KTextEditor manager API to load the respective file, if it is a supported format, and switch view to it (and thus triggering the preview to switch as well), otherwise delegate to QDesktopServices.

The KMarkdownWebView KParts plugin supports that mode already. 

The info bit about being a relative link or not though currently might be missing from the signal, the API does not specify if the url needs to be resolved already.
Comment 2 Christoph Cullmann 2019-05-19 15:05:47 UTC
Dear user, this wish list item is now closed, as it wasn't touched in the last year and no contributor stepped up to implement it.

The Kate/KTextEditor team is small and we can just try to keep up with fixing bugs.

Therefore wishes that show no activity for a years or more will be closed from now on to keep at least a bit overview about 'current' wishs of the users.
If you want your feature to be implemented, please step up to provide some patch for it.

If you think it is really needed, you can reopen your request, but keep in mind,
if no new good arguments are made and no people get attracted to help out to implement it,
it will expire in a year again.

We have a nice website https://kate-editor.org that provides all the information needed to contribute, please make use of it.

Patches can be handed in via https://phabricator.kde.org/differential/

Greetings
Christoph Cullmann