KTextEditorPreviewPlugin 0.2.0

KTextEditorPreviewPlugin 0.2.0 has been released.

The KTextEditorPreviewPlugin software provides the KTextEditor Document Preview Plugin, a plugin for the editor Kate, the IDE KDevelop, or other software using the KTextEditor framework.

The plugin enables a live preview of the currently edited text document in the final format, in the sidebar (Kate) or as tool view (KDevelop). So when editing e.g. a Markdown text or an SVG image, the result is instantly visible next to the source text. For the display the plugin uses that KParts plugin which is currently selected as the preferred one for the MIME type of the document. If there is no KParts plugin for that type, no preview is possible.

Download from:

ab54382dfd8e88247b53b72fdd9b259feb7c0266300b604db899edf0828677ae ktexteditorpreviewplugin-0.2.0.tar.xz

Signed with my new PGP key
E191 FD5B E6F4 6870 F09E 82B2 024E 7FB4 3D01 5474
Friedrich W. H. Kossebau

Change since 0.1.0

  • Add dropdown menu to toolbar with the main menu of the KParts plugin
  • Add About dialog for the currently used KParts plugin (invokable from the new dropdown menu)


Long term the plan is to merge this plugin into the Kate repository, or some new separate KTextEditor-Plugins repo, ideally already for KDE Applications 17.12.

For now though this plugin is in its own repository to allow an initial independent quick release cycle phase, following the release-often-and-early mantra. With the help of your feedback (file your issue) that should make the features of the plugin the ones you like to have rather soon.

Developers: Improve your favourite KParts plugin

While a usual KParts plugin works out of the box, for a perfect experience with the Automatic Updating option some further improvements might be needed:

A few KParts plugins have already seen such adaptions, like the SVGPart and the KUIViewerPart (see also blog post), adaptions to be released with KDE Applications 17.12.
Another KParts plugin has been written with that in mind from the start, the KMarkdownWebViewPart (see also blog post), which already has been released.

You might want to take some guidance by the respective commit “Support loading by stream and restoring state on reload” to the SVGPart repository.


12 thoughts on “KTextEditorPreviewPlugin 0.2.0

  1. Unfortunately I have problems with the preview of SVG files, I guess because of KParts: the background of SVG files appears in black (I guess because no color is specified), hidding most of its content. Did you experienced sth similar?

      • Oh, actually I recalled it wrongly. SVG files work even better w/o svgpart when using konq-plugins, so kparts uses QtWebengine front-end.

        The problem I was referring to (black background) was actually with preview of DOT files.

        Another issue, of at least version 0.1.0, is that some previews are bigger than available space. It would be nice to 1) zoom in/out the preview to the available space, and 2) be able to adjust the available space.

      • DOT graph files are handled by the KGraphViewer KParts plugin from kgraphviewer. Any issues with it need to be fixed with that. So please help and file your black background issue on https://bugs.kde.org/enter_bug.cgi?product=kgraphviewer

        Adapting the preview to available space (i.e. current width and height of preview tool view) is something which would need support by all the KParts plugins, as the preview plugin just loads the KParts plugin and passes it the data to show. Anything else is left to the KParts plugin. Which usually defaults to 100 % zoom view. There is no abstract interface currently which could be used to instruct KParts plugins to a fit-to-size zoom. Something like that might be interesting for other KParts plugin users, like the Ark preview.

        Again please help and file your wish on bugs.kde.org, here with the KParts framework.

      • Thanks for the great work and for the info wrt kpart plugins. I will submit the issue and wish asap.

        (Cannot reply to your most recent reply, so doing it here)

      • However, somehow dolphin is able to autoscale previews and adjust available space by moving the border of the preview panel left vs. right

      • Dolphin uses a different technology to create the preview: KIO thumbnail generators, which deliver a pixmap for a given file. Those previews are indeed tailored to fit the complete object into the available size by design.

      • I just realized that point #2 is already implemented. One needs to be extremely close to the boundary to be able to shift it, but it works. Would it be possible to increase the hover region for this?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s