Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTestFile ¶
IsTestFile reports whether the given Markdown path is a test file. Markdown documents have no widely shared test-file convention, so every Markdown file is treated as production content.
func ResolveMarkdownLinkPath ¶
ResolveMarkdownLinkPath resolves a Markdown link target against the source file's directory and returns matching project files.
Static-site generators (VitePress, Docusaurus, Astro Starlight) link between docs with site-absolute URLs ("/guide/foo"). Those don't share the filesystem root, so we resolve them by suffix-matching the supplied project files.
func ResolveMarkdownProjectImports ¶
func ResolveMarkdownProjectImports( absPath string, _ string, _ string, suppliedFiles map[string]bool, contentReader vcs.ContentReader, ) ([]string, error)
ResolveMarkdownProjectImports extracts link targets from a Markdown file and returns the supplied project paths they resolve to.
Types ¶
type MarkdownLink ¶
type MarkdownLink struct {
// contains filtered or unexported fields
}
MarkdownLink represents a link, image, or reference-definition target extracted from a Markdown file.
func MarkdownLinks ¶
func MarkdownLinks(filePath string) ([]MarkdownLink, error)
MarkdownLinks reads a Markdown file and returns its extracted link targets.
func ParseMarkdownLinks ¶
func ParseMarkdownLinks(sourceCode []byte) []MarkdownLink
ParseMarkdownLinks extracts link, image, and reference-definition targets from Markdown source using tree-sitter. Code spans, fenced code blocks, and other non-link content are correctly excluded by the grammar.
func (MarkdownLink) IsImage ¶
func (l MarkdownLink) IsImage() bool
IsImage reports whether the link came from an image syntax (``).
func (MarkdownLink) Path ¶
func (l MarkdownLink) Path() string
Path returns the raw destination text from the Markdown source, with any URL fragment, query string, or surrounding quotes stripped.
type Module ¶
type Module struct{}
func (Module) Extensions ¶
func (Module) IsTestFile ¶
func (Module) IsTestFile(filePath string, _ vcs.ContentReader) bool
func (Module) Maturity ¶
func (Module) Maturity() moduleapi.MaturityLevel