Look what you have done^W^Wdo!

You are using Kate or KDevelop and often editing directly the sources of Markdown files, Qt UI files, SVG files, Dot graph files and whatever else formats which are based on plain text files?

And you are having to use a workflow to check the current state which is saving the file and (re)loading it in a separate viewer application?

Could be better, right? Perhaps like this:

Nice mock-up. Or is it? Seems not! So, KParts-based preview plugin for Kate & KDevelop coming soon near you to a well-stocked package repository? Read the whole story where things are heading.

And a Markdown kpart? Never seen before. Because it is new. Actually seems the week of Markdown in the KDE community, there is also a patch on review to add Markdown support for Okular. Sadly Markdown support in Okular with the Okular kpart would not yet replace that separate Markdown kpart, because Okular does not support webview-style display (single “reactive” page), misses support for data streaming without touching the filesystem, and has too much chrome in the kpart for simple usage. Hope is on the future and somebody (you?) improving that. I am doing my share of improving things with this preview plugin, so I am out 🙂

19 thoughts on “Look what you have done^W^Wdo!

  1. Cool thing Friedrich. One thing I regret re Markdown is that we still have no native previewer for such a simple format while we have previewer for ODF or DOCX…. Web view based code is too easy approach…

    Thanks anyway, one day going to fork kmarkdownwebview.git until it’s supported by distros (might by years).

    • Yes, I feel dirty 🙂 But the Okular markdown plugin could show the way, happy to see that.

      kmarkdownwebview currently moving into kdereview, so first release planned for begin of September.

    • Possibly, and then easy is relative to skills 🙂
      You could try to do the same JavaScript-based hack done in the Markdown kpart: exchange marked.min.js with asciidoctor.js in the code and adapt the index.html file as needed (there are two variants of that file, once for webkit, once for webengine.). See https://cgit.kde.org/kmarkdownwebview.git/tree/src/lib/data

      No personal motivatoin, so left for someone else to scratch their itch here.

  2. Great ! Will it automatically select an available kpart depending on the milme type ? For example, the kgraphviewerpart for dot files ?

    • If there was a kpart which takes tex files as input and internally processes them and displays the resulting document, e.g. the dvi blob, that would work with this. The preview plugin itself just delegates support for individual formats, i.e. loading a kpart and streaming the data of the current document to it.
      I only know of kparts being able to display the dvi files themselves, so those would be of not help here.

      Also, right now the design of this first version of the preview plugin assumes single-source-single-product, means it gets fed the text of the one file for which the preview is done. With tex files one usually has multiple of them to help with document structure, and any include commands would fail to work as the data is not passed from the normal filesystem.

      In theory this could be one day extended to also work for multi-source-single/multi-product formats, like html, tex or even software source code. But that needs quite some planning and work, and no-one has been seen to work on that.

      So the use of dedicated solutions like Kile or KDevelop will stay your (only) choice.

  3. […] The KMarkdownWebView software provides a KParts plugin for rendered display of Markdown files, using web technologies (webpage with JavaScript library which creates HTML from the plaintext handed in). This enables KParts-using applications (like the archiving tool Ark or the file manager Krusader) to show Markdown files in the target format. It is also prepared for the upcoming “Live Preview” plugin for KTextEditor-based applications like the editors/IDEs Kate & KDevelop (see introduction). […]

  4. Doesn’t work for me using KDE Neon (and some others on reddit), since the preview is using the txt backend. If I open the markdown file in Okular, it uses the correct backend. Could be a KDE Neon packaging bug, but I don’t know. Was going to chime in on https://bugs.kde.org/show_bug.cgi?id=360811#add_comment but decided to do so here first, in case it’s not relevant to that report, or if I should create a new report, or what.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.