Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 189550 - duplicated name attributes in achor tags
Summary: duplicated name attributes in achor tags
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Other documents (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Docs Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-20 03:10 UTC by Marco Clocchiatti
Modified: 2008-01-01 22:05 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Add book_id#####_chap#_pre# name in "pre" template (guide.diff,875 bytes, patch)
2007-08-27 21:59 UTC, Sven Vermeulen (RETIRED)
Details | Diff
Call body template with chid parameter (handbook.diff,617 bytes, patch)
2007-08-27 22:03 UTC, Sven Vermeulen (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Clocchiatti 2007-08-20 03:10:14 UTC
sometimes anchor tags of full listing main handbook are duplicated.

for example: 
http://www.gentoo.org/doc/it/handbook/handbook-x86.xml?part=1&chap=2#doc_chap_pre7
http://www.gentoo.org/doc/it/handbook/handbook-x86.xml?part=1&chap=3#doc_chap_pre7




Reproducible: Always

Steps to Reproduce:
1. check these addresses: 
http://www.gentoo.org/doc/it/handbook/handbook-x86.xml?part=1&chap=2#doc_chap_pre7
http://www.gentoo.org/doc/it/handbook/handbook-x86.xml?part=1&chap=3#doc_chap_pre7

they are different, but with the same name: #doc_chap_pre7
Actual Results:  
I cannot reach both using full listing page:
http://www.gentoo.org/doc/it/handbook/handbook-x86.xml?full=1#doc_chap_pre7


Expected Results:  
I would like to reach both addresses, with different name attributes, such as:

doc_chap2_pre7 and doc_chap3_pre7
Comment 1 Xavier Neys (RETIRED) gentoo-dev 2007-08-20 10:43:45 UTC
Undoing changes, not a translation issue.

It'll be fixed eventually, be patient :)
Comment 2 Marco Clocchiatti 2007-08-20 15:20:11 UTC
(In reply to comment #1)
> Undoing changes, not a translation issue.
> 
> It'll be fixed eventually, be patient :)
> 
sorry. I used a wrong example from italian docs, but the problem should be in the algorithm to define automatic attribute names.

thanks for your work.
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2007-08-27 21:59:33 UTC
Created attachment 129381 [details, diff]
Add book_id#####_chap#_pre# name in "pre" template

Patch that includes a book_id######_chap#_pre# name anchor in the "pre" template when the document is a book document.
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2007-08-27 22:03:07 UTC
Created attachment 129388 [details, diff]
Call body template with chid parameter

Call the body template inside the subsection with the chid parameter.

The body template will then call the pre template with the same parameter, allowing for the anchors to be defined.

With both patches applied, a link to #doc_chapX_preY is updated accordingly.

Note though that this invalidates at least one link (to #doc_chap_pre6 in the gentoo-ppc-faq.xml) as the behavior previously was to drop chapter ids (as pre's count onward anyway).

Dunno if that is wanted; if so, it is easy to update the patches to allow #doc_chap_preY links - or even both.
Comment 5 Xavier Neys (RETIRED) gentoo-dev 2007-08-29 12:48:40 UTC
Comment on attachment 129381 [details, diff]
Add book_id#####_chap#_pre# name in "pre" template

Useless
Comment 6 Xavier Neys (RETIRED) gentoo-dev 2007-08-29 13:25:37 UTC
Comment on attachment 129388 [details, diff]
Call body template with chid parameter

Applied and undone. Does not solve anything and messes up numbering, e.g. 2.1
2.2
...
2.7
8
9
...
18
6.19
in http://gentoo.org/doc/en/handbook/handbook-ppc.xml?part=1&chap=10
Comment 7 Xavier Neys (RETIRED) gentoo-dev 2007-08-29 13:31:25 UTC
(In reply to comment #0)
> http://www.gentoo.org/doc/it/handbook/handbook-x86.xml?full=1#doc_chap_pre7

> Expected Results:  
> I would like to reach both addresses, with different name attributes, such as:
> doc_chap2_pre7 and doc_chap3_pre7

You can't at the moment.

FYI "chap" in a handbook does not mean chapter, but section because <chapter> and <section> for some odd reason do not have the same meaning & format in handbooks and guides.

(In reply to comment #4)
> Created an attachment (id=129388) [edit]
> Call body template with chid parameter

Applied & undone, it does not make pre anchors unique in a full handbook and messes up numbering.


chid used to be in anchors by sheer luck. When bugs in libxslt that somehow made parameters available even though they were not passed, were fixed and your code became invalid, chid disappeared in some cases. I hope the chid param will eventually disappear entirely because having to pass it along the whole chain of templates is terribly messy to say the least.
Allowing <include>s would make it even worse.

Hopefully, pre anchors will eventually be made unique & usable, but it would be done differently.
Comment 8 Sven Vermeulen (RETIRED) gentoo-dev 2007-08-29 19:49:23 UTC
Easier would be to set an id attribute to the pre entity (similar to the chapter/section ones) so that the auto-generated doc_* anchors aren't used. It keeps consistency across updates (no need to look for anchors when the guide's structure changes) and makes nicer URLs.
Comment 9 Xavier Neys (RETIRED) gentoo-dev 2008-01-01 22:05:28 UTC
It should be fixed.

<pre> are numbered as in <guide>, i.e. #doc_chapX_preY

In full=1 versions of handbooks, part/chap are part of the anchors, just like they have been for other elements for a long time, i.e. #book_partZ_chapT__chapX_preY"

Allowing @id on <pre> would be trivial, I'll add it if required but the only link to a <pre> I know of is in the PPC FAQ.
Note that the more ids we allow, the more likely it becomes to have duplicates and those ids have to be unique throughout a full handbook.