# Doxygen — Documentation Generator for C++, C, Java, and More > The de facto standard tool for generating API documentation from annotated source code, producing HTML, LaTeX, PDF, and man pages from specially formatted comments. ## Install Save as a script file and run: # Doxygen — Documentation Generator for C++, C, Java, and More ## Quick Use ```bash # Install sudo apt install doxygen # Debian/Ubuntu brew install doxygen # macOS # Generate config and build docs doxygen -g Doxyfile doxygen Doxyfile # Open html/index.html ``` ## Introduction Doxygen is the standard documentation generator for C++, C, Objective-C, Java, Python, and several other languages. It extracts specially formatted comments from source code and produces browsable HTML documentation, LaTeX output for PDF generation, man pages, and XML for further processing. It has been the go-to tool for API documentation in systems programming for over two decades. ## What Doxygen Does - Parses source code comments in Javadoc, Qt, or backslash-style formats - Generates cross-referenced HTML documentation with syntax-highlighted source listings - Produces LaTeX output that can be compiled into high-quality PDF manuals - Creates class inheritance diagrams, collaboration graphs, and call graphs via Graphviz - Supports multiple languages including C, C++, Java, Python, Fortran, and C# ## Architecture Overview Doxygen is a single C++ binary that preprocesses source files, parses comment blocks against a grammar of documentation commands, and emits output through pluggable generators. The HTML generator produces a static site with JavaScript-powered search. The XML generator outputs structured data for custom post-processing. Graphviz is invoked as a subprocess for diagram generation. ## Self-Hosting & Configuration - Install from system package managers on Linux, macOS, and Windows - Generate a default Doxyfile with doxygen -g and customize project settings - Set INPUT to your source directories and FILE_PATTERNS to the relevant extensions - Enable HAVE_DOT and set DOT_PATH to generate class and call graphs with Graphviz - Integrate into CI pipelines by running doxygen Doxyfile and publishing the html directory ## Key Features - Supports over a dozen programming languages from a single tool - Generates interactive HTML with full-text search, class hierarchy browsers, and source cross-references - Produces publication-quality PDF output via LaTeX - Automatic diagram generation for class hierarchies, collaboration, and call graphs - Extensive configuration with over 300 options in the Doxyfile ## Comparison with Similar Tools - **Sphinx** — Python-centric, RST-based documentation; Doxygen excels at C/C++ API docs from source comments - **Javadoc** — Java-only; Doxygen handles Java plus many other languages - **Breathe** — bridge between Doxygen XML and Sphinx for combined docs; not a standalone generator - **Standardese** — modern C++ doc generator; Doxygen has a much larger ecosystem and broader language support ## FAQ **Q: What comment formats does it support?** A: Javadoc-style (/** */), Qt-style (/*! */), and triple-slash (///) formats are all supported. **Q: Can it document Python code?** A: Yes. Doxygen can parse Python docstrings, though Sphinx is more commonly used in the Python ecosystem. **Q: How do I generate PDF output?** A: Enable GENERATE_LATEX in the Doxyfile, run doxygen, then compile the LaTeX output with pdflatex or make in the latex directory. **Q: Does it support Markdown?** A: Yes. Markdown is supported in documentation comments and can be used for standalone pages. ## Sources - https://github.com/doxygen/doxygen - https://www.doxygen.nl --- Source: https://tokrepo.com/en/workflows/asset-f430e4ae Author: Script Depot