Help us shape the future of Go! Take the 2026 Go Developer Survey

export

package
v0.1.38 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Background

func Background(theme string) string

Background is a theme's page colour; dark's for a theme it does not have.

func DiagramPage added in v0.1.11

func DiagramPage(source, theme string) ([]byte, error)

DiagramPage is a page of one Mermaid diagram, drawn at its own size on the theme's background: for a preview, which renders it whole and scrolls it.

func Render

func Render(source []byte, format Format, theme string) ([]byte, error)

Render is RenderWith without options: every link as the source has it.

func RenderWith added in v0.1.15

func RenderWith(source []byte, format Format, theme string, options Options) ([]byte, error)

func ThemeOf

func ThemeOf(tuiTheme string) string

ThemeOf is the export theme for a TUI theme: its own where it has one, else dark.

func Themes

func Themes() []string

Themes are the themes an export takes, sorted.

func WriteFile

func WriteFile(destination string, content []byte) error

Types

type Format

type Format string
const (
	HTML Format = "html"
	Text Format = "text"
)

type Options added in v0.1.15

type Options struct {
	// Base is the directory the source's relative links are read from: each becomes the file: URL
	// of the file it names there, so the page's links reach their files wherever it is written. ""
	// writes every link as the source has it.
	Base string
	// SourceSpans puts each block element's source bytes on it (data-src="start-end"), for a
	// view that follows the editor: the GUI's native HTML preview scrolls to the cursor's block.
	SourceSpans bool
}

Options are what a render reads besides the source, its format and its theme.

Directories

Path Synopsis
Package mermaid is mermaid.js, vendored: the diagrams a page draws from its ```mermaid blocks, drawn as the Mermaid project draws them.
Package mermaid is mermaid.js, vendored: the diagrams a page draws from its ```mermaid blocks, drawn as the Mermaid project draws them.

Jump to

Keyboard shortcuts

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