tidbit

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package tidbit offers hyperlinked historical information about the Scene releasers and groups.

Index

Constants

View Source
const Dir = "public/md/tidbit" // Dir is the relative directory of the markdown files.

Variables

This section is empty.

Functions

func Missing added in v1.11.3

func Missing(uri string) bool

Missing returns true if no tidbit IDs exist for the given URI.

The ID returned can be used in a string conversion to get the description. The ID can also be used to get the URIs of the tidbit.

func Startup added in v1.14.0

func Startup(ctx context.Context, sl *slog.Logger, db *sql.DB)

Startup compares the URIs used in the Tidbits against those stored in the database. Any URIs not found are assumed to be typos, requiring fixing and are logged with a warning.

Types

type ID

type ID int

ID is the identifier of the tidbit.

func Find

func Find(uri string) []ID

Find returns the tidbit IDs for the given URI.

The ID returned can be used in a string conversion to get the description. The ID can also be used to get the URIs of the tidbit.

func (ID) Markdown added in v1.7.4

func (id ID) Markdown(sl *slog.Logger, fsys fs.FS, dir string) []byte

Markdown returns the markdown content of the tidbit that is stored in the directory in the provided file system. If the file does not exist or is empty then nil is returned.

Generally the String method should be used to get the description of the tidbit instead of this Markdown method.

func (ID) String

func (id ID) String(sl *slog.Logger, fsys fs.FS) string

String returns the tidbit description that is stored as a markdown file in the provided file system.

func (ID) URI

func (id ID) URI() []URI

URI returns the URIs of the tidbit.

func (ID) URL

func (id ID) URL(uri string) template.HTML

URL returns the HTML links of the tidbit but the provided URI is excluded.

type Tibits

type Tibits map[ID][]URI

Tibits is a map of tidbits mapped to their URIs.

func Copy added in v1.14.0

func Copy() Tibits

Copy returns a copy of the tidbits index.

type Tidbit

type Tidbit map[ID]string

Tidbit is a map of tidbits mapped to their descriptions.

type URI

type URI string

URI is the URL slug of the releaser.

Jump to

Keyboard shortcuts

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