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.
- 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.
- 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.
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.
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.