server

package
v0.0.0-...-388471c Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePDF

func GeneratePDF(html string, w io.Writer)

GeneratePDF renders an html string to pdf and writes it out.

func GetTemplates

func GetTemplates() (map[string]ThermoTemplate, error)

GetTemplates returns a map containing the templates in the template directory.

func Print

func Print(html string, copies int)

Print renders the given html string and prints it on the "Thermodrucker"

func Run

func Run(port int, static *embed.FS)

Run starts the server on the specified port.

Types

type ThermoTemplate

type ThermoTemplate struct {
	Name      string
	Variables map[string]string // the used variables with an example value
	Template  string            // the cleaned template without the front matter
}

ThermoTemplate is the basic struct for saving templates.

Jump to

Keyboard shortcuts

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