parser

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HugoParser

type HugoParser struct {
}

HugoParser parses Hugo-style shortcodes ({{< name param >}}).

func NewHugoParser

func NewHugoParser() *HugoParser

NewHugoParser creates a parser instance.

func (*HugoParser) Extract

func (p *HugoParser) Extract(content string) (string, []interfaces.ParsedShortcode, error)

Extract replaces shortcodes with placeholders and returns both the transformed content and extracted definitions.

func (*HugoParser) Parse

func (p *HugoParser) Parse(content string) ([]interfaces.ParsedShortcode, error)

Parse returns the list of parsed shortcodes in the content.

type WordPressPreprocessor

type WordPressPreprocessor struct{}

WordPressPreprocessor converts WordPress-style shortcodes to Hugo syntax.

func NewWordPressPreprocessor

func NewWordPressPreprocessor() *WordPressPreprocessor

NewWordPressPreprocessor constructs a preprocessor.

func (*WordPressPreprocessor) Process

func (p *WordPressPreprocessor) Process(content string) string

Process rewrites bracket shortcodes into Hugo-style equivalents.

Jump to

Keyboard shortcuts

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