Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Allow linking directly to a paragraph #812

Closed
kamenoccc opened this Issue Apr 9, 2015 · 5 comments

Comments

Projects
None yet
3 participants

Bitcoin.org is a really informative website, translated for many languages and helpful to bitcoiners nevertheless.

However, I often find myself hesitant when it comes to linking someone directly to it so he/she can learn something specific. I'm afraid that they'll be lost in text if I do. That's because despite the simplicity the terminology in the website has, we're not able to link directly to a paragraph.

Many other websites have this ability, including forums, wikis and other websites that can be informative. Here's an example of what I mean through wikipedia:

https://en.wikipedia.org/wiki/Bitcoin#History

The text after the '#' links to a header of the text, this way making it easier for readers to know where they should start reading from.

I think such an addition could be really useful for bitcoin.org and possibly make it easier to read too.

PS: It's the first time I'm trying to contribute to a project in github. Let me know if I'm doing something wrong.

@harding harding changed the title from There's something lacking from bitcoin.org: the ability to link directly to a paragraph to Allow linking directly to a paragraph Apr 9, 2015

Contributor

harding commented Apr 9, 2015

@kamenoccc indeed, that's a useful feature and we have it for some of our longer docs. For example: https://bitcoin.org/en/developer-guide#block-chain

You'll also notice if you scroll that page that URL in your browser's location bar updates automatically as you go from section to section.

We absolutely should try adding those features to other pages. I'll take a look at it today. Thanks!

Contributor

saivann commented Apr 9, 2015

@harding Anchor urls were typically translated for each pages with a table of content. I guess it would be quite a lot of work to add translated anchors to each and every page, so you may want to consider using anglais anchor urls only (Edit: to be clearer: English anchor urls on every translated page)

Contributor

harding commented Apr 9, 2015

@saivann yep, that's what I did, thanks! Although, when we next update the Jekyll version, we can use its newish slugify filter to convert subheader text like "Foo Bar Baz" into automatic anchors like "#foo-bar-baz". This will work on the translated subheads equally as well (I assume; I'd have to verify it works for the non-Latin languages).

I should have a PR for basic anchor links to all subheads on all pages up as soon as I finish some final checks. I'll have a second PR for adding addAnchorLinks() to base.html since that will affect the Download page.

Contributor

harding commented Apr 9, 2015

PRs fixing this issue added:

  • bitcoin#813 anchors for all subheads
  • bitcoin#814 display-on-hover anchor links next to all subheads (AKA anchor link affordance, although I have no idea who made up that term)
Contributor

harding commented Apr 27, 2015

Closing; this is now fully implemented on the site. Thanks!

@harding harding closed this Apr 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment