gotools/present/parse.go

var parsers

var funcs

// Template returns an empty template with the action functions in its FuncMap.
func Template() *template.Template {}

// Render renders the doc to the given writer using the provided template.
func (d *Doc) Render(w io.Writer, t *template.Template) error {}

// Render renders the section to the given writer using the provided template.
func (s *Section) Render(w io.Writer, t *template.Template) error {}

type ParseFunc

// Register binds the named action, which does not begin with a period, to the
// specified parser to be invoked when the name, with a period, appears in the
// present input text.
func Register(name string, parser ParseFunc) {}

type Doc

type Author

// TextElem returns the first text elements of the author details.
// This is used to display the author' name, job title, and company
// without the contact details.
func (p *Author) TextElem() (elems []Elem) {}

type Section

// HTMLAttributes for the section
func (s Section) HTMLAttributes() template.HTMLAttr {}

// Sections contained within the section.
func (s Section) Sections() (sections []Section) {}

// Level returns the level of the given section.
// The document title is level 1, main section 2, etc.
func (s Section) Level() int {}

// FormattedNumber returns a string containing the concatenation of the
// numbers identifying a Section.
func (s Section) FormattedNumber() string {}

func (s Section) TemplateName() string {}

type Elem

// renderElem implements the elem template function, used to render
// sub-templates.
func renderElem(t *template.Template, e Elem) (template.HTML, error) {}

// pageNum derives a page number from a section.
func pageNum(s Section, offset int) int {}

func init() {}

// execTemplate is a helper to execute a template and return the output as a
// template.HTML value.
func execTemplate(t *template.Template, name string, data interface{}

type Text

func (t Text) TemplateName() string {}

type List

func (l List) TemplateName() string {}

type Lines

func readLines(r io.Reader) (*Lines, error) {}

func (l *Lines) next() (text string, ok bool) {}

func (l *Lines) back() {}

func (l *Lines) nextNonEmpty() (text string, ok bool) {}

type Context

type ParseMode

const TitlesOnly

// Parse parses a document from r.
func (ctx *Context) Parse(r io.Reader, name string, mode ParseMode) (*Doc, error) {}

// Parse parses a document from r. Parse reads assets used by the presentation
// from the file system using os.ReadFile.
func Parse(r io.Reader, name string, mode ParseMode) (*Doc, error) {}

var isHeadingLegacy

var isHeadingMarkdown

// lesserHeading returns true if text is a heading of a lesser or equal level
// than that denoted by prefix.
func lesserHeading(isHeading *regexp.Regexp, text, prefix string) bool {}

// parseSections parses Sections from lines for the section level indicated by
// number (a nil number indicates the top level).
func parseSections(ctx *Context, name, prefix string, lines *Lines, number []int) ([]Section, error) {}

func parseHeader(doc *Doc, isMarkdown bool, lines *Lines) error {}

func parseAuthors(name, sectionPrefix string, lines *Lines) (authors []Author, err error) {}

func parseAuthorURL(name, text string) Elem {}

func parseTime(text string) (t time.Time, ok bool) {}

func isSpeakerNote(s string) bool {}

func trimSpeakerNote(s string) string {}

func renderMarkdown(input []byte) (template.HTML, error) {}

func fixupMarkdown(n ast.Node) {}