2

Is there a plugin/xml file or any way to extend the capability of Kate to highlight Markdown?

I am really comfortable with Kate (using version 15.12.3) and I use it to write logs. For plain-text readibility I use Markdown, since it is a Markup language that (in my opinion) doesn't need compilation to look pretty. However, Markdown-syntax-highlighting helps!

Luckily, Kate supports some basic syntax highlighting, like highlighting headers (when using #), italic (using * or _), indents, inline code (using backticks) and lists (using - or 1. / 2. / ...).

However, some interesting features are missing, e.g. like bold text (using ** or __) highlighting headers in underline style:

h1: my header
=============

h2: my sub header
-----------------

and most importantly for me the syntax highlighting without indent, using backticks:

a syntax block in markdown can be started with indents (4 spaces):

    code()

but also with 3 backticks:
```
code()
highlight.me{}
```

only in the backtick syntax we can use a notation 
that some tools convert to language specific highlighting

```
public class HelloWorld {
   public static void main(String[] args) {
     System.out.println("Hello, World");
   }
}
```

Since I use this in plain-text markdown to write code that I can copy and paste without indents, I'd love if Kate would be able to recognize this as code. So are there syntax highlighting extensions for enhanced Markdown support in Markdown?

0

I don't think it is possible to just extend the syntax highlighting with preserving the original functionality, but you can definitely create your own template. You can find a documentation for how to do this on the official KDE site:

https://docs.kde.org/stable5/en/applications/katepart/highlight.html

As you probably don't want to be starting from scratch, you can use this as your base file:

https://github.com/jgm/skylighting/blob/master/skylighting-core/xml/markdown.xml

I would post here a link to some markdown highlighting file on the official KDE site or their git, but I couldn't find anything useful, unfortunately. After creating the .xml file you want, you need to save it to a specific location so Kate can find it. On my version of Linux (Linux Mint 19 Cinnamon), the path is

/usr/share/katepart5/syntax

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.