kpath

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package kpath provides tools to locate TeX related files.

It loosely mimicks Kpathsea, as described in:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

Context holds state to efficiently search for files in a TDS (TeX Directory Structure), as described in:

func New added in v0.3.0

func New() Context

New returns a minimal kpath context initialized with the content of a minimal TeX Directory Structure.

func NewFromDB

func NewFromDB(r io.Reader) (Context, error)

NewFromDB creates a kpath search from a TeX ls-R db file.

func NewFromFS added in v0.3.0

func NewFromFS(fsys fs.FS) (Context, error)

NewFromFS creates a kpath search context from the provided filesystem.

NewFromFS checks first whether an ls-R database exists at the root of the provided filesystem, and otherwise walks the whole fs.

func (Context) FS added in v0.3.0

func (ctx Context) FS() fs.FS

FS returns the underlying filesystem this context is using.

func (Context) Find

func (ctx Context) Find(name string) (string, error)

Find returns the full path to the named file if it could be found within the TeXMF distribution system. Find returns an error if no file or more than one file were found.

func (Context) FindAll

func (ctx Context) FindAll(name string) ([]string, error)

FindAll returns the full path to all the files matching name that could be found within the TeXMF distribution system. Find returns an error if no file was found.

func (Context) Open added in v0.3.0

func (ctx Context) Open(name string) (fs.File, error)

Open opens the named file for reading.

Jump to

Keyboard shortcuts

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