Documentation
¶
Overview ¶
Package parser extracts URLs from markdown content using goldmark. It supports various markdown link formats including inline links, reference links, images, autolinks, and HTML anchor tags. URLs inside code blocks are ignored.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link struct {
URL string // The actual URL
FilePath string // Which file it was found in
Text string // Link text or alt text for images
// For reference links.
RefName string // Reference name (e.g., "myref" in [text][myref])
Line int // Line number (1-indexed)
Column int // Column position (1-indexed)
Type LinkType // Type of link
RefDefLine int // Line where [ref]: url is defined (0 if not reference)
}
Link represents a URL found in a file.
func ExtractLinks ¶
ExtractLinks reads a file and returns all HTTP/HTTPS links found.
func ExtractLinksFromContent ¶
ExtractLinksFromContent extracts links from markdown content.
func ExtractLinksFromMultipleFiles ¶
ExtractLinksFromMultipleFiles processes multiple files concurrently and returns all links. Uses a worker pool bounded by the number of CPU cores for optimal parallelism.
type LinkType ¶
type LinkType int
LinkType represents the type of link found in markdown.
const ( // LinkTypeInline represents a standard markdown link: [text](url). LinkTypeInline LinkType = iota // LinkTypeReference represents a reference-style link: [text][ref] with [ref]: url. LinkTypeReference // LinkTypeImage represents an image: . LinkTypeImage // LinkTypeAutolink represents a bare URL that's auto-linked. LinkTypeAutolink // LinkTypeHTML represents a link in HTML: <a href="url">. LinkTypeHTML )
Click to show internal directories.
Click to hide internal directories.