gotools/present/code.go

var PlayEnabled

var NotesEnabled

func init() {}

type Code

func (c Code) PresentCmd() string   {}

func (c Code) TemplateName() string {}

var highlightRE

var hlCommentRE

var codeRE

// parseCode parses a code present directive. Its syntax:
//
//	.code [-numbers] [-edit] <filename> [address] [highlight]
//
// The directive may also be ".play" if the snippet is executable.
func parseCode(ctx *Context, sourceFile string, sourceLine int, cmd string) (Elem, error) {}

// formatLines returns a new slice of codeLine with the given lines
// replacing tabs with spaces and adding highlighting where needed.
func formatLines(lines []codeLine, highlight string) []codeLine {}

// rawCode returns the code represented by the given codeLines without any kind
// of formatting.
func rawCode(lines []codeLine) []byte {}

type codeTemplateData

var leadingSpaceRE

var codeTemplate

const codeTemplateHTML

type codeLine

// codeLines takes a source file and returns the lines that
// span the byte range specified by start and end.
// It discards lines that end in "OMIT".
func codeLines(src []byte, start, end int) (lines []codeLine) {}

func parseArgs(name string, line int, args []string) (res []interface{}