Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Add anchor link for titles in documents #34

Closed
zcbenz opened this issue Jun 3, 2015 · 3 comments
Closed

Add anchor link for titles in documents #34

zcbenz opened this issue Jun 3, 2015 · 3 comments
Labels
enhancement New feature or request

Comments

@zcbenz
Copy link
Member

zcbenz commented Jun 3, 2015

It is useful to use link with hash to reference a certain API in the documents, like this:
https://github.com/atom/electron/blob/master/docs/api/tray.md#traysethighlightmodehighlight

@zcbenz zcbenz added the enhancement New feature or request label Jun 3, 2015
@jlord jlord added the docs label Jun 4, 2015
@jlord
Copy link
Contributor

jlord commented Jun 4, 2015

I added the id option to the site's markdown parser, 1c24753, so it now adds an id. But looking at the example you mentioned, the id is a bit awkward for methods:

<h3 id="tray.sethighlightmode(highlight)">Tray.setHighlightMode(highlight)</h3>

Also, that id doesn't even work as an anchor 😞

We are using redcarpet as the parser because it worked best with highlighting (I think), but I will try and experiment with another so that these work.

@jlord
Copy link
Contributor

jlord commented Jun 8, 2015

When GitHub Pages updates the version of redcarpet it uses our ids will get sorted 🍕

Things in motion: github/pages-gem#143

@jlord
Copy link
Contributor

jlord commented Aug 11, 2015

The parser has been updated so our docs now have the ids: http://electron.atom.io/docs/v0.30.0/api/tray/#tray-sethighlightmode-highlight

I just dug around and found the way to get the headers to be links in Jekyll as well... PR coming 🔜

@jlord jlord closed this as completed in #69 Aug 11, 2015
kevinsawicki pushed a commit that referenced this issue May 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants