HTML, XHTML and CSS All-In-One for Dummies - Andy Harris [32]
A couple of IDEs have popped up recently in the open-source community. One tries to be like the commercial tools (and ends up replicating some of their flaws). Some other editors have emerged that seem to be a good compromise between helping you write solid code and growing with you while you become more sophisticated.
Introducing Aptana
My preferred editor for beginners who intend to advance is Aptana (available on this book’s CD-ROM or at www.aptana.com). Aptana Studio is a full-blown IDE, based on the popular Eclipse editor. Aptana has many features that make it a good choice for Web developers:
♦ Syntax completion: Aptana has built-in knowledge of HTML (and several other languages). When you start to type HTML code, it recognizes the code and pops up a list of suggestions. Figure 3-7 shows Aptana helping on some HTML code.
♦ Automatic ending tags: As soon as you write a beginning tag, Aptana automatically generates the corresponding end tag. This makes it much less likely that you’ll forget an ending tag — one of the most common coding errors.
♦ Automatically generated XHTML template: When you tell Aptana to create an HTML page, it can generate the page template with all the messy doctype stuff built in. (I explain how to customize this feature in the next section.)
♦ Error detection: Aptana can look at the code and detect certain errors. Although it isn’t a replacement for a validator, it can be a very handy tool, especially when you begin to write JavaScript code.
♦ File management tools: Aptana makes it easy to work with both the local file system and pages that reside on Internet servers.
♦ Page preview: You can preview your page directly within Aptana, or you can view it in your primary browser.
♦ Outline view: This panel displays the page structure as an outline to help you see the overall structure of the page. You can also use this panel as a table of contents to get to any particular part of your page in the editor quickly. Figure 3-8 shows the Outline view in action.
Figure 3-7: Aptana recognizes HTML and suggests code for you.
Figure 3-8: The Outline view acts as a table of contents for your page.
♦ Advanced features: When you’re ready to try JavaScript and AJAX, Aptana has nice support for these more advanced technologies. The syntax-highlighting features work in CSS, JavaScript, and PHP the same way they do in HTML. This means you can use the same editor for all your Web languages, which is a great thing.
Aptana Studio previously had two different versions, but now the features are combined, and the community edition is the only version offered. Studio is completely free to use and redistribute, although it has multiple licensing models. It provides all the features you might need and a few advanced features (such as integrated support for cloud-based computing) you may never use.
Customizing Aptana
Aptana is a great editor, but I recommend you change a few settings after you install it on your system.
Getting to the HTML editor preferences
Aptana can be customized in many ways. For now, the only preferences you need to change are in the HTML editor. Choose Windows⇒Preferences, and in the Preferences dialog box, expand the Aptana link and select HTML Editor. The dialog box is shown in Figure 3-9.
Figure 3-9: Aptana’s HTML Editor Preferences dialog box.
Changing the extension
By default, Aptana saves files with the .htm extension. Because this is the extension normally used only by Microsoft servers, I prefer to save pages with the .html extension. All Web pages in this book are stored with the .html extension.
Enter .html in the Default Extension for New HTML Files (Prefix with '.') field