命令行 HTML 漂亮打印机:让凌乱的 HTML 变得可读

发布于 2024-08-19 18:45:38 字数 1539 浏览 8 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

慵挽 2024-08-26 18:45:39

我认为 HTML tidy 是该领域家喻户晓的名字之一。

I think HTML tidy is one of the household names in that field.

黑寡妇 2024-08-26 18:45:39

要获得此问题的更新的、与操作系统无关的答案:

虽然 原始 < href="http://tidy.sourceforge.net/" rel="nofollow noreferrer">HTMLTidy 项目已休眠超过 6 年“W3C 社区和业务小组”,名称为 “HTML Tidy Advocacy Community Group ( HTACG)”现已开始继续开发,目标是使其完全兼容 HTML5。该组织成立于 2015 年 1 月,尽管他们将当前状态描述为“正在进行中”,但二进制文件已经可供下载。

To have an updated, OS-agnostic answer to this question:

While the original HTMLTidy project has been dormant for over 6 years, a "W3C Community & Business group" that goes by the name "HTML Tidy Advocacy Community Group (HTACG)" has now begun to continue its development, with the goal of making it fully HTML5-compatible. The group was formed in January 2015 and although they describe the current state as "work in progress", binaries are already available for download.

有深☉意 2024-08-26 18:45:39

只是对 OT 问题的后期跟进。

正如您所期望的那样,Homebrew 安装了 tidy-html5

它被链接为 tidy5

Just a late followup on an OT question.

Homebrew has a tidy-html5 installed as you'd expect.

It's linked up as tidy5.

我不是你的备胎 2024-08-26 18:45:38

查看 HTML Tidy 项目:http://www.html-tidy.org/

HTML 工具的鼻祖,支持现代标准。

曾经有一个名为 tidy-html5 的分支,后来成为官方的东西。这是其 GitHub 存储库

Tidy 是一款适用于 Mac OS X、Linux、Windows、UNIX 等的控制台应用程序。它通过修复标记错误并将遗留代码升级到现代标准来纠正和清理 HTML 和 XML 文档。

根据您的需要,以下是调用 Tidy 的命令行:

tidy inputfile.html

Have a look at the HTML Tidy Project: http://www.html-tidy.org/

The granddaddy of HTML tools, with support for modern standards.

There used to be a fork called tidy-html5 which since became the official thing. Here is its GitHub repository.

Tidy is a console application for Mac OS X, Linux, Windows, UNIX, and more. It corrects and cleans up HTML and XML documents by fixing markup errors and upgrading legacy code to modern standards.

For your needs, here is the command line to call Tidy:

tidy inputfile.html
节枝 2024-08-26 18:45:38

更新 2018: homebrew/dupes 现已弃用,可以直接安装 tidy-html5。

brew install tidy-html5

原始回复:

OS X 的 Tidy 不支持 HTML5。但 Github 上有一个实验分支可以做到这一点。

得到它:

brew tap homebrew/dupes
brew install tidy --HEAD
brew untap homebrew/dupes

就是这样!玩得开心!

Update 2018: The homebrew/dupes is now deprecated, tidy-html5 may be directly installed.

brew install tidy-html5

Original reply:

Tidy from OS X doesn't support HTML5. But there is experimental branch on Github which does.

To get it:

brew tap homebrew/dupes
brew install tidy --HEAD
brew untap homebrew/dupes

That's it! Have fun!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文