8

I want to a tool which can convert c/c++ source code files to HTML files. So far all tools I have found, like src-highlite, highlight, can only do syntax highlighting. The critical feature I want is to navigate over code and when my mouse moves over a classname, I can click the hyperlink and it takes me to the definition file of the class.

Then I can package these HTML files into a .mobi file, so I can read source code on my kindle.

Does anybody know?

Bart
  • 19,692
  • 7
  • 68
  • 77
soulmachine
  • 3,917
  • 4
  • 46
  • 56

3 Answers3

13

Have you checked out Doxygen?

It will generate documentation from your comments too. There's lot of other cool features like a class graph, file dependencies graph, and of course just HTML files of the source.

For an example of the output, check out the KDE library API reference.

albert
  • 8,285
  • 3
  • 19
  • 32
David Hu
  • 3,076
  • 24
  • 26
  • yes! this is exactly what I want, Thank you:) In fact I ever used Doxyen about a year ago, I remind that it could embeds the whole source code along with comments into HTML. – soulmachine Nov 25 '11 at 02:11
1

check enscript: http://linux.die.net/man/1/enscript

nscript --color -Ecpp -fCourier8 *.cpp -o - |ps2pdf - output.pdf
perreal
  • 94,503
  • 21
  • 155
  • 181
1

Or use vim, open the file, and issue :TOhtml.

Zsolt Botykai
  • 50,406
  • 14
  • 85
  • 110