Documentation ¶
Overview ¶
generate from go code to README
Index ¶
- Variables
- func ExistsFunc(fname string) bool
- func GlobFunc(fname string) []string
- func ImportFunc(fname string) string
- type Document
- func (d *Document) Description() string
- func (d *Document) Examples() []*Example
- func (d *Document) ImportPath() string
- func (d *Document) IsCommand() bool
- func (d *Document) Name() string
- func (d *Document) Synopsis() string
- func (d *Document) Usage() string
- func (d *Document) WriteTo(w io.Writer) error
- type Example
- type FuncMap
- type Template
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefualtFuncMap = FuncMap{ "import": ImportFunc, "exists": ExistsFunc, "glob": GlobFunc, }
Functions ¶
func ExistsFunc ¶
func ImportFunc ¶
Types ¶
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Example ¶
Document output
// read template templ := template.Must(template.ParseFiles("template.md")) d, err := NewDocument(".", templ) if err != nil { return } var buf bytes.Buffer err = d.WriteTo(&buf) if err != nil { return } fmt.Println(buf.String())
Output:
func (*Document) Description ¶
func (*Document) ImportPath ¶
Click to show internal directories.
Click to hide internal directories.