Colored Syntax

This is a discussion on Colored Syntax within the C Programming forums, part of the General Programming Boards category; I am trying to put all my source files online. I want to show them in HTML colored syntax format. ...

  1. #1
    Unregistered
    Guest

    Colored Syntax

    I am trying to put all my source files online.
    I want to show them in HTML colored syntax format.
    Is there a program that does this ?
    for example, if I put php (in []) and /php (in []) in
    this forum, I see that it is colored.
    PHP Code:
    cout << "How do I convert my .CPP programs into Colored syntax like this and save as HTML files ? << endl; 
    Any help is appreciated.
    COOL PROGRAMS @ www.akilla.tk

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231

    Re: Colored Syntax

    Originally posted by Unregistered
    I want to show them in HTML colored syntax format.
    Is there a program that does this ?
    Google is your friend.... it found me this.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Akilla
    Guest

    ok

    I downloaded the zip file (http://www.paulgriffiths.net/program/c/fibo.zip)

    It contains a bunch of source files. How do I compile them ?
    I have borland C++ 5.5 , Turbo C++ 3.0

    I dont know how to compile when there're more files. I am new to this.

    Can anyone please help ?


    COOL PROGRAMS @ www.akilla.tk

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231

    Re: ok

    Originally posted by Akilla
    How do I compile them ?
    I have borland C++ 5.5
    I tried this one with Borland 5.5, it compiled OK, but when I ran it, it complained about some problem setting file pointers. Anyways, unzip the source to a directory of their own, and do something like:
    >bcc32 -e ctohtml.exe *.c

    I also used gcc, and it compiled fine and worked well to.

    If you can't get this one going, I'm sure there will be others to try. Just use our mate google
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  5. #5
    Akilla
    Guest

    Post Nope

    Nope! Not working.

    Here's the situation
    C:\Documents and Settings\akilla\Desktop\Ctohtml>bcc32 -e ctohtml.exe *.c
    Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    Error E2194: Could not find file 'ctohtml.exe'
    file.c:
    html.c:
    main.c:
    Warning W8060 main.c 31: Possibly incorrect assignment in function main
    process.c:
    token.c:
    It did not create an EXE

    Any help appreciated.

    COOL PROGRAMS @ www.akilla.tk

  6. #6
    Akilla
    Guest

    and..

    when I did this,
    bcc32 -e *.c


    It created a file ".exe"

    I renamed it to file.exe but when I run it, it show's
    some garbage but doesn't work. :-(

    COOL PROGRAMS @ www.akilla.tk

  7. #7
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    There's no space between the -e and ctohtml.exe (or at least there shouldn't be, my example was wrong )

    Try this
    >bcc32 -ectohtml.exe *.c

    When you run it like this
    >ctohtml source.c
    it will write a whole load of stuff to the screen. Just redirect it to a file like this:
    >ctohtml source.c >source.html
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  8. #8
    Akilla
    Guest

    Unhappy ok.. i got it to work but..

    where is the colored syntax ?
    The file just made the htm file but did not have
    color syntax.. :-(

  9. #9
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    You need the CSS file here http://www.paulgriffiths.net/c.css

    You may also need to change the HTML source to point to this file on your local PC, as by default it uses something like /c/c.css. I take it you know enough HTML to know about this sort of stuff?
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  3. Using VC Toolkit 2003
    By Noobwaker in forum Windows Programming
    Replies: 8
    Last Post: 03-13-2006, 06:33 AM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 09:33 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21