[PHP] Aeperio, syntax highlighter

Results 1 to 6 of 6
  1. #1
    Gamma Daevius is offline
    MemberRank
    Jun 2007 Join Date
    NetherlandsLocation
    3,252Posts

    [PHP] Aeperio, syntax highlighter

    Hi,

    I've been working on this project for quite a while. Preety complicated to make this script efficient and fast. But it came out pretty good :D. I have only programmed highlighting for PHP yet, but other languages can be added very easily, just add a new config file with a few css files (for the actual colour).

    Here it is: PHP Highlighter

    Fill in any PHP code you want. You will get the coloured result and some information about the script/execution at the bottom.

    To view the config file: http://www.daevius.com/aeperio/php.php.txt
    To view the index.php file: PHP Highlighter
    To view the CSS file: http://www.daevius.com/aeperio/langu...reamweaver.css

    The script will be open-source, once I finish it (this is the beta release).

    Enjoy :), and please comment for improvements/issues ;).

    PS: GeSHi is a syntax highlighter too. I tested with a 1000 lines code, and came to the following results:
    GeSHi highlighted it in ~4.50 seconds.
    Aeperio highlighted it in ~1.40 seconds.


  2. #2
    Member MaestroS is offline
    MemberRank
    Aug 2006 Join Date
    PolandLocation
    83Posts

    Re: [PHP] Aeperio, syntax highlighter

    Nice script, but you know, highliters made in PHP sux... integrate PHP with ajax and write dynamic highlighting ;)

  3. #3
    Gamma Daevius is offline
    MemberRank
    Jun 2007 Join Date
    NetherlandsLocation
    3,252Posts

    Re: [PHP] Aeperio, syntax highlighter

    Hmm, interesting. How do you think I should integrate AJAX into this script? (I have no experience with AJAX (willing to learn) but I don't know how I could use it in this script).

    I was planning to make a script that will save the highlighted text, and thus if you reload the page it doesn't have to regenerate the highlighting but just simply loads it.

  4. #4
    Member MaestroS is offline
    MemberRank
    Aug 2006 Join Date
    PolandLocation
    83Posts

    Re: [PHP] Aeperio, syntax highlighter

    It is well-known that you cannot format textarea directly with HTML, so you must find another way to highlight text.

  5. #5
    Gamma Daevius is offline
    MemberRank
    Jun 2007 Join Date
    NetherlandsLocation
    3,252Posts

    Re: [PHP] Aeperio, syntax highlighter

    Quote Originally Posted by MaestroS View Post
    It is well-known that you cannot format textarea directly with HTML, so you must find another way to highlight text.
    So basically: you have an textarea and when you start entering text, it will get coloured instantly? Can I call php scripts with ajax, because I;m not going to rewrite the code in ajax :P

    Feature list I have yet to do so far:
    - Integrate into smarty
    - Integrate ajax into it?
    - Writing result into file for re-use (for the next time you load the page it will just load the premade file)
    - Switching of language colouring in one page (ie: html and php, or php and mysql).
    - More languages, like mysql, C++, html, css, javascript etc etc etc

  6. #6
    Member MaestroS is offline
    MemberRank
    Aug 2006 Join Date
    PolandLocation
    83Posts

    Re: [PHP] Aeperio, syntax highlighter

    AJAX is just for that.
    By AJAX you're executing PHP scripts, managing website content etc. without reloading site you're currently viewing.

    The point is to format an area you're writing text in.

    I heard that there're GUI components available. Check, if there is a MEMO "component" and check if its available for direct format.



Advertisement