-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving crystal docs for C bindings #6721
Comments
You shouldn't document those (at least from an API point of view) because you are not supposed to directly expose them. You should wrap them with Crystal constructs, and document those. |
@asterite But sometimes it makes sense to expose parts of the C bindings (for example structs) in the public API to ensure interoperability with other other C libraries. See Enums in lib definitions can already be documented, by the way. The documentation from the lib enum will be used when it is aliased as Crystal type. |
I agree with @straight-shoota. I'm currently working on a GLFW wrapper, which happens to have support for creating Vulkan objects and wrapping them into anything doesn't make any sense, because those functions were designed to by directly used by Vulkan API. That's why I want to have some kind of documentation for lib functions. |
It's rare that a wrapped object will have no methods. In that case you have two options:
|
I would be fine with this if macros worked for |
That's already the case. The only issue is that because of some semantic intricacies, they are only accessible inside methods: def foo
{% p LibC.class.methods %}
end
foo |
I'd like to bring attention to this issue again if possible. I'd really love this as a feature. Maybe being a flag like |
I think this could work well if combined with #13184 if the C Lib stuff is put in a separate tab. |
Right now as far as I can see,
crystal docs
tool won't help you in any way if you are creating a binding to some C library. It isn't possible to document fun declarations with markdown comments, which I think might be beneficial.Would you consider adding support for documentation comments for fun declarations and other things related to bindings like C structs and enums?
The text was updated successfully, but these errors were encountered: