Re: Help required - kernel-doc, code block and backslash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 15, 2024 at 12:38:38PM -0700, Jonathan Corbet wrote:
> Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx> writes:
> 
> > Hi,
> >
> > I'll try to integrate some documentation which is already written in
> > code comments into the kernel documentation.
> >
> > There I face the problem with a backslash at the end of a line in a
> > 'code block' and this ends up in removing the newline.
> 
> Yes, kernel-doc does that...looking at the history, that behavior was
> added in 2012 (commit 65478428443) because otherwise multi-line macros
> are not handled properly.
> 
> Fixing this properly is not going to be all that easy; the code reading
> the source file is well before any sort of parsing, so it has no idea of
> whether it's in a comment or not.
> 
> A really ugly workaround... put something relatively inconspicuous, like
> "     .", after the backslash, and at least your formatting won't be
> mangled.

Well ... if we're into "ugly workaround" territory, we could use '^ *'
as a marker for "we're in a comment, ignore the backslash".  My skills
in this area are terrible, so would something like this work?

while (!/^ \*/ && s/\\\s*$//) {

I would try it myself, but Something Changed, and even without it,
I've just started getting:

Sphinx parallel build error:
AssertionError

when I run make htmldocs.





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux