将源代码存储库转换为HTML文件,并突出显示漂亮的语法。
code2html的Python项目详细描述
将源代码存储库转换为HTML文件。
简介
你喜欢在你的移动设备上阅读源代码吗?
html是一种轻量级格式(不像pdf或epub),可以很容易地阅读 每个浏览器都包括移动设备。
code2html是一个将源代码存储库转换为HTML格式文件的工具,因此 你可以把它们放进你的移动设备里,随时随地阅读 只要有漂亮的语法亮点(谢谢Vim)。
摆脱那些社交网络应用程序,开始享受代码阅读。
要求
利用Vim中的magicTOhtml函数, code2html需要安装Vim。如果您指定 要使用非默认颜色方案,它也必须在您的系统上可用。
用法
code2html [-h] [--color COLOR] [--include INCLUDES] [--pre] input output positional arguments: input Path to the source code repository output Path for saving output files optional arguments: -h, --help show this help message and exit --color COLOR Specify the color scheme use for syntax highlighting --include INCLUDES Specify file matching patterns, then only the matched files will be convert. Wild card characters are supported. e.g. --include="*.c" --include="?.py" --pre Instead of actually performing the conversion, simply display what *would* have been converted if --pre weren't used
例1
使用--pre检查要转换的内容:
$ code2html --pre --include="*.cpp" /path/to/input /path/to/output
例2
转换所有python源,ext.c和来自^{tt9}的自述文件$ 到/path/to/output,使用jellybeans作为语法突出显示方案:
$ code2html --color=jellybeans --include="*.py" --include="ext.c" --include="README.rst" /path/to/input /path/to/output
例3
将源代码文件放入移动设备并找到一个好的文件 经理来组织他们。下次你等午饭的时候,巴士, 女朋友(Fixme!)等等,读一些代码!