Question

I install docutils and pygment for syntax highlighting on rst files. By using command:

rst2html.py file.rst file.html

I can get good result.

When I use pycharm to compose rst file, it has build-in script to comvert rst:

C:\Python27\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 2.5.2\helpers\rest_runners\rst2smth.py" rst2html F:/Dropbox/notes/python/PythonNotes/1.rst F:/Dropbox/notes/python/PythonNotes/1.html

I read the file "rst2smth.py", it seems use system installed docutils command rst2html, but I got html without syntax highlight code snippet. to describe easily, I took a screenshot as below: https://www.dropbox.com/s/frmf933t3kjcvum/pycharm_rst2html.png

is any way to make pycharm to convert rst to html just like the command I use in terminal?

and below is the python interpreter setting on pycharm: https://www.dropbox.com/s/qas4352r4fmi6iq/pycharm_packages.png

Was it helpful?

Solution

It's not possible to change the command used by PyCharm, but you can create your own External Tool with the desired arguments and bind it to a hotkey.

OTHER TIPS

With the newer version of Pycharm (using 3.4 atm), you have the option to create a target for Python docs > Sphinx task. You need to specify the root dir of your docs and the destination dir. You probably need to specifically install sphinx and pygments too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top