Skip to content

Replace gtk-doc with cdoc(MkDocs) for API reference

Pawel Sikora igt-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6mkdocs.yml: add mkdocs-cdoc and mdx_linkifydocs/requirements-docs.txt mkdocs.yml+32 -21 reply
2/6docs: add pages for API reference introductiondocs/api-intro.md docs/running_tests.md docs/tests-intro.md+128 -11 reply
3/6dockerfiles: update debian and fedora dockerfilesDockerfile.build-debian Dockerfile.build-debian-minimal Dockerfile.build-fedora+7 -21 reply
4/6docs/css/extra.css: make nav/toc initial max widthdocs/css/extra.css+4 -01 reply
5/6lib/intel_batchbuffer: update api docs urllib/intel_batchbuffer.c+1 -11 reply
6/6gitlab-ci: move api page build to MkDocs(cdoc).gitlab-ci.yml+0 -30 replies

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by.

PatchKamil Konieczny
1/6A-b
2/6
3/6
4/6A-b
5/6A-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH i-g-t v1 0/6] Replace gtk-doc with cdoc(MkDocs) for API reference

This series supersedes the previous mkdocs-based API reference generation approach:
https://patchwork.freedesktop.org/series/161238/

The key change in this new series is the switch from mkdoxy to mkdocs-cdoc:
https://github.com/pawelsikora/mkdocs-cdoc/ for generating API reference documentation.

The mkdocs-cdoc plugin offers several advantages:

1. Similar tooling used as Hawkmoth, providing a familiar workflow for documentation generation
2. No dependency on Doxygen, simplifying the build process and reducing external dependencies
3. Direct parsing of C source code using libclang Python bindings and fallback to regular regex parsing if clang is not available.

Additionally, gtk-doc markup in the current documentation stays as it is, as mkdocs-cdoc converts it on the fly. This allows the future transition of multiple files to happen later, not within this patchset. It also handles reStructuredText in documentation markup comments, allowing for a future transition of the markup and a potential decision to migrate to Sphinx or use it alongside MkDocs or other Markdown-based tools for documentation generation.

The series introduces the following changes:

Patch 1: Add mkdocs-cdoc plugin and mdx_linkify extension to mkdocs configuration. API reference build is split into igt-tests for 'tests' and igt-lib for 'lib' directories.
Patch 2: Add separate API reference introduction pages for index, lib, and tests. These pages are used by the cdoc plugin and are not included directly in the navigation config. Patch 3: Update Debian and Fedora dockerfiles to include clang Python bindings and clang development libraries required by mkdocs-cdoc.
Patch 4: Adjust CSS to set initial max-width for navigation and table of contents, improving readability when code examples are rendered side by side with explanations.
Patch 5: Update API documentation URLs in lib/intel_batchbuffer to match the new cross-referencing format.
Patch 6: Simplify GitLab CI by removing gtk-doc and meson build steps; the cdoc plugin configuration now handles API reference generation via 'mkdocs build'.

Build as before, first dependencies:

$ pip install -r docs/requirements-docs.txt

Then:

$ mkdocs build
to build static html pages.

or

$ mkdocs serve

to run the web server.

Looking forward to your comments,
Kind Regards,
Pawel Sikora

Pawel Sikora (6):
mkdocs.yml: add mkdocs-cdoc and mdx_linkify
docs: add pages for API reference introduction
dockerfiles: update debian and fedora dockerfiles docs/css/extra.css: make nav/toc initial max width lib/intel_batchbuffer: update api docs url
gitlab-ci: move api page build to MkDocs(cdoc)

 .gitlab-ci.yml                  |  3 --
 Dockerfile.build-debian         |  4 +-
 Dockerfile.build-debian-minimal |  4 +-
 Dockerfile.build-fedora         |  1 +
 docs/api-intro.md               | 81 +++++++++++++++++++++++++++++++++
 docs/css/extra.css              |  4 ++
 docs/requirements-docs.txt      |  2 +
 docs/running_tests.md           |  2 +-
 docs/tests-intro.md             | 46 +++++++++++++++++++
 lib/intel_batchbuffer.c         |  2 +-
 mkdocs.yml                      | 32 ++++++++++++-
 11 files changed, 172 insertions(+), 9 deletions(-)
 create mode 100644 docs/api-intro.md
 create mode 100644 docs/tests-intro.md
Signature · 1 line
2.51.0