Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201105173854-bc9fc8d8c4bc / present / caption.go
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package present
6
7 import "strings"
8
9 func init() {
10         Register("caption", parseCaption)
11 }
12
13 type Caption struct {
14         Cmd  string // original command from present source
15         Text string
16 }
17
18 func (c Caption) PresentCmd() string   { return c.Cmd }
19 func (c Caption) TemplateName() string { return "caption" }
20
21 func parseCaption(_ *Context, _ string, _ int, text string) (Elem, error) {
22         text = strings.TrimSpace(strings.TrimPrefix(text, ".caption"))
23         return Caption{text, text}, nil
24 }