Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-07-27 16:21:09

Danielsan
Member
Registered: 2017-11-22
Posts: 66

Adding a markup syntax to Mousepad!

Hi guys,

is there any method, besides opening a bug request, to add a mark-up syntax to Mousedpad?
I'd love adding support for GemText the Gemini mark-up which is pretty trivial itself!

Thanks!


Debian ~ Devuan & FreeBSD + XFCE = <3

Offline

#2 2022-07-27 17:48:39

KBar
Moderator
Registered: 2021-11-05
Posts: 689

Re: Adding a markup syntax to Mousepad!

Hi.

Mousepad uses a GNOME library for syntax highlighting. It's called GtkSourceView. Besides opening a new issue, you can write your own language definition. You can use one from many of the supported markup languages as a reference point. You can list them with the following command:

grep -rl 'section="Markup"' /usr/share/gtksourceview*/language-specs/

Last edited by KBar (2022-07-27 17:56:03)


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#3 2022-07-27 19:38:37

Danielsan
Member
Registered: 2017-11-22
Posts: 66

Re: Adding a markup syntax to Mousepad!

Thank you!

The #xfce-dev IRC Channel just redirect me here.

I hope that modifying an existing file can be enough.

I keep this thread to keep everyone posted!

Last edited by Danielsan (2022-07-27 19:48:24)


Debian ~ Devuan & FreeBSD + XFCE = <3

Offline

#4 2022-07-27 19:46:05

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,950

Re: Adding a markup syntax to Mousepad!

Here is a draft one that didn't get merged into gtksourceview. Perhaps you can try it out/use it as a base?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2022-07-27 19:49:13

Danielsan
Member
Registered: 2017-11-22
Posts: 66

Re: Adding a markup syntax to Mousepad!

ToZ wrote:

Here is a draft one that didn't get merged into gtksourceview. Perhaps you can try it out/use it as a base?

Ooh! Cool!

This surely will help a lot!

Thanks! big_smile


Debian ~ Devuan & FreeBSD + XFCE = <3

Offline

#6 2022-07-27 20:11:04

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,950

Re: Adding a markup syntax to Mousepad!

Seems to work fine in gtksourceview4 - seems to have some problems in gtksourceview-3.0. To use it, paste the content of that merge request into ~/.local/share/gtksourceview-4/language-specs (create the directory if it doesn't exit) and restart mousepad. The entry will show up in the "Markup" section.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2022-07-27 20:12:53

Danielsan
Member
Registered: 2017-11-22
Posts: 66

Re: Adding a markup syntax to Mousepad!

Indeed, doesn't not work in gtksourceview-3.0 and it is not trivial as I hoped, not at all... sad


Debian ~ Devuan & FreeBSD + XFCE = <3

Offline

Board footer

Powered by FluxBB