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