quarto-dev / quarto-dev/quarto-cli

When using `code-tools: source: repo` link to exact commit

Open
#4,819 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement html
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

I think when linking to the source file, it would be nice if the code-tools: source: repo linked to exact commit for that file on GitHub.

For my personal blog, I used to do something like this:

const commit = child_process
  .spawnSync("git", ["log", "-n", "1", "--pretty=format:%H", "--", `${filename}`])
  .stdout.toString();
metadata.source = `https://github.com/kdheepak/blog/blob/${commit}/${filename}`;
Checklist
  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.
  • Please provide the output of quarto check so we know which version of quarto and its dependencies you're running.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by searching the code-tools implementation for the source: repo option and the metadata.source value shown in the issue. Trace how the source-file URL is generated, then verify that it points to the file at its exact Git commit on GitHub rather than a moving branch reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.