render

package
v0.0.0-...-876207e Latest Latest
Warning

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

Go to latest
Published: May 31, 2017 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookImage

type BookImage struct {
	Env  string
	Body string

	Alt      string
	CssClass string
	Style    string

	Image image.Image
	Type  BookImageType
}

type BookImageType

type BookImageType int
const (
	BookImageTypePNG BookImageType = iota
	BookImageTypeJPG
)

type Queue

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

Queue allows to run LaTeX and to convert the output into images.

func NewQueue

func NewQueue(resolution int) (*Queue, error)

NewQueue creates a new rendering queue for converting .tex files to images. The argument 'resolution' specifies the image resolution in pixels per inch.

func (*Queue) Finish

func (q *Queue) Finish() error

Finish must be called after the last rendering job has been submitted to the queue. The function waits until all rendered images have been delivered and then shuts down the queue.

func (*Queue) Submit

func (q *Queue) Submit(tmpl *template.Template, data interface{}) <-chan image.Image

Submit adds a new rendering job to the queue. As part of the job, the template tmpl is executed with the given data to obtain a TeX file. Pdflatex is run with this file as input, and Ghostscript is used to convert each page of output into an image. The resulting images can be read from the channel returned by .Submit().

Jump to

Keyboard shortcuts

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