The modern documentation tool for C++.


hdoc logo

hdoc: the modern documentation tool for C++

See for more details. Usage documentation is hosted at

An important notice about this repository

The contents of this repository are a subset of a private repository where hdoc's development takes place.

Overview and features

  • Autogenerated API documentation. hdoc generated API documentation for every function, record, enum, and namespace in your codebase.
  • Integrated Markdown pages. hdoc converts your Markdown pages into a website and puts it next to your API docs. All of your documentation is in one place.
  • Instant codebase search. Instant search-as-you-type lookup of symbols throughout your entire codebase.
  • Easy CI integration. Your documentation is never out of date if you build it with your code. All you need to do is add hdoc to your build job.
  • Advanced C++ parser. hdoc understands the newest C++ features with its advanced LLVM/Clang-based parser.
  • Clean, fast output. hdoc outputs fully static HTML with no required Javascript, ensuring your users never have to wait.

Quick start

hdoc depends on LLVM/Clang and OpenSSL, and all other dependencies are vendored in subprojects/. hdoc also comes with a Nix Flake which sets up a development environment for you with all of the needed dependencies, and should work on all Linux distributions. Follow the instructions below to build hdoc.

# Build hdoc
meson build             # Configure the build directory
ninja -C build          # Compile hdoc binaries and tests
./build/hdoc --verbose  # Run hdoc over itself, saving the HTML documentation to ./hdoc-output/

More instructions for using hdoc can be found at

Running tests

hdoc has a suite of unit and integration tests, which can be run using the instructions below.

# Assumes you've already built hdoc
cd build

# Running indexing unit tests

# Running integration tests
cd ../tests
./  # Pull testing repos from GitHub
./              # Run hdoc over testing repos

Repository structure

├── assets       # Static HTML/CSS/Favicons used in the generated HTML docs
├── index-tests  # Unit tests of hdoc's indexing functionality
├── site         # Source code for and hdoc's documentation
├── src          # C++ source code
│   ├── frontend   # Parses configuration file and CLI arguments
│   ├── indexer    # Parses a codebase and extracts documentation from it into an index
│   ├── serde      # Serialization/Deserialization of hdoc's index into HTML and other formats
│   ├── support    # Ancillary code used to parallelize indexing
│   └── types      # Types used by hdoc
├── subprojects  # Vendored dependencies
└── tests        # Integration testing scripts


hdoc relies on several open source software projects. We thank all of the contributors to these projects for their work. These are listed below in alphabetical order:

More information, including licenses, can be found at


hdoc is available under the AGPLv3 license, or a custom commercial license. For more information about commercial licensing, reach out to [email protected].

  • Hide Private Members?

    Hide Private Members?

    Is there a way we could prevent including private members with documentation? They kind of clutter the docs generated with members that developers can't even use.

    opened by jm4games 11
  • fix ignore.ignore_private_members=false being interpreted as =true

    fix ignore.ignore_private_members=false being interpreted as =true

    If the user specifies 'ignore.ignore_private_members=false' in their .hdoc.toml, we are interpreting that as if they wrote 'ignore.ignore_private_members=true'. This is because .as_boolean returns a pointer, and we are casting that non-null pointer to a boolean, which always yields true.

    Fix the problem:

    • Avoid auto, which made the problem harder to see
    • Use .value() (which returns a std::optional) instead of .as_boolean() (which returns a toml::value*)
    • Use * to extract the value from the std::optional (which the compiler helpfully now tells us to do)
    opened by strager 10
  • Compilation fixes

    Compilation fixes

    Compiling current master on Arch Linux fails for two reasons, both of which this PR addresses:

    • argparse.hpp currently does not include <utility>, which results in an compilation error; this is fixed by bumping it to v2.9.
    • Arch Linux ships it clang libraries as clang-cpp (as do some other distros), so that meson can't find the libraries; this is fixed by defaulting to using clang-cpp, but falling back to the old method. This is the same approach as used by mesa.
    opened by no92 8
  • Build error (can't find clang)

    Build error (can't find clang)

    To reproduce:

    1. clone repo
    2. meson build
    3. See this:
    /tmp/hdoc(master) » CC=gcc CXX=g++ meson build                                               bogdan@big
    The Meson build system
    Version: 0.57.1
    Source dir: /tmp/hdoc
    Build dir: /tmp/hdoc/build
    Build type: native build
    Project name: hdoc
    Project version: 1.0.1
    C++ compiler for the host machine: g++ (gcc 10.2.0 "g++ (GCC) 10.2.0")
    C++ linker for the host machine: g++ ld.bfd 2.36.1
    Host machine cpu family: x86_64
    Host machine cpu: x86_64
    Found CMake: /home/bogdan/.local/bin/cmake (3.18.4)
    WARNING: Ignoring LLVM CMake dependency because dynamic was requested
    llvm-config found: YES (/usr/bin/llvm-config) 11.1.0
    Run-time dependency LLVM found: YES 11.1.0
    Run-time dependency clang found: NO  ERROR: Dependency Clang not found: CMake: invalid module clangTooling for Clang.
    Try to explicitly specify one or more targets with the "modules" property.
    Valid targets are:
    ['LLVMDemangle', 'LLVMSupport', 'LLVMTableGen', 'llvm-tblgen', 'LLVMCore', 'LLVMFuzzMutate', 'LLVMIRReader', 'LLVMCodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter', 'LLVMMIRParser', 'LLVMGlobalISel', 'LLVMBinaryFormat', 'LLVMBitReader', 'LLVMBitWriter', 'LLVMBitstreamReader', 'LLVMDWARFLinker', 'LLVMExtensions', 'LLVMFrontendOpenACC', 'LLVMFrontendOpenMP', 'LLVMTransformUtils', 'LLVMInstrumentation', 'LLVMAggressiveInstCombine', 'LLVMInstCombine', 'LLVMScalarOpts', 'LLVMipo', 'LLVMVectorize', 'LLVMObjCARCOpts', 'LLVMCoroutines', 'LLVMCFGuard', 'LLVMLinker', 'LLVMAnalysis', 'LLVMLTO', 'LLVMMC', 'LLVMMCParser', 'LLVMMCDisassembler', 'LLVMMCA', 'LLVMObject', 'LLVMObjectYAML', 'LLVMOption', 'LLVMRemarks', 'LLVMDebugInfoDWARF', 'LLVMDebugInfoGSYM', 'LLVMDebugInfoMSF', 'LLVMDebugInfoCodeView', 'LLVMDebugInfoPDB', 'LLVMSymbolize', 'LLVMExecutionEngine', 'LLVMInterpreter', 'LLVMJITLink', 'LLVMMCJIT', 'LLVMOrcError', 'LLVMOrcJIT', 'LLVMRuntimeDyld', 'LLVMTarget', 'LLVMAArch64CodeGen', 'LLVMAArch64AsmParser', 'LLVMAArch64Disassembler', 'LLVMAArch64Desc', 'LLVMAArch64Info', 'LLVMAArch64Utils', 'LLVMAMDGPUCodeGen', 'LLVMAMDGPUAsmParser', 'LLVMAMDGPUDisassembler', 'LLVMAMDGPUDesc', 'LLVMAMDGPUInfo', 'LLVMAMDGPUUtils', 'LLVMARMCodeGen', 'LLVMARMAsmParser', 'LLVMARMDisassembler', 'LLVMARMDesc', 'LLVMARMInfo', 'LLVMARMUtils', 'LLVMAVRCodeGen', 'LLVMAVRAsmParser', 'LLVMAVRDisassembler', 'LLVMAVRDesc', 'LLVMAVRInfo', 'LLVMBPFCodeGen', 'LLVMBPFAsmParser', 'LLVMBPFDisassembler', 'LLVMBPFDesc', 'LLVMBPFInfo', 'LLVMHexagonCodeGen', 'LLVMHexagonAsmParser', 'LLVMHexagonDisassembler', 'LLVMHexagonDesc', 'LLVMHexagonInfo', 'LLVMLanaiCodeGen', 'LLVMLanaiAsmParser', 'LLVMLanaiDisassembler', 'LLVMLanaiDesc', 'LLVMLanaiInfo', 'LLVMMipsCodeGen', 'LLVMMipsAsmParser', 'LLVMMipsDisassembler', 'LLVMMipsDesc', 'LLVMMipsInfo', 'LLVMMSP430CodeGen', 'LLVMMSP430Desc', 'LLVMMSP430Info', 'LLVMMSP430AsmParser', 'LLVMMSP430Disassembler', 'LLVMNVPTXCodeGen', 'LLVMNVPTXDesc', 'LLVMNVPTXInfo', 'LLVMPowerPCCodeGen', 'LLVMPowerPCAsmParser', 'LLVMPowerPCDisassembler', 'LLVMPowerPCDesc', 'LLVMPowerPCInfo', 'LLVMRISCVCodeGen', 'LLVMRISCVAsmParser', 'LLVMRISCVDisassembler', 'LLVMRISCVDesc', 'LLVMRISCVInfo', 'LLVMRISCVUtils', 'LLVMSparcCodeGen', 'LLVMSparcAsmParser', 'LLVMSparcDisassembler', 'LLVMSparcDesc', 'LLVMSparcInfo', 'LLVMSystemZCodeGen', 'LLVMSystemZAsmParser', 'LLVMSystemZDisassembler', 'LLVMSystemZDesc', 'LLVMSystemZInfo', 'LLVMWebAssemblyCodeGen', 'LLVMWebAssemblyAsmParser', 'LLVMWebAssemblyDisassembler', 'LLVMWebAssemblyDesc', 'LLVMWebAssemblyInfo', 'LLVMX86CodeGen', 'LLVMX86AsmParser', 'LLVMX86Disassembler', 'LLVMX86Desc', 'LLVMX86Info', 'LLVMXCoreCodeGen', 'LLVMXCoreDisassembler', 'LLVMXCoreDesc', 'LLVMXCoreInfo', 'LLVMAsmParser', 'LLVMLineEditor', 'LLVMProfileData', 'LLVMCoverage', 'LLVMPasses', 'LLVMTextAPI', 'LLVMDlltoolDriver', 'LLVMLibDriver', 'LLVMXRay', 'LLVMWindowsManifest', 'FileCheck', 'llvm-PerfectShuffle', 'count', 'not', 'yaml-bench', 'LTO', 'LLVMgold', 'llvm-ar', 'llvm-config', 'llvm-lto', 'llvm-profdata', 'bugpoint', 'dsymutil', 'llc', 'lli-child-target', 'lli', 'llvm-as', 'llvm-bcanalyzer', 'llvm-c-test', 'llvm-cat', 'llvm-cfi-verify', 'llvm-cov', 'llvm-cvtres', 'llvm-cxxdump', 'llvm-cxxfilt', 'llvm-cxxmap', 'llvm-diff', 'llvm-dis', 'llvm-dwarfdump', 'llvm-dwp', 'llvm-elfabi', 'llvm-exegesis', 'llvm-extract', 'llvm-gsymutil', 'llvm-ifs', 'llvm-jitlink', 'llvm-link', 'llvm-lipo', 'llvm-lto2', 'llvm-mc', 'llvm-mca', 'llvm-ml', 'llvm-modextract', 'llvm-mt', 'llvm-nm', 'llvm-objcopy', 'llvm-objdump', 'llvm-opt-report', 'llvm-pdbutil', 'llvm-rc', 'llvm-readobj', 'llvm-reduce', 'llvm-rtdyld', 'LLVM', 'llvm-size', 'llvm-split', 'llvm-stress', 'llvm-strings', 'llvm-symbolizer', 'llvm-undname', 'llvm-xray', 'obj2yaml', 'opt', 'Remarks', 'sancov', 'sanstats', 'verify-uselistorder', 'yaml2obj', 'intrinsics_gen', 'omp_gen', 'acc_gen', 'diagtool', 'clang', 'clang-format', 'clang-offload-bundler', 'clang-offload-wrapper', 'clang-scan-deps', 'clang-rename', 'clang-refactor', 'clang-cpp', 'clang-check', 'clang-extdef-mapping', 'clang-apply-replacements', 'clang-reorder-fields', 'modularize', 'clang-tidy', 'clang-change-namespace', 'clang-doc', 'clang-include-fixer', 'find-all-symbols', 'clang-move', 'clang-query', 'pp-trace', 'clangd', 'libclang', 'clang-tablegen-targets']
    A full log can be found at /tmp/hdoc/build/meson-logs/meson-log.txt

    clang is installed, as well as g++/gcc. I tried to set CC=clang CXX=clang++, but this didn't help.

    opened by Warchant 7
  • Ability to hide timestamp in generated output

    Ability to hide timestamp in generated output

    This is a minor request, but one small change in my hdoc patches is to hide the timestamp from the footer of generated docs:


    Removing the timestamp reduces unnecessary thrash in the generated output. For example, this docs update does not include any changes to cpp docs because the timestamp is not in the footer.

    opened by jtbandes 5
  • Enable C language support in

    Enable C language support in

    When I tried creating a Dockerfile to build hdoc, I found that the CMake steps failed because C language support was not enabled. Adding 'c' to this list makes things work.

    Example failure:

    Determining dependency 'LLVM' with CMake executable '/usr/bin/cmake'
    Try CMake generator: Ninja
    CMake failed for generator Ninja and package LLVM with error code 1
    -- Could NOT find FFI (missing: HAVE_FFI_CALL) 
    -- Could NOT find Terminfo (missing: Terminfo_LINKABLE) 
    -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 
    -- Found LibXml2: /usr/lib/aarch64-linux-gnu/ (found version "2.9.13") 
    -- Configuring incomplete, errors occurred!
    See also "/hdoc/build/meson-private/cmake_LLVM/CMakeFiles/CMakeOutput.log".
    CMake Error at /usr/share/cmake-3.22/Modules/Internal/CheckSourceCompiles.cmake:44 (message):
      check_source_compiles: C: needs to be enabled before use.
    Call Stack (most recent call first):
      /usr/share/cmake-3.22/Modules/CheckCSourceCompiles.cmake:76 (cmake_check_source_compiles)
      /usr/lib/llvm-14/cmake/FindFFI.cmake:44 (check_c_source_compiles)
      /usr/lib/llvm-14/cmake/LLVMConfig.cmake:242 (find_package)
      CMakeLists.txt:9 (find_package)
    CMake Error at /usr/share/cmake-3.22/Modules/Internal/CheckSourceCompiles.cmake:44 (message):
      check_source_compiles: C: needs to be enabled before use.
    Call Stack (most recent call first):
      /usr/share/cmake-3.22/Modules/CheckCSourceCompiles.cmake:76 (cmake_check_source_compiles)
      /usr/lib/llvm-14/cmake/FindTerminfo.cmake:21 (check_c_source_compiles)
      /usr/lib/llvm-14/cmake/LLVMConfig.cmake:249 (find_package)
      CMakeLists.txt:9 (find_package)
    opened by jtbandes 5
  • Incorrect/Weird display of function

    Incorrect/Weird display of function

    When I declare a function as a return type like so

    constexpr auto borrow() const& noexcept -> const value_type&;

    hdoc displays it like so

    It seems to split the const& specifier on a member function and split it in 2 parts. Not sure why it happens. It's not a big bug, but i thought it was worth reporting

    opened by Wmbat 5
  • hdoc doesn't detect my comments

    hdoc doesn't detect my comments

    I'm trying hdoc, and it doesn't seem to show my class comments in the generated documentation.


    hdoc output: Screen Shot 2022-10-01 at 3 08 23 PM

    It doesn't seem to work with member functions either: Screen Shot 2022-10-01 at 3 09 09 PM

    or anything else I've looked at.

    Here's my .hdoc.toml:

    name = "quick-lint-js"
    version = "2.9.0"
    git_repo_url = ""
    compile_commands = "build/compile_commands.json"
    output_dir = "build/hdoc"
    opened by strager 4
  • Global variables

    Global variables

    It looks like hdoc doesn't show me any global variables. It only shows me classes, functions, enums, and namespaces. I'd like to see my globals listed, searchable, and documented.

    I have some file-scoped global variables (example, example). I do not want those variables to be listed by hdoc (because that would be noisy, and possibly confusing because of name collisions).

    opened by strager 3
  • Way to add examples to documentation

    Way to add examples to documentation

    Feature request:

    The only thing stopping me from fully adopting hdoc is the inability to add nicely formatted code examples. Ideally this would take the form of something like Doxygens:

    [[magic import example.cpp]]
    opened by ConorWilliams 3
  • Ability to hide or change giant

    Ability to hide or change giant "hdoc" title in the sidebar

    Another change that I keep in a hdoc patch is to remove this large "hdoc" link from the sidebar:


    I'm not against having a link back to to make the tool discoverable (and there already is one in the footer), but it doesn't need to be the largest link on the page and prominently displayed above the title of the actual project being documented. 😄

    opened by jtbandes 3
  • Wishlist: Markdown syntax

    Wishlist: Markdown syntax

    hdoc supports (some of) doxygen syntax, which makes sense.

    But instead, I would like to write documentation in the syntax of Rustdoc, which doesn't require a lot of keywords. Instead it uses markdown syntax:

    This could be a runtime option since being backward compat with doxygen seems like an important thing.

    An example comment that uses the # Header syntax in markdown, in this case # Safety which should appear on its own line bolded then:

    opened by danakj 1
  • Wishlist: Separate static and instance methods

    Wishlist: Separate static and instance methods

    Static methods disappear into the list of instance methods.

    It would also be really nice to separate constructors and operators out, and maybe even provide them in a more human-readable friendly way instead of just the C++ syntax.

    opened by danakj 3
  • Methods declared in a macro are not present in the documentation

    Methods declared in a macro are not present in the documentation

    Here's a class f32:

    It has a ton of static and instance methods declared in macros:

    However the documentation omits them all.

    The same is true for other classes like this in the project, i32, i8, u8, etc.

    opened by danakj 2
  • Ignore precompiled headers

    Ignore precompiled headers

    I build my project with precompiled headers. The compile_commands.json lists precompiled headers. Unfortunately, hdoc uses a different version of Clang than my build, leading to errors like the following when running hdoc:

    Error while processing /Users/strager/Projects/quick-lint-js/test/test-utf-16.cpp.
    [2022-10-01 14:59:58.924] [error] Failed to parse source file: /Users/strager/Projects/quick-lint-js/test/test-utf-16.cpp
    error: PCH file built from a different branch ((clang-1400.0.29.102)) than the compiler ()
    1 error generated.

    I think hdoc should disable PCH to work around this issue.

    opened by strager 1
  • Ability to exclude symbols/namespaces by regex match

    Ability to exclude symbols/namespaces by regex match

    Feature request: I would like to be able to exclude certain symbols, or symbols under certain namespaces, from the documentation and search index.

    This is one of the only remaining things I have to maintain in a patch:

    It would be great to specify an exclusion pattern in the config file, preferably using regular expressions for maximum flexibility. As an example:

    ignore_records = "^(.*::)?internal::.*$"
    ignore_functions = "^(.*::)?internal::.*$"
    opened by jtbandes 5
The modern documentation tool for C++.

hdoc: the modern documentation tool for C++ See for more details. Usage documentation is hosted at An important notice about thi

hdoc 209 Jan 8, 2023
Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:

sol2 sol2 is a C++ library binding to Lua. It currently supports all Lua versions 5.1+ (LuaJIT 2.0+ and MoonJIT included). sol2 aims to be easy to use

The Phantom Derpstorm 3.3k Jan 4, 2023
An operating system. Its main goal? Readable code, developer experience and documentation.

OS Dependencies Required for development. sudo apt install build-essential nasm grub-pc-bin grub-common xorriso Required for building cross-compiler.

Stijn Rogiest 1 Nov 15, 2022
Tube_gateways - Information and Documentation on Tube's Zigbee Gateways

Tube's Zigbee Gateways Information and documentation on Tube's Zigbee Gateways. Pre-assembed hardware devices can be purchased from https://www.tubesz

null 183 Jan 2, 2023
Documentation and code for rooting and extending a Bosch car head unit (lcn2kai)

Rooting Bosch lcn2kai Headunit My Nissan Xterra came with a (for the time) modern head unit that has a touch screen, built-in navigation, backup camer

null 339 Dec 12, 2022
pre-built coreboot images and documentation on how to flash them for Thinkpad Laptops

Skulls - not quite Heads pre-built coreboot images with an easy installation process Skulls makes it easy to install an unlocked, up-to-date and easy

Martin Kepplinger 514 Jan 3, 2023
A modern day direct port of BOOM 2.02 for modern times. Aiming to tastefully continue the development of BOOM, in the style of TeamTNT.

ReBOOM ReBOOM is a continuation of the BOOM source port, version 2.02. what is it ReBOOM is a source port, directly ported from BOOM 2.02 with additio

Gibbon 12 Jul 27, 2022
C++ game engine inspired by quake. Modern rendering and quake mapping tool integration.

Nuake Feel free to join the discord server for updates: What is it Nuake is a game engine written from scratch by myself. It is not meant to be a end-

Antoine Pilote 25 Oct 17, 2022
A modern-day Boss Key software tool. Switch instantly from work to play & play to work with Bosky.

Bosky By: Seanpm2001, Bosky-dev Et; Al. Top Read this article in a different language Sorted by: A-Z Sorting options unavailable ( af Afrika

Sean P. Myrick V19.1.7.2 2 Sep 10, 2022
6D - Pose Annotation Tool (6D-PAT) - is a tool that allows the user to load a set of images and also a set of 3D models and annotate where in the 2D image the 3D object ist placed.

6D - Pose Annotation Tool (6D-PAT) For detiled explanations checkout the WikiPage. What is it? With 6D-PAT you can create 6D annotations on images for

Florian Blume 71 Nov 20, 2022
C-based/Cached/Core Computer Vision Library, A Modern Computer Vision Library

Build Status Travis CI VM: Linux x64: Raspberry Pi 3: Jetson TX2: Backstory I set to build ccv with a minimalism inspiration. That was back in 2010, o

Liu Liu 6.9k Jan 6, 2023
Header-only, event based, tiny and easy to use libuv wrapper in modern C++ - now available as also shared/static library!

Do you have a question that doesn't require you to open an issue? Join the gitter channel. If you use uvw and you want to say thanks or support the pr

Michele Caini 1.5k Jan 1, 2023
A library for interactive command line interfaces in modern C++

cli A cross-platform header only C++14 library for interactive command line interfaces (Cisco style) Features Header only Cross-platform (linux and wi

Daniele Pallastrelli 888 Dec 31, 2022
Activity Indicators for Modern C++

Highlights Thread-safe progress bars and spinners Header-only library. Grab a copy of include/indicators. Single-header version in single_include/indi

Pranav 2.3k Jan 4, 2023
Table Maker for Modern C++

Source for the above image can be found here Table of Contents Quick Start Formatting Options Style Inheritance Model Word Wrapping Font Alignment Fon

Pranav 1.4k Dec 30, 2022
Modern concurrency for C++. Tasks, executors, timers and C++20 coroutines to rule them all

concurrencpp, the C++ concurrency library concurrencpp is a tasking library for C++ allowing developers to write highly concurrent applications easily

David Haim 1.2k Jan 3, 2023