Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: the hash tag should mirror the headline #2

Closed
ghost opened this issue Feb 29, 2012 · 3 comments
Closed

Feature request: the hash tag should mirror the headline #2

ghost opened this issue Feb 29, 2012 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 29, 2012

On your example page, if you click the "Contributors" link in the table of contents, instead of the url hash being #toc9, it would be cleaner and make more sense for a url if the headline was the hash. Just a suggestion.

@jgallen23
Copy link
Owner

Yep, that's on the feature list.

@dvberkel
Copy link
Contributor

dvberkel commented Mar 5, 2012

I have related suggestion. It is similar enough that I did not start a new issues.

It would be great if the hash tag was generated by a function. The hash tag generator would have a default specified e.g

jQuery.fn.toc.defaults = {
  ...
  hashtag: function(i, heading, prefix){
      return '#'+prefix+i;
  },
  ...
};

and could be called with $.opts.hashtag(i,heading, $.opts.prefix).

I will fork the project and implement this feature. I will also provide an implementation which returns the heading text as an example.

dvberkel added a commit to dvberkel/toc that referenced this issue Mar 5, 2012
The plugable anchorName is implemented.
jgallen23 pushed a commit that referenced this issue Mar 9, 2012
@jgallen23
Copy link
Owner

fixed in #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants