Implementing Markdown Plugin in Custom intelliJ Plugin


I'm creating an intelliJ plugin that displays a markdown file for developers in a toolWindow side panel. I want the rendering to be the same as how a regular markdown file looks like in intelliJ, like how the markdown plugin is. Is there a possibility that I can implement the markdown plugin into my own plugin, so that I can have my plugin display the md files the same way? Thanks!

Official comment

Hi Katherineliu, you can use org.intellij.plugins.markdown.ui.preview.jcef.MarkdownJCEFHtmlPanel for that. Use it's getComponent() method to get the Markdown view component that can be added to your UI hierarchy. To set the preview content, use setHtml(String, Int) method.

To use this component you will need to add a dependency on Markdown plugin.

In MarkdownJCEFHtmlPanel how to add wrap the hight with the size of text?


Please sign in to leave a comment.