Code Optimizer

This function lets you clean up documents, so that codes and scripts are clearer and work better. You can apply changes to a unique document or to several documents.

  1. In the Tools menu, click on the option Code Optimizer.
    The dialog box
    Code Optimizer opens. A unique document is selected by default.

The top part of the dialog box offers different options, depending on whether you are working on a unique document or several documents.

  1. Specify the optimization options you want to apply, according to the four tabs at the bottom:

3.      Click on Start to display defined optimization options.
To stop this process, click on Stop. Note that any changes made to codes will remain.

4.      Click on Close to close the dialog box.

Applying changes to a unique document

  1. Click on Unique document in the dialog box.

  2. Click on Open to select the document you want to modify.

  3. To make a backup copy, click on Save and rename the file.

  4. Specify the optimization options you want to apply, according to the four tabs at the bottom.

  5. Click on Start to begin the optimization process.

Applying changes to several documents 

1.      Click on Several documents in the dialog box.

2.      Define file options with the following parameters:

Backup modified files 

Activate this option to make backup copies of files before optimizing them. In this case, AceHTML generates as many files as there are optimizations, saving them with a .bak extension.

Apply first on open files  

Check this box to give priority to open files. This option should be used to do a search on several files (for example, files in a directory or project).

Apply to: 

  

Specified files 

This option lets you modify only the selected files. Activating this option will transform the dialog box. Click on Add to select the files you want to modify. Click on Restore to erase all previously selected files.

Search all files in project 

This option lets you modify all the files in a project. The files must be open before you can start the optimization process. This option is only available if the file belongs to a project, and the latter is open.

Search in directories 

This option lets you modify all the files in a specific directory.

Search Options 

This zone is refreshed according to the type of search specified, thereby allowing you to select the appropriate files, projects and directories.

Directory to Search 

This option is displayed when you choose the Search in directories option. In the field, select the directory containing the files to be modified.

Search in all documents opened 

This option lets you modify only those files opened in AceHTML. When you select this option, the Search Options zone is disabled.

Include subdirectories 

This option is displayed when you choose the Search in directories option. Checking this box will apply the changes to all files and subdirectories in the selected directory.

File masks 

Select the type of file to which you want to apply a filter. Modifications will only be done on files corresponding to the selected mask.

  1. Specify the optimization options you want to apply, according to the four tabs at the bottom.

  2. Click on Start to begin the optimization process.

Compression options 

 This tab lets you define options that can clean up your document by deleting certain items that are not useful until you are at the page editing stage.

Compression options only apply to items in your Edit Window, and do not change how the browser displays your document.

Strip Carriage Returns (#10 and #13) 

Check this box to delete all empty lines from the Edit Window. The sub-options are then activated:

  • All Carriage Returns:  deletes all carriage returns in the Edit Window.

  • Extra Carriage Returns (more than 1): deletes only double returns.

Strip Tabs 

Check this box to delete all indents from the Edit Window.

Strip HTML Comments 

Check this box to delete all comment lines (preceded by the tag <- - comment - - >). 

Strip Extra Spaces 

Check this box to delete all space characters from the Edit Window, thereby leaving only one space between words and codes.

Strip Script Comments  

Check this box to delete all comments on special scripts included in the document (preceded by the tag <!-- start of script and ending with // end of script -->).

Custom Remove 

Check this box to delete code you have created. Example: to identify document sections.

Nearby zones are activated when this box is checked:

  • Start with: indicates the expression at the beginning of tags or codes to be deleted; to delete a style class, for example, enter <h1 class=" myclass" >. 

  • End with: indicates the expression at the end of tags or codes to be deleted; as indicated above, enter <h1 >.

Skip ASP/PHP tags  

Check this box to skip document sections created with ASP or PHP scripts.

Strip HTML tags

Check this box to delete all HTML tags in the document. This function is useful when you want to ensure there are no HTML tags in a document in a language other than HTML (JS, ASP, PHP).

Skip HTML tags  

Skips HTML tags. This function is useful when the optimized document was created using several languages.

Beauty options 

This tab lets you define options to improve the esthetics of your document in the Editor window. Having a clean, well laid out document at the editing phase will make it easier for you to find information.

Strip Carriage Returns more than:  

To ensure all paragraphs in the document are evenly spaced, check this box and indicate how many carriage returns (or line returns) you want. All extra carriage returns will be deleted.

Strip Spaces more than: 

To ensure consistency as to spaces between words, check this box and indicate how many spaces you want. All extra spaces will be deleted.

Strip Spaces after EOL 

Check this box to delete all extra spaces at the end of text lines.

Align Code with Tabs 

Check this box to ensure visual balance of the document, through tabs in front of line blocks. Nearby zones are activated when this box is checked:

  • Use Spaces: check this box to use spaces rather than tabs.

  • Tab Value: indicate the desired indent value (as a number of characters).

Convert HTML to XHTML 

Check this box to convert all document tags and codes to XHTML. Checking this box will activate the adjacent box:

  • Wrap scripts: check this box to convert JavaScript codes.

  • Skip ASP/PHP tags: activate this option to skip these tags.

Tags in lowercase 

Check this box to convert the case of characters in tags. All recognized tags with characters in upper or mixed case (upper and lower) will be transformed into lower case.

Attributes in lowercase 

Check this box to convert the case of characters in attributes. All recognized tag attributes with characters in upper or mixed case (upper and lower) will be transformed into lower case.

Quote attribute values

Check this box to add quotation marks to all attribute values.

Special Characters 

This command lets you convert all special characters (Θ, α, ε, etc.) in the HTML code document. This command is particularly useful for Web designers creating sites for use on older browser versions. For more recent versions (as of versions 4 of Internet Explorer or Netscape), this command is not necessary.

Conversion of special characters 

If your Edit Window includes special characters, check this box to convert normal characters into special characters.

Return to normal characters 

If your Edit Window includes special characters, check this box to convert to convert them into normal characters.

Special characters in decimal numbers 

This option lets you display all special characters in decimals.

Example: The character Θ = &eacute, a special character, becomes &#233, a special character in decimals.

Text in comments will not be affected by this conversion.

Example of normal characters converted into special characters 

This special character tab lets you enter the characters directly in the Editor window.

File conversions 

This tab lets you modify the case of certain document codes, as well as modify the direction of separators.

Convert to lower case 

Convert to upper case 

The case modification is applied to the identification accompanying a tag attribute. For example, all of a document's align="center" attributes can be automatically converted: align="CENTER".

Activate the option corresponding to the conversion you want to do.

Separator Conversion 

All separator conversion options are disabled by default. You can command the automatic conversion of all separators in your document, according to whether your site will be on a local network or server.

  • Convert separator from '\' to '/': used for relative addresses, for example, for working on a local network.

  • Convert separator from '/' to '\': used for absolute addresses, for example, for working on a remote server.

None of these conversions modify the document itself.

Attributes to check 

 lets you select the attributes to be converted. 

  • Add: click on this button to add an attribute. The dialog box Add an Attribute opens. Enter the name of the attribute to modify in the Attribute field (example, align).

  • Remove: click on this button to delete the attribute previously selected from the list Attributes to check, and ensure it is not converted. 

  • Restore: click on this button to revert to AceHTML's default values. By default, AceHTML only converts the attributes href and src.