printuser

package
v0.9.0-rc.53 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package printuser renders the user chip that appears inside wikitext output.

Index

Constants

View Source
const (
	AnonAvatar    = "/-/static/images/anon_avatar.png"
	DefaultAvatar = "/-/static/images/default_avatar.png"
	WikidotAvatar = "/-/static/images/wikidot_avatar.png"
)
View Source
const (
	TypeNormal  = "normal"
	TypeWikidot = "wikidot"
	TypeSystem  = "system"
	TypeBot     = "bot"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Avatar bool
	Hover  bool
}

type Renderer

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

func New

func New(loc *i18n.Localizer, icon roles.IconLoader) *Renderer

func (*Renderer) Anonymous

func (r *Renderer) Anonymous(opts Options) string

func (*Renderer) External

func (r *Renderer) External(username string, opts Options) string

External is the wd: user nobody imported. The name is normalized as a page name rather than a user name, and the displayed form keeps the original.

func (*Renderer) System

func (r *Renderer) System(opts Options) string

func (*Renderer) Tails

func (r *Renderer) Tails(u User, rs []roles.Role) (roles.Tails, error)

Tails answers the banned and bot cases before roles are consulted at all, so neither state can be hidden by a role configuration.

func (*Renderer) User

func (r *Renderer) User(u User, rs []roles.Role, opts Options) (string, error)

type User

type User struct {
	ID              int64
	Type            string
	Username        string
	WikidotUsername string
	DisplayName     string
	Avatar          string
	IsActive        bool
}

func (User) URLName

func (u User) URLName() string

Jump to

Keyboard shortcuts

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