Code coloring files
Adobe Dreamweaver defines code coloring styles and schemes in XML files that reside in the Configuration/CodeColoring folder. A code coloring style file defines styles for fields that are defined in syntax definitions. It has a root node of <codeColors>
. A code coloring scheme file defines code coloring syntax and has a root node of <codeColoring>
.
The code coloring style file that Adobe Dreamweaver provides is Colors.xml. The code coloring syntax files that Adobe Dreamweaver provides are CodeColoring.xml, ASP JavaScript.xml, ASP VBScript.xml, ASP.NET CSharp.xml, and ASP.NET VB.xml.
The following excerpt from the Colors.xml file illustrates the hierarchy of tags in a code coloring style file:
<codeColors> <colorGroup> <syntaxColor id="CodeColor_HTMLEntity" bold="true" italic="true" /> <syntaxColor id="CodeColor_JavascriptNative" text="#009999" /> <syntaxColor id="CodeColor_JavascriptNumber" text="#FF0000" />
…
<tagColor id="CodeColor_HTMLStyle" text="#990099" /> <tagColor id="CodeColor_HTMLTable" text="#009999" /> <syntaxColor id="CodeColor_HTMLComment" text="#999999" italic="true" />
…
</colorGroup></codeColors>
Colors are specified in red-green-blue (RGB) hexadecimal values. For example, the statement text="009999" in the preceding XML code assigns a blue-green (teal) color to the ID "CodeColor_JavascriptNative"
.
The following excerpt from the codeColoring.xml file illustrates the hierarchy of tags in a code coloring scheme file, and it also illustrates the relationship between the styles file and the scheme file:
<codeColoring> <scheme name="Text" id="Text" doctypes="Text" priority="1"> <ignoreTags>Yes</ignoreTags> <defaultText name="Text" id="CodeColor_TextText" /> <sampleText doctypes="Text"><![CDATA[Default file syntax highlighting.The quick brown foxjumped over the lazy dog.]]> </sampleText> </scheme><scheme name="HTML" id="HTML" doctypes="ASP.NET_VB,ASP.NET_CSharp,ASP-JS,ASP-VB,ColdFusion,CFC,HTML,JSP,EDML,PHP_MySQL,DWTemplate,LibraryItem,WML" priority="50"> <ignoreCase>Yes</ignoreCase> <ignoreTags>No</ignoreTags> <defaultText name="Text" id="CodeColor_HTMLText" /> <defaultTag name="Other Tags" id="CodeColor_HTMLTag" /> <defaultAttribute /> <commentStart name="Comment" id="CodeColor_HTMLComment"><![CDATA[<!--]]></commentStart>. . . <tagGroup name="HTML Anchor Tags" id="CodeColor_HTMLAnchor" taglibrary="DWTagLibrary_html" tags="a" /> <tagGroup name="HTML Form Tags" id="CodeColor_HTMLForm" taglibrary="DWTagLibrary_html" tags="select,form,input,option,textarea" />. . .</codeColoring>
Notice that the syntaxColor
and tagColor
tags in the Colors.xml file assign color and style values to an id
string value. The id
value is then used in the codeColoring.xml file to assign a style to a scheme tag. For example, the defaultTag
tag in the codeColoring.xml excerpt has an id
of "CodeColor_HTMLComment"
. In the Colors.xml file, the id
value of "CodeColor_HTMLComment"
is assigned a text=
value of "#999999"
, which is gray.
Adobe Dreamweaver includes the following code coloring schemes: Default, HTML, JavaScript, ASP_JavaScript, ASP_VBScript, JSP, and ColdFusion. The Default scheme has an id
value equal to "Text".
Adobe Dreamweaver uses the Default scheme for document types that do not have a defined code coloring scheme.
A code coloring file contains the following tags.