Automatically generate docs for wrapped C libraries

Hi,

I am wrapping a C library (XCB) with Clang, and I miss having docstrings around the wrapped library. I was wondering, is there a way to generate them automatically? Essentially, it would be interesting to have some kind of translation for example from C header docstrings to Julia docstrings (or a more abstract representation). I am aware that there exist different docstring formats, but having a tool to at least convert the most used docstring formats would be great.

GDAL.jl has a script to generate docstrings from Doxygen XML output:

https://github.com/JuliaGeo/GDAL.jl/tree/master/gen

2 Likes

Great! I think that functionality should be in JuliaInterop.

1 Like

A more desent solution would be clang-doc, but it’s a C++ library that cannot be directly ccall-ed from Julia.

1 Like

I ran into clang-doc, although it seems to me that a lot of work might have to be done to get it wrapped (but honestly I don’t have any experience in wrapping C++ libraries from Julia). Anyway, the scripts from GDAL.jl can be handy for quickly generating docstrings thanks!