user3055034
user3055034

Reputation: 643

How to use markdown for python with PyCharm?

I'm new to python and I've been using PyCharm (4.5 Community Edition) as my IDE on a Mac OS X v11 system. I've installed the markdown plug-in and enabled the package in pycharm (Actions>Plugins>Markdown is checked, program restart complete).

When I create a new markdown file (test.md or test.markdown) I can see the preview tab. But I don't see anything in the preview tab. Also, I can't "run / execute" this file. So seeing a preview would be nice. Ideally, I would like to be able to execute python chunks with markdown comments in-between and see the output rendered in a local browser if this at all is possible.

This was really easy in the Rstudio IDE and a super powerful way to communicate findings.

Any suggestions? Help much appreciated.

Upvotes: 15

Views: 31033

Answers (5)

vitaliis
vitaliis

Reputation: 4212

Currently PyCharm has two plugin options for .md format: PlantUML and Mermaid.

According to the official docs, in order to enable md support:

  • Go to File -> Settings -> Languages & Frameworks -> Markdown.

    (in recent versions: Pycharm -> Preferences -> Languages & Frameworks -> Markdown)

  • Install either of these plugins.

  • Close and Reopen PyCharm (it did not work instantly for me)

  • In order to see a file preview move a mouse to the upper right corner and select this option.

enter image description here

enter image description here

Upvotes: 8

rustyMagnet
rustyMagnet

Reputation: 4085

The default setting for Markdown files - with a fresh copy of Pycharm - is preview mode only:

preview_only_mode

Just change it to side-by-side mode:

sidebyside_mode

No requirement to install additional plug-ins.

https://www.jetbrains.com/help/idea/markdown.html#preview

Upvotes: 10

torenunez
torenunez

Reputation: 130

I'm on the same boat. Making transition from RStudio to PyCharm. You can install markdown plugins directly within the PyCharm settings. Within Pycharm I searched and downloaded "Markdown support". Once you're editing the Markdown file, you should have a "view" to see the markdown in raw or rendered format and even some formatting buttons like in a normal Text Editor.

I think you need to follow these tag instructions to have the HTML render correctly.

You should also take a look at IntelliLang for language injections, which I think are equivalent to R "chunks".

Upvotes: 5

Kirill Kondratiev
Kirill Kondratiev

Reputation: 107

  1. Uninstall Markdown Support (by Jetbrains) (has no side preview)

  2. Install Markdown Navigator 2.0 (by Vladimir Schneider) (has side-preview)

https://github.com/vsch/idea-multimarkdown

This should give you a per-compiled side view of you .md file.

screenshot

Upvotes: 6

user3055034
user3055034

Reputation: 643

I've found that a much better way to achieve what I was trying to accomplish when I asked this question is to utilize jupyter notebook (jupyter.org/).

Upvotes: 2

Related Questions