2

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

CSJ
  • 2,709
  • 4
  • 24
  • 30
  • 1
    You can configure it as an external tool: http://www.jetbrains.com/pycharm/webhelp/configuring-third-party-tools.html. – CrazyCoder Aug 14 '12 at 18:24
  • it works by using external tool, that I can specify many detailes, thanks a lot :D – CSJ Aug 15 '12 at 03:31

2 Answers2

3

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.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
0

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.

Laur Ivan
  • 4,117
  • 3
  • 38
  • 62