我怎样才能将`git diff --color-words`的输出转换为HTML? [英] How can I convert the output of `git diff --color-words` to HTML?
问题描述
为了处理散文文本,以纯文本格式存储,我非常喜欢 git diff --color-words
的输出,但我不喜欢它依赖于ANSI终端转义序列。我希望获得可用于转换为HTML的输出,某种用户友好的原始字符显示,或者生成两个文件之间差异的统计信息。
我更喜欢Perl(包括CPAN),但可以解决任何问题。 询问有关将ANSI转义序列转换为HTML的问题颜色指令,并且接受的答案是 Perl模块 HTML的链接:: FromANSI
,在CPAN中。
For working with text that is prose, stored in plain text, I really like the output of git diff --color-words
, but I don't like the way it is dependent on ANSI terminal escape sequences. I'd like to get output that I can use to turn into HTML, some kind of user-friendly raw character display, or to generate statistics on the differences between the two files.
I prefer Perl (including CPAN), but would settle for pretty much anything.
This question asks about converting ANSI escape sequences into HTML color directives, and the accepted answer is a link to the Perl module HTML::FromANSI
, in CPAN.
这篇关于我怎样才能将`git diff --color-words`的输出转换为HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!