vsch / idea-multimarkdown

Markdown language support for IntelliJ IDEA.
https://plugins.jetbrains.com/plugin/7896-markdown-navigator
Apache License 2.0
812 stars 129 forks source link
intellij-plugin markdown-editor markdown-to-html markdown-toc markdown-viewer

Markdown Navigator 3.0

Table of Contents

Overview

Screenshot

Markdown language support for IntelliJ platform

You can download it on the JetBrains plugin page.

Document with pleasure!

Work with Markdown files like you do with other languages in the IDE, by getting full support for:

Two tier model

  1. Previewing, syntax highlighting, basic editing functionality with link completions with split editor preview is available in the basic open source edition. Intended for mostly previewing and editing of Markdown documents without full document format.

  2. Advanced features used for creating and maintaining Markdown documents: refactoring, find usages, validation and auto formatting were available with the Enhanced version, from the JetBrains Marketplace.

    :information_source: The latest release is only to address compatibility issues for newer IDEs from 2021.3 to 2023.1.1.

    It is a full-featured Enhanced version, released without needing a license.

    It is only intended as a measure to allow users, who depended on this plugin for their workflow, to have a working solution until I can figure out if it is possible to continue maintaining this plugin in an economically sustainable manner and return Markdown Navigator Enhanced to the JetBrains Marketplace as a paid plugin, or let it go for good.

Source

The source in this repository is for the unlicensed version of the plugin. As such, it does not have all the features of the enhanced version.

Working with the source

IntelliJ Gradle Plugin development environment. See Building from sources

Some internal details, should you care to know

The pegdown Markdown parser used by the plugin in its original incarnation was changed to flexmark-java and pegdown dependencies have been removed as of version 2.2.0.

flexmark-java is a fork of commonmark-java, with changes:

On the coding end, the new parser is a joy to maintain and enhance. The parser architecture, inherited from commonmark-java, is easy to debug and test. Markdown element parsers have little or no interdependencies with other element parsers making it easy to fine tune parser behaviour on a per-element basis and add parser configuration options to emulate other Markdown processors. All this is in contrast to pegdown's one big PEG grammar implementation with everything potentially inter-dependent.

Background

It all started with a desire to see Markdown files in PhpStorm IDE as they would look on GitHub. I was already using nicoulaj/idea-markdown plugin but found its preview was more like Craig's List than GitHub. It did not appear to have been recently updated, so I decided to fork it and modify its style sheet. How hard could that be?

I found out quickly that there was more to it than meets the eye. Rendering is done by Swing not a browser, the parser is HTML 3.1, with many features not implemented. Additionally, the Table extension did not work in pegdown version used by the plugin.

I upgraded the plugin to use the latest pegdown, parboiled. Fixed a few bugs. I was already in the code, so I might as well add a few more features like user editable style sheet, fix a few more bugs, add updates to preview so that I could split the editor pane and edit in one while seeing the preview in the other.

Now, years later, the plugin is brimming with features to make Markdown editing and creation a breeze. It was a lot more work, and code, than I imagined but more satisfying that I had hoped.

It has been a fun trip down the rabbit hole of IntelliJ IDEA plugin development which started with a simple desire for a Markdown preview that looked like GitHub's.


* This plugin was originally based on the nicoulaj/idea-markdown plugin by nicoulaj, which was based on pegdown library by sirthias.

Markdown Navigator, Copyright (c) 2015-2023, Vladimir Schneider, All Rights Reserved.