Add a button while hovering a id to generate a link with anchor (ala GitHub)

NEW
Unassigned

Status

Mozilla Developer Network
Wiki pages
--
enhancement
3 years ago
3 years ago

People

(Reporter: Julien G, Unassigned)

Tracking

Details

(Whiteboard: [specification][type:feature])

Attachments

(2 attachments)

(Reporter)

Description

3 years ago
What problems would this solve?
===============================
This would make easier for readers to create link towards specific points in MDN articles. Currently, only heading element from the ToC can generate such links though some other elements have IDs.

Who would use this?
===================
Readers of the page who want to generate a link to a specific point in the page (non necessarily a heading element) in order to share/reference it.

What would users see?
=====================
Users will see a link button while hovering the element of the page to link too (cf. GitHub which does this)

What would users do? What would happen as a result?
===================================================
Users would be able to click on this button to get the URL to be exactly the one corresponding to this point in the page (whether it's in the URL bar or in the clipboard) 
For example, they could create https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype withouth going through the dev tools looking for the ID.

A user receiving such a link would be directly sent to the exact point of the page related to the info.

Is there anything else we should know?
======================================
This has been a real user case explained on IRC. This feature could be inspired from the one that is already in GitHub.
(Reporter)

Updated

3 years ago
Component: General → Design
(Reporter)

Comment 1

3 years ago
Created attachment 8588419 [details]
Feature on es5.github.io
(Reporter)

Comment 2

3 years ago
Created attachment 8588420 [details]
Feature on GitHub https://github.com/mozilla/kuma

Comment 3

3 years ago
To be noted: github feature only works on headers. It indeed doesn't make sense to have a link to the middle of a paragraph.

Hence, I think this feature should be added for:

- <h*> (whether in the ToC or not)
- <dt>

... and maybe others I haven't thought about.
The New York times has a way to do this that doesn't involve generating IDs but the links expire if the text is changed significantly: http://open.blogs.nytimes.com/2011/01/11/emphasis-update-and-source/ 

What Julien is describing is certainly the more familiar UI pattern and probably would be easier to make work without javascript.
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Component: Design → Wiki pages
Ever confirmed: true
You need to log in before you can comment on or make changes to this bug.