md

package
v1.0.80 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DirectionRead  = "read"
	DirectionWrite = "write"
	DirectionBoth  = "both"
)

Functions

This section is empty.

Types

type CodeBlockTransform

type CodeBlockTransform struct {
	FromLang  string `yaml:"from_lang"`
	ToLang    string `yaml:"to_lang"`
	Direction string `yaml:"direction"` // "read": replace ToLang->FromLang when reading, "write": replace FromLang->ToLang when writing, "both": apply both transformations
	Enabled   *bool  `yaml:"enabled"`
}

func (*CodeBlockTransform) CheckDirection

func (c *CodeBlockTransform) CheckDirection(direction string) bool

func (*CodeBlockTransform) GetLang

func (c *CodeBlockTransform) GetLang(direction string) (string, string)

func (*CodeBlockTransform) IsEnabled

func (c *CodeBlockTransform) IsEnabled() bool

IsEnabled returns true if the transform is enabled, false otherwise, defaulting to true if nil

type MDCodeBlockHandler

type MDCodeBlockHandler struct {
}

func (*MDCodeBlockHandler) Handle

func (m *MDCodeBlockHandler) Handle(mdConfig *MDConfig, mdBytes []byte, direction string) []byte

type MDConfig

type MDConfig struct {
	CodeBlockTransforms []CodeBlockTransform `yaml:"code_block_transforms"`
}

type MDHandler

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

func NewMDHandler

func NewMDHandler() *MDHandler

func (*MDHandler) Handle

func (m *MDHandler) Handle(mdConfig *MDConfig, mdBytes []byte, direction string) []byte

type MDNormalizeHandler added in v1.0.72

type MDNormalizeHandler struct {
}

func (*MDNormalizeHandler) Handle added in v1.0.72

func (m *MDNormalizeHandler) Handle(mdConfig *MDConfig, mdBytes []byte, direction string) []byte

type MDSourceHandler

type MDSourceHandler interface {
	Handle(mdCondif *MDConfig, mdBytes []byte, direction string) []byte
}

Jump to

Keyboard shortcuts

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