markdown

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 25 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(value Markdown) htmlui.Surface

Convert builds Markdown's DOM and stylesheet for an owned HTML surface. Call it when the source/style changes; retained HTML handles stable frames.

func DespawnMarkdown

func DespawnMarkdown(world *ecs.World, entity ecs.Entity) bool

func MarkdownSystem

func MarkdownSystem(name string) ecs.SystemConfig

MarkdownSystem runs the Markdown-to-HTML conversion stage without invoking the complete UI synchronization pipeline. Feature integrations use it when registering the optional runtime extension.

func SetMarkdownVisible

func SetMarkdownVisible(world *ecs.World, entity ecs.Entity, visible bool)

func SpawnMarkdown

func SpawnMarkdown(world *ecs.World, opts MarkdownOptions) ecs.Entity

func SyncSystem

func SyncSystem(name string) ecs.SystemConfig

Types

type Feature

type Feature struct{}

Feature installs Markdown conversion on top of the HTML UI runtime. Keeping it in this package makes Markdown's parser and syntax highlighter a link-time optional dependency.

func (Feature) InstallMarkdown

func (Feature) InstallMarkdown(app *onix.App) error

type Markdown

type Markdown struct {
	Value       string
	Style       MarkdownStyle
	Width       float32
	PassThrough bool
}

Markdown stores authored Markdown. Its rendered HTML lives in the html.Surface component on the same entity.

type MarkdownLayout

type MarkdownLayout = htmlui.Layout

func UpdateMarkdown

func UpdateMarkdown(world *ecs.World, entity ecs.Entity, opts MarkdownOptions) MarkdownLayout

type MarkdownOptions

type MarkdownOptions struct {
	Style       *MarkdownStyle
	Value       string
	Theme       ui.Theme
	X, Y        float32
	Width       float32
	PassThrough bool
}

type MarkdownStyle

type MarkdownStyle struct {
	Font       *onixtext.Font
	BoldFont   *onixtext.Font
	FontSize   float64
	DPI        float64
	StackIndex int
	QuoteWidth float32

	Text            graphics.ColorRGBA
	Quote           graphics.ColorRGBA
	QuoteBackground graphics.ColorRGBA
	Italic          graphics.ColorRGBA
	Strike          graphics.ColorRGBA
	Bold            graphics.ColorRGBA
	Heading         graphics.ColorRGBA
	TableHeader     graphics.ColorRGBA
	Link            graphics.ColorRGBA
	Code            graphics.ColorRGBA
	Math            graphics.ColorRGBA

	CodeBackground        graphics.ColorRGBA
	MathBackground        graphics.ColorRGBA
	TableHeaderBackground graphics.ColorRGBA
	TableOddBackground    graphics.ColorRGBA
	TableEvenBackground   graphics.ColorRGBA
	Radius                ui.CornerRadius
	TableFontSize         float64
	InlineMathFontSize    float64
	DisplayMathFontSize   float64
}

MarkdownStyle controls the stylesheet applied to converted Markdown HTML.

func DefaultMarkdownStyle

func DefaultMarkdownStyle(theme ui.Theme) MarkdownStyle

Jump to

Keyboard shortcuts

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