Documentation
¶
Overview ¶
Package ghissue provides a Goldmark extension for GitHub issue and PR references. It transforms references like #123 or owner/repo#123 into clickable links that point to the actual issue or pull request on GitHub.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KindGitHubIssue = ast.NewNodeKind("GitHubIssue")
KindGitHubIssue is a NodeKind of the GitHubIssue node.
Functions ¶
func DetectRepository ¶
func DetectRepository() string
DetectRepository attempts to detect the GitHub repository from git remote
func NewHTMLRenderer ¶
func NewHTMLRenderer(config *Config) renderer.NodeRenderer
NewHTMLRenderer creates a new HTML renderer for GitHub issue/PR references
func NewParser ¶
func NewParser(config *Config) parser.InlineParser
NewParser creates a new inline parser for GitHub issue/PR references
func NewTransformer ¶
func NewTransformer(config *Config) parser.ASTTransformer
NewTransformer creates a new AST transformer for GitHub issue/PR references
Types ¶
type Config ¶
type Config struct {
// Repository is the default repository in the format "owner/repo"
// Used for resolving references like #123
Repository string
// GitHubToken is an optional GitHub personal access token for API calls
// If not provided, unauthenticated requests will be made (rate limited)
GitHubToken string
}
Config holds configuration for the GitHub issue extension
type Extender ¶
type Extender struct {
// contains filtered or unexported fields
}
Extender implements goldmark.Extender to add GitHub issue/PR reference support
type GitHubIssue ¶
type GitHubIssue struct {
ast.BaseInline
// Repository in the format "owner/repo"
// Empty string means use the default repository
Repository []byte
// Number is the issue or PR number
Number []byte
// IsExternal indicates if this was an external reference (owner/repo#123)
// vs an internal reference (#123)
IsExternal bool
}
GitHubIssue represents a GitHub issue or PR reference in markdown
func NewExternalGitHubIssue ¶
func NewExternalGitHubIssue(repo, number []byte) *GitHubIssue
NewExternalGitHubIssue creates a new GitHubIssue node for external references
func NewGitHubIssue ¶
func NewGitHubIssue(repo, number []byte) *GitHubIssue
NewGitHubIssue creates a new GitHubIssue node
func (*GitHubIssue) Dump ¶
func (n *GitHubIssue) Dump(source []byte, level int)
Dump implements Node.Dump
type HTMLRenderer ¶
type HTMLRenderer struct {
// contains filtered or unexported fields
}
HTMLRenderer renders GitHubIssue nodes as HTML links
func (*HTMLRenderer) RegisterFuncs ¶
func (r *HTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)
RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs
type Option ¶
type Option func(*Config)
Option is a functional option for configuring the extension
func WithGitHubToken ¶
WithGitHubToken sets the GitHub API token for authenticated requests
func WithRepository ¶
WithRepository sets the default repository for issue/PR references