markup

package
v0.0.4-beta.11 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package markup implements lightweight regex-based parsers for markup and style languages: HTML, CSS, SCSS, and Markdown. No tree-sitter dependency — pure Go regex extraction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	Path       string
	Type       string // "link", "script", "import", "url"
	LineNumber int
}

Dependency represents a linked resource.

type Entity

type Entity struct {
	Name      string
	Type      string // "heading", "id", "selector", "rule", "mixin", "variable", "media_query", "link"
	Kind      string
	Signature string
	StartLine int
	EndLine   int
	Parent    string
}

Entity represents a named element extracted from markup.

type ParseResult

type ParseResult struct {
	FilePath     string
	Entities     []*Entity
	Dependencies []*Dependency
}

ParseResult is the output of a markup parse.

func ParseCSS

func ParseCSS(filePath string, content string) *ParseResult

ParseCSS extracts selectors, @import, and @media rules.

func ParseHTML

func ParseHTML(filePath string, content string) *ParseResult

ParseHTML extracts element IDs and linked resources.

func ParseMarkdown

func ParseMarkdown(filePath string, content string) *ParseResult

ParseMarkdown extracts headings and links.

func ParseSCSS

func ParseSCSS(filePath string, content string) *ParseResult

ParseSCSS extracts variables, mixins, selectors, and @import/@use.

Jump to

Keyboard shortcuts

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