Documentation ¶
Index ¶
- Variables
- func HasCite(str string) bool
- type TexLang
- func (tl *TexLang) AutoBracket(fs *parse.FileStates, bra rune, pos lexer.Pos, curLn []rune) (match, newLine bool)
- func (tl *TexLang) CompleteCite(fss *parse.FileStates, origStr, str string, pos lexer.Pos) (md complete.Matches)
- func (tl *TexLang) CompleteEdit(fss *parse.FileStates, text string, cp int, comp complete.Completion, ...) (ed complete.Edit)
- func (tl *TexLang) CompleteLine(fss *parse.FileStates, str string, pos lexer.Pos) (md complete.Matches)
- func (tl *TexLang) FindBibliography(pfs *parse.FileState) string
- func (tl *TexLang) HiLine(fss *parse.FileStates, line int, txt []rune) lexer.Line
- func (tl *TexLang) IndentLine(fs *parse.FileStates, src [][]rune, tags []lexer.Line, ln int, tabSz int) (pInd, delInd, pLn int, ichr indent.Character)
- func (tl *TexLang) LexLine(fs *parse.FileState, line int, txt []rune) lexer.Line
- func (tl *TexLang) Lookup(fss *parse.FileStates, str string, pos lexer.Pos) (ld complete.Lookup)
- func (tl *TexLang) LookupCite(fss *parse.FileStates, origStr, str string, pos lexer.Pos) (ld complete.Lookup)
- func (tl *TexLang) OpenBibfile(fss *parse.FileStates, pfs *parse.FileState) error
- func (tl *TexLang) ParseDir(fs *parse.FileState, path string, opts parse.LangDirOpts) *syms.Symbol
- func (tl *TexLang) ParseFile(fss *parse.FileStates, txt []byte)
- func (tl *TexLang) ParseLine(fs *parse.FileState, line int) *parse.FileState
- func (tl *TexLang) Parser() *parse.Parser
Constants ¶
This section is empty.
Variables ¶
var CiteCommands = []string{`\cite`, `\citep`, `\citet`, `\citeNP`, `\citeyearpar`, `\citeyear`, `\citeauthor`, `\citeA`, `\citealp`, `\citeyearNP`, `\parencite`, `\textcite`, `\nptextcite`, `\incite`, `\nopcite`, `\yrcite`, `\yrnopcite`, `\abbrevcite`, `\abbrevincite`}
CiteCommands is a list of latex citation commands (APA style requires many variations). We include all the variations so they show up in completion.
var LaTeXCommands = []string{
`\em`,
`\emph`,
`\textbf`,
`\textit`,
`\texttt`,
`\textsf`,
`\textrm`,
`\tiny`,
`\scriptsize`,
`\footnotesize`,
`\small`,
`\normalsize`,
`\large`,
`\Large`,
`\LARGE`,
`\huge`,
`\Huge`,
`\begin`,
`\end`,
`enumerate`,
`itemize`,
`description`,
`\item`,
`figure`,
`table`,
`tabular`,
`array`,
`\hline`,
`\cline`,
`\multicolumn`,
`equation`,
`center`,
`\centering`,
`\verb`,
`verbatim`,
`quote`,
`\section`,
`\subsection`,
`\subsubsection`,
`\paragraph`,
}
LaTeXCommands is a big list of standard commands
var LaTeXCommandsAll []string
LaTeXCommandsAll concatenates LaTeXCmds and CiteCmds
var TheTexLang = TexLang{}
TheTexLang is the instance variable providing support for the Go language
Functions ¶
Types ¶
type TexLang ¶
type TexLang struct { Pr *parse.Parser // bibliography files that have been loaded, keyed by file path from bibfile metadata stored in filestate Bibs bibtex.Files }
TexLang implements the Lang interface for the Tex / LaTeX language
func (*TexLang) AutoBracket ¶
func (tl *TexLang) AutoBracket(fs *parse.FileStates, bra rune, pos lexer.Pos, curLn []rune) (match, newLine bool)
AutoBracket returns what to do when a user types a starting bracket character (bracket, brace, paren) while typing. pos = position where bra will be inserted, and curLn is the current line match = insert the matching ket, and newLine = insert a new line.
func (*TexLang) CompleteCite ¶
func (tl *TexLang) CompleteCite(fss *parse.FileStates, origStr, str string, pos lexer.Pos) (md complete.Matches)
CompleteCite does completion on citation
func (*TexLang) CompleteEdit ¶
func (tl *TexLang) CompleteEdit(fss *parse.FileStates, text string, cp int, comp complete.Completion, seed string) (ed complete.Edit)
func (*TexLang) CompleteLine ¶
func (*TexLang) IndentLine ¶
func (tl *TexLang) IndentLine(fs *parse.FileStates, src [][]rune, tags []lexer.Line, ln int, tabSz int) (pInd, delInd, pLn int, ichr indent.Character)
IndentLine returns the indentation level for given line based on previous line's indentation level, and any delta change based on e.g., brackets starting or ending the previous or current line, or other language-specific keywords. See lexer.BracketIndentLine for example. Indent level is in increments of tabSz for spaces, and tabs for tabs. Operates on rune source with markup lex tags per line.
func (*TexLang) Lookup ¶
Lookup is the main api called by completion code in giv/complete.go to lookup item
func (*TexLang) LookupCite ¶
func (tl *TexLang) LookupCite(fss *parse.FileStates, origStr, str string, pos lexer.Pos) (ld complete.Lookup)
LookupCite does lookup on citation
func (*TexLang) OpenBibfile ¶
OpenBibfile attempts to open the /bibliography file. Sets meta data "bibfile" to resulting file if found, and deletes it if not.