Doxygen is an open-source code documentation generator originally written by Dimitri van Heesch. It parses specially-formatted comment blocks directly inside your C, C++, Java, or Python source files and automatically builds browsable HTML (or LaTeX/PDF) API reference documentation from them. It sits around #16 among documentation tools at roughly 4.3% usage share, and teams reach for it specifically because the docs live next to the code they describe and stay in sync as the code changes.
Doxygen reads specially-marked comment blocks (starting with /**) that use tags like @brief, @param, and @return to describe a function.
/**
* @brief Computes the shipping cost for an order.
*
* @param weightKg The package weight in kilograms.
* @param destZip The destination ZIP/postal code.
* @return double The computed shipping cost in USD.
*
* @note Throws std::invalid_argument if weightKg is negative.
*/
double computeShippingCost(double weightKg, const std::string& destZip) {
if (weightKg < 0) {
throw std::invalid_argument("weight cannot be negative");
}
return weightKg * 2.5 + zoneRateFor(destZip);
}
Install Doxygen, generate a default config file, then point it at your source directory and run it to produce an HTML docs site.
# generate a default Doxyfile config in the current directory
doxygen -g
# edit Doxyfile: set INPUT = ./src and GENERATE_HTML = YES
# run it โ produces html/index.html with your full API reference
doxygen Doxyfile