Documentation ¶
Overview ¶
Some extended parser.Expr that are useful to the editor
Index ¶
- Constants
- Variables
- func GetVanillaString(cmd parser.LatexCmd) string
- func JoinHorizontal(baseline []int, strs ...string) string
- type Cursor
- type LatexCmdInput
- type LatexSourceConfig
- type Renderer
- func (r *Renderer) DrawToBuffer(tree parser.Expr)
- func (r *Renderer) Load(tree parser.FlexContainer)
- func (r *Renderer) Prerender(node parser.Expr) (out string, baseLevel int)
- func (r *Renderer) PrerenderCmdContainer(node parser.CmdContainer, x int, y int) (output string, baseLine int)
- func (r *Renderer) PrerenderCmdFrac(node parser.CmdContainer) (output string, newBaseLevel int)
- func (r *Renderer) PrerenderCmdOverline(node parser.CmdContainer) (output string, baseLevel int)
- func (r *Renderer) PrerenderCmdSqrt(node parser.CmdContainer) (output string, baseLevel int)
- func (r *Renderer) PrerenderCmdUnderline(node parser.CmdContainer) (output string, baseLevel int)
- func (r *Renderer) PrerenderFlexContainer(node parser.FlexContainer) (output string, baseLine int)
- func (r *Renderer) Sync(focus parser.Container, selected bool)
- func (r *Renderer) View() string
Constants ¶
View Source
const (
CONF_RENDER_EMPTY_COMP_EXPR = true // config to enable rendering empty CompositeExpr "{}" as a space
)
Variables ¶
View Source
var VanillaToUnicode = map[parser.LatexCmd]string{}/* 388 elements not displayed */
Functions ¶
func GetVanillaString ¶
func JoinHorizontal ¶
Types ¶
type Cursor ¶
type Cursor struct {
Symbol string // appearance of the cursor
}
the Cursor object implements a zero-width parser.Literal TODO rn its still a normal character
func (*Cursor) VisualizeTree ¶
type LatexCmdInput ¶
type LatexCmdInput struct {
Text *parser.TextStringWrapper
}
func (*LatexCmdInput) Children ¶
func (x *LatexCmdInput) Children() []parser.Expr
func (*LatexCmdInput) End ¶
func (x *LatexCmdInput) End() parser.Pos
func (*LatexCmdInput) Parameters ¶
func (x *LatexCmdInput) Parameters() int
func (*LatexCmdInput) Pos ¶
func (x *LatexCmdInput) Pos() parser.Pos
func (*LatexCmdInput) VisualizeTree ¶
func (x *LatexCmdInput) VisualizeTree() string
type LatexSourceConfig ¶
type LatexSourceConfig struct {
UseUnicode bool
}
func (*LatexSourceConfig) ProduceLatex ¶
func (cfg *LatexSourceConfig) ProduceLatex(node parser.Expr) string
possible optimisation: pass the strings.Builder object by reference into the recursive function to avoid multiple Builder instances. Then returning string is no longer needed, we just use the original Builder to get the string instead
type Renderer ¶
type Renderer struct { Buffer string LatexTree parser.FlexContainer FocusOn parser.Container // the container in which the cursor is, a better implementation would be letting Render functions return a 'focused' flag when cursor is found HasSelection bool // whether there is a selection in FocusOn Focus bool // whether the widget itself is focused }
func FromFormula ¶
func (*Renderer) DrawToBuffer ¶
func (*Renderer) Load ¶
func (r *Renderer) Load(tree parser.FlexContainer)
func (*Renderer) PrerenderCmdContainer ¶
func (r *Renderer) PrerenderCmdContainer(node parser.CmdContainer, x int, y int) (output string, baseLine int)
TODO remove
func (*Renderer) PrerenderCmdFrac ¶
func (r *Renderer) PrerenderCmdFrac(node parser.CmdContainer) (output string, newBaseLevel int)
func (*Renderer) PrerenderCmdOverline ¶
func (r *Renderer) PrerenderCmdOverline(node parser.CmdContainer) (output string, baseLevel int)
func (*Renderer) PrerenderCmdSqrt ¶
func (r *Renderer) PrerenderCmdSqrt(node parser.CmdContainer) (output string, baseLevel int)
func (*Renderer) PrerenderCmdUnderline ¶
func (r *Renderer) PrerenderCmdUnderline(node parser.CmdContainer) (output string, baseLevel int)
func (*Renderer) PrerenderFlexContainer ¶
func (r *Renderer) PrerenderFlexContainer(node parser.FlexContainer) (output string, baseLine int)
Click to show internal directories.
Click to hide internal directories.