Skip to contentSkip to conversation

doc: memory-barriers: reStructure Text

PATCH In review afzal mohammed 4 participants 8 messages Jan 3, 2018 – Jan 5, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: memory-barriers: reStructure Text

Let PDF & HTML's be created out of memory-barriers Text by reStructuring.

reStructuring done were,
1. Section headers modification, lower header case except start
2. Removal of manual index(contents section), since it now gets created automatically for html/pdf
3. Internal cross reference for easy navigation
4. Alignment adjustments
5. Strong emphasis made wherever there was emphasis earlier (through other ways), strong was chosen as normal emphasis showed in italics, which was felt to be not enough & strong showed it in bold
6. ASCII text & code snippets in literal blocks
7. Backquotes for inline instances in the paragraph's where they are expressed not in English, but in C, pseudo-code, file path etc.
8. Notes section created out of the earlier notes
9. Manual numbering replaced by auto-numbering 10.Bibliography (References section) made such that it can be cross-linked

---

Hi,

With this change, pdf & html could be generated. There certainly are improvements to be made, but thought of first knowing whether migrating memory-barriers from txt to rst is welcome.

The location chosen is "Documentation/kernel-hacking", i was unsure where this should reside & there was no .rst file in top-level directory "Documentation", so put it into one of the existing folder that seemed to me as not that unsuitable.

Other files refer to memory-barrier.txt, those also needs to be adjusted based on where .rst can reside.

afzal

 Documentation/kernel-hacking/index.rst             |    1 +
 .../memory-barriers.rst}                           | 1707 ++++++++++----------
 2 files changed, 837 insertions(+), 871 deletions(-)
 rename Documentation/{memory-barriers.txt => kernel-hacking/memory-barriers.rst} (63%)
Documentation/kernel-hacking/index.rst +1 -0
index fcb0eda3cca3..20eb56d02ea5 100644
@@ -7,3 +7,4 @@ Kernel Hacking Guides
 
    hacking
    locking
+   memory-barriers
Documentation/kernel-hacking/memory-barriers.rst renamed from Documentation/memory-barriers.txt +836 -871

2,996 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.15.1

Part of the diff is not shown here. View the raw message.

maintainer
#1 lore raw
Quoted 20 lines · afzal mohammed

Let PDF & HTML's be created out of memory-barriers Text by reStructuring.

reStructuring done were,
1. Section headers modification, lower header case except start
2. Removal of manual index(contents section), since it now gets created automatically for html/pdf
3. Internal cross reference for easy navigation
4. Alignment adjustments
5. Strong emphasis made wherever there was emphasis earlier (through other ways), strong was chosen as normal emphasis showed in italics, which was felt to be not enough & strong showed it in bold
6. ASCII text & code snippets in literal blocks
7. Backquotes for inline instances in the paragraph's where they are expressed not in English, but in C, pseudo-code, file path etc.
8. Notes section created out of the earlier notes
9. Manual numbering replaced by auto-numbering 10.Bibliography (References section) made such that it can be cross-linked

Quoted 1 line

So I hate this rst crap with a passion, so NAK from me.

#2 lore raw

Hi,

Quoted 4 lines · Peter Zijlstra
Quoted 2 lines

Let PDF & HTML's be created out of memory-barriers Text by reStructuring.

So I hate this rst crap with a passion, so NAK from me.

Okay, the outcome is exactly as was feared.

Abondoning the patch, let this be > /dev/null

afzal

#3 lore raw
In reply to afzal mohammed
Quoted 29 lines · afzal mohammed

Let PDF & HTML's be created out of memory-barriers Text by reStructuring.

reStructuring done were,
1. Section headers modification, lower header case except start
2. Removal of manual index(contents section), since it now gets created automatically for html/pdf
3. Internal cross reference for easy navigation
4. Alignment adjustments
5. Strong emphasis made wherever there was emphasis earlier (through other ways), strong was chosen as normal emphasis showed in italics, which was felt to be not enough & strong showed it in bold
6. ASCII text & code snippets in literal blocks
7. Backquotes for inline instances in the paragraph's where they are expressed not in English, but in C, pseudo-code, file path etc.
8. Notes section created out of the earlier notes
9. Manual numbering replaced by auto-numbering 10.Bibliography (References section) made such that it can be cross-linked

---

Hi,

With this change, pdf & html could be generated. There certainly are improvements to be made, but thought of first knowing whether migrating memory-barriers from txt to rst is welcome.

Quoted 8 lines

The location chosen is "Documentation/kernel-hacking", i was unsure where this should reside & there was no .rst file in top-level directory "Documentation", so put it into one of the existing folder that seemed to me as not that unsuitable.

Other files refer to memory-barrier.txt, those also needs to be adjusted based on where .rst can reside.

How do you plan to handle the external references? For example, the following LWN articles has a link this file:

	https://lwn.net/Articles/718628/

And changing the name and/or location will break that link, AFAIK.

Regards,
Boqun

Quoted 3 lines

afzal

[...]

#4 lore raw

Hi,

Quoted 8 lines · Boqun Feng
Quoted 7 lines

The location chosen is "Documentation/kernel-hacking", i was unsure where this should reside & there was no .rst file in top-level directory "Documentation", so put it into one of the existing folder that seemed to me as not that unsuitable.

Other files refer to memory-barrier.txt, those also needs to be adjusted based on where .rst can reside.

Quoted 6 lines

How do you plan to handle the external references? For example, the following LWN articles has a link this file:

	https://lwn.net/Articles/718628/

And changing the name and/or location will break that link, AFAIK.

If necessary to handle these, symlink might help here i believe.

Upon trying to understand memory-barriers.txt, i felt that it might be better to have it in PDF/HTML format, thus attempted to convert it to rst. And i see it not being welcomed, hence shelving the conversion.

afzal

#5 lore raw
Quoted 15 lines

Am 04.01.2018 um 04:59 schrieb afzal mohammed <[email protected]>:

Hi,

Quoted 7 lines · Boqun Feng
Quoted 7 lines

The location chosen is "Documentation/kernel-hacking", i was unsure where this should reside & there was no .rst file in top-level directory "Documentation", so put it into one of the existing folder that seemed to me as not that unsuitable.

Other files refer to memory-barrier.txt, those also needs to be adjusted based on where .rst can reside.

Quoted 8 lines
Quoted 6 lines

How do you plan to handle the external references? For example, the following LWN articles has a link this file:

	https://lwn.net/Articles/718628/

And changing the name and/or location will break that link, AFAIK.

If necessary to handle these, symlink might help here i believe.

IMO symlinks are mostly ending in a mess, URLs are never stable. There is a

https://www.kernel.org/doc/html/latest/objects.inv

to handle such requirements. Take a look at *intersphinx* :

http://www.sphinx-doc.org/en/stable/ext/intersphinx.html

to see how it works: Each Sphinx HTML build creates a file named objects.inv that contains a mapping from object names to URIs relative to the HTML set’s root.

This means articles from external (like lwn articles) has to be recompiled. Not perfect, but a first solution.

Quoted 3 lines

Am 04.01.2018 um 00:48 schrieb Peter Zijlstra <[email protected]>:

So I hate this rst crap with a passion, so NAK from me.

I really like them, factually valuable comments .. please express your concern so that we have a chance to move on.

Quoted 3 lines

Upon trying to understand memory-barriers.txt, i felt that it might be better to have it in PDF/HTML format, thus attempted to convert it to rst. And i see it not being welcomed, hence shelving the conversion.

I think that's a pity.

-- Markus --

#6 lore raw

Hi,

Quoted 7 lines · Markus Heiser

IMO symlinks are mostly ending in a mess, URLs are never stable. There is a

https://www.kernel.org/doc/html/latest/objects.inv

to handle such requirements. Take a look at *intersphinx* :

Quoted 7 lines

http://www.sphinx-doc.org/en/stable/ext/intersphinx.html

to see how it works: Each Sphinx HTML build creates a file named objects.inv that contains a mapping from object names to URIs relative to the HTML set’s root.

This means articles from external (like lwn articles) has to be recompiled. Not perfect, but a first solution.

Thanks for the details.

Quoted 1 line

I really like them

Initially i was sceptical of rst & once instead of hitting the fly, hit "make htmldocs" on the keyboard :), and the opinion about it was changed. It was easy to navigate through various docs & the realized that various topics (& many) were present (yes, it was there earlier also, but had to dive inside Documentation & search, while viewing the toplevel index.html made them standout). It was like earlier you had to go after docs, but now it was docs coming after you, that is my opinion.

Later while fighting with memory-barriers.txt, felt that it might be good for it as well as to be in that company.

And the readability as a text is not hurt as well.

It was thought that rst conversion could be done quickly, but since this was my first attempt with rst, had to put some effort to get a not so bad output, even if this patch dies, i am happy to have learnt rst conversion to some extent.

Quoted 5 lines
Quoted 3 lines

Upon trying to understand memory-barriers.txt, i felt that it might be better to have it in PDF/HTML format, thus attempted to convert it to rst. And i see it not being welcomed, hence shelving the conversion.

I think that's a pity.

When one of the author of the original document objected, i felt it is better to backoff. But if there is a consensus, i will proceed.

afzal

#7 lore raw
Quoted 2 lines

Am 05.01.2018 um 04:52 schrieb afzal mohammed <[email protected]>:

[...]

Quoted 3 lines

Initially i was sceptical of rst & once instead of hitting the fly, hit "make htmldocs" on the keyboard :), and the opinion about it was changed.

Yes, I understand that some of us have a (reasonable) doubt about the reST markup. It is not perfect in any matter, e.g. I don't like the ``monospace`` markup. But this is my home opinion.

My hope is, that those of us who have a doubt give reST a chance ... it is a compromise, not as bad as you might think first ... your cooperation and your criticism is needed and welcome. Please let me invite you / read on:

There are other plain-text markups e.g. AsciiDoc or Markdown. The reST markup and the Sphinx-builder is a compromise from a evaluation in 2016 (see linux-doc ML subject "muddying the waters" [1]).

Jani wrote an article about the evaluation and it results [2]. And there are other articles documenting all the various aspects.

- A report from the documentation maintainer [3]
- Kernel documentation with Sphinx, part 2: how it works [4]
- Kernel documentation update [5]

To summarize it with my words:

The old DocBook-based toolchain was hard to maintain and of course who want's to write XML? A consistent plain-text markup for articles in /Documentation/* and source-code comments (kernel-doc) was needed.

The markup: IMO reST wins that race, because it has a extendable markup specification while others plain-text markups like Markdown have various (HTML) builders with various markup dialects[7] (which is more a mess than a definition).

The builder: IMO Sphinx-Doc wins that race, since it is (well) maintained, widely used and has a interface for extensions. I.e. the one extension we wrote: 'kernel-doc' to parse kernel-doc comments from source code and include them in the articles.
Perspective: Sphinx-Doc also offers solutions we might use in the future (e.g. building man-pages). Not to end in a mess, extensions should be implemented cautiously and deliberately (be patient).

But that should not fool you; yes we have known problems with our toolchain and it is not yet ;) perfect in any matter (e.g. the highlighting in kernel-doc comments or the PDF generation or the sphinx-doc versions shipped with various distributions or ..)

Anyway, today we have more than before: The reST learning curve is (compared to DocBook) not hard for newbees and our toolchain is flexible for all the requirements wich might come up in the future.

IMO the actual challenge is the content and the organization of the doc-tree and for this

[1] https://www.mail-archive.com/search?q=muddying+the+waters&l=linux-doc%40vger.kernel.org
[2] https://lwn.net/Articles/692704/
[3] https://lwn.net/Articles/704613/
[4] https://lwn.net/Articles/692705/
[5] https://lwn.net/Articles/705224/
[6] http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html
[7] http://pandoc.org/MANUAL.html#markdown-variants

Quoted 10 lines

It was easy to navigate through various docs & the realized that various topics (& many) were present (yes, it was there earlier also, but had to dive inside Documentation & search, while viewing the toplevel index.html made them standout). It was like earlier you had to go after docs, but now it was docs coming after you, that is my opinion.

Later while fighting with memory-barriers.txt, felt that it might be good for it as well as to be in that company.

Quoted 6 lines

And the readability as a text is not hurt as well.

It was thought that rst conversion could be done quickly, but since this was my first attempt with rst, had to put some effort to get a not so bad output, even if this patch dies, i am happy to have learnt rst conversion to some extent.

Thats exactly what I mean: give reST a chance :)

-- Markus --