| 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 presentscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/ |
| 6 | |
| 7 | import "stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/" |
| 8 | |
| 9 | func initscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/init().() { |
| 10 | Registerscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/Register().("caption", parseCaptionscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/parseCaption().) |
| 11 | } |
| 12 | |
| 13 | type Captionscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/Caption# struct { |
| 14 | Cmdscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/Caption#Cmd. string // original command from present source |
| 15 | Textscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/Caption#Text. string |
| 16 | } |
| 17 | |
| 18 | func (c Captionscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/Caption#) PresentCmdscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/Caption#PresentCmd().() string { return c.Cmdscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/Caption#Cmd. } |
| 19 | func (c Captionscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/Caption#) TemplateNamescip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/Caption#TemplateName().() string { return "caption" } |
| 20 | |
| 21 | func parseCaptionscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/parseCaption().(_ *Contextscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/Context#, _ string, _ int, cmd string) (Elemscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/Elem#, error) { |
| 22 | text := stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.TrimSpacescip-go gomod github.com/golang/go/src go1.25.0 strings/TrimSpace().(stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.TrimPrefixscip-go gomod github.com/golang/go/src go1.25.0 strings/TrimPrefix().(cmd, ".caption")) |
| 23 | return Captionscip-go gomod golang.org/x/tools . `golang.org/x/tools/present`/Caption#{cmd, text}, nil |
| 24 | } |