matchtemplate

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchTemplate

type MatchTemplate struct {
	// contains filtered or unexported fields
}

MatchTemplate contains a list of input filenames and a template. The matches are filesnames representing which input files the template could be applied onto. Only the most specific template should be applied to each input file. Most specific means templates are sorted from least matches to most and the "top" template for each file is applied.

type MatchedTemplates

type MatchedTemplates []MatchTemplate

MatchedTemplates is a list of matchTemplates.

func (*MatchedTemplates) Lookup

func (m *MatchedTemplates) Lookup(name string) *template.Template

Lookup returns the most appropriate template for an input file. Check each template for matches. Return the first matching template.

func (*MatchedTemplates) Parse

func (m *MatchedTemplates) Parse(opts *options.Opts) error

Parse the command line template selection into matchedTemplates. The args slice should contain an even number of elements in the form: "pattern,/path/to/template"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL