A Quarto extension that automatically converts Git hosting platform references (issues, pull requests, commits, users) into clickable links. Supports GitHub, GitLab, Codeberg, Gitea, and Bitbucket.
quarto add mcanouil/quarto-gitlinkThis will install the extension under the _extensions subdirectory.
If you're using version control, you will want to check in this directory.
Add the extension to your document's YAML front matter:
---
title: "My Document"
filters:
- path: gitlink
at: post-quarto
extensions:
gitlink:
platform: github # Platform: github, gitlab, codeberg, gitea, bitbucket
base-url: https://github.com # Base URL (optional, auto-detected from platform)
repository-name: owner/repo # Repository name for relative references
----
Old (<1.8.21):
filters: - quarto - gitlink
-
New (>=1.8.21):
filters: - path: gitlink at: post-quarto
extensions:
gitlink:
platform: github
base-url: https://github.com
repository-name: owner/repoReferences:
- Issues/PRs:
#123,owner/repo#123 - Commits:
a5c3785,owner/repo@a5c3785 - Users:
@username
extensions:
gitlink:
platform: gitlab
base-url: https://gitlab.com
repository-name: group/projectReferences:
- Issues:
#123,group/project#123 - Merge Requests:
!456,group/project!456 - Commits:
9ba12248,group/project@9ba12248 - Users:
@username
extensions:
gitlink:
platform: codeberg
base-url: https://codeberg.org
repository-name: user/repoReferences:
- Issues/PRs:
#123,user/repo#123(same format for both) - Commits:
e59ff077,user/repo@e59ff077 - Users:
@username
extensions:
gitlink:
platform: gitea
base-url: https://gitea.com
repository-name: user/repoReferences:
- Issues:
#123,user/repo#123 - Pull Requests:
!123,user/repo!123 - Commits:
e59ff077,user/repo@e59ff077 - Users:
@username
extensions:
gitlink:
platform: bitbucket
base-url: https://bitbucket.org
repository-name: workspace/repoReferences:
- Issues/PRs:
#123,workspace/repo#123(same format for both) - Commits:
9cc27f2,workspace/repo@9cc27f2 - Users:
@accountname
The extension automatically processes full URLs and converts them to short references:
Input: https://github.com/owner/repo/issues/123
Output: owner/repo#123 (or #123 if it's the current repository)
If repository-name is not specified, the extension attempts to detect it from the Git remote:
git remote get-url originThis works for most Git hosting platforms and extracts the owner/repo format from URLs like:
https://github.com/owner/repo.gitgit@gitlab.com:group/project.gitssh://git@codeberg.org/user/repo.git
- Supports
GH-123format for issues - Pull requests use same format as issues (
#123) - Automatic 7-character SHA shortening for commits
- Merge requests use
!123format (distinct from issues) - Issues use
#123format - URLs include
/-/in the path structure - Full SHA support with automatic shortening
- Issues and pull requests both use
#123format - Follows Forgejo/Gitea conventions
- Automatic reference linking in comments
- Issues use
#123format - Pull requests use
!123format (GitLab-style) - Supports both internal and external issue trackers
- Actionable references (closes, fixes, etc.)
- Issues and pull requests both use
#123format - Pull request URLs use
/pull-requests/path - Workspace-based repository structure
See issue #123 for details.
Commit a5c3785 fixes the bug.
Thanks @contributor for the review!Related to mcanouil/quarto-github#45
Implemented in microsoft/vscode@9ba12248Check this issue: https://github.com/owner/repo/issues/123
The fix is in: https://gitlab.com/group/project/-/commit/abc1234Here is the source code for a comprehensive example: example.qmd.
Output of example.qmd: