<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14436</bug_id>
          
          <creation_ts>2021-06-16 08:14:41 +0000</creation_ts>
          <short_desc>mega-manual: singleindex.html - same name multiple times</short_desc>
          <delta_ts>2026-10-23 08:13:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>9</classification_id>
          <classification>Documentation</classification>
          <product>Mega Manual</product>
          <component>mega-manual</component>
          <version>3.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>ACCEPTED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Berger">pokylinux</reporter>
          <assigned_to name="Antonin Godard">antonin.godard</assigned_to>
          <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>90644</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2021-06-16 08:14:41 +0000</bug_when>
    <thetext>It looks like I found at least one case where we have the same link name multiple times.

1) Click here:
http://docs.yoctoproject.org/singleindex.html#machine-features

2) Scroll up to: &quot;12 Features&quot;

3) Click &quot;12 Features&quot;

4) This brings you here:
http://docs.yoctoproject.org/singleindex.html#features

Which is wrong.

My problem is, that I need unique links to link to from my training material, which does not seem to be the case anymore.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90645</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2021-06-16 08:20:31 +0000</bug_when>
    <thetext>If I look at the pattern, I see, that I am still able to to access

ref-machine-features

&lt;div class=&quot;section&quot; id=&quot;machine-features&quot;&gt;
&lt;span id=&quot;ref-features-machine&quot;&gt;&lt;/span&gt;&lt;h4&gt;&lt;span class=&quot;section-number&quot;&gt;12.1 &lt;/span&gt;Machine Features&lt;a class=&quot;headerlink&quot; href=&quot;#machine-features&quot; title=&quot;Permalink to this headline&quot;&gt;¶&lt;/a&gt;&lt;/h4&gt;

This would work for me:

replace:

&lt;span id=&quot;document-ref-manual/features&quot;&gt;&lt;/span&gt;&lt;div class=&quot;section&quot; id=&quot;features&quot;&gt;

with:

&lt;span id=&quot;document-ref-manual/features&quot;&gt;&lt;/span&gt;&lt;div class=&quot;section&quot; id=&quot;ref-features&quot;&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90664</commentid>
    <comment_count>2</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2021-06-17 09:11:42 +0000</bug_when>
    <thetext>another example:

1) http://docs.yoctoproject.org/singleindex.html#yocto-project-linux-kernel-development-manual

2) click on permalink for Introduction

http://docs.yoctoproject.org/singleindex.html#introduction

which is wrong</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90665</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2021-06-17 09:12:49 +0000</bug_when>
    <thetext>another example:

1)

http://docs.yoctoproject.org/singleindex.html#yocto-project-linux-kernel-development-manual

2) click on permalink of

1.1 Overview

http://docs.yoctoproject.org/singleindex.html#overview

which is wrong</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90666</commentid>
    <comment_count>4</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2021-06-17 09:47:12 +0000</bug_when>
    <thetext>another example:

1) http://docs.yoctoproject.org/singleindex.html#yocto-project-linux-kernel-development-manual

2) click on 1.1 Overview

http://docs.yoctoproject.org/singleindex.html#overview

which is wrong</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90667</commentid>
    <comment_count>5</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2021-06-17 10:19:15 +0000</bug_when>
    <thetext>Since those links are most likely also used internally singleindex.html is most likely broken for all and not just for me since links are not unique. 

With separate manuals things most likely still work. 
The question is how inter-document links are made.
I assume a.html#link and b.html#link is the main difference, since with different html files the same link names can refer to different html docs.

singleindex.html is a single html file and hence it&apos;s broken for the case where internal links are not unique.

They need to be unique per html document!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91161</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Opdenacker">michael.opdenacker</who>
    <bug_when>2021-08-12 14:11:01 +0000</bug_when>
    <thetext>Hi Robert,

Thank you very much for the bug report.

I looked for options in the Sphinx &quot;singlehtml&quot; output, which could address this issue.

The corresponding builder is documented here:
https://www.sphinx-doc.org/en/master/usage/builders/index.html

And the source code is here:
https://github.com/sphinx-doc/sphinx/blob/master/sphinx/builders/singlehtml.py
https://github.com/sphinx-doc/sphinx/blob/master/sphinx/builders/html/__init__.py

What seems to be wrong is the way &quot;permalinks&quot; are created. See &quot;html_permalinks&quot; and &quot;html_add_permalinks&quot; in the https://github.com/sphinx-doc/sphinx/blob/master/sphinx/builders/html/__init__.py file.

There is documentation on https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_permalinks too.

I&apos;ll take some spare time to understand the code that generates the singlehtml output and see what&apos;s possible to do. This may require to push a patch upstream.

That&apos;s better than making sure we have no subsections that have the same name in different manuals.

Thanks again
Michael.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91162</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Opdenacker">michael.opdenacker</who>
    <bug_when>2021-08-12 14:15:33 +0000</bug_when>
    <thetext>Also wanted to add that the links to top sections on the left bar are unique, so there&apos;s hope to implement something similar for individual permalinks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91174</commentid>
    <comment_count>8</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2021-08-12 18:16:39 +0000</bug_when>
    <thetext>OK great!

This is what I do:

I download a local copy of the mega-manual and link to it from my slides and I also noticed that if I use a local copy like that from a browser:

file:///home/rber/projects/trainings/framework-3.0/yocto-3.0/mega-manual-new/mega-manual.html

links still refer e.g. to http://docs.yoctoproject.org/singleindex.html#term-Build-Host and not to the relative path.

Not sure this is intentional. It was not the case with the good old doc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92085</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Opdenacker">michael.opdenacker</who>
    <bug_when>2021-12-01 15:25:36 +0000</bug_when>
    <thetext>Here&apos;s another comment from Robert...

We have the same link (I guess auto generated) multiple times in the html, which I need to patch in order to link from my pdf files to the right one.

Something like that:

Index: final-yocto/singleindex.html
===================================================================
--- final-yocto.orig/singleindex.html
+++ final-yocto/singleindex.html
@@ -32337,7 +32337,7 @@ log into the &lt;a class=&quot;reference externa
 &lt;div class=&quot;line&quot;&gt;&lt;br /&gt;&lt;/div&gt;
 &lt;/div&gt;
 &lt;div class=&quot;toctree-wrapper compound&quot;&gt;
-&lt;span id=&quot;document-kernel-dev/intro&quot;&gt;&lt;/span&gt;&lt;section id=&quot;introduction&quot;&gt;
+&lt;span id=&quot;document-kernel-dev/intro&quot;&gt;&lt;/span&gt;&lt;section id=&quot;kernel-dev-introduction&quot;&gt;
 &lt;h3&gt;&lt;span class=&quot;section-number&quot;&gt;1 &lt;/span&gt;Introduction&lt;a class=&quot;headerlink&quot; href=&quot;#introduction&quot; title=&quot;Permalink to this headline&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
 &lt;section id=&quot;overview&quot;&gt;
 &lt;h4&gt;&lt;span class=&quot;section-number&quot;&gt;1.1 &lt;/span&gt;Overview&lt;a class=&quot;headerlink&quot; href=&quot;#overview&quot; title=&quot;Permalink to this headline&quot;&gt;&lt;/a&gt;&lt;/h4&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94042</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Opdenacker">michael.opdenacker</who>
    <bug_when>2022-09-21 14:07:38 +0000</bug_when>
    <thetext>The problem still happens with Sphinx 5.1.1
It will need fixing in upstream.

Steps to reproduce:
make singlehtml
open __build/singlehtml/index.html#document-kernel-dev/index
Follow the link to 
Click on the permalink associated to the &quot;overview&quot; section
It goes to another &quot;overview&quot; section elsewhere in the mega manual.

That&apos;s because &quot;make singlehtml&quot; doesn&apos;t make permalinks unique if there are identical section names in different documents.

Milestone set to 4.2 M4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99864</commentid>
    <comment_count>11</comment_count>
    <who name="Antonin Godard">antonin.godard</who>
    <bug_when>2024-10-15 14:54:40 +0000</bug_when>
    <thetext>Sidenote: this is also an open issue in Sphinx since 2018: https://github.com/sphinx-doc/sphinx/issues/4814.

I don&apos;t this it was mentioned here before.

From the issue, it seems that the root of the problem could be docutils, not even Sphinx. 

I looked at the code in `builders/html/__init__.py`, and `ids` are generated by docutils and Sphinx uses them to add the `href` attribute in the relevant html node, so it _not_ generating the attribute.

I doubt there is an easy solution to this unfortunately.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100023</commentid>
    <comment_count>12</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-10-24 15:04:03 +0000</bug_when>
    <thetext>Bulk move of 5.1 M4 to 5.2 M2 as approved by AlexB.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102176</commentid>
    <comment_count>13</comment_count>
    <who name="Antonin Godard">antonin.godard</who>
    <bug_when>2025-06-06 07:42:29 +0000</bug_when>
    <thetext>Bulk move of bugs I am assigned to from Milestone 5.2M4 to 5.3M1.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>