背景

rst2s5 ~ 好用的S5生成宏 @ 2010-09-18 23:23 - Zoom.Quiet's PyBlosxom blogging

所以 2011 以后所有发布的幻灯都是 rest2s5 生成的了:

s5.zoomquiet.io

问题

忽然发现生成的代码颜色很奇怪,在黑色背景中,很多元素几乎看不见

分析

4年前的生成脚本,和最新 pygments 接口不匹配了,,,

解决

参考:

对比:

发现就是样式的声明问题: 于是就追加了一个参数: style="monokai"

# ...
formatter = get_formatter_by_name('html'
, noclasses=True
, style="monokai"
)

搞掂!

另外,也随手变更了一下注册的 directive ~ 指令:

# Register the directive with docutils.
#rst.directives.register_directive('code-block', code_block)
#rst.roles.register_local_role('code-block', code_role)
rst.directives.register_directive('sourcecode', code_block)
rst.roles.register_local_role('sourcecode', code_role)

这样俺在 Leo 中写:

140507-rst2s5-source.png

就可以一键生成为幻灯中的:

140507-rst2s5-slide.png


Comments


大妈的多重宇宙 - YouTube

全新自媒体系列...科学幻想,读书,说故事...

订阅 substack 体验古早写作:
Zoom.Quiet’s Chaos42 | Substack


蟒营®编程思维提高班Python版

**2021.01.11** 因大妈再次创业暂停定期开设, 转换为预约触发:
  • + 任何问题, 随时邮件提问可也:
    askdama@googlegroups.com

Copyright 2001-2023 by Zoom.Quiet
Content licensed under the Creative Commons attribution-noncommercial-sharealike License.
Contact me via , mail ,github or gitlab . Tip me via || (ATOM)