linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Keith Packard <keithp@keithp.com>,
	Jonathan Corbet <corbet@lwn.net>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-doc@vger.kernel.org, Daniel Vetter <daniel.vetter@ffwll.ch>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	linux-media@vger.kernel.org,
	Graham Whaley <graham.whaley@linux.intel.com>,
	Johannes Stezenbach <js@linuxtv.org>
Subject: Re: Kernel docs: muddying the waters a bit
Date: Fri, 4 Mar 2016 09:59:50 -0300	[thread overview]
Message-ID: <20160304095950.3358a2cb@recife.lan> (raw)
In-Reply-To: <87si06r6i3.fsf@intel.com>

Em Fri, 04 Mar 2016 10:29:08 +0200
Jani Nikula <jani.nikula@intel.com> escreveu:

> On Fri, 04 Mar 2016, Mauro Carvalho Chehab <mchehab@osg.samsung.com> wrote:
> > Em Thu, 03 Mar 2016 15:23:23 -0800
> > Keith Packard <keithp@keithp.com> escreveu:
> >  
> >> Mauro Carvalho Chehab <mchehab@osg.samsung.com> writes:
> >>   
> >> > On my tests, Sphinix seemed too limited to format tables. Asciidoc
> >> > produced an output that worked better.    
> >> 
> >> Yes, asciidoc has much more flexibility in table formatting, including
> >> the ability to control text layout within cells and full control over
> >> borders.
> >> 
> >> However, I think asciidoc has two serious problems:
> >> 
> >>   1) the python version (asciidoc) appears to have been abandoned in
> >>      favor of the ruby version. 
> >> 
> >>   2) It really is just a docbook pre-processor. Native html/latex output
> >>      is poorly supported at best, and exposes only a small subset of the
> >>      full capabilities of the input language.
> >> 
> >> As such, we would have to commit to using the ruby version and either
> >> committing to fixing the native html output backend or continuing to use
> >> the rest of the docbook toolchain.
> >> 
> >> We could insist on using the python version, of course. I spent a bit of
> >> time hacking that up to add 'real' support for a table-of-contents in
> >> the native HTML backend and it looks like getting those changes
> >> upstreamed would be reasonably straightforward. However, we'd end up
> >> 'owning' the code, and I'm not sure we want to.  
> >
> > I'm a way more concerned about using a tool that fulfill our needs
> > than to look for something that won't use the docbook toolchain or
> > require to install ruby.  
> 
> I think you meant that to be the other way round, or I fail at parsing
> you. ;)

I mean: I'm a way more concerned about using a tool that fulfill our
needs than on toolchain it uses.

> 
> > In the case of Docbook, we know it works and we know already its
> > issues. Please correct me if I'm wrong, but the big problem we
> > have is not due to the DocBook toolchain, but due to the lack of
> > features at the kernel-doc script. Also, xmlto is already installed
> > by the ones that build the kernel docs. So, keeping use it won't
> > require to install a weird toolchain by hand.  
> 
> I think kernel-doc is just a small part of the puzzle. It's a problem,
> but a small one at that, and we've already made it output asciidoc, rst
> and docbook as part of this exercise. For real, as in code, not as in
> talk.
> 
> The reasons I'm involved in this is that I want to make writing
> documentation and rich kernel-doc comments easier (using lightweight
> markup) and I want to make building the documentation easier (using a
> straightforward toolchain with not too many dependencies). I'm hoping
> the former makes writing documentation more attractive and the latter
> keeps the documentation and the toolchain in a better shape through
> having more people actually build the documentation.

I don't think the toolchain is a problem. We don't attract too many
people because developers don't like writing documentation.

Ok, using a markup language can be easier than writing DocBook
tags directly, but people usually don't even add C comments on
the code they submit.

> IMHO docbook is problematic because the toolchain gets too long and
> fragile. You need plenty of tools installed to build the documentation,
> it's fussy to get working, and people just won't. Like code,
> documentation bitrots too when it's not used. 

On most distros, a single command installs all that it is needed.

> The documentation build is broken too often. 

This is indeed a problem, but the way I solved this at the media
subsystem is that I rebuild the documentation every time a media
file either at Documentation/Docbook or included at device-drivers.tmpl
is touched.

If the script produces error, I nack the patch.

So, IMHO, this is not a toolchain fault, but the lack of a process.

The kernel build robot is now producing e-mails when the documentation
has new troubles, so I guess this will help a lot to avoid adding
new documentation breakages.

> Debugging formatting issues through the entire
> pipeline gets hard; I already faced some of this when playing with the
> kernel-doc->asciidoc->docbook->html chain.
> 
> In short, I don't think the docbook toolchain fills all of our needs
> either.
> 
> > So, to be frank, it doesn't scary me to use either pyhton or
> > ruby script + docbook.
> >
> > Of course, having to own the code has a cost that should be evaluated.
> >
> > If, on the other hand, we decide to use RST, we'll very likely need to
> > patch it to fulfill our needs in order to add proper table support.
> > I've no idea how easy/difficult would be to do that, nor if Sphinx
> > upstream would accept such changes.
> >
> > So, at the end of the day, we may end by having to carry on our own
> > version of Sphinx inside our tree, with doesn't sound good, specially
> > since it is not just a script, but a package with hundreds of
> > files.  
> 
> If we end up having to modify Sphinx, it has a powerful extension
> mechanism for this. We wouldn't have to worry about getting it merged to
> Sphinx upstream, and we wouldn't have to carry a local version of all of
> Sphinx. (In fact, the extension mechanism provides a future path for
> doing kernel-doc within Sphinx instead of as a preprocessing step.)

That's indeed a good news.

> 
> I know none of this alleviates your concerns with table supports right
> now. I'll try to have a look at that a bit more.

I created a PoC tree with a few usecases taken from the V4L2 uAPI
documentation:
	https://git.linuxtv.org/mchehab/v4l2-docs-poc.git/

Perhaps you could help to fix the issues there:

1) We want borderless tables, on both PDF and HTML outputs, for
the table at:
	https://git.linuxtv.org/mchehab/v4l2-docs-poc.git/tree/v4l-table-within-table.rst

2) The tables at packed-rgb.rst are not created:
	https://git.linuxtv.org/mchehab/v4l2-docs-poc.git/diff/packed-rgb.rst

It complains that the table there is malformed:                                                                                                   
	packed-rgb.rst:12: ERROR: Malformed table.

3) I tried to use a .. cssclass, as Johannes suggested, but
I was not able to include the CSS file. I suspect that this is
easy to fix, but I want to see if the cssclass will also work for
the pdf output as well.

4) It seems that it can't produce nested tables in pdf:

Markup is unsupported in LaTeX:
v4l-table-within-table:: nested tables are not yet implemented.
Makefile:115: recipe for target 'latexpdf' failed

Can you help solving those issues?

Thanks,
Mauro

  parent reply	other threads:[~2016-03-04 12:59 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160213145317.247c63c7@lwn.net>
     [not found] ` <86fuwwcdmd.fsf@hiro.keithp.com>
     [not found]   ` <CAKMK7uGeU_grgC7pRCdqw+iDGWQfXhHwvX+tkSgRmdimxMrthA@mail.gmail.com>
     [not found]     ` <20160217151401.3cb82f65@lwn.net>
     [not found]       ` <CAKMK7uEqbSrhc2nh0LjC1fztciM4eTjtKE9T_wMVCqAkkTnzkA@mail.gmail.com>
     [not found]         ` <874md6fkna.fsf@intel.com>
     [not found]           ` <CAKMK7uE72wFEFCyw1dHbt+f3-ex3fr_9MbjoGfnKFZkd5+9S2Q@mail.gmail.com>
2016-02-18 10:26             ` Kernel docs: muddying the waters a bit 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-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 [this message]
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-12  9:18                                 ` Hans Verkuil
2016-04-12 15:46                                 ` Jonathan Corbet
2016-04-18  9:49                                   ` Markus Heiser
2016-04-27 14:28                                   ` Grant Likely
2016-05-03 14:31                                     ` Daniel Vetter
2016-05-03 15:54                                       ` Keith Packard
2016-05-04  9:34                                       ` Markus Heiser
2016-05-04  9:58                                         ` Jani Nikula
2016-05-04 12:40                                           ` Markus Heiser
2016-05-04 13:41                                             ` Jani Nikula
2016-05-04 15:09                                               ` Jonathan Corbet
2016-05-04 13:43                                             ` Daniel Vetter
2016-05-04 14:18                                               ` Daniel Vetter
2016-05-04 14:57                                                 ` Jonathan Corbet
2016-05-04 15:02                                                   ` Daniel Vetter
2016-05-04 16:32                                                     ` Daniel Vetter
2016-05-04 15:44                                                   ` Jani Nikula
2016-05-04 16:38                                                   ` Mauro Carvalho Chehab
2016-05-04 15:55                                               ` Markus Heiser
2016-05-04 16:13                                                 ` Jani Nikula
2016-05-04 16:50                                                   ` Mauro Carvalho Chehab
2016-05-04 16:59                                                     ` Jonathan Corbet
2016-05-04 17:57                                                       ` Mauro Carvalho Chehab
2016-05-05 13:02                                                         ` Jonathan Corbet
2016-05-05 13:23                                                           ` Mauro Carvalho Chehab
2016-05-06 11:23                                                   ` 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 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-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 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=20160304095950.3358a2cb@recife.lan \
    --to=mchehab@osg.samsung.com \
    --cc=corbet@lwn.net \
    --cc=daniel.vetter@ffwll.ch \
    --cc=graham.whaley@linux.intel.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jani.nikula@intel.com \
    --cc=js@linuxtv.org \
    --cc=keithp@keithp.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).