Documentation ¶
Index ¶
Constants ¶
View Source
const ( DfltTexTemplateExt string = ".tmpl" DfltTexTemplateDir string = "tmpl" DfltTexTemplateMain string = "master.tmpl" DfltTexCommand string = "pdflatex" )
Default TeXGraph parameter values.
Variables ¶
View Source
var (
DfltTeXTemplateDelims = []string{"__{", "}__"}
)
View Source
var DfltTeXTemplates embed.FS
View Source
var ( ErrBadGrapher = fmt.Errorf( "bad grapher, available graphers are: %q", common.MapKeys(GrapherFactories)) )
View Source
var GrapherFactories = map[string]GrapherFactory{
"tex": newTeXGrapher,
}
GrapherFactories maps Format type tags to FormatReaders.
Functions ¶
Types ¶
type Config ¶
type Config struct { // GrapherType is the graphing program name. GrapherType string `yaml:"type"` // Graphs is list of graph specifications. Graphs []yaml.Node `yaml:"graphs"` }
type GrapherFactory ¶
type TeXGrapher ¶
type TeXGrapher struct { // Name is the graph handle. Name string `yaml:"name"` // Directory is an output directory for all files. If it is an empty string, // the current working directory is used. The path is created recursively // if it does not exist. Directory string `yaml:"directory"` Axes []TexAxis `yaml:"axes"` // TableFile is the path to the data file, usually a CSV file, // used for creating the graph. // It is propagated to all child TeXTables, if they do not // have a TableFile defined locally. TableFile string `yaml:"table_file"` // TemplateDir is the path to the directory which contains // the graph file templates. TemplateDir string `yaml:"template_directory"` // TemplateMain is the file name of the main (root) template. TemplateMain string `yaml:"template_main"` // TemplateDelims are the Go template control structure delimiters. TemplateDelims []string `yaml:"template_delims"` // TeXCommand is the name of the binary which is used to generate // the graph from graph files. TeXCommand string `yaml:"tex_command"` TemplatePattern string `yaml:"-"` Templates fs.FS `yaml:"-"` Spec *yaml.Node `yaml:"-"` }
func (*TeXGrapher) Generate ¶
func (g *TeXGrapher) Generate() error
Generate generates graphs from graph files.
func (*TeXGrapher) Write ¶
func (g *TeXGrapher) Write() error
Write writes the graph files from templates.
Click to show internal directories.
Click to hide internal directories.