parser

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveFilePath

func ResolveFilePath(input string) (string, error)

ResolveFilePath resolves a URL, short path, or file path to an actual file path. Supports:

func WalkParsedFiles added in v0.2.0

func WalkParsedFiles(filters WalkFilters, callback func(*ParsedFile) error) error

WalkParsedFiles walks the gh-md root directory and calls the callback for each parsed file. Returns early if callback returns an error.

Types

type ParsedComment

type ParsedComment struct {
	ID       string // empty = new comment
	Author   string
	Body     string
	ParentID string // for discussion replies (derived from indentation)
}

ParsedComment represents a parsed comment from the markdown file.

type ParsedFile

type ParsedFile struct {
	// From frontmatter
	ID        string
	Owner     string
	Repo      string
	Number    int
	Updated   time.Time // For conflict detection
	State     string    // open/closed from frontmatter
	Author    string
	Assignees []string
	Reviewers []string
	Labels    []string
	Created   time.Time

	// From content
	Title    string
	Body     string
	ItemType github.ItemType
	Comments []ParsedComment // Parsed from comments section

	// Original file path
	FilePath string
}

ParsedFile represents a parsed markdown file.

func ParseFile

func ParseFile(path string) (*ParsedFile, error)

ParseFile parses a markdown file and returns structured data.

type WalkFilters added in v0.2.0

type WalkFilters struct {
	Repo string // "owner/repo" format, empty = all repos
}

WalkFilters specifies which files to include when walking.

Jump to

Keyboard shortcuts

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