markdown

package
v1.0.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2021 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ListKeys = map[string]struct{}{"*": {}, "+": {}, "-": {}}

List keywords (for indent)

View Source
var TheMarkdownLang = MarkdownLang{}

TheMarkdownLang is the instance variable providing support for the Markdown language

Functions

This section is empty.

Types

type MarkdownLang

type MarkdownLang struct {
	Pr   *pi.Parser
	Bibs bibtex.Files `desc:"bibliography files that have been loaded, keyed by file path from bibfile metadata stored in filestate"`
}

MarkdownLang implements the Lang interface for the Markdown language

func (*MarkdownLang) AutoBracket added in v0.9.15

func (ml *MarkdownLang) AutoBracket(fs *pi.FileStates, bra rune, pos lex.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 (*MarkdownLang) CompleteCite added in v1.0.0

func (ml *MarkdownLang) CompleteCite(fss *pi.FileStates, origStr, str string, pos lex.Pos) (md complete.Matches)

CompleteCite does completion on citation

func (*MarkdownLang) CompleteEdit

func (ml *MarkdownLang) CompleteEdit(fs *pi.FileStates, text string, cp int, comp complete.Completion, seed string) (ed complete.Edit)

func (*MarkdownLang) CompleteLine

func (ml *MarkdownLang) CompleteLine(fss *pi.FileStates, str string, pos lex.Pos) (md complete.Matches)

func (*MarkdownLang) FindBibliography added in v1.0.0

func (ml *MarkdownLang) FindBibliography(pfs *pi.FileState) string

FindBibliography looks for yaml metadata at top of markdown file

func (*MarkdownLang) HiLine

func (ml *MarkdownLang) HiLine(fss *pi.FileStates, line int, txt []rune) lex.Line

func (*MarkdownLang) IndentLine added in v0.9.15

func (ml *MarkdownLang) IndentLine(fs *pi.FileStates, src [][]rune, tags []lex.Line, ln int, tabSz int) (pInd, delInd, pLn int, ichr indent.Char)

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 lex.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 (*MarkdownLang) LexLine

func (ml *MarkdownLang) LexLine(fs *pi.FileState, line int, txt []rune) lex.Line

func (*MarkdownLang) Lookup added in v0.9.11

func (ml *MarkdownLang) Lookup(fss *pi.FileStates, str string, pos lex.Pos) (ld complete.Lookup)

Lookup is the main api called by completion code in giv/complete.go to lookup item

func (*MarkdownLang) LookupCite added in v1.0.0

func (ml *MarkdownLang) LookupCite(fss *pi.FileStates, origStr, str string, pos lex.Pos) (ld complete.Lookup)

LookupCite does lookup on citation

func (*MarkdownLang) OpenBibfile added in v1.0.0

func (ml *MarkdownLang) OpenBibfile(fss *pi.FileStates, pfs *pi.FileState) error

OpenBibfile attempts to find the bibliography file, and load it. Sets meta data "bibfile" to resulting file if found, and deletes it if not.

func (*MarkdownLang) ParseDir

func (ml *MarkdownLang) ParseDir(fs *pi.FileState, path string, opts pi.LangDirOpts) *syms.Symbol

func (*MarkdownLang) ParseFile

func (ml *MarkdownLang) ParseFile(fss *pi.FileStates, txt []byte)

func (*MarkdownLang) ParseLine

func (ml *MarkdownLang) ParseLine(fs *pi.FileState, line int) *pi.FileState

func (*MarkdownLang) Parser

func (ml *MarkdownLang) Parser() *pi.Parser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL