在 Eclipse 中格式化 freemarker 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4044414/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Format freemarker files in Eclipse
提问by Beno?t Guérout
Actually we have freemarker files (ftl) under Eclipse + Freemarker plugin (from JBoss).
实际上,我们在 Eclipse + Freemarker 插件(来自 JBoss)下有 freemarker 文件(ftl)。
Do you know a way to format ftl files ?
你知道格式化 ftl 文件的方法吗?
Thanks
谢谢
回答by Wolfgang Fahl
For ftl files that represent HTML configuring eclipse to open the HTML Editor works nicely. The HTML Editor has formatting capability as asked for. Todo configure eclipse to open ftl files with the HTML Editor you can use "open with" and there you'll get offered to link the HTML Editor permanently to the ftl extension:
对于代表 HTML 的 ftl 文件,配置 eclipse 以打开 HTML 编辑器效果很好。HTML 编辑器具有所需的格式化功能。Todo 配置 eclipse 以使用 HTML 编辑器打开 ftl 文件,您可以使用“打开方式”,然后您将被提供将 HTML 编辑器永久链接到 ftl 扩展名:
In the Content Types Preferences Page you can than actually add the *.ftl extension:
在内容类型首选项页面中,您可以实际添加 *.ftl 扩展名:
回答by Andy
I looked for a formatting tool a few months ago and I was unable to find any such tools. To my knowledge there no such tools currently available, just the syntax highlighting you mentioned.
几个月前我找了一个格式化工具,但找不到任何这样的工具。据我所知,目前没有这样的工具可用,只有你提到的语法高亮。
回答by NimChimpsky
Associated the ftl file extension with your web page editor (assuming you have wtp already installed).
将 ftl 文件扩展名与您的网页编辑器相关联(假设您已经安装了 wtp)。
回答by TinusSky
An old question. I had the same problem for some time now, the default html editor contains some irritating features when working on freemarker templates, especially when using the bracket syntax.
一个老问题。一段时间以来我遇到了同样的问题,默认的 html 编辑器在处理 freemarker 模板时包含一些令人讨厌的功能,尤其是在使用括号语法时。
Aptana studio eclipse plugin solves most of the problems: http://www.aptana.com/products/studio3/download
Aptana studio eclipse插件解决了大部分问题:http: //www.aptana.com/products/studio3/download