【发布时间】:2020-10-13 19:22:14
【问题描述】:
我正在尝试使用pygments 通过命令行工具pygmentize 使用以下命令将python 文件转换为html 文件:
pygmentize -f html -O full -O linenos=1 out_file.html in_file.py
很遗憾,默认的fontsize太小了,不知道怎么调大。使用-O fontsize=16 不会报错,但也没有效果。
此外,我尝试了一个丑陋的补丁,将html *{font-size: 1.05em !important;} 插入到 html 文档的 css 部分,但这会影响行号布局。
我可以通过 python 终端调用“pygments”,但不知道如何将命令行实现到 python 代码中
【问题讨论】:
标签: python html command-line pygments pygmentize