pagerender

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: 16 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 pagerender assembles the engine, the modules and the data layer into the callbacks one request renders with.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveLinks(ctx context.Context, conn *db.DB, result renderer.Result) ([]db.ArticleLink, error)

A name that starts with another site's slug is stored against that site, so the page it names lists this one among its backlinks.

Types

type Deps

type Deps struct {
	DB     *db.DB
	Engine renderer.Renderer
	Icons  roles.IconLoader
	Trust  *proxyheader.Trust
}

func (Deps) Env

func (d Deps) Env(ctx context.Context, loc *i18n.Localizer, site *db.Site, user *db.User) *Env

type Env

type Env struct {
	// contains filtered or unexported fields
}
func (e *Env) Backlinks(source string, info renderer.PageInfo, cb *callbacks.Callbacks) ([]db.ArticleLink, error)

ftml answers with the pages a source pulls in and the pages it points at, in that order. Handing the two back swapped would invert every backlink on the site.

func (*Env) Callbacks

func (e *Env) Callbacks(vars *page.Vars, pc *page.Context) *callbacks.Callbacks

func (*Env) CodeAndHTML

func (e *Env) CodeAndHTML(source string, info renderer.PageInfo, cb *callbacks.Callbacks, mode renderer.Mode) (renderer.Parts, error)

func (*Env) HTML

func (e *Env) HTML(source string, info renderer.PageInfo, cb *callbacks.Callbacks, mode renderer.Mode) (renderer.Result, error)

func (*Env) Message

func (e *Env) Message(source string) (string, error)

func (*Env) ModuleAPI

func (e *Env) ModuleAPI(pc *page.Context, name, method string, params map[string]string) (wikijson.Object, error)

func (*Env) PageInfo

func (e *Env) PageInfo(source *db.Article) (renderer.PageInfo, error)

func (*Env) SetClient

func (e *Env) SetClient(r *http.Request)

Only the layer holding the proxy trust can say which forwarded address to believe.

func (*Env) Text

func (e *Env) Text(source string, info renderer.PageInfo, cb *callbacks.Callbacks, mode renderer.Mode) (renderer.Result, error)

func (*Env) Vars

func (e *Env) Vars(of *db.Article) *page.Vars

Jump to

Keyboard shortcuts

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