All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Heiser <markus.heiser@darmarit.de>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>, Jonathan Corbet <corbet@lwn.net>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Grant Likely <grant.likely@secretlab.ca>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Dan Allen <dan@opendevise.io>,
	Russel Winder <russel@winder.org.uk>,
	Keith Packard <keithp@keithp.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-doc@vger.kernel.org, Hans Verkuil <hverkuil@xs4all.nl>,
	"linux-media\@vger.kernel.org linux-media" 
	<linux-media@vger.kernel.org>,
	Graham Whaley <graham.whaley@linux.intel.com>
Subject: Re: Kernel docs: muddying the waters a bit
Date: Fri, 6 May 2016 13:23:06 +0200	[thread overview]
Message-ID: <6BDB8BFB-6AEA-46A8-B535-C69FBC6FF3BD@darmarit.de> (raw)
In-Reply-To: <87inytn6n2.fsf@intel.com>


Hy Jani,

Am 04.05.2016 um 18:13 schrieb Jani Nikula <jani.nikula@intel.com>:

>> Am 04.05.2016 um 17:09 schrieb Jonathan Corbet <corbet@lwn.net>:
>> 
>>> I think all of this makes sense.  It would be really nice to have the
>>> directives in the native sphinx language like that.  I *don't* think we
>>> need to aim for that at the outset; the docproc approach works until we can
>>> properly get rid of it.  What would be *really* nice would be to get
>>> support for the kernel-doc directive into the sphinx upstream.
>> 
>> No need for kernel-doc directive in sphinx upstream, later it will be 
>> an extension which could be installed by a simple command like 
>> "pip install kernel-doc-extensions" or similar.
>> 
>> I develop these required extension (and more) within my proof of concept
>> on github ... this takes time ... if I finished all my tests and all is
>> well, I will build the *kernel-doc-extensions* package and deploy it
>> on https://pypi.python.org/pypi from where everyone could install this 
>> with "pip".
> 
> I think we should go for vanilla sphinx at first, to make the setup step
> as easy as possible for everyone. Even if it means still doing that ugly
> docproc step to call kernel-doc. We can improve from there, and I
> definitely appreciate your work on making this work with sphinx
> extensions.

+1 

> That said, how would it work to include the kernel-doc extension in the
> kernel source tree? Having things just work if sphinx is installed is
> preferred over requiring installation of something extra from pypi. (I
> know this may sound backwards for a lot of projects, but for kernel I'm
> pretty sure this is how it should be done.)

Thats all right. Lets talk about the extension infrastructure by example:

First we have to chose a folder where we place all the *sphinx-documentation*
I recommending:

 /share/linux/Documentation/sphinx

Next we have to chose a folder where reST-extensions should take place, I
would prefer ... or similar:
 
 /share/linux/Documentation/sphinx/extensions

Lets say, you wan't to get in use of the "flat-table" extension.

Copy (only) the rstFlatTable.py file from my POC extension folder (ignore
other extensions which might be there) ...

 https://github.com/return42/sphkerneldoc/tree/master/doc/extensions

Now lets say you are writing on a gpu book, it wold be placed in the folder:

 /share/linux/Documentation/sphinx/gpu

In this gpu-folder you have to place the conf.py config file, needed to
setup the sphinx build environment.

 /share/linux/Documentation/sphinx/gpu/conf.py

In this conf.py you have to *register* your folder with the extensions.

<SNIP conf.py> --------

    import os.path, sys

    EXT_PATH  = "../extensions"  # the path of extension folder relative to the conf.py file
    sys.path.insert(0, os.path.join(os.path.dirname(__file__), EXT_PATH)))

    # now import the "flat-table" extension, it will be self-registering to docutils

    import rstFlatTable

<SNIP conf.py> --------

Thats all, you can run your sphinx-build command and the flat-tables in your
reST sources should be handled as common tables.

ASIDE: 

You will find similar parts in your conf.py which you have created 
with the sphinx-quickstart command. There, you will also find a block 
looks like ...

extensions = [
    'sphinx.ext.autodoc'
....
]

Don't try to add flat-table extension to this list. This list is a list
of sphinx extensions, we will use it later for other *real* sphinx 
extensions.

A few words about the flat-table extension and a (future) kernel-doc one:

The flat-table is a pure docutils (the layer below sphinx) extension which
is not application specific, so I will ask for moving it to the docutils 
upstream. 

The kernel-doc extension on the other side is a very (very) kernel specific
application, this would never go to sphinx nor docutils upstream.

--Markus--

  parent reply	other threads:[~2016-05-06 11:23 UTC|newest]

Thread overview: 127+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-13 21:53 Kernel docs: muddying the waters a bit Jonathan Corbet
2016-02-14  0:57 ` Keith Packard
2016-02-14 12:27   ` Daniel Vetter
2016-02-14 16:27     ` Keith Packard
2016-02-17 22:14     ` Jonathan Corbet
2016-02-17 22:29       ` Daniel Vetter
2016-02-18  9:11         ` Jani Nikula
2016-02-18  9:24           ` Daniel Vetter
2016-02-18 10:26             ` Mauro Carvalho Chehab
2016-02-18 11:23               ` Jani Nikula
2016-02-18 12:04                 ` Mauro Carvalho Chehab
2016-02-18 12:07                   ` Hans Verkuil
2016-02-18 12:44                     ` Mauro Carvalho Chehab
2016-02-18 13:34                       ` Patrick Boettcher
2016-02-18 13:01             ` Jonathan Corbet
2016-02-18 14:39               ` Daniel Vetter
2016-02-16  8:25 ` Jani Nikula
2016-02-16 16:08   ` Jonathan Corbet
2016-02-16 17:11     ` Jani Nikula
2016-02-16 19:13   ` Keith Packard
2016-02-16 19:59     ` Jonathan Corbet
2016-02-17  0:01       ` Keith Packard
2016-03-03 14:03 ` Jani Nikula
2016-03-03 14:13   ` Jonathan Corbet
2016-03-03 14:34     ` One Thousand Gnomes
2016-03-03 15:17       ` Jonathan Corbet
2016-03-03 15:45         ` Daniel Vetter
2016-03-03 18:50     ` Mauro Carvalho Chehab
2016-03-03 23:23       ` Keith Packard
2016-03-04  1:19         ` Mauro Carvalho Chehab
2016-03-04  8:29           ` Jani Nikula
2016-03-04  8:59             ` Johannes Stezenbach
2016-03-04 12:59             ` Mauro Carvalho Chehab
2016-03-04 14:09               ` Johannes Stezenbach
2016-03-06  2:29                 ` Mauro Carvalho Chehab
2016-03-06 23:29                   ` Johannes Stezenbach
2016-03-07  8:48                     ` Johannes Stezenbach
2016-03-07 12:15                       ` Mauro Carvalho Chehab
2016-03-07 12:19                     ` Mauro Carvalho Chehab
2016-03-04  7:28         ` Russel Winder
2016-03-04  7:46           ` Jani Nikula
2016-03-08  4:53             ` Russel Winder
     [not found]           ` <CAKeHnO6sSV1x2xh_HgbD5ddZ8rp+SVvbdjVhczhudc9iv_-UCQ@mail.gmail.com>
2016-03-08  9:49             ` Jani Nikula
2016-03-08 11:29               ` Mauro Carvalho Chehab
     [not found]                 ` <CAKeHnO7R25knFH07+3trdi0ZotsrEE+5ZzDZXdx33+DUW=q2Ug@mail.gmail.com>
2016-03-08 13:39                   ` Mauro Carvalho Chehab
2016-03-08 15:39                     ` Mauro Carvalho Chehab
2016-03-09 21:27                       ` Mauro Carvalho Chehab
2016-03-10 10:25                         ` Jani Nikula
2016-03-10 15:21                           ` Mauro Carvalho Chehab
2016-03-13 15:33                             ` Markus Heiser
2016-04-08 15:12                               ` Markus Heiser
2016-04-08 15:12                                 ` Markus Heiser
2016-04-12  9:18                                 ` Hans Verkuil
2016-04-12  9:18                                   ` Hans Verkuil
2016-04-12 15:46                                 ` Jonathan Corbet
2016-04-12 15:46                                   ` Jonathan Corbet
2016-04-18  9:49                                   ` Markus Heiser
2016-04-18  9:49                                     ` Markus Heiser
2016-04-27 14:28                                   ` Grant Likely
2016-04-27 14:28                                     ` Grant Likely
2016-05-03 14:31                                     ` Daniel Vetter
2016-05-03 14:31                                       ` Daniel Vetter
2016-05-03 15:54                                       ` Keith Packard
2016-05-03 15:54                                         ` Keith Packard
2016-05-04  9:34                                       ` Markus Heiser
2016-05-04  9:34                                         ` Markus Heiser
2016-05-04  9:58                                         ` Jani Nikula
2016-05-04  9:58                                           ` Jani Nikula
2016-05-04 12:40                                           ` Markus Heiser
2016-05-04 12:40                                             ` Markus Heiser
2016-05-04 13:41                                             ` Jani Nikula
2016-05-04 13:41                                               ` Jani Nikula
2016-05-04 15:09                                               ` Jonathan Corbet
2016-05-04 15:09                                                 ` Jonathan Corbet
2016-05-04 13:43                                             ` Daniel Vetter
2016-05-04 13:43                                               ` Daniel Vetter
2016-05-04 14:18                                               ` Daniel Vetter
2016-05-04 14:18                                                 ` Daniel Vetter
2016-05-04 14:57                                                 ` Jonathan Corbet
2016-05-04 14:57                                                   ` Jonathan Corbet
2016-05-04 15:02                                                   ` Daniel Vetter
2016-05-04 15:02                                                     ` Daniel Vetter
2016-05-04 16:32                                                     ` Daniel Vetter
2016-05-04 16:32                                                       ` Daniel Vetter
2016-05-04 15:44                                                   ` Jani Nikula
2016-05-04 15:44                                                     ` Jani Nikula
2016-05-04 16:38                                                   ` Mauro Carvalho Chehab
2016-05-04 16:38                                                     ` Mauro Carvalho Chehab
2016-05-04 15:55                                               ` Markus Heiser
2016-05-04 15:55                                                 ` Markus Heiser
2016-05-04 16:13                                                 ` Jani Nikula
2016-05-04 16:13                                                   ` Jani Nikula
2016-05-04 16:50                                                   ` Mauro Carvalho Chehab
2016-05-04 16:50                                                     ` Mauro Carvalho Chehab
2016-05-04 16:59                                                     ` Jonathan Corbet
2016-05-04 16:59                                                       ` Jonathan Corbet
2016-05-04 17:57                                                       ` Mauro Carvalho Chehab
2016-05-04 17:57                                                         ` Mauro Carvalho Chehab
2016-05-05 13:02                                                         ` Jonathan Corbet
2016-05-05 13:02                                                           ` Jonathan Corbet
2016-05-05 13:23                                                           ` Mauro Carvalho Chehab
2016-05-05 13:23                                                             ` Mauro Carvalho Chehab
2016-05-06 11:23                                                   ` Markus Heiser [this message]
2016-05-06 11:23                                                     ` Markus Heiser
2016-05-06 11:44                                                     ` Markus Heiser
2016-05-06 11:44                                                       ` Markus Heiser
     [not found]                                                     ` <20160506083529.31ad2fa0@recife.lan>
     [not found]                                                       ` <BAE3C147-6C21-4242-BD3C-8989C1626E10@darmarit.de>
     [not found]                                                         ` <20160506104210.12197832@recife.lan>
2016-05-06 14:27                                                           ` Markus Heiser
2016-05-06 14:27                                                             ` Markus Heiser
2016-05-06 15:06                                                             ` Jani Nikula
2016-05-06 15:23                                                               ` Mauro Carvalho Chehab
2016-05-06 15:35                                                               ` Markus Heiser
2016-05-06 15:52                                                                 ` Jani Nikula
2016-05-06 15:14                                                             ` Mauro Carvalho Chehab
2016-05-04 16:15                                         ` Mauro Carvalho Chehab
2016-05-04 16:15                                           ` Mauro Carvalho Chehab
2016-05-06 10:05                                           ` Markus Heiser
2016-05-06 10:05                                             ` Markus Heiser
     [not found]                                             ` <20160506080304.56307066@recife.lan>
2016-05-06 16:26                                               ` Markus Heiser
2016-05-06 17:06                                                 ` Mauro Carvalho Chehab
     [not found]                                 ` <20160412105850.50e02108@recife.lan>
2016-04-18  8:10                                   ` Markus Heiser
2016-04-18  8:10                                     ` Markus Heiser
2016-04-18 11:16                                     ` Mauro Carvalho Chehab
2016-04-18 11:16                                       ` Mauro Carvalho Chehab
     [not found]               ` <CAKeHnO7_7k8Qc5Jmu_x2OzAVT4YXxW8PSe_m6QUP-8V7XxbTVw@mail.gmail.com>
2016-03-08 13:30                 ` Mauro Carvalho Chehab
2016-03-08 13:58                 ` Jani Nikula
     [not found]                   ` <CAKeHnO7e5Escm0Ndm50eFX-qUXf7Lg9n=iXvwUGjz2M4KHLMsQ@mail.gmail.com>
2016-03-09  8:57                     ` Jani Nikula
2016-03-07  3:48   ` Jonathan Corbet

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=6BDB8BFB-6AEA-46A8-B535-C69FBC6FF3BD@darmarit.de \
    --to=markus.heiser@darmarit.de \
    --cc=corbet@lwn.net \
    --cc=dan@opendevise.io \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel@ffwll.ch \
    --cc=graham.whaley@linux.intel.com \
    --cc=grant.likely@secretlab.ca \
    --cc=hverkuil@xs4all.nl \
    --cc=jani.nikula@intel.com \
    --cc=keithp@keithp.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=russel@winder.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.