utils

package
v0.0.0-...-60192f8 Latest Latest
Warning

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

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

Documentation

Overview

Package utils provides simple various utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShortText

func ShortText(s string, maxChars int) string

ShortText returns a string of maxChars maximum length. It attempts to cut between words when possible.

func ShortURL

func ShortURL(s string, maxChars int) string

ShortURL returns a string of maxChars maximum length where src is a URL. It attempts to nicely cut the path parts.

func Slug

func Slug(s string) string

Slug replaces each run of characters which are not unicode letters or numbers with a single hyphen, except for leading or trailing runes. Letters will be stripped of diacritical marks and lowercased. Letter or number codepoints that do not have combining marks or a lower-cased variant will be passed through unaltered.

Types

This section is empty.

Jump to

Keyboard shortcuts

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