Re: Kernel docs: muddying the waters a bit

From: Jani Nikula
Date: Thu Feb 18 2016 - 04:11:45 EST


On Thu, 18 Feb 2016, Daniel Vetter <daniel.vetter@xxxxxxxx> wrote:
> On Wed, Feb 17, 2016 at 11:14 PM, Jonathan Corbet <corbet@xxxxxxx> wrote:
>> On Sun, 14 Feb 2016 13:27:04 +0100
>> Daniel Vetter <daniel.vetter@xxxxxxxx> wrote:
>>
>>> One concern/open I have for pro/cons are the hyperlinks from kerneldoc
>>> comments. Currently we have the postproc hack, iirc Jani's patches
>>> generated links native when extracting the kerneldoc. What's the
>>> solution with spinx?
>>
>> So I've been trying to figure out what this refers to. Is this the
>> cross-reference links within the document? When I did my sphinx hack it
>> used a technique that, shall we say, strongly resembles what Jani's
>> patches did. One difference is that Sphinx has the concept of
>> "functions" built into it, so I use function references for those.
>
> That's what I meant. As long as I can type in stuff like func(),
> &struct and similar and get a link for it automatically (plus anywhere
> else in the templated stuff for function headers) I'm really happy.

I think that could be made to work in rst just as well as
asciidoc. Which is to say, kernel-doc may generate broken refs in both,
since it doesn't know if the link target exists outside of the
file. Also, in theory, it's possible to generate non-unique targets in
the end result if there are same named enums, structs, static functions
etc. but I think that's less of a problem. Asciidoc just ignores these
issues, I don't know what sphinx does.

I think some of that could be alleviated by making the kernel-doc
inclusion a directive through a sphinx extension. It could at the very
least provide informative error messages. But that's distant future.

Worth noting is that, AFAICT, in all of the proposals, including the
original where kernel-doc produces docbook, this autoreferencing only
works within parts processed by kernel-doc. Not in the template
documents themselves. (You can still use the markup's more verbose cross
referencing keywords.)


BR,
Jani.


--
Jani Nikula, Intel Open Source Technology Center