Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: Syntax Highlighting (is it possible?)

  1. #1

    Syntax Highlighting (is it possible?)

    Is there anyway we could add syntax highlighting to the sections?
    My DGDev forum pascal syntax highlight settings:
    <br />[background=#FFFFFF][comment=#8080FF][normal=#000080]
    <br />[number=#C00000][reserved=#000000][string=#00C000]

  2. #2

    Syntax Highlighting (is it possible?)

    No you can't....yet

    Give me a few days and I'll see what can be done

    While you're waiting, here's something to play with!

    Use [glow=color]Your text here [/glow] to add a glow to your text

    Use Your text here to add a shadow

    It's not syntax highlighting but at the moment it's all I've got for you :shock:

  3. #3

    Syntax Highlighting (is it possible?)

    I found this PHP code that might be of use. Currently it is set up to highlight PHP code sections (i.e. |php||/php|) in a C like fasion. We might be able to modify it so it handles |code||/code| sections and highlights itin a Pascal fashion.

    P.S. I also found this one for VB style highlighting. Now if I could just find one for Pascal!!!!

    P.P.S. Maybe I'll sit down and see if I can convert it myself.
    My DGDev forum pascal syntax highlight settings:
    <br />[background=#FFFFFF][comment=#8080FF][normal=#000080]
    <br />[number=#C00000][reserved=#000000][string=#00C000]

  4. #4

    Syntax Highlighting (is it possible?)

    Thanks, I'm still looking too. If you could write one yourself I'd be very grateful. If you go over to phpbbhacks.com there's plenty of info on making a mod. Then I can just install it here :twisted:

    If not, I'm sure between us we can work out how to replace the bit that formats [code].

  5. #5

    Syntax Highlighting (is it possible?)

    I've started on a Pascal highlighter based on that VB one. So far I've put ALL the reserved words in to it. Having a bit of trouble with comments at the moment. Let you know when it's done.

  6. #6

    Syntax Highlighting (is it possible?)

    I started working on the original C style one and was blown away at the amount of PHP code I couldn't decipher. Let me know how work goes on the VB one. I'll be trolling around the PHP tutorial sites trying to gain a bit of insight on it all.
    My DGDev forum pascal syntax highlight settings:
    <br />[background=#FFFFFF][comment=#8080FF][normal=#000080]
    <br />[number=#C00000][reserved=#000000][string=#00C000]

  7. #7

    Syntax Highlighting (is it possible?)

    I've got a working version now, it just highlights reserved words, comments and strings. A lot of work to do yet. And it's only working for the DarkEQ style so try it at your own risk!!

    If anyone can help, I'm having a little problem

    When I set the font colour, it changes the text to a different font. It should be a nice source code font like courier, but any text I put <font color=#xxxxxx></font> changes the font face. Is there a way in HTML to force a font to be applied, I'm not so good at this sort of thing. I'd guess the style sheet settings are overriding mine :?:

    This is how it looks now:

    [pascal]
    procedure test; //This is a comment
    begin
    string := 'And here is a string';
    number := 12345; // That was a number
    end;
    [/pascal]

  8. #8

    Syntax Highlighting (is it possible?)

    well, maybe this is a provisional solution for the problem. when I want to have syntax-highlighting in my code in other forums I use JAPP (just another pretty printer) which converts delphi- (and other code) into html. then you can insert the conversion into the post.
    http://www.martinpyka.de

  9. #9

    Syntax Highlighting (is it possible?)

    Thanks, but I think it's nearly done now :lol:

  10. #10

    Syntax Highlighting (is it possible?)

    Yeah that DarkEQ style is kinda ugly (no offense). As for the font, can't you just use:

    <font face="Arial, Courier New, Time New Roman" color="#xxxxxx">Text goes here</font>

    to specify the order in which fonts should be used if they are available? I'm pretty sure this would first use Arial, then Courier New, then Times New Roman then default to whatever the HTML page is set to use (given the availability of each).
    My DGDev forum pascal syntax highlight settings:
    <br />[background=#FFFFFF][comment=#8080FF][normal=#000080]
    <br />[number=#C00000][reserved=#000000][string=#00C000]

Page 1 of 4 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Comodo SSL