html

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package html renders the kage-shape static site from stored records: an inert, self-contained set of pages that look like X and open with the network unplugged (spec §9). No <script>, no on* handlers, no remote fonts — a photograph, not a program. Templates are embedded so the binary needs no asset directory at runtime, and html/template auto-escapes every value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSS

func CSS() []byte

CSS returns the embedded stylesheet bytes so the caller can write it into the repository's _assets directory.

Types

type Renderer

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

Renderer holds the shared context for one repository's pages. It is single-use per render pass and not safe for concurrent pages (it sets the per-page FromPage on the shared context before each build).

func New

func New(tweets []*x.Tweet, assets []repo.Asset, profile *x.User, footer, navTitle string) *Renderer

New builds a renderer over a record set, the localised media, and the profile. footer is the page footer line (carrying the --date capture stamp); navTitle is the repository's display name shown in the top nav.

func (*Renderer) Index

func (r *Renderer) Index(threads []thread.Thread, heading, subheading string) (string, error)

Index renders the repository home at index.html: the profile header (when a profile was captured) followed by a reverse-chronological list of the captured threads and standalone tweets, each linking to its page. heading/subheading label a non-profile capture (a search or a list).

func (*Renderer) ThreadPage

func (r *Renderer) ThreadPage(th thread.Thread) (string, error)

ThreadPage renders a reconstructed conversation at threads/<root>.html.

func (*Renderer) TweetPage

func (r *Renderer) TweetPage(t *x.Tweet) (string, error)

TweetPage renders one tweet as a standalone page at html/<id>.html.

Jump to

Keyboard shortcuts

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