Conversation

Jarkko Sakkinen

@jani, Didn't DRM documentation have some nice way to embed and include documentation from source files?

In vcam, I will have at least documentation blocks for theory of operation and very like locking hierarchy (depending on complexity). It would be nice to have in Documentation/ something that includes those snippets.

Just looking for tips and too lazy for RTFM ATM :-)
1
0
1

@jarkko It's not only DRM documentation, but all kernel documentation. We were just spearheading the whole thing originally.

Add this to path/to/source.c:

/**
* DOC: My cool overview
*
* (rst formatted documentation)
*/

And this to some .rst file under Documentation:

.. kernel-doc:: path/to/source.c
:doc: My cool overview

It'll slurp in the documentation from the source. Obvously you can also document functions etc. See the link below for more.

https://docs.kernel.org/doc-guide/kernel-doc.html

1
1
1
@jani thanks! better to take this approach now that i'm writing a completely new driver
0
0
1