C++ code documentation example
- Startup command
doxygen -g ./doc/Doxyfile
- CLI generation of Doxygen documentation
doxygen ./doc/Doxyfile
- Title of the project:
PROJECT_NAME = "..."
- Optional one line description of the project:
PROJECT_BRIEF = "..."
- Disable LaTeX output:
GENERATE_LATEX = NO
- Directory to put the HTML docs
OUTPUT_DIRECTORY = ./html/
- Files and/or directories that contain documented source files:
INPUT = ../include ../src
- Reuse documentation for the group:
DISTRIBUTE_GROUP_DOC = YES
- Show public members of class:
EXTRACT_ALL = YES
- Search subdirectories for input files:
RECURSIVE = YES
- Dot tool ( Graphviz ) available:
HAVE_DOT = YES
- Use UML notation for class diagrams:
UML_LOOK = YES
- Make a main page out of a markdown:
USE_MDFILE_AS_MAINPAGE = "..."
- Project logo file:
PROJECT_LOGO = "..."
- Match functions declarations and definitions whose arguments contain STL classes:
BUILTIN_STL_SUPPORT = YES
- Exclude documentation from external libraries:
EXCLUDE = "..."
- Show private members of class:
EXTRACT_PRIVATE = YES
- Show private virtual members of class:
EXTRACT_PRIV_VIRTUAL = YES
- Show static members of class:
EXTRACT_STATIC = YES
- Show all memebers of internal scope:
EXTRACT_PACKAGE = YES
- Show members of anonymous namespace:
EXTRACT_ANON_NSPACES = YES
- Add all the header and source file extensions used:
FILE_PATTERNS = *.cpp *.h *.hpp
- Generate list from all
/** @todo */
:GENERATE_TODOLIST = YES
- Generate list from all
/** @test */
:GENERATE_TESTLIST = YES
- Generate list from all
/** @bug */
:GENERATE_BUGLIST = YES
- Show all members in UML class:
UML_LIMIT_NUM_FIELDS = 0
- Generate a call dependency graph for every global function or class method:
CALL_GRAPH = YES
- Generate a caller dependency graph for every global function or class method:
CALLER_GRAPH = YES
- Show relationship for templates in graphs:
TEMPLATE_RELATIONS = YES
- Hide inheritance and usage relations if the target is undocumented or is not a class:
HIDE_UNDOC_RELATIONS = NO
- Number of threads to use for DOT:
DOT_NUM_THREADS = 4
- Show all functions that reference current function:
REFERENCED_BY_RELATION = YES
- Show all functions referenced by current function:
REFERENCES_RELATION = YES
- Include functions body to the generated HTML's:
INLINE_SOURCES = YES
- Specify files/folders with example code:
EXAMPLE_PATH = "..."
find_package(Doxygen REQUIRED dot)
set(DOXYGEN_PROJECT_NAME "C++ Document Example")
# Other Doxygen options
doxygen_add_docs(docs_target
${PROJECT_SOURCE_DIR}
COMMENT "Generate documentation"
)
- Documentation can be created without compiling the project:
make docs_target
- FindDoxygen
- Quick setup to use Doxygen with CMake
- Build doxygen from CMake script
- Create the github action:
.github/workflows/doxygen_publish.yml
- Go to
Settings -> Actions -> General -> Workflow
and setRead and write permissions
- Setup GitHub Pages
- Go to
Settings -> Pages
- Set
Build and deployment
toDeploy from a branch
- Set
Branch
togh-pages
and/(root)
- Resulting site is https://vlantonov.github.io/CppDocumentExample/
- Follow the steps in GitLab Pages
- Setup the pipeline in
.gitlab-ci.yml
as shown here - Go to
Deploy > Pages
section and untick theUse unique domain
- Go to
Settings > General > Visibility
and selectEveryone
in pages section. - Resulting site is https://vladiant.gitlab.io/CppDocumentExample/
- How to configure Doxygen for C++ code
- Creating a visualization of a C++ project with doxygen
- Learn how to use doxygen
- CPP / C++ Notes - Doxygen - Documentation Generator
- Doxygen for C++ projects