Documentation ¶
Overview ¶
Post formatting renderer. MUST BE KEPT IN SYNC WITH ts/templates/body.ts!
Template structs, helper routines and context providers. MUST BE KEPT IN SYNC WITH ts/templates/isomorph.ts!
Package templates generates and stores HTML templates
Index ¶
- Constants
- Variables
- func Admin(ss *auth.Session, l string, cs config.BoardConfigs, staff auth.Staff, ...) []byte
- func Board(l, title string, page, total int, ss *auth.Session, catalog bool, ...) []byte
- func CalculateOmit(t common.Thread) (int, int)
- func ChangePassword(l string) string
- func CompileMustache() (err error)
- func ConfigureServer(l string, conf config.ServerConfig) string
- func Landing(ss *auth.Session, l string) []byte
- func Page(ss *auth.Session, l, title, html string, status bool) []byte
- func Stickers(ss *auth.Session, l string, stickHTML []byte) []byte
- func Thread(id uint64, l, board, title string, abbrev bool, ss *auth.Session, ...) []byte
- type BacklinksContext
- type FileContext
- type PostContext
- type PostLinkContext
Constants ¶
View Source
const Extensions = 0 | b.EXTENSION_NO_INTRA_EMPHASIS | b.EXTENSION_FENCED_CODE | b.EXTENSION_AUTOLINK | b.EXTENSION_STRIKETHROUGH | b.EXTENSION_HARD_LINE_BREAK | b.EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK | 0
View Source
const HtmlFlags = 0 | b.HTML_SKIP_HTML | b.HTML_SKIP_STYLE | b.HTML_SKIP_IMAGES | b.HTML_SAFELINK | b.HTML_NOREFERRER_LINKS | b.HTML_HREF_TARGET_BLANK | 0
Variables ¶
View Source
var ( RollQueryRe = regexp.MustCompile(`^(0|[1-9][0-9]?)-([1-9][0-9]?[0-9]?)$`) FlipQueryRe = regexp.MustCompile(`^([1-9][0-9]?)%$`) )
Functions ¶
func Admin ¶
func Admin( ss *auth.Session, l string, cs config.BoardConfigs, staff auth.Staff, bans auth.BanRecords, log auth.ModLogRecords, ) []byte
func CalculateOmit ¶
CalculateOmit returns the omitted post and image counts for a thread
func ChangePassword ¶
ChangePassword renders a form for changing an account's password
func CompileMustache ¶
func CompileMustache() (err error)
func ConfigureServer ¶
func ConfigureServer(l string, conf config.ServerConfig) string
Renders the form for changing server configuration.
Types ¶
type BacklinksContext ¶
type FileContext ¶
type PostContext ¶
type PostContext struct { Lang string ID uint64 TID uint64 Index bool OP bool HasBoard bool Board string Subject string Badge bool Auth string Name string Color string ShowColor bool Time string HasFiles bool Reacts common.Reacts // contains filtered or unexported fields }
func MakePostContext ¶
func (*PostContext) Backlinks ¶
func (ctx *PostContext) Backlinks() string
func (*PostContext) Body ¶
func (ctx *PostContext) Body() string
func (*PostContext) Files ¶
func (ctx *PostContext) Files() (files []string)
func (*PostContext) PostClass ¶
func (ctx *PostContext) PostClass() string
func (PostContext) Render ¶
func (ctx PostContext) Render() string
func (*PostContext) URL ¶
func (ctx *PostContext) URL() (url string)
type PostLinkContext ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.