1 Apr 2009 20:08
New bflang2 language highlighting for Smarty
I've put together a bflang2 languge highlighting definition file for Smarty templates. Smarty is template engine which allows the separation of presentation logic from processing logic in PHP-enabled web sites. The Smarty template language is basically a superset of HTML and can theoretically contain PHP code as well. The smarty.bflang2 file is in the latest SVN revision in the data directory, and uses a code-reuse scheme suggested by Daniel which might prove potentially useful for other bflang files as well, and would allow, for instance, all bflang2 files which define html highlighting to be kept current with the language by updating the inclusion rather than each one separately. smarty.bflang2 contains these two lines: <!ENTITY all-html SYSTEM "all-html.bfinc"> <!ENTITY all-php SYSTEM "all-php.bfinc"> The all-html entity, extracted from html.bflang2, is used twice and all-php is used once. The files all-html.bfinc and all-php.bfinc are required to be in the same directory with smarty.bflang2. I've also re-written html.bflang2 and php.bflang2 to use these as well, so that all-html.bfinc becomes the HTML core language definition file for HTML, apart from the header and other bluefish related code. I've done the same for PHP in all-php.bfinc which encapsulates all the language definition elements from php.bflang2. Both the modified html.bflang2 and php.bflang2 work as expected. They're not in SVN, but can easily be re-created for testing. Comments and suggestions are requested.(Continue reading)
RSS Feed