项目作者: pcolby

项目描述 :
Render Doxygen XML via Grantlee Templates
高级语言: CSS
项目地址: git://github.com/pcolby/doxlee.git
创建时间: 2021-09-01T23:20:21Z
项目社区:https://github.com/pcolby/doxlee

开源协议:GNU General Public License v3.0

下载


Doxlee

Build Status
Static Analysis
Codacy Grade
Codacy Coverage

Doxlee renders source code documentation by applying text templates to Doxygen‘s XML output.

  1. flowchart LR
  2. subgraph Your project
  3. src[(Source\ncode)]
  4. templates[(Templates)]
  5. end
  6. subgraph Doxygen
  7. doxygen(doxygen) --> doxml[("doxml\n(XML)")]
  8. end
  9. subgraph Doxlee
  10. doxlee(doxlee) --> renders[(HTML,\nMarkdown,\netc.)]
  11. end
  12. src --> doxygen
  13. doxml & templates --> doxlee(doxlee)

Doxygen does support using your own custom headers, footers, and style sheets, which can achieve a fair amount of
flexibility already (Doxygen Awesome is a great example). But those options do not allow fundamental restructuring of
things like the navigation menus, sidebar and breadcrumbs. So if Doxygen‘s built-in options are sufficient for your
desired output, then you should definitely use them directly. But if you do desire more control over the generated
documentation, then feel free to explore this project :)

Text Templates

Doxlee uses a text template language that is very similar to Django templates. Specfically, Doxlee uses either the
Grantlee or Cutelee library (the latter is a Qt6-compatible fork of the former).

[!NOTE]
Doxlee began using the Grantlee library with Qt5. However, the Grantlee author has moved the library to KDE,
where it is now known as KTextTemplate, and the original Grantlee library has been retired. Meanwhile, the
Cutelyst project has forked Grantlee to Cutelee, and ported it to Qt6. Today, Doxlee supports both Grantlee
(with Qt5) and Cutelee (with Qt6). Doxlee will most likely support KTextTemplate too, when that library becomes
more readily available.

You can find the template language documention here. You can also
have a look at some of the demo templates.

Installation

\todo

For now, see Building from Source below.

Usage

Update your Doxygen configuration file to enable XML output:

  1. GENERATE_XML = YES
  2. XML_OUTPUT = <path-to-xml> # Optional; defaults to xml.
  3. XML_PROGRAMLISTING = YES # Optional; set to YES to include source code in the documentation.
  4. XML_NS_MEMB_FILE_SCOPE = YES # Optional; set to YES to include namespace documentation, if any.

Generate the documentation:

  1. doxygen [configname]
  2. doxlee -i <path-to-xml-> -o <path-to-write-output> -t <path-to-theme>

There are some other basic options too. Use --help to see them.

  1. Usage: doxlee [options]
  2. Render Doxygen XML via text templates
  3. Options:
  4. -i, --input-dir <dir> Read Doyxgen XML files from dir
  5. -t, --templates-dir <dir> Read text templates from dir
  6. -o, --output-dir <dir> Write output files to dir
  7. -d, --debug Enable debug output
  8. --color <yes|no|auto> Color the console output (default auto)
  9. --overwrite <yes|no|prompt> Overwrite existing files (default prompt)
  10. -f, --force Same as --overwrite=yes but also skip initial
  11. prompt
  12. -h, --help Displays help on commandline options.
  13. --help-all Displays help, including generic Qt options.
  14. -v, --version Displays version information.

Building from Source

Just follow a typical CMake-based out-of-source build process:

  1. cmake -E make_directory <tmp-build-dir>
  2. cmake -D CMAKE_BUILD_TYPE=Release -S <path-to-cloned-repo> -B <tmp-build-dir>
  3. cmake --build <tmp-build-dir>
  4. ctest --test-dir <tmp-build-dir> --verbose