22 Mar 2005, 17:22
'Code Vault' Updated
About a year ago, instead of revision I wrote a small script of just under 500 lines to syntax highlight code files and display them. Now, a year later I'm releasing the first update to it! It's only a minor change:
- Fixes a compatibility bug---it was working with PHP>=4.2 but not 4.1 which was the stated compatibility.
- Makes the XHTML generation greedy, and so if you get several tokens of the same type then it coalesces them into one set of span tags rather than multiple ones. This should have a noticable effect on the size of the generated HTML file and seems to also speed up the generation probably due to decreased memory usage.
The script, oddly named 'Code Vault' because it makes no pretentions to securing the files is displaying itself here: http://www.ajrn.co.uk/src/?/xix_code_vault.
Licensed under the GPL, feel free to distribute, alter etc as appropriate.
- Fixes a compatibility bug---it was working with PHP>=4.2 but not 4.1 which was the stated compatibility.
- Makes the XHTML generation greedy, and so if you get several tokens of the same type then it coalesces them into one set of span tags rather than multiple ones. This should have a noticable effect on the size of the generated HTML file and seems to also speed up the generation probably due to decreased memory usage.
The script, oddly named 'Code Vault' because it makes no pretentions to securing the files is displaying itself here: http://www.ajrn.co.uk/src/?/xix_code_vault.
Licensed under the GPL, feel free to distribute, alter etc as appropriate.
Posted By: Alaric
Post your comment to this article