Skip to content

markdown-preview: Add Markdown preview plugin#41

Open
vkareh wants to merge 2 commits intomasterfrom
markdown-preview
Open

markdown-preview: Add Markdown preview plugin#41
vkareh wants to merge 2 commits intomasterfrom
markdown-preview

Conversation

@vkareh
Copy link
Member

@vkareh vkareh commented Oct 16, 2025

This plugin uses the new right pane in Pluma to display a real-time rendering/preview of a Markdown file. It uses WebKit2 and only relies on core markdown plugins in python.

Needs python3-markdown (or whatever the lib is named in your distro).

Also moved the sourcecodebrowser plugin to the new right panel.

Needs mate-desktop/pluma#718

Markdown Preview plugin:
Screenshot at 2025-10-15 16-51-57

Source code browser plugin on right side:
Screenshot at 2025-10-16 08-18-35

@Cyrille37
Copy link

Yeah! That's a so great feature 💌

@lukefromdc
Copy link
Member

Is there a test file for this? This is one of those things I don't know anything about

@vkareh
Copy link
Member Author

vkareh commented Dec 5, 2025

@lukefromdc

Is there a test file for this? This is one of those things I don't know anything about

Try the README.md file in this repo. The .md extension is for Markdown, which is what we generaly use in MATE.

@lukefromdc
Copy link
Member

lukefromdc commented Dec 5, 2025

I was unable to build pluma-plugins due to a libpeas issue blocking the build at the word-completion plugin:

                 from pluma-word-completion-plugin.c:29:
/usr/include/libpeas-1.0/libpeas/peas-extension.h:26:10: fatal error: girepository.h: No such file or directory
   26 | #include <girepository.h>
      |          ^~~~~~~~~~~~~~~~


Debian has rebuit libpeas 1.36.0 (1.36.0-8) to declare "breaks" against current eom and eog prior to a certain commit. I don't know much about libpeas but pluma without the plugins package is working fine with libpeas 1.36.0-5

libpeas (1.36.0-8) unstable; urgency=medium

  * Team upload
  * d/control: Increase version of Breaks on eom and pluma.
    Version 1.28.0-1 of each package was uploaded to unstable, so we'll
    need a correspondingly newer upload with the changes for #1118496
    and #1118497.
  * Release to unstable (transition: #1118613) (Closes: #1118363)

libpeas (1.36.0-5)

@vkareh
Copy link
Member Author

vkareh commented Jan 14, 2026

@lukefromdc I think your solution for the time being may be to install libgirepository1.0-dev to work around those Debian changes.

Long term I think pluma-plugins (and possibly other packages in MATE) need to explicitly depend on girepository (and handle 1.0 or 2.0 gracefully, or through a build flag)

@vkareh
Copy link
Member Author

vkareh commented Jan 20, 2026

This should work now with the latest commit from Pluma (I've rebased mate-desktop/pluma#718 from master)

@lukefromdc
Copy link
Member

Got this error on an attempted test build during configuration:

configure.ac:28: installing './compile'
configure.ac:22: installing './missing'
configure.ac: error: AM_GNU_GETTEXT used but SUBDIRS not defined
plugins/bookmarks/Makefile.am: installing './depcomp'
autoreconf: error: automake failed with exit status: 1

@vkareh
Copy link
Member Author

vkareh commented Mar 3, 2026

The AM_GNU_GETTEXT used but SUBDIRS not defined error usually happens when gettext's infrastructure isn't properly initialized before running autoreconf.

I think having both autopoint and gettext-devel is necessary here. Can you reproduce this in master?

@lukefromdc
Copy link
Member

lukefromdc commented Mar 6, 2026

A build from git master just went fine, and then from the same directory switching to this branch , configuring again, and building again also appeared to work but (EDIT) it did NOT. The terminal text completed and did not show an error, but none of the binary files actually got built. In master they showed up fine

@mbkma
Copy link
Member

mbkma commented Mar 7, 2026

Looks very nice, I compiled and ran it today. An issue I found was when clicking on a link in the markdown preview, the website opened inside the markdown preview. Expected would be in a web browser.

@vkareh vkareh force-pushed the markdown-preview branch from d484feb to 5467d41 Compare March 9, 2026 16:29
@vkareh
Copy link
Member Author

vkareh commented Mar 9, 2026

@mbkma good catch, thanks for pointing that out!
I added a signal catch to make sure any navigation happens outside in the default browser app. I also cleaned up a few things in the plugin code.

@vkareh vkareh force-pushed the markdown-preview branch from 5467d41 to 5ea2093 Compare March 17, 2026 15:38
Copy link
Member

@mbkma mbkma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The links now open in the browser as expected.

However, there are still issues with the Markdown plugin:

  • When opening a Markdown file, the preview does not appear immediately. I need to close and reopen the file for the preview to show.
  • When closing a .md file, the preview remains visible instead of being cleared.

Both behaviors should be addressed.

Peek 2026-03-19 20-03

@vkareh vkareh force-pushed the markdown-preview branch from 5ea2093 to 13521cb Compare March 20, 2026 17:48
vkareh added 2 commits March 20, 2026 13:55
This plugin uses the new right pane in Pluma to display a real-time
rendering/preview of a Markdown file. It uses WebKit2 and only relies on
core markdown plugins in python.

Needs python3-markdown (or whatever the lib is named in your distro).
Since this plugin provides ctags, which are often presented on the right
side in most IDEs, we can move this plugin to show in Pluma's new right
side panel to be consistent.
@vkareh vkareh force-pushed the markdown-preview branch from 13521cb to 62a46fa Compare March 20, 2026 17:55
@vkareh
Copy link
Member Author

vkareh commented Mar 20, 2026

@mbkma just added a function to show the pane when the active document is markdown and a call to load the placeholder text when the active document is not markdown.

@vkareh vkareh requested a review from mbkma March 20, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants