rdx-github
Optional RDX transform that converts GitHub-style references in text to links.
Usage
use Pipeline;
use GithubReferences;
let root = new
.add
.run;
What it converts
| Source | Output |
|---|---|
#123 |
Link to https://github.com/{repo}/issues/123 |
@username |
Link to https://github.com/username |
abc1234f (7+ hex chars with a letter) |
Link to https://github.com/{repo}/commit/abc1234f |
Configuration
The repository can be set explicitly or read from frontmatter:
// Explicit
new
// From frontmatter (reads `github: owner/repo` field)
from_frontmatter
A custom base_url can be set for GitHub Enterprise:
new.base_url
Behavior
- Skips references inside existing links and images (no nested links)
- Issue references require a non-alphanumeric preceding character to avoid false positives
- User mentions must follow whitespace
- Commit SHAs must be 7-40 hex characters and contain at least one letter
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.