templates

package
v0.0.0-...-9b07064 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEmptyDocx

func GetEmptyDocx() ([]byte, error)

GetEmptyDocx returns a minimal valid .docx file that OnlyOffice can edit

func GetEmptyPptx

func GetEmptyPptx() ([]byte, error)

GetEmptyPptx returns a minimal valid .pptx file that OnlyOffice can edit

func GetEmptyXlsx

func GetEmptyXlsx() ([]byte, error)

GetEmptyXlsx returns a minimal valid .xlsx file that OnlyOffice can edit

func GetTemplateForExtension

func GetTemplateForExtension(ext string) ([]byte, error)

GetTemplateForExtension returns the appropriate template for a file extension Returns nil, nil if no template is needed (file can be empty)

func Render

func Render(w io.Writer, name string, data interface{}) error

Render executes the named page template with data, rendering through the base layout. The template is invoked via the "base" block defined in base.html.

func RenderString

func RenderString(name string, data interface{}) (string, error)

RenderString is like Render but returns the result as a string.

Types

type LoginSuccessData

type LoginSuccessData struct {
	ReturnURL string
}

LoginSuccessData holds data for login_success.html

type OnlyOfficeData

type OnlyOfficeData struct {
	Filename   string
	APIJSURL   string
	ConfigJSON template.JS // raw JSON for JS config, trusted
}

OnlyOfficeData holds data for onlyoffice_editor.html

Jump to

Keyboard shortcuts

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