Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to format the html code

Contributor ,
Dec 22, 2017 Dec 22, 2017

Is there a way to automatically format the html code in dreamweaver?

I mean, for example, select the code and automatically get the right alignment of the code like it is possible do in action script.

Is it possible?

Is there a keyboard shortcut?

Thanks.

2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2017 Dec 22, 2017

in fact there are differents current feature requests to polish and greatly improve the code formatting / coloring.

you can still have a drop down menu Edit > Code that open a child menu to format and indent the code, AFAIK there is not shortcur for it ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 22, 2017 Dec 22, 2017

Thank you!

Yes, but it does not work either with the mouse or with the keyboard.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2017 Dec 22, 2017

I agree that it really need improvment, but at least for HTML, it is more or less indenting the tags correctly... can you post a screen grab ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 23, 2017 Dec 23, 2017

... or doesn't work?

....

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 23, 2017 Dec 23, 2017

JavaScript is not HTML.

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 23, 2017 Dec 23, 2017

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 23, 2017 Dec 23, 2017

Thank you but:

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 24, 2017 Dec 24, 2017

Thank you again,

a question:

there is not a shortcuts for comments?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2017 Dec 27, 2017
LATEST

Open the Snippets folder.  You will find Comments under JavaScript.  And you can create a custom Trigger Key for quicker insertion of code snippets.

Learn how to reuse code in Dreamweaver with the Snippets panel

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2017 Dec 22, 2017

From the Common Toolbar (shown below) select Apply Source Formatting.  However, you must Edit Tag Libraries 1st to set up your indenting preferences.   Personally, I don't like indented code.

CC-applySourceFormatting.jpg

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2017 Dec 22, 2017

you're right, when code is indented it is too complex to read it, to clearly see the nested tags, having the starting/ending tag in a first view, well it is definitly better to have a one line code ... arf arf...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 23, 2017 Dec 23, 2017

Thank you both for the reply.

Yes I know those functions but it seams sometime doesn't work properly,

as well as comment that doesn't change in grey color wen I use it.

Sometime (in both the option that you show me work well), when I will get the same problem I try to understand and I will send a screen shot.

Thank you both.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 23, 2017 Dec 23, 2017

the not greyout commented code line is a know bug... well the only workaround is to save the file, or press F5 on code vew... sometimes the only way is to close reopen the file... home code editor will be really improved in the next builds

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 23, 2017 Dec 23, 2017

Code colors are controlled by your code Theme's LESS file.

Open the LESS file to edit comment color as desired.  Save & close.

.cm-comment {

    color: #CCC;

}

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 23, 2017 Dec 23, 2017

Thank you! This seems work properly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines