Sphinx扩展,包括程序截图
sphinxcontrib-programscreenshot的Python项目详细描述
这个Sphinx1.0扩展在生成步骤期间执行程序,并且 在文档中包括他们的截图。 sphinxcontrib.programoutput扩展的gui版本。
主页:https://github.com/ponty/sphinxcontrib-programscreenshot
文档:http://ponty.github.com/sphinxcontrib-programscreenshot
基本用法
.. program-screenshot:: xmessage hello :prompt:
工作原理
- 使用pyvirtualdisplay
- 通过设置$display变量将程序显示重定向到xvfb服务器。
- 稍等片刻
- 由需要scrot的pyscreenshot截图。
- 使用.. image::指令显示图像
安装
一般
ubuntu
sudo apt-get install python-pip sudo apt-get install scrot sudo apt-get install xvfb sudo apt-get install xserver-xephyr sudo apt-get install python-imaging sudo pip install sphinxcontrib-programscreenshot
卸载
# as root pip uninstall sphinxcontrib-programscreenshot