Generate anchor name for top- and second-level titles

Troy's Avatar

Troy

17 Apr, 2013 11:12 PM

Right now my KB entries are scattered with manually-created anchor tags I've added because I needed to link someone to a specific section of a doc. GitHub's markdown processor generates anchor names for high-level titles. I'd love to have that. If I did (and didn't need to manually add each one), I'd use anchor names in many more of my links so users got to the exact right place.

Thanks,

Troy

  1. 1 Posted by Julien on 18 Apr, 2013 12:24 AM

    Julien's Avatar

    Hey Troy,

    I'll look into it.

  2. 2 Posted by Julien on 24 Apr, 2013 05:06 PM

    Julien's Avatar

    Hi Troy,

    I deployed this change yesterday. All headings should get an automatically generated anchor now (toc_N). It requires resaving all your KBs though (HTML is cached), so take a look, and it that suits you, I'll go ahead and resave them all for you.

  3. 3 Posted by Troy on 24 Apr, 2013 06:12 PM

    Troy's Avatar

    Hi Julien,

    First off, thanks for doing this. It's really cool to see something happen so quickly.

    So.. I hate to be that guy, but I silently assumed that you'd look at GitHub's implementation and retain the good parts of it. There's two things that make Tender's way less useful than GitHub's:

    • I don't see the anchor name. This basically ensures that nobody among your userbase will actually find and use these, which makes my whole request kind of a waste. (Sure, I can view source, but it'll never be obvious enough to get used). It needs the mouseover treatment like GitHub does, or the feature is destined for disuse and despite my good intentions, was probably just a waste of your time.
    • Ideally, the anchor name should include the text. That's not absolutely required, but it's really really nice. (I'm assuming that the ToC sequence doesn't change, too. If adding a new title would reorder the toc_X names as-is, then this is also sort of a must, since the existing links would all go to the wrong place.)

    You've probably seen how GitHub's works, but if not, hit https://github.com/papertrail/remote_syslog and scroll down to one of the title sections in the readme, then mouseover it.

    Thanks, and sorry to be the bearer of bad news. I'd say as-is it's actually worth pulling out and leaving until the changes above are possible. I know it sucks, but that's what it takes to have the minimum useful feature here. Thanks for asking, too.

    Troy

  4. 4 Posted by Julien on 24 Apr, 2013 06:18 PM

    Julien's Avatar

    Hey Troy,

    No worries, your concerns are legitimate. For the first part I just went the easy route and simply enabled an option in our library, which gives the #toc_X. The rest of the features are cool but require actual code, so I'll work on it, just not sure when. In any case I'll keep you posted when I have something new.

    Cheers!

  5. 5 Posted by Troy on 24 Apr, 2013 06:36 PM

    Troy's Avatar

    Gotcha. Do they reorder if a new header is added? If so, I think that's actually far, far worse than not having it at all. If I link someone to something (or it's indexed - Google grabs the line after anchor names and displays them as section links in search results), it needs to stay stable above all else.

    Thanks,

    Troy

  6. Support Staff 6 Posted by Courtenay on 26 Apr, 2013 12:52 AM

    Courtenay's Avatar

    We have a fix for this, just nailing down some css changes and QAing it. It will work the way you'd expect and have hover links and so on. It may take a few days to get to production.

  7. 7 Posted by Troy on 26 Apr, 2013 04:07 AM

    Troy's Avatar

    That's great news, Courtenay. Nice work.

    Troy

  8. 8 Posted by Julien on 29 Apr, 2013 05:54 PM

    Julien's Avatar

    Hi Troy,

    This is deployed. I have re-generated all your KB articles.

    Let me know how it goes.

  9. 9 Posted by Troy on 29 Apr, 2013 06:26 PM

    Troy's Avatar

    Oh, man, this is gorgeous. You made my day. Beautiful work. Thank you and thanks to Courtenay.

    I have one tiny suggestion: downcase the whole thing. I very rarely see people use caps-aware anchor names, and with ones that are dynamically generated, that might be safer.

    Cheers,

    Troy

  10. 10 Posted by Troy on 29 Apr, 2013 06:29 PM

    Troy's Avatar

    No exaggeration, I just told someone to go to a URL and "scroll down to Section" earlier today. You prevented all future cases of our users having to do that and me having to say that (and there's been hundreds of both). Thanks again.

    Troy

  11. 11 Posted by Julien on 29 Apr, 2013 10:19 PM

    Julien's Avatar

    Hi Troy,

    Should be all good now (lowercase).

    Cheers!

  12. 12 Posted by Troy on 01 May, 2013 08:16 PM

    Troy's Avatar

    This is working absolutely beautifully. No exaggeration, I've used it in 6 or 7 chat replies today alone.

    Troy

  13. 13 Posted by Julien on 02 May, 2013 05:04 PM

    Julien's Avatar

    Hey Troy,

    Glad you like it, and thanks for bringing it up.

    Cheers!

  14. Julien closed this discussion on 02 May, 2013 05:04 PM.

  15. Troy re-opened this discussion on 31 Mar, 2014 05:41 PM

  16. 14 Posted by Troy on 31 Mar, 2014 05:41 PM

    Troy's Avatar

    Hey Julien, this is still working great. I ran across an unusual case that I thought you might want to know about, though I doubt it's change-able, and it might not even be worth changing. Namely, punctuation in slugs is encoded with the punctuation ASCII code instead of being stripped. Here's an example:

    Title: Can searches refine which senders' logs are shown (without creating a new group)?

    Slug: can-searches-refine-which-senders-39-logs-are-shown-without-creating-a-new-group-

    Anyway, no action needed, just passing it along. Have a great week,

    Troy

  17. 15 Posted by Julien on 31 Mar, 2014 06:46 PM

    Julien's Avatar

    Hey Troy,

    Thanks for the notice. I looked it up and what happens is the quote gets escaped by the markdown lib to ', and since we remove all "non word characters", the 39 sticks.

    We could probably fix it, but it is indeed a minor inconvenience, so I will leave it as is for the time being.

    Cheers!

  18. Courtenay closed this discussion on 31 Mar, 2014 06:48 PM.

Discussions are closed to public comments.
If you need help with Tender please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac