# Automatically generate docs for wrapped C libraries

**URL:** <https://discourse.julialang.org/t/automatically-generate-docs-for-wrapped-c-libraries/45671>\
**Category:** Tooling\
**Tags:** question\
**Created:** [August 28, 2020, 10:06am UTC](https://discourse.julialang.org/t/automatically-generate-docs-for-wrapped-c-libraries/45671 "2020-08-28T10:06:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![serenity4](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/serenity4/32/44707_2.png) [@serenity4](https://discourse.julialang.org/u/serenity4)\
**Post date:** [August 28, 2020, 10:06am UTC](https://discourse.julialang.org/t/automatically-generate-docs-for-wrapped-c-libraries/45671/1 "2020-08-28T10:06:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [August 28, 2020, 11:46am UTC](https://discourse.julialang.org/t/automatically-generate-docs-for-wrapped-c-libraries/45671/2 "2020-08-28T11:46:43Z")

</div>

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

[https://github.com/JuliaGeo/GDAL.jl/tree/master/gen](https://github.com/JuliaGeo/GDAL.jl/tree/master/gen)

---

<div class="post-metadata">

**Author:** ![anon37204545](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon37204545](https://discourse.julialang.org/u/anon37204545)\
**Post date:** [August 28, 2020, 12:12pm UTC](https://discourse.julialang.org/t/automatically-generate-docs-for-wrapped-c-libraries/45671/3 "2020-08-28T12:12:21Z")

</div>

Great! I think that functionality should be in [JuliaInterop](https://github.com/JuliaInterop).

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [August 28, 2020, 12:35pm UTC](https://discourse.julialang.org/t/automatically-generate-docs-for-wrapped-c-libraries/45671/4 "2020-08-28T12:35:18Z")

</div>

A more desent solution would be [clang-doc](https://www.youtube.com/watch?v=bTzvPhKN0YI), but it’s a C++ library that cannot be directly `ccall`-ed from Julia.

---

<div class="post-metadata">

**Author:** ![serenity4](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/serenity4/32/44707_2.png) [@serenity4](https://discourse.julialang.org/u/serenity4)\
**Post date:** [August 28, 2020, 7:56pm UTC](https://discourse.julialang.org/t/automatically-generate-docs-for-wrapped-c-libraries/45671/5 "2020-08-28T19:56:25Z")

</div>

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!
