Turn GitHub pull request references like repo#123 into Markdown links.
An Obsidian plugin that turns GitHub pull request references into Markdown links.
Write a reference like repo#1234, select it, run the Link GitHub pull request command, and it becomes:
[repo#1234](https://github.com/owner/repo/pull/1234)
repo#123
owner/repo#123
repo/pull/123
owner/repo/pull/123
https://github.com/owner/repo/pull/123
repo#123 and repo/pull/123 use the Default GitHub owner from the plugin settings.owner/repo#123, owner/repo/pull/123, and full URLs link to that owner directly, ignoring the default.http or https, include www., and carry extra path segments, query strings, or fragments (e.g. /files or #issuecomment-456). The generated link always points at the pull request itself, so deep-link suffixes are dropped.For repo#123 and owner/repo#123, the selected text is preserved as the link label, so octocat/hello-world#789 becomes:
[octocat/hello-world#789](https://github.com/octocat/hello-world/pull/789)
For /pull/ paths and URLs, the label is rewritten to the short reference form. By default https://github.com/octocat/hello-world/pull/789 becomes:
[hello-world#789](https://github.com/octocat/hello-world/pull/789)
The Owner in link label setting controls whether these rewritten labels include the owner:
repo#123.owner/repo#123.repo#123 for your own repositories, owner/repo#123 for everyone else's.If nothing is selected, the selection does not match a supported format, or no default owner is configured for an ownerless reference, the plugin shows a notice and leaves your text untouched.
main.js and manifest.json from the latest release (or build them yourself, see below).<your-vault>/.obsidian/plugins/github-pr-linker/.main.js and manifest.json into that folder.thequietmind).today#123 or owner/repo#456, a path such as today/pull/123, or paste a pull request URL.Cmd/Ctrl+P) and run Link GitHub pull request.The selection is replaced with a Markdown link to the pull request on GitHub.
Link GitHub pull request.Cmd+Shift+L.Requires Node.js and npm.
npm install
npm run dev — build in watch mode with inline sourcemaps.npm run build — typecheck and produce a minified production main.js.npm test — run the unit tests with Vitest.To test the plugin in a vault, clone this repository into <your-vault>/.obsidian/plugins/github-pr-linker/, run npm install and npm run build, then enable the plugin in Obsidian.