Debian Codegraph @

readme-template/package.txt

raw
1 {{with .PAst}}{{node $ .}}{{end}}{{/*
2
3 ---------------------------------------
4
5 */}}{{with .PDoc}}{{if $.IsMain}}COMMAND DOCUMENTATION
6
7 {{comment_text .Doc " " "\t"}}
8 {{else}}# {{.Name}}
9
10 ## Description ##
11
12 {{comment_text .Doc " " "\t"}}
13
14 ## Documentation ##
15
16 [http://godoc.org/{{.ImportPath}}](http://godoc.org/{{.ImportPath}})
17
18 ## Import ##
19
20 import "{{.ImportPath}}"
21
22 ## Usage ##
23
24 ### open google.com in the user's default browser (method 1):
25
26 open.Run("https://google.com/")
27
28 ### open google.com in the user's default browser (method 2):
29
30 open.Start("https://google.com")
31
32 ### you can listen for errors
33
34 err := open.Run("https://google.com/")
35
36 ### you can specify the program to use
37
38 open.RunWith("https://google.com/", "firefox")
39
40 {{example_text $ "" " "}}{{/*
41
42 ---------------------------------------
43
44 */}}{{with .Consts}}
45 CONSTANTS
46
47 {{range .}}{{node $ .Decl}}
48 {{comment_text .Doc " " "\t"}}
49 {{end}}{{end}}{{/*
50
51 ---------------------------------------
52
53 */}}{{with .Vars}}
54 VARIABLES
55
56 {{range .}}{{node $ .Decl}}
57 {{comment_text .Doc " " "\t"}}
58 {{end}}{{end}}{{/*
59
60 ---------------------------------------
61
62 */}}{{with .Funcs}}
63 ## Functions ##
64
65 {{range .}}### {{node $ .Decl}}
66
67 {{comment_text .Doc " " "\t"}}
68 {{example_text $ .Name " "}}{{end}}{{end}}{{/*
69
70 ---------------------------------------
71
72 */}}{{with .Types}}
73 TYPES
74
75 {{range .}}{{$tname := .Name}}{{node $ .Decl}}
76 {{comment_text .Doc " " "\t"}}
77 {{range .Consts}}{{node $ .Decl}}
78 {{comment_text .Doc " " "\t"}}
79 {{end}}{{range .Vars}}{{node $ .Decl}}
80 {{comment_text .Doc " " "\t"}}
81 {{end}}{{example_text $ .Name " "}}
82 {{range .Funcs}}{{node $ .Decl}}
83 {{comment_text .Doc " " "\t"}}
84 {{example_text $ .Name " "}}
85 {{end}}{{range .Methods}}{{node $ .Decl}}
86 {{comment_text .Doc " " "\t"}}
87 {{$name := printf "%s_%s" $tname .Name}}{{example_text $ $name " "}}{{end}}
88 {{end}}{{end}}{{end}}{{/*
89
90 ---------------------------------------
91
92 */}}{{with $.Notes}}
93 {{range $marker, $content := .}}
94 {{$marker}}S
95
96 {{range $content}}{{comment_text .Body " " "\t"}}
97 {{end}}{{end}}{{end}}{{end}}{{/*
98
99 ---------------------------------------
100
101 */}}{{with .Dirs}}
102 SUBDIRECTORIES
103 {{if $.DirFlat}}{{range .List}}{{if .HasPkg}}
104 {{.Path}}{{end}}{{end}}
105 {{else}}{{range .List}}
106 {{repeat `. ` .Depth}}{{.Name}}{{end}}
107 {{end}}{{end}}
108 ## License ##
109
110 Copyright (c) 2013 skratchdot
111 Licensed under the MIT license.