jashkenas / underscore

JavaScript's utility _ belt
https://underscorejs.org
MIT License
27.29k stars 5.53k forks source link

Missing link #2976

Closed stevespages closed 1 year ago

stevespages commented 1 year ago

I am a very new user and may have missed something very obvious so apologies it that is the case.

I feel there should be a link from this page: https://underscorejs.org/#debounce to this page: https://underscorejs.org/docs/modules/debounce.html

Obviously that is just an example and would apply to every function.

jgonggrijp commented 1 year ago

You are absolutely right! There is no such link yet, even though it would make sense. The historical reason is that all Underscore source code used to be in a single file. However, now that every function lives in a separate module (since 1.11), it should be easy to add.

Thanks for the suggestion!

jgonggrijp commented 1 year ago

@stevespages The main website now includes an annotated source link for each function. Please let me know whether you are happy with it.

stevespages commented 1 year ago

I just saw it. I think that is great! Also good that the link is labelled as 'SOURCE' so it is clear what it is. I am now wondering whether you should have a link from that page back to the # on the original page? I think clutter is bad but on the other hand I can imagine that might be useful.

I am actually just using underscorejs to try and improve my programming understanding but with a view to incorporating it into my code if I ever get to that stage...

jgonggrijp commented 1 year ago

@stevespages I think that could be done efficiently. If you were the one adding the back link, where on the annotated source page would you put it?

As for incorporating Underscore in your code, what is holding you back?

stevespages commented 1 year ago

I guess it could go under the h1 title. I was thinking it might be good to make it upper case and style it like the SOURCE link as they are 'complimentary' links. I am not quite sure what word you would use for the link to describe those sections but MORE or INFO might work if there is nothing more specific.

I seem to have spent years learning to code and never actually taken on any paid work. So, in a way writing my own functions makes sense. I am beginning to realise there are many advantages to using a library partly because of reading https://juliangonggrijp.com/article/introducing-modular-underscore.html

Edit: I just twigged you wrote it!

jgonggrijp commented 1 year ago

How about DOCUMENTATION? I agree under the <h1> makes sense, and it also seems easy to do from a technical standpoint.

Happy to hear that my article inspired you! For some more practical, hands-on Underscore inspiration, you might like some of my Stack Overflow answers:

stevespages commented 1 year ago

DOCUMENTATION sounds good to me. I will take a look at those Stackoverflow answers. I am spending far too long on Stackoverflow trying to get passed 1000 reputation which I am finding much harder than I thought it would be. After that I am hoping to get back to building an app...