Wanted: Syntax-colouring scripts?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim Tyler

    Wanted: Syntax-colouring scripts?

    Are there any syntax colouring scripts out there?

    Ones where you provide the script with the path or URL of some source
    file - and they return a web page containing correctly-coloured
    source code?

    I'd be particularly interested in a version in PHP that rendered
    HTML/PHP/Javascript.
    --
    __________
    |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.
  • Ian.H

    #2
    Re: Wanted: Syntax-colouring scripts?

    On Thu, 16 Oct 2003 19:44:42 +0000, Tim Tyler wrote:
    [color=blue]
    > Are there any syntax colouring scripts out there?
    >
    > Ones where you provide the script with the path or URL of some source file
    > - and they return a web page containing correctly-coloured source code?
    >
    > I'd be particularly interested in a version in PHP that rendered
    > HTML/PHP/Javascript.[/color]


    For PHP...


    highlight_strin g()

    and

    highlight_file( )


    Don't know off hand about HTML and JS though.


    HTH =)



    Regards,

    Ian

    --
    Ian.H [Design & Development]
    digiServ Network - Web solutions
    www.digiserv.net | irc.digiserv.ne t | forum.digiserv. net
    Programming, Web design, development & hosting.

    Comment

    • Tim Tyler

      #3
      Re: Wanted: Syntax-colouring scripts?

      Ian.H <ian@windozedig iserv.net> wrote or quoted:[color=blue]
      > On Thu, 16 Oct 2003 19:44:42 +0000, Tim Tyler wrote:[/color]
      [color=blue][color=green]
      >> Are there any syntax colouring scripts out there?
      >>
      >> Ones where you provide the script with the path or URL of some source file
      >> - and they return a web page containing correctly-coloured source code?
      >>
      >> I'd be particularly interested in a version in PHP that rendered
      >> HTML/PHP/Javascript.[/color]
      >
      > For PHP...
      >
      > highlight_strin g()
      >
      > and
      >
      > highlight_file( )
      >
      > Don't know off hand about HTML and JS though.[/color]

      That manages PHP - though not in my favourite colour scheme.

      I see most others messing with the colours are post-processing the HTML
      output of this function - aargh! :-(

      An open source PHP script which did some decent rendering would be nice.

      However at least this is a lot better than nothing at all ;-)
      --
      __________
      |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.

      Comment

      • Tim Tyler

        #4
        Re: Wanted: Syntax-colouring scripts?

        Tim Tyler <tim@tt1lock.or g> wrote or quoted:[color=blue]
        > Ian.H <ian@windozedig iserv.net> wrote or quoted:[color=green]
        >> On Thu, 16 Oct 2003 19:44:42 +0000, Tim Tyler wrote:[/color][/color]
        [color=blue][color=green][color=darkred]
        >>> Are there any syntax colouring scripts out there?
        >>>
        >>> Ones where you provide the script with the path or URL of some source file
        >>> - and they return a web page containing correctly-coloured source code?
        >>>
        >>> I'd be particularly interested in a version in PHP that rendered
        >>> HTML/PHP/Javascript.[/color]
        >>
        >> For PHP...
        >>
        >> highlight_strin g()
        >>
        >> and
        >>
        >> highlight_file( )
        >>
        >> Don't know off hand about HTML and JS though.[/color]
        >
        > That manages PHP - though not in my favourite colour scheme.
        >
        > I see most others messing with the colours are post-processing the HTML
        > output of this function - aargh! :-([/color]

        I hacked in someone else's colour changes and made a simple attempt to
        dealt with HTML comments.

        Example:


        The script:


        There is a great deal which could be done to improve legibility...
        but I'm reluctant to do any more on the existing foundations.

        If a colouring script is written it probably ought to be done properly -
        rather than by post-processing some HTML spat out by another program in
        a non-standard format.
        --
        __________
        |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.

        Comment

        • Andy Hassall

          #5
          Re: Wanted: Syntax-colouring scripts?

          On Thu, 16 Oct 2003 18:44:42 GMT, Tim Tyler <tim@tt1lock.or g> wrote:
          [color=blue]
          >Are there any syntax colouring scripts out there?
          >
          >Ones where you provide the script with the path or URL of some source
          >file - and they return a web page containing correctly-coloured
          >source code?
          >
          >I'd be particularly interested in a version in PHP that rendered
          >HTML/PHP/Javascript.[/color]

          It's not PHP, but webcpp is good at syntax colouring.

          Download Web C Plus Plus (webcpp) for free. Webcpp converts Ada95, ASP, Assembler, Basic, C, C#, C++, Cg, CLIPS, Fortran, Haskell, Java, Markup, Modula2, Objective C, Pascal, Perl, PHP, Python, Renderman, Ruby, SQL, Tcl, Unix shell, UnrealScript & VHDL into HTML with syntax highlighting and themes


          Easy enough to call from PHP.

          --
          Andy Hassall (andy@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
          Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)

          Comment

          • Tim Tyler

            #6
            Re: Wanted: Syntax-colouring scripts?

            I wrote a PHP syntax highlighter that handles HTML:


            --
            __________
            |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.

            Comment

            Working...