将源代码存储库转换为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!)等等,读一些代码!

https://raw.githubusercontent.com/kfei/code2html/master/misc/img1.pnghttps://raw.githubusercontent.com/kfei/code2html/master/misc/img2.pnghttps://raw.githubusercontent.com/kfei/code2html/master/misc/img3.pnghttps://raw.githubusercontent.com/kfei/code2html/master/misc/img4.png

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
接收com。太阳媒体声音Java中来自MIDI控制器的FastShortMessage,如何解码?   JAVA日志记录:当日志文件将要滚动时,应用程序将暂停   java如何使用循环来重复函数选择   java OpenJPA和存储过程,Weblogic 12c   编码风格什么是正确的方式来使用。Java中的equals方法?   通过tcpsocket将xml从java发送到C#   java对象比JTable效率更高   java在运行时删除标志\半透明\状态   java将一个数均匀随机地分成m个部分   链表的Java数组   javajaxws:在数据库中记录请求和响应   java maven,执行标记,缺少id标记   泛型类中的java泛型转换