如何将Linux的shell输出转换为HTML? [英] How to convert Linux's shell output to HTML?

查看:52
本文介绍了如何将Linux的shell输出转换为HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以将bash输出转换为html吗?例如,如果我在bash中有一些彩色输出(例如htop),如何将其转换为html标签...(例如:< p style ="color:red"> some text</p> )

is there any way to convert bash output to html ? for example if I had some colorized output in bash ( something like htop ), how can I convert it to html tags ... ( something like this: <p style="color: red">some text</p>)

推荐答案

ansifilter 加上诸如 highlight 之类的工具可以从纯文本(例如源文件)中生成彩色的html.

There's ansifilter plus some tools like highlight will produce colorized html from plain text such as source files.

两个都可以在此处.

这篇关于如何将Linux的shell输出转换为HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆