puck

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

README

puck

Puck is an artificial spirit from Re:Zero that Emilia was formerly contracted with.

Seems very reasonable to have puck as the sub-package of emilia, which provides all sorts of constants and hard static values.

Documentation

Index

Constants

View Source
const (
	// ExtensionOrgmode is the extension of orgmode files.
	ExtensionOrgmode = ".org"
	// ExtensionMarkdown is the extension of markdown files.
	ExtensionMarkdown = ".md"
	// ExtensionHtml is the extension of html files.
	ExtensionHtml = ".html"

	// DefaultPreviewFile is the name of the file where the preview of the gallery is stored.
	DefaultPreviewFile = "preview.png"

	// DefaultVendorDirectory is the name of the dir where vendor images are stored.
	DefaultVendorDirectory yunyun.RelativePathDir = "darkness_vendor"
	// DefaultPreviewDirectory is the name of the dir where all gallery previews are stored.
	DefaultPreviewDirectory yunyun.RelativePathDir = "darkness_gallery_previews"

	// DefaultPreviewWidth is the default width of the gallery preview.
	PagePreviewWidth = 1200

	// DefaultPreviewHeight is the default height of the gallery preview.
	PagePreviewHeight = 700

	// LastBuildTimestampFile is where we write the RFC3339 of last build.
	LastBuildTimestampFile = "last_built.txt"
)
View Source
const (
	// DebugLevel is the debug level.
	DebugLevel l.Level = iota - 1
	// InfoLevel is the info level.
	InfoLevel
	// WarnLevel is the warn level.
	WarnLevel
	// ErrorLevel is the error level.
	ErrorLevel
	// FatalLevel is the fatal level.
	FatalLevel
)

Variables

View Source
var (
	// PagePreviewWidthString is the string representation of PagePreviewWidth.
	PagePreviewWidthString = strconv.Itoa(PagePreviewWidth)

	// PagePreviewHeightString is the string representation of PagePreviewHeight.
	PagePreviewHeightString = strconv.Itoa(PagePreviewHeight)
)
View Source
var (
	HEregex              = regexp.MustCompile(`(?P<day>\d+);\s*(?P<year>\d+)\s*H.E.\s*(?P<hour_minute>[0-9]{4})?`)
	HERegexSubmatchNames = HEregex.SubexpNames()
)

HEregex is a regex for matching Holoscene times

View Source
var Logger = NewLogger("Darkness 🥬 ")

Logger is darkness' logger.

Functions

func NewLogger

func NewLogger(prefix string, levels ...l.Level) *l.Logger

NewLogger returns a new logger with the given prefix.

func Stopwatch

func Stopwatch(msg any, msgs ...any) interface {
	Record(...*l.Logger) time.Duration
	RecordWithFile(func(yunyun.FullPathFile, time.Duration), yunyun.FullPathFile, ...*l.Logger) time.Duration
}

Stopwatch is a simple stopwatch that can be used to time operations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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