tex

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Mark = "%!texd"

Mark is used to help identifying the main input file from a list of potential candidates. This is a last resort measurement, clients should specify main files explicitly.

Variables

View Source
var (
	DefaultEngine = engines[0]
)
View Source
var ForbiddenFiles = []string{

	"latexmkrc", ".latexmkrc",
}

ForbiddenFiles is a list of file names which are not allowed for security reasons.

View Source
var LatexmkDefaultFlags = []string{
	"-cd",
	"-silent",
	"-pv-", "-pvc-",
}

Functions

func CompilationError

func CompilationError(message string, cause error, extra KV) error

func InputError

func InputError(message string, cause error, extra KV) error

func QueueError

func QueueError(message string, cause error, extra KV) error

func SetDefaultEngine

func SetDefaultEngine(name string) error

func SetJobBaseDir

func SetJobBaseDir(dir string) error

SetJobBaseDir will update the working directory for texd. If dir is empty, texd will fallback to os.TempDir(). The directory must exist, and it must be writable, otherwise a non-nil error is returned.

func SupportedEngines

func SupportedEngines() (e []string)

func UnknownError

func UnknownError(message string, cause error, extra KV) error

Types

type Document

type Document interface {
	WorkingDirectory() (string, error)
	AddFile(name, contents string) error
	AddFiles(req *http.Request) error
	Cleanup() error
	Image() string
	Engine() Engine
	SetMainInput(string) error
	MainInput() (string, error)
	GetResult() (io.ReadCloser, error)
	GetLogs() (io.ReadCloser, error)
}

func NewDocument

func NewDocument(engine Engine, image string) Document

type Engine

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

func NewEngine

func NewEngine(name string, latexmkFlags ...string) Engine

func ParseEngine

func ParseEngine(name string) (Engine, error)

func (Engine) Flags

func (e Engine) Flags() []string

func (Engine) LatexmkCmd

func (engine Engine) LatexmkCmd(main string) []string

latexmk builds a command line for latexmk invocation.

func (Engine) Name

func (e Engine) Name() string

func (Engine) String

func (e Engine) String() string

type ErrInvalidWorkDir

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

func (*ErrInvalidWorkDir) Error

func (err *ErrInvalidWorkDir) Error() string

func (*ErrInvalidWorkDir) Unwrap

func (err *ErrInvalidWorkDir) Unwrap() error

type ErrUnsupportedEngine

type ErrUnsupportedEngine string

func (ErrUnsupportedEngine) Error

func (err ErrUnsupportedEngine) Error() string

type ErrWithCategory

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

func (*ErrWithCategory) Error

func (err *ErrWithCategory) Error() string

func (*ErrWithCategory) MarshalJSON

func (err *ErrWithCategory) MarshalJSON() ([]byte, error)

func (*ErrWithCategory) Unwrap

func (err *ErrWithCategory) Unwrap() error

type File

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

type KV

type KV map[string]interface{}

Jump to

Keyboard shortcuts

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