【问题标题】:how to change command for pycharm to convert rst to html如何更改 pycharm 的命令以将 rst 转换为 html
【发布时间】:2012-08-14 17:56:03
【问题描述】:

我安装 docutils 和 pygment 以在 rst 文件上突出显示语法。 通过使用命令:

rst2html.py file.rst file.html

我可以得到好的结果。

当我使用 pycharm 编写 rst 文件时,它具有用于转换 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

我阅读了文件“rst2smth.py”,似乎使用系统安装的 docutils 命令 rst2html,但我得到的 html 没有语法高亮代码 sn-p。 为了方便描述,我截取了如下截图: https://www.dropbox.com/s/frmf933t3kjcvum/pycharm_rst2html.png

是使 pycharm 将 rst 转换为 html 的任何方法,就像我的命令一样 在终端中使用?

以下是pycharm上的python解释器设置: https://www.dropbox.com/s/qas4352r4fmi6iq/pycharm_packages.png

【问题讨论】:

标签: python pycharm restructuredtext pygments docutils


【解决方案1】:

无法更改 PyCharm 使用的命令,但您可以使用所需的参数创建自己的 External Tool 并将其绑定到热键。

【讨论】:

    【解决方案2】:

    使用较新版本的 Pycharm(使用 3.4 atm),您可以选择为 Python 文档 > Sphinx 任务创建目标。您需要指定文档的根目录和目标目录。您可能还需要专门安装 sphinx 和 pygments。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-11-14
      • 2018-01-19
      • 2018-04-02
      • 2011-04-18
      • 2015-12-07
      • 2021-10-08
      • 2020-02-10
      • 1970-01-01
      相关资源
      最近更新 更多