Chapter 5. Simple support for XML and HTML

Here is an example for contents of the ctags configuration file mentioned in the previous chapter. The example add simple support for XML files and HTML files (note that HTML is now supported natively in ctags):

--langdef=xml
--langmap=xml:.xml
--regex-xml=/<([^ \t]+)[ \t]*(id|name)[ \t]*=[ \t]*\"([^\"]+)/\1 \3/Named Tags/i

--langdef=html
--langmap=html:.htm.html
--regex-html=/<a[ \t]+href[ \t]*=[ \t]*\"([^\"]+)/\1/HRefs/i
--regex-html=/<img[ \t]+src[ \t]*=[ \t]*\"([^\"]+)/\1/Images/i
--regex-html=/<h([1-6])[^>]*>([^<]*)/\2 (\1)/Headers/i
	

The --langdef lines define the name of the language, the --langmap lines define the extensions of files for this language, and the --regex-html lines define the regular expressions describing the items of a language you want to see in Code Browser. For more info please see the ctags documentation.