Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Automatically document code (C++, PHP,...) with Doxygen UNIX

As a php coder, I'm sometimes overwhelmed by the sheer volume of code I'm writing. Then I stumbled on Doxygen, a documentation generator which reads your code and generates standard documentation pages about it. Aside from HTML, you can also generate LaTex, RTF, Postscript, Hyperlinked PDF's and Unix man pages. There's a Mac OS X version available if you don't like to compile it yourself.

How does it work? Doxygen runs from the prompt and reads a configuration file you have to prepare (once). The generated ouput is then ready to use. Of course, if you extend your comments in your code with the doxygen tags (like: author, version, to-do, etc.), your output will become more useful, as doxygen does cross-referencing and the works!

    •    
  • Currently 2.40 / 5
  You rated: 3 / 5 (5 votes cast)
 
[10,638 views]  

Automatically document code (C++, PHP,...) with Doxygen | 4 comments | Create New Account
Click here to return to the 'Automatically document code (C++, PHP,...) with Doxygen' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automatically document code (C++, PHP,...) with Doxygen
Authored by: gdsimms on Oct 14, '03 12:13:30PM

All right, but I'm too lazy to write my own Project Builder target/build step for this process. Anyone have a quick HOWTO on this?



[ Reply to This | # ]
Automatically document code (C++, PHP,...) with Doxygen
Authored by: TomorrowPlusX on Oct 14, '03 12:35:34PM

I don't have a quick howto, but I can tell you how to.

(Note that I've never actually done this, while I use doxygen for everything I do it from command line. However, I have let project builder automatically generate bindings using SWIG, and the process is conceptually similar)

Make a script somewhere in your project folder, for example, "makedocs.sh"

The script should contain the commands to make your docs, in my case I always name my doxygen config file the default name: "Doxyfile", so my script is nothing but an invocation of doxygen:

#!/bin/sh
doxygen

chmod it +x

Then, under your build phases, make a new "Shell script build phase" and have it run that shell script. I'm at work, where I use different tools, so I can't verify this, but my guess is you might have to do something either in your script or in the build-phase setup to make sure your working directory is right.

the whole process shold take you less than 5 minutes to setup and test.



[ Reply to This | # ]
Automatically document code (C++, PHP,...) with Doxygen
Authored by: gdsimms on Oct 15, '03 02:03:37PM

Holy smokes, that's trivial. I'm guessing it should be possible to use a similar method for invoking "moc" on Qt sources as well. Thanks!



[ Reply to This | # ]
Project Builder/Xcode (Cocoa)
Authored by: jscotta on Oct 14, '03 03:13:37PM

Anyone know of a similar product for the Cocoa using Project Builder/Xcode?

---
Windows because I have to. OS X because I want to.



[ Reply to This | # ]