However, web development frequently includes several different languages in one file, such as in Drupal Development:
- The basic language is HTML.
The <SCRIPT> tag switches context to Javascript.
The <?PHP tag switches context to PHP
The PHP can also include all the Drupal-specific functions.
Additionally, since Javascript is between <SCRIPT> tags, it looks like plain text to Textpad, and doesn't get any highlighting at all.
What would be better is if Textpad could use several .syn definitions for a single file.
( This doesn't only apply to Drupal development, but also for Wordpress, ASP, and any other web framework where several languages get mixed in one file. )
Here's a possible implemention:
In [ Textpad.. Configure.. Preferences ]. you specify the primary .syn file for a file extension. For example, *.module would use "Drupal6Html5.syn".
Inside "Drupal6HTML5.syn", you define all the HTML5 tags. You also specify the start and end tags to mark other languages, such as "<?php" and "?>" as start and end tags for "Drupal6PHP5.syn". Also, you would specify "<SCRIPT.*>" and "</SCRIPT>" as the start and end tags for "JavascriptJQuery1.6.syn".
The corresponding .syn files would then be used for syntax highlighting between those tags.