简体   繁体   English

如何在 Vscode 中格式化 tpl 文件中的 HTML 代码

[英]How can I format HTML code in tpl files in Vscode

how can I turn on snippets and html code formater in.tpl files?如何打开 snippets 和 html code formater in.tpl 文件? I will using Vscode to edit PrestaShop files where is a lot of html code inside.tpl files.我将使用 Vscode 编辑 PrestaShop 文件,其中包含大量 html 代码 inside.tpl 文件。

Format html code inside.tpl file格式化html代码inside.tpl文件

You can try these steps:-您可以尝试以下步骤:-

  1. First check for any extension available in vscode market place.首先检查 vscode 市场中是否有任何可用的扩展。 If it is available then you can proceed with it.如果可用,则可以继续。
  2. The second option, which is manually configuring Visual Studio Code to handle ".tpl" files, can be done by following these steps:第二个选项是手动配置 Visual Studio Code 来处理".tpl"文件,可以通过以下步骤完成:
  • Go to Settings editor, search for "files.associations" and click on the Edit in settings.json link. Go 到设置编辑器,搜索“files.associations”并单击“在设置中编辑”。json 链接。
  • In the settings.json file, add the following line of code: "*.tpl": "html"在 settings.json 文件中,添加以下代码行: "*.tpl": "html"

This tells Visual Studio Code to associate the ".tpl" file type with the "html" language mode.这告诉 Visual Studio Code 将“.tpl”文件类型与“html”语言模式相关联。

  1. You can edit the file extension to .html to work with the html code formatter.您可以将文件扩展名编辑为.html以使用 html 代码格式化程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM