1. 20 Mar, 2020 3 commits
    • Jonathan Corbet's avatar
      Merge branch 'mauro' into docs-next · 769f90f8
      Jonathan Corbet authored
      Mauro says (as he's cleaning up my mess):
      
      This small series address a regression caused by a new patch at
      docs-next (and at linux-next).
      
      Before this patch, when a cross-reference to a chapter within the
      documentation is needed, we had to add a markup like:
      
      	.. _foo:
      
      	foo
      	===
      
      This behavor is now different after this patch:
      
      	58ad30cf ("docs: fix reference to core-api/namespaces.rst")
      
      As a Sphinx extension now creates automatically a reference
      like the above, without requiring any extra markup.
      
      That, however, comes with a price: it is not possible anymore to have
      two sections with the same name within the entire Kernel docs!
      
      This causes thousands of warnings, as we have sections named
      "introduction" on lots of places.
      
      This series solve this regression by doing two changes:
      
      1) The references are now prefixed by the document name. So,
         a file named "bar" would have the "foo" reference as "bar:foo".
      
      2) It will only use the first two levels. The first one is (usually) the
         name of the document, and the second one the chapter name.
      
      This solves almost all problems we have. Still, there are a few places
      where we have two chapters at the same document with the
      same name. The first patch addresses this problem.
      
      The second patch limits the escope of the autosectionlabel.
      769f90f8
    • Mauro Carvalho Chehab's avatar
      docs: conf.py: avoid thousands of duplicate label warning on Sphinx · 4658b0eb
      Mauro Carvalho Chehab authored
      The autosectionlabel extension is nice, as it allows to refer to
      a section by its name without requiring any extra tag to create
      a reference name.
      
      However, on its default, it has two serious problems:
      
      1) the namespace is global. So, two files with different
         "introduction" section would create a label with the
         same name. This is easily solvable by forcing the extension
         to prepend the file name with:
      
      	autosectionlabel_prefix_document = True
      
      2) It doesn't work hierarchically. So, if there are two level 1
         sessions (let's say, one labeled "open" and another one "ioctl")
         and both have a level 2 "synopsis" label, both section 2 will
         have the same identical name.
      
         Currently, there's no way to tell Sphinx to create an
         hierarchical reference like:
      
      		open / synopsis
      		ioctl / synopsis
      
        This causes around 800 warnings. So, the fix should be to
        not let autosectionlabel to produce references for anything
        that it is not at a chapter level within any doc, with:
      
      	autosectionlabel_maxdepth = 2
      
      Fixes: 58ad30cf ("docs: fix reference to core-api/namespaces.rst")
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Link: https://lore.kernel.org/r/74f4d8d91c648d7101c45b4b99cc93532f4dadc6.1584716446.git.mchehab+huawei@kernel.orgSigned-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      4658b0eb
    • Mauro Carvalho Chehab's avatar
      docs: prevent warnings due to autosectionlabel · c44166fe
      Mauro Carvalho Chehab authored
      Changeset 58ad30cf ("docs: fix reference to core-api/namespaces.rst")
      enabled a new feature at Sphinx: it will now generate index for each
      document title, plus to each chapter inside it.
      
      There's a drawback, though: one document cannot have two sections
      with the same name anymore.
      
      A followup patch will change the logic of autosectionlabel to
      avoid most creating references for every single section title,
      but still we need to be able to reference the chapters inside
      a document.
      
      There are a few places where there are two chapters with the
      same name. This patch renames one of the chapters, in order to
      avoid symbol conflict within the same document.
      
      PS.: as I don't speach Chinese, I had some help from a friend
      (Wen Liu) at the Chinese translation for "publishing patches"
      for this document:
      
      	Documentation/translations/zh_CN/process/5.Posting.rst
      
      Fixes: 58ad30cf ("docs: fix reference to core-api/namespaces.rst")
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Link: https://lore.kernel.org/r/2bffb91e4a63d41bf5fae1c23e1e8b3bba0b8806.1584716446.git.mchehab+huawei@kernel.orgSigned-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      c44166fe
  2. 19 Mar, 2020 1 commit
  3. 11 Mar, 2020 1 commit
  4. 10 Mar, 2020 21 commits
  5. 02 Mar, 2020 14 commits