format

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompactPostList

func CompactPostList(posts []*reddit.Post, subName string, sort string, after string) string

CompactPostList renders a subreddit listing in compact notation.

func CompactSearchResults

func CompactSearchResults(posts []*reddit.Post, query string, sub string, after string) string

CompactSearchResults renders search results in compact notation.

func CompactSubredditInfo

func CompactSubredditInfo(info *reddit.SubredditInfo) string

CompactSubredditInfo renders subreddit metadata in compact notation.

func CompactThread

func CompactThread(t *reddit.Thread) string

CompactThread renders a thread in tab-delimited compact notation.

func CompactUser

func CompactUser(info *reddit.UserInfo, posts []*reddit.Post, comments []*reddit.Comment) string

CompactUser renders user info and activity in compact notation.

func FormatPostList

func FormatPostList(posts []*reddit.Post, header string, after string) string

FormatPostList renders a numbered list of posts for subreddit listings.

func FormatSearchResults

func FormatSearchResults(posts []*reddit.Post, query string, after string) string

FormatSearchResults renders search results with subreddit names.

func FormatSubredditInfo

func FormatSubredditInfo(info *reddit.SubredditInfo) string

FormatSubredditInfo renders subreddit metadata.

func FormatThread

func FormatThread(t *reddit.Thread) string

FormatThread renders a full post with its comment tree in readable markdown.

func FormatUser

func FormatUser(info *reddit.UserInfo, posts []*reddit.Post, comments []*reddit.Comment) string

FormatUser renders a user profile with recent activity.

func ToJSON

func ToJSON(v any) string

ToJSON serializes any value to indented JSON.

Types

This section is empty.

Jump to

Keyboard shortcuts

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