// TemplateTree returns a tree of all templates
183323
func (r *Store) TemplateTree(ctx context.Context) (tree.Tree, error) {
	root := simple.New("gopass")

	for _, t := range r.store.ListTemplates(ctx, "") {
		out.Debug(ctx, "[<root>] Adding template %s", t)
		if err := root.AddFile(t, "gopass/template"); err != nil {
			out.Error(ctx, "Failed to add file to tree: %s", err)
		}
	}

	mps := r.MountPoints()
	sort.Sort(store.ByPathLen(mps))
	for _, alias := range mps {
		substore := r.mounts[alias]
		if substore == nil {
			continue
		}
		if err := root.AddMount(alias, substore.Path()); err != nil {
			return nil, errors.Errorf("failed to add mount: %s", err)
		}
		for _, t := range substore.ListTemplates(ctx, alias) {
			out.Debug(ctx, "[%s] Adding template %s", alias, t)
			if err := root.AddFile(t, "gopass/template"); err != nil {
				out.Error(ctx, "Failed to add file to tree: %s", err)
			}
		}
	}

	return root, nil
}
929816
func (t *Template) copy(c *common) *Template {
	nt := New(t.name)
	nt.Tree = t.Tree
	nt.common = c
	nt.leftDelim = t.leftDelim
	nt.rightDelim = t.rightDelim
	return nt
}
1268464
func templateBaseName(typ templateType, name string) string {
	name = strings.TrimPrefix(name, internalPathPrefix)
	switch typ {
	case templateShortcode:
		return strings.TrimPrefix(name, shortcodesPathPrefix)
	default:
		panic("not implemented")
	}

}
881497
func NewTemplate() *Template {
	return &Template{
		AWSTemplateFormatVersion: "2010-09-09",
		Mappings:                 map[string]*Mapping{},
		Parameters:               map[string]*Parameter{},
		Resources:                map[string]*Resource{},
		Outputs:                  map[string]*Output{},
		Conditions:               map[string]interface{}{},
	}
}
880432
func (s *Action) TemplatesComplete(ctx context.Context, c *cli.Context) {
	tree, err := s.Store.TemplateTree(ctx)
	if err != nil {
		fmt.Fprintln(stdout, err)
		return
	}

	for _, v := range tree.List(0) {
		fmt.Fprintln(stdout, v)
	}
}
770537
func Template() (c *TemplateController) {
	return &TemplateController{
		List:   templateList,
		New:    templateNew,
		Create: templateCreate,
		Edit:   templateEdit,
		Update: templateUpdate,
		Delete: templateDelete,
	}
}
334498
func Convert_v1_TemplateList_To_template_TemplateList(in *v1.TemplateList, out *template.TemplateList, s conversion.Scope) error {
	return autoConvert_v1_TemplateList_To_template_TemplateList(in, out, s)
}
129437
func (t *TemplateAdapter) Tree() string {
	var tree *parse.Tree
	switch tt := t.Template.(type) {
	case *template.Template:
		tree = tt.Tree
	case *texttemplate.Template:
		tree = tt.Tree
	default:
		panic("Unknown template")
	}

	if tree == nil || tree.Root == nil {
		return ""
	}
	s := tree.Root.String()

	return s
}
82611
func (m *MockIndex) Templates(arg0 template.CSS, arg1 template0.FuncMap) {
	m.ctrl.T.Helper()
	m.ctrl.Call(m, "Templates", arg0, arg1)
}
605897
func compileTemplate(p, base string) error {
	ext := path.Ext(p)
	c, ok := compilers[ext]
	// Ignore file if no template compiler exist for this extension
	if ok {
		t, err := c.Compile(p)
		if err != nil {
			return err
		}
		key, err := filepath.Rel(base, p)
		if err != nil {
			return err
		}
		ghost.LogFn("ghost.templates : storing template for file %s", key)
		templaters[key] = t
	}
	return nil
}
1273552
func (c *Compiler) CompileWithTemplate(t *template.Template) (*template.Template, error) {
	data, err := c.CompileString()

	if err != nil {
		return nil, err
	}

	tpl, err := t.Funcs(FuncMap).Parse(data)

	if err != nil {
		return nil, err
	}

	return tpl, nil
}
131249
func (r *Registry) Template(name string) (Template, bool) {
	for _, t := range r.Templates {
		if t.Node.Name == name {
			return t, true
		}
	}
	return Template{}, false
}
322986
func PrintTree(tree *ImmutableTree) {
	ndb, root := tree.ndb, tree.root
	printNode(ndb, root, 0)
}
163035
func (c *Clientset) Template() templateinternalversion.TemplateInterface {
	return &faketemplateinternalversion.FakeTemplate{Fake: &c.Fake}
}
635697
func NewTree(v interface{}, duplicates bool) Tree {
	return &tree{
		container: newNodeContainer(justValue{v}, duplicates),
	}
}
1027198
func (a *ArgType) TemplateLoader(name string) ([]byte, error) {
	// no template path specified
	if a.TemplatePath == "" {
		return templates.Asset(name)
	}

	return ioutil.ReadFile(path.Join(a.TemplatePath, name))
}
1253985
func Template(p Partial) string {
	
	qb422016 := qt422016.AcquireByteBuffer()
	
	WriteTemplate(qb422016, p)
	
	qs422016 := string(qb422016.B)
	
	qt422016.ReleaseByteBuffer(qb422016)
	
	return qs422016


}