public inbox for lkmm@lists.linux.dev
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Ignacio Encinas Rubio <ignacio@iencinas.com>,
	lkmm@lists.linux.dev, paulmck@kernel.org, joel@joelfernandes.org,
	Akira Yokosawa <akiyks@gmail.com>,
	linux-kernel-mentees@lists.linux.dev, peterz@infradead.org,
	corbet@lwn.net, Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: Potential translation of LKMM docs into ReST
Date: Mon, 31 Mar 2025 01:52:45 +0800	[thread overview]
Message-ID: <20250331015245.260fbb52@sal.lan> (raw)
In-Reply-To: <16aa2173-afb2-4781-b1b0-a248b1f16a9f@rowland.harvard.edu>

Em Sun, 30 Mar 2025 12:09:22 -0400
Alan Stern <stern@rowland.harvard.edu> escreveu:

> On Sun, Mar 30, 2025 at 01:07:23PM +0200, Ignacio Encinas Rubio wrote:
> > Hello!
> > 
> > There is interest [1] to get the memory model documentation into the 
> > built docs. Akira pointed out that this was discussed in the past [2].
> > 
> > A couple of years have gone by, so I was wondering whether the decision
> > to keep plain text documentation still applies. 
> > 
> > There is an "easy" way [3] to get the plain text documentation into the
> > built docs, but I would be happy to work in a conversion into ReST if
> > that's what you want :)
> > 
> > Ccing people involved in [2]
> > 
> > Thanks!
> > 
> > [1] https://lore.kernel.org/all/87o6y5lvvg.fsf@trenco.lwn.net/
> > [2] https://lore.kernel.org/lkml/20190901133530.GL4125@linux.ibm.com/
> > [3] https://lore.kernel.org/all/20220927160559.97154-7-corbet@lwn.net/  
> 
> I have no great interest in seeing the memory model documentation 
> translated into ReST, but you're welcome to try it and see how it comes 
> out if you want.  Some of the files are likely to be easier to convert 
> than others.
> 
> The only restriction I will insist on is that if the resulting ReST 
> source files end up being unreadable because of all the markup they 
> contain then we must keep the original plain text files too.

I did some attempts to convert some of them to ReST. Some files
could be a little be tricky if we want them to be converted, but
it is possible to go to a minimal set of changes. For instance:

	Documentation/memory-barriers.txt

There is an outdated conversion of it could be found at:
	https://lkml.org/lkml/2017/5/18/1267

If you take a look on it, most of the changes are minimal. On a
quick look on my previous patch, what we have is:

1) the most relevant change: example blocks need to use "::", like:

    -in 24 different combinations:
    +in 24 different combinations::
 
 	STORE A=3,	STORE B=4,	y=LOAD A->3,	x=LOAD B->4
 	STORE A=3,	STORE B=4,	x=LOAD B->4,	y=LOAD A->3

2) This won't work:

	By: foo
	    bar

   As it will produce a warning and place everything on a single line.
   The smallest change would be to add a blank line after :, e.g.:

	By:
	    foo
	    bar

3) This is not valid list on ReST:

	 (*) element
	 (*) element

   On ReST, unumerated lists use either:

	- element
	- element

   or:

	* element
	* element 

   We may also use, instead, a numerated list with:
 
	(#) element
	(#) element

  On such case, Sphinx will automatically numerate the list
  This is what I proposed back them to make changes minimal,
  as i wouldn't need to adjust indentation.

4) Tables in ReST require an extra line before/after it:

	+	===============	=======================	===========================
	 	TYPE		MANDATORY		SMP CONDITIONAL
	 	===============	=======================	===========================
	 	GENERAL		mb()			smp_mb()
	 	WRITE		wmb()			smp_wmb()
	 	READ		rmb()			smp_rmb()
	 	DATA DEPENDENCY	read_barrier_depends()	smp_read_barrier_depends()
	+	===============	=======================	===========================

5) Footnotes on ReST require a different notation. Either:

	[1]_

   or:

	[#]_

   and, at the place they're used:


	.. [1] foo

   or

	.. [#] foo

 
6) Chapter numeration markups need to start from column 1. On files with
   sub-chapters, some changes to use the same markup might me needed (this is
   not the case of memory-barriers).

The remaining changes I did back then on such patch were cosmetic to make it
look more similar to other parts of Documentation, like using "Titles Case"
for chapters and converting CONTENTS to a comment for them to not appear at
the docs output (as Sphinx already generates a contents index).

Regards,
Mauro


  reply	other threads:[~2025-03-30 17:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-30 11:07 Potential translation of LKMM docs into ReST Ignacio Encinas Rubio
2025-03-30 16:09 ` Alan Stern
2025-03-30 17:52   ` Mauro Carvalho Chehab [this message]
2025-05-06  2:50 ` [PATCH] lkmm: docs: Put LKMM documentation into dev-tools book Akira Yokosawa
2025-05-07  0:07   ` Paul E. McKenney
2025-06-09 22:03   ` Jonathan Corbet
2025-06-10  2:11     ` Akira Yokosawa
2025-06-10  8:13       ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250331015245.260fbb52@sal.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=akiyks@gmail.com \
    --cc=corbet@lwn.net \
    --cc=ignacio@iencinas.com \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=lkmm@lists.linux.dev \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox