Skip to main content
jameshoty
Known Participant
Aug 23, 2018 12:54 AM UTC
Answered

Indentation

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 is closed to new replies. Start a new post to keep the conversation going.
ALsp
ALspCorrect answer
Legend
Aug 23, 2018 1:34 AM UTC

Dreamweaver 18:

Edit > Code > Apply Source Formatting

Dreamweaver CS6:

Commands > Apply Source Formatting

9 replies

B i r n o u
Legend
Aug 28, 2018 2:59 AM UTC

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

Translate
B i r n o u
Legend
Aug 27, 2018 12:02 PM UTC

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)

Translate
ALsp
ALspCorrect answer
Legend
Aug 23, 2018 1:34 AM UTC

Dreamweaver 18:

Edit > Code > Apply Source Formatting

Dreamweaver CS6:

Commands > Apply Source Formatting

Translate
jameshoty
jameshotyAuthor
Known Participant
Aug 23, 2018 1:51 AM UTC

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">

Translate
ALsp
Legend
Aug 23, 2018 2:31 AM UTC

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

Translate