Markdown Preview, plugin to add Markdown support to Gedit

about plugin markdown preview

In the next article we are going to take a look at the Markdown Preview plugin for Gedit. If you are one of the users who likes the Gedit text editor and you want to add preview support for Markdown, this plugin is possibly what you are looking for.

As GNOME users know, the default text editor does not support Markdown by default. But thanks to the fact that if it supports plugins, we will be able to add the Markdown Preview plugin and thus be able to dispose of Markdown support in the latest versions of Gedit (from version 3.22).

General features of Markdown Preview

markdown preview plugin options

  • Gedit Markdown Preview is a plugin for this editor that automatically detected when opening .md files in Gedit and when it does, it opens a panel in the sidebar with a preview of the Markdown file. We will also be able to disable the automatic opening of this panel and run it manually from the menu VIEW by Gedit.
  • This Markdown preview allows you to zoom in or out, find and open links and insert images.
  • Preview is not automatically updated by default, but we can click on the 3-dot menu at the bottom right of the preview area and enable auto-reload from there. We can also manually update the preview using the button Update on the left side of the preview window.

markdown preview plugin working

  • This Gedit plugin also helps with Markdown editing. It will add a right mouse click menu to the documents from where we will be able to insert markdown tags like bold, italic, ordered or unordered list and more. It will also allow us to easily insert an image into the file. Markdown tags can be inserted using keyboard shortcuts, although we will only find some tags / shortcuts in plugin settings as this feature is under development.
  • This plugin use python3-markdown or pandoc like to print the preview or export it.
  • Markdown files can be export using Gedit Markdown Preview plugin to HTML when using python3-markdown: PDF, TEX, DOCX, ODT, TXT, PPTX, RTF or HTML / JS (using slideshow.js slideshow - still in development ) using pandoc. A style sheet can be applied to the exported HTML.

May See all the features of this add-on in the GitHub page of the project.

Install the Markdown Preview plugin on Gedit

On distributions like Ubuntu, We will need to have Gedit installed before installing this add-on. As a note say that Gedit can be used with any desktop environment, and not just with GNOME.

Install the required dependencies.

To use Markdown Preview we need to install the dependencies and Git to get the latest published code. We can do this by opening a terminal (Ctrl + Alt + T) and typing the following command:

sudo apt install python3-markdown pandoc gir1.2-webkit2-4.0 git

Get the latest code from Markdown Preview and install it

After installing the dependencies we can download the latest code released today from Markdown Preview using Git. We will do this by writing in the same terminal:

cloning the markdown preview repository

git clone https://github.com/maoschanz/gedit-plugin-markdown_preview

Now we just have to access the newly created folder and run the .sh file to install the plugin listed below:

installation gedit markdow preview

cd gedit-plugin-markdown_preview

./install.sh

The install.sh script that is available can be used to install Markdown Preview with and without superuser privileges. When installed without sudo, the plugin is only available to the current user in ~ / .local / share / gedit / plugins /, while sudo installs it for all users, in / usr / lib / x86_64-linux-gnu / gedit / plugins.

files to uninstall and update the plugin

In the plugin cloned directory we will also find a script update.sh that we can use to update this plugin. Inside the folder we will also find a script uninstall.sh to remove this plugin for Gedit.

In case Gedit was running while we installed the plugin, we will have to close it and start it again.

Enable plugin for Markdown

To enable this add-on we will have to go to Gedit preferences and click on the tab Accessories. There we will have to activate the Markdown Preview plugin.

activate plugin for Gedit

Once enabled, we can access your settings by clicking the button Preferences at the bottom of the window.

plugin preferences

I have to say that as the biggest problem I encountered while testing this plugin, I will say that the preview did not scroll automatically when the source .md document is scrolled. Although this is not a problem that prevents working with the plugin.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.