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

DW 2019: Apply Source Formatting of all HTML Files of a Site

Contributor ,
Dec 19, 2018 Dec 19, 2018

Copy link to clipboard

Copied

I want to format the source code of a complete site, of all HTML/PHP/CSS files in all the directories of the site.

How can I do that without opening each file manually and performing the command "Edit > Code > Apply Source Formatting" for each file?

If that is not possible:
What do you think about the idea as a feature for next version of DW?

Thanks.

Views

1.8K

Translate

Translate

Report

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 19, 2018 Dec 19, 2018

Copy link to clipboard

Copied

I fear site-wide, automated processes in any version of DW past about CS6. Given a couple of script rewrite bugs in a few of the latest versions that specifically occurred when Apply Source Formatting was run on PHP pages, I don't think I would ever run a site-wide, "no undo available" version of it.

If every one of those bugs were squashed, and remained that way for more than 1 version, I could see a sitewide ASF being useful to some users.

Votes

Translate

Translate

Report

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 19, 2018 Dec 19, 2018

Copy link to clipboard

Copied

@Jon Fritz

I think a version control system (I use Git) is a good method to feel safe with side wide processes.

@Energize

I'm coming from DW 2014. So I have to fear bugs in the source formatting function in DW 2019.

Is there a bug entry in the database of Adobe yet?

If I can use the extension with DW 2014 as well, please let me know where I can find the extension.

Votes

Translate

Translate

Report

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 19, 2018 Dec 19, 2018

Copy link to clipboard

Copied

There have been quite a few posts on uservoice site about problems with the format source tool.

Paul-M - Community Expert

Votes

Translate

Translate

Report

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 20, 2018 Dec 20, 2018

Copy link to clipboard

Copied

@Energizer

You wrote: "FYI I have tweaked the format source extenion for enitre site to work with CC 2019"

Did you tested the function yet and do you like to provide that version too?

Independent of that:

Did anyone of you ever found a site wide method to tidy code in the more subtle aspects?

Example:
<blocklevel-element1> Lorem </blocklevel-element1>

Tidy:

<blocklevel-element1>Lorem</blocklevel-element1>

Sure, you can do that manually with regular expressions.

But those expressions are huge.
And you have to make sure, that you get collateral damages like deleting whitespaces inside the element pre. Just as an example.

I'm looking for a powerful side wide cleaning tool with a GUI, which is able to perform such more ambitious tasks.

Votes

Translate

Translate

Report

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 20, 2018 Dec 20, 2018

Copy link to clipboard

Copied

@Energizer

You wrote: "FYI I have tweaked the format source extenion for enitre site to work with CC 2019"

Did you tested the function yet and do you like to provide that version too?

If you look at the dropbox link above there are two versions, one for CC 2015 (and should work in CC 2014) and another version for CC 2017 versions and above.

I have to say at this point that I do NOT trust the apply source formatting TOOL in CC 2017, CC2018 or CC 2019. There have been lots of documented problems and inconsistencies, (breaking PHP code for example). I have the latest version of CC 2019 and in many cases, the apply souce formatting tool does not obey the rules I have set in Tag LIbraries.

*** IF YOU INTEND TO TRY AND USE IT WITH DREAMWEAVER CC 2019. I WOULD BE VERY, VERY CAUTIOUS, MAKE A COMPLETRE BACKUP OF YOUR SITE BEFORE USING IT ***

If you have a CC cloud subscription, I recommend installing Dreamweaver CC 2015 and doing the site wide source format in that version.

Paul-M - Community Expert

Votes

Translate

Translate

Report

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 20, 2018 Dec 20, 2018

Copy link to clipboard

Copied

@Energizer

OK, thanks for the clarification.

I think using the tool is to dangerous for me. I needs to much time to check the code after performing the command, if there so many problems which can occur.

I hope there will be another side wide tool which works reliable in DW 2019.

Votes

Translate

Translate

Report

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 20, 2018 Dec 20, 2018

Copy link to clipboard

Copied

Its not the extension, its the apply source formatting option built into Dreamweaver now, since CC 2017 and the native Dreamweaver code editor was replaced with Brackets it can't be trusted to work as expected. I have both CC 2015 and CC 2019 installed because soemtimes I just have to go back to CC 2015.

I would :

1) Make a full backup of the site

2)  Setup the site in Dreamweaver CC 2015

3) Run the site wide source formatting in Dreamweaver CC 2015

I perosnally would NOT:

Do any source formatting in CC 2017, CC 2018 or CC 2019.

Paul-M - Community Expert

Votes

Translate

Translate

Report

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 20, 2018 Dec 20, 2018

Copy link to clipboard

Copied

Now I got it.

I'm sorry, that I was slow on the uptake.

Why please, does Adobe ignore such a bug of a basic feature as code formatting is, since 3 years?

Votes

Translate

Translate

Report

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 20, 2018 Dec 20, 2018

Copy link to clipboard

Copied

Why please, does Adobe ignore such a bug of a basic feature as code formatting is, since 3 years?

They've been busy fixing other isues and restoring features that were lost as a result of the decision to replace Dreamweaver's native code editor with an integrated version of Brackets.  IMO, a very bad decision made by who? ... And a lot of wasted developmemt time. The old native code editor just needed a few new features, there was already an emmet extension available for it and it was a solid editor that just needed a bit of love.
Paul-M - Community Expert

Votes

Translate

Translate

Report

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 20, 2018 Dec 20, 2018

Copy link to clipboard

Copied

welcome on board...

Votes

Translate

Translate

Report

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 19, 2018 Dec 19, 2018

Copy link to clipboard

Copied

It can be done in Dreamweaver CC 2015 with the help of an extension. If you want the extension let me know.

I don't use the format source option in newer versions of DW, it never seems to have worked corectly since some plonker decided it would be a good idea to replace the native code editor in Dreamweaver with Brackets.

Paul-M - Community Expert

Votes

Translate

Translate

Report

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 19, 2018 Dec 19, 2018

Copy link to clipboard

Copied

FYI I have tweaked the format source extenion for enitre site to work with CC 2019, it was originally written by Massimo ​who used to write extensions fro Dreamweaver back in the day, so I'm not trying to take credit for anybodys work. I just tweaked the extension to reflect the chnages Adobe have made to Dreamweavers menus.

I just want to check it works OK (on first inspection it seems to) and I will post a link to download as it doesn;t appear Massimo has links to his extenions anymore with them quite old now.

Paul-M - Community Expert

Votes

Translate

Translate

Report

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
Mentor ,
Dec 19, 2018 Dec 19, 2018

Copy link to clipboard

Copied

it was originally written by Massimo who used to write extensions fro Dreamweaver back in the day,

One of my favorite people. I love the quote on his home page:

"Never buy magic! Before you commit to a framework, make sure you could write it. Do this by actually writing something simple that does the basics that you need. Make sure the magic all goes away. And then look at the framework again. Is it worth it? Can you live without it?"  - Bob Martin

Thanks for the bit of nostalgia.

Votes

Translate

Translate

Report

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 19, 2018 Dec 19, 2018

Copy link to clipboard

Copied

Here are the two version of Massimo' sitewide format (one for CC 2015 and one for CC2017 and up: Dropbox  Link​

 

First of all disclaimer: If you intend to try and use these extensions, bare in mind they are old & I would be especially careful on Dreamweaver CC 2017 and up. ***Make a backup of your entire site before using**

 

On Dreamweaver CC 2015 (it will probably work on CC 2014 but not tested): acccess from Commands > Sitewide > Format Source

 

On Dreamweaver CC 2017 and up acces from Tools > Sitewide > Format Source

 

*** PROCEED WITH CAUTION & MAKE A SITE BACKUP BEFORE DOING ANYTHING - IF IT SCREWS UP YOUR FILES ON A LARGE SITE & YOU DO NOT HAVE A BACKUP , YOU MIGHT BE UP ALL NIGHT FIXING IT***

 

***Just to reiterate, this is an old extension by Massimo , I'm taking NO credit for somebody elses good work and I just did a small tweak to the extension and repacked it for Dreamweaver CC 2017 and up ***

Paul-M - Community Expert

Votes

Translate

Translate

Report

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 19, 2018 Dec 19, 2018

Copy link to clipboard

Copied

@Energize

Thanks a lot. I'm looking forward to test it tomorrow. I will give feedback.

Votes

Translate

Translate

Report

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 19, 2018 Dec 19, 2018

Copy link to clipboard

Copied

@Energize

Thanks a lot. I'm looking forward to test it tomorrow. I will give feedback.

I think it should work fine in Dreamweaver CC 2014 .... Let me know how you get on

Paul-M - Community Expert

Votes

Translate

Translate

Report

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 Beginner ,
Sep 24, 2019 Sep 24, 2019

Copy link to clipboard

Copied

Hi Paul-M.
I was trying the dropbox link but is not working any longer. Is there any chance to update the link? I really need to use "your magic solution" as I have to change about 5k html files....

Votes

Translate

Translate

Report

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 ,
Sep 25, 2019 Sep 25, 2019

Copy link to clipboard

Copied

here is a new link: https://www.dropbox.com/s/lgzv1qarwgdqzc5/sitewide_format_source_cc2017-2019.zip?dl=0 use with extreme caution, I would backup the entire website before trying it out. Access from the bottom of the tools menu: Tools > Sitewide > Format Source
Paul-M - Community Expert

Votes

Translate

Translate

Report

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
New Here ,
Jan 09, 2020 Jan 09, 2020

Copy link to clipboard

Copied

LATEST

Thank you Paul-M,

I tried to install the extension but failed. Neither works on DW 2019.19.2 on my computer nor on DW2017.5 on another. 

https://helpx.adobe.com/dreamweaver/using/extensions.html#third-party-extensions 

the error code kept saying -160

I doubted whether the file was damaged. 

Could you please tell how to correctly install the extension?

And could you share the version for DW 2015 since the link you share contains only 2017-2019.

Thank you very much. 

Votes

Translate

Translate

Report

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