MacOS X 上的 HTML5 格式? (最好使用 TextMate)
是否有适用于 MacOS X 且支持 HTML5 文档格式的编辑器或捆绑包?整理画布等新标签上的错误。
Are there any editors or bundles available for MacOS X that support formatting of HTML5 documents? Tidy errors out on newer tags like canvas.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这个问题讨论如何让 Tidy 与 HTML5 配合使用;调整 TextMate 包的命令行以使用这些参数应该可以。
This question talks about how to make Tidy work with HTML5; tweaking the TextMate bundle's command line to use these params should work.
我设法使用此问题中找到的信息将 HTML5 Tidy 添加到 TextMate。 Tidy 似乎不接受自定义字符串作为 DocType,因此我使用 TextMate 宏来插入有效的字符串。可能有一种更优雅的方法来做到这一点,但它可以完成工作!
首先,我们需要为 Tidy 创建一个与 HTML5 兼容的 TextMate 命令。从“捆绑包”菜单访问“捆绑包编辑器”,然后创建一个包含以下内容的新命令:
将此命令命名为“HTML5 Tidy”。将范围选择设置为“text.html”。我们稍后将设置键盘快捷键。请注意,“doctype”开关已设置为“omit”,这会完全删除 DocType 声明。
然后,您需要通过以下操作从“捆绑包”菜单中录制宏:
选择“保存上次录制”菜单项来存储宏。将其命名为适当的名称,例如“HTML5 Tidy + DocType”,并将其范围设置为“text.html”。然后,您可以使用“等效键”输入为已完成的宏分配键盘快捷键。
这应该允许您在 HTML5 文档上使用 Tidy,不会出现任何问题。
I managed to add a HTML5 Tidy to TextMate by using the information found in this question. Tidy does not seem to accept a custom string as a DocType, so I used a TextMate macro to insert a valid one. There probably is a more elegant way of doing this, but it gets the job done!
To start off, we need to create a TextMate command for Tidy that plays nice with HTML5. Access the "Bundle Editor" from the Bundles menu, and create a new command containing the following:
Name this command something along the lines of "HTML5 Tidy". Set the scope selection to "text.html". We'll set up a keyboard shortcut in a moment. Note that the "doctype" switch has been set to "omit", which removes the DocType declaration entirely.
You then need to record a macro from the Bundles menu with the following actions:
<!DOCTYPE html>
Select the "Save Last Recording" menu item to store the macro. Name it something appropriate, such as "HTML5 Tidy + DocType", and set its scope to "text.html". You can then assign a keyboard shortcut for your completed macro using the "Key Equivalent" input.
This should allow you to use Tidy on your HTML5 documents without any problems.
Textmate 有一个捆绑包,可以根据 W3C 验证器进行验证 - http://validator.w3.org/
Textmate has a bundle that will validate against the W3C validator - http://validator.w3.org/
我不得不说我对 TextMate 捆绑包并不熟悉,因为我个人不使用该编辑器。尽管如此,我发现他们有一个公共颠覆服务器,他们在其中保存不同的捆绑包。快速搜索没有发现任何 HTML5 捆绑包。您可以在其网站上找到有关捆绑包的更多信息。
如果您想要以开箱即用的方式在 HTML5 中创建 Web 内容,请查看 Aloha Editor 。
I have to say that I am not familiar with TextMate bundles because I do not personally use that editor. None the less, I found out that they have a public subversion server where they keep different bundles. A quick search did not reveal any HTML5 bundle. You can find more information about bundles on their website.
If you want an out of the box way of create web content in HTML5, have a look at Aloha Editor.
不关心 textmate 包,但是恐慌的尾声怎么样? www.panic.com/coda
Do not about textmate bundles, but how about coda from panic? www.panic.com/coda
John Muhl 的 html5 包 - https://github.com/johnmuhl/html5.tmbundle
John Muhl's html5 bundle - https://github.com/johnmuhl/html5.tmbundle