Closed Bug 681723 Opened 14 years ago Closed 5 years ago

scratchpad: add "documentation" as a menu item

Categories

(DevTools :: General, enhancement)

6 Branch
x86
macOS
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: allen, Unassigned)

Details

Scratchpad should be augment to make it easy for developers to discover how to use JavaScript and browser APIs. Add a "documentation" (or perhaps ("docs") to the scratchpad execute menu and the also the scratchpad popup menu. Here is what should do: It opens (if not already open) a new HTML window for displaying documentation. If the current selection is a JavaScript keyword it opens in the documentation window the MDN JavaScript documentation for that keyword. For example selecting "var" would open https://developer.mozilla.org/en/JavaScript/Reference/Statements/var If the current selection is not a JS keyword the selection is evaluated and the result is examined. If the result is a built-in JS or browser API function open the MDN docuentation for that function. For example selecting "[].map" would open https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/map and if "alert" was selected then https://developer.mozilla.org/en/window.alert would display if it evaluates to window.alert. If the result is a user defined JavaScript function display the source code of the function. If the result value is not a function but is a easily recognizable builtin value or kind of object open the MDN summary page for that data type. For example if the selection was "window.document" then https://developer.mozilla.org/en/DOM/document would be display. For values that can not be more precisely identified a notification should be given that documentation is not available. The documentation window should have a random access history list so that recently accessed documentation can be quickly accessed. Also a search box that does a MDN search. In the longer term we might recognize that the source code of JS functions includes metadata for commonly used documentation conventions such as JSDoc. In that case we might format and display the user provided documentation. It would also be a good idea to provide an extension mechanism so framework writers can plugin documentation modules for there framework functions and objects.
Product: Firefox → DevTools

Scratchpad has been deprecated, closing.

Honza

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.