RST with Pygments - zzzz~~~'s Blog

RST with Pygments

zzzz~~~ posted @ 2013年1月16日 14:45 in VIM , 1479 阅读

RST with Pygments

Pygments 为 RST 提供语法高亮度功能,但 docutils 中的 rst2html.py 不支持 Pygments 的 style 功能,下面是一种不修改程序的解决办法。

# 创建独立的 pygments css 文件
echo "pre.code { overflow: auto; }" > ~/.pygments.css
pygmentize -S monokai -f html >> ~/.pygments.css

# --syntax-highlight 使用 short 格式
# --stylesheet-path css 文件路径,多个 css 文件中间用 , 分隔
# html4css1.css docutils 默认的 css 文件
rst2html.py --syntax-highlight=short --stylesheet-path=/usr/lib/python2.6/site-packages/docutils/writers/html4css1/html4css1.css,/home/${USER}/.pygments.css input.rst
Avatar_small
the impossible quiz 说:
2022年1月06日 12:56

Hi to everybody, here every one is sharing such knowledge, so it’s fastidious to see this site, and I used to visit this blog daily

Avatar_small
JK 11th Question Pap 说:
2022年8月26日 12:08

All information regarding the JKBOSE 11th Important Model Question Paper 2023 and the J&K 11th Class Important Model Question Paper 2023 has been made available by the higher officials of the Jammu & Kashmir State Board of School Education (JKBOSE) on their official website. JK 11th Question Paper 2023 The PDF Record is Downloadable by Students on Their Devices. Students may read these Last Year Important Model Question Paper 2023 both online and offline.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee