forked from robertkrimen/godocdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.template
40 lines (26 loc) · 1.46 KB
/
example.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Example godocdown (strings)
This markdown was generated with the help of custom template file ([example.template](http://github.com/robertkrimen/godocdown/blob/master/example.template)). To add custom
markdown to your documentation, you can do something like:
godocdown -template=godocdown.tmpl ...
The template format is the standard Go text/template: http://golang.org/pkg/text/template
Along with the standard template functionality, the starting data argument has the following interface:
{{ "{{ .Emit }}" }}
// Emit the standard documentation (what godocdown would emit without a template)
{{ "{{ .EmitHeader }}" }}
// Emit the package name and an import line (if one is present/needed)
{{ "{{ .EmitSynopsis }}" }}
// Emit the package declaration
{{ "{{ .EmitUsage }}" }}
// Emit package usage, which includes a constants section, a variables section,
// a functions section, and a types section. In addition, each type may have its own constant,
// variable, and/or function/method listing.
{{ "{{ if .IsCommand }} ... {{ end }}" }}
// A boolean indicating whether the given package is a command or a plain package
{{ "{{ .Name }}" }}
// The name of the package/command (string)
{{ "{{ .ImportPath }}" }}
// The import path for the package (string)
// (This field will be the empty string if godocdown is unable to guess it)
godocdown for the http://golang.org/pkg/strings package:
--
{{ .Emit }}