TIP 79: Rewriting Your Source Code


Call us picky, but we prefer our source code written in a particular way, thank you very much. Sometimes, though, if we've been mucking around a lot in the code or cutting and pasting code from here to there, we end up with source code that is formatted inconsistently. When that happens, we invoke a command called Rewrite Source Code. Don't mistake this command for one that fixes poorly written code. Instead, it restores the formatting of your code to your specifications, including line breaks, indents, uppercase or lowercase, and CSS formatting.

What Are Web Settings?

In the pull-down for General Markup Options in the Rewrite Source Code dialog, you'll find a selection called Web Settings. By accessing these settings, advanced users can get very granular about how they want their code to be written by GoLive. Choose GoLive > Web Settings on Mac or Edit > Web Settings on Windows. A word of caution, though: If you don't know what you are doing, stay away! You could end up wreaking havoc with your source code.


You'll find the command under Special > Source Code > Rewrite Source Code. Once you invoke the command, a dialog appears offering choices on how the source code should be rewritten. There are four sections in the dialog: HTML Options, CSS Options, General Markup Options, and Text Options. To set preferences for any of these options, choose from the options in the pull-down menus. When you are happy with the settings, choose which files are to be rewritten by selecting from the Work On pull-down list (Figure 79).

Figure 79. The Rewrite Source Code dialog offers several choices on how to format the code as well as an easy way to choose which files to rewrite.


Bonus Tip

You can assign a keyboard shortcut to the Rewrite Source Code command so that you can run it very simply by pressing a key combination on your keyboard.




    Adobe GoLive CS2 Tips and Tricks The 250 Best
    Adobe GoLive CS2 Tips and Tricks The 250 Best
    ISBN: B008CMGJS0
    EAN: N/A
    Year: 2005
    Pages: 301

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net