In notebooks you can press F1 (or Shift+F1 for a new window) to:
- open the help page of the marked
Symbol
or theSymbol
under the cursor in the Documentation Center - to search the Documentation Center, if no direct page was available
Question: Is it possible to achieve exactly this behavior with a function searchDoc[input_String]
?
Related issues
Related 1:
As stated in the documentation to Hyperlink
, this here opens the documentation of Plot
in a new window
NotebookOpen["paclet:/ref/Plot"]
but if the "paclet" does not exist, an error message appears instead of a search in the docs.
Related 2: It's possible to mimic the behavior of F1 with a FrontEndToken
.
Button["HEEELP!!", FrontEndExecute[FrontEndToken["SelectionHelpDialog"]]]
This button shows the help of marked symbols or of symbols under the cursor. Problem here is, that it searches always the selected expression. Maybe there exists something similar which can take an input string.
Related 3: One of the probably biggest resource of information can be found in package
$InstallationDirectory/AddOns/Applications/DocumentationSearch
This seems to contain the functions and helpers which are actually used in the Documentation Center. See for instance what
DocumentationSearch`SearchDocumentation["Graphics"]
gives.