shell

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: 12 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 shell renders the HTML page that a rendered article is placed into.

Index

Constants

View Source
const (
	SettingsTabBasic    = ""
	SettingsTabEmail    = "email"
	SettingsTabPassword = "password"
	SettingsTabDevices  = "devices"
	SettingsTabNotify   = "notify"
)
View Source
const (
	ProfileTabAbout = ""
	ProfileTabEdits = "edits"
	ProfileTabPosts = "posts"
	ProfileTabPages = "pages"
)

Variables

This section is empty.

Functions

func SystemNotFound

func SystemNotFound(bundle *i18n.Bundle, assets *static.Assets) http.Handler

Types

type Accept

type Accept struct {
	Username  string
	IsWikidot bool
	CSRF      string
	Error     string
	Fatal     bool
}

type ActivityCell

type ActivityCell struct {
	Date  string
	Count int
	Level int
	Blank bool
}

type ActivityMonth

type ActivityMonth struct {
	Column int
	Label  string
}
type Breadcrumb struct {
	URL   string
	Title string
}

type Data

type Data struct {
	SiteName     string
	SiteHeadline string
	SiteTitle    string
	SiteIcon     string

	License string

	OGTitle       string
	OGDescription string
	OGImage       string
	OGURL         string

	NoIndex     bool
	GoogleTagID string

	ThemeURL       string
	NoBaseStyle    bool
	ComputedStyles []string

	NavTop  string
	NavSide string

	Title         string
	Content       string
	Breadcrumbs   []Breadcrumb
	TagCategories []TagCategory

	RevNumber int
	UpdatedAt time.Time
	TimeZone  *time.Location

	LoginStatusConfig string
	OptionsConfig     string
}

Data is one page's worth of shell. NavTop, NavSide and Content arrive as rendered HTML and are written through untouched.

type Device

type Device struct {
	ID       int64
	Name     string
	Site     string
	Address  string
	SignedIn *time.Time
	Seen     time.Time
	Current  bool
}

type Login

type Login struct {
	AuthIcon     string
	SiteTitle    string
	SignupClosed bool

	Username string
	CSRF     string
	Error    string
}

type Mute

type Mute struct {
	ArticleID int64
	ThreadID  int64
	UserID    int64
	Title     string
	URL       string
	Site      string
}

type NotFound

type NotFound struct {
	PageID      string
	AllowCreate bool
	Options     string
}

type Notice

type Notice struct {
	AuthIcon   string
	SiteTitle  string
	Heading    string
	Body       string
	ActionURL  string
	GoURL      string
	ActionText string
	CSRF       string
	LinkURL    string
	LinkText   string
}

type NotifyChoice

type NotifyChoice struct {
	Kind string
	On   bool
}

type PlatformChoice

type PlatformChoice struct {
	Key  string
	Name string
}

type PluginSection

type PluginSection struct {
	Title string
	HTML  string
}

type Profile

type Profile struct {
	ID          int64
	ProfileURL  string
	DisplayName string
	Avatar      string
	Subtitle    string
	AuthIcon    string
	SiteTitle   string

	IsSelf           bool
	Unread           Unread
	CanDirectMessage bool
	IsBlocked        bool
	ActionsConfig    string

	FromWikidot bool
	IsBot       bool
	FullName    string
	Bio         string
	BioHTML     string
	JoinedAt    time.Time
	TimeZone    *time.Location

	Fields     []ProfileField
	Socials    []ProfileSocial
	Activity   *ProfileActivity
	Stats      *ProfileStats
	Trend      *ScoreTrend
	Sites      []SiteChoice
	Years      []YearChoice
	Pins       []ProfilePage
	PinChoices []ProfilePage
	PinPicker  bool
	Folders    []ProfileFolder

	FolderAsked      bool
	OpenFolder       *ProfileFolder
	FolderPagination string
	Pages            []ProfilePage
	PinLimit         int
	CSRF             string

	Tab   string
	Tabs  []ProfileTab
	Roles []ProfileRoles
	Edits ProfileFeed
	Posts ProfileFeed

	PagesFrom, PagesTo string
	PagesPagination    string

	PluginSections []PluginSection
	PluginBadges   []PluginSection
}

type ProfileActivity

type ProfileActivity struct {
	Weeks   [][]ActivityCell
	Months  []ActivityMonth
	Total   int
	Summary string
	From    string
	To      string
}

type ProfileEdit

type ProfileEdit struct {
	AuthIcon    string
	SiteTitle   string
	DisplayName string
	Avatar      string
	ProfileURL  string

	FullName string
	Bio      string
	Unread   Unread
	Notify   []NotifyChoice
	Mutes    []Mute

	Fields    []ProfileField
	Links     []ProfileLinkRow
	Platforms []PlatformChoice
	ShowPins  bool
	ShowStats bool
	ShowTrend bool

	AdvancedEditor bool
	Language       string
	Languages      []i18n.Choice

	Email          string
	EmailVerified  bool
	EmailPending   string
	EmailHeld      string
	EmailHeldUntil *time.Time
	CanRename      bool

	Devices []Device

	Tab  string
	Tabs []ProfileTab

	Said  string
	CSRF  string
	Error string
	Saved bool
}

type ProfileFeed

type ProfileFeed struct {
	Items      []ProfileItem
	Pagination string

	Tab, From, To string
}

type ProfileField

type ProfileField struct {
	Key   string
	Value string
	Href  string
}

type ProfileFlag

type ProfileFlag struct {
	ID   string
	Desc string
}

type ProfileFolder

type ProfileFolder struct {
	Key   string
	Name  string
	URL   string
	Count int
	Pages []ProfilePage
}

type ProfileItem

type ProfileItem struct {
	URL     string
	Title   string
	Site    string
	At      time.Time
	Flags   []ProfileFlag
	Rev     string
	Content string
}

type ProfileLinkRow

type ProfileLinkRow struct {
	Platform string
	Value    string
}

type ProfilePage

type ProfilePage struct {
	ArticleID int64
	Title     string
	URL       string
	Site      string
	At        time.Time
	Pinned    bool
}

type ProfileRoles

type ProfileRoles struct {
	Site  string
	URL   string
	Names string
}

type ProfileSocial

type ProfileSocial struct {
	Name  string
	Value string
	Href  string
	Icon  string
	FA    string
	Color string
}

type ProfileStats

type ProfileStats struct {
	Pages int
	Score string
	Edits int
	Posts int
}

type ProfileTab

type ProfileTab struct {
	Label  string
	URL    string
	Active bool
}

type Reactive

type Reactive struct {
	ThemeURL string
	Config   string
}

type Renderer

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

func New

func New(loc *i18n.Localizer, assets *static.Assets) *Renderer

func (*Renderer) Accept

func (r *Renderer) Accept(d Accept) (string, error)

func (*Renderer) Forbidden

func (r *Renderer) Forbidden(pageID string) (string, error)

func (*Renderer) Login

func (r *Renderer) Login(d Login) (string, error)

func (*Renderer) Missing

func (r *Renderer) Missing(w http.ResponseWriter, req *http.Request, message string)

func (*Renderer) NotFound

func (r *Renderer) NotFound(d NotFound) (string, error)

func (*Renderer) Notice

func (r *Renderer) Notice(d Notice) (string, error)

func (*Renderer) Page

func (r *Renderer) Page(w io.Writer, d Data) error

func (*Renderer) Print

func (r *Renderer) Print(w io.Writer, d Data) error

func (*Renderer) Profile

func (r *Renderer) Profile(d Profile) (string, error)

func (*Renderer) ProfileEdit

func (r *Renderer) ProfileEdit(d ProfileEdit) (string, error)

func (*Renderer) Reactive

func (r *Renderer) Reactive(w io.Writer, d Reactive) error

func (*Renderer) Reset

func (r *Renderer) Reset(d Reset) (string, error)

func (*Renderer) Signup

func (r *Renderer) Signup(d Signup) (string, error)

func (*Renderer) SystemPage

func (r *Renderer) SystemPage(w io.Writer, d System) error

type Reset

type Reset struct {
	Stage     string
	AuthIcon  string
	SiteTitle string
	Help      string
	Email     string
	Finished  bool
	CSRF      string
	Error     string
}

type ScoreTrend

type ScoreTrend struct {
	Path    string
	Zero    float64
	Max     string
	Min     string
	From    string
	To      string
	Current string
	Points  string
}

type Signup

type Signup struct {
	AuthIcon  string
	SiteTitle string
	Notice    string

	Username  string
	Email     string
	IsWikidot bool
	Sent      bool
	Closed    bool
	CSRF      string
	Error     string
}

type SiteChoice

type SiteChoice struct {
	Slug   string
	Title  string
	Picked bool
}

type System

type System struct {
	Title     string
	SiteTitle string
	ThemeURL  string
	Before    string
	Heading   string
	BodyClass string
	BackLink  bool
	Content   string

	Stylesheets []string
}

System is the page the wiki's own pages sit in, which is not the one an article sits in.

type Tag

type Tag struct {
	Name     string
	FullName string
}

func (Tag) Hidden

func (t Tag) Hidden() bool

Hidden marks the tags Wikidot keeps out of the tag block.

type TagCategory

type TagCategory struct {
	Name string
	Tags []Tag
}

type Unread

type Unread struct {
	Notices  int
	Comments int
	Messages int
}

type YearChoice

type YearChoice struct {
	Value  string
	Label  string
	Picked bool
}

Jump to

Keyboard shortcuts

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