Sourcetext of the code to run.
sourcetext : String
A custom piece of code that is run on the editor client.
The editor can use the Lean.Widget.getWidgetSource
RPC method to
get this object.
See the manual entry above this declaration for more information on how to use the widgets system.
Instances For
Equations
- Lean.Widget.instInhabitedWidgetSource = { default := { sourcetext := default } }
Equations
Equations
- Lean.Widget.instFromJsonWidgetSource = { fromJson? := Lean.Widget.fromJsonWidgetSource✝ }
Pretty name of user widget to display to the user.
name : StringAn ESmodule that exports a react component to render.
javascript : String
Use this structure and the @[widget]
attribute to define your own widgets.
@[widget]
def rubiks : UserWidgetDefinition :=
{ name := "Rubiks cube app"
javascript := include_str ...
}
Instances For
Equations
- Lean.Widget.instInhabitedUserWidgetDefinition = { default := { name := default, javascript := default } }
Equations
- Lean.Widget.instInhabitedUserWidget = { default := { id := default, name := default, javascriptHash := default } }
Equations
- Lean.Widget.instToJsonUserWidget = { toJson := Lean.Widget.toJsonUserWidget✝ }
Equations
- Lean.Widget.instFromJsonUserWidget = { fromJson? := Lean.Widget.fromJsonUserWidget✝ }
The hash of the sourcetext to retrieve.
hash : UInt64- pos : Lean.Lsp.Position
Input for getWidgetSource
RPC.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Try to retrieve the UserWidgetInfo
at a particular position.
Equations
- One or more equations did not get rendered due to their size.
Arguments to be fed to the widget's main component.
props : Lean.JsonThe location of the widget instance in the Lean file.
range? : Option Lean.Lsp.Range
UserWidget accompanied by component props.
Instances For
Get the UserWidget
s present at a particular position.
Equations
- One or more equations did not get rendered due to their size.
Save a user-widget instance to the infotree.
The given widgetId
should be the declaration name of the widget definition.
Equations
- Lean.Widget.saveWidgetInfo widgetId props stx = let info := Lean.Elab.Info.ofUserWidgetInfo { stx := stx, widgetId := widgetId, props := props }; Lean.Elab.pushInfoLeaf info
Widget command #
Use #widget
to display a widget. Useful for debugging widgets.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.