Skip to main content
jameshoty
Known Participant
August 23, 2018
Answered

Indentation

  • August 23, 2018
  • 3 replies
  • 1199 views

When I create a new document, the pre-filled codes are not indented accordingly. How can I indent them "quickly and easily" instead of tabbing at each line? Periodically, when I open someones' else code and I want to do the same to indent and find it daunting to do so due to the length of the codes. I know it will still work if the code is not indented but it does make a difference when reading it. Thank you for helping.

This topic has been closed for replies.
Correct answer ALsp

Dreamweaver 18:

Edit > Code > Apply Source Formatting

Dreamweaver CS6:

Commands > Apply Source Formatting

3 replies

B i r n o u
Legend
August 28, 2018

what is almost funny... if anyone connect to the prerelease forum (which is publicaly opened) he or she will constat, that a features request asking for such ameliorations on the code formating ... has been ... simply... closed by folks @adobe... funny isn't it ?

Adobe Prerelease

B i r n o u
Legend
August 27, 2018

if someone does not want indentation for code formatting (which is apparently the case of some of us around here), it is very easy to set the preferences parameters as such (indentation, space value, space type, etc. by resetting everything to none) and then apply code formatting....

the result will apply...in a perfect way and whatever the site is...

but for those of us who work with different teams and choose to indent their code, there is a big problem which is that on the one hand preferences are set at the global level and not at the level of each project (not all partners and teams have the same indentation rules and politics) and on the other hand parameters do not necessarily meet the needs when several languages are used within the same page, nor do they take into account all the languages offered by Dreamweaver.

so answer... it doesn't concern me, I don't use it, it doesn't fit my needs... is somewhere anti-constructive (this is neither an attack nor a provocation, to any one in particular ... it is just a remark)

ALsp
ALspCorrect answer
Legend
August 23, 2018

Dreamweaver 18:

Edit > Code > Apply Source Formatting

Dreamweaver CS6:

Commands > Apply Source Formatting

jameshoty
jameshotyAuthor
Known Participant
August 23, 2018

This is what I am looking for (except that I was trying at Edit > Code > Indent Code)

By the way, when I apply source formatting and I get the following :

<html>

<head>

<title>Bootstrap Demo - 1</title>

<meta charset="UTF-8">

Why is <head>, <title> and <meta> not indented like this?

<html>

  <head>

    <title>Bootstrap Demo - 1</title>

    <meta charset="UTF-8">

ALsp
Legend
August 23, 2018

jameshoty  wrote

Why is <head>, <title> and <meta> not indented like this?

<html>

  <head>

    <title>Bootstrap Demo - 1</title>

    <meta charset="UTF-8">

I've been coding pages for over 20 years and I have never indented tags outside the body. If you have a good reason for wanting to do it, you can probably edit your tag library... but logically, there is no usability benefit to it. I would leave the html and head tags alone.

The only thing I would seriously consider indenting... right off your page, actually... is Bootstrap