Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 772005 - Add anchor links to sections
Summary: Add anchor links to sections
Status: RESOLVED FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Devmanual (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Devmanual Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-22 07:28 UTC by Sam James
Modified: 2021-02-25 19:30 UTC (History)
0 users

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


Attachments
Patch for XSL and CSS stylesheets (0001-devbook.xsl-devmanual.css-Add-permalinks-to-section-.patch,2.21 KB, patch)
2021-02-22 18:07 UTC, Ulrich Müller
Details | Diff
Patch for XSL and CSS stylesheets v2 (0001-devbook.xsl-devmanual.css-Add-permalinks-to-section-.patch,3.62 KB, patch)
2021-02-22 19:47 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-02-22 07:28:57 UTC
Is it possible to add anchor links to sections like with the QA Policy? (e.g. https://projects.gentoo.org/qa/policy-guide/dependencies.html#pg0002).

Note that it is possible to link to specific sections already - we just don't have an actual indicator for them, e.g. https://devmanual.gentoo.org/general-concepts/mirrors/index.html#automatic-mirroring.
Comment 1 Ulrich Müller gentoo-dev 2021-02-22 18:07:34 UTC
Created attachment 688095 [details, diff]
Patch for XSL and CSS stylesheets

Yes, that could be done with CSS.
Please test if attached patch does what you want.
Comment 2 Ulrich Müller gentoo-dev 2021-02-22 18:09:56 UTC
Note that I've omitted the chapter headings. Since there is exactly one chapter per page, its address is always equal to the page address which is readily available.
Comment 3 Ulrich Müller gentoo-dev 2021-02-22 19:47:57 UTC
Created attachment 688101 [details, diff]
Patch for XSL and CSS stylesheets v2

Patch v2:
- Use link icon from Font Awesome
- Remove some code duplication
Comment 4 Ulrich Müller gentoo-dev 2021-02-23 07:55:17 UTC
Comment on attachment 688101 [details, diff]
Patch for XSL and CSS stylesheets v2

https://github.com/gentoo/devmanual/pull/195 now.
Comment 5 Larry the Git Cow gentoo-dev 2021-02-25 19:30:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=ca88a7b371840409a3f3788da5365d968a55118e

commit ca88a7b371840409a3f3788da5365d968a55118e
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2021-02-22 22:02:43 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2021-02-25 19:06:13 +0000

    devbook.xsl, devmanual.css: Add permalinks to section headers
    
    While we use empty fragments ("#") elsewhere for navigation within the
    document (because they don't cause reloading of the page), we use an
    empty href ("") for the chapter because it is meant to be copied as an
    external link.
    
    Closes: https://bugs.gentoo.org/772005
    Suggested-by: Sam James <sam@gentoo.org>
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 devbook.xsl   |  6 +++++-
 devmanual.css | 14 ++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)