Bringing AsciiDoc Preview to KDE Kate

Kate provides an integrated document preview facility for Markdown. Why not offer the same capability for AsciiDoc?

I developed a reusable KDE KPart component that integrates AsciiDoc rendering into Kate’s existing Document Preview infrastructure. A separate compatibility patch for Kate 26.08.3 preserves the original document URL, enabling correct resolution of relative resources during live preview.

AsciiDoc source and rendered preview within KDE Kate

Figure 1. AsciiDoc rendering within Kate, demonstrating successful resolution of relative image paths and included documents.

Implementation

The component receives document content from Kate, invokes Asciidoctor to generate HTML, and displays the rendered document within the application.

The implementation leverages KDE Frameworks 6, Qt, MIME-type registration, and the KParts architecture.

Technologies: C++, Qt 6, KDE Frameworks 6, CMake, Asciidoctor, Git, and Linux.

Design Objectives

  • Integrate with the existing KDE application architecture
  • Avoid unnecessary modifications to Kate
  • Support rendering of document content as it is edited
  • Preserve document-relative resource resolution
  • Provide a reusable component rather than an application-specific implementation

Component Architecture

AsciiDoc KPart component architecture

Figure 2. Component architecture and data flow between Kate, the AsciiDoc KPart, Asciidoctor, and QTextBrowser.

Project Status

Implemented, tested, documented, and published as an open-source project. Submitted to KDE as a feature proposal for upstream consideration.

Project Resources