10 :program:`clang-doc` is a tool for generating C and C++ documentation from
11 source code and comments.
13 The tool is in a very early development stage, so you might encounter bugs and
14 crashes. Submitting reports with information about how to reproduce the issue
15 to `the LLVM bugtracker <https://bugs.llvm.org/>`_ will definitely help the
16 project. If you have any ideas or suggestions, please to put a feature request
22 :program:`clang-doc` is a `LibTooling
23 <https://clang.llvm.org/docs/LibTooling.html>`_-based tool, and so requires a
24 compile command database for your project (for an example of how to do this
25 see `How To Setup Tooling For LLVM
26 <https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html>`_).
28 By default, the tool will run on all files listed in the given compile commands
31 .. code-block:: console
33 $ clang-doc /path/to/compile_commands.json
35 The tool can also be used on a single file or multiple files if a build path is
36 passed with the ``-p`` flag.
38 .. code-block:: console
40 $ clang-doc /path/to/file.cpp -p /path/to/build
45 :program:`clang-doc` produces a directory of documentation. One file is produced
46 for each namespace and record in the project source code, containing all
47 documentation (including contained functions, methods, and enums) for that item.
49 The top-level directory is configurable through the ``output`` flag:
51 .. code-block:: console
53 $ clang-doc -output=output/directory/ compile_commands.json
58 Configuration for :program:`clang-doc` is currently limited to command-line options.
59 In the future, it may develop the ability to use a configuration file, but no such
60 efforts are currently in progress.
65 :program:`clang-doc` offers the following options:
67 .. code-block:: console
70 USAGE: clang-doc [options] <source0> [... <sourceN>]
76 -help - Display available options (-help-hidden for more)
77 -help-list - Display list of available options (-help-list-hidden for more)
78 -version - Display the version of this program
82 --doxygen - Use only doxygen-style comments to generate docs.
83 --extra-arg=<string> - Additional argument to append to the compiler command line
84 Can be used several times.
85 --extra-arg-before=<string> - Additional argument to prepend to the compiler command line
86 Can be used several times.
87 --format=<value> - Format for outputted docs.
88 =yaml - Documentation in YAML format.
89 =md - Documentation in MD format.
90 =html - Documentation in HTML format.
91 --ignore-map-errors - Continue if files are not mapped correctly.
92 --output=<string> - Directory for outputting generated files.
93 -p=<string> - Build path
94 --project-name=<string> - Name of project.
95 --public - Document only public declarations.
96 --repository=<string> -
97 URL of repository that hosts code.
98 Used for links to definition locations.
99 --source-root=<string> -
100 Directory where processed files are stored.
101 Links to definition locations will only be
102 generated if the file is in this dir.
103 --stylesheets=<string> - CSS stylesheets to extend the default styles.
105 The following flags should only be used if ``format`` is set to ``html``: