render

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MermaidJS []byte

Functions

func File

func File(path string, opts Options) ([]byte, error)

func Markdown added in v0.2.0

func Markdown(src []byte, opts Options) ([]byte, error)

func Page added in v0.2.0

func Page(doc RenderedDocument, opts Options) ([]byte, error)

func Shell added in v0.2.0

func Shell(title string, opts Options) ([]byte, error)

func TempFilePath

func TempFilePath(sourcePath string) (string, error)

Types

type FileEntry added in v0.2.0

type FileEntry struct {
	Name     string      `json:"name"`
	Path     string      `json:"path,omitempty"`
	Dir      bool        `json:"dir,omitempty"`
	Selected bool        `json:"selected,omitempty"`
	Children []FileEntry `json:"children,omitempty"`
}

type Options

type Options struct {
	WatchMode   bool
	Title       string
	Theme       Theme
	Unsafe      bool
	Contents    bool
	Chat        bool
	ChatToken   string
	ChatAgent   string
	ChatSession string
	DirFiles    []FileEntry
	CurrentFile string
	HasDocument bool
}

type RenderedDocument added in v0.2.0

type RenderedDocument struct {
	Title string
	Body  []byte
	TOC   []TOCEntry
}

func Document added in v0.2.0

func Document(path string, opts Options) (RenderedDocument, error)

type TOCEntry added in v0.1.4

type TOCEntry struct {
	Level int    `json:"level"`
	Text  string `json:"text"`
	ID    string `json:"id"`
}

type Theme

type Theme string
const (
	ThemeDark  Theme = "dark"
	ThemeLight Theme = "light"
)

Jump to

Keyboard shortcuts

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