Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1352807 > unrolled thread
| Started by | Jani Nikula <jani.nikula@intel.com> |
|---|---|
| First post | 2016-03-08 10:50 +0100 |
| Last post | 2016-03-09 10:00 +0100 |
| Articles | 11 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Kernel docs: muddying the waters a bit Jani Nikula <jani.nikula@intel.com> - 2016-03-08 10:50 +0100
Re: Kernel docs: muddying the waters a bit Mauro Carvalho Chehab <mchehab@osg.samsung.com> - 2016-03-08 12:40 +0100
Re: Kernel docs: muddying the waters a bit Mauro Carvalho Chehab <mchehab@osg.samsung.com> - 2016-03-08 14:40 +0100
Re: Kernel docs: muddying the waters a bit Mauro Carvalho Chehab <mchehab@osg.samsung.com> - 2016-03-08 16:40 +0100
Re: Kernel docs: muddying the waters a bit Mauro Carvalho Chehab <mchehab@osg.samsung.com> - 2016-03-09 22:30 +0100
Re: Kernel docs: muddying the waters a bit Jani Nikula <jani.nikula@intel.com> - 2016-03-10 11:30 +0100
Re: Kernel docs: muddying the waters a bit Mauro Carvalho Chehab <mchehab@osg.samsung.com> - 2016-03-10 16:30 +0100
Re: Kernel docs: muddying the waters a bit Markus Heiser <markus.heiser@darmarit.de> - 2016-03-13 16:50 +0100
Re: Kernel docs: muddying the waters a bit Mauro Carvalho Chehab <mchehab@osg.samsung.com> - 2016-03-08 14:40 +0100
Re: Kernel docs: muddying the waters a bit Jani Nikula <jani.nikula@intel.com> - 2016-03-08 15:00 +0100
Re: Kernel docs: muddying the waters a bit Jani Nikula <jani.nikula@intel.com> - 2016-03-09 10:00 +0100
| From | Jani Nikula <jani.nikula@intel.com> |
|---|---|
| Date | 2016-03-08 10:50 +0100 |
| Subject | Re: Kernel docs: muddying the waters a bit |
| Message-ID | <ramr9-7wy-17@gated-at.bofh.it> |
On Tue, 08 Mar 2016, Dan Allen <dan@opendevise.io> wrote: > One of the key goals of the Asciidoctor project is to be able to directly > produce a wide variety of outputs from the same source (without DocBook). > We've added flexibility and best practices into the syntax and matured the > converter mechanism to bridge this (sometimes very wide) gap. I think our conclusion so far was that the native AsciiDoc (and Asciidoctor) outputs fell short of our needs, forcing us to use the DocBook pipeline. I, for one, was hoping we could eventually simplify the toolchain. For example, there was no support for chunked, or split to chapters, HTML, and the single page result was simply way too big. > Asciidoctor is the future of AsciiDoc. Even the AsciiDoc Python maintainers > acknowledge that (including the original creator). Thanks for the input. We've touched the topic of AsciiDoc vs. Asciidoctor before [1]. So we should be using Asciidoctor instead of AsciiDoc. That actually makes choosing asciidoc harder, because requiring another language environment complicates, not simplifies, the toolchain. I'd really like to lower the bar for building the documentation, for everyone, so much so that it becomes part of the normal checks for patch inclusion. BR, Jani. [1] http://mid.gmane.org/86pow31ddj.fsf@hiro.keithp.com -- Jani Nikula, Intel Open Source Technology Center
[toc] | [next] | [standalone]
| From | Mauro Carvalho Chehab <mchehab@osg.samsung.com> |
|---|---|
| Date | 2016-03-08 12:40 +0100 |
| Message-ID | <rao9A-e2-23@gated-at.bofh.it> |
| In reply to | #1352807 |
Em Tue, 08 Mar 2016 11:49:35 +0200
Jani Nikula <jani.nikula@intel.com> escreveu:
> On Tue, 08 Mar 2016, Dan Allen <dan@opendevise.io> wrote:
> > One of the key goals of the Asciidoctor project is to be able to directly
> > produce a wide variety of outputs from the same source (without DocBook).
> > We've added flexibility and best practices into the syntax and matured the
> > converter mechanism to bridge this (sometimes very wide) gap.
>
> I think our conclusion so far was that the native AsciiDoc (and
> Asciidoctor) outputs fell short of our needs, forcing us to use the
> DocBook pipeline. I, for one, was hoping we could eventually simplify
> the toolchain. For example, there was no support for chunked, or split
> to chapters, HTML, and the single page result was simply way too big.
>
> > Asciidoctor is the future of AsciiDoc. Even the AsciiDoc Python maintainers
> > acknowledge that (including the original creator).
>
> Thanks for the input. We've touched the topic of AsciiDoc
> vs. Asciidoctor before [1]. So we should be using Asciidoctor instead of
> AsciiDoc. That actually makes choosing asciidoc harder, because
> requiring another language environment complicates, not simplifies, the
> toolchain. I'd really like to lower the bar for building the
> documentation, for everyone, so much so that it becomes part of the
> normal checks for patch inclusion.
As I failed to find a way to solve the issues with Sphinx/RST, I started
a PoC using Asciidoctor for the Media uAPI docbook conversion, in order
to see if this would work for us.
I'm not a big fan of using a language that I don't domain, like
Ruby (and the same applies to Python), but, as I said before,
provided that the toolchain works, can easily be installed on
Fedora and Debian, and provide the functionality I need, I'm
ok with that.
On my tests, Asciidoctor is really fast. It takes a fraction of the
time require to build from DocBook, with is a good thing.
Yet, I suspect that it doesn't have the strict checks that xmllint
have. For example, I didn't see any warning about a missing cross-ref.
We use those warnings to discover if something is added at the code,
but were not documented. Its error reports are also crappy, as it
doesn't tell where the problem is. For example:
$ asciidoctor -n -b docbook media_api.adoc
asciidoctor: WARNING: tables must have at least one body row
On a document with 33793 lines (this is the size of the uAPI doc
when converted to AsciiDoc format), the above warning doesn't help.
So, I'm actually planning to use AsciiDoc/xmllint to check for
documentation troubles, if possible.
Even with AsciiDoc/Asciidoctor, there are several features at the
media documents that aren't well supported. For example, we widely
use the Docbook's tags to generate a manpage-like description:
<refentry id="func-open">
<refmeta>
<refentrytitle>V4L2 open()</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>v4l2-open</refname>
<refpurpose>Open a V4L2 device</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include <fcntl.h></funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>open</function></funcdef>
<paramdef>const char *<parameter>device_name</parameter></paramdef>
<paramdef>int <parameter>flags</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
Asciidoctor doesn't produce anything like that, if the booktype is not
"manpage". Well, the media documentation is a multi-part book.
So, all those tags should be manually converted (actually, pandoc
made a mess with those tags - so manual work is required anyway,
no matter what markdown language we use). It will be a hard work,
but, at least, this is doable.
Also, it doesn't accept images with PDF format. We have a few PDF
images, although I we have them also in GIF. So, not a big issue here.
I also did lots of table conversions, to see if our complex tables
would fit. The answer is: Yes: on all cases I converted, it worked
fine.
There are two ways of doing that:
- Nested tables
- Merging cells
Some tables we use won't work fine with nested tables, as they have
cells merging the entire line of such tables.
Also, converting some tables to nested tables would be incredible hard,
as we have really big tables there that would need to add dozens of nested
tables inside, like this one:
https://linuxtv.org/downloads/v4l-dvb-apis/extended-controls.html#id-1.4.4.14.6.4
Using merging cells works fine, tough, and it is not hard to use.
The tables are easy to edit. The Asciidoctor syntax (not sure if AsciiDoc
also accepts this) is:
.MFC 5.1 Control IDs
[width="100%",cols="7%,40%,13%,40%",options="header",]
|=======================================================================
|ID |Type 2+| Description
...
The "2+|" tells that the next content should be merged into two cells.
One of the good things is that we're not forced to use asciiart, with
would make it really hard to handle the tables.
For those wanting to see the results so far:
The html is at:
https://mchehab.fedorapeople.org/media-kabi-docs-test/asciidoc_tests/media_api.html
The testing tree is at:
https://git.linuxtv.org/mchehab/asciidoc-poc.git/
PS.: pandoc did a really crap job on the conversion. To convert this
into something useful, we'll need to spend a lot of time, as it lost
most of the cross-references, as they were defined via DocBook macros.
It also dropped without even warning all nested tables. So, even for
a PoC, we'll need to spend some time to make it barely resembling
what we currently have on DocBook.
Thanks,
Mauro
[toc] | [prev] | [next] | [standalone]
| From | Mauro Carvalho Chehab <mchehab@osg.samsung.com> |
|---|---|
| Date | 2016-03-08 14:40 +0100 |
| Message-ID | <raq1I-1uo-25@gated-at.bofh.it> |
| In reply to | #1352913 |
Em Tue, 08 Mar 2016 05:13:13 -0700 Dan Allen <dan@opendevise.io> escreveu: > On Tue, Mar 8, 2016 at 4:29 AM, Mauro Carvalho Chehab < > mchehab@osg.samsung.com> wrote: > > > pandoc did a really crap job on the conversion. To convert this > > into something useful, we'll need to spend a lot of time, as it lost > > most of the cross-references, as they were defined via DocBook macros. > > > > I agree pandoc creates crappy AsciiDoc. We have a much better converter in > the works called DocBookRx. > > https://github.com/opendevise/docbookrx > > It has converted several very serious DocBook documents and we're > continuing to improve it. It's also a lot easier to hack than pandoc. Didn't work: $ ./bin/docbookrx ~/devel/docbook_test/v4l2.xml No visitor defined for <part>! Skipping. No visitor defined for <part>! Skipping. No visitor defined for <part>! Skipping. No visitor defined for <part>! Skipping. No visitor defined for <appendixinfo>! Skipping. > > -Dan > > -- Thanks, Mauro
[toc] | [prev] | [next] | [standalone]
| From | Mauro Carvalho Chehab <mchehab@osg.samsung.com> |
|---|---|
| Date | 2016-03-08 16:40 +0100 |
| Message-ID | <rarTR-2Ho-29@gated-at.bofh.it> |
| In reply to | #1353044 |
Em Tue, 8 Mar 2016 10:39:22 -0300 Mauro Carvalho Chehab <mchehab@osg.samsung.com> escreveu: > Em Tue, 08 Mar 2016 05:13:13 -0700 > Dan Allen <dan@opendevise.io> escreveu: > > > On Tue, Mar 8, 2016 at 4:29 AM, Mauro Carvalho Chehab < > > mchehab@osg.samsung.com> wrote: > > > > > pandoc did a really crap job on the conversion. To convert this > > > into something useful, we'll need to spend a lot of time, as it lost > > > most of the cross-references, as they were defined via DocBook macros. > > > > > > > I agree pandoc creates crappy AsciiDoc. We have a much better converter in > > the works called DocBookRx. > > > > https://github.com/opendevise/docbookrx > > > > It has converted several very serious DocBook documents and we're > > continuing to improve it. It's also a lot easier to hack than pandoc. > > Didn't work: > > $ ./bin/docbookrx ~/devel/docbook_test/v4l2.xml > No visitor defined for <part>! Skipping. > No visitor defined for <part>! Skipping. > No visitor defined for <part>! Skipping. > No visitor defined for <part>! Skipping. > No visitor defined for <appendixinfo>! Skipping. I tried to use docbookrx for the bits that were not properly converted, like the manpage-like pages: $ ../docbookrx/bin/docbookrx Documentation/DocBook/media/v4l/func-ioctl.xml No visitor defined for <refentry>! Skipping. Dan, if you want to take a look on what's going wrong here, the XML I'm trying to convert is: https://git.linuxtv.org/media_tree.git/tree/Documentation/DocBook/media/v4l/func-ioctl.xml If this would work, it should be generating something like: https://git.linuxtv.org/mchehab/asciidoc-poc.git/tree/func-ioctl.adoc Pandoc failed to fully convert it, but at least it left all the texts, with prevented rewriting it from scratch. This is the manual fix I applied to it: https://git.linuxtv.org/mchehab/asciidoc-poc.git/commit/func-ioctl.adoc?id=801d336c3742f26731e08c284290c32c0b4632fc FYI, we have 133 xml files at the media uAPI doc with refmeta. -- Thanks, Mauro
[toc] | [prev] | [next] | [standalone]
| From | Mauro Carvalho Chehab <mchehab@osg.samsung.com> |
|---|---|
| Date | 2016-03-09 22:30 +0100 |
| Message-ID | <raTQ7-5hW-11@gated-at.bofh.it> |
| In reply to | #1353156 |
Em Tue, 8 Mar 2016 12:39:21 -0300
Mauro Carvalho Chehab <mchehab@osg.samsung.com> escreveu:
> Pandoc failed to fully convert it, but at least it left all the texts,
> with prevented rewriting it from scratch. This is the manual fix
> I applied to it:
> https://git.linuxtv.org/mchehab/asciidoc-poc.git/commit/func-ioctl.adoc?id=801d336c3742f26731e08c284290c32c0b4632fc
>
> FYI, we have 133 xml files at the media uAPI doc with refmeta.
I used pandoc to convert from the html files and manually edited it.
I also fixed lots of other issues with the conversion.
I guess the conversion to asciidoc format is now in good shape,
at least to demonstrate that it is possible to use this format for the
media docbook. Still, there are lots of broken references.
The proof of concept html file is at:
https://mchehab.fedorapeople.org/media-kabi-docs-test/asciidoc_tests/media_api.html
I also added the ascii doc files there, at:
https://mchehab.fedorapeople.org/media-kabi-docs-test/asciidoc_tests/
And I'm keeping the git tree, with helps to identify the work that was
needed to make it work:
https://git.linuxtv.org/mchehab/asciidoc-poc.git
In summary, AsciiDoc, formatted via AsciiDoctor worked fine to produce
an html file.
PROBLEMS
========
1)
I was not able to produce outputs on any other format.
For example, when trying to generate docbook45 output, it sems that
part of the trouble was due to pandoc conversion. It produces
links like:
link:#ftn.id-1.4.11.43.5.11.2.7.2.6.2[^[a]^]
Which causes errors with DocBook parsers, like xmllint:
media_api.xml:32300: parser error : Opening and ending tag mismatch: superscript line 32300 and ulink
<ulink url="#id-1.4.11.43.5.11.2.7.2.6.2"><superscript>[a</ulink></superscript>]
^
I suspect that this is fixable. I may try to fix it later.
2) It seems that Asciidoctor doesn't allow annexes per document part.
It numberates them as chapters, instead of using A, B, C, ...
3) Even producing the html without troubles, it produces an error:
asciidoctor: ERROR: media_api.adoc: line 57: invalid part, must have at least one section (e.g., chapter, appendix, etc.)
4) There are some things that got lost during the conversion, like
copyright notes and revision notes. This could be simply a problem
with pandoc conversion. Nothing serious, I guess, as we could insert
the lost data manually. Yet, it means that, to move from the PoC to
the Kernel, there are still lots of work to do.
I was unable do discover why, nor to suppress this error message.
Yet, from my side, if we're willing to get rid of DocBook, then
Asciidoctor seems to be the *only* alternative so far to parse the
complex media documents.
Regards,
Mauro
[toc] | [prev] | [next] | [standalone]
| From | Jani Nikula <jani.nikula@intel.com> |
|---|---|
| Date | 2016-03-10 11:30 +0100 |
| Message-ID | <rb60W-5G6-11@gated-at.bofh.it> |
| In reply to | #1354466 |
TL;DR? Skip to the last paragraph. On Wed, 09 Mar 2016, Mauro Carvalho Chehab <mchehab@osg.samsung.com> wrote: > I guess the conversion to asciidoc format is now in good shape, > at least to demonstrate that it is possible to use this format for the > media docbook. Still, there are lots of broken references. Getting references right with asciidoc is a big problem in the kernel-doc side. As I wrote before, the proofs of concept only worked because everything was processed as one big file (via includes). The Asciidoctor inter-document references won't help, because we won't know the target document name while processing kernel-doc. Sphinx is massively better at handling cross references for kernel-doc. We can use domains (C language) and roles (e.g. functions, types, etc.) for the references, which provide kind of namespaces. Sphinx warns for referencing non-existing targets, but doesn't generate broken links in the result like Asciidoctor does. For example, in the documentation for a function that has struct foo as parameter or return type, a cross reference to struct foo is added automagically, but only if documentation for struct foo actually exists. In Asciidoctor, we would have to blindly generate the references ourselves, and try to resolve broken links ourselves by somehow post-processing the result. > Yet, from my side, if we're willing to get rid of DocBook, then > Asciidoctor seems to be the *only* alternative so far to parse the > complex media documents. I think you mean, "get rid of DocBook as source format", not altogether? I'm yet to be convinved we could rely on Asciidoctor's native formats. --- Mauro, I truly appreciate your efforts at evaluating both alternatives. I also appreciate Dan's inputs on Asciidoctor. Despite your evaluation that Asciidoctor is the only alternative for media documents, it is my opinion that we should go with Sphinx. It's an opinion, it's subjective, it's from my perspective, especially from the kernel-doc POV, so please don't take it as a slap in the face after all the work you've done. With that out of the way, here's why. For starters, Jon's Sphinx proof-of-concept at http://static.lwn.net/kerneldoc/ is pretty amazing. It's beautiful and usable. Cross references work, there are no broken links (I hacked a bit more on kernel-doc and it gets even better). There's embedded search (and if this gets exported to https://readthedocs.org/ the search is even better). The API documentation is sensible and the headings aren't mixed up with other headings. It's all there. It's what we've been looking for. The toolchain gets faster, easier to debug and simplified a lot with DocBook out of the equation completely. Sphinx itself is stable, widely available, and well documented. IMO there's sufficient native output format support. There are plenty of really nice extensions available. There's a possibility of doing kernel-doc as an extension in the future (either by calling current kernel-doc from the extension or by rewriting it). Dan keeps bringing up the active community in Asciidoctor, and how they're fixing things up as we speak... which is great, but Sphinx is here now, packaged and shipping in distros ready to use. It seems that of the two, an Asciidoctor based toolchain is currently more in need of hacking and extending to meet our needs. Which brings us to the implementation language, Python vs. Ruby. I won't make the mistake of comparing the relative merits of the languages, but I'll boldly claim the set of kernel developers who know Python is likely larger than the set of kernel developers who know Ruby [citation needed]. AFAICT there are no Ruby tools in the kernel tree, but there is a bunch of Python. My own very limited and subjective experience with other tools around the kernel is that Python is much more popular than Ruby. So my claim here is that we're in a better position to hack on Sphinx extensions ourselves than Asciidoctor. My conclusion is that Sphinx covers the vast majority of the needs of our documentation producers and consumers, in an amazing way, out of the box, better than Asciidoctor. Which brings us to the minority and the parts where Sphinx falls short, media documentation in particular. It's complex documentation, with very specific requirements on the output, especially that many things remain exactly as they are now. It also feels like the target is more to have standalone media documentation, and not so much to be aligned with and be part of the rest of the kernel documentation. I want to question the need to have all kernel documentation use tools that meet the strict requirements of the outlier, when there's a better alternative for the vast majority of the documentation. Especially when Asciidoctor isn't a ready solution for media documentation either. In summary, my proposal is to go with Sphinx, leave media docs as DocBook for now, and see if and how they can be converted to Sphinx/reStructuredText later on when we have everything else in place. It's not the perfect outcome, but IMHO it's the best overall choice. BR, Jani. -- Jani Nikula, Intel Open Source Technology Center
[toc] | [prev] | [next] | [standalone]
| From | Mauro Carvalho Chehab <mchehab@osg.samsung.com> |
|---|---|
| Date | 2016-03-10 16:30 +0100 |
| Message-ID | <rbaHg-q8-9@gated-at.bofh.it> |
| In reply to | #1354988 |
Em Thu, 10 Mar 2016 12:25:58 +0200 Jani Nikula <jani.nikula@intel.com> escreveu: > TL;DR? Skip to the last paragraph. > > On Wed, 09 Mar 2016, Mauro Carvalho Chehab <mchehab@osg.samsung.com> wrote: > > I guess the conversion to asciidoc format is now in good shape, > > at least to demonstrate that it is possible to use this format for the > > media docbook. Still, there are lots of broken references. > > Getting references right with asciidoc is a big problem in the > kernel-doc side. As I wrote before, the proofs of concept only worked > because everything was processed as one big file (via includes). The > Asciidoctor inter-document references won't help, because we won't know > the target document name while processing kernel-doc. I was able to produce chunked htmls here with: asciidoctor -b docbook45 media_api.adoc xmlto -o html-dir html media_api.xml The results are at: https://mchehab.fedorapeople.org/media-kabi-docs-test/asciidoc_tests/chunked/ But yeah, all references seem to be broken there. It could be due to some conversion issue (I didn't actually tried to check what's wrong there), but I think that there's something not ok with docbook45 output for multi-part documents (on both AsciiDoc and Asciidoctor). > Sphinx is massively better at handling cross references for > kernel-doc. We can use domains (C language) and roles (e.g. functions, > types, etc.) for the references, which provide kind of > namespaces. Sphinx warns for referencing non-existing targets, but > doesn't generate broken links in the result like Asciidoctor does. > > For example, in the documentation for a function that has struct foo as > parameter or return type, a cross reference to struct foo is added > automagically, but only if documentation for struct foo actually > exists. In Asciidoctor, we would have to blindly generate the references > ourselves, and try to resolve broken links ourselves by somehow > post-processing the result. > > > Yet, from my side, if we're willing to get rid of DocBook, then > > Asciidoctor seems to be the *only* alternative so far to parse the > > complex media documents. > > I think you mean, "get rid of DocBook as source format", not altogether? > I'm yet to be convinved we could rely on Asciidoctor's native formats. What I mean is that, right now, I see only two alternatives for the media uAPI documentation: 1) keep using DocBook; 2) AsciiDoc/Asciidoctor. Sphinx doesn't have what's needed to support the complexity of the media books, specially since cell span seems to be possible only by using asciiArt formats. Writing a big table using asciiArt is something that is a *real pain*. Also, as tested, if the table is too big, it fails to parse such asciiArt tables. So, while Sphinx doesn't have a decent way to describe tables, we can't use it. If it starts implementing it, then we can check if the other features used by the media documentation are also supported. Probably, multi-part books would be another pain with Sphinx. We have actually 4 books inside a common body. A few chapters (like book licensing, bibliography, error codes) are shared by all 4 documents. But, so far, I can't see any way to port media books without lots of lot of work to develop new features at the Sphinx code. > --- > > Mauro, I truly appreciate your efforts at evaluating both > alternatives. I also appreciate Dan's inputs on Asciidoctor. > > Despite your evaluation that Asciidoctor is the only alternative for > media documents, it is my opinion that we should go with Sphinx. > > It's an opinion, it's subjective, it's from my perspective, especially > from the kernel-doc POV, so please don't take it as a slap in the face > after all the work you've done. With that out of the way, here's why. > > For starters, Jon's Sphinx proof-of-concept at > http://static.lwn.net/kerneldoc/ is pretty amazing. It's beautiful and > usable. Cross references work, there are no broken links (I hacked a bit > more on kernel-doc and it gets even better). There's embedded search > (and if this gets exported to https://readthedocs.org/ the search is > even better). The API documentation is sensible and the headings aren't > mixed up with other headings. It's all there. It's what we've been > looking for. > > The toolchain gets faster, easier to debug and simplified a lot with > DocBook out of the equation completely. Sphinx itself is stable, widely > available, and well documented. IMO there's sufficient native output > format support. There are plenty of really nice extensions > available. There's a possibility of doing kernel-doc as an extension in > the future (either by calling current kernel-doc from the extension or > by rewriting it). Well, if we go to Sphinx for kernel-doc, that means that we'll need 2 different tools for the documentation: - Sphinx for kernel-doc - either DocBook or Asciidoctor/AsciiDoc for media. IMHO, this is the worse scenario, as we'll keep depending on DocBook plus requiring Sphinx, but it is up to Jon to decide. > Dan keeps bringing up the active community in Asciidoctor, and how > they're fixing things up as we speak... which is great, but Sphinx is > here now, packaged and shipping in distros ready to use. It seems that > of the two, an Asciidoctor based toolchain is currently more in need of > hacking and extending to meet our needs. Which brings us to the > implementation language, Python vs. Ruby. > > I won't make the mistake of comparing the relative merits of the > languages, but I'll boldly claim the set of kernel developers who know > Python is likely larger than the set of kernel developers who know Ruby > [citation needed]. AFAICT there are no Ruby tools in the kernel tree, > but there is a bunch of Python. My own very limited and subjective > experience with other tools around the kernel is that Python is much > more popular than Ruby. So my claim here is that we're in a better > position to hack on Sphinx extensions ourselves than Asciidoctor. Sorry, but I don't buy it. Python is, IMHO, a mess: each new version is incompatible with the previous one, and requires the source to change, in order to use a newer version than the one used to write the code. So, when talking about Python, we're actually talking about several different dialects that don't talk well to each other. I don't know about Ruby. So far, I don't have anything against (or in favor) of it. I bet most Kernel developers would actually prefer a toolchain in C. If such tool doesn't exist, anything else seems equally the same ;) > My conclusion is that Sphinx covers the vast majority of the needs of > our documentation producers and consumers, in an amazing way, out of the > box, better than Asciidoctor. > > Which brings us to the minority and the parts where Sphinx falls short, > media documentation in particular. It's complex documentation, with very > specific requirements on the output, especially that many things remain > exactly as they are now. It also feels like the target is more to have > standalone media documentation, and not so much to be aligned with and > be part of the rest of the kernel documentation. > > I want to question the need to have all kernel documentation use tools > that meet the strict requirements of the outlier, when there's a better > alternative for the vast majority of the documentation. Especially when > Asciidoctor isn't a ready solution for media documentation either. > > In summary, my proposal is to go with Sphinx, leave media docs as > DocBook for now, and see if and how they can be converted to > Sphinx/reStructuredText later on when we have everything else in > place. It's not the perfect outcome, but IMHO it's the best overall > choice. Well, this could be done. We don't have any good reason to move the media docs out of DocBook. On the contrary, this means an extra work. The only advantage is that it is a way simpler to write documentation with a markup language, but converting from the PoC to its integration at the Kernel tree still require lots of work, specially due to the cross-refs "magic" scripts that we have under Documentation/DocBook/media/Makefile. As I said, the only big drawback is to keep depending on two different tools for kernel-doc and for media documentation. -- Thanks, Mauro
[toc] | [prev] | [next] | [standalone]
| From | Markus Heiser <markus.heiser@darmarit.de> |
|---|---|
| Date | 2016-03-13 16:50 +0100 |
| Message-ID | <rcgrf-7Fe-1@gated-at.bofh.it> |
| In reply to | #1355199 |
Am 10.03.2016 um 16:21 schrieb Mauro Carvalho Chehab <mchehab@osg.samsung.com>: > Em Thu, 10 Mar 2016 12:25:58 +0200 > Jani Nikula <jani.nikula@intel.com> escreveu: > >> TL;DR? Skip to the last paragraph. >> >> On Wed, 09 Mar 2016, Mauro Carvalho Chehab <mchehab@osg.samsung.com> wrote: >>> I guess the conversion to asciidoc format is now in good shape, >>> at least to demonstrate that it is possible to use this format for the >>> media docbook. Still, there are lots of broken references. >> >> Getting references right with asciidoc is a big problem in the >> kernel-doc side. As I wrote before, the proofs of concept only worked >> because everything was processed as one big file (via includes). The >> Asciidoctor inter-document references won't help, because we won't know >> the target document name while processing kernel-doc. > > I was able to produce chunked htmls here with: > > asciidoctor -b docbook45 media_api.adoc > xmlto -o html-dir html media_api.xml > > The results are at: > https://mchehab.fedorapeople.org/media-kabi-docs-test/asciidoc_tests/chunked/ > > But yeah, all references seem to be broken there. It could be due to some > conversion issue (I didn't actually tried to check what's wrong there), > but I think that there's something not ok with docbook45 > output for multi-part documents (on both AsciiDoc and Asciidoctor). > >> Sphinx is massively better at handling cross references for >> kernel-doc. We can use domains (C language) and roles (e.g. functions, >> types, etc.) for the references, which provide kind of >> namespaces. Sphinx warns for referencing non-existing targets, but >> doesn't generate broken links in the result like Asciidoctor does. >> >> For example, in the documentation for a function that has struct foo as >> parameter or return type, a cross reference to struct foo is added >> automagically, but only if documentation for struct foo actually >> exists. In Asciidoctor, we would have to blindly generate the references >> ourselves, and try to resolve broken links ourselves by somehow >> post-processing the result. >> >>> Yet, from my side, if we're willing to get rid of DocBook, then >>> Asciidoctor seems to be the *only* alternative so far to parse the >>> complex media documents. >> >> I think you mean, "get rid of DocBook as source format", not altogether? >> I'm yet to be convinved we could rely on Asciidoctor's native formats. > > What I mean is that, right now, I see only two alternatives for the > media uAPI documentation: > 1) keep using DocBook; > 2) AsciiDoc/Asciidoctor. > > Sphinx doesn't have what's needed to support the complexity of the > media books, specially since cell span seems to be possible only > by using asciiArt formats. Writing a big table using asciiArt is > something that is a *real pain*. Also, as tested, if the table is > too big, it fails to parse such asciiArt tables. So, while Sphinx > doesn't have a decent way to describe tables, we can't use it. Huge tables and cell-spans are the *real pain* ;-) ... with sphinx-doc, (mostly) you have more then one choice .. e.g. import csv tables .. but this should be discussed by example ... > If it starts implementing it, then we can check if the other > features used by the media documentation are also supported. > Probably, multi-part books would be another pain with Sphinx. > We have actually 4 books inside a common body. A few chapters > (like book licensing, bibliography, error codes) are shared > by all 4 documents. > > But, so far, I can't see any way to port media books without > lots of lot of work to develop new features at the Sphinx code. may I can help you ... >> The toolchain gets faster, easier to debug and simplified a lot with >> DocBook out of the equation completely. Sphinx itself is stable, widely >> available, and well documented. IMO there's sufficient native output >> format support. There are plenty of really nice extensions >> available. There's a possibility of doing kernel-doc as an extension in >> the future (either by calling current kernel-doc from the extension or >> by rewriting it). > > Well, if we go to Sphinx for kernel-doc, that means that we'll need > 2 different tools for the documentation: > - Sphinx for kernel-doc > - either DocBook or Asciidoctor/AsciiDoc for media. > > IMHO, this is the worse scenario, as we'll keep depending on > DocBook plus requiring Sphinx, but it is up to Jon to decide. > The migration of kernel-doc is a long term project, not a one shot job. The scope of documents to migrate is not limited to the files with DocBook markup in, most documents have not a real markup. Please take a look at my thoughts and efforts about migration. * https://sphkerneldoc.readthedocs.org * https://github.com/return42/sphkerneldoc.git sphkerneldoc.git is a small project started this weekend, within this project I show you, how migration could be done and we can discuss concerns like "tables and cell-spans" by example. Believe me, most concerns discussed in this thread are a leak of knowledge. I'am working with sphinx-doc since 7 years, switched over from DocBook (escaped from a 8 years lasting XML hell). DocBook and sphinx-doc are complete different, so sphinx-doc might feels odd in the first time, but if you have switched like me, you will never go back again. >> Dan keeps bringing up the active community in Asciidoctor, and how >> they're fixing things up as we speak... which is great, but Sphinx is >> here now, packaged and shipping in distros ready to use. It seems that >> of the two, an Asciidoctor based toolchain is currently more in need of >> hacking and extending to meet our needs. Which brings us to the >> implementation language, Python vs. Ruby. >> >> I won't make the mistake of comparing the relative merits of the >> languages, but I'll boldly claim the set of kernel developers who know >> Python is likely larger than the set of kernel developers who know Ruby >> [citation needed]. AFAICT there are no Ruby tools in the kernel tree, >> but there is a bunch of Python. My own very limited and subjective >> experience with other tools around the kernel is that Python is much >> more popular than Ruby. So my claim here is that we're in a better >> position to hack on Sphinx extensions ourselves than Asciidoctor. > > Sorry, but I don't buy it. Python is, IMHO, a mess: each new version > is incompatible with the previous one, and requires the source to > change, in order to use a newer version than the one used to write > the code. So, when talking about Python, we're actually talking about > several different dialects that don't talk well to each other. Sorry, you are complete wrong ... I'am 15 years python programmer, shipped out huge projects with my customers ... we never have seen these problems ... sorry ... > I don't know about Ruby. So far, I don't have anything against (or in > favor) of it. I bet most Kernel developers would actually prefer a > toolchain in C. If such tool doesn't exist, anything else seems > equally the same ;) Why we are talking about script languages? What needed is a authoring system, which is as near as possible to the developers, which are the authors. Sphinx-Doc is a standard authoring-tool versioned, maintained and extended by thousands of developers ... >> My conclusion is that Sphinx covers the vast majority of the needs of >> our documentation producers and consumers, in an amazing way, out of the >> box, better than Asciidoctor. >> >> Which brings us to the minority and the parts where Sphinx falls short, >> media documentation in particular. It's complex documentation, with very >> specific requirements on the output, especially that many things remain >> exactly as they are now. It also feels like the target is more to have >> standalone media documentation, and not so much to be aligned with and >> be part of the rest of the kernel documentation. >> >> I want to question the need to have all kernel documentation use tools >> that meet the strict requirements of the outlier, when there's a better >> alternative for the vast majority of the documentation. Especially when >> Asciidoctor isn't a ready solution for media documentation either. >> >> In summary, my proposal is to go with Sphinx, leave media docs as >> DocBook for now, and see if and how they can be converted to >> Sphinx/reStructuredText later on when we have everything else in >> place. It's not the perfect outcome, but IMHO it's the best overall >> choice. > > Well, this could be done. We don't have any good reason to move > the media docs out of DocBook. Sorry but again wrong: you lost many of the authors which are frustrated by a XML markup and you lost many developers to improve the toolchain, frustrated by a complicated DocBook-XML XSLT toolchain with SGML markup from the middle of the last epoch. > On the contrary, this means an extra > work. The only advantage is that it is a way simpler to write > documentation with a markup language, but converting from the PoC > to its integration at the Kernel tree still require lots of work, > specially due to the cross-refs "magic" scripts that we have under > Documentation/DocBook/media/Makefile. Yes, you are right, migration is a process not a one shot job, as I mentioned before. You are a great programmer, your documentation is also great, this invest should be preserved. So lets take a try. It would be a honor for me to show you all theses steps by example on my repository (see above). > As I said, the only big drawback is to keep depending on two > different tools for kernel-doc and for media documentation. -- Markus --
[toc] | [prev] | [next] | [standalone]
| From | Mauro Carvalho Chehab <mchehab@osg.samsung.com> |
|---|---|
| Date | 2016-03-08 14:40 +0100 |
| Message-ID | <raq1I-1uo-9@gated-at.bofh.it> |
| In reply to | #1352807 |
Em Tue, 08 Mar 2016 05:09:40 -0700 Dan Allen <dan@opendevise.io> escreveu: > Jani wrote: > > > there was no support for chunked, or split > > to chapters, HTML, and the single page result was simply way too big. > > > > That's not entirely true. First, you can pre-split at the source level > using includes and generate output for each of the masters. That's what I > tend to do and it works really well since these are logical split points. The problem on pre-splitting the documents and process them in separate is that this will break cross-references. At the media uAPI Docbook, we use a lot of cross references. Btw, we use a lot of includes. Currently, it has 187 separate files. We even parse the header files looking for typedefs, structs, enums, #defines and functions, in order to produce a document that will cross-reference the documentation. > Second, there is a custom converter in the works to split post-generate > (which is really what we're talking about when we compare it to the DocBook > toolchain). > > https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/multipage-html5-converter.rb > > It's just a prototype, but proves it is possible by design. I didn't test it, but I saw some comments at the web that the part that would handle cross-references between files is not ready. > Personally, I don't like most chunked HTML approaches because they split > arbitrarily. We are trying to find the right balance so that the output is > actually sensible. There's still work to do, but there are options in the > meantime. Well, if it is capable of creating one chunk per include file, and do cross-references between chunks, this would work for media UAPI book. Yet, it would be good to have the multi-chunk extension packaged on major distros, as I don't like the idea of installing it without using my distro's package manager. -- Thanks, Mauro
[toc] | [prev] | [next] | [standalone]
| From | Jani Nikula <jani.nikula@intel.com> |
|---|---|
| Date | 2016-03-08 15:00 +0100 |
| Message-ID | <raql5-1Bi-27@gated-at.bofh.it> |
| In reply to | #1352807 |
On Tue, 08 Mar 2016, Dan Allen <dan@opendevise.io> wrote: > That's not entirely true. First, you can pre-split at the source level > using includes and generate output for each of the masters. That's what I > tend to do and it works really well since these are logical split points. I need to look into this again. Is there a specific option or directive to produce split output for includes? When I tried this, the result was just one big output file. (And indeed we'd need both. Some includes we want embedded, some includes should produce separate outputs.) >> That actually makes choosing asciidoc harder, because >> requiring another language environment complicates, not simplifies, the >> toolchain. I'd really like to lower the bar for building the >> documentation, for everyone, so much so that it becomes part of the >> normal checks for patch inclusion. > > Pardon my bluntness here, but I don't buy that argument. This is Linux. > Installing software couldn't be simpler, and we're talking about an > extremely well supported language (Ruby). Granted, that part works for me. I'm not so sensitive to the dependencies; others may disagree. > I think it's a huge exaggeration to say that Asciidoctor is any harder to > install than AsciiDoc Python. It's also a heck of a lot smaller in size > since AsciiDoc Python pulls in hundreds of MB of LaTeX packages. For me, the comparison is really between Sphinx and Asciidoctor, not so much doc vs. doctor. The native output format and extension support in Sphinx is appealing; I am not yet convinced we could manage with Asciidoctor but without DocBook. The extension offering seems better in Sphinx. > Whatever you decide, I wish you all the best with your documentation > efforts! Thanks! BR, Jani. -- Jani Nikula, Intel Open Source Technology Center
[toc] | [prev] | [next] | [standalone]
| From | Jani Nikula <jani.nikula@intel.com> |
|---|---|
| Date | 2016-03-09 10:00 +0100 |
| Message-ID | <raI8h-5pu-3@gated-at.bofh.it> |
| In reply to | #1353068 |
On Wed, 09 Mar 2016, Dan Allen <dan@opendevise.io> wrote: > On Tue, Mar 8, 2016 at 6:58 AM, Jani Nikula <jani.nikula@intel.com> wrote: > >> I need to look into this again. Is there a specific option or directive >> to produce split output for includes? When I tried this, the result was >> just one big output file. (And indeed we'd need both. Some includes we >> want embedded, some includes should produce separate outputs.) >> > > Nope. What I'm saying is that you run Asciidoctor on each sub-master > include file (an include that manages a part or chapter). That gives you > your individual part/chapter files. Then you need to make an index page, > probably by using the Asciidoctor API to itemize all the chapters as a list > or something. Bummer. Getting the inter-document cross references right may become tricky. We'll be generating plenty of snippets of lightweight markup from source code documentation comments. At the time of processing, we won't know where e.g. a specific function to be cross referenced is documented, if at all. We can't require the documentation comment writers to figure that out either; it's too burdensome, too ugly in the code, and they'll bitrot quickly. Cross referencing in the asciidoc proofs of concept have worked because they've all done the processing as a single single unit, with includes. These hacks have also ignored any broken links, and there have been > Yes, it does require some thinking about cross references. There is a lot > more we can do out of the box, but all those references can be fixed with a > little bit of post-processing in the meantime. It seems to me Sphinx provides much better support regarding cross references, out of the box, within documents and to external documents (intersphinx), with target roles and domains, including validation and not creating broken links in the output. Looking at the current hacks we have for post-processing references, I'm really not thrilled about the prospect of keeping or redoing that. See how this works in Jon's Sphinx test [1]. At the time of generating the markup from source comments, there is no idea if and where gem_init_hw() and intel_guc_ucode_init() are documented. Indeed, documentation for the former does not exist, but there's no broken link. BR, Jani. [1] http://static.lwn.net/kerneldoc/gpu.html#c.intel_guc_ucode_load -- Jani Nikula, Intel Open Source Technology Center
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web