I realize this was already discussed previously (most notably Jon Skeet's post) but it got me thinking about how beneficial and necessary a tool to add documentation links in a post was.

Much like any other worthwhile public project, I thought I would come to community to get feedback before proceeding. Additionally, I feel like this is something we can work together to not only find a more immediate ("temporary") solution, but also get a lot of the leg work done for a (presumable) permanent solution on the site.

I have the idea to use a JSONP call and something like GreaseMonkey plugin to tie it together with an embedded solution. The idea is this:

  1. Grab the tags from the question using them as a "base-line" search domain. This could probably be extended to include other things (like javascript was tagged but you may want to offer a jQuery solution, or regex was tagged but it should be a PHP solution).
  2. Insert a look-up UI to allow you to begin typing a function name, property, etc. which then queries a service somewhere that compiles both the tags and the search term(s) and finds a best-fit solution.
  3. Display a list of exact/close matches to chose from where clicking an entry auto-adds the link/relevant information in to your post.

That's more or less a simplified work-flow of how I envision the solution, but anything is open to discussion/modifications.

I also feel like this should be as modular as possible. Basically, compartmentalize how the look-ups are done so we can then further extend functionality for additional tags or as contributors begin writing additional look-ups for new or unimplemented tags.

I'm aware this is very broad and should probably be more of a wiki, but I'd like to see if there is at least interest in proceeding (otherwise I'll probably just tackle it how I see fit and possibly release it to whomever would like it).

If there is interest, I feel like these things need to be tackled:

  • Is this worthwhile?
  • Describe a work-flow (if what I've described isn't sufficient, or should be expanded upon)
  • Describe a format to return the results (how should errors return, how should responses come back)
  • Describe a UI to use and how it should be implemented
  • Decide on a language to implement this in


Also, I felt like this should be on meta, but if it's more a SO post please feel free to move it.

Update (05/31/2011)

I was just made aware that GreaseMonkey has a function that's able to make AJAX calls to non-originating web-sites (outside of the current domain) using GM_xmlhttpRequest()--this may be easier than I anticipated.

Update (03/21/2011)

So I played around with the idea of using an ASP WebService for the purpose of this task. I feel like this is the best solution given StackOverflow/Exchange is written in ASP/C# and allows a solution to be tied in to the site with the least amount of effort (while still offering support for a third-part plugin solution). I also was browsing around through the Managed Extensibility Framework (MEF), which appears to be a solid direction to head, offering modular development both now and in the future. This way a common interface can be conceived and plugins can be written for each of the segments (i.e. jQuery look-up, MSDN look-up, PHP look-up, etc.).

What I don't have under control yet is how the information should be returned. That is to say, a way of generalizing all the various returned information in to one self-contained package which would, in the end, be displayed to the user for selection/importation. Given you have an array of options that could be returned (properties, methods, libraries, etc.) I feel like the results should be generalized, but offer additional information so in the end the user can specify what s/he originally meant. I envision this something like the following:

  • ReturnedObject (Container)
    • Total Matches (Optional?)
    • Matches (Array of:)
      • Term (Name / Match result)
      • Tag (Which language this is directed for)
      • Description (Brief description of the match)
      • ReferenceUrl (Location this document can be found at)

Ideally, the client sends the service two pieces of data: a list of tags from the question (and maybe additional ones they'd also like referenced) and the term to search for. The service then goes through each of the tags looking for matches and finds the best-fit solution based on how close a match it is. All the possible results are compiled in to a returnable list and (possibly) sorted based on their closeness to a match. The client then dumps this data out where the user can either make an ultimate selection, or decide they want to search for something different/more precise. The final match is then click-able and gets directly imported in to the question.

I'm not sure I'm going down the correct path, but it's what I was brainstorming this weekend. If anyone has any additional thoughts/suggestions, please feel free to chime in.

  • I've concocted something simplistic for my own uses: stackapps.com/questions/2234/… - Very dull as of now, but it's feasible to use it with an external documentation resolver service. (And that would be more reliable)! I'm currently expecting one single url, but it would be workable to provide a link selection UI. (But I don't really know how to code one.)
    – mario
    Commented Mar 21, 2011 at 18:44
  • @mario: I like it, though it relies heavily on the sites "finding it for themselves". Though any approach is better than no approach. ;-) I've been playing with the webservice and breaking it out to be modular. Thus far, I've gotten a good chunk of the foundation done, just testing it out and playing with it using JSONP. I'm hoping I can distribute an interface library and have people make a "jquery.dll", "msdn.dll", etc. and plug them in and go. ;-) Commented Mar 21, 2011 at 19:53
  • I considered making it more dependable with an exact list of documentation urls (1 url per function name for easy searching). Though getting that shallow bit of UI working is the first task. -- Can't help with providing a DLL, but I'm very interested in writing a JSON consumer when your service is up. (It's also odd that to date nobody has attempted such an effort.)
    – mario
    Commented Mar 21, 2011 at 19:58
  • @mario: That was kind of my point as well. I've seen talk but given the demographic that is SO, I would have thought this would have been tackled by now. Either way, I always like new projects. And it gives me a reason to dabble with MEF--I find the experience will come in handy, and I'm also going on the presumption I'll get done but probably not as efficient as possible. Should someone else decide to help, undoubtedly there will be a better way I can learn from. Commented Mar 21, 2011 at 20:38


You must log in to answer this question.

Browse other questions tagged .