Function Repository Resource:

InformationPopup

Source Notebook

Add a way to quickly access symbol information inline by displaying a popup

Contributed by: Lukas Lang

ResourceFunction["InformationPopup"]["InstallMenuItem"]

permanently adds a menu item to call up an inline symbol information popup.

ResourceFunction["InformationPopup"]["InstallMenuItem",MenuKey[]]

permanently adds the menu item with the specified hotkey.

ResourceFunction["InformationPopup"]["Palette"]

creates a palette with a button to call up the information popup.

ResourceFunction["InformationPopup"]["Remove"]

removes any permanently installed changes.

Details

The information popup created by ResourceFunction["InformationPopup"] is effectively based on the output of Information[sym], where sym is the currently selected symbol.
ResourceFunction["InformationPopup"] can be used to quickly look up information such as the attributes or usage of a symbol without needing to evaluate anything in a separate cell.
The cursor/selection needs to be within the symbol of interest, with the selection being expanded if only parts of the symbol name are selected.
ResourceFunction["InformationPopup"]["InstallMenuItem",] effectively installs a paclet named ResourceFunction["InformationPopup"].
The menu item can be removed again by using ResourceFunction["InformationPopup"]["Remove"], or by uninstalling the ResourceFunction["InformationPopup"] paclet manually.
In ResourceFunction["InformationPopup"]["InstallMenuItem",MenuKey[]], the MenuKey[] expression can be anything supported by the MenuSetup.tr system menu configuration file.
The menu item can be found in HelpDisplay Inline Information, with the default hotkey being +F1 on Windows and Linux, and ++F on macOS.
Typical settings for the menu item hotkey are of the form MenuKey["letter",Modifiers{mod1,}], where the modi are one of "Shift", "Control", "Command" and "Option".
ResourceFunction["InformationPopup"]["AddMenuItem",] can be used to add the menu item to the current front end session only.
ResourceFunction["InformationPopup"][] brings up the information popup for the selection in InputNotebook[], and can be used to call up the popup from custom buttons and menus.

Examples

Basic Examples (4) 

Install the menu item:

In[1]:=
ResourceFunction["InformationPopup"]["InstallMenuItem"]

Select a symbol, and select "Help > Display Inline Information" from the menu:

Use the keyboard shortcut +F1 (++F on macOS) to bring up the information popup:

Remove the menu item again (restart Mathematica for this to take effect):

In[2]:=
ResourceFunction["InformationPopup"]["Remove"]

Scope (3) 

Display information on a resource function:


Create a palette with a button to display the information popup:

In[3]:=
ResourceFunction["InformationPopup"]["Palette"]
Out[3]=

Press the button to bring up the information popup:


Temporarily add a menu item with the hotkey +X:

In[4]:=
ResourceFunction["InformationPopup"]["AddMenuItem", System`MenuKey["X", System`Modifiers -> {"Command"}]]

Publisher

Lukas Lang

Version History

  • 1.1.0 – 10 January 2023
  • 1.0.0 – 10 December 2020

Related Resources

Author Notes

Changes from version 1.0.0 to 1.1.0:

Fixed various issues with popup positioning & size in versions 12.3 and later

License Information