Html 是否可以在 Dreamweaver 中自动格式化代码?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2146862/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:00:15  来源:igfitidea点击:

Is it possible to auto-format your code in Dreamweaver?

htmlformattingdreamweavercode-formatting

提问by Pekka

Is it possible to auto-format your code in Dreamweaver like in Visual Studio (ctrl+k+d)

是否可以像在 Visual Studio (ctrl+k+d) 中一样在 Dreamweaver 中自动格式化代码

回答by Pekka

A quick Google search turns up these two possibilities:

快速的谷歌搜索发现了这两种可能性:

  • Commands > Apply Formatting
  • Commands > Clean up HTML
  • 命令 > 应用格式
  • 命令 > 清理 HTML

回答by Brett Rigby

Commands > Apply Source Formatting.

命令 > 应用源格式。

Works a treat.

很好用。

回答by isherwood

For the 2017 CC releasethis has been moved (after many years of habit development). Find it now at:

对于2017 CC 版本,这已被移动(经过多年的习惯养成)。现在在以下位置找到它:

Edit > Code > Apply Source Formatting.

编辑 > 代码 > 应用源格式。

It may be prudent to set up a keyboard shortcut if this is something you'll need regularly.

如果这是您经常需要的东西,那么设置键盘快捷键可能是明智的。

Edit > Keyboard Shortcuts

编辑 > 键盘快捷键

回答by score

Following works perfectly for me: -*click on COMMANDand click on APPLY SOURCE FORMATTING- *And click on Clean Up HTML

以下非常适合我:-*单击命令并单击应用源格式设置-*然后单击清理 HTML

Thank you PEKA

谢谢皮卡

回答by roybatty

This is the only thing I've found for JavaScript formatting in Dreamweaver. Not many options, but it seems to work well.

这是我在 Dreamweaver 中为 JavaScript 格式找到的唯一方法。选择不多,但似乎效果很好。

JavaScript source format extension for dreamweaver: Adobe CFusion

Dreamweaver 的 JavaScript 源格式扩展:Adobe CFusion

回答by Anurag

And for JavaScript source format you can use Dreamweaver JavaScript source formatting extension.(available on adobe)

对于 JavaScript 源格式,您可以使用 Dreamweaver JavaScript 源格式扩展。(在 adobe 上可用)

回答by NullPoiиteя

Auto formatting can be done by

自动格式化可以通过

  • Select View > Code View Options
  • Click the View Options button enter image description herein the toolbar at the top of Code view or the Code inspector.
  • 选择“查看”>“代码查看选项”
  • 单击在此处输入图片说明代码视图或代码检查器顶部工具栏中的“视图选项”按钮。

Auto IndentMakes your code indent automatically when you press Enter while writing code.

自动缩进当您在编写代码时按 Enter 时,使您的代码自动缩进

source

来源

回答by Acelasi Eu

Please click on "edit" -> then keyboard shortcuts. It`s straight forward from there. Just select the command from the list, and press the + button.

请单击“编辑”-> 然后单击键盘快捷键。从那里直接向前。只需从列表中选择命令,然后按 + 按钮。

You will need to create a duplicate set, then select it again from the list. And finally set a keyboard shortcut!

您需要创建一个重复集,然后从列表中再次选择它。最后设置一个键盘快捷键!

Now, before saving, press the shortcut you just created!

现在,在保存之前,按您刚刚创建的快捷方式!

回答by Nantharupan

Coding toolbar (Edit > Toolbars > Coding) and select Code Format Settings to set your preferred formatting.

编码工具栏(编辑 > 工具栏 > 编码)并选择代码格式设置来设置您的首选格式。

You can also access the formatting option from Commands > Apply Source Formatting or only apply it to a select block of code by selecting the Apply Source Formatting to Selection option.

您还可以从“命令”>“应用源格式”访问格式选项,或者通过选择“将源格式应用于选择”选项仅将其应用于选定的代码块。

http://www.hongkiat.com/blog/10-useful-dreamweaver-tips-for-beginners/

http://www.hongkiat.com/blog/10-useful-dreamweaver-tips-for-beginners/

回答by IronmanX46

I tried some of the sources online and finally, the below selection works fine for me (Dreamweaver on Mac). For versions above Adobe Dreamweaver CC 2017 and above:

我在网上尝试了一些来源,最后,下面的选择对我来说很好用(Mac 上的 Dreamweaver)。对于Adobe Dreamweaver CC 2017 及以上版本

Adobe says:

Adobe 说:

Edit > Code > Apply Source Formatting

编辑 > 代码 > 应用源格式

Moreover, full documentation with other supporting information for tasks such as setting defaults, etc. on https://helpx.adobe.com/dreamweaver/using/format-code.html.

此外,在https://helpx.adobe.com/dreamweaver/using/format-code.html上提供包含其他支持信息的完整文档,例如设置默认值等任务。