jpfleury / gedit-markdown

Support for Markdown language in gedit
GNU General Public License v3.0
131 stars 29 forks source link

Note: if you use gedit 2 or gedit 3.0 to 3.6, please refer to the documentation of gedit-markdown v1. Below is the documentation of the version 2 for gedit 3.8 and 3.10.

Overview

gedit-markdown adds support for Markdown (or Markdown Extra) in gedit, the default Gnome text editor.

Specifically, it adds:

Default Markdown syntax highlighting in gedit.

Requirements

Installation (or update)

Markdown support will be added for the current user (so no need root privileges). The folder created by the extraction can be deleted after installation.

Uninstallation

Usage

First of all, restart gedit if it's already running.

Syntax highlighting

Syntax highlighting should automatically be activated for files recognized as Markdown files (extensions .markdown, .md or .mkd), otherwise choose it manually by going to View > Highlight Mode > Markup and selecting Markdown.

Plugin Markdown Preview

To enable this plugin, go to Edit > Preferences > Plugins and check Markdown Preview.

Two items are added in the gedit menu Tools:

When right clicking on the preview area, a context menu appears and lists several options. Besides the default ones (previous page, next page, copy, etc.), we have:

Here's a screenshot of the plugin when it's displayed in the bottom panel:

Markdown Preview in the bottom panel of gedit.

Now the same plugin displayed in the side panel (click to see the original image):

Markdown Preview in the side panel of gedit.

Note that when the cursor passes over a link in the preview area, a tooltip displays the URL:

Tooltip displaying URL when the cursor passes over a link.

Snippets

To use Markdown snippets, activate the plugin Snippets in Edit > Preferences > Plugins. Then, go to Tools > Manage Snippets... to see the possibilities.

External tool Export to HTML

To use the external tool, activate the plugin External Tools in Edit > Preferences > Plugins. Then, go to Tools > External Tools > Export to HTML to access the tool. The keyboard shortcut Ctrl+Alt+h does the same. The code of the currently opened Markdown file or the selection will be converted in HTML, and the result will be put in a new document.

To edit the tool, go to Tools > Manage External Tools....

Optional color scheme

An optional color scheme is installed by gedit-markdown. To use it, go to Edit > Preferences > Font & Colors > Color Scheme in gedit and select Classic Markdown. This color scheme is more similar to an HTML rendering, for example strong emphases and headers are in bold and black font, links are blue and underlined, etc. Here's a screenshot of a Markdown document highlighted with this color scheme:

Optional color scheme for Markdown syntax highlighting in gedit.

Configuration file

The configuration file of gedit-markdown is the following:

$XDG_CONFIG_HOME/gedit/gedit-markdown.ini

Most of the time, it will correspond to:

$HOME/.config/gedit/gedit-markdown.ini

The section markdown-preview contains several properties:

Details and limitations

Localization

The plugin Markdown Preview is localizable. The file containing strings is plugins/markdown-preview/locale/markdown-preview.pot.

Development

Git is used for revision control. Repository can be browsed online or cloned.

License

Author: Jean-Philippe Fleury (http://www.jpfleury.net/en/contact.php)
Copyright © 2009 Jean-Philippe Fleury

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Third-party code

The plugin Markdown Preview shipped with gedit-markdown is a modification of the plugin of the same name written by Michele Campeotto, under the GPL v2 or any later version.