#6912 Make chapter links in wiki copyable
Closed: Fixed 5 years ago Opened 5 years ago by vondruch.

In Fedora wiki, there is no easy way to copy link to chapters and sub-chapters. For example, I'd love to reference "Patching required gem versions" chapter in Ruby packaging guidelines [1], but it is not possible to copy reference to that id from the wiki. It is very annoying that I have to explore the page source to get the ID (and there is probably more people who even have no idea that it is possible to do something like this).

Just FTR, I know I can copy the links from TOC, but that is 1) inconvenient 2) there is displayed just 1st and 2nd level of headings.


The feature could look like when GH is displaying content of README files, i.e. hover over the heading would provide icon to copy the link

Could you use the Anchor template?

ie, place next to the heading you want to link to:

{{Anchor|patching_required_gem_versions}}

and then you should be able to link to that with url#patching_required_gem_versions

Otherwise I don't know of any feature like you describe, might be a RFE for mediawiki upstream...

There is the patching_required_gem_versions ID in the HTML, so I don't have to use the anchor template.

I think that the copyable anchor for headings should be just some styling thing, how the links are displayed and because we are using or own template (if I am not mistaken), then it should be just a few lines of some CSS?

But I'm not CSS expert myself, so my expectations might be naive ...

@ryanlerch any ideas here? Or should this be something to ask of mediawiki upstream...

Metadata Update from @kevin:
- Issue priority set to: Waiting on Assignee (was: Needs Review)

5 years ago

Just FTR, I know I can copy the links from TOC, but that is 1) inconvenient 2) there is displayed just 1st and 2nd level of headings.

I don't have permissions to edit it and see if this fixes it, but I see:
<div style="float: right; margin-left: 0.5em" class="toclimit-2">__TOC__</div>

If you raise (or get rid of) the toclimit-2, does it show the full TOC with the subsubsections? Is that good enough?

It could be better, but copying the link at the actual position would be more convenient

So I came up with a JS one-liner to add a link next to each header, which seems to work well enough, and can easily be added to the Fedora theme. I don't know of a better way to do it - I'm not sure how to tie into whatever internal mediawiki structure renders those headlines to do it server-side.

@vondruch would that work for you, at least for now?

@vondruch would that work for you, at least for now?

This sounds precisely as what I am looking for.

Metadata Update from @codeblock:
- Issue assigned to codeblock

5 years ago

Metadata Update from @codeblock:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

5 years ago

The "chain" icon is quite huge IMO, but otherwise, it works beautifully. Thx a lot!

Login to comment on this ticket.

Metadata