Skip to content

vlantonov/CppDocumentExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CppDocumentExample

C++ code documentation example

Setup Doxygen

  • Startup command
doxygen -g ./doc/Doxyfile
  • CLI generation of Doxygen documentation
doxygen ./doc/Doxyfile

Important Doygen settings

  • 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

Diagram generators

  • Dot tool ( Graphviz ) available: HAVE_DOT = YES
  • Use UML notation for class diagrams: UML_LOOK = YES

Useful Doygen settings

General

  • 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 = "..."

Scope related

  • 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

Entrance points

  • 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

Diagram generators

  • 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

Source browsing

  • 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 = "..."

Doxygen CMake target

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"
)

Publish with GitHub action

  • Create the github action: .github/workflows/doxygen_publish.yml
  • Go to Settings -> Actions -> General -> Workflow and set Read and write permissions
  • Setup GitHub Pages
  • Go to Settings -> Pages
  • Set Build and deployment to Deploy from a branch
  • Set Branch to gh-pages and /(root)
  • Resulting site is https://vlantonov.github.io/CppDocumentExample/

Publish with Gitlab Pages

Doxygen C++ examples

Command Pattern References

Technical References

Example Document pages

Releases

No releases published

Packages

No packages published