Thread: Code to HTML

  1. #1
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446

    Code to HTML

    Is there a standard way to convert cpp code to HTML (for the purpose of publishing code samples on a website)? I am hoping there is a way to preserve the text coloring used in visual studio. Thanks.
    The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.

  2. #2
    ---
    Join Date
    May 2004
    Posts
    1,379
    I dont know what compiler you are using but I can do it in dev-c++

  3. #3
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446
    I'm using Visual Studio.Net...it's surprising that the option is not available (or at least I couldn't find it). Any other ideas?
    The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.

  4. #4
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Download a copy of Dev-CPP and use it's export feature

  5. #5
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Perhaps this page is something for you?
    http://www.rafb.net/paste/
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  6. #6
    Registered User Scribbler's Avatar
    Join Date
    Sep 2004
    Location
    Aurora CO
    Posts
    266
    Highlight 2.2 is a nice utility that will convert your code into colored output in HTML, XHTML, RTF, TeX, LaTeX, XSL-FO and XML format.

  7. #7
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793

  8. #8
    ~viaxd() viaxd's Avatar
    Join Date
    Aug 2003
    Posts
    246
    i wrote my own little program to do this, pretty easy to do
    :wq

  9. #9
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446
    As I was reading these posts, I was thinking of writing a program to do it...not because it's needed, but it just sounds kind of fun.

    I was thinking of using the output of the www.rafb.net page as a starting place on what the HTML should look like.

    BTW, thanks everyone for the info.
    The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.

  10. #10
    Bob Dole for '08 B0bDole's Avatar
    Join Date
    Sep 2004
    Posts
    618
    I just use the <pre> tag
    Hmm

  11. #11
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Quote Originally Posted by B0bDole
    I just use the <pre> tag
    that won't hold up colors or anything...

    I use this program for HTML and vB exporting of my C/C++ code. It's also capable of Visual Basic code, and since it's open source, you can learn alot from it.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  12. #12
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446
    I just finished my own version. Yes...the <pre> tag was useful.
    The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 03-21-2006, 07:52 AM
  2. Problem : Threads WILL NOT DIE!!
    By hanhao in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2004, 01:37 PM
  3. Seems like correct code, but results are not right...
    By OmniMirror in forum C Programming
    Replies: 4
    Last Post: 02-13-2003, 01:33 PM
  4. Code to HTML?
    By RetroGamer1991 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-19-2002, 12:47 PM
  5. Shouldn't either HTML or vB code be enabled in the C++ Board?
    By SilentStrike in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-13-2001, 07:30 AM