Re: [PEPr] Comment on Text::Text_Highlighter
| From: | Andrey Demenev | Date: | Sat, 15 May 2004 00:43:07 +0000 |
| Subject: | Re: [PEPr] Comment on Text::Text_Highlighter | ||
| References: | 1 | Groups: | php.pear.dev php.pear.dev |
| Request: | Send a blank email to pear-dev+get-29251@lists.php.net to get a copy of this message | ||
Pepr wrote:
Bertrand Mansion (http://pear.php.net/user/mansion) has commented on the proposal for Text::Text_Highlighter. Comment: Very cool stuff ! A few comments : - The generated code has weird (MS-DOS ?) line endings. You might want to encode your Generator.php file to use Unix line feeds. - CS: use spaces before and after =, ==, commas, ?, :, etc. - A few notices: toplevel is undeclared, undefined index for never-contained and contains-all in the generator.Thank you, will be fixed
- You might want to make the generator a CLI tool so that it is easier to use. Have a look at my Console_Getargs package for the options ;)That seems to be reasonable
- Rendering: I don't like the generated HTML very much. Using <font> tags is outdated. You might consider to use an external renderer (see HTML_Menu for example) and use <span> with a css is certainly better solution. I suggest you have a look at how Horde is handling the line numbers in Chora (see cvs.php.net for examples). The problem with using <li> is that they will be selected when user want to copy/paste code. Also remember that a lot of users use <pre> to display code.The main reason why I have chosen not to use line numbering in Chora style is that to allow placing the highlighted code anyware on a page. And using tables may be not sutable ? About the tags, should I leave just one option, <span> with css classes? Does anyone has ideas about this?
I have been able to write the XML for an highlighter for Objective-C source code in half an hour, I will contribute it if you want when it is ready. Thanks for this nice package :)Thank you, any help is appreciated -- Andrey Demenev aka Blindman demenev@on-line.jar.ru