在 NetBeans 中更改模板或 HTML 缩进

发布于 2024-07-29 04:28:54 字数 36 浏览 2 评论 0原文

如何在 NetBeans 6.7 中更改 HTML 模板?

How to change HTML template in NetBeans 6.7?

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

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

发布评论

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

评论(2

岁吢 2024-08-05 04:28:54

来自 在 NetBeans 6.0 中使用文件模板< /a> :

转到“工具”->“模板”,然后选择 HTML 模板。 通过选择一个模板并单击“在编辑器中打开”按钮,您可以在 NetBeans 编辑器窗口中查看或编辑该模板。

列表模板
(来源:oracle.com

From Using file templates in NetBeans 6.0 :

Go to "Tools"->"Templates", and select the HTML-template. By selecting a template and clicking on "Open in Editor" button you can view or edit the template in NetBeans Editor window.

List of templates
(source: oracle.com)

七色彩虹 2024-08-05 04:28:54

在 NetBeans 6.7 中,HTML 模板应位于“工具 > 模板”的“Web”部分。 如果不存在,也许您已经下载了“仅限 Java SE”版本? 或者任何其他不包含“Java Web 和 EE”的下载? 您可以从此处下载“Java”或“全部”版本。 如果您要创建 html,或者“Web”类别中的其他一些文件,那么您最好立即获取完整版本。 以后会省去很多麻烦。

或者,您可以通过创建包含以下内容的“Html.html”文件(这是 NetBeans 的默认模板)来添加该模板:

<#assign licenseFirst = "<!--">
<#assign licensePrefix = "">
<#assign licenseLast = "-->">
<#include "../Licenses/license-${project.license}.txt">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=${encoding}">
  </head>
  <body>
    TODO write content
  </body>
</html>

然后转到“工具 > 模板”窗口,单击“添加”按钮并选择该文件。

如果您想更改此类文件的缩进,请转到“工具 > 选项”、“编辑器”部分、“格式”选项卡,选择“语言:所有语言”并更改“每个缩进的空格数”到您想要的值。 如果选择“将制表符扩展为空格”选项,则“制表符大小”字段决定当您点击制表符时将插入多少个空格。

In NetBeans 6.7 HTML template should be in "Tools > Templates", "Web" section. If it isn't there, maybe you've downloaded "Java SE only" version? Or any other of the downloads that don't contain "Java Web and EE"? You cand download either "Java" or "All" version from here. If you are going create html, or maybe some other files from that "Web" category, then you are better off getting full version right now. It will save you a lot of trouble later.

Or you can just add that template by creating "Html.html" file with the following contents (that is the default template from NetBeans):

<#assign licenseFirst = "<!--">
<#assign licensePrefix = "">
<#assign licenseLast = "-->">
<#include "../Licenses/license-${project.license}.txt">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=${encoding}">
  </head>
  <body>
    TODO write content
  </body>
</html>

Then going to "Tools > Templates" window, clicking "Add" button and selecting that file.

And if you want to change indentation for those kind of files, go to "Tools > Options", "Editor" section, "Formatting" tab, select in "Language : All Languages" and change the "Number of spaces per indent" to your desired value. If "Expand tabs to spaces" option is selected, then "Tab size" field determines how many spaces will be inserted when you hit tab.

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