6 Expandable Snip
An expandable snip allows the user to toggle between two
views—“open” and “closed”—implemented by two text
editors. Typically the closed view is a concise summary and the open
view contains more detailed information. The syntax browser snip is an
example of an expandable snip.
The open/close-callback is called when the snip state is
toggled. It is called with the expandable snip object and a boolean
that indicates whether the new state is open.
In closed mode, the toggle arrow and closed-editor are
displayed adjacent on a single line. In open mode, the layout is
controlled by the layout argument as follows:
'append — The first line is unchanged (that is, it
contains both toggle arrow and closed-editor), and
open-editor is displayed on the second line.
'replace — The toggle arrow and the
open-editor are displayed on a single line. The
closed-editor is not displayed.
Get the editor for the open mode.
Gets the editor for the closed mode.