preferences

package
v0.0.0-...-e4d9806 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package preferences provides a struct with methods to get some user preferences values. They can come from the user's model or from the session.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pair

type Pair struct {
	Value string
	Class string
}

Pair holds a value and class name pair.

type Preferences

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

Preferences contains the user preferences after initilization.

func New

func New(user *users.User, session *sessions.Session) *Preferences

New returns a new Preferences instance. It computes the values for each preference at this moment.

func (*Preferences) BookmarkListLayout

func (p *Preferences) BookmarkListLayout() Pair

BookmarkListLayout returns the bookmark list layout.

func (*Preferences) FontList

func (p *Preferences) FontList() [][2]string

FontList returns the available font faces.

func (*Preferences) FontSizes

func (p *Preferences) FontSizes() []string

FontSizes returns the available sizes.

func (*Preferences) LineHeights

func (p *Preferences) LineHeights() []string

LineHeights returns the available line heights.

func (*Preferences) ReaderFont

func (p *Preferences) ReaderFont() Pair

ReaderFont returns the user's reader font.

func (*Preferences) ReaderFontSize

func (p *Preferences) ReaderFontSize() Pair

ReaderFontSize returns the user's reader font size.

func (*Preferences) ReaderLineHeight

func (p *Preferences) ReaderLineHeight() Pair

ReaderLineHeight returns the user's reader line height.

Jump to

Keyboard shortcuts

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